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

@trydock/agent-bridge

v0.2.0

Published

Local agent SDK for Dock Connect. Connect a Node.js agent to the Dock desktop worker, receive routed workspace events, ack back, AND send / ask / reply across agents via Dock's REST API. ~5-line API per the Dock Connect PRD v0.4.

Readme

@trydock/agent-bridge

Local agent SDK for Dock Connect.

What this is

The five-line API your local agent needs to receive Dock workspace events in real time:

import { connectToDock } from "@trydock/agent-bridge";

const dock = await connectToDock({
  agentId: "argus-claude-opus",
  token: process.env.DOCK_AGENT_TOKEN!,
  kinds: ["dock", "loop_cap"],
});

dock.on("dock", async (ev) => {
  if (ev.event.action !== "comment.mention") return;
  if (dock.alreadyHandled(ev.cueId)) return;
  // ... do the work via Dock's MCP / REST ...
});

You don't talk to CueAPI directly. You talk to the Dock desktop worker running on localhost:7301. The worker holds a single authenticated WebSocket connection to Cue and fans incoming events out to every agent that registered for a matching subscription kind.

This means:

  • No public URL. Outbound-only; works through NAT, firewalls, corporate networks.
  • Sleep-friendly. Worker reconnects on wake, replays missed events from the last cursor (up to 72 hours; older collapses to a backfill_summary cue).
  • One auth surface. You paste a DOCK_AGENT_TOKEN minted in Dock's settings. The worker validates ownership attestation (your agent must be owned by the user the worker is logged in as) before accepting the registration.
  • Idempotency built in. Lease re-dispatch is real (laptop crash mid-process, lease expires, Cue redelivers). dock.alreadyHandled(cueId) is your guard against duplicate side-effects.

Install

npm install @trydock/agent-bridge

Requires Node ≥ 18 and the Dock desktop app running locally.

Connect

const dock = await connectToDock({
  agentId: "your-agent-id",  // matches an Agent.id row owned by you in Dock
  token: process.env.DOCK_AGENT_TOKEN!,  // minted in Settings → Local Agents
  kinds: [
    "dock",        // workspace events (comment.mention, row.updated, etc.)
    "loop_cap",    // signal when AGENT_LOOP_CAP suppresses a thread
    "topics/research-done",  // any agent-defined topic
  ],
});

On reject the SDK throws a DockBridgeError with a stable code:

| code | When | |---|---| | connect_failed | Worker not reachable. Dock desktop app not running, port mismatch, firewall. | | register_rejected | Token / agentId / ownership attestation failed. The error message carries detail. | | bad_input | Programmer error (missing agentId, empty kinds list). |

Receive

dock.on("dock", async (ev) => {
  // ev.cueId is the idempotency key.
  // ev.event is the underlying Dock workspace event.
  if (dock.alreadyHandled(ev.cueId)) return;
  if (ev.event.action === "comment.mention") {
    await replyTo(ev.event.payload.commentId);
  }
});

dock.on("loop_cap", (info) => {
  // AGENT_LOOP_CAP fired on this thread. Stop awaiting an
  // auto-response; either ping the human or give up cleanly.
  console.log(`thread ${info.threadId} reached loop cap, backing off`);
});

The SDK auto-acks each dock frame after every registered handler completes. If any handler throws, the ack carries outcome: "error" and the worker decides whether to re-dispatch (default: yes, after the lease window).

Disconnect

await dock.disconnect();

Idempotent; safe to call from a process-shutdown handler.

Versioning

Currently v0.2. Adds the agent-to-agent messaging surface on top of the v0.1 connect / on / ack / idempotency baseline.

v0.2 methods (require apiKey on connectToDock):

  • dock.send(target, body) — fire-and-forget message. Stable.
  • dock.reply(inReplyTo, body) — reply to an inbound ask. Stable.
  • dock.ask(target, body, { timeoutMs }) — request/reply with correlation. Experimental — held until [email protected] which ships response_budget_seconds, overdue-event emission, and per-thread loop-cap. The method works against v1.0.0 but you'll want v1.6.0 for production reliability.

Inbound subscription added in v0.2:

  • dock.on("ask", handler) — fires for inbound asks that don't match a pending correlationId (i.e. fresh requests, not replies).

Reference

  • Dock Connect PRD: https://trydock.ai/dock/prd?surface=dock-connect
  • Privacy model (owner-rooted agent identity): https://trydock.ai/dock/agent-identity-spec

License

MIT.