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

@brainst0rm/dispatch-sdk

v0.1.0

Published

Programmatic Brainstorm dispatch primitive for autonomous-agent operators (P1.7). Wraps the operator-side WebSocket flow with an async-iterator API for progress events and a typed dispatch() function.

Downloads

165

Readme

@brainst0rm/dispatch-sdk

Programmatic Brainstorm dispatch primitive for autonomous-agent operators (P1.7 milestone).

Wraps the operator-side WebSocket flow with a typed dispatch() function and an async-iterator API for streaming progress events.

When to use this vs. the CLI

  • CLI (brainstorm dispatch) — humans, one-off invocations, terminal output.
  • SDK (@brainst0rm/dispatch-sdk) — autonomous Claude agents, long-running sessions, programmatic consumption of progress and results.

Both speak the same wire protocol; the relay treats them identically per operator.kind ("human" vs "agent").

Usage

import { Dispatcher } from "@brainst0rm/dispatch-sdk";

const dispatcher = new Dispatcher({
  relayUrl: "wss://relay.example.com",
  apiKey: process.env.BRAINSTORM_AGENT_API_KEY!,
  agentId: "agent-soul-abc-123",
  parentHumanId: "[email protected]", // who launched this agent
  tenantId: "tenant-1",
});

await dispatcher.connect();

// Simple: await terminal result
const result = await dispatcher.dispatch({
  tool: "echo",
  params: { message: "hello from agent" },
  targetEndpointId: "ep-uuid-here",
  autoConfirm: true,
});

if (result.status === "completed") {
  console.log(result.payload?.stdout);
}

// Streaming: iterate progress events
const stream = dispatcher.dispatchStreaming({
  tool: "long-running-task",
  params: { foo: "bar" },
  targetEndpointId: "ep-uuid-here",
  autoConfirm: true,
});
for await (const event of stream) {
  if (event.kind === "preview") {
    console.log("preview:", event.preview_summary);
  } else if (event.kind === "progress") {
    console.log(`[${event.fraction ?? "--"}] ${event.message ?? ""}`);
  } else if (event.kind === "result") {
    console.log("done:", event.result.status);
  }
}

await dispatcher.close();

Identity

The SDK is for agent-class operators. Every dispatch carries:

  • operator.kind = "agent"
  • operator.id = agentId (the agent's SOUL)
  • operator.originating_human_id = parentHumanId (mandatory for agent class — preserves the audit chain back to the root human who launched the agent)
  • operator.delegating_principal_id (optional; used when chain depth > 2)

The relay's audit log records both originating_human_id and id, so dispatch decisions made by autonomous agents are always traceable to the human who launched the agent.

Auth

Same HKDF-SHA-256 key derivation as the CLI, scoped to the agent's identity. The relay derives the same HMAC key independently and verifies signatures via operatorHmac in constant time.

The apiKey is issued by the relay during agent provisioning (POST /v1/admin/agent/provision — to be defined in a future iteration; for MVP, an admin static key works). NEVER hardcode in source; load from env or a secrets vault.

Status

P1.7 milestone delivered. Builds against @brainst0rm/relay v0.1.0. Compatible with the wire protocol v3 in docs/endpoint-agent-protocol-v1.md.