npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nanobpm/urban-agent-client

v0.1.14

Published

Worker-side client for the Nano agentic channel (ADR 0056, S9): REGISTER→SERVE, heartbeat/deregister, produce relay bytes, and a local buffer / flush-on-reconnect ring that tolerates a hub outage. Speaks the @nanobpm/agentic wire contract (via its @nanobp

Readme

@nanobpm/urban-agent-client

Worker-side client for the Nano agentic channel (ADR 0056, epic nanobpm/nano-ide#124, slice S9).

A worker uses it — on a connection separate from the C8 job protocol — to join the one app-tier agentic channel: declare a capability and receive its resolved routing tokens, heartbeat/deregister for presence, and stream live terminal / command-stream bytes. It speaks the @nanobpm/agentic wire contract (S0, via its @nanobpm/agentic/protocol subpath) and is held to its shared conformance corpus; it never redefines the contract.

What it does

  • REGISTERSERVE. Declares a capability (an enrolment attribute — never part of a routing token, invariant #3) and resolves the leaf tokens the vocab handshake (S3) hands back.
  • Heartbeat / deregister. Liveness so the registry ages the worker out on TTL (S2); a clean deregister on shutdown.
  • Produce relay bytes. Streams output on the bulk lane with a monotonic per-stream byte offset so the hub-side ring can resume-from-offset (S5).
  • Hub-down tolerance (invariant #6). Everything the worker produces goes through a bounded, QoS-aware outbound ring. The worker keeps producing while the hub is gone; on reconnect the buffer drains in strict lane priority (control > interactive > bulk), so a bulk-output storm never head-of-line-blocks a heartbeat (invariant #5). On overflow the ring sheds the oldest bulk frame first and never drops a control frame to make room for a relay chunk.

Usage

import { connectAgenticChannel } from "@nanobpm/urban-agent-client";

const agent = connectAgenticChannel({ url: process.env.AGENTIC_CHANNEL_URL! });

// REGISTER {capability} → SERVE [leaf tokens]. Capability is an enrolment
// attribute, NOT part of any routing token.
const { serve } = await agent.register({
  capability: { cognition: "high", weight: 3, family: "opus", host: "cli" },
});
// serve === ["planning.spar#red", …] — resolved from the vocab artifact (S3)

agent.heartbeat();                 // liveness; ages out on TTL if it stops (S2)
agent.relay("stdout", "hello\n");  // stream terminal bytes on the relay/bulk lane
// …the client buffers + drains across a hub outage automatically…
agent.deregister("done");          // best-effort deregister, then close

You may register / relay before the channel is open — the frames buffer and drain once it connects.

Options

| option | default | meaning | | --------------------- | ------------------ | -------------------------------------------------------------------- | | url | — | the agentic channel URL (the app's own bound port) | | instance | random UUID | stable instance id carried on every presence frame | | capability | — | capability to (re-)register with; may also be passed to register() | | transport | binary WebSocket | injectable TransportFactory (tests, custom framing) | | bufferCapacity | 1024 | outbound ring size in frames | | heartbeatIntervalMs | 0 (manual) | auto-heartbeat period | | serveTimeoutMs | 30000 | how long register() waits for its SERVE | | reconnect | enabled | backoff policy (initialDelayMs, maxDelayMs, factor) |

Events

onServe, onFrame, onOpen, onClose, onError, onDrain — each returns an unsubscribe function. Decode/validation/transport errors are surfaced via onError and are never thrown: a malformed inbound frame can never crash the worker.

Building blocks

The package also exports its internals for reuse and testing:

  • OutboundRing — the bounded, QoS-aware buffer/flush-on-reconnect ring.
  • websocketTransport / TransportFactory — the transport seam; supply your own to run without a global WebSocket or with custom framing.
  • The S0 contract surface it consumes (encodeFrame, decodeFrame, validatePayload, parseToken, MESSAGE_FAMILIES, QOS_LANES, …), re-exported from @nanobpm/agentic/protocol.

Conformance

npm run test:conformance runs this client against the shared adversarial corpus at @nanobpm/agentic/source/protocol/conformance — golden frames both directions, malformed byte vectors, and routing-token vectors — the same corpus the S0 codec and the cross-repo c8ctl client are held to. It runs from source (no build step) so the repo's conformance CI job exercises the real vectors.

Runtime

Node ≥ 22.6 (which provides a global WebSocket). Ships as source .ts plus a built dist; runs under node --experimental-strip-types like the rest of the Urban stack.