{"_id":"@douglas-agent/sandbank-relay","name":"@douglas-agent/sandbank-relay","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.1":{"name":"@douglas-agent/sandbank-relay","version":"0.2.1","description":"WebSocket relay server for multi-agent communication in Sandbank","license":"MIT","type":"module","homepage":"https://sandbank.dev","repository":{"type":"git","url":"git+https://github.com/Xeonice/sandbank-douglas-agent.git","directory":"packages/relay"},"keywords":["sandbox","ai-agent","relay","websocket","multi-agent"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"dependencies":{"ws":"^8.18.0"},"devDependencies":{"@douglas-agent/sandbank-core":"^0.3.6","@types/ws":"^8.18.0","typescript":"^5.7.3"},"peerDependencies":{"@douglas-agent/sandbank-core":"^0.3.6"},"gitHead":"0589f4137bb7d4e3bafb0f4dd1ef45e50253cd45","_id":"@douglas-agent/sandbank-relay@0.2.1","bugs":{"url":"https://github.com/Xeonice/sandbank-douglas-agent/issues"},"_nodeVersion":"24.15.0","_npmVersion":"11.14.1","dist":{"integrity":"sha512-MH0h/qjKmviDRFrXD8G676wXweKARLX9hSuATo799hKe/G6sOZkrq8qEQKYOs0P367azw54UuAXh2u8P+ZgBhg==","shasum":"447f6b72ab7886a664ad5a2cadfa5ef433a5ccf2","tarball":"https://registry.npmjs.org/@douglas-agent/sandbank-relay/-/sandbank-relay-0.2.1.tgz","fileCount":20,"unpackedSize":43518,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@douglas-agent%2fsandbank-relay@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHWNR78wuevz0QczJ0sJAPTTtEuFoCkzkWIa2Rs5+8zeAiEA80TSqR0wOZKbUqZR1UVfk2jop8sn4EFyfNy1RbKPYoE="}]},"_npmUser":{"name":"douglasdong","email":"ad546971975@gmail.com"},"directories":{},"maintainers":[{"name":"douglasdong","email":"ad546971975@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sandbank-relay_0.2.1_1779268690086_0.8971112615124779"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-20T09:18:09.961Z","0.2.1":"2026-05-20T09:18:10.256Z","modified":"2026-05-20T09:18:10.638Z"},"maintainers":[{"name":"douglasdong","email":"ad546971975@gmail.com"}],"description":"WebSocket relay server for multi-agent communication in Sandbank","homepage":"https://sandbank.dev","keywords":["sandbox","ai-agent","relay","websocket","multi-agent"],"repository":{"type":"git","url":"git+https://github.com/Xeonice/sandbank-douglas-agent.git","directory":"packages/relay"},"bugs":{"url":"https://github.com/Xeonice/sandbank-douglas-agent/issues"},"license":"MIT","readme":"# @douglas-agent/sandbank-relay\n\n> WebSocket relay server for multi-agent communication in [Sandbank](../../README.md).\n\nProvides HTTP (long-polling) and WebSocket transport with JSON-RPC 2.0 protocol for real-time messaging and shared context between sandboxes.\n\n## Install\n\n```bash\npnpm add @douglas-agent/sandbank-relay\n```\n\n## Usage\n\nUsually used internally by `createSession()` from `@douglas-agent/sandbank-core`, but can be started standalone:\n\n```typescript\nimport { startRelay } from '@douglas-agent/sandbank-relay'\n\nconst relay = await startRelay({ port: 4000 })\nconsole.log(relay.wsUrl) // ws://127.0.0.1:4000\n\n// Later...\nawait relay.close()\n```\n\n## Protocol\n\n- **Transport:** HTTP `POST /rpc` + WebSocket, dual-channel\n- **Format:** JSON-RPC 2.0\n- **Auth:** `X-Session-Id` + `X-Auth-Token` headers\n\n### RPC Methods\n\n| Method | Description |\n|--------|-------------|\n| `session.auth` | WebSocket authentication |\n| `message.send` | Point-to-point messaging |\n| `message.broadcast` | Broadcast to all agents |\n| `message.recv` | Pull messages (supports long-polling) |\n| `context.get/set/delete/keys` | Shared context CRUD |\n| `sandbox.complete` | Mark agent as completed |\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-3252efed27921bc67cc5a42415c43ce0"}