{"_id":"@brightbeamai/chap-coordinator","_rev":"5-63c9b478cd047e477e35fc6a730a4446","name":"@brightbeamai/chap-coordinator","dist-tags":{"latest":"0.2.13"},"versions":{"0.2.8":{"name":"@brightbeamai/chap-coordinator","version":"0.2.8","keywords":["chap","agent","protocol","audit","json-rpc","human-ai","human-agent","review","override","scitt","mcp","a2a"],"author":{"name":"Brightbeam AI","email":"oss@brightbeam.com"},"license":"Apache-2.0","_id":"@brightbeamai/chap-coordinator@0.2.8","maintainers":[{"name":"brightbeamai","email":"eng-admin@brightbeam.com"}],"homepage":"https://github.com/BrightbeamAI/chap","bugs":{"url":"https://github.com/BrightbeamAI/chap/issues"},"dist":{"shasum":"d8311aa2c028bfffb170fbd9d54b806579c04954","tarball":"https://registry.npmjs.org/@brightbeamai/chap-coordinator/-/chap-coordinator-0.2.8.tgz","fileCount":53,"integrity":"sha512-xZqCOJwHij9hSLnTSJ25vs2iUXwTkFDiieWvvJMlkmPIIpznKnw5eE38Sa8pGABPHPMH7oMb2w2mTK08nVq+gQ==","signatures":[{"sig":"MEYCIQC3rbnuhTp5veyX9vXsgwKLkFq94ixzml+syYvGkID8iAIhALJEsOfgL9lzhjtL1D9X85zqpyV+K2NWd1G2bDjB9RK1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":944505},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./api":{"types":"./dist/api.d.ts","import":"./dist/api.js","require":"./dist/api.cjs"},"./patch":{"types":"./dist/patch.d.ts","import":"./dist/patch.js","require":"./dist/patch.cjs"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js","require":"./dist/types.cjs"},"./jsonrpc":{"types":"./dist/jsonrpc.d.ts","import":"./dist/jsonrpc.js","require":"./dist/jsonrpc.cjs"},"./methods":{"types":"./dist/methods.d.ts","import":"./dist/methods.js","require":"./dist/methods.cjs"},"./storage/store":{"types":"./dist/storage/store.d.ts","import":"./dist/storage/store.js","require":"./dist/storage/store.cjs"},"./storage/sqlite":{"types":"./dist/storage/sqlite.d.ts","import":"./dist/storage/sqlite.js","require":"./dist/storage/sqlite.cjs"}},"gitHead":"78b7f8250bbae2d675d1b6d1d6e069b30482abdd","scripts":{"test":"tsx --test tests/*.test.ts","build":"tsup","typecheck":"tsc","check:schemas":"tsx scripts/check-method-coverage.ts","prepublishOnly":"npm run check:schemas && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"brightbeamai","email":"eng-admin@brightbeam.com"},"repository":{"url":"git+https://github.com/BrightbeamAI/chap.git","type":"git","directory":"packages/coordinator"},"_npmVersion":"11.17.0","description":"Collaborative Human-Agent Protocol (CHAP): reference TypeScript implementation. Coordinator with Core + every shipped profile, plus pluggable storage and typed method facade.","directories":{},"_nodeVersion":"26.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.11.0","better-sqlite3":"^12.11.1"},"optionalDependencies":{"better-sqlite3":"^12.11.1"},"_npmOperationalInternal":{"tmp":"tmp/chap-coordinator_0.2.8_1785164583840_0.6236722501411445","host":"s3://npm-registry-packages-npm-production"}},"0.2.9":{"name":"@brightbeamai/chap-coordinator","version":"0.2.9","keywords":["chap","agent","protocol","audit","json-rpc","human-ai","human-agent","review","override","scitt","mcp","a2a"],"author":{"name":"Brightbeam AI","email":"oss@brightbeam.com"},"license":"Apache-2.0","_id":"@brightbeamai/chap-coordinator@0.2.9","maintainers":[{"name":"brightbeamai","email":"eng-admin@brightbeam.com"}],"homepage":"https://github.com/BrightbeamAI/chap","bugs":{"url":"https://github.com/BrightbeamAI/chap/issues"},"dist":{"shasum":"e15b9e1338871b5729624140a96adba084e3aa5e","tarball":"https://registry.npmjs.org/@brightbeamai/chap-coordinator/-/chap-coordinator-0.2.9.tgz","fileCount":53,"integrity":"sha512-1UCNqG1FEdR935rN+Z7ughYr4axY3UISlFyU3O5yyVCOYzizybZv15TZMB++xYMcLwooFXfclduciKJPMDD20w==","signatures":[{"sig":"MEUCIEn36w4UEXU9m0OrfS7ZdxwASFi/iir5e3QujrMn0FMvAiEA7YBAqXkJz350exzYHX3iARv+O68o55MTfagKy9iE71A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":963024},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./api":{"types":"./dist/api.d.ts","import":"./dist/api.js","require":"./dist/api.cjs"},"./patch":{"types":"./dist/patch.d.ts","import":"./dist/patch.js","require":"./dist/patch.cjs"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js","require":"./dist/types.cjs"},"./jsonrpc":{"types":"./dist/jsonrpc.d.ts","import":"./dist/jsonrpc.js","require":"./dist/jsonrpc.cjs"},"./methods":{"types":"./dist/methods.d.ts","import":"./dist/methods.js","require":"./dist/methods.cjs"},"./storage/store":{"types":"./dist/storage/store.d.ts","import":"./dist/storage/store.js","require":"./dist/storage/store.cjs"},"./storage/sqlite":{"types":"./dist/storage/sqlite.d.ts","import":"./dist/storage/sqlite.js","require":"./dist/storage/sqlite.cjs"}},"gitHead":"5c2586af71ff0ce0b7c2b49ad9c2343da649dfbe","scripts":{"test":"tsx --test tests/*.test.ts","build":"tsup","typecheck":"tsc","check:schemas":"tsx scripts/check-method-coverage.ts","prepublishOnly":"npm run check:schemas && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"brightbeamai","email":"eng-admin@brightbeam.com"},"repository":{"url":"git+https://github.com/BrightbeamAI/chap.git","type":"git","directory":"packages/coordinator"},"_npmVersion":"11.17.0","description":"Collaborative Human-Agent Protocol (CHAP): reference TypeScript implementation. Coordinator with Core + every shipped profile, plus pluggable storage and typed method facade.","directories":{},"_nodeVersion":"26.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.11.0","better-sqlite3":"^12.11.1"},"optionalDependencies":{"better-sqlite3":"^12.11.1"},"_npmOperationalInternal":{"tmp":"tmp/chap-coordinator_0.2.9_1786962635676_0.4453674853006717","host":"s3://npm-registry-packages-npm-production"}},"0.2.10":{"name":"@brightbeamai/chap-coordinator","version":"0.2.10","keywords":["chap","agent","protocol","audit","json-rpc","human-ai","human-agent","review","override","scitt","mcp","a2a"],"author":{"name":"Brightbeam AI","email":"oss@brightbeam.com"},"license":"Apache-2.0","_id":"@brightbeamai/chap-coordinator@0.2.10","maintainers":[{"name":"brightbeamai","email":"eng-admin@brightbeam.com"}],"homepage":"https://github.com/BrightbeamAI/chap","bugs":{"url":"https://github.com/BrightbeamAI/chap/issues"},"dist":{"shasum":"71c950c57247f5681ec0fd002dee09f5ed0d0886","tarball":"https://registry.npmjs.org/@brightbeamai/chap-coordinator/-/chap-coordinator-0.2.10.tgz","fileCount":53,"integrity":"sha512-6wO3J9+fnNoGjMIZlhxOspVxUWLqQEzVX8f7opw4ZwrI3R7vLx6LIY6NHVdEaLfZQoIoA5nS/zMpDcTDWoQeMg==","signatures":[{"sig":"MEYCIQDhWzuDTwEF7TF9a727fQAhFGH/fPCdGtnYoM9NxTOgOQIhANJRAA4+5b2GqBbut4iD1c+CmpVy8b+EENwzFQRwMPrA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":999330},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./api":{"types":"./dist/api.d.ts","import":"./dist/api.js","require":"./dist/api.cjs"},"./patch":{"types":"./dist/patch.d.ts","import":"./dist/patch.js","require":"./dist/patch.cjs"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js","require":"./dist/types.cjs"},"./jsonrpc":{"types":"./dist/jsonrpc.d.ts","import":"./dist/jsonrpc.js","require":"./dist/jsonrpc.cjs"},"./methods":{"types":"./dist/methods.d.ts","import":"./dist/methods.js","require":"./dist/methods.cjs"},"./storage/store":{"types":"./dist/storage/store.d.ts","import":"./dist/storage/store.js","require":"./dist/storage/store.cjs"},"./storage/sqlite":{"types":"./dist/storage/sqlite.d.ts","import":"./dist/storage/sqlite.js","require":"./dist/storage/sqlite.cjs"}},"gitHead":"7a4b1b174e63cb312aa0841bb25c30534aa040b6","scripts":{"test":"tsx --test tests/*.test.ts","build":"tsup","typecheck":"tsc","check:schemas":"tsx scripts/check-method-coverage.ts","prepublishOnly":"npm run check:schemas && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"brightbeamai","email":"eng-admin@brightbeam.com"},"repository":{"url":"git+https://github.com/BrightbeamAI/chap.git","type":"git","directory":"packages/coordinator"},"_npmVersion":"11.17.0","description":"Collaborative Human-Agent Protocol (CHAP): reference TypeScript implementation. Coordinator with Core + every shipped profile, plus pluggable storage and typed method facade.","directories":{},"_nodeVersion":"26.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.11.0","better-sqlite3":"^12.11.1"},"optionalDependencies":{"better-sqlite3":"^12.11.1"},"_npmOperationalInternal":{"tmp":"tmp/chap-coordinator_0.2.10_1787244358072_0.5567127721744132","host":"s3://npm-registry-packages-npm-production"}},"0.2.12":{"name":"@brightbeamai/chap-coordinator","version":"0.2.12","keywords":["chap","agent","protocol","audit","json-rpc","human-ai","human-agent","review","override","scitt","mcp","a2a"],"author":{"name":"Brightbeam AI","email":"oss@brightbeam.com"},"license":"Apache-2.0","_id":"@brightbeamai/chap-coordinator@0.2.12","maintainers":[{"name":"brightbeamai","email":"eng-admin@brightbeam.com"}],"homepage":"https://github.com/BrightbeamAI/chap","bugs":{"url":"https://github.com/BrightbeamAI/chap/issues"},"dist":{"shasum":"5bcc2d4facdc07e21a62a9d9d961faefdd51175e","tarball":"https://registry.npmjs.org/@brightbeamai/chap-coordinator/-/chap-coordinator-0.2.12.tgz","fileCount":53,"integrity":"sha512-ia2A8qbwqoQ3mr2tsVCMHqZ3tfKn+7jmQa+S1no9S92B4GYiIrzz8rIiGxnsG0V2Jow37sYqxncIPMhvbxyXzA==","signatures":[{"sig":"MEUCID+rPYxsb8PayM312Du7E+P/AUkC66SgD76C7IrTpRzsAiEA9DyFhrp1Cla9kUsoQrv2iYnXmYDLytJpKDjjg4vYEbk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIHm1Vww66gHnOwUnh0FcpqjXnoC1NYhA3Ik3UZAy/y8UAiB7g9ZWPWSIyPN8w53jEItA8YcSar6k6ZOOqFehhf2qjw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1025418},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./api":{"types":"./dist/api.d.ts","import":"./dist/api.js","require":"./dist/api.cjs"},"./patch":{"types":"./dist/patch.d.ts","import":"./dist/patch.js","require":"./dist/patch.cjs"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js","require":"./dist/types.cjs"},"./jsonrpc":{"types":"./dist/jsonrpc.d.ts","import":"./dist/jsonrpc.js","require":"./dist/jsonrpc.cjs"},"./methods":{"types":"./dist/methods.d.ts","import":"./dist/methods.js","require":"./dist/methods.cjs"},"./storage/store":{"types":"./dist/storage/store.d.ts","import":"./dist/storage/store.js","require":"./dist/storage/store.cjs"},"./storage/sqlite":{"types":"./dist/storage/sqlite.d.ts","import":"./dist/storage/sqlite.js","require":"./dist/storage/sqlite.cjs"}},"gitHead":"d1a1c387739727612b34b9df6402b85ab8eb584b","scripts":{"test":"tsx --test tests/*.test.ts","build":"tsup","typecheck":"tsc","check:schemas":"tsx scripts/check-method-coverage.ts","prepublishOnly":"npm run check:schemas && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"brightbeamai","email":"eng-admin@brightbeam.com"},"repository":{"url":"git+https://github.com/BrightbeamAI/chap.git","type":"git","directory":"packages/coordinator"},"_npmVersion":"11.17.0","description":"Collaborative Human-Agent Protocol (CHAP): reference TypeScript implementation. Coordinator with Core + every shipped profile, plus pluggable storage and typed method facade.","directories":{},"_nodeVersion":"26.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.11.0","better-sqlite3":"^12.11.1"},"optionalDependencies":{"better-sqlite3":"^12.11.1"},"_npmOperationalInternal":{"tmp":"tmp/chap-coordinator_0.2.12_1788735239176_0.7069598911093886","host":"s3://npm-registry-packages-npm-production"}},"0.2.13":{"_id":"@brightbeamai/chap-coordinator@0.2.13","bugs":{"url":"https://github.com/BrightbeamAI/chap/issues"},"dist":{"shasum":"0f8fc275a518caacd68df68de3e8509aff417a9a","tarball":"https://registry.npmjs.org/@brightbeamai/chap-coordinator/-/chap-coordinator-0.2.13.tgz","fileCount":53,"integrity":"sha512-mT8CWR+1Wiezm02Auh0osvRXNEQ7TsUF+Y2qfg1V1HXDp+6wFMG9rmluEef6BVAGsgP4neCEjg95AvpB+ughXQ==","signatures":[{"sig":"MEUCIQD2lIM6SwJFhNU22OCHPRkqcaTtBGvQw4qRz8CRkzNOwAIgamVJqxKpOiXVypEqyVtd9ddV2Vs8tlYyKEbwkeI4NLE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDXdxOHZMWY3oz/M3tN0QzkPf90c6QmTpmxGYx7EbxQ2AIgXZdOQ2Yjm8qwe3JwwfcgjypCHPh1WKtD9Z8AgNTkyCY="}],"unpackedSize":1032658},"main":"./dist/index.cjs","name":"@brightbeamai/chap-coordinator","type":"module","types":"./dist/index.d.ts","author":{"name":"Brightbeam AI","email":"oss@brightbeam.com"},"module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./api":{"types":"./dist/api.d.ts","import":"./dist/api.js","require":"./dist/api.cjs"},"./patch":{"types":"./dist/patch.d.ts","import":"./dist/patch.js","require":"./dist/patch.cjs"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js","require":"./dist/types.cjs"},"./jsonrpc":{"types":"./dist/jsonrpc.d.ts","import":"./dist/jsonrpc.js","require":"./dist/jsonrpc.cjs"},"./methods":{"types":"./dist/methods.d.ts","import":"./dist/methods.js","require":"./dist/methods.cjs"},"./storage/store":{"types":"./dist/storage/store.d.ts","import":"./dist/storage/store.js","require":"./dist/storage/store.cjs"},"./storage/sqlite":{"types":"./dist/storage/sqlite.d.ts","import":"./dist/storage/sqlite.js","require":"./dist/storage/sqlite.cjs"}},"gitHead":"8ac178aac3e9059f62e9c1b030307f530e57a9c6","license":"Apache-2.0","scripts":{"test":"tsx --test tests/*.test.ts","build":"tsup","typecheck":"tsc","check:schemas":"tsx scripts/check-method-coverage.ts","prepublishOnly":"npm run check:schemas && npm run typecheck && npm run test && npm run build"},"version":"0.2.13","_npmUser":{"name":"brightbeamai","email":"eng-admin@brightbeam.com"},"homepage":"https://github.com/BrightbeamAI/chap","keywords":["chap","agent","protocol","audit","json-rpc","human-ai","human-agent","review","override","scitt","mcp","a2a"],"repository":{"url":"git+https://github.com/BrightbeamAI/chap.git","type":"git","directory":"packages/coordinator"},"_npmVersion":"11.17.0","description":"Collaborative Human-Agent Protocol (CHAP): reference TypeScript implementation. Coordinator with Core + every shipped profile, plus pluggable storage and typed method facade.","directories":{},"maintainers":[{"name":"brightbeamai","email":"eng-admin@brightbeam.com"}],"_nodeVersion":"26.5.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.11.0","better-sqlite3":"^12.11.1"},"optionalDependencies":{"better-sqlite3":"^12.11.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chap-coordinator_0.2.13_1788796121214_0.26697553383544625"}}},"time":{"created":"2026-07-27T15:03:03.696Z","modified":"2026-09-07T15:48:41.492Z","0.2.8":"2026-07-27T15:03:04.057Z","0.2.9":"2026-08-17T10:30:35.810Z","0.2.10":"2026-08-20T16:45:58.213Z","0.2.12":"2026-09-06T22:53:59.278Z","0.2.13":"2026-09-07T15:48:41.303Z"},"bugs":{"url":"https://github.com/BrightbeamAI/chap/issues"},"author":{"name":"Brightbeam AI","email":"oss@brightbeam.com"},"license":"Apache-2.0","homepage":"https://github.com/BrightbeamAI/chap","keywords":["chap","agent","protocol","audit","json-rpc","human-ai","human-agent","review","override","scitt","mcp","a2a"],"repository":{"url":"git+https://github.com/BrightbeamAI/chap.git","type":"git","directory":"packages/coordinator"},"description":"Collaborative Human-Agent Protocol (CHAP): reference TypeScript implementation. Coordinator with Core + every shipped profile, plus pluggable storage and typed method facade.","maintainers":[{"name":"brightbeamai","email":"eng-admin@brightbeam.com"}],"readme":"# @brightbeamai/chap-coordinator (TypeScript)\n\nTypeScript reference implementation of the Collaborative Human-Agent Protocol (CHAP).\n\nCovers Core plus every profile, 39 method handlers in total. Spec-aligned\nfield names, error codes, and response shapes against `profiles/*.md`.\nThe Python reference at `packages/coordinator-py/` implements the same\nsurface, so the two interoperate on the same JSON-RPC 2.0 wire.\n\n## Install\n\n```bash\nnpm install @brightbeamai/chap-coordinator\n```\n\nNode 20+ required. No required runtime dependencies; uses Node's built-in\n`crypto` for Ed25519 and JCS. `better-sqlite3` is an optional dependency,\nneeded only for `SqliteStore`.\n\n## Companion packages\n\nThe `@brightbeamai/chap-coordinator` package is the protocol core. Two transport\nadapters ship alongside it for embedding a Coordinator in MCP and\nA2A ecosystems:\n\n- [`@brightbeamai/chap-coordinator-mcp`](https://github.com/BrightbeamAI/chap/tree/main/packages/coordinator-mcp) wraps a Coordinator\n  as an MCP server. Every CHAP method becomes an MCP tool named\n  `chap.<method>`. Reference stdio server at\n  `reference/mcp-server-ts/`. Spec target: MCP 2026-07-28, serving\n  2025-11-25 clients as well.\n- [`@brightbeamai/chap-coordinator-a2a`](https://github.com/BrightbeamAI/chap/tree/main/packages/coordinator-a2a) wraps a Coordinator\n  as an A2A agent. Every CHAP method becomes an `AgentSkill` on the\n  Agent Card. Reference Express server at `reference/a2a-server-ts/`.\n  Spec target: A2A 0.3.0.\n\nInward citation helpers (`wrapMcpToolCall`, `wrapA2aMessageExchange`,\n`contentHash`) are exported from `@brightbeamai/chap-coordinator` directly. They\ntake a completed external event and emit the matching CHAP audit\nentries with input/output hashes.\n\n## Quick start\n\n```typescript\nimport { Coordinator } from \"@brightbeamai/chap-coordinator\";\n\nconst coord = new Coordinator({\n  defaultProfiles: [\"core/1.0\", \"review/1.0\", \"whisper/1.0\"],\n});\n\ncoord.dispatch({\n  jsonrpc: \"2.0\", id: \"1\",\n  method: \"workspace.create\",\n  params: { workspace: \"wsp_demo\" },\n});\n\ncoord.dispatch({\n  jsonrpc: \"2.0\", id: \"2\",\n  method: \"participant.join\",\n  params: { workspace: \"wsp_demo\",\n            from: \"human:me@local\", type: \"human\", role: \"reviewer\" },\n});\n\ncoord.dispatch({\n  jsonrpc: \"2.0\", id: \"3\",\n  method: \"participant.join\",\n  params: { workspace: \"wsp_demo\",\n            from: \"agent:bot\", type: \"agent\", role: \"drafter\" },\n});\n\nconst resp = coord.dispatch({\n  jsonrpc: \"2.0\", id: \"4\",\n  method: \"task.create\",\n  params: {\n    workspace: \"wsp_demo\",\n    from: \"human:me@local\",\n    kind: \"draft_response\",\n    input: { ticket_id: \"INC-1\" },\n    assignee: \"agent:bot\",\n  },\n});\n\nconsole.log(resp.result);  // { task_id: \"tsk_...\", state: \"created\" }\n```\n\n## What is implemented\n\n| Profile               | Methods (per profile spec)                                                                |\n|-----------------------|-------------------------------------------------------------------------------------------|\n| `core/1.0`            | `workspace.create`, `workspace.describe`, `workspace.set_profiles`, `participant.join`, `participant.leave`, `task.create`, `task.update`, `task.complete`, `audit.read`; a task created with `review_required` completes only on a reviewer decision |\n| `review/1.0`          | `review.request`, `decide.approve`, `decide.reject`, `decide.override`, `abstain.declare`, `escalate.raise` |\n| `whisper/1.0`         | `whisper.ask`, `whisper.answer`; lapse hook via `coord.checkWhisperLapses(workspaceId, now?)` |\n| `deliberation/1.0`    | `deliberate.open`, `deliberate.comment`, `deliberate.vote`, `deliberate.close` |\n| `handoff/1.0`         | `handoff.propose`, `handoff.accept`, `handoff.decline`; multi-task; recipient may be a URI or `group:` |\n| `control/1.0`         | `control.pause`, `control.resume`, `control.cancel`, `control.snapshot`, `control.rollback`, `control.supersede`, `control.set_mode_ceiling`; pause/resume take `scope: task/participant/workspace` |\n| `routing/1.0`         | `task.route`, `review.depth`, `escalate.auto`; each emits a `route_decision` artefact |\n| `modes/1.0`           | Mode handling at `task.create`; `trial` mode forces `review_required`; `control.set_mode_ceiling` shared with control/1.0 |\n| `security-signed/1.0` | `participant.rotate_key`, `participant.revoke_key`; top-level `sig` verified at dispatch when `requireSignatures` is true |\n| `audit-scitt/1.0`     | `audit.submit_to_scitt`, `audit.verify_receipt`, `audit.verify_chain`; SCITT statements assembled and passed to a deployment-supplied submitter; local prev-hash chain linkage retained |\n| `identity-oidc/1.0`   | `participant.join` binding via `verifyOidcToken`; `cnf.jwk` pinning, step-up auth via `enforceStepUp` |\n| `identity-vc/1.0`     | `participant.join` binding via `verifyVc`; holder-key pinning |\n\n**39 method handlers in total**, matching the Python reference exactly.\n\n**The review gate.** A task carrying `review_required` does not complete on\n`task.complete`. The call opens a review, holding the submitted output as the\nartefact under review, and only a `decide.*` reaches `completed`. `task.update`\ncannot complete such a task either, and answers `-32602` naming the route\nthrough. Where no reviewer was named, the set is the human members other than\nthe completer and the assignee; a workspace with no eligible human refuses the\ncompletion rather than opening a review nobody can decide. Under `modes/1.0` a\ntrial-mode task has `review_required` set for it.\n\n## Architecture\n\nThe coordinator is transport-agnostic, persistence-agnostic, and\nUI-agnostic. The entry point:\n\n```typescript\nconst response = coord.dispatch(envelope);\n```\n\n`envelope` is a JSON-RPC 2.0 request; `response` is the JSON-RPC 2.0\nresponse. State is held in memory; persist by subscribing with\n`coord.onAudit(listener)`.\n\nReference HTTP bindings:\n- `reference/core/` and `reference/core-plus-review/` (standalone TS\n  servers used by the conformance harness and the demo playground)\n- `reference/python/` (HTTP server using the Python reference)\n\n## Determinism for tests\n\n```typescript\nconst coord = new Coordinator({\n  deterministicIds: true,\n  deterministicClock: true,\n});\n```\n\nULIDs derive from a deterministic counter; the clock advances by a\nfixed step per emission. Useful for golden-file tests.\n\n## Identity binding\n\n```typescript\nconst coord = new Coordinator({\n  verifyOidcToken: (token) => {\n    // Validate against your IdP; return claims dict or null.\n    // Include \"cnf\": { \"jwk\": {...} } to bind a signing key.\n    return { sub: \"...\", auth_time: 1234, cnf: { jwk: {...} } };\n  },\n  verifyVc: (vp) => {\n    // Verify the VP; return subject claims or null.\n    // Include \"cnf_jwk\": {...} to bind a holder key.\n    return { holder: \"did:example:alice\", cnf_jwk: {...} };\n  },\n  enforceStepUp: true,  // require fresh auth_time for privileged methods\n});\n```\n\nIf a `participant.join` envelope includes `oidc_token` or\n`vc_presentation`, the relevant hook is called and the bound key is\nadded to the participant's key history.\n\n## Signed envelopes (security-signed/1.0)\n\n```typescript\nconst coord = new Coordinator({ requireSignatures: true });\n```\n\nEach participant registers one or more JWKs at `participant.join` via\n`jwks: { keys: [...] }`. Senders sign the JCS canonicalisation of the\nenvelope **with the top-level `sig` field removed**, then attach the\nsignature as a top-level `sig: \"ed25519:<kid>:<base64>\"` field. The\nCoordinator looks up the verifying key by `(from, kid, ts)`, so\nhistorical envelopes verify across key rotation.\n\nKey lifecycle:\n- `participant.rotate_key` is signed with the old key; the Coordinator\n  marks `valid_until` on the old key and `valid_from` on the new one.\n- `participant.revoke_key` is an admin operation; envelopes signed\n  with the revoked key after revocation are rejected.\n\nHelpers exported from `@brightbeamai/chap-coordinator`:\n\n```typescript\nimport {\n  deriveKeypair,         // demo: deterministic keypair from a URI\n  signEnvelope,          // sign canonical bytes -> ed25519:<kid>:<b64>\n  verifyEnvelope,        // verify a sig tag against canonical + pubkey\n  publicKeyFromJwk,      // JWK -> Node KeyObject\n} from \"@brightbeamai/chap-coordinator\";\n```\n\n## Routing policies (routing/1.0)\n\nA default policy ships out of the box. Override it with operator hooks:\n\n```typescript\nconst coord = new Coordinator({\n  routingPolicy: (task, candidates) => ({\n    selected: candidates[0],\n    rationale: {\n      policy_id: \"round-robin\",\n      summary: \"first eligible\",\n    },\n  }),\n  reviewDepthPolicy: (task, hints) => ({\n    depth: \"spot_check\",\n    sampling_probability: 0.05,\n    rationale: { policy_id: \"v1\", summary: \"5% sample\" },\n  }),\n  escalationPolicy: (task, hints) => ({\n    escalate: hints.criticality === \"critical\",\n    to: \"group:senior-pool\",\n    triggered_rule: { rule_id: \"esc-crit\", summary: \"criticality=critical\" },\n  }),\n});\n```\n\nEvery call to `task.route`, `review.depth`, and `escalate.auto`\nemits a `route_decision` artefact. `task.route` also updates the\ntask's `assignee`.\n\n## Audit and SCITT (audit-scitt/1.0)\n\nAudit entries are hash-linked when the profile is active.\n`audit.verify_chain` replays the chain locally and confirms\n`prev_hash` continuity. The verdict names the range it covered:\n`status` is `verified` with `ok: true` only when every entry was\nchecked, and `not_evaluated` with `ok: false` when part of the log\nlies outside the chain, which happens when the profile is added to a\nworkspace that already has entries. A broken chain is an error. Read\n`status`, or read `ok` and fail closed.\n\n`audit.submit_to_scitt` builds a SCITT-shaped signed statement for\neach audit entry in the requested range and passes it to a\ndeployment-supplied submitter:\n\n```typescript\nconst coord = new Coordinator({\n  scittSubmitter: (statement) => {\n    // Submit to your SCITT transparency service; return the receipt\n    return { receipt_id: \"...\", log_root: \"...\" };\n  },\n});\n```\n\nWithout a submitter configured, `audit.submit_to_scitt` returns the\nstatements so the caller can submit out-of-band.\n\n## Testing\n\n```bash\nnpm test\n```\n\nThe suite covers Core, every profile, JCS and\nEd25519 conformance vectors, signed-envelope verification, OIDC/VC\nbinding, the inward wrap helpers, and an end-to-end composition test\nexercising every method handler in one workspace.\n\n## Spec fidelity\n\nThis implementation was reviewed against every profile spec under\n`profiles/` and aligned with the documented field names, error codes,\nand response shapes. The full audit notes are in the parent repo's\n[`CHANGELOG.md`](https://github.com/BrightbeamAI/chap/blob/main/CHANGELOG.md), with the 0.2.2 entry covering\nthe original TypeScript expansion and 0.2.3 / 0.2.4 covering the MCP\nand A2A transport additions.\n\n## License\n\nApache 2.0. See the parent repository's [LICENSE](./LICENSE).\n\n## Specification\n\nTracks the spec at\n[github.com/BrightbeamAI/chap/SPECIFICATION.md](https://github.com/BrightbeamAI/chap/blob/main/SPECIFICATION.md).\n","readmeFilename":"README.md"}