claude-code-swarm 0.0.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1176) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/.claude-plugin/plugin.json +8 -0
  3. package/CLAUDE.md +266 -0
  4. package/README.md +108 -1
  5. package/docs/design.md +1181 -0
  6. package/docs/implementation-plan.md +635 -0
  7. package/e2e/helpers/assertions.mjs +162 -0
  8. package/e2e/helpers/cleanup.mjs +48 -0
  9. package/e2e/helpers/cli.mjs +327 -0
  10. package/e2e/helpers/map-mock-server.mjs +121 -0
  11. package/e2e/helpers/workspace.mjs +72 -0
  12. package/e2e/tier1-hooks.test.mjs +176 -0
  13. package/e2e/tier2-skill.test.mjs +146 -0
  14. package/e2e/tier3-coordination.test.mjs +88 -0
  15. package/e2e/tier4-map.test.mjs +203 -0
  16. package/e2e/vitest.config.e2e.mjs +19 -0
  17. package/hooks/hooks.json +107 -0
  18. package/package.json +45 -14
  19. package/plan.md +214 -0
  20. package/references/multi-agent-protocol/.sudocode/issues.jsonl +120 -0
  21. package/references/multi-agent-protocol/.sudocode/specs.jsonl +15 -0
  22. package/references/multi-agent-protocol/LICENSE +21 -0
  23. package/references/multi-agent-protocol/README.md +113 -0
  24. package/references/multi-agent-protocol/docs/00-design-specification.md +496 -0
  25. package/references/multi-agent-protocol/docs/01-open-questions.md +1050 -0
  26. package/references/multi-agent-protocol/docs/02-wire-protocol.md +296 -0
  27. package/references/multi-agent-protocol/docs/03-streaming-semantics.md +252 -0
  28. package/references/multi-agent-protocol/docs/04-error-handling.md +231 -0
  29. package/references/multi-agent-protocol/docs/05-connection-model.md +244 -0
  30. package/references/multi-agent-protocol/docs/06-visibility-permissions.md +243 -0
  31. package/references/multi-agent-protocol/docs/07-federation.md +335 -0
  32. package/references/multi-agent-protocol/docs/08-macro-agent-migration.md +253 -0
  33. package/references/multi-agent-protocol/docs/09-authentication.md +748 -0
  34. package/references/multi-agent-protocol/docs/10-environment-awareness.md +242 -0
  35. package/references/multi-agent-protocol/docs/10-mail-protocol.md +553 -0
  36. package/references/multi-agent-protocol/docs/11-anp-inspired-improvements.md +1079 -0
  37. package/references/multi-agent-protocol/docs/11-trajectory-protocol.md +292 -0
  38. package/references/multi-agent-protocol/docs/12-anp-implementation-plan.md +641 -0
  39. package/references/multi-agent-protocol/docs/agent-iam-integration.md +877 -0
  40. package/references/multi-agent-protocol/docs/agentic-mesh-integration-draft.md +459 -0
  41. package/references/multi-agent-protocol/docs/git-transport-draft.md +251 -0
  42. package/references/multi-agent-protocol/docs-site/Gemfile +22 -0
  43. package/references/multi-agent-protocol/docs-site/README.md +82 -0
  44. package/references/multi-agent-protocol/docs-site/_config.yml +91 -0
  45. package/references/multi-agent-protocol/docs-site/_includes/head_custom.html +20 -0
  46. package/references/multi-agent-protocol/docs-site/_sass/color_schemes/map.scss +42 -0
  47. package/references/multi-agent-protocol/docs-site/_sass/custom/custom.scss +34 -0
  48. package/references/multi-agent-protocol/docs-site/examples/full-integration.md +510 -0
  49. package/references/multi-agent-protocol/docs-site/examples/index.md +138 -0
  50. package/references/multi-agent-protocol/docs-site/examples/simple-chat.md +282 -0
  51. package/references/multi-agent-protocol/docs-site/examples/task-queue.md +399 -0
  52. package/references/multi-agent-protocol/docs-site/getting-started/index.md +98 -0
  53. package/references/multi-agent-protocol/docs-site/getting-started/installation.md +219 -0
  54. package/references/multi-agent-protocol/docs-site/getting-started/overview.md +172 -0
  55. package/references/multi-agent-protocol/docs-site/getting-started/quickstart.md +237 -0
  56. package/references/multi-agent-protocol/docs-site/index.md +136 -0
  57. package/references/multi-agent-protocol/docs-site/protocol/authentication.md +391 -0
  58. package/references/multi-agent-protocol/docs-site/protocol/connection-model.md +376 -0
  59. package/references/multi-agent-protocol/docs-site/protocol/design.md +284 -0
  60. package/references/multi-agent-protocol/docs-site/protocol/error-handling.md +312 -0
  61. package/references/multi-agent-protocol/docs-site/protocol/federation.md +449 -0
  62. package/references/multi-agent-protocol/docs-site/protocol/index.md +129 -0
  63. package/references/multi-agent-protocol/docs-site/protocol/permissions.md +398 -0
  64. package/references/multi-agent-protocol/docs-site/protocol/streaming.md +353 -0
  65. package/references/multi-agent-protocol/docs-site/protocol/wire-protocol.md +369 -0
  66. package/references/multi-agent-protocol/docs-site/sdk/api/agent.md +357 -0
  67. package/references/multi-agent-protocol/docs-site/sdk/api/client.md +380 -0
  68. package/references/multi-agent-protocol/docs-site/sdk/api/index.md +62 -0
  69. package/references/multi-agent-protocol/docs-site/sdk/api/server.md +453 -0
  70. package/references/multi-agent-protocol/docs-site/sdk/api/types.md +468 -0
  71. package/references/multi-agent-protocol/docs-site/sdk/guides/agent.md +375 -0
  72. package/references/multi-agent-protocol/docs-site/sdk/guides/authentication.md +405 -0
  73. package/references/multi-agent-protocol/docs-site/sdk/guides/client.md +352 -0
  74. package/references/multi-agent-protocol/docs-site/sdk/guides/index.md +89 -0
  75. package/references/multi-agent-protocol/docs-site/sdk/guides/server.md +360 -0
  76. package/references/multi-agent-protocol/docs-site/sdk/guides/testing.md +446 -0
  77. package/references/multi-agent-protocol/docs-site/sdk/guides/transports.md +363 -0
  78. package/references/multi-agent-protocol/docs-site/sdk/index.md +206 -0
  79. package/references/multi-agent-protocol/package-lock.json +4230 -0
  80. package/references/multi-agent-protocol/package.json +56 -0
  81. package/references/multi-agent-protocol/schema/meta.json +584 -0
  82. package/references/multi-agent-protocol/schema/schema.json +3067 -0
  83. package/references/openhive/.claude/settings.json +6 -0
  84. package/references/openhive/.dockerignore +54 -0
  85. package/references/openhive/.github/workflows/docker.yml +52 -0
  86. package/references/openhive/.sudocode/issues.jsonl +24 -0
  87. package/references/openhive/.sudocode/specs.jsonl +4 -0
  88. package/references/openhive/CLAUDE.md +88 -0
  89. package/references/openhive/Dockerfile +105 -0
  90. package/references/openhive/README.md +745 -0
  91. package/references/openhive/bin/openhive.js +6 -0
  92. package/references/openhive/cloudbuild.yaml +80 -0
  93. package/references/openhive/deploy/cloud-run.sh +106 -0
  94. package/references/openhive/deploy/openhive.env.example +80 -0
  95. package/references/openhive/deploy/openhive.service +91 -0
  96. package/references/openhive/docker-compose.yml +67 -0
  97. package/references/openhive/docker-entrypoint.sh +117 -0
  98. package/references/openhive/docs/API_MIGRATION.md +176 -0
  99. package/references/openhive/docs/DEPLOYMENT.md +847 -0
  100. package/references/openhive/docs/DESIGN_v1.md +489 -0
  101. package/references/openhive/docs/DESIGN_v2.md +564 -0
  102. package/references/openhive/docs/HEADSCALE_HOSTING_SPEC.md +513 -0
  103. package/references/openhive/docs/HIVE_SYNC_DESIGN.md +2362 -0
  104. package/references/openhive/docs/HIVE_SYNC_IMPLEMENTATION_PLAN.md +1169 -0
  105. package/references/openhive/docs/HOSTING.md +601 -0
  106. package/references/openhive/docs/IMPLEMENTATION_PLAN.md +428 -0
  107. package/references/openhive/docs/LOCAL_SETUP.md +506 -0
  108. package/references/openhive/docs/MACRO_AGENT_ATLAS_EXTENSION.md +351 -0
  109. package/references/openhive/docs/MEMORY_BANK_SYNC_SPEC.md +909 -0
  110. package/references/openhive/docs/PLAN_v1.md +471 -0
  111. package/references/openhive/docs/PLAN_v2.md +623 -0
  112. package/references/openhive/docs/WEBSOCKET.md +267 -0
  113. package/references/openhive/docs/openswarm-bootstrap-token-spec.md +240 -0
  114. package/references/openhive/ecosystem.config.cjs +76 -0
  115. package/references/openhive/fly.toml +63 -0
  116. package/references/openhive/package-lock.json +17640 -0
  117. package/references/openhive/package.json +128 -0
  118. package/references/openhive/packages/openhive-types/package-lock.json +1473 -0
  119. package/references/openhive/packages/openhive-types/package.json +42 -0
  120. package/references/openhive/packages/openhive-types/src/index.ts +36 -0
  121. package/references/openhive/packages/openhive-types/src/map-coordination.ts +92 -0
  122. package/references/openhive/packages/openhive-types/src/map-session-sync.ts +50 -0
  123. package/references/openhive/packages/openhive-types/src/map-sync.ts +68 -0
  124. package/references/openhive/packages/openhive-types/tsconfig.json +15 -0
  125. package/references/openhive/packages/openhive-types/tsconfig.tsbuildinfo +1 -0
  126. package/references/openhive/packages/openhive-types/tsup.config.ts +12 -0
  127. package/references/openhive/railway.json +13 -0
  128. package/references/openhive/railway.toml +24 -0
  129. package/references/openhive/render.yaml +51 -0
  130. package/references/openhive/src/__tests__/auth.test.ts +148 -0
  131. package/references/openhive/src/__tests__/bridge/credentials.test.ts +65 -0
  132. package/references/openhive/src/__tests__/bridge/dal.test.ts +279 -0
  133. package/references/openhive/src/__tests__/bridge/inbound.test.ts +349 -0
  134. package/references/openhive/src/__tests__/bridge/manager.test.ts +419 -0
  135. package/references/openhive/src/__tests__/bridge/mentions.test.ts +83 -0
  136. package/references/openhive/src/__tests__/bridge/outbound.test.ts +209 -0
  137. package/references/openhive/src/__tests__/bridge/slack-adapter.test.ts +276 -0
  138. package/references/openhive/src/__tests__/cli.test.ts +342 -0
  139. package/references/openhive/src/__tests__/config.test.ts +205 -0
  140. package/references/openhive/src/__tests__/coordination/coordination.test.ts +1072 -0
  141. package/references/openhive/src/__tests__/coordination/cross-instance.test.ts +540 -0
  142. package/references/openhive/src/__tests__/coordination/e2e.test.ts +780 -0
  143. package/references/openhive/src/__tests__/data-dir.test.ts +332 -0
  144. package/references/openhive/src/__tests__/db.test.ts +258 -0
  145. package/references/openhive/src/__tests__/discovery.test.ts +288 -0
  146. package/references/openhive/src/__tests__/events/dal.test.ts +371 -0
  147. package/references/openhive/src/__tests__/events/dispatch.test.ts +202 -0
  148. package/references/openhive/src/__tests__/events/e2e.test.ts +528 -0
  149. package/references/openhive/src/__tests__/events/normalizers.test.ts +263 -0
  150. package/references/openhive/src/__tests__/events/router.test.ts +314 -0
  151. package/references/openhive/src/__tests__/events/routes.test.ts +407 -0
  152. package/references/openhive/src/__tests__/follows.test.ts +328 -0
  153. package/references/openhive/src/__tests__/helpers/test-dirs.ts +44 -0
  154. package/references/openhive/src/__tests__/ingest-keys.test.ts +925 -0
  155. package/references/openhive/src/__tests__/map/sync-client-content.test.ts +288 -0
  156. package/references/openhive/src/__tests__/map/sync-client.test.ts +500 -0
  157. package/references/openhive/src/__tests__/map/sync-listener.test.ts +504 -0
  158. package/references/openhive/src/__tests__/middleware/hostname-guard.test.ts +73 -0
  159. package/references/openhive/src/__tests__/migrations.test.ts +260 -0
  160. package/references/openhive/src/__tests__/opentasks/client.test.ts +497 -0
  161. package/references/openhive/src/__tests__/opentasks/discovery.test.ts +283 -0
  162. package/references/openhive/src/__tests__/opentasks/e2e.test.ts +767 -0
  163. package/references/openhive/src/__tests__/routes/agents.test.ts +417 -0
  164. package/references/openhive/src/__tests__/routes/opentasks-content.test.ts +493 -0
  165. package/references/openhive/src/__tests__/routes/resource-content.test.ts +1741 -0
  166. package/references/openhive/src/__tests__/sessions/adapters.test.ts +524 -0
  167. package/references/openhive/src/__tests__/sessions/routes.test.ts +1053 -0
  168. package/references/openhive/src/__tests__/sessions/storage.test.ts +545 -0
  169. package/references/openhive/src/__tests__/sessions/trajectory-checkpoints.test.ts +349 -0
  170. package/references/openhive/src/__tests__/sessions/trajectory-routes.test.ts +290 -0
  171. package/references/openhive/src/__tests__/swarm/config.test.ts +125 -0
  172. package/references/openhive/src/__tests__/swarm/credentials.test.ts +254 -0
  173. package/references/openhive/src/__tests__/swarm/dal.test.ts +290 -0
  174. package/references/openhive/src/__tests__/swarm/e2e.test.ts +827 -0
  175. package/references/openhive/src/__tests__/swarm/fixtures/exit-immediately.js +3 -0
  176. package/references/openhive/src/__tests__/swarm/fixtures/map-server.js +147 -0
  177. package/references/openhive/src/__tests__/swarm/fixtures/sleep-server.js +52 -0
  178. package/references/openhive/src/__tests__/swarm/local-provider.test.ts +279 -0
  179. package/references/openhive/src/__tests__/swarm/manager.test.ts +305 -0
  180. package/references/openhive/src/__tests__/swarm/routes.test.ts +396 -0
  181. package/references/openhive/src/__tests__/swarm/workspace.test.ts +257 -0
  182. package/references/openhive/src/__tests__/swarmhub/client.test.ts +324 -0
  183. package/references/openhive/src/__tests__/swarmhub/config.test.ts +213 -0
  184. package/references/openhive/src/__tests__/swarmhub/connector.test.ts +581 -0
  185. package/references/openhive/src/__tests__/swarmhub/routes.test.ts +639 -0
  186. package/references/openhive/src/__tests__/swarmhub/slack-client.test.ts +164 -0
  187. package/references/openhive/src/__tests__/swarmhub/slack-connector.test.ts +164 -0
  188. package/references/openhive/src/__tests__/swarmhub/slack-routes.test.ts +373 -0
  189. package/references/openhive/src/__tests__/swarmhub/webhook-handler.test.ts +295 -0
  190. package/references/openhive/src/__tests__/sync/resource-sync.test.ts +1418 -0
  191. package/references/openhive/src/__tests__/sync/sync.test.ts +800 -0
  192. package/references/openhive/src/api/index.ts +65 -0
  193. package/references/openhive/src/api/middleware/auth.ts +227 -0
  194. package/references/openhive/src/api/middleware/hostname-guard.ts +38 -0
  195. package/references/openhive/src/api/routes/admin.ts +366 -0
  196. package/references/openhive/src/api/routes/agents.ts +223 -0
  197. package/references/openhive/src/api/routes/auth.ts +164 -0
  198. package/references/openhive/src/api/routes/bridges.ts +384 -0
  199. package/references/openhive/src/api/routes/comments.ts +294 -0
  200. package/references/openhive/src/api/routes/coordination.ts +312 -0
  201. package/references/openhive/src/api/routes/events.ts +158 -0
  202. package/references/openhive/src/api/routes/federation.ts +367 -0
  203. package/references/openhive/src/api/routes/feed.ts +212 -0
  204. package/references/openhive/src/api/routes/hives.ts +264 -0
  205. package/references/openhive/src/api/routes/map.ts +674 -0
  206. package/references/openhive/src/api/routes/memory-banks.ts +971 -0
  207. package/references/openhive/src/api/routes/posts.ts +342 -0
  208. package/references/openhive/src/api/routes/resource-content.ts +727 -0
  209. package/references/openhive/src/api/routes/resources.ts +1013 -0
  210. package/references/openhive/src/api/routes/search.ts +45 -0
  211. package/references/openhive/src/api/routes/sessions.ts +1187 -0
  212. package/references/openhive/src/api/routes/swarm-hosting.ts +313 -0
  213. package/references/openhive/src/api/routes/sync-protocol.ts +168 -0
  214. package/references/openhive/src/api/routes/sync.ts +279 -0
  215. package/references/openhive/src/api/routes/uploads.ts +174 -0
  216. package/references/openhive/src/api/routes/webhooks.ts +603 -0
  217. package/references/openhive/src/api/schemas/agents.ts +26 -0
  218. package/references/openhive/src/api/schemas/comments.ts +22 -0
  219. package/references/openhive/src/api/schemas/hives.ts +33 -0
  220. package/references/openhive/src/api/schemas/posts.ts +37 -0
  221. package/references/openhive/src/api/schemas/sync.ts +56 -0
  222. package/references/openhive/src/auth/index.ts +2 -0
  223. package/references/openhive/src/auth/jwks.ts +58 -0
  224. package/references/openhive/src/bridge/adapters/slack.ts +306 -0
  225. package/references/openhive/src/bridge/credentials.ts +72 -0
  226. package/references/openhive/src/bridge/inbound.ts +288 -0
  227. package/references/openhive/src/bridge/index.ts +42 -0
  228. package/references/openhive/src/bridge/manager.ts +425 -0
  229. package/references/openhive/src/bridge/mentions.ts +42 -0
  230. package/references/openhive/src/bridge/outbound.ts +103 -0
  231. package/references/openhive/src/bridge/schema.ts +82 -0
  232. package/references/openhive/src/bridge/types.ts +238 -0
  233. package/references/openhive/src/cli/network.ts +480 -0
  234. package/references/openhive/src/cli.ts +620 -0
  235. package/references/openhive/src/config.ts +611 -0
  236. package/references/openhive/src/coordination/index.ts +43 -0
  237. package/references/openhive/src/coordination/listener.ts +92 -0
  238. package/references/openhive/src/coordination/schema.ts +79 -0
  239. package/references/openhive/src/coordination/service.ts +233 -0
  240. package/references/openhive/src/coordination/types.ts +177 -0
  241. package/references/openhive/src/data-dir.ts +105 -0
  242. package/references/openhive/src/db/adapters/index.ts +21 -0
  243. package/references/openhive/src/db/adapters/postgres.ts +310 -0
  244. package/references/openhive/src/db/adapters/sqlite.ts +56 -0
  245. package/references/openhive/src/db/adapters/types.ts +65 -0
  246. package/references/openhive/src/db/dal/agents.ts +430 -0
  247. package/references/openhive/src/db/dal/bridge.ts +336 -0
  248. package/references/openhive/src/db/dal/comments.ts +213 -0
  249. package/references/openhive/src/db/dal/coordination.ts +361 -0
  250. package/references/openhive/src/db/dal/events.ts +381 -0
  251. package/references/openhive/src/db/dal/follows.ts +96 -0
  252. package/references/openhive/src/db/dal/hives.ts +198 -0
  253. package/references/openhive/src/db/dal/ingest-keys.ts +176 -0
  254. package/references/openhive/src/db/dal/instances.ts +196 -0
  255. package/references/openhive/src/db/dal/invites.ts +123 -0
  256. package/references/openhive/src/db/dal/map.ts +750 -0
  257. package/references/openhive/src/db/dal/posts.ts +274 -0
  258. package/references/openhive/src/db/dal/remote-agents.ts +56 -0
  259. package/references/openhive/src/db/dal/search.ts +238 -0
  260. package/references/openhive/src/db/dal/sync-events.ts +160 -0
  261. package/references/openhive/src/db/dal/sync-groups.ts +100 -0
  262. package/references/openhive/src/db/dal/sync-peer-configs.ts +216 -0
  263. package/references/openhive/src/db/dal/sync-peers.ts +145 -0
  264. package/references/openhive/src/db/dal/syncable-resources.ts +888 -0
  265. package/references/openhive/src/db/dal/trajectory-checkpoints.ts +291 -0
  266. package/references/openhive/src/db/dal/uploads.ts +124 -0
  267. package/references/openhive/src/db/dal/votes.ts +124 -0
  268. package/references/openhive/src/db/index.ts +293 -0
  269. package/references/openhive/src/db/providers/index.ts +75 -0
  270. package/references/openhive/src/db/providers/postgres.ts +529 -0
  271. package/references/openhive/src/db/providers/sqlite.ts +1383 -0
  272. package/references/openhive/src/db/providers/turso.ts +1360 -0
  273. package/references/openhive/src/db/providers/types.ts +516 -0
  274. package/references/openhive/src/db/schema.ts +641 -0
  275. package/references/openhive/src/discovery/index.ts +403 -0
  276. package/references/openhive/src/events/dispatch.ts +106 -0
  277. package/references/openhive/src/events/index.ts +17 -0
  278. package/references/openhive/src/events/normalizers/github.ts +133 -0
  279. package/references/openhive/src/events/normalizers/index.ts +62 -0
  280. package/references/openhive/src/events/normalizers/slack.ts +50 -0
  281. package/references/openhive/src/events/router.ts +156 -0
  282. package/references/openhive/src/events/schema.ts +66 -0
  283. package/references/openhive/src/events/types.ts +130 -0
  284. package/references/openhive/src/federation/index.ts +1 -0
  285. package/references/openhive/src/federation/service.ts +776 -0
  286. package/references/openhive/src/headscale/client.ts +256 -0
  287. package/references/openhive/src/headscale/config.ts +212 -0
  288. package/references/openhive/src/headscale/index.ts +23 -0
  289. package/references/openhive/src/headscale/manager.ts +249 -0
  290. package/references/openhive/src/headscale/sync.ts +272 -0
  291. package/references/openhive/src/headscale/types.ts +231 -0
  292. package/references/openhive/src/index.ts +225 -0
  293. package/references/openhive/src/map/client-entry.ts +26 -0
  294. package/references/openhive/src/map/index.ts +76 -0
  295. package/references/openhive/src/map/schema.ts +119 -0
  296. package/references/openhive/src/map/service.ts +323 -0
  297. package/references/openhive/src/map/sync-client.ts +696 -0
  298. package/references/openhive/src/map/sync-listener.ts +409 -0
  299. package/references/openhive/src/map/types.ts +290 -0
  300. package/references/openhive/src/network/factory.ts +118 -0
  301. package/references/openhive/src/network/headscale-provider.ts +437 -0
  302. package/references/openhive/src/network/index.ts +43 -0
  303. package/references/openhive/src/network/tailscale-client.ts +289 -0
  304. package/references/openhive/src/network/tailscale-provider.ts +287 -0
  305. package/references/openhive/src/network/types.ts +178 -0
  306. package/references/openhive/src/opentasks-client/client.ts +374 -0
  307. package/references/openhive/src/opentasks-client/index.ts +7 -0
  308. package/references/openhive/src/realtime/index.ts +282 -0
  309. package/references/openhive/src/server.ts +1069 -0
  310. package/references/openhive/src/services/email.ts +177 -0
  311. package/references/openhive/src/services/sitemap.ts +135 -0
  312. package/references/openhive/src/sessions/adapters/claude.ts +466 -0
  313. package/references/openhive/src/sessions/adapters/codex.ts +265 -0
  314. package/references/openhive/src/sessions/adapters/index.ts +263 -0
  315. package/references/openhive/src/sessions/adapters/raw.ts +144 -0
  316. package/references/openhive/src/sessions/adapters/types.ts +83 -0
  317. package/references/openhive/src/sessions/index.ts +50 -0
  318. package/references/openhive/src/sessions/storage/adapters/gcs.ts +277 -0
  319. package/references/openhive/src/sessions/storage/adapters/local.ts +240 -0
  320. package/references/openhive/src/sessions/storage/adapters/s3.ts +321 -0
  321. package/references/openhive/src/sessions/storage/index.ts +231 -0
  322. package/references/openhive/src/sessions/storage/types.ts +189 -0
  323. package/references/openhive/src/sessions/types.ts +415 -0
  324. package/references/openhive/src/shared/types/index.ts +45 -0
  325. package/references/openhive/src/shared/types/map-coordination.ts +92 -0
  326. package/references/openhive/src/shared/types/map-session-sync.ts +170 -0
  327. package/references/openhive/src/shared/types/map-sync.ts +68 -0
  328. package/references/openhive/src/skill.ts +203 -0
  329. package/references/openhive/src/storage/adapters/local.ts +169 -0
  330. package/references/openhive/src/storage/adapters/s3.ts +195 -0
  331. package/references/openhive/src/storage/index.ts +64 -0
  332. package/references/openhive/src/storage/types.ts +69 -0
  333. package/references/openhive/src/swarm/credentials.ts +98 -0
  334. package/references/openhive/src/swarm/dal.ts +206 -0
  335. package/references/openhive/src/swarm/index.ts +28 -0
  336. package/references/openhive/src/swarm/manager.ts +917 -0
  337. package/references/openhive/src/swarm/providers/local.ts +338 -0
  338. package/references/openhive/src/swarm/providers/sandboxed-local.ts +478 -0
  339. package/references/openhive/src/swarm/providers/workspace.ts +52 -0
  340. package/references/openhive/src/swarm/schema.ts +43 -0
  341. package/references/openhive/src/swarm/types.ts +333 -0
  342. package/references/openhive/src/swarmhub/client.ts +279 -0
  343. package/references/openhive/src/swarmhub/connector.ts +463 -0
  344. package/references/openhive/src/swarmhub/index.ts +43 -0
  345. package/references/openhive/src/swarmhub/routes.ts +296 -0
  346. package/references/openhive/src/swarmhub/types.ts +213 -0
  347. package/references/openhive/src/swarmhub/webhook-handler.ts +126 -0
  348. package/references/openhive/src/sync/compaction.ts +193 -0
  349. package/references/openhive/src/sync/coordination-hooks.ts +154 -0
  350. package/references/openhive/src/sync/crypto.ts +79 -0
  351. package/references/openhive/src/sync/gossip.ts +136 -0
  352. package/references/openhive/src/sync/hooks.ts +202 -0
  353. package/references/openhive/src/sync/materializer-repo.ts +256 -0
  354. package/references/openhive/src/sync/materializer.ts +682 -0
  355. package/references/openhive/src/sync/middleware.ts +140 -0
  356. package/references/openhive/src/sync/peer-resolver.ts +157 -0
  357. package/references/openhive/src/sync/resource-hooks.ts +161 -0
  358. package/references/openhive/src/sync/schema.ts +158 -0
  359. package/references/openhive/src/sync/service.ts +990 -0
  360. package/references/openhive/src/sync/types.ts +369 -0
  361. package/references/openhive/src/terminal/index.ts +4 -0
  362. package/references/openhive/src/terminal/pty-manager.ts +337 -0
  363. package/references/openhive/src/terminal/resolve-tui.ts +44 -0
  364. package/references/openhive/src/terminal/terminal-ws.ts +251 -0
  365. package/references/openhive/src/types.ts +442 -0
  366. package/references/openhive/src/utils/git-remote.ts +329 -0
  367. package/references/openhive/src/web/App.tsx +77 -0
  368. package/references/openhive/src/web/__tests__/components/dashboard/RecentActivity.test.tsx +77 -0
  369. package/references/openhive/src/web/__tests__/components/dashboard/StatsOverview.test.tsx +62 -0
  370. package/references/openhive/src/web/__tests__/components/dashboard/SwarmStatusSummary.test.tsx +122 -0
  371. package/references/openhive/src/web/__tests__/components/dashboard/SyncResourcesStatus.test.tsx +104 -0
  372. package/references/openhive/src/web/__tests__/components/layout/Sidebar.test.tsx +110 -0
  373. package/references/openhive/src/web/__tests__/components/swarm/StatusBadges.test.tsx +65 -0
  374. package/references/openhive/src/web/__tests__/components/terminal/query-responses.test.ts +143 -0
  375. package/references/openhive/src/web/__tests__/components/terminal/terminal-mouse.test.ts +509 -0
  376. package/references/openhive/src/web/__tests__/hooks/useEventsApi.test.ts +378 -0
  377. package/references/openhive/src/web/__tests__/pages/Dashboard.test.tsx +57 -0
  378. package/references/openhive/src/web/__tests__/pages/Events.test.tsx +886 -0
  379. package/references/openhive/src/web/__tests__/pages/Explore.test.tsx +63 -0
  380. package/references/openhive/src/web/__tests__/routing.test.tsx +79 -0
  381. package/references/openhive/src/web/__tests__/setup.ts +37 -0
  382. package/references/openhive/src/web/__tests__/stores/dashboard.test.ts +49 -0
  383. package/references/openhive/src/web/components/common/AgentBadge.tsx +58 -0
  384. package/references/openhive/src/web/components/common/Avatar.tsx +78 -0
  385. package/references/openhive/src/web/components/common/ErrorBoundary.tsx +76 -0
  386. package/references/openhive/src/web/components/common/Highlight.tsx +79 -0
  387. package/references/openhive/src/web/components/common/ImageUpload.tsx +209 -0
  388. package/references/openhive/src/web/components/common/LoadingSpinner.tsx +37 -0
  389. package/references/openhive/src/web/components/common/Logo.tsx +21 -0
  390. package/references/openhive/src/web/components/common/Markdown.tsx +53 -0
  391. package/references/openhive/src/web/components/common/ProtectedRoute.tsx +18 -0
  392. package/references/openhive/src/web/components/common/ThemeToggle.tsx +38 -0
  393. package/references/openhive/src/web/components/common/TimeAgo.tsx +17 -0
  394. package/references/openhive/src/web/components/common/Toast.tsx +70 -0
  395. package/references/openhive/src/web/components/common/VoteButtons.tsx +100 -0
  396. package/references/openhive/src/web/components/dashboard/RecentActivity.tsx +100 -0
  397. package/references/openhive/src/web/components/dashboard/StatsOverview.tsx +40 -0
  398. package/references/openhive/src/web/components/dashboard/SwarmStatusSummary.tsx +89 -0
  399. package/references/openhive/src/web/components/dashboard/SyncResourcesStatus.tsx +81 -0
  400. package/references/openhive/src/web/components/feed/FeedControls.tsx +38 -0
  401. package/references/openhive/src/web/components/feed/NewPostsIndicator.tsx +75 -0
  402. package/references/openhive/src/web/components/feed/PostCard.tsx +129 -0
  403. package/references/openhive/src/web/components/feed/PostList.tsx +83 -0
  404. package/references/openhive/src/web/components/layout/Footer.tsx +5 -0
  405. package/references/openhive/src/web/components/layout/Layout.tsx +29 -0
  406. package/references/openhive/src/web/components/layout/Sidebar.tsx +348 -0
  407. package/references/openhive/src/web/components/post/CommentForm.tsx +59 -0
  408. package/references/openhive/src/web/components/post/CommentTree.tsx +145 -0
  409. package/references/openhive/src/web/components/resources/MemoryBrowser.tsx +208 -0
  410. package/references/openhive/src/web/components/resources/OpenTasksSummary.tsx +138 -0
  411. package/references/openhive/src/web/components/resources/SkillBrowser.tsx +284 -0
  412. package/references/openhive/src/web/components/swarm/StatusBadges.tsx +56 -0
  413. package/references/openhive/src/web/components/terminal/TerminalPanel.tsx +485 -0
  414. package/references/openhive/src/web/components/terminal/index.ts +2 -0
  415. package/references/openhive/src/web/components/terminal/query-responses.ts +70 -0
  416. package/references/openhive/src/web/components/terminal/terminal-mouse.ts +222 -0
  417. package/references/openhive/src/web/hooks/useApi.ts +740 -0
  418. package/references/openhive/src/web/hooks/useDocumentTitle.ts +49 -0
  419. package/references/openhive/src/web/hooks/useInfiniteScroll.ts +58 -0
  420. package/references/openhive/src/web/hooks/useRealtimeUpdates.ts +154 -0
  421. package/references/openhive/src/web/hooks/useWebSocket.ts +225 -0
  422. package/references/openhive/src/web/index.html +73 -0
  423. package/references/openhive/src/web/lib/api.ts +518 -0
  424. package/references/openhive/src/web/main.tsx +32 -0
  425. package/references/openhive/src/web/pages/About.tsx +131 -0
  426. package/references/openhive/src/web/pages/Agent.tsx +130 -0
  427. package/references/openhive/src/web/pages/Agents.tsx +69 -0
  428. package/references/openhive/src/web/pages/AuthCallback.tsx +75 -0
  429. package/references/openhive/src/web/pages/Dashboard.tsx +41 -0
  430. package/references/openhive/src/web/pages/Events.tsx +1025 -0
  431. package/references/openhive/src/web/pages/Explore.tsx +43 -0
  432. package/references/openhive/src/web/pages/Hive.tsx +134 -0
  433. package/references/openhive/src/web/pages/Hives.tsx +64 -0
  434. package/references/openhive/src/web/pages/Home.tsx +43 -0
  435. package/references/openhive/src/web/pages/Login.tsx +122 -0
  436. package/references/openhive/src/web/pages/Post.tsx +216 -0
  437. package/references/openhive/src/web/pages/ResourceDetail.tsx +426 -0
  438. package/references/openhive/src/web/pages/Resources.tsx +276 -0
  439. package/references/openhive/src/web/pages/Search.tsx +234 -0
  440. package/references/openhive/src/web/pages/SessionDetail.tsx +703 -0
  441. package/references/openhive/src/web/pages/Sessions.tsx +129 -0
  442. package/references/openhive/src/web/pages/Settings.tsx +826 -0
  443. package/references/openhive/src/web/pages/SwarmCraft.tsx +16 -0
  444. package/references/openhive/src/web/pages/Swarms.tsx +981 -0
  445. package/references/openhive/src/web/pages/Terminal.tsx +69 -0
  446. package/references/openhive/src/web/postcss.config.js +5 -0
  447. package/references/openhive/src/web/public/favicon.svg +11 -0
  448. package/references/openhive/src/web/public/manifest.json +21 -0
  449. package/references/openhive/src/web/stores/auth.ts +207 -0
  450. package/references/openhive/src/web/stores/dashboard.ts +23 -0
  451. package/references/openhive/src/web/stores/realtime.ts +90 -0
  452. package/references/openhive/src/web/stores/theme.ts +70 -0
  453. package/references/openhive/src/web/stores/toast.ts +63 -0
  454. package/references/openhive/src/web/styles/globals.css +503 -0
  455. package/references/openhive/src/web/sw.ts +228 -0
  456. package/references/openhive/src/web/utils/serviceWorker.ts +86 -0
  457. package/references/openhive/src/web/vite.config.ts +81 -0
  458. package/references/openhive/tsconfig.json +32 -0
  459. package/references/openhive/tsup.config.ts +17 -0
  460. package/references/openhive/vitest.config.ts +30 -0
  461. package/references/openhive/vitest.web.config.ts +20 -0
  462. package/references/opentasks/.claude/settings.json +6 -0
  463. package/references/opentasks/.claude-plugin/plugin.json +20 -0
  464. package/references/opentasks/.lintstagedrc.json +4 -0
  465. package/references/opentasks/.prettierignore +4 -0
  466. package/references/opentasks/.prettierrc.json +11 -0
  467. package/references/opentasks/.sudocode/issues.jsonl +89 -0
  468. package/references/opentasks/.sudocode/specs.jsonl +24 -0
  469. package/references/opentasks/README.md +401 -0
  470. package/references/opentasks/docs/ARCHITECTURE.md +841 -0
  471. package/references/opentasks/docs/DESIGN.md +689 -0
  472. package/references/opentasks/docs/INTERFACE.md +670 -0
  473. package/references/opentasks/docs/PERSISTENCE.md +1638 -0
  474. package/references/opentasks/docs/PROVIDERS.md +1412 -0
  475. package/references/opentasks/docs/SCHEMA.md +815 -0
  476. package/references/opentasks/docs/TESTING.md +1081 -0
  477. package/references/opentasks/eslint.config.js +58 -0
  478. package/references/opentasks/package-lock.json +4348 -0
  479. package/references/opentasks/package.json +81 -0
  480. package/references/opentasks/skills/opentasks/SKILL.md +139 -0
  481. package/references/opentasks/skills/opentasks/dependency-management.md +119 -0
  482. package/references/opentasks/skills/opentasks/feedback-and-review.md +100 -0
  483. package/references/opentasks/skills/opentasks/linking-external-data.md +103 -0
  484. package/references/opentasks/skills/opentasks/spec-to-implementation.md +98 -0
  485. package/references/opentasks/src/__tests__/cli-tools.test.ts +800 -0
  486. package/references/opentasks/src/__tests__/cli.test.ts +97 -0
  487. package/references/opentasks/src/__tests__/p1-p3-gaps.test.ts +635 -0
  488. package/references/opentasks/src/cli.ts +929 -0
  489. package/references/opentasks/src/client/__tests__/client-crud.test.ts +546 -0
  490. package/references/opentasks/src/client/__tests__/client.test.ts +658 -0
  491. package/references/opentasks/src/client/__tests__/socket-discovery.test.ts +122 -0
  492. package/references/opentasks/src/client/client.ts +560 -0
  493. package/references/opentasks/src/client/index.ts +32 -0
  494. package/references/opentasks/src/config/__tests__/defaults.test.ts +66 -0
  495. package/references/opentasks/src/config/__tests__/env.test.ts +155 -0
  496. package/references/opentasks/src/config/__tests__/index.test.ts +148 -0
  497. package/references/opentasks/src/config/__tests__/loader.test.ts +173 -0
  498. package/references/opentasks/src/config/__tests__/merge.test.ts +121 -0
  499. package/references/opentasks/src/config/__tests__/schema.test.ts +446 -0
  500. package/references/opentasks/src/config/defaults.ts +18 -0
  501. package/references/opentasks/src/config/env.ts +170 -0
  502. package/references/opentasks/src/config/errors.ts +33 -0
  503. package/references/opentasks/src/config/index.ts +63 -0
  504. package/references/opentasks/src/config/loader.ts +90 -0
  505. package/references/opentasks/src/config/merge.ts +64 -0
  506. package/references/opentasks/src/config/schema.ts +767 -0
  507. package/references/opentasks/src/core/__tests__/conditional-redirects.test.ts +116 -0
  508. package/references/opentasks/src/core/__tests__/connections.test.ts +194 -0
  509. package/references/opentasks/src/core/__tests__/hash.test.ts +161 -0
  510. package/references/opentasks/src/core/__tests__/id.test.ts +175 -0
  511. package/references/opentasks/src/core/__tests__/init.test.ts +115 -0
  512. package/references/opentasks/src/core/__tests__/location.test.ts +94 -0
  513. package/references/opentasks/src/core/__tests__/merge-driver.test.ts +300 -0
  514. package/references/opentasks/src/core/__tests__/redirects.test.ts +169 -0
  515. package/references/opentasks/src/core/__tests__/resolve-location-target.test.ts +468 -0
  516. package/references/opentasks/src/core/__tests__/uri.test.ts +228 -0
  517. package/references/opentasks/src/core/__tests__/worktree.test.ts +160 -0
  518. package/references/opentasks/src/core/conditional-redirects.ts +100 -0
  519. package/references/opentasks/src/core/connections.ts +217 -0
  520. package/references/opentasks/src/core/discover.ts +195 -0
  521. package/references/opentasks/src/core/hash.ts +74 -0
  522. package/references/opentasks/src/core/id.ts +174 -0
  523. package/references/opentasks/src/core/index.ts +108 -0
  524. package/references/opentasks/src/core/init.ts +66 -0
  525. package/references/opentasks/src/core/location.ts +139 -0
  526. package/references/opentasks/src/core/merge-driver.ts +280 -0
  527. package/references/opentasks/src/core/redirects.ts +182 -0
  528. package/references/opentasks/src/core/uri.ts +270 -0
  529. package/references/opentasks/src/core/worktree.ts +504 -0
  530. package/references/opentasks/src/daemon/__tests__/e2e-live-agent.test.ts +344 -0
  531. package/references/opentasks/src/daemon/__tests__/e2e-session-pipeline.test.ts +447 -0
  532. package/references/opentasks/src/daemon/__tests__/e2e-watch.test.ts +279 -0
  533. package/references/opentasks/src/daemon/__tests__/entire-linker.test.ts +1074 -0
  534. package/references/opentasks/src/daemon/__tests__/entire-watcher.test.ts +659 -0
  535. package/references/opentasks/src/daemon/__tests__/flush.test.ts +306 -0
  536. package/references/opentasks/src/daemon/__tests__/integration.test.ts +338 -0
  537. package/references/opentasks/src/daemon/__tests__/ipc.test.ts +406 -0
  538. package/references/opentasks/src/daemon/__tests__/lifecycle.test.ts +378 -0
  539. package/references/opentasks/src/daemon/__tests__/lock.test.ts +240 -0
  540. package/references/opentasks/src/daemon/__tests__/methods/graph.test.ts +372 -0
  541. package/references/opentasks/src/daemon/__tests__/methods/provider.test.ts +238 -0
  542. package/references/opentasks/src/daemon/__tests__/methods/tools.test.ts +690 -0
  543. package/references/opentasks/src/daemon/__tests__/multi-location.test.ts +945 -0
  544. package/references/opentasks/src/daemon/__tests__/registry.test.ts +268 -0
  545. package/references/opentasks/src/daemon/__tests__/watcher.test.ts +329 -0
  546. package/references/opentasks/src/daemon/entire-linker.ts +615 -0
  547. package/references/opentasks/src/daemon/entire-watcher.ts +415 -0
  548. package/references/opentasks/src/daemon/factory.ts +133 -0
  549. package/references/opentasks/src/daemon/flush.ts +168 -0
  550. package/references/opentasks/src/daemon/index.ts +120 -0
  551. package/references/opentasks/src/daemon/ipc.ts +491 -0
  552. package/references/opentasks/src/daemon/lifecycle.ts +1106 -0
  553. package/references/opentasks/src/daemon/location-state.ts +481 -0
  554. package/references/opentasks/src/daemon/lock.ts +168 -0
  555. package/references/opentasks/src/daemon/methods/__tests__/graph.test.ts +359 -0
  556. package/references/opentasks/src/daemon/methods/__tests__/provider.test.ts +227 -0
  557. package/references/opentasks/src/daemon/methods/__tests__/tools.test.ts +360 -0
  558. package/references/opentasks/src/daemon/methods/__tests__/watch.test.ts +656 -0
  559. package/references/opentasks/src/daemon/methods/archive.ts +193 -0
  560. package/references/opentasks/src/daemon/methods/graph.ts +274 -0
  561. package/references/opentasks/src/daemon/methods/lifecycle.ts +112 -0
  562. package/references/opentasks/src/daemon/methods/location.ts +118 -0
  563. package/references/opentasks/src/daemon/methods/provider.ts +159 -0
  564. package/references/opentasks/src/daemon/methods/tools.ts +221 -0
  565. package/references/opentasks/src/daemon/methods/watch.ts +206 -0
  566. package/references/opentasks/src/daemon/registry.ts +244 -0
  567. package/references/opentasks/src/daemon/types.ts +163 -0
  568. package/references/opentasks/src/daemon/watcher.ts +248 -0
  569. package/references/opentasks/src/entire/__tests__/agent-registry.test.ts +127 -0
  570. package/references/opentasks/src/entire/__tests__/claude-generator.test.ts +49 -0
  571. package/references/opentasks/src/entire/__tests__/commit-msg.test.ts +89 -0
  572. package/references/opentasks/src/entire/__tests__/cursor-agent.test.ts +224 -0
  573. package/references/opentasks/src/entire/__tests__/flush-sentinel.test.ts +93 -0
  574. package/references/opentasks/src/entire/__tests__/gemini-agent.test.ts +375 -0
  575. package/references/opentasks/src/entire/__tests__/git-hooks.test.ts +85 -0
  576. package/references/opentasks/src/entire/__tests__/hook-managers.test.ts +128 -0
  577. package/references/opentasks/src/entire/__tests__/opencode-agent.test.ts +329 -0
  578. package/references/opentasks/src/entire/__tests__/redaction.test.ts +143 -0
  579. package/references/opentasks/src/entire/__tests__/session-store.test.ts +83 -0
  580. package/references/opentasks/src/entire/__tests__/summarize.test.ts +346 -0
  581. package/references/opentasks/src/entire/__tests__/transcript-timestamp.test.ts +127 -0
  582. package/references/opentasks/src/entire/__tests__/types.test.ts +112 -0
  583. package/references/opentasks/src/entire/__tests__/utils.test.ts +296 -0
  584. package/references/opentasks/src/entire/__tests__/validation.test.ts +103 -0
  585. package/references/opentasks/src/entire/__tests__/worktree.test.ts +66 -0
  586. package/references/opentasks/src/entire/agent/registry.ts +143 -0
  587. package/references/opentasks/src/entire/agent/session-types.ts +117 -0
  588. package/references/opentasks/src/entire/agent/types.ts +217 -0
  589. package/references/opentasks/src/entire/commands/clean.ts +134 -0
  590. package/references/opentasks/src/entire/commands/disable.ts +85 -0
  591. package/references/opentasks/src/entire/commands/doctor.ts +152 -0
  592. package/references/opentasks/src/entire/commands/enable.ts +149 -0
  593. package/references/opentasks/src/entire/commands/explain.ts +271 -0
  594. package/references/opentasks/src/entire/commands/reset.ts +105 -0
  595. package/references/opentasks/src/entire/commands/resume.ts +194 -0
  596. package/references/opentasks/src/entire/commands/rewind.ts +204 -0
  597. package/references/opentasks/src/entire/commands/status.ts +150 -0
  598. package/references/opentasks/src/entire/config.ts +153 -0
  599. package/references/opentasks/src/entire/git-operations.ts +485 -0
  600. package/references/opentasks/src/entire/hooks/git-hooks.ts +171 -0
  601. package/references/opentasks/src/entire/hooks/lifecycle.ts +224 -0
  602. package/references/opentasks/src/entire/index.ts +644 -0
  603. package/references/opentasks/src/entire/security/redaction.ts +263 -0
  604. package/references/opentasks/src/entire/session/state-machine.ts +463 -0
  605. package/references/opentasks/src/entire/store/checkpoint-store.ts +489 -0
  606. package/references/opentasks/src/entire/store/native-store.ts +178 -0
  607. package/references/opentasks/src/entire/store/provider-types.ts +99 -0
  608. package/references/opentasks/src/entire/store/session-store.ts +233 -0
  609. package/references/opentasks/src/entire/strategy/attribution.ts +300 -0
  610. package/references/opentasks/src/entire/strategy/common.ts +222 -0
  611. package/references/opentasks/src/entire/strategy/content-overlap.ts +242 -0
  612. package/references/opentasks/src/entire/strategy/manual-commit.ts +1008 -0
  613. package/references/opentasks/src/entire/strategy/types.ts +285 -0
  614. package/references/opentasks/src/entire/summarize/claude-generator.ts +119 -0
  615. package/references/opentasks/src/entire/summarize/summarize.ts +432 -0
  616. package/references/opentasks/src/entire/types.ts +408 -0
  617. package/references/opentasks/src/entire/utils/chunk-files.ts +49 -0
  618. package/references/opentasks/src/entire/utils/commit-message.ts +65 -0
  619. package/references/opentasks/src/entire/utils/detect-agent.ts +36 -0
  620. package/references/opentasks/src/entire/utils/hook-managers.ts +118 -0
  621. package/references/opentasks/src/entire/utils/ide-tags.ts +32 -0
  622. package/references/opentasks/src/entire/utils/paths.ts +59 -0
  623. package/references/opentasks/src/entire/utils/preview-rewind.ts +86 -0
  624. package/references/opentasks/src/entire/utils/rewind-conflict.ts +121 -0
  625. package/references/opentasks/src/entire/utils/shadow-branch.ts +113 -0
  626. package/references/opentasks/src/entire/utils/string-utils.ts +46 -0
  627. package/references/opentasks/src/entire/utils/todo-extract.ts +193 -0
  628. package/references/opentasks/src/entire/utils/trailers.ts +190 -0
  629. package/references/opentasks/src/entire/utils/transcript-parse.ts +177 -0
  630. package/references/opentasks/src/entire/utils/transcript-timestamp.ts +61 -0
  631. package/references/opentasks/src/entire/utils/tree-ops.ts +227 -0
  632. package/references/opentasks/src/entire/utils/tty.ts +72 -0
  633. package/references/opentasks/src/entire/utils/validation.ts +67 -0
  634. package/references/opentasks/src/entire/utils/worktree.ts +58 -0
  635. package/references/opentasks/src/graph/EdgeTypeRegistry.ts +330 -0
  636. package/references/opentasks/src/graph/FederatedGraph.ts +796 -0
  637. package/references/opentasks/src/graph/GraphologyAdapter.ts +374 -0
  638. package/references/opentasks/src/graph/HydratingFederatedGraph.ts +533 -0
  639. package/references/opentasks/src/graph/__tests__/EdgeTypeRegistry.test.ts +263 -0
  640. package/references/opentasks/src/graph/__tests__/FederatedGraph.test.ts +821 -0
  641. package/references/opentasks/src/graph/__tests__/GraphologyAdapter.test.ts +408 -0
  642. package/references/opentasks/src/graph/__tests__/HydratingFederatedGraph.test.ts +735 -0
  643. package/references/opentasks/src/graph/__tests__/debounce.test.ts +276 -0
  644. package/references/opentasks/src/graph/__tests__/e2e-store-roundtrip.test.ts +349 -0
  645. package/references/opentasks/src/graph/__tests__/edge-cases.test.ts +595 -0
  646. package/references/opentasks/src/graph/__tests__/expansion.test.ts +304 -0
  647. package/references/opentasks/src/graph/__tests__/git-graph-syncer.test.ts +572 -0
  648. package/references/opentasks/src/graph/__tests__/provider-store.test.ts +1091 -0
  649. package/references/opentasks/src/graph/__tests__/query.test.ts +991 -0
  650. package/references/opentasks/src/graph/__tests__/store.test.ts +998 -0
  651. package/references/opentasks/src/graph/__tests__/sync.test.ts +178 -0
  652. package/references/opentasks/src/graph/__tests__/validation.test.ts +657 -0
  653. package/references/opentasks/src/graph/coordination.ts +454 -0
  654. package/references/opentasks/src/graph/debounce.ts +154 -0
  655. package/references/opentasks/src/graph/expansion.ts +364 -0
  656. package/references/opentasks/src/graph/git-graph-syncer.ts +321 -0
  657. package/references/opentasks/src/graph/history.ts +438 -0
  658. package/references/opentasks/src/graph/index.ts +145 -0
  659. package/references/opentasks/src/graph/provider-store.ts +1077 -0
  660. package/references/opentasks/src/graph/query.ts +651 -0
  661. package/references/opentasks/src/graph/store.ts +861 -0
  662. package/references/opentasks/src/graph/sync.ts +116 -0
  663. package/references/opentasks/src/graph/types.ts +420 -0
  664. package/references/opentasks/src/graph/validation.ts +520 -0
  665. package/references/opentasks/src/index.ts +270 -0
  666. package/references/opentasks/src/materialization/CLAUDE.md +88 -0
  667. package/references/opentasks/src/materialization/README.md +187 -0
  668. package/references/opentasks/src/materialization/__tests__/archive-methods.test.ts +194 -0
  669. package/references/opentasks/src/materialization/__tests__/archiver.test.ts +528 -0
  670. package/references/opentasks/src/materialization/__tests__/config.test.ts +123 -0
  671. package/references/opentasks/src/materialization/__tests__/git-remote-store.test.ts +533 -0
  672. package/references/opentasks/src/materialization/__tests__/graph-id.test.ts +82 -0
  673. package/references/opentasks/src/materialization/__tests__/http-remote-store.test.ts +263 -0
  674. package/references/opentasks/src/materialization/__tests__/materialize-before-archive.test.ts +246 -0
  675. package/references/opentasks/src/materialization/__tests__/remote-store-factory.test.ts +152 -0
  676. package/references/opentasks/src/materialization/__tests__/snapshot.test.ts +209 -0
  677. package/references/opentasks/src/materialization/archiver.ts +318 -0
  678. package/references/opentasks/src/materialization/git-archive-store.ts +568 -0
  679. package/references/opentasks/src/materialization/git-remote-store.ts +551 -0
  680. package/references/opentasks/src/materialization/graph-id.ts +173 -0
  681. package/references/opentasks/src/materialization/http-remote-store.ts +190 -0
  682. package/references/opentasks/src/materialization/index.ts +62 -0
  683. package/references/opentasks/src/materialization/remote-store-factory.ts +55 -0
  684. package/references/opentasks/src/materialization/snapshot.ts +230 -0
  685. package/references/opentasks/src/materialization/types.ts +410 -0
  686. package/references/opentasks/src/providers/__tests__/beads.test.ts +752 -0
  687. package/references/opentasks/src/providers/__tests__/claude-tasks.test.ts +485 -0
  688. package/references/opentasks/src/providers/__tests__/entire-e2e.test.ts +692 -0
  689. package/references/opentasks/src/providers/__tests__/entire-sessionlog-e2e.test.ts +1113 -0
  690. package/references/opentasks/src/providers/__tests__/entire.test.ts +1016 -0
  691. package/references/opentasks/src/providers/__tests__/from-config.test.ts +183 -0
  692. package/references/opentasks/src/providers/__tests__/global.test.ts +515 -0
  693. package/references/opentasks/src/providers/__tests__/materialization.test.ts +567 -0
  694. package/references/opentasks/src/providers/__tests__/native.test.ts +693 -0
  695. package/references/opentasks/src/providers/__tests__/registry.test.ts +232 -0
  696. package/references/opentasks/src/providers/beads.ts +1155 -0
  697. package/references/opentasks/src/providers/claude-tasks.ts +402 -0
  698. package/references/opentasks/src/providers/entire.ts +608 -0
  699. package/references/opentasks/src/providers/from-config.ts +210 -0
  700. package/references/opentasks/src/providers/global.ts +460 -0
  701. package/references/opentasks/src/providers/index.ts +147 -0
  702. package/references/opentasks/src/providers/location.ts +237 -0
  703. package/references/opentasks/src/providers/materialization.ts +346 -0
  704. package/references/opentasks/src/providers/native.ts +725 -0
  705. package/references/opentasks/src/providers/registry.ts +114 -0
  706. package/references/opentasks/src/providers/sudocode.ts +1292 -0
  707. package/references/opentasks/src/providers/sync.ts +485 -0
  708. package/references/opentasks/src/providers/traits/RelationshipQueryable.ts +169 -0
  709. package/references/opentasks/src/providers/traits/TaskManageable.ts +211 -0
  710. package/references/opentasks/src/providers/traits/Watchable.ts +260 -0
  711. package/references/opentasks/src/providers/traits/__tests__/RelationshipQueryable.test.ts +217 -0
  712. package/references/opentasks/src/providers/traits/__tests__/TaskManageable.test.ts +241 -0
  713. package/references/opentasks/src/providers/traits/index.ts +42 -0
  714. package/references/opentasks/src/providers/types.ts +439 -0
  715. package/references/opentasks/src/schema/__tests__/validation.test.ts +283 -0
  716. package/references/opentasks/src/schema/base.ts +88 -0
  717. package/references/opentasks/src/schema/edges.ts +78 -0
  718. package/references/opentasks/src/schema/index.ts +37 -0
  719. package/references/opentasks/src/schema/nodes.ts +119 -0
  720. package/references/opentasks/src/schema/storage.ts +130 -0
  721. package/references/opentasks/src/schema/validation.ts +209 -0
  722. package/references/opentasks/src/storage/__tests__/atomic-write.test.ts +227 -0
  723. package/references/opentasks/src/storage/__tests__/file-lock.test.ts +120 -0
  724. package/references/opentasks/src/storage/__tests__/jsonl.test.ts +267 -0
  725. package/references/opentasks/src/storage/__tests__/locked-writer.test.ts +134 -0
  726. package/references/opentasks/src/storage/__tests__/sqlite.test.ts +572 -0
  727. package/references/opentasks/src/storage/atomic-write.ts +86 -0
  728. package/references/opentasks/src/storage/file-lock.ts +215 -0
  729. package/references/opentasks/src/storage/index.ts +24 -0
  730. package/references/opentasks/src/storage/interface.ts +289 -0
  731. package/references/opentasks/src/storage/jsonl.ts +264 -0
  732. package/references/opentasks/src/storage/locked-writer.ts +140 -0
  733. package/references/opentasks/src/storage/sqlite-schema.ts +177 -0
  734. package/references/opentasks/src/storage/sqlite.ts +791 -0
  735. package/references/opentasks/src/tools/__tests__/annotate.test.ts +381 -0
  736. package/references/opentasks/src/tools/__tests__/link.test.ts +299 -0
  737. package/references/opentasks/src/tools/__tests__/query.test.ts +350 -0
  738. package/references/opentasks/src/tools/__tests__/task.test.ts +218 -0
  739. package/references/opentasks/src/tools/annotate.ts +277 -0
  740. package/references/opentasks/src/tools/index.ts +57 -0
  741. package/references/opentasks/src/tools/link.ts +163 -0
  742. package/references/opentasks/src/tools/query.ts +468 -0
  743. package/references/opentasks/src/tools/task.ts +213 -0
  744. package/references/opentasks/src/tools/types.ts +451 -0
  745. package/references/opentasks/src/tracking/__tests__/claude-tool-categorizer.test.ts +223 -0
  746. package/references/opentasks/src/tracking/__tests__/transcript-extractor.test.ts +262 -0
  747. package/references/opentasks/src/tracking/claude-tool-categorizer.ts +155 -0
  748. package/references/opentasks/src/tracking/index.ts +32 -0
  749. package/references/opentasks/src/tracking/skill-tracker.ts +322 -0
  750. package/references/opentasks/src/tracking/transcript-extractor.ts +225 -0
  751. package/references/opentasks/tests/e2e/helpers/assertions.ts +211 -0
  752. package/references/opentasks/tests/e2e/helpers/beads-helpers.ts +487 -0
  753. package/references/opentasks/tests/e2e/helpers/fixtures.ts +236 -0
  754. package/references/opentasks/tests/e2e/helpers/index.ts +122 -0
  755. package/references/opentasks/tests/e2e/helpers/sudocode-helpers.ts +341 -0
  756. package/references/opentasks/tests/e2e/helpers/system-setup.ts +504 -0
  757. package/references/opentasks/tests/e2e/helpers/test-agent.ts +504 -0
  758. package/references/opentasks/tests/e2e/infrastructure.e2e.test.ts +521 -0
  759. package/references/opentasks/tests/e2e/skill-tracking.e2e.test.ts +625 -0
  760. package/references/opentasks/tests/e2e/workflows/feedback-loop.e2e.test.ts +279 -0
  761. package/references/opentasks/tests/e2e/workflows/multi-agent.e2e.test.ts +304 -0
  762. package/references/opentasks/tests/e2e/workflows/provider-sync/background-sync.e2e.test.ts +292 -0
  763. package/references/opentasks/tests/e2e/workflows/provider-sync/beads-provider-compat.e2e.test.ts +249 -0
  764. package/references/opentasks/tests/e2e/workflows/provider-sync/cross-provider-edges.e2e.test.ts +407 -0
  765. package/references/opentasks/tests/e2e/workflows/provider-sync/federated-ready.e2e.test.ts +504 -0
  766. package/references/opentasks/tests/e2e/workflows/provider-sync/hydration.e2e.test.ts +340 -0
  767. package/references/opentasks/tests/e2e/workflows/provider-sync/materialization.e2e.test.ts +370 -0
  768. package/references/opentasks/tests/e2e/workflows/provider-sync/sudocode-provider-compat.e2e.test.ts +683 -0
  769. package/references/opentasks/tests/e2e/workflows/provider-sync/watchable-beads.e2e.test.ts +573 -0
  770. package/references/opentasks/tests/e2e/workflows/spec-driven.e2e.test.ts +244 -0
  771. package/references/opentasks/tests/e2e/worktree-location.e2e.test.ts +699 -0
  772. package/references/opentasks/tests/integration/daemon/helpers.ts +147 -0
  773. package/references/opentasks/tests/integration/daemon/ipc.integration.test.ts +343 -0
  774. package/references/opentasks/tests/integration/daemon/lifecycle.integration.test.ts +407 -0
  775. package/references/opentasks/tests/integration/graph/federated-graph.integration.test.ts +660 -0
  776. package/references/opentasks/tests/integration/helpers/flags.ts +28 -0
  777. package/references/opentasks/tests/integration/helpers/index.ts +47 -0
  778. package/references/opentasks/tests/integration/helpers/process.ts +133 -0
  779. package/references/opentasks/tests/integration/helpers/temp.ts +105 -0
  780. package/references/opentasks/tests/integration/helpers/wait.ts +133 -0
  781. package/references/opentasks/tests/integration/helpers.test.ts +120 -0
  782. package/references/opentasks/tests/integration/providers/beads-task-manageable.integration.test.ts +450 -0
  783. package/references/opentasks/tests/integration/providers/beads.integration.test.ts +388 -0
  784. package/references/opentasks/tests/integration/providers/native-task-manageable.integration.test.ts +667 -0
  785. package/references/opentasks/tests/integration/providers/sudocode-task-manageable.integration.test.ts +406 -0
  786. package/references/opentasks/tests/integration/providers/sudocode.integration.test.ts +342 -0
  787. package/references/opentasks/tests/integration/storage/jsonl-durability.integration.test.ts +390 -0
  788. package/references/opentasks/tests/integration/storage/sqlite-durability.integration.test.ts +527 -0
  789. package/references/opentasks/tests/integration/worktree/redirect-location-resolution.integration.test.ts +578 -0
  790. package/references/opentasks/tests/integration/worktree/worktree-flow.integration.test.ts +656 -0
  791. package/references/opentasks/tsconfig.json +18 -0
  792. package/references/opentasks/vitest.config.ts +27 -0
  793. package/references/opentasks/vitest.e2e.config.ts +35 -0
  794. package/references/opentasks/vitest.integration.config.ts +19 -0
  795. package/references/openteams/.claude/settings.json +6 -0
  796. package/references/openteams/CLAUDE.md +98 -0
  797. package/references/openteams/README.md +508 -0
  798. package/references/openteams/SKILL.md +198 -0
  799. package/references/openteams/design.md +250 -0
  800. package/references/openteams/docs/visual-editor-design.md +1225 -0
  801. package/references/openteams/editor/index.html +15 -0
  802. package/references/openteams/editor/package.json +39 -0
  803. package/references/openteams/editor/src/App.tsx +48 -0
  804. package/references/openteams/editor/src/components/canvas/Canvas.tsx +131 -0
  805. package/references/openteams/editor/src/components/canvas/QuickAddMenu.tsx +134 -0
  806. package/references/openteams/editor/src/components/edges/PeerRouteEdge.tsx +82 -0
  807. package/references/openteams/editor/src/components/edges/SignalFlowEdge.tsx +77 -0
  808. package/references/openteams/editor/src/components/edges/SpawnEdge.tsx +54 -0
  809. package/references/openteams/editor/src/components/inspector/ChannelInspector.tsx +158 -0
  810. package/references/openteams/editor/src/components/inspector/EdgeInspector.tsx +168 -0
  811. package/references/openteams/editor/src/components/inspector/Inspector.tsx +46 -0
  812. package/references/openteams/editor/src/components/inspector/RoleInspector.tsx +508 -0
  813. package/references/openteams/editor/src/components/inspector/TeamInspector.tsx +126 -0
  814. package/references/openteams/editor/src/components/nodes/ChannelNode.tsx +103 -0
  815. package/references/openteams/editor/src/components/nodes/RoleNode.tsx +157 -0
  816. package/references/openteams/editor/src/components/nodes/node-styles.ts +101 -0
  817. package/references/openteams/editor/src/components/sidebar/Sidebar.tsx +227 -0
  818. package/references/openteams/editor/src/components/toolbar/ExportModal.tsx +110 -0
  819. package/references/openteams/editor/src/components/toolbar/ImportModal.tsx +139 -0
  820. package/references/openteams/editor/src/components/toolbar/Toolbar.tsx +190 -0
  821. package/references/openteams/editor/src/hooks/use-autosave.ts +126 -0
  822. package/references/openteams/editor/src/hooks/use-keyboard.ts +106 -0
  823. package/references/openteams/editor/src/hooks/use-validation.ts +45 -0
  824. package/references/openteams/editor/src/index.css +245 -0
  825. package/references/openteams/editor/src/lib/auto-layout.ts +51 -0
  826. package/references/openteams/editor/src/lib/bundled-templates.ts +42 -0
  827. package/references/openteams/editor/src/lib/compiler.ts +75 -0
  828. package/references/openteams/editor/src/lib/load-template.ts +103 -0
  829. package/references/openteams/editor/src/lib/rebuild-edges.ts +104 -0
  830. package/references/openteams/editor/src/lib/serializer.ts +408 -0
  831. package/references/openteams/editor/src/lib/signal-catalog.ts +50 -0
  832. package/references/openteams/editor/src/lib/validator.ts +172 -0
  833. package/references/openteams/editor/src/main.tsx +10 -0
  834. package/references/openteams/editor/src/stores/canvas-store.ts +80 -0
  835. package/references/openteams/editor/src/stores/config-store.ts +243 -0
  836. package/references/openteams/editor/src/stores/history-store.ts +143 -0
  837. package/references/openteams/editor/src/stores/theme-store.ts +66 -0
  838. package/references/openteams/editor/src/stores/ui-store.ts +46 -0
  839. package/references/openteams/editor/src/stores/validation-store.ts +27 -0
  840. package/references/openteams/editor/src/types/editor.ts +74 -0
  841. package/references/openteams/editor/src/vite-env.d.ts +1 -0
  842. package/references/openteams/editor/tests/compiler.test.ts +151 -0
  843. package/references/openteams/editor/tests/e2e-add-remove.test.ts +386 -0
  844. package/references/openteams/editor/tests/e2e-components.test.tsx +424 -0
  845. package/references/openteams/editor/tests/e2e-export-roundtrip.test.ts +299 -0
  846. package/references/openteams/editor/tests/e2e-template-load.test.ts +204 -0
  847. package/references/openteams/editor/tests/e2e-ui-store.test.ts +126 -0
  848. package/references/openteams/editor/tests/e2e-undo-redo.test.ts +203 -0
  849. package/references/openteams/editor/tests/e2e-validation.test.ts +307 -0
  850. package/references/openteams/editor/tests/serializer.test.ts +142 -0
  851. package/references/openteams/editor/tests/setup.ts +52 -0
  852. package/references/openteams/editor/tests/validator.test.ts +92 -0
  853. package/references/openteams/editor/tsconfig.json +21 -0
  854. package/references/openteams/editor/tsconfig.tsbuildinfo +1 -0
  855. package/references/openteams/editor/vite.config.ts +28 -0
  856. package/references/openteams/examples/bmad-method/prompts/analyst/ROLE.md +16 -0
  857. package/references/openteams/examples/bmad-method/prompts/analyst/SOUL.md +5 -0
  858. package/references/openteams/examples/bmad-method/prompts/architect/ROLE.md +24 -0
  859. package/references/openteams/examples/bmad-method/prompts/architect/SOUL.md +5 -0
  860. package/references/openteams/examples/bmad-method/prompts/developer/ROLE.md +25 -0
  861. package/references/openteams/examples/bmad-method/prompts/developer/SOUL.md +5 -0
  862. package/references/openteams/examples/bmad-method/prompts/master/ROLE.md +21 -0
  863. package/references/openteams/examples/bmad-method/prompts/master/SOUL.md +5 -0
  864. package/references/openteams/examples/bmad-method/prompts/pm/ROLE.md +20 -0
  865. package/references/openteams/examples/bmad-method/prompts/pm/SOUL.md +5 -0
  866. package/references/openteams/examples/bmad-method/prompts/qa/ROLE.md +17 -0
  867. package/references/openteams/examples/bmad-method/prompts/qa/SOUL.md +5 -0
  868. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/ROLE.md +23 -0
  869. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/SOUL.md +5 -0
  870. package/references/openteams/examples/bmad-method/prompts/scrum-master/ROLE.md +27 -0
  871. package/references/openteams/examples/bmad-method/prompts/scrum-master/SOUL.md +5 -0
  872. package/references/openteams/examples/bmad-method/prompts/tech-writer/ROLE.md +21 -0
  873. package/references/openteams/examples/bmad-method/prompts/tech-writer/SOUL.md +5 -0
  874. package/references/openteams/examples/bmad-method/prompts/ux-designer/ROLE.md +16 -0
  875. package/references/openteams/examples/bmad-method/prompts/ux-designer/SOUL.md +5 -0
  876. package/references/openteams/examples/bmad-method/roles/analyst.yaml +9 -0
  877. package/references/openteams/examples/bmad-method/roles/architect.yaml +9 -0
  878. package/references/openteams/examples/bmad-method/roles/developer.yaml +8 -0
  879. package/references/openteams/examples/bmad-method/roles/master.yaml +8 -0
  880. package/references/openteams/examples/bmad-method/roles/pm.yaml +9 -0
  881. package/references/openteams/examples/bmad-method/roles/qa.yaml +8 -0
  882. package/references/openteams/examples/bmad-method/roles/quick-flow-dev.yaml +8 -0
  883. package/references/openteams/examples/bmad-method/roles/scrum-master.yaml +9 -0
  884. package/references/openteams/examples/bmad-method/roles/tech-writer.yaml +8 -0
  885. package/references/openteams/examples/bmad-method/roles/ux-designer.yaml +8 -0
  886. package/references/openteams/examples/bmad-method/team.yaml +161 -0
  887. package/references/openteams/examples/bug-fix-pipeline/roles/fixer.yaml +9 -0
  888. package/references/openteams/examples/bug-fix-pipeline/roles/investigator.yaml +8 -0
  889. package/references/openteams/examples/bug-fix-pipeline/roles/pr-creator.yaml +6 -0
  890. package/references/openteams/examples/bug-fix-pipeline/roles/triager.yaml +7 -0
  891. package/references/openteams/examples/bug-fix-pipeline/roles/verifier.yaml +8 -0
  892. package/references/openteams/examples/bug-fix-pipeline/team.yaml +88 -0
  893. package/references/openteams/examples/codebase-migration/roles/assessor.yaml +7 -0
  894. package/references/openteams/examples/codebase-migration/roles/migrator.yaml +9 -0
  895. package/references/openteams/examples/codebase-migration/roles/planner.yaml +5 -0
  896. package/references/openteams/examples/codebase-migration/roles/test-extractor.yaml +9 -0
  897. package/references/openteams/examples/codebase-migration/roles/validator.yaml +7 -0
  898. package/references/openteams/examples/codebase-migration/team.yaml +81 -0
  899. package/references/openteams/examples/docs-sync/roles/adr-writer.yaml +7 -0
  900. package/references/openteams/examples/docs-sync/roles/api-doc-writer.yaml +7 -0
  901. package/references/openteams/examples/docs-sync/roles/change-detector.yaml +7 -0
  902. package/references/openteams/examples/docs-sync/roles/doc-reviewer.yaml +7 -0
  903. package/references/openteams/examples/docs-sync/roles/guide-writer.yaml +7 -0
  904. package/references/openteams/examples/docs-sync/team.yaml +84 -0
  905. package/references/openteams/examples/gsd/prompts/codebase-mapper/ROLE.md +17 -0
  906. package/references/openteams/examples/gsd/prompts/codebase-mapper/SOUL.md +5 -0
  907. package/references/openteams/examples/gsd/prompts/debugger/ROLE.md +25 -0
  908. package/references/openteams/examples/gsd/prompts/debugger/SOUL.md +5 -0
  909. package/references/openteams/examples/gsd/prompts/executor/ROLE.md +34 -0
  910. package/references/openteams/examples/gsd/prompts/executor/SOUL.md +5 -0
  911. package/references/openteams/examples/gsd/prompts/integration-checker/ROLE.md +18 -0
  912. package/references/openteams/examples/gsd/prompts/integration-checker/SOUL.md +3 -0
  913. package/references/openteams/examples/gsd/prompts/orchestrator/ROLE.md +42 -0
  914. package/references/openteams/examples/gsd/prompts/orchestrator/SOUL.md +5 -0
  915. package/references/openteams/examples/gsd/prompts/phase-researcher/ROLE.md +15 -0
  916. package/references/openteams/examples/gsd/prompts/phase-researcher/SOUL.md +3 -0
  917. package/references/openteams/examples/gsd/prompts/plan-checker/ROLE.md +17 -0
  918. package/references/openteams/examples/gsd/prompts/plan-checker/SOUL.md +3 -0
  919. package/references/openteams/examples/gsd/prompts/planner/ROLE.md +28 -0
  920. package/references/openteams/examples/gsd/prompts/planner/SOUL.md +5 -0
  921. package/references/openteams/examples/gsd/prompts/project-researcher/ROLE.md +16 -0
  922. package/references/openteams/examples/gsd/prompts/project-researcher/SOUL.md +3 -0
  923. package/references/openteams/examples/gsd/prompts/research-synthesizer/ROLE.md +13 -0
  924. package/references/openteams/examples/gsd/prompts/research-synthesizer/SOUL.md +3 -0
  925. package/references/openteams/examples/gsd/prompts/roadmapper/ROLE.md +14 -0
  926. package/references/openteams/examples/gsd/prompts/roadmapper/SOUL.md +3 -0
  927. package/references/openteams/examples/gsd/prompts/verifier/ROLE.md +19 -0
  928. package/references/openteams/examples/gsd/prompts/verifier/SOUL.md +5 -0
  929. package/references/openteams/examples/gsd/roles/codebase-mapper.yaml +8 -0
  930. package/references/openteams/examples/gsd/roles/debugger.yaml +8 -0
  931. package/references/openteams/examples/gsd/roles/executor.yaml +8 -0
  932. package/references/openteams/examples/gsd/roles/integration-checker.yaml +8 -0
  933. package/references/openteams/examples/gsd/roles/orchestrator.yaml +9 -0
  934. package/references/openteams/examples/gsd/roles/phase-researcher.yaml +7 -0
  935. package/references/openteams/examples/gsd/roles/plan-checker.yaml +8 -0
  936. package/references/openteams/examples/gsd/roles/planner.yaml +8 -0
  937. package/references/openteams/examples/gsd/roles/project-researcher.yaml +8 -0
  938. package/references/openteams/examples/gsd/roles/research-synthesizer.yaml +7 -0
  939. package/references/openteams/examples/gsd/roles/roadmapper.yaml +7 -0
  940. package/references/openteams/examples/gsd/roles/verifier.yaml +8 -0
  941. package/references/openteams/examples/gsd/team.yaml +154 -0
  942. package/references/openteams/examples/incident-response/roles/communicator.yaml +5 -0
  943. package/references/openteams/examples/incident-response/roles/fix-proposer.yaml +7 -0
  944. package/references/openteams/examples/incident-response/roles/incident-triager.yaml +8 -0
  945. package/references/openteams/examples/incident-response/roles/investigator.yaml +8 -0
  946. package/references/openteams/examples/incident-response/team.yaml +68 -0
  947. package/references/openteams/examples/pr-review-checks/roles/code-reviewer.yaml +7 -0
  948. package/references/openteams/examples/pr-review-checks/roles/security-scanner.yaml +6 -0
  949. package/references/openteams/examples/pr-review-checks/roles/summarizer.yaml +6 -0
  950. package/references/openteams/examples/pr-review-checks/roles/test-checker.yaml +8 -0
  951. package/references/openteams/examples/pr-review-checks/team.yaml +64 -0
  952. package/references/openteams/examples/security-audit/roles/code-analyzer.yaml +6 -0
  953. package/references/openteams/examples/security-audit/roles/dep-scanner.yaml +7 -0
  954. package/references/openteams/examples/security-audit/roles/fixer.yaml +9 -0
  955. package/references/openteams/examples/security-audit/roles/pr-creator.yaml +6 -0
  956. package/references/openteams/examples/security-audit/roles/prioritizer.yaml +6 -0
  957. package/references/openteams/examples/security-audit/roles/secrets-scanner.yaml +6 -0
  958. package/references/openteams/examples/security-audit/roles/verifier.yaml +8 -0
  959. package/references/openteams/examples/security-audit/team.yaml +102 -0
  960. package/references/openteams/media/banner.png +0 -0
  961. package/references/openteams/media/editor.png +0 -0
  962. package/references/openteams/package-lock.json +4804 -0
  963. package/references/openteams/package.json +58 -0
  964. package/references/openteams/schema/role.schema.json +147 -0
  965. package/references/openteams/schema/team.schema.json +311 -0
  966. package/references/openteams/src/cli/editor.ts +170 -0
  967. package/references/openteams/src/cli/generate.test.ts +191 -0
  968. package/references/openteams/src/cli/generate.ts +220 -0
  969. package/references/openteams/src/cli/prompt-utils.ts +42 -0
  970. package/references/openteams/src/cli/template.test.ts +365 -0
  971. package/references/openteams/src/cli/template.ts +205 -0
  972. package/references/openteams/src/cli.ts +22 -0
  973. package/references/openteams/src/generators/agent-prompt-generator.test.ts +332 -0
  974. package/references/openteams/src/generators/agent-prompt-generator.ts +527 -0
  975. package/references/openteams/src/generators/package-generator.test.ts +129 -0
  976. package/references/openteams/src/generators/package-generator.ts +102 -0
  977. package/references/openteams/src/generators/skill-generator.test.ts +246 -0
  978. package/references/openteams/src/generators/skill-generator.ts +388 -0
  979. package/references/openteams/src/index.ts +84 -0
  980. package/references/openteams/src/template/builtins.test.ts +74 -0
  981. package/references/openteams/src/template/builtins.ts +108 -0
  982. package/references/openteams/src/template/install-service.test.ts +452 -0
  983. package/references/openteams/src/template/install-service.ts +332 -0
  984. package/references/openteams/src/template/loader.test.ts +1696 -0
  985. package/references/openteams/src/template/loader.ts +804 -0
  986. package/references/openteams/src/template/resolver.test.ts +304 -0
  987. package/references/openteams/src/template/resolver.ts +251 -0
  988. package/references/openteams/src/template/types.ts +229 -0
  989. package/references/openteams/tsconfig.cjs.json +7 -0
  990. package/references/openteams/tsconfig.esm.json +8 -0
  991. package/references/openteams/tsconfig.json +16 -0
  992. package/references/openteams/vitest.config.ts +9 -0
  993. package/references/sessionlog/.husky/pre-commit +1 -0
  994. package/references/sessionlog/.lintstagedrc.json +4 -0
  995. package/references/sessionlog/.prettierignore +4 -0
  996. package/references/sessionlog/.prettierrc.json +11 -0
  997. package/references/sessionlog/LICENSE +21 -0
  998. package/references/sessionlog/README.md +453 -0
  999. package/references/sessionlog/eslint.config.js +58 -0
  1000. package/references/sessionlog/package-lock.json +3672 -0
  1001. package/references/sessionlog/package.json +65 -0
  1002. package/references/sessionlog/src/__tests__/agent-hooks.test.ts +570 -0
  1003. package/references/sessionlog/src/__tests__/agent-registry.test.ts +127 -0
  1004. package/references/sessionlog/src/__tests__/claude-code-hooks.test.ts +225 -0
  1005. package/references/sessionlog/src/__tests__/claude-generator.test.ts +46 -0
  1006. package/references/sessionlog/src/__tests__/commit-msg.test.ts +86 -0
  1007. package/references/sessionlog/src/__tests__/cursor-agent.test.ts +224 -0
  1008. package/references/sessionlog/src/__tests__/e2e-live.test.ts +890 -0
  1009. package/references/sessionlog/src/__tests__/event-log.test.ts +183 -0
  1010. package/references/sessionlog/src/__tests__/flush-sentinel.test.ts +105 -0
  1011. package/references/sessionlog/src/__tests__/gemini-agent.test.ts +375 -0
  1012. package/references/sessionlog/src/__tests__/git-hooks.test.ts +78 -0
  1013. package/references/sessionlog/src/__tests__/hook-managers.test.ts +121 -0
  1014. package/references/sessionlog/src/__tests__/lifecycle-tasks.test.ts +759 -0
  1015. package/references/sessionlog/src/__tests__/opencode-agent.test.ts +338 -0
  1016. package/references/sessionlog/src/__tests__/redaction.test.ts +136 -0
  1017. package/references/sessionlog/src/__tests__/session-repo.test.ts +353 -0
  1018. package/references/sessionlog/src/__tests__/session-store.test.ts +166 -0
  1019. package/references/sessionlog/src/__tests__/setup-ccweb.test.ts +466 -0
  1020. package/references/sessionlog/src/__tests__/skill-live.test.ts +461 -0
  1021. package/references/sessionlog/src/__tests__/summarize.test.ts +348 -0
  1022. package/references/sessionlog/src/__tests__/task-plan-e2e.test.ts +610 -0
  1023. package/references/sessionlog/src/__tests__/task-plan-live.test.ts +632 -0
  1024. package/references/sessionlog/src/__tests__/transcript-timestamp.test.ts +121 -0
  1025. package/references/sessionlog/src/__tests__/types.test.ts +166 -0
  1026. package/references/sessionlog/src/__tests__/utils.test.ts +333 -0
  1027. package/references/sessionlog/src/__tests__/validation.test.ts +103 -0
  1028. package/references/sessionlog/src/__tests__/worktree.test.ts +57 -0
  1029. package/references/sessionlog/src/agent/registry.ts +143 -0
  1030. package/references/sessionlog/src/agent/session-types.ts +113 -0
  1031. package/references/sessionlog/src/agent/types.ts +220 -0
  1032. package/references/sessionlog/src/cli.ts +597 -0
  1033. package/references/sessionlog/src/commands/clean.ts +133 -0
  1034. package/references/sessionlog/src/commands/disable.ts +84 -0
  1035. package/references/sessionlog/src/commands/doctor.ts +145 -0
  1036. package/references/sessionlog/src/commands/enable.ts +202 -0
  1037. package/references/sessionlog/src/commands/explain.ts +261 -0
  1038. package/references/sessionlog/src/commands/reset.ts +105 -0
  1039. package/references/sessionlog/src/commands/resume.ts +180 -0
  1040. package/references/sessionlog/src/commands/rewind.ts +195 -0
  1041. package/references/sessionlog/src/commands/setup-ccweb.ts +275 -0
  1042. package/references/sessionlog/src/commands/status.ts +172 -0
  1043. package/references/sessionlog/src/config.ts +165 -0
  1044. package/references/sessionlog/src/events/event-log.ts +126 -0
  1045. package/references/sessionlog/src/git-operations.ts +558 -0
  1046. package/references/sessionlog/src/hooks/git-hooks.ts +165 -0
  1047. package/references/sessionlog/src/hooks/lifecycle.ts +391 -0
  1048. package/references/sessionlog/src/index.ts +650 -0
  1049. package/references/sessionlog/src/security/redaction.ts +283 -0
  1050. package/references/sessionlog/src/session/state-machine.ts +452 -0
  1051. package/references/sessionlog/src/store/checkpoint-store.ts +509 -0
  1052. package/references/sessionlog/src/store/native-store.ts +173 -0
  1053. package/references/sessionlog/src/store/provider-types.ts +99 -0
  1054. package/references/sessionlog/src/store/session-store.ts +266 -0
  1055. package/references/sessionlog/src/strategy/attribution.ts +296 -0
  1056. package/references/sessionlog/src/strategy/common.ts +207 -0
  1057. package/references/sessionlog/src/strategy/content-overlap.ts +228 -0
  1058. package/references/sessionlog/src/strategy/manual-commit.ts +988 -0
  1059. package/references/sessionlog/src/strategy/types.ts +279 -0
  1060. package/references/sessionlog/src/summarize/claude-generator.ts +115 -0
  1061. package/references/sessionlog/src/summarize/summarize.ts +432 -0
  1062. package/references/sessionlog/src/types.ts +508 -0
  1063. package/references/sessionlog/src/utils/chunk-files.ts +49 -0
  1064. package/references/sessionlog/src/utils/commit-message.ts +65 -0
  1065. package/references/sessionlog/src/utils/detect-agent.ts +36 -0
  1066. package/references/sessionlog/src/utils/hook-managers.ts +125 -0
  1067. package/references/sessionlog/src/utils/ide-tags.ts +32 -0
  1068. package/references/sessionlog/src/utils/paths.ts +79 -0
  1069. package/references/sessionlog/src/utils/preview-rewind.ts +80 -0
  1070. package/references/sessionlog/src/utils/rewind-conflict.ts +121 -0
  1071. package/references/sessionlog/src/utils/shadow-branch.ts +109 -0
  1072. package/references/sessionlog/src/utils/string-utils.ts +46 -0
  1073. package/references/sessionlog/src/utils/todo-extract.ts +188 -0
  1074. package/references/sessionlog/src/utils/trailers.ts +187 -0
  1075. package/references/sessionlog/src/utils/transcript-parse.ts +177 -0
  1076. package/references/sessionlog/src/utils/transcript-timestamp.ts +59 -0
  1077. package/references/sessionlog/src/utils/tree-ops.ts +219 -0
  1078. package/references/sessionlog/src/utils/tty.ts +72 -0
  1079. package/references/sessionlog/src/utils/validation.ts +65 -0
  1080. package/references/sessionlog/src/utils/worktree.ts +58 -0
  1081. package/references/sessionlog/src/wire-types.ts +59 -0
  1082. package/references/sessionlog/templates/setup-env.sh +153 -0
  1083. package/references/sessionlog/tsconfig.json +18 -0
  1084. package/references/sessionlog/vitest.config.ts +12 -0
  1085. package/references/swarmkit/LICENSE +21 -0
  1086. package/references/swarmkit/README.md +130 -0
  1087. package/references/swarmkit/docs/design.md +453 -0
  1088. package/references/swarmkit/docs/package-setup-reference.md +519 -0
  1089. package/references/swarmkit/package-lock.json +1938 -0
  1090. package/references/swarmkit/package.json +43 -0
  1091. package/references/swarmkit/src/cli.ts +41 -0
  1092. package/references/swarmkit/src/commands/add.ts +126 -0
  1093. package/references/swarmkit/src/commands/doctor.ts +117 -0
  1094. package/references/swarmkit/src/commands/hive.ts +279 -0
  1095. package/references/swarmkit/src/commands/init/phases/configure.ts +96 -0
  1096. package/references/swarmkit/src/commands/init/phases/global-setup.ts +102 -0
  1097. package/references/swarmkit/src/commands/init/phases/packages.ts +44 -0
  1098. package/references/swarmkit/src/commands/init/phases/project.ts +81 -0
  1099. package/references/swarmkit/src/commands/init/phases/use-case.ts +47 -0
  1100. package/references/swarmkit/src/commands/init/state.test.ts +23 -0
  1101. package/references/swarmkit/src/commands/init/state.ts +22 -0
  1102. package/references/swarmkit/src/commands/init/wizard.ts +160 -0
  1103. package/references/swarmkit/src/commands/init.ts +17 -0
  1104. package/references/swarmkit/src/commands/login.ts +106 -0
  1105. package/references/swarmkit/src/commands/logout.ts +22 -0
  1106. package/references/swarmkit/src/commands/remove.ts +72 -0
  1107. package/references/swarmkit/src/commands/status.ts +101 -0
  1108. package/references/swarmkit/src/commands/update.ts +62 -0
  1109. package/references/swarmkit/src/commands/whoami.ts +41 -0
  1110. package/references/swarmkit/src/config/global.test.ts +258 -0
  1111. package/references/swarmkit/src/config/global.ts +141 -0
  1112. package/references/swarmkit/src/config/keys.test.ts +109 -0
  1113. package/references/swarmkit/src/config/keys.ts +49 -0
  1114. package/references/swarmkit/src/doctor/checks.test.ts +366 -0
  1115. package/references/swarmkit/src/doctor/checks.ts +292 -0
  1116. package/references/swarmkit/src/doctor/types.ts +33 -0
  1117. package/references/swarmkit/src/hub/auth-flow.test.ts +127 -0
  1118. package/references/swarmkit/src/hub/auth-flow.ts +144 -0
  1119. package/references/swarmkit/src/hub/client.test.ts +224 -0
  1120. package/references/swarmkit/src/hub/client.ts +185 -0
  1121. package/references/swarmkit/src/hub/credentials.test.ts +132 -0
  1122. package/references/swarmkit/src/hub/credentials.ts +51 -0
  1123. package/references/swarmkit/src/index.ts +116 -0
  1124. package/references/swarmkit/src/packages/installer.test.ts +365 -0
  1125. package/references/swarmkit/src/packages/installer.ts +206 -0
  1126. package/references/swarmkit/src/packages/plugin.test.ts +141 -0
  1127. package/references/swarmkit/src/packages/plugin.ts +46 -0
  1128. package/references/swarmkit/src/packages/registry.test.ts +235 -0
  1129. package/references/swarmkit/src/packages/registry.ts +209 -0
  1130. package/references/swarmkit/src/packages/setup.test.ts +1349 -0
  1131. package/references/swarmkit/src/packages/setup.ts +635 -0
  1132. package/references/swarmkit/src/utils/ui.test.ts +115 -0
  1133. package/references/swarmkit/src/utils/ui.ts +62 -0
  1134. package/references/swarmkit/tsconfig.json +17 -0
  1135. package/references/swarmkit/vitest.config.ts +9 -0
  1136. package/scripts/bootstrap.mjs +26 -0
  1137. package/scripts/generate-agents.mjs +32 -0
  1138. package/scripts/map-hook.mjs +187 -0
  1139. package/scripts/map-sidecar.mjs +115 -0
  1140. package/scripts/sync-version.mjs +22 -0
  1141. package/scripts/team-loader.mjs +87 -0
  1142. package/settings.json +13 -0
  1143. package/skills/swarm/SKILL.md +71 -0
  1144. package/src/__tests__/agent-generator.test.mjs +299 -0
  1145. package/src/__tests__/bootstrap.test.mjs +353 -0
  1146. package/src/__tests__/config.test.mjs +286 -0
  1147. package/src/__tests__/context-output.test.mjs +138 -0
  1148. package/src/__tests__/helpers.mjs +136 -0
  1149. package/src/__tests__/inbox.test.mjs +174 -0
  1150. package/src/__tests__/index.test.mjs +90 -0
  1151. package/src/__tests__/map-connection.test.mjs +134 -0
  1152. package/src/__tests__/map-events.test.mjs +325 -0
  1153. package/src/__tests__/paths.test.mjs +70 -0
  1154. package/src/__tests__/roles.test.mjs +112 -0
  1155. package/src/__tests__/sessionlog.test.mjs +139 -0
  1156. package/src/__tests__/sidecar-client.test.mjs +73 -0
  1157. package/src/__tests__/sidecar-server.test.mjs +318 -0
  1158. package/src/__tests__/template.test.mjs +109 -0
  1159. package/src/agent-generator.mjs +325 -0
  1160. package/src/bootstrap.mjs +237 -0
  1161. package/src/config.mjs +86 -0
  1162. package/src/context-output.mjs +150 -0
  1163. package/src/inbox.mjs +105 -0
  1164. package/src/index.mjs +98 -0
  1165. package/src/map-connection.mjs +121 -0
  1166. package/src/map-events.mjs +175 -0
  1167. package/src/paths.mjs +74 -0
  1168. package/src/roles.mjs +72 -0
  1169. package/src/sessionlog.mjs +161 -0
  1170. package/src/sidecar-client.mjs +131 -0
  1171. package/src/sidecar-server.mjs +247 -0
  1172. package/src/swarmkit-resolver.mjs +111 -0
  1173. package/src/template.mjs +163 -0
  1174. package/vitest.config.mjs +17 -0
  1175. package/dist/index.d.ts +0 -1
  1176. package/dist/index.js +0 -6
package/docs/design.md ADDED
@@ -0,0 +1,1181 @@
1
+ # claude-code-swarm — Integration Design
2
+
3
+ Design document for integrating MAP (Multi-Agent Protocol) and sessionlog into the claude-code-swarm plugin.
4
+
5
+ ## Status
6
+
7
+ **Draft v2** — updated with decisions from design review.
8
+
9
+ ### Key decisions made
10
+
11
+ - **openteams** is config/generation only — team topology definitions, role prompts, artifact generation via `openteams generate all`. No runtime task, messaging, or signal CLI usage.
12
+ - **Claude Code native teams** handle all runtime coordination — `TeamCreate` for team setup, `TaskCreate`/`TaskUpdate` for task lifecycle, `SendMessage` for agent-to-agent communication.
13
+ - **MAP** handles external observability only — lifecycle events (agent spawned/completed, task dispatched/completed, turn events) and external message injection. Not used for internal team coordination.
14
+ - **sessionlog** is fully independent — the swarm plugin checks its status but does not manage its lifecycle. An optional bridge (`sessionlog.sync`) forwards session state to MAP for external observability.
15
+ - **Sidecar mode is configurable** — session-scoped (starts/stops with the session) or persistent (user manages externally).
16
+ - **MAP server** is user-provisioned — the plugin connects, doesn't start a server.
17
+ - **MAP scope** is per swarm team — all agents in a team share one scope.
18
+ - **Coordinator pattern** — `/swarm` calls `TeamCreate` and spawns a coordinator agent (the root role) with `team_name`. The coordinator manages team setup, task creation, and agent spawning.
19
+
20
+ ---
21
+
22
+ ## 1. Context
23
+
24
+ ### What exists today
25
+
26
+ claude-code-swarm is a Claude Code plugin that launches agent teams from openteams YAML topologies. The current architecture:
27
+
28
+ ```
29
+ .claude-swarm.json ← project config (template name)
30
+ hooks/hooks.json ← SessionStart hook (installs openteams, loads team context)
31
+ settings.json ← enables agent teams, allows openteams CLI
32
+ skills/swarm/SKILL.md ← /swarm skill definition
33
+ scripts/generate-agents.mjs ← openteams templates → AGENT.md files
34
+ templates/ ← bundled team topologies (get-shit-done, bmad-method)
35
+ ```
36
+
37
+ **Coordination today:** Agents coordinate via Claude Code's native team features (`TeamCreate`, `TaskCreate`/`TaskUpdate`, `SendMessage`). Each generated AGENT.md includes native team tool instructions. openteams is used only for topology configuration and artifact generation (`openteams generate all`).
38
+
39
+ ### What we want to add
40
+
41
+ 1. **MAP** — Real-time observability and coordination protocol for the agent swarm
42
+ 2. **sessionlog** — Session tracking, checkpointing, and rewind capability
43
+
44
+ Both are opt-in via `.claude-swarm.json` configuration.
45
+
46
+ ### What changes about openteams
47
+
48
+ openteams is now **config/generation only** — team topology definitions, role specifications, spawn rules, signal/channel schemas, and artifact generation. All runtime coordination is handled by Claude Code's native team features:
49
+
50
+ - **TeamCreate** — sets up the team with shared task list
51
+ - **TaskCreate/TaskUpdate/TaskList** — task lifecycle (replaces `openteams task` CLI)
52
+ - **SendMessage** — agent-to-agent communication (replaces `openteams message` CLI and signal emission)
53
+ - **Agent tool with `team_name`** — spawns agents as team members
54
+
55
+ openteams CLI command retained:
56
+ - `openteams generate all` — generate role artifacts (SKILL.md per role)
57
+
58
+ openteams CLI commands dropped (replaced by Claude Code native teams):
59
+ - `openteams template load` — no longer needed (no runtime state to initialize)
60
+ - `openteams task list/create/update` — replaced by `TaskCreate`/`TaskUpdate`/`TaskList`
61
+ - `openteams template emit/events` — replaced by `SendMessage`
62
+ - `openteams message send/poll` — replaced by `SendMessage`
63
+
64
+ MAP remains for **external observability** — lifecycle events for dashboards, external message injection from non-Claude-Code systems.
65
+
66
+ ---
67
+
68
+ ## 2. Systems Overview
69
+
70
+ ### 2.1 MAP (Multi-Agent Protocol)
71
+
72
+ **Package:** `@multi-agent-protocol/sdk@0.0.12` (npm)
73
+
74
+ #### Core types (from SDK)
75
+
76
+ ```typescript
77
+ // Message — the fundamental unit
78
+ interface Message<T = unknown> {
79
+ id: MessageId; // ULID, auto-generated
80
+ from: ParticipantId; // sender (agent ID or participant ID)
81
+ to: Address; // recipient(s)
82
+ timestamp: Timestamp; // ISO 8601
83
+ payload?: T; // arbitrary JSON
84
+ meta?: MessageMeta; // delivery semantics, priority, correlation
85
+ }
86
+
87
+ // Addressing — flexible targeting
88
+ type Address =
89
+ | string // shorthand agent ID
90
+ | { agent: AgentId } // direct to one agent
91
+ | { agents: AgentId[] } // multi-target
92
+ | { scope: ScopeId } // all agents in scope
93
+ | { role: string; within?: ScopeId } // by role, optionally scoped
94
+ | { parent: true } // parent agent
95
+ | { children: true } // all children
96
+ | { broadcast: true } // all agents in system
97
+
98
+ // MessageMeta — optional delivery control
99
+ interface MessageMeta {
100
+ timestamp?: Timestamp;
101
+ relationship?: "parent-to-child" | "child-to-parent" | "peer" | "broadcast";
102
+ expectsResponse?: boolean;
103
+ correlationId?: string;
104
+ priority?: "urgent" | "high" | "normal" | "low";
105
+ delivery?: "fire-and-forget" | "acknowledged" | "guaranteed";
106
+ ttlMs?: number;
107
+ }
108
+
109
+ // Agent — registered entity
110
+ interface Agent {
111
+ id: AgentId;
112
+ name?: string;
113
+ description?: string;
114
+ parent?: AgentId;
115
+ children?: AgentId[];
116
+ state: "registered" | "active" | "busy" | "idle" | "suspended" | "stopping" | "stopped" | "failed";
117
+ role?: string;
118
+ scopes?: ScopeId[];
119
+ metadata?: Record<string, unknown>;
120
+ }
121
+
122
+ // AgentConnection — per-agent client
123
+ class AgentConnection {
124
+ constructor(stream: Stream, options?: AgentConnectionOptions);
125
+ static connect(url: string, options?: AgentConnectOptions): Promise<AgentConnection>;
126
+
127
+ connect(options?): Promise<ConnectResponseResult>;
128
+ disconnect(): Promise<string | undefined>;
129
+
130
+ send(to: Address, payload?: unknown, meta?: MessageMeta): Promise<SendResponseResult>;
131
+ sendToParent(payload?, meta?): Promise<SendResponseResult>;
132
+ sendToChildren(payload?, meta?): Promise<SendResponseResult>;
133
+
134
+ onMessage(handler: (message: Message) => void): this;
135
+ offMessage(handler): this;
136
+
137
+ updateState(state: AgentState): Promise<Agent>;
138
+ subscribe(filter?: SubscriptionFilter): Promise<Subscription>;
139
+ }
140
+
141
+ // AgentConnectOptions — used with static connect()
142
+ interface AgentConnectOptions {
143
+ name?: string;
144
+ role?: string;
145
+ parent?: AgentId;
146
+ scopes?: ScopeId[];
147
+ metadata?: Record<string, unknown>;
148
+ auth?: { method: 'bearer' | 'api-key' | 'mtls' | 'none'; token?: string };
149
+ reconnection?: true | false | AgentReconnectionOptions;
150
+ }
151
+ ```
152
+
153
+ #### Built-in event types
154
+
155
+ MAP server emits these events automatically (observable via `subscribe()`):
156
+
157
+ ```
158
+ agent_registered agent_unregistered agent_state_changed
159
+ participant_connected participant_disconnected
160
+ message_sent message_delivered message_failed
161
+ scope_created scope_deleted
162
+ scope_member_joined scope_member_left
163
+ ```
164
+
165
+ These are free observability — any `ClientConnection` subscriber sees them without the agents doing anything special.
166
+
167
+ #### Transports
168
+
169
+ ```typescript
170
+ import { websocketStream, ndJsonStream, createStreamPair } from '@multi-agent-protocol/sdk';
171
+
172
+ websocketStream(ws) // WebSocket (remote servers)
173
+ ndJsonStream(stdin, out) // stdio (local pipes)
174
+ createStreamPair() // in-process (testing)
175
+ ```
176
+
177
+ ### 2.2 sessionlog
178
+
179
+ **Package:** `sessionlog` (npm)
180
+
181
+ sessionlog tracks Claude Code sessions in git with zero runtime dependencies:
182
+ - **Session state** stored in `.git/sessionlog-sessions/<id>.json`
183
+ - **Checkpoints** on shadow branches (`sessionlog/<base-commit[:7]>`)
184
+ - **Committed checkpoints** on `sessionlog/checkpoints/v1` branch
185
+ - **Secret redaction** (30+ patterns + entropy detection) applied to transcripts
186
+ - **Subagent tracking** via `SubagentAwareExtractor` — rolls up token usage and file changes across the entire agent tree
187
+ - **Rewind** — restore project to any checkpoint state
188
+ - **Resume** — discover and continue sessions from branches
189
+
190
+ sessionlog installs its own Claude Code hooks programmatically into `.claude/settings.json`:
191
+ - `SessionStart`, `SessionEnd`, `UserPromptSubmit`, `Stop`
192
+ - `PreToolUse(Task)`, `PostToolUse(Task)` — subagent lifecycle
193
+ - `PostToolUse(TodoWrite)` — compaction events
194
+
195
+ And 4 git hooks: `prepare-commit-msg`, `commit-msg`, `post-commit`, `pre-push`.
196
+
197
+ ### 2.3 openteams (config/generation only)
198
+
199
+ **Package:** `openteams` (npm)
200
+
201
+ openteams provides the team definition and generation layer:
202
+ - **Templates** — YAML topology definitions with roles, spawn rules, communication channels
203
+ - **Signal definitions** — channel/signal schemas from `team.yaml` (embedded in agent prompts as SendMessage guidance)
204
+ - **Code generation** — `openteams generate all` produces role artifacts (SKILL.md per role)
205
+
206
+ **Not used at runtime:** All openteams CLI commands except `openteams generate all` are superseded by Claude Code native teams (`TeamCreate`, `TaskCreate`/`TaskUpdate`, `SendMessage`).
207
+
208
+ ---
209
+
210
+ ## 3. Architecture
211
+
212
+ ### 3.1 The Hook Model — Constraints and Opportunities
213
+
214
+ Claude Code hooks are fire-and-forget shell commands. Key properties:
215
+
216
+ | Hook Event | stdin | stdout (exit 0) | Can Block? |
217
+ |---|---|---|---|
218
+ | `SessionStart` | `{ session_id, cwd, source }` | Injected into context | No |
219
+ | `UserPromptSubmit` | `{ session_id, cwd, prompt }` | Injected into context | Yes (exit 2) |
220
+ | `PreToolUse` | `{ session_id, tool_name, tool_input }` | JSON decision | Yes (exit 2) |
221
+ | `PostToolUse` | `{ session_id, tool_name, tool_output }` | — | No |
222
+ | `Stop` | `{ session_id, stop_reason }` | — | No |
223
+
224
+ **Critical insight:** `SessionStart` and `UserPromptSubmit` hooks can inject text directly into Claude's conversation context by writing to stdout. This is the bridge for MAP inbound coordination — a hook can read queued MAP messages and inject them as context before the agent processes the prompt.
225
+
226
+ **Limitation:** Hooks are synchronous, short-lived processes. They cannot maintain persistent connections. A long-running sidecar process is needed for real-time MAP message reception.
227
+
228
+ ### 3.2 Layered Architecture
229
+
230
+ ```
231
+ ┌─────────────────────────────────────────────────────┐
232
+ │ Claude Code Session │
233
+ │ │
234
+ │ ┌──────────────┐ ┌──────────────┐ ┌───────────┐ │
235
+ │ │ SessionStart │ │ UserPrompt │ │ PostTool │ │
236
+ │ │ Hook │ │ Submit Hook │ │ Hook │ │
237
+ │ └──────┬───────┘ └──────┬───────┘ └─────┬─────┘ │
238
+ │ │ │ │ │
239
+ └─────────┼─────────────────┼────────────────┼─────────┘
240
+ │ │ │
241
+ ┌─────▼─────┐ ┌────▼─────┐ ┌─────▼──────┐
242
+ │ Bootstrap │ │ Inject │ │ Emit │
243
+ │ (start │ │ MAP │ │ MAP │
244
+ │ sidecar, │ │ inbox │ │ events │
245
+ │ check │ │ context │ │ │
246
+ │ sessionlog│ └────┬─────┘ └─────┬──────┘
247
+ └─────┬─────┘ │ │
248
+ │ ┌────▼────────────────▼──────┐
249
+ │ │ MAP Sidecar │
250
+ ▼ │ (persistent WebSocket) │
251
+ ┌───────────┐ │ │
252
+ │ sessionlog│ │ inbox/ ← received msgs │
253
+ │ (own hooks│ │ outbox/ → sent events │
254
+ │ own life- │ └────────────┬───────────────┘
255
+ │ cycle) │ │
256
+ └───────────┘ ┌─────▼──────┐
257
+ │ MAP Server │
258
+ │ (user- │
259
+ │ provisioned│
260
+ └─────┬──────┘
261
+ │ federation
262
+ ┌─────▼──────┐
263
+ │ Listeners │
264
+ │ (dashboard,│
265
+ │ logging, │
266
+ │ other │
267
+ │ systems) │
268
+ └────────────┘
269
+ ```
270
+
271
+ ### 3.3 MAP Integration — Sidecar with Fire-and-Forget Fallback
272
+
273
+ #### Sidecar mode (configurable)
274
+
275
+ The sidecar is a persistent Node.js process that maintains a WebSocket connection to the MAP server. Two lifecycle modes:
276
+
277
+ **`"session"` mode (default):**
278
+ - Started by the `SessionStart` hook as a background process
279
+ - Stopped by the `SessionEnd` hook (SIGTERM to PID)
280
+ - Self-terminates after inactivity timeout (30 min) as safety net
281
+ - Tied to the Claude Code session lifecycle
282
+ - **Best-effort auto-recovery:** if the sidecar crashes mid-session, the `UserPromptSubmit` hook detects the missing socket, restarts the sidecar, and re-registers agents. Messages received during the gap are lost, but the connection resumes for subsequent turns.
283
+
284
+ **`"persistent"` mode:**
285
+ - User starts the sidecar independently (e.g., as a daemon or in a separate terminal)
286
+ - Plugin hooks connect to it via UNIX socket — if it's running, use it; if not, fall back
287
+ - Survives across Claude Code sessions
288
+ - Useful for long-running projects with frequent session restarts
289
+
290
+ In both modes, the sidecar:
291
+ 1. Connects to the MAP server via WebSocket
292
+ 2. Registers as the agent's MAP identity (role + team name)
293
+ 3. Joins the team's MAP scope
294
+ 4. Listens for incoming messages, writes to inbox file
295
+ 5. Accepts outbound messages via UNIX socket, forwards to MAP server
296
+
297
+ #### Sidecar ↔ hooks communication
298
+
299
+ ```
300
+ ┌──────────────┐ ┌──────────────┐
301
+ │ Hook │ ──── UNIX socket ──→ │ Sidecar │
302
+ │ (short- │ ←── file read ────── │ (long- │
303
+ │ lived) │ │ running) │
304
+ └──────────────┘ └──────────────┘
305
+
306
+ Outbound: hook writes event JSON to sidecar via UNIX socket (.generated/map/sidecar.sock)
307
+ Inbound: hook reads .generated/map/inbox.jsonl (written by sidecar)
308
+ ```
309
+
310
+ #### Fire-and-forget fallback (outbound only)
311
+
312
+ If the sidecar isn't running, hooks fall back to one-shot WebSocket connections:
313
+
314
+ ```javascript
315
+ // Pseudocode: hook fallback logic
316
+ const sidecarSocket = tryConnectLocal('.generated/map/sidecar.sock');
317
+ if (sidecarSocket) {
318
+ // Fast path: send to sidecar via local socket
319
+ sidecarSocket.write(JSON.stringify(event));
320
+ } else {
321
+ // Slow path: direct MAP server connection (fire-and-forget)
322
+ const agent = await AgentConnection.connect(config.map.server, {
323
+ name: agentName,
324
+ role: roleName,
325
+ scopes: [teamScope]
326
+ });
327
+ await agent.send({ scope: teamScope }, event);
328
+ await agent.disconnect();
329
+ }
330
+ ```
331
+
332
+ ~100-200ms overhead per event. No inbound capability. Acceptable for lifecycle events.
333
+
334
+ #### Best-effort sidecar auto-recovery
335
+
336
+ When the `UserPromptSubmit` hook detects the sidecar is not running (socket connection fails), it attempts recovery:
337
+
338
+ ```
339
+ UserPromptSubmit hook fires
340
+
341
+ ├─ Try connect to .generated/map/sidecar.sock
342
+
343
+ ├─ [if socket exists and responds]
344
+ │ Sidecar is healthy → read inbox, proceed normally
345
+
346
+ ├─ [if socket missing or connection refused]
347
+ │ 1. Check .generated/map/sidecar.pid — is process alive?
348
+ │ 2. If dead: restart sidecar (node scripts/map-sidecar.mjs &)
349
+ │ 3. Wait briefly for socket to appear (up to 2s)
350
+ │ 4. If recovery succeeds: re-register agents, proceed
351
+ │ 5. If recovery fails: log warning, fall back to fire-and-forget
352
+
353
+ └─ Read inbox (may be empty if sidecar was down)
354
+ ```
355
+
356
+ Recovery is best-effort:
357
+ - Messages received by the MAP server while the sidecar was down are lost (MAP doesn't buffer for disconnected agents by default)
358
+ - Agent registrations are re-created, but any state (inbox, in-flight messages) from the crashed sidecar is gone
359
+ - The hook never blocks the agent's turn — if recovery takes too long, it falls back silently
360
+
361
+ ### 3.4 Scope Model
362
+
363
+ **One MAP scope per swarm team.** When a swarm launches, all agents in that team share a MAP scope:
364
+
365
+ ```
366
+ scope = "swarm:<team-name>" // e.g., "swarm:get-shit-done"
367
+ agent = "<team-name>-<role>" // e.g., "get-shit-done-orchestrator"
368
+ ```
369
+
370
+ All agents register with their scope. MAP messages addressed to `{ scope: "swarm:get-shit-done" }` reach all team members.
371
+
372
+ Addressing options:
373
+ - `{ agent: "get-shit-done-executor" }` — direct to one agent
374
+ - `{ role: "executor", within: "swarm:get-shit-done" }` — all executors in this team
375
+ - `{ scope: "swarm:get-shit-done" }` — broadcast to entire team
376
+ - `{ parent: true }` — to spawning agent
377
+ - `{ children: true }` — to all spawned agents
378
+
379
+ ### 3.5 Federation-Based Observability
380
+
381
+ MAP's federation layer provides a clean mechanism for broadcasting swarm events to external systems (dashboards, logging, other agent systems) without requiring them to connect to the same MAP server.
382
+
383
+ #### How federation works
384
+
385
+ The MAP server can establish federation connections with peer systems. When a federation peer is connected, events and messages are automatically wrapped in `FederationEnvelope` and forwarded:
386
+
387
+ ```typescript
388
+ interface FederationEnvelope<T = unknown> {
389
+ payload: T; // The message or event
390
+ federation: {
391
+ sourceSystem: string; // "system-claude-swarm"
392
+ targetSystem: string; // "system-dashboard"
393
+ hopCount: number; // Loop prevention
394
+ maxHops?: number;
395
+ path?: string[]; // Systems traversed (debugging)
396
+ originTimestamp: Timestamp;
397
+ correlationId?: string; // Cross-system tracing
398
+ };
399
+ }
400
+ ```
401
+
402
+ #### Configuration
403
+
404
+ The MAP server (user-provisioned) handles federation configuration. The swarm plugin just needs to know its own system identity:
405
+
406
+ ```json
407
+ {
408
+ "map": {
409
+ "enabled": true,
410
+ "server": "ws://localhost:8080",
411
+ "systemId": "system-claude-swarm"
412
+ }
413
+ }
414
+ ```
415
+
416
+ The MAP server operator configures federation peers (dashboards, logging systems, other agent platforms) on the server side. The swarm plugin's sidecar connects as an agent — the server handles federation routing transparently.
417
+
418
+ #### What observers see
419
+
420
+ A federated observer (e.g., a dashboard on a different MAP system) receives:
421
+ 1. **MAP-native events** — `agent_registered`, `agent_state_changed`, `message_sent` etc., wrapped in federation envelopes
422
+ 2. **Custom swarm events** — `swarm.agent.spawned`, `swarm.task.dispatched` etc., as message payloads in federation envelopes
423
+ 3. **Full routing metadata** — source system, hop path, correlation IDs for cross-system tracing
424
+
425
+ This means a dashboard doesn't need to know about Claude Code or hooks — it just subscribes to federation events from `system-claude-swarm` and gets a complete view of the swarm.
426
+
427
+ #### Federation vs direct subscription
428
+
429
+ | | Direct subscription | Federation |
430
+ |---|---|---|
431
+ | **Observer location** | Same MAP server | Any MAP system |
432
+ | **Setup** | `ClientConnection` to server | Federation peer config on server |
433
+ | **Latency** | Lowest (same process) | Slightly higher (cross-system) |
434
+ | **Isolation** | Observer sees everything | Can filter by system/scope |
435
+ | **Use case** | Local development dashboard | Multi-team observability, logging services |
436
+
437
+ Both work. Federation is the right choice when observers are on separate infrastructure or when you want to aggregate events from multiple swarm instances.
438
+
439
+ ### 3.6 sessionlog Integration
440
+
441
+ **Fully independent.** sessionlog manages its own lifecycle — installation, hook registration, session tracking. The swarm plugin does NOT call `sessionlog enable` or install sessionlog.
442
+
443
+ The plugin's role is limited to:
444
+ 1. **Check** — on `SessionStart`, verify if sessionlog is active and report status
445
+ 2. **Warn** — if `sessionlog.enabled: true` in config but sessionlog isn't installed/active, output a warning
446
+ 3. **Coexist** — the plugin's hooks and sessionlog's hooks run independently; Claude Code merges them
447
+
448
+ ```
449
+ SessionStart hook output:
450
+ "## Claude Code Swarm (openteams)
451
+ Team template: get-shit-done
452
+ MAP: connected (scope: swarm:get-shit-done)
453
+ Sessionlog: ✓ active ← or "⚠ not installed (optional)"
454
+ Use /swarm to launch the team."
455
+ ```
456
+
457
+ **What sessionlog provides for swarms:**
458
+ - Full session tracking across the orchestrator and all spawned agents (via its own `PreToolUse(Task)` / `PostToolUse(Task)` hooks)
459
+ - Token usage rollup across the entire agent tree
460
+ - File change aggregation
461
+ - Checkpoint/rewind — restore the project to before the swarm made changes
462
+ - Secret-redacted transcript storage for post-mortem
463
+
464
+ **What the user does:** Install and enable sessionlog independently:
465
+ ```bash
466
+ npm install -g sessionlog
467
+ sessionlog enable --agent claude-code
468
+ ```
469
+
470
+ ### 3.7 Sessionlog → MAP Bridge (Trajectory Protocol)
471
+
472
+ When both MAP and sessionlog are active, the swarm plugin bridges sessionlog's rich session data into MAP using the **Trajectory Protocol** (`trajectory/checkpoint`). This gives persistent, queryable checkpoint storage — external dashboards can discover past checkpoints via `trajectory/list` and `trajectory/get` without needing to be subscribed at emit time.
473
+
474
+ **Configuration** via `.claude-swarm.json`:
475
+ ```json
476
+ {
477
+ "sessionlog": {
478
+ "enabled": true,
479
+ "sync": "full"
480
+ }
481
+ }
482
+ ```
483
+
484
+ **Sync levels** (`sessionlog.sync`) — controls what goes into `TrajectoryCheckpoint.metadata`:
485
+ | Level | Checkpoint metadata |
486
+ |-------|--------------|
487
+ | `"off"` | No bridge (default) |
488
+ | `"lifecycle"` | phase, turnId, startedAt, endedAt |
489
+ | `"metrics"` | Above + tokenUsage, filesTouched, stepCount, checkpointIDs |
490
+ | `"full"` | Complete SessionState snapshot |
491
+
492
+ **Sessionlog → TrajectoryCheckpoint mapping:**
493
+ | Checkpoint field | Source |
494
+ |---|---|
495
+ | `id` | `lastCheckpointID` or `${sessionID}-step${stepCount}` |
496
+ | `agentId` | `${teamName}-sidecar` |
497
+ | `sessionId` | `sessionID` |
498
+ | `label` | `"Turn {turnID} (step {stepCount}, {phase})"` |
499
+ | `metadata` | Sync-level-filtered sessionlog fields |
500
+
501
+ **How it works:**
502
+ 1. sessionlog's own hooks write session state to `.git/sessionlog-sessions/<id>.json`
503
+ 2. On every `Stop` hook (end of turn), `map-hook.mjs sessionlog-sync` reads the active session file
504
+ 3. The state is mapped into a `TrajectoryCheckpoint` (id, agentId, sessionId, label, metadata)
505
+ 4. The checkpoint is sent to the sidecar via `{ action: "trajectory-checkpoint", checkpoint }`
506
+ 5. The sidecar calls `connection.callExtension("trajectory/checkpoint", { checkpoint })`
507
+ 6. On success: checkpoint is stored on the MAP server, queryable via `trajectory/list`/`trajectory/get`
508
+ 7. On failure (server doesn't support trajectory): falls back to `connection.send()` with a `swarm.sessionlog.sync` broadcast event
509
+ 8. The checkpoint is cached at `.generated/map/sessionlog-state.json`
510
+ 9. An initial sync fires during `SessionStart` (bootstrap.sh)
511
+
512
+ **Fallback strategy:**
513
+ 1. **Sidecar + trajectory support** → `trajectory/checkpoint` → persistent queryable storage
514
+ 2. **Sidecar + no trajectory** → `callExtension` throws → fallback to `swarm.sessionlog.sync` broadcast
515
+ 3. **No sidecar** → `fireAndForgetTrajectory()` creates temp connection, tries trajectory, falls back to broadcast
516
+ 4. **MAP server unreachable** → silently dropped (never blocks the agent)
517
+
518
+ **Key design choices:**
519
+ - **No sessionlog dependency** — the bridge reads `.git/sessionlog-sessions/*.json` directly via `fs.readFileSync`. No `sessionlog` npm import.
520
+ - **Guard conditions** — the Stop hook guard checks both `map.enabled` AND `sessionlog.sync !== 'off'` before running
521
+ - **No-op when sessionlog is absent** — if the session directory doesn't exist or has no active sessions, the handler returns silently
522
+ - **Global SDK** — uses `@multi-agent-protocol/sdk` npm package, installed automatically by bootstrap.sh when MAP is enabled
523
+
524
+ **Data flow:**
525
+ ```
526
+ sessionlog hooks → .git/sessionlog-sessions/<id>.json
527
+
528
+ Stop hook fires │
529
+ │ ▼
530
+ map-hook.mjs sessionlog-sync
531
+ ├── findActiveSession() → SessionState
532
+ ├── buildTrajectoryCheckpoint(state, syncLevel, config)
533
+ │ └── { id, agentId, sessionId, label, metadata: { ... } }
534
+ ├── sendToSidecar({ action: "trajectory-checkpoint", checkpoint })
535
+ │ │
536
+ │ ▼ (sidecar)
537
+ │ connection.callExtension("trajectory/checkpoint", { checkpoint })
538
+ │ │
539
+ │ ├── success → stored as queryable checkpoint on MAP server
540
+ │ └── error → fallback: connection.send() with swarm.sessionlog.sync
541
+
542
+ └── Cache → .generated/map/sessionlog-state.json
543
+ ```
544
+
545
+ ---
546
+
547
+ ## 4. MAP Event Model
548
+
549
+ ### 4.1 Design principles
550
+
551
+ - **Observability first** — v1 focuses on making the swarm visible (what agents exist, what they're doing, when they spawn/complete)
552
+ - **Task events** — Claude Code native task lifecycle is surfaced as MAP events
553
+ - **Inter-agent messages** — agent-to-agent communication is observable by any MAP subscriber
554
+ - **Structured payloads** — events use typed payloads (not free-form text) so dashboards can parse them
555
+ - **MAP-native events are free** — `agent_registered`, `agent_state_changed`, `message_sent`, etc. are emitted by the MAP server automatically when agents register and send messages. We only need custom events for swarm-specific semantics.
556
+
557
+ ### 4.2 Outbound events (hooks → MAP)
558
+
559
+ These are custom events emitted by the plugin's hooks. They supplement the MAP-native events with swarm-specific context.
560
+
561
+ #### Agent lifecycle events
562
+
563
+ Emitted via `PreToolUse(Task)` and `PostToolUse(Task)` hooks:
564
+
565
+ ```typescript
566
+ // When orchestrator spawns an executor
567
+ {
568
+ to: { scope: "swarm:get-shit-done" },
569
+ payload: {
570
+ type: "swarm.agent.spawned",
571
+ agent: "get-shit-done-executor",
572
+ role: "executor",
573
+ parent: "get-shit-done-orchestrator",
574
+ task: "Implement authentication module" // summary of the spawning prompt
575
+ },
576
+ meta: { relationship: "parent-to-child" }
577
+ }
578
+
579
+ // When executor completes
580
+ {
581
+ to: { scope: "swarm:get-shit-done" },
582
+ payload: {
583
+ type: "swarm.agent.completed",
584
+ agent: "get-shit-done-executor",
585
+ role: "executor",
586
+ parent: "get-shit-done-orchestrator",
587
+ filesTouched: ["src/auth.ts", "src/auth.test.ts"],
588
+ durationMs: 45000
589
+ },
590
+ meta: { relationship: "child-to-parent" }
591
+ }
592
+ ```
593
+
594
+ #### Turn lifecycle events
595
+
596
+ Emitted via `UserPromptSubmit` and `Stop` hooks:
597
+
598
+ ```typescript
599
+ // Turn started
600
+ {
601
+ to: { scope: "swarm:get-shit-done" },
602
+ payload: {
603
+ type: "swarm.turn.started",
604
+ agent: "get-shit-done-orchestrator",
605
+ role: "orchestrator",
606
+ promptLength: 150
607
+ }
608
+ }
609
+
610
+ // Turn completed
611
+ {
612
+ to: { scope: "swarm:get-shit-done" },
613
+ payload: {
614
+ type: "swarm.turn.completed",
615
+ agent: "get-shit-done-orchestrator",
616
+ role: "orchestrator",
617
+ stopReason: "end_turn"
618
+ }
619
+ }
620
+ ```
621
+
622
+ #### Task events
623
+
624
+ Emitted via `PreToolUse(Task)` and `PostToolUse(Task)`. These map to whatever task system is active — Claude Code's native `Agent` tool dispatches are the primary source. The event format is task-system-agnostic:
625
+
626
+ ```typescript
627
+ // Task dispatched (orchestrator spawns a team agent for a task)
628
+ {
629
+ to: { scope: "swarm:get-shit-done" },
630
+ payload: {
631
+ type: "swarm.task.dispatched",
632
+ taskId: "tool-use-id-abc123", // Claude Code tool_use ID
633
+ agent: "get-shit-done-orchestrator", // dispatcher
634
+ targetAgent: "get-shit-done-executor",
635
+ targetRole: "executor",
636
+ description: "Implement user login endpoint"
637
+ }
638
+ }
639
+
640
+ // Task completed
641
+ {
642
+ to: { scope: "swarm:get-shit-done" },
643
+ payload: {
644
+ type: "swarm.task.completed",
645
+ taskId: "tool-use-id-abc123",
646
+ agent: "get-shit-done-executor",
647
+ parent: "get-shit-done-orchestrator",
648
+ status: "completed",
649
+ filesTouched: ["src/auth.ts", "src/auth.test.ts"]
650
+ }
651
+ }
652
+ ```
653
+
654
+ The `taskId` is the Claude Code `tool_use` ID from the hook's stdin data. This provides natural correlation between dispatch and completion without requiring a separate task tracking system.
655
+
656
+ ### 4.3 Agent registration model
657
+
658
+ **Team-level agents get separate MAP registrations. Internal subagents do not.**
659
+
660
+ When the orchestrator spawns a team role (e.g., executor, planner, verifier), the sidecar registers a new MAP agent with parent/child relationship:
661
+
662
+ ```typescript
663
+ // Sidecar receives PreToolUse(Task) event from hook
664
+ // The Task is spawning a team agent (name matches a role in the topology)
665
+ await connection.send(/* agents.register */, {
666
+ agentId: "get-shit-done-executor",
667
+ name: "executor",
668
+ role: "executor",
669
+ parent: "get-shit-done-orchestrator",
670
+ scopes: ["swarm:get-shit-done"],
671
+ metadata: { template: "get-shit-done", position: "spawned" }
672
+ });
673
+ ```
674
+
675
+ When the team agent completes, the sidecar unregisters it:
676
+ ```typescript
677
+ await connection.send(/* agents.unregister */, {
678
+ agentId: "get-shit-done-executor",
679
+ reason: "task completed"
680
+ });
681
+ ```
682
+
683
+ **What counts as a "team agent":** Any agent spawned via the `Agent` tool whose name matches a role defined in the openteams topology (`team.yaml`). The sidecar checks the spawned agent's name against the team's role list.
684
+
685
+ **What does NOT get registered:** If a team agent (e.g., executor) internally spawns Claude Code subagents for its own use (e.g., a research subagent), those are internal to the executor and invisible to MAP. This keeps the MAP agent tree clean — it mirrors the team topology, not every Claude Code process.
686
+
687
+ This means a dashboard querying `agents.get("get-shit-done-orchestrator", { include: { descendants: true } })` sees:
688
+ ```
689
+ orchestrator
690
+ ├── planner
691
+ ├── executor
692
+ ├── verifier
693
+ └── researcher
694
+ ```
695
+
696
+ Not:
697
+ ```
698
+ orchestrator
699
+ ├── planner
700
+ │ └── planner-internal-search-subagent ← NOT registered
701
+ ├── executor
702
+ │ ├── executor-internal-test-runner ← NOT registered
703
+ │ └── executor-internal-linter ← NOT registered
704
+ └── verifier
705
+ ```
706
+
707
+ ### 4.4 MAP-native events (free observability)
708
+
709
+ These are emitted automatically by the MAP server — no plugin work needed. A `ClientConnection` subscriber or federated observer sees:
710
+
711
+ | Event | When | Data |
712
+ |---|---|---|
713
+ | `agent_registered` | Sidecar registers agent | `{ agentId, name, role, scopes }` |
714
+ | `agent_state_changed` | Agent calls `updateState()` | `{ agentId, previousState, newState }` |
715
+ | `agent_unregistered` | Agent disconnects | `{ agentId, reason }` |
716
+ | `message_sent` | Any `send()` call | `{ messageId, from, to }` |
717
+ | `message_delivered` | Message reaches recipient | `{ messageId, deliveredTo }` |
718
+ | `scope_member_joined` | Agent joins scope | `{ scopeId, agentId }` |
719
+ | `scope_member_left` | Agent leaves scope | `{ scopeId, agentId }` |
720
+
721
+ Combined with our custom events, a dashboard gets a complete picture of the swarm without agents needing to do anything special.
722
+
723
+ ### 4.5 Agent state mapping
724
+
725
+ The sidecar maps Claude Code session phases to MAP agent states:
726
+
727
+ | Claude Code Phase | MAP AgentState | When |
728
+ |---|---|---|
729
+ | Session started | `"active"` | `SessionStart` hook |
730
+ | Processing prompt | `"busy"` | `UserPromptSubmit` hook |
731
+ | Waiting for input | `"idle"` | `Stop` hook |
732
+ | Session ended | `"stopped"` | `SessionEnd` hook |
733
+ | Spawning subagent | (child registered as `"active"`) | `PreToolUse(Task)` |
734
+ | Subagent done | (child state → `"stopped"`) | `PostToolUse(Task)` |
735
+
736
+ ### 4.6 Inbound messages (MAP → agent context)
737
+
738
+ When the sidecar receives messages addressed to this agent, it queues them in `.generated/map/inbox.jsonl`. The `UserPromptSubmit` hook reads the inbox and injects them as context.
739
+
740
+ **Injected format (structured markdown):**
741
+
742
+ ```markdown
743
+ ## [MAP] 2 pending messages
744
+
745
+ **From get-shit-done-verifier** (role: verifier, 3s ago)
746
+ > Module A verification failed. 3 test failures in src/auth.test.ts.
747
+ > Priority: high
748
+
749
+ **From get-shit-done-planner** (role: planner, 8s ago)
750
+ > Task 4 is ready for execution. Files: src/db.ts, src/models/user.ts
751
+ > Correlation: task-4-impl
752
+ ```
753
+
754
+ This format is:
755
+ - Readable by LLMs (structured markdown, not raw JSON)
756
+ - Includes metadata (sender role, age, priority) without overwhelming
757
+ - Actionable — the agent can respond by sending messages back via MAP
758
+
759
+ ---
760
+
761
+ ## 5. Hook Ordering
762
+
763
+ ### 5.1 Design principle
764
+
765
+ **The swarm plugin controls its own hook ordering. sessionlog controls its own.** They run independently. The plugin does not call sessionlog's CLI or manage its hooks.
766
+
767
+ Claude Code merges hooks from multiple sources:
768
+ - Plugin hooks (`hooks/hooks.json`) — the swarm plugin's hooks
769
+ - Project hooks (`.claude/settings.json`) — sessionlog's hooks (and any user hooks)
770
+
771
+ The plugin's `SessionStart` hook checks sessionlog status but doesn't depend on sessionlog running first. sessionlog is resilient to ordering — its `SessionStart` hook is idempotent.
772
+
773
+ ### 5.2 Plugin hook ordering (within `hooks/hooks.json`)
774
+
775
+ The plugin's own hooks execute in declaration order:
776
+
777
+ #### SessionStart
778
+
779
+ ```
780
+ 1. Read .claude-swarm.json (config)
781
+ 2. Ensure openteams is installed
782
+ 3. Check sessionlog status (report, don't manage)
783
+ 4. [if map.enabled] Start sidecar (session mode) or verify sidecar running (persistent mode)
784
+ 5. Output team context + status to stdout (injected into conversation)
785
+ ```
786
+
787
+ #### UserPromptSubmit
788
+
789
+ ```
790
+ 1. [if map.enabled] Read .generated/map/inbox.jsonl
791
+ 2. Format pending messages as structured markdown
792
+ 3. Clear processed messages from inbox
793
+ 4. Output to stdout (injected into agent's turn context)
794
+ ```
795
+
796
+ #### PreToolUse (matcher: "Task")
797
+
798
+ ```
799
+ 1. [if map.enabled] Emit swarm.agent.spawned event
800
+ 2. [if map.enabled] Emit swarm.task.dispatched event
801
+ ```
802
+
803
+ #### PostToolUse (matcher: "Task")
804
+
805
+ ```
806
+ 1. [if map.enabled] Emit swarm.agent.completed event
807
+ 2. [if map.enabled] Emit swarm.task.completed event
808
+ ```
809
+
810
+ #### Stop
811
+
812
+ ```
813
+ 1. [if map.enabled] Emit swarm.turn.completed event
814
+ 2. [if map.enabled] Update agent state to "idle"
815
+ ```
816
+
817
+ #### SessionEnd
818
+
819
+ ```
820
+ 1. [if map.enabled, session mode] Send SIGTERM to sidecar PID
821
+ 2. [if map.enabled] Update agent state to "stopped"
822
+ ```
823
+
824
+ ### 5.3 No ordering dependency on sessionlog
825
+
826
+ sessionlog's hooks run in whatever order Claude Code assigns them. The swarm plugin neither depends on nor interferes with sessionlog's execution. If sessionlog isn't installed, the swarm plugin works identically — it just reports "sessionlog: not installed" in the context output.
827
+
828
+ ---
829
+
830
+ ## 6. Configuration Schema
831
+
832
+ ### `.claude-swarm.json`
833
+
834
+ ```json
835
+ {
836
+ "template": "get-shit-done",
837
+
838
+ "map": {
839
+ "enabled": true,
840
+ "server": "ws://localhost:8080",
841
+ "scope": "my-project-swarm",
842
+ "systemId": "system-claude-swarm",
843
+ "sidecar": "session"
844
+ },
845
+
846
+ "sessionlog": {
847
+ "enabled": true
848
+ }
849
+ }
850
+ ```
851
+
852
+ | Field | Type | Default | Description |
853
+ |---|---|---|---|
854
+ | `template` | `string` | — | Team topology name or path (required) |
855
+ | `map.enabled` | `boolean` | `false` | Enable MAP integration |
856
+ | `map.server` | `string` | `"ws://localhost:8080"` | MAP server WebSocket URL (must be running) |
857
+ | `map.scope` | `string` | `"swarm:<template>"` | MAP scope for this team (auto-derived if omitted) |
858
+ | `map.systemId` | `string` | `"system-claude-swarm"` | Federation system identity for this swarm instance |
859
+ | `map.sidecar` | `"session" \| "persistent"` | `"session"` | Sidecar lifecycle mode |
860
+ | `sessionlog.enabled` | `boolean` | `false` | Check for sessionlog and report status |
861
+
862
+ ### Minimal config (no integrations)
863
+
864
+ ```json
865
+ { "template": "get-shit-done" }
866
+ ```
867
+
868
+ ### Full config
869
+
870
+ ```json
871
+ {
872
+ "template": "get-shit-done",
873
+ "map": {
874
+ "enabled": true,
875
+ "server": "ws://localhost:8080",
876
+ "systemId": "my-project-swarm",
877
+ "sidecar": "session"
878
+ },
879
+ "sessionlog": {
880
+ "enabled": true
881
+ }
882
+ }
883
+ ```
884
+
885
+ ---
886
+
887
+ ## 7. File Changes
888
+
889
+ ### New files
890
+
891
+ | File | Purpose |
892
+ |---|---|
893
+ | `scripts/map-sidecar.mjs` | MAP sidecar process — persistent WebSocket, inbox/outbox, agent registration |
894
+ | `scripts/map-hook.mjs` | MAP hook helper — inbox injection, event emission, fallback logic |
895
+ | `scripts/bootstrap.sh` | Unified SessionStart entry point — openteams, MAP, sessionlog status |
896
+ | `docs/design.md` | This document |
897
+
898
+ ### Modified files
899
+
900
+ | File | Change |
901
+ |---|---|
902
+ | `hooks/hooks.json` | Replace inline SessionStart; add `UserPromptSubmit`, `PreToolUse(Task)`, `PostToolUse(Task)`, `Stop`, `SessionEnd` hooks |
903
+ | `settings.json` | Add `Bash(node *)` permission for sidecar/hooks |
904
+ | `scripts/generate-agents.mjs` | Replace openteams messaging section with MAP coordination in generated AGENT.md; add scope/addressing info |
905
+ | `skills/swarm/SKILL.md` | Document MAP and sessionlog in the launch flow |
906
+ | `CLAUDE.md` | Update architecture description |
907
+
908
+ ### Generated files (in `.generated/`, gitignored)
909
+
910
+ | File | Purpose |
911
+ |---|---|
912
+ | `.generated/map/inbox.jsonl` | Queued inbound MAP messages |
913
+ | `.generated/map/sidecar.pid` | Sidecar process PID (session mode) |
914
+ | `.generated/map/sidecar.sock` | UNIX socket for hook ↔ sidecar communication |
915
+
916
+ ---
917
+
918
+ ## 8. Detailed Flows
919
+
920
+ ### 8.1 Session Start (full flow)
921
+
922
+ ```
923
+ Claude Code starts session
924
+
925
+
926
+ SessionStart hook fires (hooks/hooks.json)
927
+
928
+
929
+ scripts/bootstrap.sh
930
+
931
+ ├─ 1. Read .claude-swarm.json
932
+ │ Parse template, map, sessionlog config
933
+
934
+ ├─ 2. Install openteams (if needed)
935
+ │ command -v openteams || npm install -g openteams
936
+
937
+ ├─ 3. [if sessionlog.enabled]
938
+ │ Check: command -v sessionlog && sessionlog status
939
+ │ Report status (do NOT install or enable)
940
+ │ Warn if not active: "sessionlog configured but not installed"
941
+
942
+ ├─ 4. [if map.enabled]
943
+ │ 4a. [sidecar=session]
944
+ │ node scripts/map-sidecar.mjs \
945
+ │ --server ws://localhost:8080 \
946
+ │ --scope swarm:get-shit-done \
947
+ │ --agent get-shit-done-orchestrator \
948
+ │ --role orchestrator &
949
+ │ Write PID to .generated/map/sidecar.pid
950
+ │ 4b. [sidecar=persistent]
951
+ │ Check if sidecar is running via .generated/map/sidecar.sock
952
+ │ Warn if not running
953
+
954
+ └─ 5. Output to stdout (injected as context):
955
+ "## Claude Code Swarm (openteams)
956
+ Team template: get-shit-done
957
+ MAP: connected (scope: swarm:get-shit-done)
958
+ Sessionlog: ✓ active
959
+ Use /swarm to launch the team."
960
+ ```
961
+
962
+ ### 8.2 MAP Message Flow (inbound)
963
+
964
+ ```
965
+ External agent sends MAP message
966
+
967
+
968
+ MAP Server routes to { agent: "gsd-executor" }
969
+
970
+
971
+ Sidecar receives via WebSocket (onMessage handler)
972
+
973
+
974
+ Sidecar appends to .generated/map/inbox.jsonl:
975
+ {"id":"01HX...","from":"gsd-planner","to":{"agent":"gsd-executor"},
976
+ "timestamp":"2026-03-01T10:30:45Z",
977
+ "payload":{"type":"task.ready","taskId":"4","files":["src/db.ts"]},
978
+ "meta":{"priority":"high"}}
979
+
980
+
981
+ [Next turn: user submits prompt or orchestrator dispatches]
982
+
983
+
984
+ UserPromptSubmit hook fires
985
+
986
+
987
+ scripts/map-hook.mjs --action inject
988
+
989
+ ├─ Read .generated/map/inbox.jsonl
990
+ ├─ Format as structured markdown
991
+ ├─ Truncate inbox (clear processed messages)
992
+ └─ Output to stdout:
993
+ "## [MAP] 1 pending message
994
+ **From gsd-planner** (role: planner, 3s ago)
995
+ > Task 4 is ready. Files: src/db.ts
996
+ > Priority: high"
997
+
998
+
999
+ Agent sees MAP messages as part of its turn context
1000
+ ```
1001
+
1002
+ ### 8.3 MAP Event Flow (outbound)
1003
+
1004
+ ```
1005
+ Agent spawns a subagent (PreToolUse: Task)
1006
+
1007
+
1008
+ PreToolUse(Task) hook fires (hooks/hooks.json)
1009
+
1010
+
1011
+ scripts/map-hook.mjs --action emit
1012
+ Receives on stdin: { tool_name: "Task", tool_input: { name: "executor", prompt: "..." } }
1013
+
1014
+ ├─ [if sidecar running]
1015
+ │ Connect to .generated/map/sidecar.sock
1016
+ │ Send: { type: "swarm.agent.spawned", agent: "gsd-executor", ... }
1017
+ │ Sidecar forwards to MAP server
1018
+
1019
+ └─ [if sidecar not running — fallback]
1020
+ AgentConnection.connect(config.map.server, { name: agentName })
1021
+ agent.send({ scope: teamScope }, { type: "swarm.agent.spawned", ... })
1022
+ agent.disconnect()
1023
+ ```
1024
+
1025
+ ### 8.4 Dashboard / Observer View
1026
+
1027
+ #### Option A: Direct subscription (same MAP server)
1028
+
1029
+ A MAP `ClientConnection` can subscribe to the team scope and see the full swarm:
1030
+
1031
+ ```typescript
1032
+ import { ClientConnection, websocketStream, EVENT_TYPES } from '@multi-agent-protocol/sdk';
1033
+
1034
+ const client = new ClientConnection(websocketStream(ws));
1035
+ await client.connect();
1036
+
1037
+ // Subscribe to all events in the swarm scope
1038
+ const sub = await client.subscribe({
1039
+ scopes: ["swarm:get-shit-done"],
1040
+ eventTypes: [
1041
+ EVENT_TYPES.AGENT_REGISTERED,
1042
+ EVENT_TYPES.AGENT_STATE_CHANGED,
1043
+ EVENT_TYPES.MESSAGE_SENT,
1044
+ EVENT_TYPES.MESSAGE_DELIVERED
1045
+ ]
1046
+ });
1047
+
1048
+ sub.onEvent((event) => {
1049
+ // See: agent registered, state changes, all messages, task events
1050
+ console.log(`[${event.type}]`, event.data);
1051
+ });
1052
+
1053
+ // Also receive custom swarm events via message subscription
1054
+ client.onMessage((msg) => {
1055
+ // See: swarm.agent.spawned, swarm.task.dispatched, etc.
1056
+ console.log(`[${msg.payload?.type}]`, msg.payload);
1057
+ });
1058
+ ```
1059
+
1060
+ #### Option B: Federation (separate MAP system)
1061
+
1062
+ A dashboard running on a different MAP system receives events via federation. The MAP server forwards all scope events wrapped in `FederationEnvelope`:
1063
+
1064
+ ```typescript
1065
+ // Dashboard on a separate MAP system
1066
+ // Server-side: federation peer configured to accept from "system-claude-swarm"
1067
+
1068
+ // Dashboard subscribes to federation events
1069
+ const sub = await client.subscribe({
1070
+ eventTypes: [
1071
+ EVENT_TYPES.FEDERATION_CONNECTED,
1072
+ EVENT_TYPES.AGENT_REGISTERED, // forwarded from swarm system
1073
+ EVENT_TYPES.AGENT_STATE_CHANGED, // forwarded from swarm system
1074
+ EVENT_TYPES.MESSAGE_SENT // forwarded from swarm system
1075
+ ]
1076
+ });
1077
+
1078
+ // Events arrive with federation metadata for cross-system tracing
1079
+ sub.onEvent((event) => {
1080
+ // event.data may include federation.sourceSystem = "system-claude-swarm"
1081
+ console.log(`[federated:${event.type}]`, event.data);
1082
+ });
1083
+ ```
1084
+
1085
+ This is especially useful for:
1086
+ - **Multi-team observability** — aggregate events from multiple swarm instances on different machines
1087
+ - **Logging services** — forward swarm events to a centralized logging/monitoring system
1088
+ - **Cross-platform coordination** — a dashboard system that monitors both Claude Code swarms and other agent platforms
1089
+
1090
+ ---
1091
+
1092
+ ## 9. Open Questions
1093
+
1094
+ ### ~~9.1 Sidecar crash recovery~~ (RESOLVED)
1095
+
1096
+ **Decision:** Best-effort auto-recovery. The `UserPromptSubmit` hook detects missing sidecar and restarts it. Messages during the gap are lost. See section 3.3 "Best-effort sidecar auto-recovery" for details.
1097
+
1098
+ ### 9.2 Multiple concurrent swarms
1099
+
1100
+ **Q:** What happens if a user launches two swarm teams in the same session?
1101
+
1102
+ **Leaning:** Not supported in v1. Each session has one `.claude-swarm.json` config and one MAP scope. Document this limitation.
1103
+
1104
+ ### 9.3 Hook merge ordering guarantees
1105
+
1106
+ **Q:** Does Claude Code guarantee plugin hooks run before or after project hooks?
1107
+
1108
+ **Current approach:** We don't depend on ordering between our hooks and sessionlog's hooks. Our hooks are self-contained. Test empirically to verify no conflicts.
1109
+
1110
+ ### ~~9.4 Subagent MAP registration~~ (RESOLVED)
1111
+
1112
+ **Decision:** Team-level agents (roles from the openteams topology) get separate MAP registrations with parent/child relationships. Internal subagents spawned by a team agent do NOT get registered. See section 4.3 for details.
1113
+
1114
+ ### ~~9.5 openteams task events vs MAP task events~~ (RESOLVED)
1115
+
1116
+ **Decision:** MAP task events map to Claude Code native task lifecycle. The primary source is Claude Code agent spawning via the `Agent` tool (with `team_name`), and task management via `TaskCreate`/`TaskUpdate`. openteams is not used at runtime — it provides structural definitions only. MAP provides the external observability layer.
1117
+
1118
+ ### ~~9.6 Federation configuration ownership~~ (RESOLVED)
1119
+
1120
+ **Decision:** Server operator configures federation peers. The plugin just connects as an agent. The `map.systemId` config field identifies this swarm instance for federation envelope routing.
1121
+
1122
+ ### ~~9.7 Sidecar agent identity when multiple team agents are spawned~~ (RESOLVED)
1123
+
1124
+ **Decision:** Single connection. The sidecar uses one `AgentConnection` and calls `agents.register()` / `agents.spawn()` to create child agents on behalf of the team.
1125
+
1126
+ ---
1127
+
1128
+ ## 10. Implementation Phases
1129
+
1130
+ ### Phase 1: Foundation
1131
+
1132
+ - [ ] Create `scripts/bootstrap.sh` — unified SessionStart entry point
1133
+ - [ ] Update `hooks/hooks.json` to use bootstrap script
1134
+ - [ ] Add sessionlog status check (not lifecycle management)
1135
+ - [ ] Update `.claude-swarm.json` schema with `map` and `sessionlog` fields
1136
+ - [ ] Update `settings.json` permissions
1137
+ - [ ] Update `scripts/generate-agents.mjs` to drop openteams messaging, add MAP context
1138
+
1139
+ ### Phase 2: MAP Sidecar + Outbound Events
1140
+
1141
+ - [ ] Create `scripts/map-sidecar.mjs` — persistent WebSocket, agent registration, inbox/outbox
1142
+ - [ ] Create `scripts/map-hook.mjs` — event emission with sidecar/fallback logic
1143
+ - [ ] Add `PreToolUse(Task)`, `PostToolUse(Task)`, `Stop`, `SessionEnd` hooks
1144
+ - [ ] Implement sidecar lifecycle (session + persistent modes)
1145
+ - [ ] Test with a local MAP server + `ClientConnection` subscriber
1146
+
1147
+ ### Phase 3: MAP Inbound + Recovery
1148
+
1149
+ - [ ] Add `UserPromptSubmit` hook for MAP inbox injection
1150
+ - [ ] Implement inbox formatting (structured markdown)
1151
+ - [ ] Implement best-effort sidecar auto-recovery in `UserPromptSubmit` hook
1152
+ - [ ] Test end-to-end: external sender → sidecar inbox → hook injection → agent sees message
1153
+ - [ ] Test recovery: kill sidecar mid-session → next prompt restarts it
1154
+
1155
+ ### Phase 4: Team Agent Registration
1156
+
1157
+ - [ ] Sidecar registers team-level agents on `PreToolUse(Task)` when name matches topology role
1158
+ - [ ] Sidecar unregisters team agents on `PostToolUse(Task)` completion
1159
+ - [ ] Ignore internal subagents (names not matching topology roles)
1160
+ - [ ] MAP server tracks team agent tree (parent/child relationships)
1161
+ - [ ] Dashboard can query `agents.get(orchestratorId, { include: { descendants: true } })`
1162
+
1163
+ ### Phase 5: Polish
1164
+
1165
+ - [ ] Update `/swarm` SKILL.md with MAP/sessionlog documentation
1166
+ - [ ] Update CLAUDE.md with new architecture
1167
+ - [ ] Error handling: MAP server down, sidecar crash, malformed messages
1168
+ - [ ] Agent state transitions (active → busy → idle → stopped)
1169
+ - [ ] Verify federation event forwarding works with federated observers
1170
+
1171
+ ---
1172
+
1173
+ ## 11. Dependencies
1174
+
1175
+ | Package | Purpose | Install method | Required? |
1176
+ |---|---|---|---|
1177
+ | `openteams` | Team topologies, task CLI | `npm install -g openteams` | Yes |
1178
+ | `sessionlog` | Session tracking, checkpointing | User installs independently | Only if `sessionlog.enabled` |
1179
+ | `@multi-agent-protocol/sdk` | MAP connections, messaging | `npm install -g @multi-agent-protocol/sdk` | Only if `map.enabled` |
1180
+
1181
+ openteams is installed on-demand by `scripts/bootstrap.sh`. sessionlog is user-managed. MAP SDK is installed on-demand when MAP is enabled. The plugin itself has zero bundled npm dependencies.