{"_id":"@agent-dashboard/protocol","_rev":"5-9f9a2fef87bca7623c8e5c5be7fddc25","name":"@agent-dashboard/protocol","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@agent-dashboard/protocol","version":"0.1.0","_id":"@agent-dashboard/protocol@0.1.0","maintainers":[{"name":"anishgarg019","email":"anishgarg019@gmail.com"}],"dist":{"shasum":"e5ca214a26b7b0c1c36ef4d73b8c9a92b6c93d6a","tarball":"https://registry.npmjs.org/@agent-dashboard/protocol/-/protocol-0.1.0.tgz","fileCount":6,"integrity":"sha512-OAblDvQGGYk704IHEx21uBgpOoA31pEi2p5uV7hB5B8lJXlWSyVICqaVXrH28vdkAGaa5GfLuZ9SDCNtxddCPw==","signatures":[{"sig":"MEQCIGx/FC7GVAdTXWZU0uckkQyEcdGWmoaHkj0Ea9JKBKnsAiBNjkvAe7N6YQkirt9uFG/H1np06ABgbLeqTc2Ol1To6A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22897},"main":"./dist/index.js","type":"module","_from":"file:agent-dashboard-protocol-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"lint":"eslint src","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anishgarg019","email":"anishgarg019@gmail.com"},"_resolved":"/tmp/69706b6f9d11bc96c62a18fde7e6fa8d/agent-dashboard-protocol-0.1.0.tgz","_integrity":"sha512-OAblDvQGGYk704IHEx21uBgpOoA31pEi2p5uV7hB5B8lJXlWSyVICqaVXrH28vdkAGaa5GfLuZ9SDCNtxddCPw==","_npmVersion":"10.8.2","description":"The Generic Agent Protocol — a runtime-agnostic TypeScript contract that any agent runtime can implement to plug into the Agent Dashboard.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/protocol_0.1.0_1777814957184_0.25750043460886274","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agent-dashboard/protocol","version":"0.1.1","_id":"@agent-dashboard/protocol@0.1.1","maintainers":[{"name":"anishgarg019","email":"anishgarg019@gmail.com"}],"dist":{"shasum":"5bf1c7b2d8fd479705ebdd79393dfceb7f0350e0","tarball":"https://registry.npmjs.org/@agent-dashboard/protocol/-/protocol-0.1.1.tgz","fileCount":6,"integrity":"sha512-dHXldN7Gr5/++8nTIcSXav1Hw1LgctzIRauDDgpK5UQKZXx+HDbVe0GaUJFL+ijzBdn5VbQZd5dR+v9/ENkUnQ==","signatures":[{"sig":"MEUCIFb9OkdEGLDFpWuE9DmFvqhRsEhh0RKBx/TwYDud09N7AiEA3bpPMdul9pqdw2m1yZVHLnAxXmYtB9nBsSJR69Ve/Hg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22897},"main":"./dist/index.js","type":"module","_from":"file:agent-dashboard-protocol-0.1.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"lint":"eslint src","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anishgarg019","email":"anishgarg019@gmail.com"},"_resolved":"/tmp/a570cfaf1cecd07ba3836752be80edc7/agent-dashboard-protocol-0.1.1.tgz","_integrity":"sha512-dHXldN7Gr5/++8nTIcSXav1Hw1LgctzIRauDDgpK5UQKZXx+HDbVe0GaUJFL+ijzBdn5VbQZd5dR+v9/ENkUnQ==","_npmVersion":"10.8.2","description":"The Generic Agent Protocol — a runtime-agnostic TypeScript contract that any agent runtime can implement to plug into the Agent Dashboard.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/protocol_0.1.1_1777815296224_0.14219931161572075","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@agent-dashboard/protocol","version":"0.1.2","_id":"@agent-dashboard/protocol@0.1.2","maintainers":[{"name":"anishgarg019","email":"anishgarg019@gmail.com"}],"dist":{"shasum":"edc1712e313454d1173a0c262140f193433613ed","tarball":"https://registry.npmjs.org/@agent-dashboard/protocol/-/protocol-0.1.2.tgz","fileCount":6,"integrity":"sha512-eRvgbsNfYSgByZJ+1VUBahCNwr1pum6gJbGHi88b209Im4Vach6xxc+xcv7SmA6Rf99UpQmwz8/bBeWHuoq/Ew==","signatures":[{"sig":"MEQCIF+3LaKQkc5StxDVwYwgn3dsnzbGr7eItSvQ+wwGEiDzAiBoUFEhy4y2TAbJy6buKlUqTzPdyl4NVEKFA6SNbSezbQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22897},"main":"./dist/index.js","type":"module","_from":"file:agent-dashboard-protocol-0.1.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"lint":"eslint src","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anishgarg019","email":"anishgarg019@gmail.com"},"_resolved":"/tmp/6cb57caac6af118e044360cad85b9cb6/agent-dashboard-protocol-0.1.2.tgz","_integrity":"sha512-eRvgbsNfYSgByZJ+1VUBahCNwr1pum6gJbGHi88b209Im4Vach6xxc+xcv7SmA6Rf99UpQmwz8/bBeWHuoq/Ew==","_npmVersion":"10.8.2","description":"The Generic Agent Protocol — a runtime-agnostic TypeScript contract that any agent runtime can implement to plug into the Agent Dashboard.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/protocol_0.1.2_1777815564921_0.403007515430194","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@agent-dashboard/protocol","version":"0.1.3","_id":"@agent-dashboard/protocol@0.1.3","maintainers":[{"name":"anishgarg019","email":"anishgarg019@gmail.com"}],"dist":{"shasum":"8d8fd61af195c38ed1d71d6e74a300d4d559b4e6","tarball":"https://registry.npmjs.org/@agent-dashboard/protocol/-/protocol-0.1.3.tgz","fileCount":6,"integrity":"sha512-jb9sqlnnlGuM5v+WzOci+U31P5TlZWzDGdWrYJ4yx+mmYe9J1e1fCBFHHTkMZNyZ28f3uFBVYFB3syY1nfZZDQ==","signatures":[{"sig":"MEUCIHoU+aXXyNm2KJLjBgYAjZrr2c/ZGdtea+dvyxg4Qo5EAiEA955KLX5Fkr+4KDVS7dPdM5jtwm5L5+GhhexCR3DG2q4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22897},"main":"./dist/index.js","type":"module","_from":"file:agent-dashboard-protocol-0.1.3.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"lint":"eslint src","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anishgarg019","email":"anishgarg019@gmail.com"},"_resolved":"/tmp/4312632886285bb6c9127eb4e1fc6e64/agent-dashboard-protocol-0.1.3.tgz","_integrity":"sha512-jb9sqlnnlGuM5v+WzOci+U31P5TlZWzDGdWrYJ4yx+mmYe9J1e1fCBFHHTkMZNyZ28f3uFBVYFB3syY1nfZZDQ==","_npmVersion":"10.8.2","description":"The Generic Agent Protocol — a runtime-agnostic TypeScript contract that any agent runtime can implement to plug into the Agent Dashboard.","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/protocol_0.1.3_1777815798203_0.14732837564637258","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@agent-dashboard/protocol","version":"0.1.4","type":"module","engines":{"node":">=20 <24"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","lint":"eslint src","test":"vitest run"},"_id":"@agent-dashboard/protocol@0.1.4","description":"The Generic Agent Protocol — a runtime-agnostic TypeScript contract that any agent runtime can implement to plug into the Agent Dashboard.","_integrity":"sha512-ETV4297+fpdr0ZZ2jt0RIXiDA4jLiVcw8WEx+gSBOTQZmPSptaqokpY0CmBvX9vFvQ7v+8Zi9RuQQzm4JqHBGA==","_resolved":"/tmp/3c76515ba9c04d643f6707229aee8a7f/agent-dashboard-protocol-0.1.4.tgz","_from":"file:agent-dashboard-protocol-0.1.4.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-ETV4297+fpdr0ZZ2jt0RIXiDA4jLiVcw8WEx+gSBOTQZmPSptaqokpY0CmBvX9vFvQ7v+8Zi9RuQQzm4JqHBGA==","shasum":"eb9c9f45e324ea4a1d22e8b23a7e2867ef9d440a","tarball":"https://registry.npmjs.org/@agent-dashboard/protocol/-/protocol-0.1.4.tgz","fileCount":6,"unpackedSize":22901,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCpym3JqjUa7jas+KMapBCMWYsIN78REpSRzQ9qVim2BwIhAJas525PnVAItRd/3h0y8MatxX9GBpaYjaPccMBeul3l"}]},"_npmUser":{"name":"anishgarg019","email":"anishgarg019@gmail.com"},"directories":{},"maintainers":[{"name":"anishgarg019","email":"anishgarg019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/protocol_0.1.4_1779187040828_0.2568135012561181"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-03T13:29:17.073Z","modified":"2026-05-19T10:37:21.095Z","0.1.0":"2026-05-03T13:29:17.342Z","0.1.1":"2026-05-03T13:34:56.403Z","0.1.2":"2026-05-03T13:39:25.099Z","0.1.3":"2026-05-03T13:43:18.350Z","0.1.4":"2026-05-19T10:37:20.954Z"},"description":"The Generic Agent Protocol — a runtime-agnostic TypeScript contract that any agent runtime can implement to plug into the Agent Dashboard.","maintainers":[{"name":"anishgarg019","email":"anishgarg019@gmail.com"}],"readme":"# @agent-dashboard/protocol\n\nThe Generic Agent Protocol — a runtime-agnostic TypeScript contract that any agent\nruntime can implement to plug into the Agent Dashboard.\n\nThis package has **zero runtime dependencies**. Adapters import the type contract,\nimplement it, and emit a closed set of events; the orchestrator does the rest.\n\n## What's in here\n\n- `AgentAdapter` — the interface every runtime adapter implements.\n- `TaskContext`, `TaskHandle` — request/response shapes for `startTask`.\n- `AgentEventType`, `AgentEventPayloadMap` — typed event taxonomy with payload\n  shapes per event. See [events.md](./events.md).\n- `validateAdapter`, `validateEventPayload` — pure runtime guards used by the\n  orchestrator's dynamic loader and the event ingest path.\n- `PROTOCOL_VERSION` — semver string. Bump policy is documented in\n  [`src/version.ts`](./src/version.ts).\n\n## Implementing an adapter\n\nBelow is a minimal \"echo\" adapter that emits a started event, a single tool call,\nand then a completed event. It demonstrates the full lifecycle.\n\n```ts\nimport type {\n  AgentAdapter,\n  AgentEventPayloadMap,\n  AgentEventType,\n  TaskContext,\n  TaskHandle,\n} from '@agent-dashboard/protocol';\n\ntype Listeners = {\n  [E in AgentEventType]?: Set<(p: AgentEventPayloadMap[E]) => void>;\n};\n\nexport const echoAdapter = (): AgentAdapter => {\n  const listeners: Listeners = {};\n\n  const emit = <E extends AgentEventType>(event: E, payload: AgentEventPayloadMap[E]): void => {\n    listeners[event]?.forEach((fn) => fn(payload));\n  };\n\n  return {\n    runtime: 'echo',\n\n    startTask: async (ctx: TaskContext): Promise<TaskHandle> => {\n      const handle: TaskHandle = {\n        agentId: ctx.agentId,\n        runtime: 'echo',\n        pid: null,\n        startedAt: new Date().toISOString(),\n      };\n      const base = { timestamp: handle.startedAt, agentId: ctx.agentId, storyId: ctx.storyId };\n      emit('agent.started', { ...base, runtime: 'echo', pid: null });\n      emit('agent.tool_called', { ...base, tool: 'Echo', arg: ctx.story.title });\n      emit('agent.completed', { ...base, exitCode: 0, summary: 'echoed' });\n      return handle;\n    },\n\n    kill: async () => undefined,\n\n    on: (event, listener) => {\n      const set = (listeners[event] ??= new Set()) as Set<typeof listener>;\n      set.add(listener);\n      return () => set.delete(listener);\n    },\n\n    dispose: async () => undefined,\n  };\n};\n```\n\n## Soft-pause (optional)\n\n`AgentAdapter` exposes an optional `pause(handle)` method (Story 7.1). It's\na best-effort soft signal — the agent should land at its next safe\ncheckpoint without losing in-flight work. Adapters that don't have a\nruntime pause primitive may omit this method entirely or implement it as a\nno-op; the orchestrator won't hang waiting on it.\n\n`pause` is *not* a hard kill. The CLI's `agent-dashboard kill` command\n(separate story) is the destructive path.\n\n## Architecture references\n\n- AD-11 (Generic Agent Protocol) — this contract.\n- AD-12 (Adapter loader) — orchestrator dynamically imports adapters and calls\n  `validateAdapter()` before use.\n- AD-20 (Single-writer) — adapters never write state files; they emit events.\n  The orchestrator (Story 4.3) is the lone state writer.\n\nFor payload-by-payload details, see [events.md](./events.md).\n","readmeFilename":"README.md"}