🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

synapse-nats-sdk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

synapse-nats-sdk

Synapse Protocol SDK - Multi-agent systems on NATS with streaming, HTTP bridges, cryptographic ACL, and reputation scoring

latest
Source
npmnpm
Version
2.4.0
Version published
Maintainers
1
Created
Source

Synapse SDK

Build multi-agent systems on NATS with 6 primitives: register, discover, request, respond, emit, subscribe.

Install

npm install synapse-nats-sdk

Quick Start

import Synapse from "synapse-nats-sdk";

// Start Bob (chat agent)
const bob = await Synapse.connect("nats://localhost:4222");
await bob.register({ name: "Bob", capabilities: ["chat"], skills: [{ id: "chat", name: "Chat", description: "Chat with Bob" }] });
bob.onRequest("chat", (payload) => ({ text: `Bob says: ${payload.input.text}` }));

// Start Jeff (discovers Bob and chats)
const jeff = await Synapse.connect("nats://localhost:4222");
const agents = await jeff.discover({ capabilities: ["chat"] });
const result = await jeff.request(agents[0].id, "chat", { text: "Hi Bob!" });
console.log(result.payload.output); // { text: "Bob says: Hi Bob!" }

Streaming (LLM tokens)

// Caller: receives tokens incrementally
for await (const chunk of mesh.streamRequest(agentId, "chat", { message: "explain quantum" })) {
  process.stdout.write(chunk.token); // live streaming
}

// Handler: yields tokens from LLM
mesh.onStreamRequest("chat", async function* (payload) {
  const stream = anthropic.messages.stream({ model: "claude-3-5-sonnet-20241022", ... });
  for await (const event of stream) {
    if (event.type === "content_block_delta") yield { token: event.delta.text };
  }
});

Documentation

Full skill documentation: skills.sh/drolu/synapse-skill/synapse

License

MIT

Keywords

synapse

FAQs

Package last updated on 17 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts