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

synapse-protocol

v0.2.9

Published

Synapse — audit, observability, conflict detection, intent capture, and reasoning capture for agentic teams that span vendor SDKs. TypeScript SDK.

Readme

synapse-protocol — TypeScript SDK

TypeScript / JavaScript client for the Synapse coordination protocol. Mirrors the Python SDK at sdk-python/.

Pre-alpha. Surface: protocol types, envelope construction, Redis Streams bus client, Agent class, Mock inference adapter. Hosted/native adapters port over once the Python ones stabilize.

Install

npm install synapse-protocol
# or
pnpm add synapse-protocol

Quickstart

import { Agent, Bus, MockAdapter } from "synapse-protocol";

const bus = new Bus({ url: "redis://localhost:6379/0" });
await bus.connect();

const agent = new Agent({
  id: "agent_a",
  session: "my_session",
  backend: new MockAdapter(),
  subscribes: ["auth.*"],
  scopesOwned: ["auth.middleware"],
  bus,
});

const [intentionId, conflicts] = await agent.emitIntention({
  action: { tool: "edit_file", args: { path: "auth/middleware.ts" } },
  scope: ["auth.middleware:w"],
  expected_outcome: "Refactor middleware",
  blocking: true,
});

if (conflicts.length > 0) {
  console.log("Pivot needed:", conflicts[0]?.suggested_resolution);
} else {
  // do the work
  await agent.emitResolution({ intentionId, outcome: "success" });
}

await bus.close();

What's in this version

| Module | Status | |---|---| | types | All 8 message payloads + envelope + capabilities + tenant context | | envelope | makeEnvelope() ULID generator, isUlid() validator | | bus | Redis Streams client (publish, drainInbox, ensureGroup) via ioredis | | agent | Agent class — emitIntention / emitResolution / emitBelief / emitBlock, waitForSignal | | adapters/base | InferenceAdapter interface, StreamHandle, Token, error types, TenantViolation | | adapters/mock | Mock adapter with multi-tenant request_id isolation by default |

Multi-tenant isolation

The Mock adapter (and any future adapter implementing multi_tenant_isolation: "request_id") rejects cross-tenant access on any in-flight request_id:

const owner = { tenant_id: "acme", agent_id: "a1", session_id: "s1" };
const handle = await adapter.startStream([], { tenant: owner });

// An attacker with a different tenant context can't read this stream:
const attacker = { ...handle, tenant: { tenant_id: "evilcorp" } };
for await (const t of adapter.readTokens(attacker)) {
  // throws TenantViolation before yielding
}

Test

npm install
npm test         # vitest run
npm run typecheck

12 tests across envelope construction, ULID validation, mock streaming, inject-and-continue, partial preservation on cancel, and multi-tenant isolation.

Roadmap

| Item | Phase | |---|---| | Hosted adapters (Anthropic, OpenAI, Gemini) | v0.2 | | Local-API (Ollama) | v0.2 | | Native adapters (vLLM-via-Modal RPC) | v0.3 | | Framework integrations (LangChain, Mastra, Vercel AI SDK) | v0.3 |