{"_id":"@anulum/synapse-channel","name":"@anulum/synapse-channel","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anulum/synapse-channel","version":"0.1.0","description":"Official typed TypeScript/JavaScript WebSocket client for the SYNAPSE CHANNEL coordination hub: chat, claims, releases, board, presence, and receipts.","license":"AGPL-3.0-or-later","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"engines":{"node":">=20"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run"},"keywords":["synapse","coordination","multi-agent","websocket","client"],"author":{"name":"Anulum Fortis & Arcane Sapience","email":"protoscience@anulum.li"},"repository":{"type":"git","url":"git+https://github.com/anulum/synapse-channel.git","directory":"clients/js"},"devDependencies":{"typescript":"^5.6.0","vitest":"^3.2.6"},"_id":"@anulum/synapse-channel@0.1.0","gitHead":"8b67b663bcc25eb4009878a177edd97bf18af0da","bugs":{"url":"https://github.com/anulum/synapse-channel/issues"},"homepage":"https://github.com/anulum/synapse-channel#readme","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-rjfm1y+RcNNHtqRDUBx384s8Wt29wAWNNl9NJvzfCg4DD9pIZIRrEB0dlRt75Aa3cPOeZvAmMFAuMbteS0a1mg==","shasum":"e09b608a7532956708f6360483cfe7165bd1221e","tarball":"https://registry.npmjs.org/@anulum/synapse-channel/-/synapse-channel-0.1.0.tgz","fileCount":11,"unpackedSize":37028,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDs9VnxxaWbWrajwb9R66PR3uUlK7PWlRvB2O6VYl2UOAIgNAcKIpDWAFl55ckaI4qeuPP2auXqD+s2L/GJHscboqU="}]},"_npmUser":{"name":"anulum","email":"fortisstudio@gmail.com"},"directories":{},"maintainers":[{"name":"anulum","email":"fortisstudio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/synapse-channel_0.1.0_1784567423056_0.4696108877947551"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-20T17:10:22.945Z","0.1.0":"2026-07-20T17:10:23.388Z","modified":"2026-07-20T17:10:23.556Z"},"maintainers":[{"name":"anulum","email":"fortisstudio@gmail.com"}],"description":"Official typed TypeScript/JavaScript WebSocket client for the SYNAPSE CHANNEL coordination hub: chat, claims, releases, board, presence, and receipts.","homepage":"https://github.com/anulum/synapse-channel#readme","keywords":["synapse","coordination","multi-agent","websocket","client"],"repository":{"type":"git","url":"git+https://github.com/anulum/synapse-channel.git","directory":"clients/js"},"author":{"name":"Anulum Fortis & Arcane Sapience","email":"protoscience@anulum.li"},"bugs":{"url":"https://github.com/anulum/synapse-channel/issues"},"license":"AGPL-3.0-or-later","readme":"<!--\nSPDX-License-Identifier: AGPL-3.0-or-later\nCommercial license available\nCopyright Concepts 1996-2026 Miroslav Sotek. All rights reserved.\nCopyright Code 2020-2026 Miroslav Sotek. All rights reserved.\nORCID: 0009-0009-3560-0851\nContact: www.anulum.li | protoscience@anulum.li\n-->\n\n# SYNAPSE CHANNEL TypeScript/JavaScript client\n\nOfficial typed WebSocket client for the coordination hub. Unlike the read-only Go\nclient, this client speaks the WebSocket mutation protocol: chat, claims,\nreleases, board reads, presence, and receipts. It runs unchanged in the browser\nand in Node 20+ (both expose a global `WebSocket`), with no runtime dependencies.\n\n## Install\n\n```bash\nnpm install @anulum/synapse-channel\n```\n\n## Use\n\n```ts\nimport { SynapseClient, MessageType } from \"@anulum/synapse-channel\";\n\nconst client = new SynapseClient({\n  uri: \"ws://127.0.0.1:8876\",\n  name: \"SYNAPSE-CHANNEL/web-agent\",\n  token: process.env.SYNAPSE_TOKEN, // omit for an open loopback hub\n});\n\nclient.on(MessageType.Chat, (message) => {\n  console.log(`${message.sender}: ${message.payload}`);\n});\nclient.on(MessageType.ClaimDenied, (message) => {\n  console.warn(\"claim denied:\", message.payload);\n});\n\nawait client.connect(); // resolves when the hub welcomes the registration\n\nclient.chat(\"hello from the browser\", { target: \"all\" });\nclient.claim(\"synapse-channel:web\", [\"src/web/**\"]);\nclient.requestBoard();\n// ...later\nclient.release(\"synapse-channel:web\");\nclient.close();\n```\n\n## API\n\n- `new SynapseClient({ uri, name, token?, takeover?, heartbeatIntervalMs?, readyTimeoutMs? })`\n- `connect(): Promise<void>` — opens the socket, registers the identity, resolves on the hub welcome.\n- `on(type, handler)` / `onMessage(handler)` — subscribe by `MessageType` or to every frame; each returns an unsubscribe function.\n- `chat(payload, { target?, channel?, priority? })`,\n  `claim(taskId, paths?, pathIdentity?)`, `release(taskId)`. The optional\n  `ClaimScopeIdentity` is for bridges carrying output from the trusted Python\n  Git/filesystem resolver; its worktree path is sent automatically. Omit it\n  rather than inventing canonical values.\n- `requestBoard()`, `requestWho()`, `requestState()`.\n- `send(type, { target?, payload?, extra? })` for any other protocol frame.\n- `close()`.\n\n## Develop\n\n```bash\ncd clients/js\nnpm install\nnpm run typecheck   # strict tsc\nnpm test            # vitest\nnpm run build       # emit dist/\n```\n\nThis client is a separate npm package; it does not ship inside the Python\n`synapse-channel` distribution.\n","readmeFilename":"README.md","_rev":"1-1c6f4c0be968401ce5ae0e096f40602a"}