claude-code-swarm 0.3.7 → 0.3.8

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 (1357) hide show
  1. package/.claude/settings.json +1 -0
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/CLAUDE.md +44 -1
  5. package/package.json +4 -1
  6. package/scripts/bootstrap-bg.mjs +31 -0
  7. package/scripts/bootstrap.mjs +30 -4
  8. package/scripts/dev-link.mjs +179 -0
  9. package/scripts/map-hook.mjs +30 -44
  10. package/scripts/map-sidecar.mjs +156 -27
  11. package/src/__tests__/bootstrap.test.mjs +227 -237
  12. package/src/__tests__/config.test.mjs +275 -1
  13. package/src/__tests__/e2e-reconnection.test.mjs +537 -0
  14. package/src/__tests__/helpers.mjs +6 -0
  15. package/src/__tests__/index.test.mjs +4 -0
  16. package/src/__tests__/log.test.mjs +510 -0
  17. package/src/__tests__/map-connection.test.mjs +7 -0
  18. package/src/__tests__/paths.test.mjs +1 -1
  19. package/src/bootstrap.mjs +129 -94
  20. package/src/config.mjs +36 -9
  21. package/src/index.mjs +4 -0
  22. package/src/log.mjs +152 -0
  23. package/src/map-connection.mjs +40 -9
  24. package/src/mesh-connection.mjs +8 -12
  25. package/src/opentasks-client.mjs +5 -2
  26. package/src/paths.mjs +11 -8
  27. package/src/roles.mjs +4 -3
  28. package/src/sessionlog.mjs +38 -2
  29. package/src/sidecar-client.mjs +13 -2
  30. package/src/sidecar-server.mjs +16 -26
  31. package/src/skilltree-client.mjs +4 -1
  32. package/src/swarmkit-resolver.mjs +17 -1
  33. package/src/template.mjs +4 -1
  34. package/vitest.config.mjs +4 -0
  35. package/references/agent-inbox/CLAUDE.md +0 -151
  36. package/references/agent-inbox/README.md +0 -238
  37. package/references/agent-inbox/docs/CLAUDE-CODE-SWARM-PROPOSAL.md +0 -137
  38. package/references/agent-inbox/docs/DESIGN.md +0 -1156
  39. package/references/agent-inbox/hooks/inbox-hook.mjs +0 -119
  40. package/references/agent-inbox/hooks/register-hook.mjs +0 -69
  41. package/references/agent-inbox/package-lock.json +0 -3347
  42. package/references/agent-inbox/package.json +0 -58
  43. package/references/agent-inbox/rules/agent-inbox.md +0 -78
  44. package/references/agent-inbox/src/federation/address.ts +0 -61
  45. package/references/agent-inbox/src/federation/connection-manager.ts +0 -573
  46. package/references/agent-inbox/src/federation/delivery-queue.ts +0 -222
  47. package/references/agent-inbox/src/federation/index.ts +0 -6
  48. package/references/agent-inbox/src/federation/routing-engine.ts +0 -188
  49. package/references/agent-inbox/src/federation/trust.ts +0 -71
  50. package/references/agent-inbox/src/index.ts +0 -404
  51. package/references/agent-inbox/src/ipc/ipc-server.ts +0 -265
  52. package/references/agent-inbox/src/jsonrpc/mail-server.ts +0 -382
  53. package/references/agent-inbox/src/map/map-client.ts +0 -414
  54. package/references/agent-inbox/src/mcp/mcp-proxy.ts +0 -326
  55. package/references/agent-inbox/src/mcp/mcp-server.ts +0 -272
  56. package/references/agent-inbox/src/mesh/delivery-bridge.ts +0 -110
  57. package/references/agent-inbox/src/mesh/mesh-connector.ts +0 -41
  58. package/references/agent-inbox/src/mesh/mesh-transport.ts +0 -157
  59. package/references/agent-inbox/src/mesh/type-mapper.ts +0 -239
  60. package/references/agent-inbox/src/push/notifier.ts +0 -233
  61. package/references/agent-inbox/src/registry/warm-registry.ts +0 -255
  62. package/references/agent-inbox/src/router/message-router.ts +0 -175
  63. package/references/agent-inbox/src/storage/interface.ts +0 -48
  64. package/references/agent-inbox/src/storage/memory.ts +0 -145
  65. package/references/agent-inbox/src/storage/sqlite.ts +0 -671
  66. package/references/agent-inbox/src/traceability/traceability.ts +0 -183
  67. package/references/agent-inbox/src/types.ts +0 -329
  68. package/references/agent-inbox/test/federation/address.test.ts +0 -101
  69. package/references/agent-inbox/test/federation/connection-manager.test.ts +0 -546
  70. package/references/agent-inbox/test/federation/delivery-queue.test.ts +0 -159
  71. package/references/agent-inbox/test/federation/integration.test.ts +0 -857
  72. package/references/agent-inbox/test/federation/routing-engine.test.ts +0 -117
  73. package/references/agent-inbox/test/federation/sdk-integration.test.ts +0 -744
  74. package/references/agent-inbox/test/federation/trust.test.ts +0 -89
  75. package/references/agent-inbox/test/ipc-jsonrpc.test.ts +0 -113
  76. package/references/agent-inbox/test/ipc-new-commands.test.ts +0 -200
  77. package/references/agent-inbox/test/ipc-server.test.ts +0 -197
  78. package/references/agent-inbox/test/mail-server.test.ts +0 -285
  79. package/references/agent-inbox/test/map-client.test.ts +0 -408
  80. package/references/agent-inbox/test/mcp-proxy.test.ts +0 -191
  81. package/references/agent-inbox/test/mesh/delivery-bridge.test.ts +0 -178
  82. package/references/agent-inbox/test/mesh/e2e-mesh.test.ts +0 -527
  83. package/references/agent-inbox/test/mesh/e2e-real-meshpeer.test.ts +0 -629
  84. package/references/agent-inbox/test/mesh/federation-mesh.test.ts +0 -269
  85. package/references/agent-inbox/test/mesh/mesh-connector.test.ts +0 -66
  86. package/references/agent-inbox/test/mesh/mesh-transport.test.ts +0 -191
  87. package/references/agent-inbox/test/mesh/meshpeer-integration.test.ts +0 -442
  88. package/references/agent-inbox/test/mesh/mock-mesh.ts +0 -125
  89. package/references/agent-inbox/test/mesh/mock-meshpeer.ts +0 -266
  90. package/references/agent-inbox/test/mesh/type-mapper.test.ts +0 -226
  91. package/references/agent-inbox/test/message-router.test.ts +0 -184
  92. package/references/agent-inbox/test/push-notifier.test.ts +0 -139
  93. package/references/agent-inbox/test/registry/warm-registry.test.ts +0 -171
  94. package/references/agent-inbox/test/sqlite-prefix.test.ts +0 -192
  95. package/references/agent-inbox/test/sqlite-storage.test.ts +0 -243
  96. package/references/agent-inbox/test/storage.test.ts +0 -196
  97. package/references/agent-inbox/test/traceability.test.ts +0 -123
  98. package/references/agent-inbox/test/wake.test.ts +0 -330
  99. package/references/agent-inbox/tsconfig.json +0 -20
  100. package/references/agent-inbox/tsup.config.ts +0 -10
  101. package/references/agent-inbox/vitest.config.ts +0 -8
  102. package/references/minimem/.claude/settings.json +0 -7
  103. package/references/minimem/.sudocode/issues.jsonl +0 -18
  104. package/references/minimem/.sudocode/specs.jsonl +0 -1
  105. package/references/minimem/CLAUDE.md +0 -329
  106. package/references/minimem/README.md +0 -565
  107. package/references/minimem/claude-plugin/.claude-plugin/plugin.json +0 -10
  108. package/references/minimem/claude-plugin/.mcp.json +0 -7
  109. package/references/minimem/claude-plugin/README.md +0 -158
  110. package/references/minimem/claude-plugin/commands/recall.md +0 -47
  111. package/references/minimem/claude-plugin/commands/remember.md +0 -41
  112. package/references/minimem/claude-plugin/hooks/__tests__/hooks.test.ts +0 -272
  113. package/references/minimem/claude-plugin/hooks/hooks.json +0 -27
  114. package/references/minimem/claude-plugin/hooks/session-end.sh +0 -86
  115. package/references/minimem/claude-plugin/hooks/session-start.sh +0 -85
  116. package/references/minimem/claude-plugin/skills/memory/SKILL.md +0 -108
  117. package/references/minimem/media/banner.png +0 -0
  118. package/references/minimem/package-lock.json +0 -5373
  119. package/references/minimem/package.json +0 -76
  120. package/references/minimem/scripts/postbuild.js +0 -49
  121. package/references/minimem/src/__tests__/edge-cases.test.ts +0 -371
  122. package/references/minimem/src/__tests__/errors.test.ts +0 -265
  123. package/references/minimem/src/__tests__/helpers.ts +0 -199
  124. package/references/minimem/src/__tests__/internal.test.ts +0 -407
  125. package/references/minimem/src/__tests__/knowledge-frontmatter.test.ts +0 -148
  126. package/references/minimem/src/__tests__/knowledge.test.ts +0 -148
  127. package/references/minimem/src/__tests__/minimem.integration.test.ts +0 -1127
  128. package/references/minimem/src/__tests__/session.test.ts +0 -190
  129. package/references/minimem/src/cli/__tests__/commands.test.ts +0 -760
  130. package/references/minimem/src/cli/__tests__/contained-layout.test.ts +0 -286
  131. package/references/minimem/src/cli/commands/__tests__/conflicts.test.ts +0 -141
  132. package/references/minimem/src/cli/commands/append.ts +0 -76
  133. package/references/minimem/src/cli/commands/config.ts +0 -262
  134. package/references/minimem/src/cli/commands/conflicts.ts +0 -415
  135. package/references/minimem/src/cli/commands/daemon.ts +0 -169
  136. package/references/minimem/src/cli/commands/index.ts +0 -12
  137. package/references/minimem/src/cli/commands/init.ts +0 -166
  138. package/references/minimem/src/cli/commands/mcp.ts +0 -221
  139. package/references/minimem/src/cli/commands/push-pull.ts +0 -213
  140. package/references/minimem/src/cli/commands/search.ts +0 -223
  141. package/references/minimem/src/cli/commands/status.ts +0 -84
  142. package/references/minimem/src/cli/commands/store.ts +0 -189
  143. package/references/minimem/src/cli/commands/sync-init.ts +0 -290
  144. package/references/minimem/src/cli/commands/sync.ts +0 -70
  145. package/references/minimem/src/cli/commands/upsert.ts +0 -197
  146. package/references/minimem/src/cli/config.ts +0 -611
  147. package/references/minimem/src/cli/index.ts +0 -299
  148. package/references/minimem/src/cli/shared.ts +0 -189
  149. package/references/minimem/src/cli/sync/__tests__/central.test.ts +0 -152
  150. package/references/minimem/src/cli/sync/__tests__/conflicts.test.ts +0 -209
  151. package/references/minimem/src/cli/sync/__tests__/daemon.test.ts +0 -118
  152. package/references/minimem/src/cli/sync/__tests__/detection.test.ts +0 -207
  153. package/references/minimem/src/cli/sync/__tests__/integration.test.ts +0 -476
  154. package/references/minimem/src/cli/sync/__tests__/registry.test.ts +0 -363
  155. package/references/minimem/src/cli/sync/__tests__/state.test.ts +0 -255
  156. package/references/minimem/src/cli/sync/__tests__/validation.test.ts +0 -193
  157. package/references/minimem/src/cli/sync/__tests__/watcher.test.ts +0 -178
  158. package/references/minimem/src/cli/sync/central.ts +0 -292
  159. package/references/minimem/src/cli/sync/conflicts.ts +0 -205
  160. package/references/minimem/src/cli/sync/daemon.ts +0 -407
  161. package/references/minimem/src/cli/sync/detection.ts +0 -138
  162. package/references/minimem/src/cli/sync/index.ts +0 -107
  163. package/references/minimem/src/cli/sync/operations.ts +0 -373
  164. package/references/minimem/src/cli/sync/registry.ts +0 -279
  165. package/references/minimem/src/cli/sync/state.ts +0 -358
  166. package/references/minimem/src/cli/sync/validation.ts +0 -206
  167. package/references/minimem/src/cli/sync/watcher.ts +0 -237
  168. package/references/minimem/src/cli/version.ts +0 -34
  169. package/references/minimem/src/core/index.ts +0 -9
  170. package/references/minimem/src/core/indexer.ts +0 -628
  171. package/references/minimem/src/core/searcher.ts +0 -221
  172. package/references/minimem/src/db/schema.ts +0 -183
  173. package/references/minimem/src/db/sqlite-vec.ts +0 -24
  174. package/references/minimem/src/embeddings/__tests__/embeddings.test.ts +0 -431
  175. package/references/minimem/src/embeddings/batch-gemini.ts +0 -392
  176. package/references/minimem/src/embeddings/batch-openai.ts +0 -409
  177. package/references/minimem/src/embeddings/embeddings.ts +0 -434
  178. package/references/minimem/src/index.ts +0 -132
  179. package/references/minimem/src/internal.ts +0 -299
  180. package/references/minimem/src/minimem.ts +0 -1291
  181. package/references/minimem/src/search/__tests__/hybrid.test.ts +0 -247
  182. package/references/minimem/src/search/graph.ts +0 -234
  183. package/references/minimem/src/search/hybrid.ts +0 -151
  184. package/references/minimem/src/search/search.ts +0 -256
  185. package/references/minimem/src/server/__tests__/mcp.test.ts +0 -347
  186. package/references/minimem/src/server/__tests__/tools.test.ts +0 -364
  187. package/references/minimem/src/server/mcp.ts +0 -326
  188. package/references/minimem/src/server/tools.ts +0 -720
  189. package/references/minimem/src/session.ts +0 -460
  190. package/references/minimem/src/store/__tests__/manifest.test.ts +0 -177
  191. package/references/minimem/src/store/__tests__/materialize.test.ts +0 -52
  192. package/references/minimem/src/store/__tests__/store-graph.test.ts +0 -228
  193. package/references/minimem/src/store/index.ts +0 -27
  194. package/references/minimem/src/store/manifest.ts +0 -203
  195. package/references/minimem/src/store/materialize.ts +0 -185
  196. package/references/minimem/src/store/store-graph.ts +0 -252
  197. package/references/minimem/tsconfig.json +0 -19
  198. package/references/minimem/tsup.config.ts +0 -26
  199. package/references/minimem/vitest.config.ts +0 -29
  200. package/references/multi-agent-protocol/.sudocode/issues.jsonl +0 -120
  201. package/references/multi-agent-protocol/.sudocode/specs.jsonl +0 -15
  202. package/references/multi-agent-protocol/LICENSE +0 -21
  203. package/references/multi-agent-protocol/README.md +0 -113
  204. package/references/multi-agent-protocol/docs/00-design-specification.md +0 -496
  205. package/references/multi-agent-protocol/docs/01-open-questions.md +0 -1050
  206. package/references/multi-agent-protocol/docs/02-wire-protocol.md +0 -296
  207. package/references/multi-agent-protocol/docs/03-streaming-semantics.md +0 -252
  208. package/references/multi-agent-protocol/docs/04-error-handling.md +0 -231
  209. package/references/multi-agent-protocol/docs/05-connection-model.md +0 -244
  210. package/references/multi-agent-protocol/docs/06-visibility-permissions.md +0 -243
  211. package/references/multi-agent-protocol/docs/07-federation.md +0 -335
  212. package/references/multi-agent-protocol/docs/08-macro-agent-migration.md +0 -253
  213. package/references/multi-agent-protocol/docs/09-authentication.md +0 -748
  214. package/references/multi-agent-protocol/docs/10-environment-awareness.md +0 -242
  215. package/references/multi-agent-protocol/docs/10-mail-protocol.md +0 -553
  216. package/references/multi-agent-protocol/docs/11-anp-inspired-improvements.md +0 -1079
  217. package/references/multi-agent-protocol/docs/11-trajectory-protocol.md +0 -292
  218. package/references/multi-agent-protocol/docs/12-anp-implementation-plan.md +0 -641
  219. package/references/multi-agent-protocol/docs/agent-iam-integration.md +0 -877
  220. package/references/multi-agent-protocol/docs/agentic-mesh-integration-draft.md +0 -459
  221. package/references/multi-agent-protocol/docs/git-transport-draft.md +0 -251
  222. package/references/multi-agent-protocol/docs-site/Gemfile +0 -22
  223. package/references/multi-agent-protocol/docs-site/README.md +0 -82
  224. package/references/multi-agent-protocol/docs-site/_config.yml +0 -91
  225. package/references/multi-agent-protocol/docs-site/_includes/head_custom.html +0 -20
  226. package/references/multi-agent-protocol/docs-site/_sass/color_schemes/map.scss +0 -42
  227. package/references/multi-agent-protocol/docs-site/_sass/custom/custom.scss +0 -34
  228. package/references/multi-agent-protocol/docs-site/examples/full-integration.md +0 -510
  229. package/references/multi-agent-protocol/docs-site/examples/index.md +0 -138
  230. package/references/multi-agent-protocol/docs-site/examples/simple-chat.md +0 -282
  231. package/references/multi-agent-protocol/docs-site/examples/task-queue.md +0 -399
  232. package/references/multi-agent-protocol/docs-site/getting-started/index.md +0 -98
  233. package/references/multi-agent-protocol/docs-site/getting-started/installation.md +0 -219
  234. package/references/multi-agent-protocol/docs-site/getting-started/overview.md +0 -172
  235. package/references/multi-agent-protocol/docs-site/getting-started/quickstart.md +0 -237
  236. package/references/multi-agent-protocol/docs-site/index.md +0 -136
  237. package/references/multi-agent-protocol/docs-site/protocol/authentication.md +0 -391
  238. package/references/multi-agent-protocol/docs-site/protocol/connection-model.md +0 -376
  239. package/references/multi-agent-protocol/docs-site/protocol/design.md +0 -284
  240. package/references/multi-agent-protocol/docs-site/protocol/error-handling.md +0 -312
  241. package/references/multi-agent-protocol/docs-site/protocol/federation.md +0 -449
  242. package/references/multi-agent-protocol/docs-site/protocol/index.md +0 -129
  243. package/references/multi-agent-protocol/docs-site/protocol/permissions.md +0 -398
  244. package/references/multi-agent-protocol/docs-site/protocol/streaming.md +0 -353
  245. package/references/multi-agent-protocol/docs-site/protocol/wire-protocol.md +0 -369
  246. package/references/multi-agent-protocol/docs-site/sdk/api/agent.md +0 -357
  247. package/references/multi-agent-protocol/docs-site/sdk/api/client.md +0 -380
  248. package/references/multi-agent-protocol/docs-site/sdk/api/index.md +0 -62
  249. package/references/multi-agent-protocol/docs-site/sdk/api/server.md +0 -453
  250. package/references/multi-agent-protocol/docs-site/sdk/api/types.md +0 -468
  251. package/references/multi-agent-protocol/docs-site/sdk/guides/agent.md +0 -375
  252. package/references/multi-agent-protocol/docs-site/sdk/guides/authentication.md +0 -405
  253. package/references/multi-agent-protocol/docs-site/sdk/guides/client.md +0 -352
  254. package/references/multi-agent-protocol/docs-site/sdk/guides/index.md +0 -89
  255. package/references/multi-agent-protocol/docs-site/sdk/guides/server.md +0 -360
  256. package/references/multi-agent-protocol/docs-site/sdk/guides/testing.md +0 -446
  257. package/references/multi-agent-protocol/docs-site/sdk/guides/transports.md +0 -363
  258. package/references/multi-agent-protocol/docs-site/sdk/index.md +0 -206
  259. package/references/multi-agent-protocol/package-lock.json +0 -4230
  260. package/references/multi-agent-protocol/package.json +0 -56
  261. package/references/multi-agent-protocol/schema/meta.json +0 -584
  262. package/references/multi-agent-protocol/schema/schema.json +0 -3067
  263. package/references/openhive/.claude/settings.json +0 -6
  264. package/references/openhive/.dockerignore +0 -54
  265. package/references/openhive/.github/workflows/docker.yml +0 -52
  266. package/references/openhive/.sudocode/issues.jsonl +0 -24
  267. package/references/openhive/.sudocode/specs.jsonl +0 -4
  268. package/references/openhive/CLAUDE.md +0 -88
  269. package/references/openhive/Dockerfile +0 -105
  270. package/references/openhive/README.md +0 -745
  271. package/references/openhive/bin/openhive.js +0 -6
  272. package/references/openhive/cloudbuild.yaml +0 -80
  273. package/references/openhive/deploy/cloud-run.sh +0 -106
  274. package/references/openhive/deploy/openhive.env.example +0 -80
  275. package/references/openhive/deploy/openhive.service +0 -91
  276. package/references/openhive/docker-compose.yml +0 -67
  277. package/references/openhive/docker-entrypoint.sh +0 -117
  278. package/references/openhive/docs/API_MIGRATION.md +0 -176
  279. package/references/openhive/docs/DEPLOYMENT.md +0 -847
  280. package/references/openhive/docs/DESIGN_v1.md +0 -489
  281. package/references/openhive/docs/DESIGN_v2.md +0 -564
  282. package/references/openhive/docs/HEADSCALE_HOSTING_SPEC.md +0 -513
  283. package/references/openhive/docs/HIVE_SYNC_DESIGN.md +0 -2362
  284. package/references/openhive/docs/HIVE_SYNC_IMPLEMENTATION_PLAN.md +0 -1169
  285. package/references/openhive/docs/HOSTING.md +0 -601
  286. package/references/openhive/docs/IMPLEMENTATION_PLAN.md +0 -428
  287. package/references/openhive/docs/LOCAL_SETUP.md +0 -506
  288. package/references/openhive/docs/MACRO_AGENT_ATLAS_EXTENSION.md +0 -351
  289. package/references/openhive/docs/MEMORY_BANK_SYNC_SPEC.md +0 -909
  290. package/references/openhive/docs/PLAN_v1.md +0 -471
  291. package/references/openhive/docs/PLAN_v2.md +0 -623
  292. package/references/openhive/docs/WEBSOCKET.md +0 -267
  293. package/references/openhive/docs/openswarm-bootstrap-token-spec.md +0 -240
  294. package/references/openhive/ecosystem.config.cjs +0 -76
  295. package/references/openhive/fly.toml +0 -63
  296. package/references/openhive/package-lock.json +0 -17640
  297. package/references/openhive/package.json +0 -128
  298. package/references/openhive/packages/openhive-types/package-lock.json +0 -1473
  299. package/references/openhive/packages/openhive-types/package.json +0 -42
  300. package/references/openhive/packages/openhive-types/src/index.ts +0 -36
  301. package/references/openhive/packages/openhive-types/src/map-coordination.ts +0 -92
  302. package/references/openhive/packages/openhive-types/src/map-session-sync.ts +0 -50
  303. package/references/openhive/packages/openhive-types/src/map-sync.ts +0 -68
  304. package/references/openhive/packages/openhive-types/tsconfig.json +0 -15
  305. package/references/openhive/packages/openhive-types/tsconfig.tsbuildinfo +0 -1
  306. package/references/openhive/packages/openhive-types/tsup.config.ts +0 -12
  307. package/references/openhive/railway.json +0 -13
  308. package/references/openhive/railway.toml +0 -24
  309. package/references/openhive/render.yaml +0 -51
  310. package/references/openhive/src/__tests__/auth.test.ts +0 -148
  311. package/references/openhive/src/__tests__/bridge/credentials.test.ts +0 -65
  312. package/references/openhive/src/__tests__/bridge/dal.test.ts +0 -279
  313. package/references/openhive/src/__tests__/bridge/inbound.test.ts +0 -349
  314. package/references/openhive/src/__tests__/bridge/manager.test.ts +0 -419
  315. package/references/openhive/src/__tests__/bridge/mentions.test.ts +0 -83
  316. package/references/openhive/src/__tests__/bridge/outbound.test.ts +0 -209
  317. package/references/openhive/src/__tests__/bridge/slack-adapter.test.ts +0 -276
  318. package/references/openhive/src/__tests__/cli.test.ts +0 -342
  319. package/references/openhive/src/__tests__/config.test.ts +0 -205
  320. package/references/openhive/src/__tests__/coordination/coordination.test.ts +0 -1072
  321. package/references/openhive/src/__tests__/coordination/cross-instance.test.ts +0 -540
  322. package/references/openhive/src/__tests__/coordination/e2e.test.ts +0 -780
  323. package/references/openhive/src/__tests__/data-dir.test.ts +0 -332
  324. package/references/openhive/src/__tests__/db.test.ts +0 -258
  325. package/references/openhive/src/__tests__/discovery.test.ts +0 -288
  326. package/references/openhive/src/__tests__/events/dal.test.ts +0 -371
  327. package/references/openhive/src/__tests__/events/dispatch.test.ts +0 -202
  328. package/references/openhive/src/__tests__/events/e2e.test.ts +0 -528
  329. package/references/openhive/src/__tests__/events/normalizers.test.ts +0 -263
  330. package/references/openhive/src/__tests__/events/router.test.ts +0 -314
  331. package/references/openhive/src/__tests__/events/routes.test.ts +0 -407
  332. package/references/openhive/src/__tests__/follows.test.ts +0 -328
  333. package/references/openhive/src/__tests__/helpers/test-dirs.ts +0 -44
  334. package/references/openhive/src/__tests__/ingest-keys.test.ts +0 -925
  335. package/references/openhive/src/__tests__/map/sync-client-content.test.ts +0 -288
  336. package/references/openhive/src/__tests__/map/sync-client.test.ts +0 -500
  337. package/references/openhive/src/__tests__/map/sync-listener.test.ts +0 -504
  338. package/references/openhive/src/__tests__/middleware/hostname-guard.test.ts +0 -73
  339. package/references/openhive/src/__tests__/migrations.test.ts +0 -260
  340. package/references/openhive/src/__tests__/opentasks/client.test.ts +0 -497
  341. package/references/openhive/src/__tests__/opentasks/discovery.test.ts +0 -283
  342. package/references/openhive/src/__tests__/opentasks/e2e.test.ts +0 -767
  343. package/references/openhive/src/__tests__/routes/agents.test.ts +0 -417
  344. package/references/openhive/src/__tests__/routes/opentasks-content.test.ts +0 -493
  345. package/references/openhive/src/__tests__/routes/resource-content.test.ts +0 -1741
  346. package/references/openhive/src/__tests__/sessions/adapters.test.ts +0 -524
  347. package/references/openhive/src/__tests__/sessions/routes.test.ts +0 -1053
  348. package/references/openhive/src/__tests__/sessions/storage.test.ts +0 -545
  349. package/references/openhive/src/__tests__/sessions/trajectory-checkpoints.test.ts +0 -349
  350. package/references/openhive/src/__tests__/sessions/trajectory-routes.test.ts +0 -290
  351. package/references/openhive/src/__tests__/swarm/config.test.ts +0 -125
  352. package/references/openhive/src/__tests__/swarm/credentials.test.ts +0 -254
  353. package/references/openhive/src/__tests__/swarm/dal.test.ts +0 -290
  354. package/references/openhive/src/__tests__/swarm/e2e.test.ts +0 -827
  355. package/references/openhive/src/__tests__/swarm/fixtures/exit-immediately.js +0 -3
  356. package/references/openhive/src/__tests__/swarm/fixtures/map-server.js +0 -147
  357. package/references/openhive/src/__tests__/swarm/fixtures/sleep-server.js +0 -52
  358. package/references/openhive/src/__tests__/swarm/local-provider.test.ts +0 -279
  359. package/references/openhive/src/__tests__/swarm/manager.test.ts +0 -305
  360. package/references/openhive/src/__tests__/swarm/routes.test.ts +0 -396
  361. package/references/openhive/src/__tests__/swarm/workspace.test.ts +0 -257
  362. package/references/openhive/src/__tests__/swarmhub/client.test.ts +0 -324
  363. package/references/openhive/src/__tests__/swarmhub/config.test.ts +0 -213
  364. package/references/openhive/src/__tests__/swarmhub/connector.test.ts +0 -581
  365. package/references/openhive/src/__tests__/swarmhub/routes.test.ts +0 -639
  366. package/references/openhive/src/__tests__/swarmhub/slack-client.test.ts +0 -164
  367. package/references/openhive/src/__tests__/swarmhub/slack-connector.test.ts +0 -164
  368. package/references/openhive/src/__tests__/swarmhub/slack-routes.test.ts +0 -373
  369. package/references/openhive/src/__tests__/swarmhub/webhook-handler.test.ts +0 -295
  370. package/references/openhive/src/__tests__/sync/resource-sync.test.ts +0 -1418
  371. package/references/openhive/src/__tests__/sync/sync.test.ts +0 -800
  372. package/references/openhive/src/api/index.ts +0 -65
  373. package/references/openhive/src/api/middleware/auth.ts +0 -227
  374. package/references/openhive/src/api/middleware/hostname-guard.ts +0 -38
  375. package/references/openhive/src/api/routes/admin.ts +0 -366
  376. package/references/openhive/src/api/routes/agents.ts +0 -223
  377. package/references/openhive/src/api/routes/auth.ts +0 -164
  378. package/references/openhive/src/api/routes/bridges.ts +0 -384
  379. package/references/openhive/src/api/routes/comments.ts +0 -294
  380. package/references/openhive/src/api/routes/coordination.ts +0 -312
  381. package/references/openhive/src/api/routes/events.ts +0 -158
  382. package/references/openhive/src/api/routes/federation.ts +0 -367
  383. package/references/openhive/src/api/routes/feed.ts +0 -212
  384. package/references/openhive/src/api/routes/hives.ts +0 -264
  385. package/references/openhive/src/api/routes/map.ts +0 -674
  386. package/references/openhive/src/api/routes/memory-banks.ts +0 -971
  387. package/references/openhive/src/api/routes/posts.ts +0 -342
  388. package/references/openhive/src/api/routes/resource-content.ts +0 -727
  389. package/references/openhive/src/api/routes/resources.ts +0 -1013
  390. package/references/openhive/src/api/routes/search.ts +0 -45
  391. package/references/openhive/src/api/routes/sessions.ts +0 -1187
  392. package/references/openhive/src/api/routes/swarm-hosting.ts +0 -313
  393. package/references/openhive/src/api/routes/sync-protocol.ts +0 -168
  394. package/references/openhive/src/api/routes/sync.ts +0 -279
  395. package/references/openhive/src/api/routes/uploads.ts +0 -174
  396. package/references/openhive/src/api/routes/webhooks.ts +0 -603
  397. package/references/openhive/src/api/schemas/agents.ts +0 -26
  398. package/references/openhive/src/api/schemas/comments.ts +0 -22
  399. package/references/openhive/src/api/schemas/hives.ts +0 -33
  400. package/references/openhive/src/api/schemas/posts.ts +0 -37
  401. package/references/openhive/src/api/schemas/sync.ts +0 -56
  402. package/references/openhive/src/auth/index.ts +0 -2
  403. package/references/openhive/src/auth/jwks.ts +0 -58
  404. package/references/openhive/src/bridge/adapters/slack.ts +0 -306
  405. package/references/openhive/src/bridge/credentials.ts +0 -72
  406. package/references/openhive/src/bridge/inbound.ts +0 -288
  407. package/references/openhive/src/bridge/index.ts +0 -42
  408. package/references/openhive/src/bridge/manager.ts +0 -425
  409. package/references/openhive/src/bridge/mentions.ts +0 -42
  410. package/references/openhive/src/bridge/outbound.ts +0 -103
  411. package/references/openhive/src/bridge/schema.ts +0 -82
  412. package/references/openhive/src/bridge/types.ts +0 -238
  413. package/references/openhive/src/cli/network.ts +0 -480
  414. package/references/openhive/src/cli.ts +0 -620
  415. package/references/openhive/src/config.ts +0 -611
  416. package/references/openhive/src/coordination/index.ts +0 -43
  417. package/references/openhive/src/coordination/listener.ts +0 -92
  418. package/references/openhive/src/coordination/schema.ts +0 -79
  419. package/references/openhive/src/coordination/service.ts +0 -233
  420. package/references/openhive/src/coordination/types.ts +0 -177
  421. package/references/openhive/src/data-dir.ts +0 -105
  422. package/references/openhive/src/db/adapters/index.ts +0 -21
  423. package/references/openhive/src/db/adapters/postgres.ts +0 -310
  424. package/references/openhive/src/db/adapters/sqlite.ts +0 -56
  425. package/references/openhive/src/db/adapters/types.ts +0 -65
  426. package/references/openhive/src/db/dal/agents.ts +0 -430
  427. package/references/openhive/src/db/dal/bridge.ts +0 -336
  428. package/references/openhive/src/db/dal/comments.ts +0 -213
  429. package/references/openhive/src/db/dal/coordination.ts +0 -361
  430. package/references/openhive/src/db/dal/events.ts +0 -381
  431. package/references/openhive/src/db/dal/follows.ts +0 -96
  432. package/references/openhive/src/db/dal/hives.ts +0 -198
  433. package/references/openhive/src/db/dal/ingest-keys.ts +0 -176
  434. package/references/openhive/src/db/dal/instances.ts +0 -196
  435. package/references/openhive/src/db/dal/invites.ts +0 -123
  436. package/references/openhive/src/db/dal/map.ts +0 -750
  437. package/references/openhive/src/db/dal/posts.ts +0 -274
  438. package/references/openhive/src/db/dal/remote-agents.ts +0 -56
  439. package/references/openhive/src/db/dal/search.ts +0 -238
  440. package/references/openhive/src/db/dal/sync-events.ts +0 -160
  441. package/references/openhive/src/db/dal/sync-groups.ts +0 -100
  442. package/references/openhive/src/db/dal/sync-peer-configs.ts +0 -216
  443. package/references/openhive/src/db/dal/sync-peers.ts +0 -145
  444. package/references/openhive/src/db/dal/syncable-resources.ts +0 -888
  445. package/references/openhive/src/db/dal/trajectory-checkpoints.ts +0 -291
  446. package/references/openhive/src/db/dal/uploads.ts +0 -124
  447. package/references/openhive/src/db/dal/votes.ts +0 -124
  448. package/references/openhive/src/db/index.ts +0 -293
  449. package/references/openhive/src/db/providers/index.ts +0 -75
  450. package/references/openhive/src/db/providers/postgres.ts +0 -529
  451. package/references/openhive/src/db/providers/sqlite.ts +0 -1383
  452. package/references/openhive/src/db/providers/turso.ts +0 -1360
  453. package/references/openhive/src/db/providers/types.ts +0 -516
  454. package/references/openhive/src/db/schema.ts +0 -641
  455. package/references/openhive/src/discovery/index.ts +0 -403
  456. package/references/openhive/src/events/dispatch.ts +0 -106
  457. package/references/openhive/src/events/index.ts +0 -17
  458. package/references/openhive/src/events/normalizers/github.ts +0 -133
  459. package/references/openhive/src/events/normalizers/index.ts +0 -62
  460. package/references/openhive/src/events/normalizers/slack.ts +0 -50
  461. package/references/openhive/src/events/router.ts +0 -156
  462. package/references/openhive/src/events/schema.ts +0 -66
  463. package/references/openhive/src/events/types.ts +0 -130
  464. package/references/openhive/src/federation/index.ts +0 -1
  465. package/references/openhive/src/federation/service.ts +0 -776
  466. package/references/openhive/src/headscale/client.ts +0 -256
  467. package/references/openhive/src/headscale/config.ts +0 -212
  468. package/references/openhive/src/headscale/index.ts +0 -23
  469. package/references/openhive/src/headscale/manager.ts +0 -249
  470. package/references/openhive/src/headscale/sync.ts +0 -272
  471. package/references/openhive/src/headscale/types.ts +0 -231
  472. package/references/openhive/src/index.ts +0 -225
  473. package/references/openhive/src/map/client-entry.ts +0 -26
  474. package/references/openhive/src/map/index.ts +0 -76
  475. package/references/openhive/src/map/schema.ts +0 -119
  476. package/references/openhive/src/map/service.ts +0 -323
  477. package/references/openhive/src/map/sync-client.ts +0 -696
  478. package/references/openhive/src/map/sync-listener.ts +0 -409
  479. package/references/openhive/src/map/types.ts +0 -290
  480. package/references/openhive/src/network/factory.ts +0 -118
  481. package/references/openhive/src/network/headscale-provider.ts +0 -437
  482. package/references/openhive/src/network/index.ts +0 -43
  483. package/references/openhive/src/network/tailscale-client.ts +0 -289
  484. package/references/openhive/src/network/tailscale-provider.ts +0 -287
  485. package/references/openhive/src/network/types.ts +0 -178
  486. package/references/openhive/src/opentasks-client/client.ts +0 -374
  487. package/references/openhive/src/opentasks-client/index.ts +0 -7
  488. package/references/openhive/src/realtime/index.ts +0 -282
  489. package/references/openhive/src/server.ts +0 -1069
  490. package/references/openhive/src/services/email.ts +0 -177
  491. package/references/openhive/src/services/sitemap.ts +0 -135
  492. package/references/openhive/src/sessions/adapters/claude.ts +0 -466
  493. package/references/openhive/src/sessions/adapters/codex.ts +0 -265
  494. package/references/openhive/src/sessions/adapters/index.ts +0 -263
  495. package/references/openhive/src/sessions/adapters/raw.ts +0 -144
  496. package/references/openhive/src/sessions/adapters/types.ts +0 -83
  497. package/references/openhive/src/sessions/index.ts +0 -50
  498. package/references/openhive/src/sessions/storage/adapters/gcs.ts +0 -277
  499. package/references/openhive/src/sessions/storage/adapters/local.ts +0 -240
  500. package/references/openhive/src/sessions/storage/adapters/s3.ts +0 -321
  501. package/references/openhive/src/sessions/storage/index.ts +0 -231
  502. package/references/openhive/src/sessions/storage/types.ts +0 -189
  503. package/references/openhive/src/sessions/types.ts +0 -415
  504. package/references/openhive/src/shared/types/index.ts +0 -45
  505. package/references/openhive/src/shared/types/map-coordination.ts +0 -92
  506. package/references/openhive/src/shared/types/map-session-sync.ts +0 -170
  507. package/references/openhive/src/shared/types/map-sync.ts +0 -68
  508. package/references/openhive/src/skill.ts +0 -203
  509. package/references/openhive/src/storage/adapters/local.ts +0 -169
  510. package/references/openhive/src/storage/adapters/s3.ts +0 -195
  511. package/references/openhive/src/storage/index.ts +0 -64
  512. package/references/openhive/src/storage/types.ts +0 -69
  513. package/references/openhive/src/swarm/credentials.ts +0 -98
  514. package/references/openhive/src/swarm/dal.ts +0 -206
  515. package/references/openhive/src/swarm/index.ts +0 -28
  516. package/references/openhive/src/swarm/manager.ts +0 -917
  517. package/references/openhive/src/swarm/providers/local.ts +0 -338
  518. package/references/openhive/src/swarm/providers/sandboxed-local.ts +0 -478
  519. package/references/openhive/src/swarm/providers/workspace.ts +0 -52
  520. package/references/openhive/src/swarm/schema.ts +0 -43
  521. package/references/openhive/src/swarm/types.ts +0 -333
  522. package/references/openhive/src/swarmhub/client.ts +0 -279
  523. package/references/openhive/src/swarmhub/connector.ts +0 -463
  524. package/references/openhive/src/swarmhub/index.ts +0 -43
  525. package/references/openhive/src/swarmhub/routes.ts +0 -296
  526. package/references/openhive/src/swarmhub/types.ts +0 -213
  527. package/references/openhive/src/swarmhub/webhook-handler.ts +0 -126
  528. package/references/openhive/src/sync/compaction.ts +0 -193
  529. package/references/openhive/src/sync/coordination-hooks.ts +0 -154
  530. package/references/openhive/src/sync/crypto.ts +0 -79
  531. package/references/openhive/src/sync/gossip.ts +0 -136
  532. package/references/openhive/src/sync/hooks.ts +0 -202
  533. package/references/openhive/src/sync/materializer-repo.ts +0 -256
  534. package/references/openhive/src/sync/materializer.ts +0 -682
  535. package/references/openhive/src/sync/middleware.ts +0 -140
  536. package/references/openhive/src/sync/peer-resolver.ts +0 -157
  537. package/references/openhive/src/sync/resource-hooks.ts +0 -161
  538. package/references/openhive/src/sync/schema.ts +0 -158
  539. package/references/openhive/src/sync/service.ts +0 -990
  540. package/references/openhive/src/sync/types.ts +0 -369
  541. package/references/openhive/src/terminal/index.ts +0 -4
  542. package/references/openhive/src/terminal/pty-manager.ts +0 -337
  543. package/references/openhive/src/terminal/resolve-tui.ts +0 -44
  544. package/references/openhive/src/terminal/terminal-ws.ts +0 -251
  545. package/references/openhive/src/types.ts +0 -442
  546. package/references/openhive/src/utils/git-remote.ts +0 -329
  547. package/references/openhive/src/web/App.tsx +0 -77
  548. package/references/openhive/src/web/__tests__/components/dashboard/RecentActivity.test.tsx +0 -77
  549. package/references/openhive/src/web/__tests__/components/dashboard/StatsOverview.test.tsx +0 -62
  550. package/references/openhive/src/web/__tests__/components/dashboard/SwarmStatusSummary.test.tsx +0 -122
  551. package/references/openhive/src/web/__tests__/components/dashboard/SyncResourcesStatus.test.tsx +0 -104
  552. package/references/openhive/src/web/__tests__/components/layout/Sidebar.test.tsx +0 -110
  553. package/references/openhive/src/web/__tests__/components/swarm/StatusBadges.test.tsx +0 -65
  554. package/references/openhive/src/web/__tests__/components/terminal/query-responses.test.ts +0 -143
  555. package/references/openhive/src/web/__tests__/components/terminal/terminal-mouse.test.ts +0 -509
  556. package/references/openhive/src/web/__tests__/hooks/useEventsApi.test.ts +0 -378
  557. package/references/openhive/src/web/__tests__/pages/Dashboard.test.tsx +0 -57
  558. package/references/openhive/src/web/__tests__/pages/Events.test.tsx +0 -886
  559. package/references/openhive/src/web/__tests__/pages/Explore.test.tsx +0 -63
  560. package/references/openhive/src/web/__tests__/routing.test.tsx +0 -79
  561. package/references/openhive/src/web/__tests__/setup.ts +0 -37
  562. package/references/openhive/src/web/__tests__/stores/dashboard.test.ts +0 -49
  563. package/references/openhive/src/web/components/common/AgentBadge.tsx +0 -58
  564. package/references/openhive/src/web/components/common/Avatar.tsx +0 -78
  565. package/references/openhive/src/web/components/common/ErrorBoundary.tsx +0 -76
  566. package/references/openhive/src/web/components/common/Highlight.tsx +0 -79
  567. package/references/openhive/src/web/components/common/ImageUpload.tsx +0 -209
  568. package/references/openhive/src/web/components/common/LoadingSpinner.tsx +0 -37
  569. package/references/openhive/src/web/components/common/Logo.tsx +0 -21
  570. package/references/openhive/src/web/components/common/Markdown.tsx +0 -53
  571. package/references/openhive/src/web/components/common/ProtectedRoute.tsx +0 -18
  572. package/references/openhive/src/web/components/common/ThemeToggle.tsx +0 -38
  573. package/references/openhive/src/web/components/common/TimeAgo.tsx +0 -17
  574. package/references/openhive/src/web/components/common/Toast.tsx +0 -70
  575. package/references/openhive/src/web/components/common/VoteButtons.tsx +0 -100
  576. package/references/openhive/src/web/components/dashboard/RecentActivity.tsx +0 -100
  577. package/references/openhive/src/web/components/dashboard/StatsOverview.tsx +0 -40
  578. package/references/openhive/src/web/components/dashboard/SwarmStatusSummary.tsx +0 -89
  579. package/references/openhive/src/web/components/dashboard/SyncResourcesStatus.tsx +0 -81
  580. package/references/openhive/src/web/components/feed/FeedControls.tsx +0 -38
  581. package/references/openhive/src/web/components/feed/NewPostsIndicator.tsx +0 -75
  582. package/references/openhive/src/web/components/feed/PostCard.tsx +0 -129
  583. package/references/openhive/src/web/components/feed/PostList.tsx +0 -83
  584. package/references/openhive/src/web/components/layout/Footer.tsx +0 -5
  585. package/references/openhive/src/web/components/layout/Layout.tsx +0 -29
  586. package/references/openhive/src/web/components/layout/Sidebar.tsx +0 -348
  587. package/references/openhive/src/web/components/post/CommentForm.tsx +0 -59
  588. package/references/openhive/src/web/components/post/CommentTree.tsx +0 -145
  589. package/references/openhive/src/web/components/resources/MemoryBrowser.tsx +0 -208
  590. package/references/openhive/src/web/components/resources/OpenTasksSummary.tsx +0 -138
  591. package/references/openhive/src/web/components/resources/SkillBrowser.tsx +0 -284
  592. package/references/openhive/src/web/components/swarm/StatusBadges.tsx +0 -56
  593. package/references/openhive/src/web/components/terminal/TerminalPanel.tsx +0 -485
  594. package/references/openhive/src/web/components/terminal/index.ts +0 -2
  595. package/references/openhive/src/web/components/terminal/query-responses.ts +0 -70
  596. package/references/openhive/src/web/components/terminal/terminal-mouse.ts +0 -222
  597. package/references/openhive/src/web/hooks/useApi.ts +0 -740
  598. package/references/openhive/src/web/hooks/useDocumentTitle.ts +0 -49
  599. package/references/openhive/src/web/hooks/useInfiniteScroll.ts +0 -58
  600. package/references/openhive/src/web/hooks/useRealtimeUpdates.ts +0 -154
  601. package/references/openhive/src/web/hooks/useWebSocket.ts +0 -225
  602. package/references/openhive/src/web/index.html +0 -73
  603. package/references/openhive/src/web/lib/api.ts +0 -518
  604. package/references/openhive/src/web/main.tsx +0 -32
  605. package/references/openhive/src/web/pages/About.tsx +0 -131
  606. package/references/openhive/src/web/pages/Agent.tsx +0 -130
  607. package/references/openhive/src/web/pages/Agents.tsx +0 -69
  608. package/references/openhive/src/web/pages/AuthCallback.tsx +0 -75
  609. package/references/openhive/src/web/pages/Dashboard.tsx +0 -41
  610. package/references/openhive/src/web/pages/Events.tsx +0 -1025
  611. package/references/openhive/src/web/pages/Explore.tsx +0 -43
  612. package/references/openhive/src/web/pages/Hive.tsx +0 -134
  613. package/references/openhive/src/web/pages/Hives.tsx +0 -64
  614. package/references/openhive/src/web/pages/Home.tsx +0 -43
  615. package/references/openhive/src/web/pages/Login.tsx +0 -122
  616. package/references/openhive/src/web/pages/Post.tsx +0 -216
  617. package/references/openhive/src/web/pages/ResourceDetail.tsx +0 -426
  618. package/references/openhive/src/web/pages/Resources.tsx +0 -276
  619. package/references/openhive/src/web/pages/Search.tsx +0 -234
  620. package/references/openhive/src/web/pages/SessionDetail.tsx +0 -703
  621. package/references/openhive/src/web/pages/Sessions.tsx +0 -129
  622. package/references/openhive/src/web/pages/Settings.tsx +0 -826
  623. package/references/openhive/src/web/pages/SwarmCraft.tsx +0 -16
  624. package/references/openhive/src/web/pages/Swarms.tsx +0 -981
  625. package/references/openhive/src/web/pages/Terminal.tsx +0 -69
  626. package/references/openhive/src/web/postcss.config.js +0 -5
  627. package/references/openhive/src/web/public/favicon.svg +0 -11
  628. package/references/openhive/src/web/public/manifest.json +0 -21
  629. package/references/openhive/src/web/stores/auth.ts +0 -207
  630. package/references/openhive/src/web/stores/dashboard.ts +0 -23
  631. package/references/openhive/src/web/stores/realtime.ts +0 -90
  632. package/references/openhive/src/web/stores/theme.ts +0 -70
  633. package/references/openhive/src/web/stores/toast.ts +0 -63
  634. package/references/openhive/src/web/styles/globals.css +0 -503
  635. package/references/openhive/src/web/sw.ts +0 -228
  636. package/references/openhive/src/web/utils/serviceWorker.ts +0 -86
  637. package/references/openhive/src/web/vite.config.ts +0 -81
  638. package/references/openhive/tsconfig.json +0 -32
  639. package/references/openhive/tsup.config.ts +0 -17
  640. package/references/openhive/vitest.config.ts +0 -30
  641. package/references/openhive/vitest.web.config.ts +0 -20
  642. package/references/opentasks/.claude/settings.json +0 -6
  643. package/references/opentasks/.claude-plugin/plugin.json +0 -20
  644. package/references/opentasks/.lintstagedrc.json +0 -4
  645. package/references/opentasks/.prettierignore +0 -4
  646. package/references/opentasks/.prettierrc.json +0 -11
  647. package/references/opentasks/.sudocode/issues.jsonl +0 -89
  648. package/references/opentasks/.sudocode/specs.jsonl +0 -24
  649. package/references/opentasks/README.md +0 -401
  650. package/references/opentasks/docs/ARCHITECTURE.md +0 -841
  651. package/references/opentasks/docs/DESIGN.md +0 -689
  652. package/references/opentasks/docs/INTERFACE.md +0 -670
  653. package/references/opentasks/docs/PERSISTENCE.md +0 -1638
  654. package/references/opentasks/docs/PROVIDERS.md +0 -1412
  655. package/references/opentasks/docs/SCHEMA.md +0 -815
  656. package/references/opentasks/docs/TESTING.md +0 -1081
  657. package/references/opentasks/eslint.config.js +0 -58
  658. package/references/opentasks/package-lock.json +0 -4348
  659. package/references/opentasks/package.json +0 -81
  660. package/references/opentasks/skills/opentasks/SKILL.md +0 -139
  661. package/references/opentasks/skills/opentasks/dependency-management.md +0 -119
  662. package/references/opentasks/skills/opentasks/feedback-and-review.md +0 -100
  663. package/references/opentasks/skills/opentasks/linking-external-data.md +0 -103
  664. package/references/opentasks/skills/opentasks/spec-to-implementation.md +0 -98
  665. package/references/opentasks/src/__tests__/cli-tools.test.ts +0 -800
  666. package/references/opentasks/src/__tests__/cli.test.ts +0 -97
  667. package/references/opentasks/src/__tests__/p1-p3-gaps.test.ts +0 -635
  668. package/references/opentasks/src/cli.ts +0 -929
  669. package/references/opentasks/src/client/__tests__/client-crud.test.ts +0 -546
  670. package/references/opentasks/src/client/__tests__/client.test.ts +0 -658
  671. package/references/opentasks/src/client/__tests__/socket-discovery.test.ts +0 -122
  672. package/references/opentasks/src/client/client.ts +0 -560
  673. package/references/opentasks/src/client/index.ts +0 -32
  674. package/references/opentasks/src/config/__tests__/defaults.test.ts +0 -66
  675. package/references/opentasks/src/config/__tests__/env.test.ts +0 -155
  676. package/references/opentasks/src/config/__tests__/index.test.ts +0 -148
  677. package/references/opentasks/src/config/__tests__/loader.test.ts +0 -173
  678. package/references/opentasks/src/config/__tests__/merge.test.ts +0 -121
  679. package/references/opentasks/src/config/__tests__/schema.test.ts +0 -446
  680. package/references/opentasks/src/config/defaults.ts +0 -18
  681. package/references/opentasks/src/config/env.ts +0 -170
  682. package/references/opentasks/src/config/errors.ts +0 -33
  683. package/references/opentasks/src/config/index.ts +0 -63
  684. package/references/opentasks/src/config/loader.ts +0 -90
  685. package/references/opentasks/src/config/merge.ts +0 -64
  686. package/references/opentasks/src/config/schema.ts +0 -767
  687. package/references/opentasks/src/core/__tests__/conditional-redirects.test.ts +0 -116
  688. package/references/opentasks/src/core/__tests__/connections.test.ts +0 -194
  689. package/references/opentasks/src/core/__tests__/hash.test.ts +0 -161
  690. package/references/opentasks/src/core/__tests__/id.test.ts +0 -175
  691. package/references/opentasks/src/core/__tests__/init.test.ts +0 -115
  692. package/references/opentasks/src/core/__tests__/location.test.ts +0 -94
  693. package/references/opentasks/src/core/__tests__/merge-driver.test.ts +0 -300
  694. package/references/opentasks/src/core/__tests__/redirects.test.ts +0 -169
  695. package/references/opentasks/src/core/__tests__/resolve-location-target.test.ts +0 -468
  696. package/references/opentasks/src/core/__tests__/uri.test.ts +0 -228
  697. package/references/opentasks/src/core/__tests__/worktree.test.ts +0 -160
  698. package/references/opentasks/src/core/conditional-redirects.ts +0 -100
  699. package/references/opentasks/src/core/connections.ts +0 -217
  700. package/references/opentasks/src/core/discover.ts +0 -195
  701. package/references/opentasks/src/core/hash.ts +0 -74
  702. package/references/opentasks/src/core/id.ts +0 -174
  703. package/references/opentasks/src/core/index.ts +0 -108
  704. package/references/opentasks/src/core/init.ts +0 -66
  705. package/references/opentasks/src/core/location.ts +0 -139
  706. package/references/opentasks/src/core/merge-driver.ts +0 -280
  707. package/references/opentasks/src/core/redirects.ts +0 -182
  708. package/references/opentasks/src/core/uri.ts +0 -270
  709. package/references/opentasks/src/core/worktree.ts +0 -504
  710. package/references/opentasks/src/daemon/__tests__/e2e-live-agent.test.ts +0 -344
  711. package/references/opentasks/src/daemon/__tests__/e2e-session-pipeline.test.ts +0 -447
  712. package/references/opentasks/src/daemon/__tests__/e2e-watch.test.ts +0 -279
  713. package/references/opentasks/src/daemon/__tests__/entire-linker.test.ts +0 -1074
  714. package/references/opentasks/src/daemon/__tests__/entire-watcher.test.ts +0 -659
  715. package/references/opentasks/src/daemon/__tests__/flush.test.ts +0 -306
  716. package/references/opentasks/src/daemon/__tests__/integration.test.ts +0 -338
  717. package/references/opentasks/src/daemon/__tests__/ipc.test.ts +0 -406
  718. package/references/opentasks/src/daemon/__tests__/lifecycle.test.ts +0 -378
  719. package/references/opentasks/src/daemon/__tests__/lock.test.ts +0 -240
  720. package/references/opentasks/src/daemon/__tests__/methods/graph.test.ts +0 -372
  721. package/references/opentasks/src/daemon/__tests__/methods/provider.test.ts +0 -238
  722. package/references/opentasks/src/daemon/__tests__/methods/tools.test.ts +0 -690
  723. package/references/opentasks/src/daemon/__tests__/multi-location.test.ts +0 -945
  724. package/references/opentasks/src/daemon/__tests__/registry.test.ts +0 -268
  725. package/references/opentasks/src/daemon/__tests__/watcher.test.ts +0 -329
  726. package/references/opentasks/src/daemon/entire-linker.ts +0 -615
  727. package/references/opentasks/src/daemon/entire-watcher.ts +0 -415
  728. package/references/opentasks/src/daemon/factory.ts +0 -133
  729. package/references/opentasks/src/daemon/flush.ts +0 -168
  730. package/references/opentasks/src/daemon/index.ts +0 -120
  731. package/references/opentasks/src/daemon/ipc.ts +0 -491
  732. package/references/opentasks/src/daemon/lifecycle.ts +0 -1106
  733. package/references/opentasks/src/daemon/location-state.ts +0 -481
  734. package/references/opentasks/src/daemon/lock.ts +0 -168
  735. package/references/opentasks/src/daemon/methods/__tests__/graph.test.ts +0 -359
  736. package/references/opentasks/src/daemon/methods/__tests__/provider.test.ts +0 -227
  737. package/references/opentasks/src/daemon/methods/__tests__/tools.test.ts +0 -360
  738. package/references/opentasks/src/daemon/methods/__tests__/watch.test.ts +0 -656
  739. package/references/opentasks/src/daemon/methods/archive.ts +0 -193
  740. package/references/opentasks/src/daemon/methods/graph.ts +0 -274
  741. package/references/opentasks/src/daemon/methods/lifecycle.ts +0 -112
  742. package/references/opentasks/src/daemon/methods/location.ts +0 -118
  743. package/references/opentasks/src/daemon/methods/provider.ts +0 -159
  744. package/references/opentasks/src/daemon/methods/tools.ts +0 -221
  745. package/references/opentasks/src/daemon/methods/watch.ts +0 -206
  746. package/references/opentasks/src/daemon/registry.ts +0 -244
  747. package/references/opentasks/src/daemon/types.ts +0 -163
  748. package/references/opentasks/src/daemon/watcher.ts +0 -248
  749. package/references/opentasks/src/entire/__tests__/agent-registry.test.ts +0 -127
  750. package/references/opentasks/src/entire/__tests__/claude-generator.test.ts +0 -49
  751. package/references/opentasks/src/entire/__tests__/commit-msg.test.ts +0 -89
  752. package/references/opentasks/src/entire/__tests__/cursor-agent.test.ts +0 -224
  753. package/references/opentasks/src/entire/__tests__/flush-sentinel.test.ts +0 -93
  754. package/references/opentasks/src/entire/__tests__/gemini-agent.test.ts +0 -375
  755. package/references/opentasks/src/entire/__tests__/git-hooks.test.ts +0 -85
  756. package/references/opentasks/src/entire/__tests__/hook-managers.test.ts +0 -128
  757. package/references/opentasks/src/entire/__tests__/opencode-agent.test.ts +0 -329
  758. package/references/opentasks/src/entire/__tests__/redaction.test.ts +0 -143
  759. package/references/opentasks/src/entire/__tests__/session-store.test.ts +0 -83
  760. package/references/opentasks/src/entire/__tests__/summarize.test.ts +0 -346
  761. package/references/opentasks/src/entire/__tests__/transcript-timestamp.test.ts +0 -127
  762. package/references/opentasks/src/entire/__tests__/types.test.ts +0 -112
  763. package/references/opentasks/src/entire/__tests__/utils.test.ts +0 -296
  764. package/references/opentasks/src/entire/__tests__/validation.test.ts +0 -103
  765. package/references/opentasks/src/entire/__tests__/worktree.test.ts +0 -66
  766. package/references/opentasks/src/entire/agent/registry.ts +0 -143
  767. package/references/opentasks/src/entire/agent/session-types.ts +0 -117
  768. package/references/opentasks/src/entire/agent/types.ts +0 -217
  769. package/references/opentasks/src/entire/commands/clean.ts +0 -134
  770. package/references/opentasks/src/entire/commands/disable.ts +0 -85
  771. package/references/opentasks/src/entire/commands/doctor.ts +0 -152
  772. package/references/opentasks/src/entire/commands/enable.ts +0 -149
  773. package/references/opentasks/src/entire/commands/explain.ts +0 -271
  774. package/references/opentasks/src/entire/commands/reset.ts +0 -105
  775. package/references/opentasks/src/entire/commands/resume.ts +0 -194
  776. package/references/opentasks/src/entire/commands/rewind.ts +0 -204
  777. package/references/opentasks/src/entire/commands/status.ts +0 -150
  778. package/references/opentasks/src/entire/config.ts +0 -153
  779. package/references/opentasks/src/entire/git-operations.ts +0 -485
  780. package/references/opentasks/src/entire/hooks/git-hooks.ts +0 -171
  781. package/references/opentasks/src/entire/hooks/lifecycle.ts +0 -224
  782. package/references/opentasks/src/entire/index.ts +0 -644
  783. package/references/opentasks/src/entire/security/redaction.ts +0 -263
  784. package/references/opentasks/src/entire/session/state-machine.ts +0 -463
  785. package/references/opentasks/src/entire/store/checkpoint-store.ts +0 -489
  786. package/references/opentasks/src/entire/store/native-store.ts +0 -178
  787. package/references/opentasks/src/entire/store/provider-types.ts +0 -99
  788. package/references/opentasks/src/entire/store/session-store.ts +0 -233
  789. package/references/opentasks/src/entire/strategy/attribution.ts +0 -300
  790. package/references/opentasks/src/entire/strategy/common.ts +0 -222
  791. package/references/opentasks/src/entire/strategy/content-overlap.ts +0 -242
  792. package/references/opentasks/src/entire/strategy/manual-commit.ts +0 -1008
  793. package/references/opentasks/src/entire/strategy/types.ts +0 -285
  794. package/references/opentasks/src/entire/summarize/claude-generator.ts +0 -119
  795. package/references/opentasks/src/entire/summarize/summarize.ts +0 -432
  796. package/references/opentasks/src/entire/types.ts +0 -408
  797. package/references/opentasks/src/entire/utils/chunk-files.ts +0 -49
  798. package/references/opentasks/src/entire/utils/commit-message.ts +0 -65
  799. package/references/opentasks/src/entire/utils/detect-agent.ts +0 -36
  800. package/references/opentasks/src/entire/utils/hook-managers.ts +0 -118
  801. package/references/opentasks/src/entire/utils/ide-tags.ts +0 -32
  802. package/references/opentasks/src/entire/utils/paths.ts +0 -59
  803. package/references/opentasks/src/entire/utils/preview-rewind.ts +0 -86
  804. package/references/opentasks/src/entire/utils/rewind-conflict.ts +0 -121
  805. package/references/opentasks/src/entire/utils/shadow-branch.ts +0 -113
  806. package/references/opentasks/src/entire/utils/string-utils.ts +0 -46
  807. package/references/opentasks/src/entire/utils/todo-extract.ts +0 -193
  808. package/references/opentasks/src/entire/utils/trailers.ts +0 -190
  809. package/references/opentasks/src/entire/utils/transcript-parse.ts +0 -177
  810. package/references/opentasks/src/entire/utils/transcript-timestamp.ts +0 -61
  811. package/references/opentasks/src/entire/utils/tree-ops.ts +0 -227
  812. package/references/opentasks/src/entire/utils/tty.ts +0 -72
  813. package/references/opentasks/src/entire/utils/validation.ts +0 -67
  814. package/references/opentasks/src/entire/utils/worktree.ts +0 -58
  815. package/references/opentasks/src/graph/EdgeTypeRegistry.ts +0 -330
  816. package/references/opentasks/src/graph/FederatedGraph.ts +0 -796
  817. package/references/opentasks/src/graph/GraphologyAdapter.ts +0 -374
  818. package/references/opentasks/src/graph/HydratingFederatedGraph.ts +0 -533
  819. package/references/opentasks/src/graph/__tests__/EdgeTypeRegistry.test.ts +0 -263
  820. package/references/opentasks/src/graph/__tests__/FederatedGraph.test.ts +0 -821
  821. package/references/opentasks/src/graph/__tests__/GraphologyAdapter.test.ts +0 -408
  822. package/references/opentasks/src/graph/__tests__/HydratingFederatedGraph.test.ts +0 -735
  823. package/references/opentasks/src/graph/__tests__/debounce.test.ts +0 -276
  824. package/references/opentasks/src/graph/__tests__/e2e-store-roundtrip.test.ts +0 -349
  825. package/references/opentasks/src/graph/__tests__/edge-cases.test.ts +0 -595
  826. package/references/opentasks/src/graph/__tests__/expansion.test.ts +0 -304
  827. package/references/opentasks/src/graph/__tests__/git-graph-syncer.test.ts +0 -572
  828. package/references/opentasks/src/graph/__tests__/provider-store.test.ts +0 -1091
  829. package/references/opentasks/src/graph/__tests__/query.test.ts +0 -991
  830. package/references/opentasks/src/graph/__tests__/store.test.ts +0 -998
  831. package/references/opentasks/src/graph/__tests__/sync.test.ts +0 -178
  832. package/references/opentasks/src/graph/__tests__/validation.test.ts +0 -657
  833. package/references/opentasks/src/graph/coordination.ts +0 -454
  834. package/references/opentasks/src/graph/debounce.ts +0 -154
  835. package/references/opentasks/src/graph/expansion.ts +0 -364
  836. package/references/opentasks/src/graph/git-graph-syncer.ts +0 -321
  837. package/references/opentasks/src/graph/history.ts +0 -438
  838. package/references/opentasks/src/graph/index.ts +0 -145
  839. package/references/opentasks/src/graph/provider-store.ts +0 -1077
  840. package/references/opentasks/src/graph/query.ts +0 -651
  841. package/references/opentasks/src/graph/store.ts +0 -861
  842. package/references/opentasks/src/graph/sync.ts +0 -116
  843. package/references/opentasks/src/graph/types.ts +0 -420
  844. package/references/opentasks/src/graph/validation.ts +0 -520
  845. package/references/opentasks/src/index.ts +0 -270
  846. package/references/opentasks/src/materialization/CLAUDE.md +0 -88
  847. package/references/opentasks/src/materialization/README.md +0 -187
  848. package/references/opentasks/src/materialization/__tests__/archive-methods.test.ts +0 -194
  849. package/references/opentasks/src/materialization/__tests__/archiver.test.ts +0 -528
  850. package/references/opentasks/src/materialization/__tests__/config.test.ts +0 -123
  851. package/references/opentasks/src/materialization/__tests__/git-remote-store.test.ts +0 -533
  852. package/references/opentasks/src/materialization/__tests__/graph-id.test.ts +0 -82
  853. package/references/opentasks/src/materialization/__tests__/http-remote-store.test.ts +0 -263
  854. package/references/opentasks/src/materialization/__tests__/materialize-before-archive.test.ts +0 -246
  855. package/references/opentasks/src/materialization/__tests__/remote-store-factory.test.ts +0 -152
  856. package/references/opentasks/src/materialization/__tests__/snapshot.test.ts +0 -209
  857. package/references/opentasks/src/materialization/archiver.ts +0 -318
  858. package/references/opentasks/src/materialization/git-archive-store.ts +0 -568
  859. package/references/opentasks/src/materialization/git-remote-store.ts +0 -551
  860. package/references/opentasks/src/materialization/graph-id.ts +0 -173
  861. package/references/opentasks/src/materialization/http-remote-store.ts +0 -190
  862. package/references/opentasks/src/materialization/index.ts +0 -62
  863. package/references/opentasks/src/materialization/remote-store-factory.ts +0 -55
  864. package/references/opentasks/src/materialization/snapshot.ts +0 -230
  865. package/references/opentasks/src/materialization/types.ts +0 -410
  866. package/references/opentasks/src/providers/__tests__/beads.test.ts +0 -752
  867. package/references/opentasks/src/providers/__tests__/claude-tasks.test.ts +0 -485
  868. package/references/opentasks/src/providers/__tests__/entire-e2e.test.ts +0 -692
  869. package/references/opentasks/src/providers/__tests__/entire-sessionlog-e2e.test.ts +0 -1113
  870. package/references/opentasks/src/providers/__tests__/entire.test.ts +0 -1016
  871. package/references/opentasks/src/providers/__tests__/from-config.test.ts +0 -183
  872. package/references/opentasks/src/providers/__tests__/global.test.ts +0 -515
  873. package/references/opentasks/src/providers/__tests__/materialization.test.ts +0 -567
  874. package/references/opentasks/src/providers/__tests__/native.test.ts +0 -693
  875. package/references/opentasks/src/providers/__tests__/registry.test.ts +0 -232
  876. package/references/opentasks/src/providers/beads.ts +0 -1155
  877. package/references/opentasks/src/providers/claude-tasks.ts +0 -402
  878. package/references/opentasks/src/providers/entire.ts +0 -608
  879. package/references/opentasks/src/providers/from-config.ts +0 -210
  880. package/references/opentasks/src/providers/global.ts +0 -460
  881. package/references/opentasks/src/providers/index.ts +0 -147
  882. package/references/opentasks/src/providers/location.ts +0 -237
  883. package/references/opentasks/src/providers/materialization.ts +0 -346
  884. package/references/opentasks/src/providers/native.ts +0 -725
  885. package/references/opentasks/src/providers/registry.ts +0 -114
  886. package/references/opentasks/src/providers/sudocode.ts +0 -1292
  887. package/references/opentasks/src/providers/sync.ts +0 -485
  888. package/references/opentasks/src/providers/traits/RelationshipQueryable.ts +0 -169
  889. package/references/opentasks/src/providers/traits/TaskManageable.ts +0 -211
  890. package/references/opentasks/src/providers/traits/Watchable.ts +0 -260
  891. package/references/opentasks/src/providers/traits/__tests__/RelationshipQueryable.test.ts +0 -217
  892. package/references/opentasks/src/providers/traits/__tests__/TaskManageable.test.ts +0 -241
  893. package/references/opentasks/src/providers/traits/index.ts +0 -42
  894. package/references/opentasks/src/providers/types.ts +0 -439
  895. package/references/opentasks/src/schema/__tests__/validation.test.ts +0 -283
  896. package/references/opentasks/src/schema/base.ts +0 -88
  897. package/references/opentasks/src/schema/edges.ts +0 -78
  898. package/references/opentasks/src/schema/index.ts +0 -37
  899. package/references/opentasks/src/schema/nodes.ts +0 -119
  900. package/references/opentasks/src/schema/storage.ts +0 -130
  901. package/references/opentasks/src/schema/validation.ts +0 -209
  902. package/references/opentasks/src/storage/__tests__/atomic-write.test.ts +0 -227
  903. package/references/opentasks/src/storage/__tests__/file-lock.test.ts +0 -120
  904. package/references/opentasks/src/storage/__tests__/jsonl.test.ts +0 -267
  905. package/references/opentasks/src/storage/__tests__/locked-writer.test.ts +0 -134
  906. package/references/opentasks/src/storage/__tests__/sqlite.test.ts +0 -572
  907. package/references/opentasks/src/storage/atomic-write.ts +0 -86
  908. package/references/opentasks/src/storage/file-lock.ts +0 -215
  909. package/references/opentasks/src/storage/index.ts +0 -24
  910. package/references/opentasks/src/storage/interface.ts +0 -289
  911. package/references/opentasks/src/storage/jsonl.ts +0 -264
  912. package/references/opentasks/src/storage/locked-writer.ts +0 -140
  913. package/references/opentasks/src/storage/sqlite-schema.ts +0 -177
  914. package/references/opentasks/src/storage/sqlite.ts +0 -791
  915. package/references/opentasks/src/tools/__tests__/annotate.test.ts +0 -381
  916. package/references/opentasks/src/tools/__tests__/link.test.ts +0 -299
  917. package/references/opentasks/src/tools/__tests__/query.test.ts +0 -350
  918. package/references/opentasks/src/tools/__tests__/task.test.ts +0 -218
  919. package/references/opentasks/src/tools/annotate.ts +0 -277
  920. package/references/opentasks/src/tools/index.ts +0 -57
  921. package/references/opentasks/src/tools/link.ts +0 -163
  922. package/references/opentasks/src/tools/query.ts +0 -468
  923. package/references/opentasks/src/tools/task.ts +0 -213
  924. package/references/opentasks/src/tools/types.ts +0 -451
  925. package/references/opentasks/src/tracking/__tests__/claude-tool-categorizer.test.ts +0 -223
  926. package/references/opentasks/src/tracking/__tests__/transcript-extractor.test.ts +0 -262
  927. package/references/opentasks/src/tracking/claude-tool-categorizer.ts +0 -155
  928. package/references/opentasks/src/tracking/index.ts +0 -32
  929. package/references/opentasks/src/tracking/skill-tracker.ts +0 -322
  930. package/references/opentasks/src/tracking/transcript-extractor.ts +0 -225
  931. package/references/opentasks/tests/e2e/helpers/assertions.ts +0 -211
  932. package/references/opentasks/tests/e2e/helpers/beads-helpers.ts +0 -487
  933. package/references/opentasks/tests/e2e/helpers/fixtures.ts +0 -236
  934. package/references/opentasks/tests/e2e/helpers/index.ts +0 -122
  935. package/references/opentasks/tests/e2e/helpers/sudocode-helpers.ts +0 -341
  936. package/references/opentasks/tests/e2e/helpers/system-setup.ts +0 -504
  937. package/references/opentasks/tests/e2e/helpers/test-agent.ts +0 -504
  938. package/references/opentasks/tests/e2e/infrastructure.e2e.test.ts +0 -521
  939. package/references/opentasks/tests/e2e/skill-tracking.e2e.test.ts +0 -625
  940. package/references/opentasks/tests/e2e/workflows/feedback-loop.e2e.test.ts +0 -279
  941. package/references/opentasks/tests/e2e/workflows/multi-agent.e2e.test.ts +0 -304
  942. package/references/opentasks/tests/e2e/workflows/provider-sync/background-sync.e2e.test.ts +0 -292
  943. package/references/opentasks/tests/e2e/workflows/provider-sync/beads-provider-compat.e2e.test.ts +0 -249
  944. package/references/opentasks/tests/e2e/workflows/provider-sync/cross-provider-edges.e2e.test.ts +0 -407
  945. package/references/opentasks/tests/e2e/workflows/provider-sync/federated-ready.e2e.test.ts +0 -504
  946. package/references/opentasks/tests/e2e/workflows/provider-sync/hydration.e2e.test.ts +0 -340
  947. package/references/opentasks/tests/e2e/workflows/provider-sync/materialization.e2e.test.ts +0 -370
  948. package/references/opentasks/tests/e2e/workflows/provider-sync/sudocode-provider-compat.e2e.test.ts +0 -683
  949. package/references/opentasks/tests/e2e/workflows/provider-sync/watchable-beads.e2e.test.ts +0 -573
  950. package/references/opentasks/tests/e2e/workflows/spec-driven.e2e.test.ts +0 -244
  951. package/references/opentasks/tests/e2e/worktree-location.e2e.test.ts +0 -699
  952. package/references/opentasks/tests/integration/daemon/helpers.ts +0 -147
  953. package/references/opentasks/tests/integration/daemon/ipc.integration.test.ts +0 -343
  954. package/references/opentasks/tests/integration/daemon/lifecycle.integration.test.ts +0 -407
  955. package/references/opentasks/tests/integration/graph/federated-graph.integration.test.ts +0 -660
  956. package/references/opentasks/tests/integration/helpers/flags.ts +0 -28
  957. package/references/opentasks/tests/integration/helpers/index.ts +0 -47
  958. package/references/opentasks/tests/integration/helpers/process.ts +0 -133
  959. package/references/opentasks/tests/integration/helpers/temp.ts +0 -105
  960. package/references/opentasks/tests/integration/helpers/wait.ts +0 -133
  961. package/references/opentasks/tests/integration/helpers.test.ts +0 -120
  962. package/references/opentasks/tests/integration/providers/beads-task-manageable.integration.test.ts +0 -450
  963. package/references/opentasks/tests/integration/providers/beads.integration.test.ts +0 -388
  964. package/references/opentasks/tests/integration/providers/native-task-manageable.integration.test.ts +0 -667
  965. package/references/opentasks/tests/integration/providers/sudocode-task-manageable.integration.test.ts +0 -406
  966. package/references/opentasks/tests/integration/providers/sudocode.integration.test.ts +0 -342
  967. package/references/opentasks/tests/integration/storage/jsonl-durability.integration.test.ts +0 -390
  968. package/references/opentasks/tests/integration/storage/sqlite-durability.integration.test.ts +0 -527
  969. package/references/opentasks/tests/integration/worktree/redirect-location-resolution.integration.test.ts +0 -578
  970. package/references/opentasks/tests/integration/worktree/worktree-flow.integration.test.ts +0 -656
  971. package/references/opentasks/tsconfig.json +0 -18
  972. package/references/opentasks/vitest.config.ts +0 -27
  973. package/references/opentasks/vitest.e2e.config.ts +0 -35
  974. package/references/opentasks/vitest.integration.config.ts +0 -19
  975. package/references/openteams/.claude/settings.json +0 -6
  976. package/references/openteams/CLAUDE.md +0 -98
  977. package/references/openteams/README.md +0 -508
  978. package/references/openteams/SKILL.md +0 -198
  979. package/references/openteams/design.md +0 -250
  980. package/references/openteams/docs/visual-editor-design.md +0 -1225
  981. package/references/openteams/editor/index.html +0 -15
  982. package/references/openteams/editor/package.json +0 -39
  983. package/references/openteams/editor/src/App.tsx +0 -48
  984. package/references/openteams/editor/src/components/canvas/Canvas.tsx +0 -131
  985. package/references/openteams/editor/src/components/canvas/QuickAddMenu.tsx +0 -134
  986. package/references/openteams/editor/src/components/edges/PeerRouteEdge.tsx +0 -82
  987. package/references/openteams/editor/src/components/edges/SignalFlowEdge.tsx +0 -77
  988. package/references/openteams/editor/src/components/edges/SpawnEdge.tsx +0 -54
  989. package/references/openteams/editor/src/components/inspector/ChannelInspector.tsx +0 -158
  990. package/references/openteams/editor/src/components/inspector/EdgeInspector.tsx +0 -168
  991. package/references/openteams/editor/src/components/inspector/Inspector.tsx +0 -46
  992. package/references/openteams/editor/src/components/inspector/RoleInspector.tsx +0 -508
  993. package/references/openteams/editor/src/components/inspector/TeamInspector.tsx +0 -126
  994. package/references/openteams/editor/src/components/nodes/ChannelNode.tsx +0 -103
  995. package/references/openteams/editor/src/components/nodes/RoleNode.tsx +0 -157
  996. package/references/openteams/editor/src/components/nodes/node-styles.ts +0 -101
  997. package/references/openteams/editor/src/components/sidebar/Sidebar.tsx +0 -227
  998. package/references/openteams/editor/src/components/toolbar/ExportModal.tsx +0 -110
  999. package/references/openteams/editor/src/components/toolbar/ImportModal.tsx +0 -139
  1000. package/references/openteams/editor/src/components/toolbar/Toolbar.tsx +0 -190
  1001. package/references/openteams/editor/src/hooks/use-autosave.ts +0 -126
  1002. package/references/openteams/editor/src/hooks/use-keyboard.ts +0 -106
  1003. package/references/openteams/editor/src/hooks/use-validation.ts +0 -45
  1004. package/references/openteams/editor/src/index.css +0 -245
  1005. package/references/openteams/editor/src/lib/auto-layout.ts +0 -51
  1006. package/references/openteams/editor/src/lib/bundled-templates.ts +0 -42
  1007. package/references/openteams/editor/src/lib/compiler.ts +0 -75
  1008. package/references/openteams/editor/src/lib/load-template.ts +0 -103
  1009. package/references/openteams/editor/src/lib/rebuild-edges.ts +0 -104
  1010. package/references/openteams/editor/src/lib/serializer.ts +0 -408
  1011. package/references/openteams/editor/src/lib/signal-catalog.ts +0 -50
  1012. package/references/openteams/editor/src/lib/validator.ts +0 -172
  1013. package/references/openteams/editor/src/main.tsx +0 -10
  1014. package/references/openteams/editor/src/stores/canvas-store.ts +0 -80
  1015. package/references/openteams/editor/src/stores/config-store.ts +0 -243
  1016. package/references/openteams/editor/src/stores/history-store.ts +0 -143
  1017. package/references/openteams/editor/src/stores/theme-store.ts +0 -66
  1018. package/references/openteams/editor/src/stores/ui-store.ts +0 -46
  1019. package/references/openteams/editor/src/stores/validation-store.ts +0 -27
  1020. package/references/openteams/editor/src/types/editor.ts +0 -74
  1021. package/references/openteams/editor/src/vite-env.d.ts +0 -1
  1022. package/references/openteams/editor/tests/compiler.test.ts +0 -151
  1023. package/references/openteams/editor/tests/e2e-add-remove.test.ts +0 -386
  1024. package/references/openteams/editor/tests/e2e-components.test.tsx +0 -424
  1025. package/references/openteams/editor/tests/e2e-export-roundtrip.test.ts +0 -299
  1026. package/references/openteams/editor/tests/e2e-template-load.test.ts +0 -204
  1027. package/references/openteams/editor/tests/e2e-ui-store.test.ts +0 -126
  1028. package/references/openteams/editor/tests/e2e-undo-redo.test.ts +0 -203
  1029. package/references/openteams/editor/tests/e2e-validation.test.ts +0 -307
  1030. package/references/openteams/editor/tests/serializer.test.ts +0 -142
  1031. package/references/openteams/editor/tests/setup.ts +0 -52
  1032. package/references/openteams/editor/tests/validator.test.ts +0 -92
  1033. package/references/openteams/editor/tsconfig.json +0 -21
  1034. package/references/openteams/editor/tsconfig.tsbuildinfo +0 -1
  1035. package/references/openteams/editor/vite.config.ts +0 -28
  1036. package/references/openteams/examples/bmad-method/prompts/analyst/ROLE.md +0 -16
  1037. package/references/openteams/examples/bmad-method/prompts/analyst/SOUL.md +0 -5
  1038. package/references/openteams/examples/bmad-method/prompts/architect/ROLE.md +0 -24
  1039. package/references/openteams/examples/bmad-method/prompts/architect/SOUL.md +0 -5
  1040. package/references/openteams/examples/bmad-method/prompts/developer/ROLE.md +0 -25
  1041. package/references/openteams/examples/bmad-method/prompts/developer/SOUL.md +0 -5
  1042. package/references/openteams/examples/bmad-method/prompts/master/ROLE.md +0 -21
  1043. package/references/openteams/examples/bmad-method/prompts/master/SOUL.md +0 -5
  1044. package/references/openteams/examples/bmad-method/prompts/pm/ROLE.md +0 -20
  1045. package/references/openteams/examples/bmad-method/prompts/pm/SOUL.md +0 -5
  1046. package/references/openteams/examples/bmad-method/prompts/qa/ROLE.md +0 -17
  1047. package/references/openteams/examples/bmad-method/prompts/qa/SOUL.md +0 -5
  1048. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/ROLE.md +0 -23
  1049. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/SOUL.md +0 -5
  1050. package/references/openteams/examples/bmad-method/prompts/scrum-master/ROLE.md +0 -27
  1051. package/references/openteams/examples/bmad-method/prompts/scrum-master/SOUL.md +0 -5
  1052. package/references/openteams/examples/bmad-method/prompts/tech-writer/ROLE.md +0 -21
  1053. package/references/openteams/examples/bmad-method/prompts/tech-writer/SOUL.md +0 -5
  1054. package/references/openteams/examples/bmad-method/prompts/ux-designer/ROLE.md +0 -16
  1055. package/references/openteams/examples/bmad-method/prompts/ux-designer/SOUL.md +0 -5
  1056. package/references/openteams/examples/bmad-method/roles/analyst.yaml +0 -9
  1057. package/references/openteams/examples/bmad-method/roles/architect.yaml +0 -9
  1058. package/references/openteams/examples/bmad-method/roles/developer.yaml +0 -8
  1059. package/references/openteams/examples/bmad-method/roles/master.yaml +0 -8
  1060. package/references/openteams/examples/bmad-method/roles/pm.yaml +0 -9
  1061. package/references/openteams/examples/bmad-method/roles/qa.yaml +0 -8
  1062. package/references/openteams/examples/bmad-method/roles/quick-flow-dev.yaml +0 -8
  1063. package/references/openteams/examples/bmad-method/roles/scrum-master.yaml +0 -9
  1064. package/references/openteams/examples/bmad-method/roles/tech-writer.yaml +0 -8
  1065. package/references/openteams/examples/bmad-method/roles/ux-designer.yaml +0 -8
  1066. package/references/openteams/examples/bmad-method/team.yaml +0 -161
  1067. package/references/openteams/examples/bug-fix-pipeline/roles/fixer.yaml +0 -9
  1068. package/references/openteams/examples/bug-fix-pipeline/roles/investigator.yaml +0 -8
  1069. package/references/openteams/examples/bug-fix-pipeline/roles/pr-creator.yaml +0 -6
  1070. package/references/openteams/examples/bug-fix-pipeline/roles/triager.yaml +0 -7
  1071. package/references/openteams/examples/bug-fix-pipeline/roles/verifier.yaml +0 -8
  1072. package/references/openteams/examples/bug-fix-pipeline/team.yaml +0 -88
  1073. package/references/openteams/examples/codebase-migration/roles/assessor.yaml +0 -7
  1074. package/references/openteams/examples/codebase-migration/roles/migrator.yaml +0 -9
  1075. package/references/openteams/examples/codebase-migration/roles/planner.yaml +0 -5
  1076. package/references/openteams/examples/codebase-migration/roles/test-extractor.yaml +0 -9
  1077. package/references/openteams/examples/codebase-migration/roles/validator.yaml +0 -7
  1078. package/references/openteams/examples/codebase-migration/team.yaml +0 -81
  1079. package/references/openteams/examples/docs-sync/roles/adr-writer.yaml +0 -7
  1080. package/references/openteams/examples/docs-sync/roles/api-doc-writer.yaml +0 -7
  1081. package/references/openteams/examples/docs-sync/roles/change-detector.yaml +0 -7
  1082. package/references/openteams/examples/docs-sync/roles/doc-reviewer.yaml +0 -7
  1083. package/references/openteams/examples/docs-sync/roles/guide-writer.yaml +0 -7
  1084. package/references/openteams/examples/docs-sync/team.yaml +0 -84
  1085. package/references/openteams/examples/gsd/prompts/codebase-mapper/ROLE.md +0 -17
  1086. package/references/openteams/examples/gsd/prompts/codebase-mapper/SOUL.md +0 -5
  1087. package/references/openteams/examples/gsd/prompts/debugger/ROLE.md +0 -25
  1088. package/references/openteams/examples/gsd/prompts/debugger/SOUL.md +0 -5
  1089. package/references/openteams/examples/gsd/prompts/executor/ROLE.md +0 -34
  1090. package/references/openteams/examples/gsd/prompts/executor/SOUL.md +0 -5
  1091. package/references/openteams/examples/gsd/prompts/integration-checker/ROLE.md +0 -18
  1092. package/references/openteams/examples/gsd/prompts/integration-checker/SOUL.md +0 -3
  1093. package/references/openteams/examples/gsd/prompts/orchestrator/ROLE.md +0 -42
  1094. package/references/openteams/examples/gsd/prompts/orchestrator/SOUL.md +0 -5
  1095. package/references/openteams/examples/gsd/prompts/phase-researcher/ROLE.md +0 -15
  1096. package/references/openteams/examples/gsd/prompts/phase-researcher/SOUL.md +0 -3
  1097. package/references/openteams/examples/gsd/prompts/plan-checker/ROLE.md +0 -17
  1098. package/references/openteams/examples/gsd/prompts/plan-checker/SOUL.md +0 -3
  1099. package/references/openteams/examples/gsd/prompts/planner/ROLE.md +0 -28
  1100. package/references/openteams/examples/gsd/prompts/planner/SOUL.md +0 -5
  1101. package/references/openteams/examples/gsd/prompts/project-researcher/ROLE.md +0 -16
  1102. package/references/openteams/examples/gsd/prompts/project-researcher/SOUL.md +0 -3
  1103. package/references/openteams/examples/gsd/prompts/research-synthesizer/ROLE.md +0 -13
  1104. package/references/openteams/examples/gsd/prompts/research-synthesizer/SOUL.md +0 -3
  1105. package/references/openteams/examples/gsd/prompts/roadmapper/ROLE.md +0 -14
  1106. package/references/openteams/examples/gsd/prompts/roadmapper/SOUL.md +0 -3
  1107. package/references/openteams/examples/gsd/prompts/verifier/ROLE.md +0 -19
  1108. package/references/openteams/examples/gsd/prompts/verifier/SOUL.md +0 -5
  1109. package/references/openteams/examples/gsd/roles/codebase-mapper.yaml +0 -8
  1110. package/references/openteams/examples/gsd/roles/debugger.yaml +0 -8
  1111. package/references/openteams/examples/gsd/roles/executor.yaml +0 -8
  1112. package/references/openteams/examples/gsd/roles/integration-checker.yaml +0 -8
  1113. package/references/openteams/examples/gsd/roles/orchestrator.yaml +0 -9
  1114. package/references/openteams/examples/gsd/roles/phase-researcher.yaml +0 -7
  1115. package/references/openteams/examples/gsd/roles/plan-checker.yaml +0 -8
  1116. package/references/openteams/examples/gsd/roles/planner.yaml +0 -8
  1117. package/references/openteams/examples/gsd/roles/project-researcher.yaml +0 -8
  1118. package/references/openteams/examples/gsd/roles/research-synthesizer.yaml +0 -7
  1119. package/references/openteams/examples/gsd/roles/roadmapper.yaml +0 -7
  1120. package/references/openteams/examples/gsd/roles/verifier.yaml +0 -8
  1121. package/references/openteams/examples/gsd/team.yaml +0 -154
  1122. package/references/openteams/examples/incident-response/roles/communicator.yaml +0 -5
  1123. package/references/openteams/examples/incident-response/roles/fix-proposer.yaml +0 -7
  1124. package/references/openteams/examples/incident-response/roles/incident-triager.yaml +0 -8
  1125. package/references/openteams/examples/incident-response/roles/investigator.yaml +0 -8
  1126. package/references/openteams/examples/incident-response/team.yaml +0 -68
  1127. package/references/openteams/examples/pr-review-checks/roles/code-reviewer.yaml +0 -7
  1128. package/references/openteams/examples/pr-review-checks/roles/security-scanner.yaml +0 -6
  1129. package/references/openteams/examples/pr-review-checks/roles/summarizer.yaml +0 -6
  1130. package/references/openteams/examples/pr-review-checks/roles/test-checker.yaml +0 -8
  1131. package/references/openteams/examples/pr-review-checks/team.yaml +0 -64
  1132. package/references/openteams/examples/security-audit/roles/code-analyzer.yaml +0 -6
  1133. package/references/openteams/examples/security-audit/roles/dep-scanner.yaml +0 -7
  1134. package/references/openteams/examples/security-audit/roles/fixer.yaml +0 -9
  1135. package/references/openteams/examples/security-audit/roles/pr-creator.yaml +0 -6
  1136. package/references/openteams/examples/security-audit/roles/prioritizer.yaml +0 -6
  1137. package/references/openteams/examples/security-audit/roles/secrets-scanner.yaml +0 -6
  1138. package/references/openteams/examples/security-audit/roles/verifier.yaml +0 -8
  1139. package/references/openteams/examples/security-audit/team.yaml +0 -102
  1140. package/references/openteams/media/banner.png +0 -0
  1141. package/references/openteams/media/editor.png +0 -0
  1142. package/references/openteams/package-lock.json +0 -4804
  1143. package/references/openteams/package.json +0 -58
  1144. package/references/openteams/schema/role.schema.json +0 -147
  1145. package/references/openteams/schema/team.schema.json +0 -311
  1146. package/references/openteams/src/cli/editor.ts +0 -170
  1147. package/references/openteams/src/cli/generate.test.ts +0 -191
  1148. package/references/openteams/src/cli/generate.ts +0 -242
  1149. package/references/openteams/src/cli/prompt-utils.ts +0 -42
  1150. package/references/openteams/src/cli/template.test.ts +0 -365
  1151. package/references/openteams/src/cli/template.ts +0 -205
  1152. package/references/openteams/src/cli.ts +0 -22
  1153. package/references/openteams/src/generators/agent-prompt-generator.test.ts +0 -426
  1154. package/references/openteams/src/generators/agent-prompt-generator.ts +0 -556
  1155. package/references/openteams/src/generators/package-generator.test.ts +0 -129
  1156. package/references/openteams/src/generators/package-generator.ts +0 -110
  1157. package/references/openteams/src/generators/skill-generator.test.ts +0 -274
  1158. package/references/openteams/src/generators/skill-generator.ts +0 -394
  1159. package/references/openteams/src/index.ts +0 -84
  1160. package/references/openteams/src/template/builtins.test.ts +0 -74
  1161. package/references/openteams/src/template/builtins.ts +0 -108
  1162. package/references/openteams/src/template/install-service.test.ts +0 -452
  1163. package/references/openteams/src/template/install-service.ts +0 -332
  1164. package/references/openteams/src/template/loader.test.ts +0 -1696
  1165. package/references/openteams/src/template/loader.ts +0 -804
  1166. package/references/openteams/src/template/resolver.test.ts +0 -304
  1167. package/references/openteams/src/template/resolver.ts +0 -251
  1168. package/references/openteams/src/template/types.ts +0 -229
  1169. package/references/openteams/tsconfig.cjs.json +0 -7
  1170. package/references/openteams/tsconfig.esm.json +0 -8
  1171. package/references/openteams/tsconfig.json +0 -16
  1172. package/references/openteams/vitest.config.ts +0 -9
  1173. package/references/sessionlog/.husky/pre-commit +0 -1
  1174. package/references/sessionlog/.lintstagedrc.json +0 -4
  1175. package/references/sessionlog/.prettierignore +0 -4
  1176. package/references/sessionlog/.prettierrc.json +0 -11
  1177. package/references/sessionlog/LICENSE +0 -21
  1178. package/references/sessionlog/README.md +0 -453
  1179. package/references/sessionlog/eslint.config.js +0 -58
  1180. package/references/sessionlog/package-lock.json +0 -3672
  1181. package/references/sessionlog/package.json +0 -65
  1182. package/references/sessionlog/src/__tests__/agent-hooks.test.ts +0 -570
  1183. package/references/sessionlog/src/__tests__/agent-registry.test.ts +0 -127
  1184. package/references/sessionlog/src/__tests__/claude-code-hooks.test.ts +0 -225
  1185. package/references/sessionlog/src/__tests__/claude-generator.test.ts +0 -46
  1186. package/references/sessionlog/src/__tests__/commit-msg.test.ts +0 -86
  1187. package/references/sessionlog/src/__tests__/cursor-agent.test.ts +0 -224
  1188. package/references/sessionlog/src/__tests__/e2e-live.test.ts +0 -890
  1189. package/references/sessionlog/src/__tests__/event-log.test.ts +0 -183
  1190. package/references/sessionlog/src/__tests__/flush-sentinel.test.ts +0 -105
  1191. package/references/sessionlog/src/__tests__/gemini-agent.test.ts +0 -375
  1192. package/references/sessionlog/src/__tests__/git-hooks.test.ts +0 -78
  1193. package/references/sessionlog/src/__tests__/hook-managers.test.ts +0 -121
  1194. package/references/sessionlog/src/__tests__/lifecycle-tasks.test.ts +0 -759
  1195. package/references/sessionlog/src/__tests__/opencode-agent.test.ts +0 -338
  1196. package/references/sessionlog/src/__tests__/redaction.test.ts +0 -136
  1197. package/references/sessionlog/src/__tests__/session-repo.test.ts +0 -353
  1198. package/references/sessionlog/src/__tests__/session-store.test.ts +0 -166
  1199. package/references/sessionlog/src/__tests__/setup-ccweb.test.ts +0 -466
  1200. package/references/sessionlog/src/__tests__/skill-live.test.ts +0 -461
  1201. package/references/sessionlog/src/__tests__/summarize.test.ts +0 -348
  1202. package/references/sessionlog/src/__tests__/task-plan-e2e.test.ts +0 -610
  1203. package/references/sessionlog/src/__tests__/task-plan-live.test.ts +0 -632
  1204. package/references/sessionlog/src/__tests__/transcript-timestamp.test.ts +0 -121
  1205. package/references/sessionlog/src/__tests__/types.test.ts +0 -166
  1206. package/references/sessionlog/src/__tests__/utils.test.ts +0 -333
  1207. package/references/sessionlog/src/__tests__/validation.test.ts +0 -103
  1208. package/references/sessionlog/src/__tests__/worktree.test.ts +0 -57
  1209. package/references/sessionlog/src/agent/registry.ts +0 -143
  1210. package/references/sessionlog/src/agent/session-types.ts +0 -113
  1211. package/references/sessionlog/src/agent/types.ts +0 -220
  1212. package/references/sessionlog/src/cli.ts +0 -597
  1213. package/references/sessionlog/src/commands/clean.ts +0 -133
  1214. package/references/sessionlog/src/commands/disable.ts +0 -84
  1215. package/references/sessionlog/src/commands/doctor.ts +0 -145
  1216. package/references/sessionlog/src/commands/enable.ts +0 -202
  1217. package/references/sessionlog/src/commands/explain.ts +0 -261
  1218. package/references/sessionlog/src/commands/reset.ts +0 -105
  1219. package/references/sessionlog/src/commands/resume.ts +0 -180
  1220. package/references/sessionlog/src/commands/rewind.ts +0 -195
  1221. package/references/sessionlog/src/commands/setup-ccweb.ts +0 -275
  1222. package/references/sessionlog/src/commands/status.ts +0 -172
  1223. package/references/sessionlog/src/config.ts +0 -165
  1224. package/references/sessionlog/src/events/event-log.ts +0 -126
  1225. package/references/sessionlog/src/git-operations.ts +0 -558
  1226. package/references/sessionlog/src/hooks/git-hooks.ts +0 -165
  1227. package/references/sessionlog/src/hooks/lifecycle.ts +0 -391
  1228. package/references/sessionlog/src/index.ts +0 -650
  1229. package/references/sessionlog/src/security/redaction.ts +0 -283
  1230. package/references/sessionlog/src/session/state-machine.ts +0 -452
  1231. package/references/sessionlog/src/store/checkpoint-store.ts +0 -509
  1232. package/references/sessionlog/src/store/native-store.ts +0 -173
  1233. package/references/sessionlog/src/store/provider-types.ts +0 -99
  1234. package/references/sessionlog/src/store/session-store.ts +0 -266
  1235. package/references/sessionlog/src/strategy/attribution.ts +0 -296
  1236. package/references/sessionlog/src/strategy/common.ts +0 -207
  1237. package/references/sessionlog/src/strategy/content-overlap.ts +0 -228
  1238. package/references/sessionlog/src/strategy/manual-commit.ts +0 -988
  1239. package/references/sessionlog/src/strategy/types.ts +0 -279
  1240. package/references/sessionlog/src/summarize/claude-generator.ts +0 -115
  1241. package/references/sessionlog/src/summarize/summarize.ts +0 -432
  1242. package/references/sessionlog/src/types.ts +0 -508
  1243. package/references/sessionlog/src/utils/chunk-files.ts +0 -49
  1244. package/references/sessionlog/src/utils/commit-message.ts +0 -65
  1245. package/references/sessionlog/src/utils/detect-agent.ts +0 -36
  1246. package/references/sessionlog/src/utils/hook-managers.ts +0 -125
  1247. package/references/sessionlog/src/utils/ide-tags.ts +0 -32
  1248. package/references/sessionlog/src/utils/paths.ts +0 -79
  1249. package/references/sessionlog/src/utils/preview-rewind.ts +0 -80
  1250. package/references/sessionlog/src/utils/rewind-conflict.ts +0 -121
  1251. package/references/sessionlog/src/utils/shadow-branch.ts +0 -109
  1252. package/references/sessionlog/src/utils/string-utils.ts +0 -46
  1253. package/references/sessionlog/src/utils/todo-extract.ts +0 -188
  1254. package/references/sessionlog/src/utils/trailers.ts +0 -187
  1255. package/references/sessionlog/src/utils/transcript-parse.ts +0 -177
  1256. package/references/sessionlog/src/utils/transcript-timestamp.ts +0 -59
  1257. package/references/sessionlog/src/utils/tree-ops.ts +0 -219
  1258. package/references/sessionlog/src/utils/tty.ts +0 -72
  1259. package/references/sessionlog/src/utils/validation.ts +0 -65
  1260. package/references/sessionlog/src/utils/worktree.ts +0 -58
  1261. package/references/sessionlog/src/wire-types.ts +0 -59
  1262. package/references/sessionlog/templates/setup-env.sh +0 -153
  1263. package/references/sessionlog/tsconfig.json +0 -18
  1264. package/references/sessionlog/vitest.config.ts +0 -12
  1265. package/references/skill-tree/.claude/settings.json +0 -6
  1266. package/references/skill-tree/.sudocode/issues.jsonl +0 -19
  1267. package/references/skill-tree/.sudocode/specs.jsonl +0 -3
  1268. package/references/skill-tree/CLAUDE.md +0 -132
  1269. package/references/skill-tree/README.md +0 -396
  1270. package/references/skill-tree/docs/GAPS_v1.md +0 -221
  1271. package/references/skill-tree/docs/INTEGRATION_PLAN.md +0 -467
  1272. package/references/skill-tree/docs/TODOS.md +0 -91
  1273. package/references/skill-tree/docs/anthropic_skill_guide.md +0 -1364
  1274. package/references/skill-tree/docs/design/federated-skill-trees.md +0 -524
  1275. package/references/skill-tree/docs/design/multi-agent-sync.md +0 -759
  1276. package/references/skill-tree/docs/scraper/BRAINSTORM.md +0 -583
  1277. package/references/skill-tree/docs/scraper/POC_PLAN.md +0 -420
  1278. package/references/skill-tree/docs/scraper/README.md +0 -170
  1279. package/references/skill-tree/examples/basic-usage.ts +0 -157
  1280. package/references/skill-tree/package-lock.json +0 -1852
  1281. package/references/skill-tree/package.json +0 -66
  1282. package/references/skill-tree/plan.md +0 -78
  1283. package/references/skill-tree/scraper/README.md +0 -123
  1284. package/references/skill-tree/scraper/docs/DESIGN.md +0 -683
  1285. package/references/skill-tree/scraper/docs/PLAN.md +0 -336
  1286. package/references/skill-tree/scraper/drizzle.config.ts +0 -10
  1287. package/references/skill-tree/scraper/package-lock.json +0 -6329
  1288. package/references/skill-tree/scraper/package.json +0 -68
  1289. package/references/skill-tree/scraper/test/fixtures/invalid-skill/missing-description.md +0 -7
  1290. package/references/skill-tree/scraper/test/fixtures/invalid-skill/missing-name.md +0 -7
  1291. package/references/skill-tree/scraper/test/fixtures/minimal-skill/SKILL.md +0 -27
  1292. package/references/skill-tree/scraper/test/fixtures/skill-json/SKILL.json +0 -21
  1293. package/references/skill-tree/scraper/test/fixtures/skill-with-meta/SKILL.md +0 -54
  1294. package/references/skill-tree/scraper/test/fixtures/skill-with-meta/_meta.json +0 -24
  1295. package/references/skill-tree/scraper/test/fixtures/valid-skill/SKILL.md +0 -93
  1296. package/references/skill-tree/scraper/test/fixtures/valid-skill/_meta.json +0 -22
  1297. package/references/skill-tree/scraper/tsup.config.ts +0 -14
  1298. package/references/skill-tree/scraper/vitest.config.ts +0 -17
  1299. package/references/skill-tree/scripts/convert-to-vitest.ts +0 -166
  1300. package/references/skill-tree/skills/skill-writer/SKILL.md +0 -339
  1301. package/references/skill-tree/skills/skill-writer/references/examples.md +0 -326
  1302. package/references/skill-tree/skills/skill-writer/references/patterns.md +0 -210
  1303. package/references/skill-tree/skills/skill-writer/references/quality-checklist.md +0 -123
  1304. package/references/skill-tree/test/run-all.ts +0 -106
  1305. package/references/skill-tree/test/utils.ts +0 -128
  1306. package/references/skill-tree/vitest.config.ts +0 -16
  1307. package/references/swarmkit/LICENSE +0 -21
  1308. package/references/swarmkit/README.md +0 -130
  1309. package/references/swarmkit/docs/design.md +0 -453
  1310. package/references/swarmkit/docs/package-setup-reference.md +0 -519
  1311. package/references/swarmkit/package-lock.json +0 -1938
  1312. package/references/swarmkit/package.json +0 -43
  1313. package/references/swarmkit/src/cli.ts +0 -41
  1314. package/references/swarmkit/src/commands/add.ts +0 -126
  1315. package/references/swarmkit/src/commands/doctor.ts +0 -117
  1316. package/references/swarmkit/src/commands/hive.ts +0 -279
  1317. package/references/swarmkit/src/commands/init/phases/configure.ts +0 -74
  1318. package/references/swarmkit/src/commands/init/phases/global-setup.ts +0 -104
  1319. package/references/swarmkit/src/commands/init/phases/packages.ts +0 -44
  1320. package/references/swarmkit/src/commands/init/phases/project.ts +0 -81
  1321. package/references/swarmkit/src/commands/init/phases/use-case.ts +0 -47
  1322. package/references/swarmkit/src/commands/init/state.test.ts +0 -23
  1323. package/references/swarmkit/src/commands/init/state.ts +0 -22
  1324. package/references/swarmkit/src/commands/init/wizard.ts +0 -160
  1325. package/references/swarmkit/src/commands/init.ts +0 -17
  1326. package/references/swarmkit/src/commands/login.ts +0 -106
  1327. package/references/swarmkit/src/commands/logout.ts +0 -22
  1328. package/references/swarmkit/src/commands/remove.ts +0 -72
  1329. package/references/swarmkit/src/commands/status.ts +0 -101
  1330. package/references/swarmkit/src/commands/update.ts +0 -62
  1331. package/references/swarmkit/src/commands/whoami.ts +0 -41
  1332. package/references/swarmkit/src/config/global.test.ts +0 -258
  1333. package/references/swarmkit/src/config/global.ts +0 -141
  1334. package/references/swarmkit/src/config/keys.test.ts +0 -109
  1335. package/references/swarmkit/src/config/keys.ts +0 -49
  1336. package/references/swarmkit/src/doctor/checks.test.ts +0 -366
  1337. package/references/swarmkit/src/doctor/checks.ts +0 -292
  1338. package/references/swarmkit/src/doctor/types.ts +0 -33
  1339. package/references/swarmkit/src/hub/auth-flow.test.ts +0 -127
  1340. package/references/swarmkit/src/hub/auth-flow.ts +0 -144
  1341. package/references/swarmkit/src/hub/client.test.ts +0 -224
  1342. package/references/swarmkit/src/hub/client.ts +0 -185
  1343. package/references/swarmkit/src/hub/credentials.test.ts +0 -132
  1344. package/references/swarmkit/src/hub/credentials.ts +0 -51
  1345. package/references/swarmkit/src/index.ts +0 -116
  1346. package/references/swarmkit/src/packages/installer.test.ts +0 -365
  1347. package/references/swarmkit/src/packages/installer.ts +0 -206
  1348. package/references/swarmkit/src/packages/plugin.test.ts +0 -141
  1349. package/references/swarmkit/src/packages/plugin.ts +0 -46
  1350. package/references/swarmkit/src/packages/registry.test.ts +0 -235
  1351. package/references/swarmkit/src/packages/registry.ts +0 -209
  1352. package/references/swarmkit/src/packages/setup.test.ts +0 -1395
  1353. package/references/swarmkit/src/packages/setup.ts +0 -671
  1354. package/references/swarmkit/src/utils/ui.test.ts +0 -115
  1355. package/references/swarmkit/src/utils/ui.ts +0 -62
  1356. package/references/swarmkit/tsconfig.json +0 -17
  1357. package/references/swarmkit/vitest.config.ts +0 -9
@@ -1,6 +0,0 @@
1
- {
2
- "attribution": {
3
- "commit": "",
4
- "pr": ""
5
- }
6
- }
@@ -1,54 +0,0 @@
1
- # Dependencies
2
- node_modules
3
- src/web/node_modules
4
-
5
- # Build output (will be rebuilt in container)
6
- dist
7
-
8
- # Data directories (should be mounted as volumes)
9
- data
10
- uploads
11
- *.db
12
- *.db-wal
13
- *.db-shm
14
-
15
- # Git
16
- .git
17
- .gitignore
18
-
19
- # Documentation (not needed in container)
20
- *.md
21
- !README.md
22
- docs/
23
-
24
- # Logs
25
- logs
26
- *.log
27
-
28
- # Environment files (secrets should be passed via env vars)
29
- .env*
30
- !.env.example
31
-
32
- # Deployment configs (not needed inside container)
33
- docker-compose*.yml
34
- Dockerfile*
35
- fly.toml
36
- render.yaml
37
- railway.toml
38
- railway.json
39
- ecosystem.config.js
40
- deploy/
41
-
42
- # Development
43
- coverage
44
- .nyc_output
45
- .vscode
46
- .idea
47
- *.swp
48
- *.swo
49
- .DS_Store
50
-
51
- # Tests
52
- **/*.test.ts
53
- **/*.spec.ts
54
- __tests__
@@ -1,52 +0,0 @@
1
- name: Build & Push Docker Image
2
-
3
- on:
4
- push:
5
- tags: ['v*']
6
- workflow_dispatch:
7
-
8
- env:
9
- REGISTRY: ghcr.io
10
- IMAGE_NAME: ${{ github.repository }}
11
-
12
- jobs:
13
- build:
14
- runs-on: ubuntu-latest
15
- permissions:
16
- contents: read
17
- packages: write
18
-
19
- steps:
20
- - uses: actions/checkout@v4
21
-
22
- - uses: docker/setup-buildx-action@v3
23
-
24
- - name: Log in to GHCR
25
- uses: docker/login-action@v3
26
- if: github.event_name != 'pull_request'
27
- with:
28
- registry: ${{ env.REGISTRY }}
29
- username: ${{ github.actor }}
30
- password: ${{ secrets.GITHUB_TOKEN }}
31
-
32
- - name: Extract metadata
33
- id: meta
34
- uses: docker/metadata-action@v5
35
- with:
36
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37
- tags: |
38
- type=semver,pattern={{version}}
39
- type=semver,pattern={{major}}.{{minor}}
40
- type=sha,prefix=
41
- type=raw,value=latest,enable={{is_default_branch}}
42
-
43
- - name: Build and push
44
- uses: docker/build-push-action@v6
45
- with:
46
- context: .
47
- platforms: linux/amd64
48
- push: ${{ github.event_name != 'pull_request' }}
49
- tags: ${{ steps.meta.outputs.tags }}
50
- labels: ${{ steps.meta.outputs.labels }}
51
- cache-from: type=gha
52
- cache-to: type=gha,mode=max
@@ -1,24 +0,0 @@
1
- {"id":"i-5nl8","uuid":"635db055-4a70-4507-aa34-be71b96a5c1c","title":"Define MAP sync message types","content":"\nDefine the shared `memory:sync` and `skill:sync` message type interfaces that both OpenHive and swarms use.\n\n```typescript\ntype MapSyncMessage = {\n type: \"memory:sync\" | \"skill:sync\";\n resource_id: string; // syncable_resources ID\n agent_id: string; // who pushed\n commit_hash: string; // git commit\n timestamp: string; // ISO 8601\n}\n```\n\nThis is the contract between swarms and OpenHive. Decide where these types live (shared package, or duplicated in each project).\n\nImplements [[s-78fe]].\n","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-20 08:38:13","updated_at":"2026-02-20 10:30:50","closed_at":"2026-02-20 10:30:50","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-5nl8","from_type":"issue","to":"i-52t0","to_type":"issue","type":"blocks"},{"from":"i-5nl8","from_type":"issue","to":"i-66ra","to_type":"issue","type":"blocks"},{"from":"i-5nl8","from_type":"issue","to":"s-78fe","to_type":"spec","type":"implements"}],"tags":["MAP","sync","types"],"feedback":[{"id":"1ddbae83-ac92-482b-a942-08d31145ea3c","from_id":"i-5nl8","to_id":"s-78fe","feedback_type":"comment","content":"Added `MapSyncMessage` interface and `MapSyncMessageType` to `src/map/types.ts`. Added `memory:sync` and `skill:sync` to `WSEventType` in `src/types.ts`. Types live in the OpenHive package alongside other MAP types — swarm implementations will import or duplicate the interface.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-20T10:30:49.974Z","updated_at":"2026-02-20T10:30:49.974Z"}]}
2
- {"id":"i-66ra","uuid":"ad5642a7-3934-40b6-96c8-838a938bff40","title":"OpenHive: Subscribe to swarm MAP endpoints for sync messages","content":"\nWhen a swarm registers via `POST /map/swarms`, OpenHive should subscribe to the swarm's `map_endpoint` using the declared `map_transport` (websocket / http-sse / ndjson).\n\nOpenHive filters for `memory:sync` and `skill:sync` message types. On receiving either:\n\n1. **Bookkeeping** — update `syncable_resources` sync state:\n - `updateResourceSyncState(resource_id, commit_hash, agent_id)`\n - `createSyncEvent({ resource_id, commit_hash, pusher: agent_id, ... })`\n2. **WebSocket broadcast** — emit on `resource:{type}:{id}` channel for web UI / non-MAP clients\n\nThis replaces webhooks as the primary sync signal for MAP-aware swarms. Webhooks remain as a parallel path for non-MAP git pushes.\n\nDepends on [[i-5nl8]] for message type definitions.\nImplements [[s-78fe]].\n","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-20 08:38:28","updated_at":"2026-02-20 10:33:46","closed_at":"2026-02-20 10:33:46","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-66ra","from_type":"issue","to":"i-54gb","to_type":"issue","type":"blocks"},{"from":"i-66ra","from_type":"issue","to":"s-78fe","to_type":"spec","type":"implements"}],"tags":["MAP","openhive","sync"],"feedback":[{"id":"87c7d177-89a5-460c-985e-b296a9189c50","from_id":"i-66ra","to_id":"s-78fe","feedback_type":"comment","content":"Created `src/map/sync-listener.ts` with:\n- `initMapSyncListener()` — connects to all online swarms at startup, subscribes to `mapHubEvents` for new registrations\n- `handleSyncMessage()` — validates resource, updates sync state, creates audit event, broadcasts to local WebSocket channels\n- WebSocket connection management with exponential backoff reconnection\n- Wired into `server.ts` startup/shutdown lifecycle (guarded by `config.mapHub.enabled`)\n- Exported from `src/map/index.ts`","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-20T10:33:46.128Z","updated_at":"2026-02-20T10:33:46.128Z"}]}
3
- {"id":"i-54gb","uuid":"77f3f1ee-989f-4146-b400-de733a1ae8af","title":"OpenHive: Relay sync messages to subscribed swarms","content":"\nAfter OpenHive receives a `memory:sync` or `skill:sync` message from a swarm, it needs to relay the message to all swarms that are subscribed to that resource.\n\nFlow:\n1. Extract `resource_id` from the received message\n2. Look up `resource_subscriptions` for that resource\n3. Identify which swarms those subscribed agents belong to (agent → swarm mapping via `map_swarms.owner_agent_id` or `map_nodes`)\n4. Send the message to each relevant swarm's `map_endpoint` using the swarm's declared `map_transport`\n5. Skip sending back to the originating swarm\n\nDepends on [[i-7ahu]] (inbound subscription must work first).\nImplements [[s-78fe]].\n","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-20 08:38:32","updated_at":"2026-02-20 10:34:58","closed_at":"2026-02-20 10:34:58","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-54gb","from_type":"issue","to":"i-8qr1","to_type":"issue","type":"blocks"},{"from":"i-54gb","from_type":"issue","to":"s-78fe","to_type":"spec","type":"implements"}],"tags":["MAP","openhive","sync"],"feedback":[{"id":"94b2592c-541d-4e09-bc1a-69c48e9ce475","from_id":"i-54gb","to_id":"s-78fe","feedback_type":"comment","content":"Added relay logic to `src/map/sync-listener.ts`:\n- `relaySyncMessage()` — looks up resource subscribers, maps subscriber agents to their online swarms via `findSwarmsByOwnerAgentIds()`, sends the message to each swarm's open WebSocket connection (skipping the source swarm)\n- Added `findSwarmsByOwnerAgentIds()` to `src/db/dal/map.ts` — queries online swarms owned by a set of agent IDs\n- Relay is called from `handleSyncMessage()` after bookkeeping completes","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-20T10:34:58.068Z","updated_at":"2026-02-20T10:34:58.068Z"}]}
4
- {"id":"i-52t0","uuid":"9774bb8d-da29-48e2-91dd-007d8061af17","title":"Swarm: Emit memory:sync and skill:sync after tool operations","content":"\nThe swarm runtime should emit MAP sync messages on its own MAP endpoint after minimem or skill-tree push operations.\n\n```\nswarm.on('minimem:pushed', (result) => {\n swarm.map.broadcast({\n type: 'memory:sync',\n resource_id: result.resource_id,\n agent_id: swarm.agent_id,\n commit_hash: result.commit_hash,\n timestamp: new Date().toISOString()\n });\n});\n\nswarm.on('skilltree:pushed', (result) => {\n swarm.map.broadcast({\n type: 'skill:sync',\n resource_id: result.resource_id,\n agent_id: swarm.agent_id,\n commit_hash: result.commit_hash,\n timestamp: new Date().toISOString()\n });\n});\n```\n\nThe swarm needs to know the `resource_id` for each local memory directory / skill repo. This mapping is part of the swarm's configuration (which local dirs correspond to which OpenHive resources).\n\nAn agent/swarm can have multiple memory and skill repos — each maps to a different `resource_id`.\n\nDepends on [[i-5nl8]] for message type definitions.\nImplements [[s-78fe]].\n","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-20 08:38:38","updated_at":"2026-02-20 10:36:48","closed_at":"2026-02-20 10:36:48","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-52t0","from_type":"issue","to":"s-78fe","to_type":"spec","type":"implements"}],"tags":["MAP","swarm","sync"],"feedback":[{"id":"887847f3-c3ae-4dd4-8fcb-009f5187a9b5","from_id":"i-52t0","to_id":"s-78fe","feedback_type":"comment","content":"Created `src/map/sync-client.ts` — a client library for swarm runtimes to participate in MAP sync. Provides:\n- `emitMemorySync()` / `emitSkillSync()` — broadcast sync messages to connected clients (including OpenHive's sync listener)\n- `handleIncomingConnection()` — register WebSocket clients connecting to the swarm's MAP endpoint\n- Exported as `MapSyncClient` from `src/map/index.ts`\n\nSince the swarm runtime (OpenSwarm) is a separate project, this module lives in OpenHive as an importable SDK. Swarm runtimes wire it into their tool lifecycle:\n```typescript\nconst client = new MapSyncClient({ agent_id, hub_ws_url, owned_resources });\nclient.emitMemorySync({ resource_id: 'res_abc', commit_hash: 'abc123' });\n```","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-20T10:36:47.885Z","updated_at":"2026-02-20T10:36:47.885Z"}]}
5
- {"id":"i-8qr1","uuid":"6f6c65f0-a8a2-4a20-b835-e49f8f6583b5","title":"Swarm: Handle received sync messages and trigger tool pulls","content":"\nWhen a swarm receives a `memory:sync` or `skill:sync` message (relayed by OpenHive), it should trigger the appropriate tool operation:\n\n```\nswarm.map.on('memory:sync', (msg) => {\n if (msg.agent_id === swarm.agent_id) return; // ignore own messages\n const resource = swarm.getSubscribedResource(msg.resource_id);\n if (!resource) return;\n swarm.minimem.pull(resource.git_remote_url);\n swarm.minimem.reindex(resource.local_dir);\n});\n\nswarm.map.on('skill:sync', (msg) => {\n if (msg.agent_id === swarm.agent_id) return;\n const resource = swarm.getSubscribedResource(msg.resource_id);\n if (!resource) return;\n swarm.skillTree.refreshRemote(resource.remote_name);\n});\n```\n\nThe swarm maintains a mapping of subscribed `resource_id` → local directory / remote name so it knows where to pull content into.\n\nDepends on [[i-cvge]] (OpenHive relay must work to deliver messages).\nImplements [[s-78fe]].\n","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-20 08:38:44","updated_at":"2026-02-20 10:37:00","closed_at":"2026-02-20 10:37:00","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-8qr1","from_type":"issue","to":"s-78fe","to_type":"spec","type":"implements"}],"tags":["MAP","swarm","sync"],"feedback":[{"id":"5b654b46-b5ec-4d12-a120-d9e0d5f1b3df","from_id":"i-8qr1","to_id":"s-78fe","feedback_type":"comment","content":"Covered by `MapSyncClient` in `src/map/sync-client.ts`:\n- `onMemorySync(handler)` / `onSkillSync(handler)` — register callbacks for incoming sync messages\n- `handleIncomingSync()` — filters by agent_id (ignores own), matches `resource_id` to `subscribed_resources`, dispatches to registered handlers\n- `connectToHub()` — connects to OpenHive's WebSocket endpoint to receive relayed messages\n- Reconnection with exponential backoff\n\nUsage:\n```typescript\nconst client = new MapSyncClient({ agent_id, hub_ws_url, subscribed_resources: [...] });\nclient.onMemorySync((msg, resource) => {\n minimem.pull(resource.git_remote_url);\n minimem.reindex(resource.local_dir);\n});\nclient.onSkillSync((msg, resource) => {\n skillTree.refreshRemote(resource.local_dir);\n});\nclient.start();\n```","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-20T10:37:00.288Z","updated_at":"2026-02-20T10:37:00.288Z"}]}
6
- {"id":"i-arzo","uuid":"bf2364ba-bce9-450c-96af-a9ff91285061","title":"Swarm: Polling fallback for missed sync messages","content":"\nSince MAP messages are fire-and-forget with no delivery guarantees, swarms need a polling loop to catch up on missed messages (e.g., after being offline).\n\n```\nswarm.startPollingLoop({\n interval: 60_000, // configurable\n onUpdate: (resource, newCommit) => {\n // Same pull logic as receiving a MAP message\n }\n});\n```\n\nPolling options:\n- **Git remote ref check** — compare local HEAD vs remote HEAD for each subscribed resource\n- **OpenHive's existing `POST /resources/:id/check-updates`** — checks remote git ref and returns whether there are updates\n\nThe swarm owns its polling cadence. This is independent of MAP message delivery and works even if OpenHive is also offline.\n\nImplements [[s-78fe]].\n","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-20 08:38:50","updated_at":"2026-02-20 10:38:05","closed_at":"2026-02-20 10:38:05","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-arzo","from_type":"issue","to":"s-78fe","to_type":"spec","type":"implements"}],"tags":["MAP","polling","swarm","sync"],"feedback":[{"id":"215904be-2599-413b-9e18-de37219f0557","from_id":"i-arzo","to_id":"s-78fe","feedback_type":"comment","content":"Implemented polling fallback in `MapSyncClient`:\n- Added `PollChecker` callback type — consumer provides a function that checks resources for updates (git ls-remote, OpenHive API, etc.)\n- `runPollCycle()` calls the checker, synthesizes `MapSyncMessage` objects for each update, dispatches through the same `onMemorySync`/`onSkillSync` handlers as real-time messages\n- Initial poll runs on `start()` to catch up immediately after coming online\n- Guard against concurrent poll cycles via `this.polling` flag\n\nUsage:\n```typescript\nconst client = new MapSyncClient({\n agent_id: 'agent-a',\n subscribed_resources: [...],\n poll_interval_ms: 60_000,\n poll_checker: async (resources) => {\n // Check git remote refs, return those with new commits\n return [{ resource_id: 'res_abc', commit_hash: 'new123' }];\n },\n});\n```","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-20T10:38:05.486Z","updated_at":"2026-02-20T10:38:05.486Z"}]}
7
- {"id":"i-3dvd","uuid":"831a76dc-878a-482a-a0e5-416ab7ec49fd","title":"Add bridge database schema (bridge_configs, channel_mappings, proxy_agents, message_mappings)","content":"Add the four new tables to the database schema as a new migration:\n\n**Tables:**\n\n1. `bridge_configs` — bridge instance configuration (name, platform, transport_mode, credentials_encrypted, status, error_message, owner_agent_id)\n2. `bridge_channel_mappings` — platform channel → hive mapping (bridge_id, platform_channel_id, platform_channel_name, hive_name, direction, thread_mode)\n3. `bridge_proxy_agents` — external user → OpenHive agent mapping (bridge_id, platform_user_id, agent_id, platform_display_name, platform_avatar_url)\n4. `bridge_message_mappings` — platform message → post/comment mapping for thread tracking (bridge_id, platform_message_id, platform_channel_id, post_id, comment_id)\n\nSee spec [[s-9mbr]] for full DDL. Follow existing schema migration pattern in `src/db/schema.ts`. Add appropriate indexes on foreign keys and unique constraints.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:11","updated_at":"2026-02-21 05:10:07","closed_at":"2026-02-21 05:10:07","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-3dvd","from_type":"issue","to":"i-6wrk","to_type":"issue","type":"blocks"},{"from":"i-3dvd","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","database","schema"],"feedback":[{"id":"430e64a4-8e46-4026-9c7d-c3fbb0a95c31","from_id":"i-3dvd","to_id":"s-9mbr","feedback_type":"comment","content":"Created `src/bridge/schema.ts` with 4 tables: `bridge_configs`, `bridge_channel_mappings`, `bridge_proxy_agents`, `bridge_message_mappings`. Registered as schema migration v17 in `src/db/index.ts`. All existing DB tests pass.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:10:10.900Z","updated_at":"2026-02-21T05:10:10.900Z"}]}
8
- {"id":"i-1jbt","uuid":"881cb320-b8c8-466a-916b-02126a39bcf4","title":"Define bridge adapter interface and shared types","content":"Create `src/bridge/types.ts` with the TypeScript interfaces and types for the bridge system:\n\n- `BridgeAdapter` interface — `connect()`, `messages()`, `send()`, `disconnect()`\n- `AdapterConfig` — mode, credentials, channelMappings, webhookBaseUrl\n- `InboundMessage` — normalized inbound message with platformMessageId, author, content, thread, mentions, platformMeta\n- `OutboundMessage` — text, attachments, replyTo\n- `PlatformDestination` — platformChannelId, threadId\n- `Attachment` — type, url, name, mimeType\n- `ChannelMapping` — matches the DB table shape\n- `BridgeConfig` — matches the DB table shape\n- `BridgeStatus` — connecting, connected, error, disconnected\n- `RunningBridge` — runtime state for an active bridge\n\nExport from `src/bridge/index.ts`. These types are consumed by the bridge manager, adapters, and API routes.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:17","updated_at":"2026-02-21 05:10:08","closed_at":"2026-02-21 05:10:08","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-1jbt","from_type":"issue","to":"i-6dtg","to_type":"issue","type":"blocks"},{"from":"i-1jbt","from_type":"issue","to":"i-6wrk","to_type":"issue","type":"blocks"},{"from":"i-1jbt","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","types"],"feedback":[{"id":"9c91505c-5b90-410c-8324-4d534d2edadd","from_id":"i-1jbt","to_id":"s-9mbr","feedback_type":"comment","content":"Created `src/bridge/types.ts` with all interfaces: `BridgeAdapter`, `InboundMessage`, `OutboundMessage`, `PlatformDestination`, `BridgeConfig`, `ChannelMapping`, `ProxyAgent`, `MessageMapping`, `BridgePostMetadata`, and API input types. Exported via `src/bridge/index.ts`.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:10:13.063Z","updated_at":"2026-02-21T05:10:13.063Z"}]}
9
- {"id":"i-8lix","uuid":"489e0119-fd79-4dad-87f9-772037bef329","title":"Add bridge instance configuration to OpenHive config","content":"Add bridge configuration to the OpenHive instance config schema:\n\n```typescript\nbridge: {\n enabled: boolean; // master toggle, default false\n maxBridges: number; // limit on concurrent bridges, default 10\n credentialEncryptionKey?: string; // override; defaults to derived from instance secret\n webhookBaseUrl?: string; // public URL for webhook mode\n}\n```\n\nUpdate the config type definitions, defaults, and validation. The bridge feature should be disabled by default.","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:20","updated_at":"2026-02-21 05:11:16","closed_at":"2026-02-21 05:11:16","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-8lix","from_type":"issue","to":"i-3w9k","to_type":"issue","type":"blocks"},{"from":"i-8lix","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","config"]}
10
- {"id":"i-6wrk","uuid":"580f38eb-38ce-4876-bbbd-60294447e083","title":"Implement bridge DAL (data access layer) for bridge tables","content":"Create `src/db/dal/bridge.ts` with data access functions for the bridge tables. Follow the existing DAL pattern used by other modules (e.g., `src/db/dal/map.ts`).\n\n**Functions needed:**\n\nBridge configs:\n- `createBridge(config)` — insert new bridge config\n- `getBridge(id)` — get bridge by ID\n- `listBridges(ownerId?)` — list bridges, optionally filtered by owner\n- `updateBridge(id, updates)` — update bridge config (status, credentials, etc.)\n- `deleteBridge(id)` — delete bridge and cascade to mappings/proxy agents\n\nChannel mappings:\n- `addChannelMapping(bridgeId, mapping)` — add a channel mapping\n- `getChannelMappings(bridgeId)` — list mappings for a bridge\n- `getChannelMappingByPlatformChannel(bridgeId, platformChannelId)` — lookup for inbound routing\n- `getChannelMappingsByHive(bridgeId, hiveName)` — lookup for outbound routing\n- `deleteChannelMapping(id)` — remove a mapping\n\nProxy agents:\n- `getOrCreateProxyAgent(bridgeId, platformUser)` — find existing or create new proxy agent\n- `getProxyAgentByPlatformUser(bridgeId, platformUserId)` — lookup\n- `listProxyAgents(bridgeId)` — list all proxy agents for a bridge\n\nMessage mappings:\n- `recordMessageMapping(mapping)` — insert message mapping\n- `getMessageMapping(bridgeId, platformMessageId)` — lookup for thread resolution\n- `getMessageMappingByPost(bridgeId, postId)` — reverse lookup for outbound thread tracking\n\nDepends on: bridge schema issue, bridge types issue.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:28","updated_at":"2026-02-21 05:14:20","closed_at":"2026-02-21 05:14:20","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-6wrk","from_type":"issue","to":"i-2zrs","to_type":"issue","type":"blocks"},{"from":"i-6wrk","from_type":"issue","to":"i-9w7a","to_type":"issue","type":"blocks"},{"from":"i-6wrk","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","dal","database"]}
11
- {"id":"i-11ra","uuid":"6623868d-9946-4342-9f09-abe846d5895c","title":"Implement credential encryption for bridge configs","content":"Implement encryption/decryption for bridge platform credentials stored in `bridge_configs.credentials_encrypted`.\n\n- Use AES-256-GCM for symmetric encryption\n- Key derived from `config.bridge.credentialEncryptionKey` or fallback to instance secret\n- `encryptCredentials(credentials: Record<string, string>, key: string): string` — returns base64-encoded ciphertext with IV and auth tag\n- `decryptCredentials(encrypted: string, key: string): Record<string, string>` — returns plaintext credentials\n- Credentials should never appear in logs or API responses (redact in bridge GET endpoints)\n\nCreate as `src/bridge/credentials.ts`.","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:33","updated_at":"2026-02-21 05:11:17","closed_at":"2026-02-21 05:11:17","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-11ra","from_type":"issue","to":"i-3w9k","to_type":"issue","type":"blocks"},{"from":"i-11ra","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","security"]}
12
- {"id":"i-11xs","uuid":"e79d26cf-92ac-4d34-9db2-6de760f368fc","title":"Implement mention extraction for bridge inbound messages","content":"Implement the mention extraction logic that scans inbound message text for `@name` patterns and populates the `mentions` array on `InboundMessage`.\n\n**Behavior:**\n- Scan message text for `@name` patterns (word boundary delimited)\n- Each adapter may also provide platform-native mentions (e.g., Slack `<@U0XYZ789>`) which the adapter resolves to display names before passing to the bridge core\n- The bridge core extracts `@name` mentions from the text and deduplicates with any adapter-provided mentions\n- Mentions are stored as-is (no validation against known agent/swarm names)\n- Mentions are included in post metadata: `{ mentions: [\"infra-swarm\", \"agent-claude\"] }`\n\nCreate as a utility function in `src/bridge/mentions.ts`:\n- `extractMentions(text: string, adapterMentions?: string[]): string[]`\n\nPer spec [[s-9mbr]] Message Routing section — the bridge annotates but does not route. No swarm registry lookup.","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:39","updated_at":"2026-02-21 05:11:18","closed_at":"2026-02-21 05:11:18","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-11xs","from_type":"issue","to":"i-9w7a","to_type":"issue","type":"blocks"},{"from":"i-11xs","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","routing"]}
13
- {"id":"i-9w7a","uuid":"176cb54a-85ff-4fad-8381-7c462f13e1ef","title":"Implement inbound message pipeline (platform → OpenHive)","content":"Implement the core inbound pipeline that processes normalized `InboundMessage` objects from adapters and creates posts/comments in OpenHive.\n\n**Pipeline steps** (per spec [[s-9mbr]] Inbound Flow):\n\n1. Resolve channel mapping — lookup `(bridge_id, platformChannelId)` in `bridge_channel_mappings`, skip if no mapping or direction is `outbound`\n2. Resolve or create proxy agent — lookup/create via bridge DAL `getOrCreateProxyAgent()`\n3. Extract mentions — call `extractMentions()` on message text\n4. Determine post vs. comment based on `thread_mode`:\n - `post_per_message`: top-level = post, thread reply = comment (lookup parent via `bridge_message_mappings`)\n - `single_thread`: always comment on pinned post\n - `explicit_only`: check trigger pattern, skip non-matching\n5. Create post or comment via OpenHive API/DAL (using proxy agent as author)\n6. Set bridge metadata on post: `{ bridge, platform_message_id, platform_channel_id, mentions }`\n7. Record message mapping in `bridge_message_mappings`\n8. OpenHive's existing broadcast handles the WebSocket notification\n\nCreate as `src/bridge/inbound.ts` with a `processInboundMessage(bridgeId, message)` function.\n\nDepends on: bridge DAL, mention extraction, bridge types.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:48","updated_at":"2026-02-21 05:21:36","closed_at":"2026-02-21 05:21:36","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-9w7a","from_type":"issue","to":"i-3w9k","to_type":"issue","type":"blocks"},{"from":"i-9w7a","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","pipeline"],"feedback":[{"id":"2115c11d-06f9-40e2-8a8d-c24c72cb5985","from_id":"i-9w7a","to_id":"s-9mbr","feedback_type":"comment","content":"Implemented inbound pipeline in `src/bridge/inbound.ts` with `processInboundMessage(bridgeId, message)`. Handles all three thread modes (post_per_message, single_thread, explicit_only). Creates proxy agents automatically on first message from a platform user. Extracts mentions and broadcasts to WebSocket. 16 tests covering skip conditions, post/comment creation, proxy agent reuse, thread replies, mention extraction, message mapping, and title truncation.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:21:30.899Z","updated_at":"2026-02-21T05:21:30.899Z"}]}
14
- {"id":"i-2zrs","uuid":"3d21241c-1ed1-4408-900d-24a3431c020a","title":"Implement outbound message pipeline (OpenHive → platform)","content":"Implement the outbound pipeline that subscribes to OpenHive WebSocket channels for mapped hives and relays new posts/comments back to the external platform.\n\n**Pipeline steps** (per spec [[s-9mbr]] Outbound Flow):\n\n1. Subscribe to WebSocket channels for all mapped hives (`hive:{name}`)\n2. On `new_post` or `new_comment` event, check:\n a. Is the author a proxy agent owned by this bridge? Skip (avoid echo)\n b. Is the channel mapping direction `inbound`? Skip (read-only)\n c. Does the post/comment have bridge metadata from this bridge? Skip (avoid echo)\n3. Resolve platform destination — hive → platform channel from mappings\n4. For comments, look up parent post in `bridge_message_mappings` for thread ID\n5. Format outbound message — author name, markdown-to-platform conversion, thread context\n6. Call `adapter.send(destination, message)`\n7. Record outbound message in `bridge_message_mappings` for future thread tracking\n\nCreate as `src/bridge/outbound.ts` with an `OutboundRelay` class that manages the WebSocket subscription and relays events.\n\nDepends on: bridge DAL, bridge types.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:52:54","updated_at":"2026-02-21 05:21:37","closed_at":"2026-02-21 05:21:37","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-2zrs","from_type":"issue","to":"i-3w9k","to_type":"issue","type":"blocks"},{"from":"i-2zrs","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","pipeline"],"feedback":[{"id":"3255bb77-1dfc-4f1e-90cb-3ae6bba0591d","from_id":"i-2zrs","to_id":"s-9mbr","feedback_type":"comment","content":"Implemented outbound pipeline in `src/bridge/outbound.ts` with `processOutboundEvent(bridgeConfig, mappings, event)`. Filters proxy agent events (echo prevention), respects channel direction, resolves thread context from message mappings, and formats outbound messages with author attribution. Returns array of OutboundActions for the BridgeManager to dispatch via adapters. 10 tests covering echo prevention, direction filtering, formatting, thread context, and unmapped hives.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:21:34.282Z","updated_at":"2026-02-21T05:21:34.282Z"}]}
15
- {"id":"i-3w9k","uuid":"aaab5c3a-cbaa-48e3-9858-4a8c51127f23","title":"Implement BridgeManager service","content":"Implement the `BridgeManager` class as a server-level service that manages bridge adapter lifecycles.\n\n**Responsibilities:**\n- Load active bridge configs from DB on startup\n- Instantiate correct adapter for each platform\n- Wire adapter message stream to inbound pipeline\n- Create outbound relay (WebSocket subscription) for each bridge\n- Handle adapter reconnection with exponential backoff on error\n- Update bridge status in DB (`active`, `inactive`, `error` + error_message)\n- Expose `startBridge(id)`, `stopBridge(id)`, `stopAll()`, `getBridgeStatus(id)`\n- Respect `config.bridge.maxBridges` limit\n- Graceful shutdown — disconnect all bridges on server stop\n\nCreate as `src/bridge/manager.ts`. This is the main entry point that the server wires into its lifecycle.\n\nDepends on: bridge DAL, inbound pipeline, outbound pipeline, bridge types, credential encryption, bridge config.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:53:00","updated_at":"2026-02-21 05:24:09","closed_at":"2026-02-21 05:24:09","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-3w9k","from_type":"issue","to":"i-3z4a","to_type":"issue","type":"blocks"},{"from":"i-3w9k","from_type":"issue","to":"i-7fqi","to_type":"issue","type":"blocks"},{"from":"i-3w9k","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","manager"],"feedback":[{"id":"ea3a8288-6036-49f4-94ee-64c948cd29ed","from_id":"i-3w9k","to_id":"s-9mbr","feedback_type":"comment","content":"Implemented BridgeManager in `src/bridge/manager.ts`. Features: adapter registry pattern, startBridge/stopBridge/stopAll lifecycle, credential decryption, message loop with AbortController, exponential backoff reconnection, outbound event relay via `notifyHiveEvent()`, mapping hot-reload, startAll for server startup, max bridges limit enforcement. 18 tests covering start/stop lifecycle, credential handling, error cases, limit enforcement, outbound relay, mapping reload, and startAll.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:24:09.505Z","updated_at":"2026-02-21T05:24:09.505Z"}]}
16
- {"id":"i-3z4a","uuid":"c751164a-6312-4a9a-b72b-c8fbe139a835","title":"Implement bridge API routes","content":"Add API routes for bridge management at `/api/v1/bridges`.\n\n**Endpoints:**\n- `POST /api/v1/bridges` — create bridge config (validate platform, transport_mode, credentials)\n- `GET /api/v1/bridges` — list bridge configs (redact credentials)\n- `GET /api/v1/bridges/:id` — get bridge details (redact credentials)\n- `PUT /api/v1/bridges/:id` — update bridge config\n- `DELETE /api/v1/bridges/:id` — delete bridge (must be stopped first)\n- `POST /api/v1/bridges/:id/start` — start bridge (calls BridgeManager.startBridge)\n- `POST /api/v1/bridges/:id/stop` — stop bridge (calls BridgeManager.stopBridge)\n- `POST /api/v1/bridges/:id/mappings` — add channel mapping\n- `GET /api/v1/bridges/:id/mappings` — list channel mappings\n- `DELETE /api/v1/bridges/:id/mappings/:mid` — remove channel mapping\n- `GET /api/v1/bridges/:id/agents` — list proxy agents for this bridge\n\n**Webhook receiver:**\n- `POST /api/v1/hooks/:platform/:bridge_id` — inbound webhook endpoint for webhook-mode adapters\n\nAuthentication: require authenticated agent, bridge owner or admin only.\n\nCreate as `src/api/routes/bridges.ts`, register in the main route setup.\n\nDepends on: bridge DAL, BridgeManager, credential encryption.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:53:06","updated_at":"2026-02-21 05:26:50","closed_at":"2026-02-21 05:26:50","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-3z4a","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["api","bridge"],"feedback":[{"id":"87ca93f5-160c-436b-a879-4732b332de60","from_id":"i-3z4a","to_id":"s-9mbr","feedback_type":"comment","content":"Implemented bridge API routes in `src/api/routes/bridges.ts`. Endpoints: CRUD for bridges (with credential redaction), start/stop lifecycle, channel mapping management, proxy agent listing. Auth required for all endpoints, owner/admin check for mutations. Registered in `src/api/index.ts` with optional BridgeManager dependency.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:26:47.025Z","updated_at":"2026-02-21T05:26:47.025Z"}]}
17
- {"id":"i-6dtg","uuid":"ddc3746a-a3c8-4ae7-9c3e-9343e1b04637","title":"Implement Slack bridge adapter (Socket Mode + Events API)","content":"Implement the Slack adapter as the first concrete `BridgeAdapter` implementation.\n\n**Outbound mode (Socket Mode):**\n- Use `@slack/socket-mode` package to connect via outbound WebSocket\n- Authenticate with `app_token` (xapp-...) for Socket Mode connection\n- Use `bot_token` (xoxb-...) for Web API calls (sending messages, user info)\n- Receive message events, normalize to `InboundMessage` format\n- Resolve Slack user mentions (`<@U0XYZ789>`) to display names via `users.info` API\n- Extract thread_ts for threading support\n\n**Webhook mode (Events API):**\n- Receive HTTP POST events at `/api/v1/hooks/slack/:bridge_id`\n- Verify Slack signing secret (HMAC-SHA256 with `X-Slack-Signature` header)\n- Handle URL verification challenge\n- Process `message` events, normalize to `InboundMessage`\n\n**Outbound (send):**\n- Use `@slack/web-api` to post messages via `chat.postMessage`\n- Convert markdown to Slack mrkdwn format\n- Support threading via `thread_ts` parameter\n- Include author attribution in message\n\nCreate as `src/bridge/adapters/slack.ts`.\n\nDepends on: bridge adapter interface/types.","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:53:14","updated_at":"2026-02-21 05:29:07","closed_at":"2026-02-21 05:29:07","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-6dtg","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["adapter","bridge","slack"],"feedback":[{"id":"592d87d9-d31d-4948-8346-42fa9f5a7526","from_id":"i-6dtg","to_id":"s-9mbr","feedback_type":"comment","content":"Implemented Slack adapter in `src/bridge/adapters/slack.ts`. Features: Socket Mode (outbound transport) via @slack/socket-mode, Web API message sending via @slack/web-api, Slack mention resolution (`<@U...>` → display names), thread_ts threading support, markdown→mrkdwn conversion, user info caching, pushInboundMessage for webhook mode, file attachment normalization. Installed @slack/socket-mode and @slack/web-api packages. 13 tests covering connection modes, message push/consume, sending, threading, markdown conversion, and disconnect behavior.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:29:07.158Z","updated_at":"2026-02-21T05:29:07.158Z"}]}
18
- {"id":"i-7fqi","uuid":"d4bc52ee-406d-4822-b513-9d95b976b936","title":"Wire BridgeManager into server startup/shutdown lifecycle","content":"Integrate the BridgeManager into the OpenHive server lifecycle in `src/server.ts`.\n\n- Instantiate BridgeManager if `config.bridge.enabled` is true\n- On server start: call `bridgeManager.loadAndStartActiveBridges()` to resume active bridges\n- On server shutdown: call `bridgeManager.stopAll()` for graceful disconnect\n- Follow the same pattern as the MAP sync listener and SwarmCraft plugin integration\n\nDepends on: BridgeManager, bridge config.","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-21 04:53:18","updated_at":"2026-02-21 05:26:50","closed_at":"2026-02-21 05:26:50","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-7fqi","from_type":"issue","to":"s-9mbr","to_type":"spec","type":"implements"}],"tags":["bridge","server"],"feedback":[{"id":"9eac4f64-ddbc-43c5-ac60-7e99d7105566","from_id":"i-7fqi","to_id":"s-9mbr","feedback_type":"comment","content":"Wired BridgeManager into server lifecycle in `src/server.ts`. Creates BridgeManager when `config.bridge.enabled`, passes to registerRoutes, calls `startAll()` during server start, and `stopAll()` during shutdown. Follows existing SwarmManager/SyncService patterns.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-21T05:26:49.566Z","updated_at":"2026-02-21T05:26:49.566Z"}]}
19
- {"id":"i-1lof","uuid":"07e6854a-90fe-4720-835e-eaa2671e5ba5","title":"Define session sync wire format types in openhive-types","content":"Phase 1: Create `packages/openhive-types/src/map-session-sync.ts` with all session sync types (SessionSyncParams, SessionCheckpointSummary, MapSessionSyncMessage, MapSessionContentRequest, MapSessionContentResponse, MapSessionContentChunkMessage) and validation constants. Update `packages/openhive-types/src/index.ts` and `src/map/types.ts` with re-exports. Follow existing patterns from `map-sync.ts` and `map-coordination.ts`.","status":"open","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-03-01 20:45:05","updated_at":"2026-03-01 20:45:05","closed_at":null,"parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-1lof","from_type":"issue","to":"i-15eu","to_type":"issue","type":"blocks"},{"from":"i-1lof","from_type":"issue","to":"i-1yvn","to_type":"issue","type":"blocks"},{"from":"i-1lof","from_type":"issue","to":"s-3me1","to_type":"spec","type":"implements"}],"tags":["map","phase-1","types"]}
20
- {"id":"i-3qeo","uuid":"af59496c-b573-48f5-9fa8-c8886e514e36","title":"Add onCheckpointCommitted callback to sessionlog strategy","content":"Phase 2: Add `onCheckpointCommitted` callback to `ManualCommitStrategyConfig` in `references/sessionlog/src/strategy/manual-commit.ts`. Define `CheckpointCommittedEvent` type. Invoke the callback after `checkpointStore.writeCommitted()` succeeds in `condenseSession()` (~line 675). Export the new type from `references/sessionlog/src/index.ts`. Fire-and-forget with try/catch.","status":"open","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-03-01 20:45:09","updated_at":"2026-03-01 20:45:09","closed_at":null,"parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-3qeo","from_type":"issue","to":"i-9x94","to_type":"issue","type":"blocks"},{"from":"i-3qeo","from_type":"issue","to":"s-3me1","to_type":"spec","type":"implements"}],"tags":["callback","phase-2","sessionlog"]}
21
- {"id":"i-1yvn","uuid":"52d50929-c180-46a3-b2c0-a26fcf830c6a","title":"Add session sync emission and content request handling to MapSyncClient","content":"Phase 3: Extend `MapSyncClient` in `src/map/sync-client.ts` with: (a) `emitSessionSync()` method, (b) `onContentRequest()` handler registration, (c) `sendContentResponse()` and `sendContentChunk()` helpers, (d) update message handler to recognize `x-openhive/session.content` requests (JSON-RPC with `id` field -- new pattern), (e) widen `broadcast()` to accept session sync messages. Content request handler should read from checkpoint store, check size against 512KB threshold, and either respond inline or stream via chunked base64 JSONL.","status":"blocked","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-03-01 20:45:14","updated_at":"2026-03-01 20:45:40","closed_at":null,"parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-1yvn","from_type":"issue","to":"i-9x94","to_type":"issue","type":"blocks"},{"from":"i-1yvn","from_type":"issue","to":"s-3me1","to_type":"spec","type":"implements"}],"tags":["map","phase-3","sync-client"]}
22
- {"id":"i-15eu","uuid":"5e8188b3-5019-4228-9150-aa727923afed","title":"Add session sync handling to hub sync listener","content":"Phase 4: Extend `src/map/sync-listener.ts` with: (a) `isSessionSyncMessage()` type guard, (b) `handleSessionSyncMessage()` that stores metadata in syncable_resources, creates audit events, broadcasts to WS channels, (c) update `connectToSwarm()` message handler to dispatch session sync messages, (d) `requestSessionContent()` to send JSON-RPC requests to swarms, (e) pending request tracking with timeout for content responses and chunk reassembly.","status":"blocked","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-03-01 20:45:17","updated_at":"2026-03-01 20:45:41","closed_at":null,"parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-15eu","from_type":"issue","to":"i-7w50","to_type":"issue","type":"blocks"},{"from":"i-15eu","from_type":"issue","to":"i-9x94","to_type":"issue","type":"blocks"},{"from":"i-15eu","from_type":"issue","to":"s-3me1","to_type":"spec","type":"implements"}],"tags":["hub","map","phase-4","sync-listener"]}
23
- {"id":"i-7w50","uuid":"aa4c4b4e-437b-4a75-b4c8-394e9cdafe03","title":"Add hub-side content caching via SessionStorageAdapter","content":"Phase 5: Create `src/map/session-content-cache.ts` with `cacheSessionContent()` and `getCachedContent()` functions that use `getSessionStorage()` to persist fetched checkpoint content locally. Integrate with the pending request handler from Phase 4 so content is cached when received. Check `isSessionStorageInitialized()` before attempting cache operations.","status":"blocked","priority":3,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-03-01 20:45:21","updated_at":"2026-03-01 20:45:43","closed_at":null,"parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-7w50","from_type":"issue","to":"s-3me1","to_type":"spec","type":"implements"}],"tags":["cache","map","phase-5","storage"]}
24
- {"id":"i-9x94","uuid":"413533ca-fac8-4521-8243-26d1dadb803a","title":"Wire sessionlog checkpoint callback to MAP sync emission","content":"Phase 6: In the swarm hosting bridge (where `createManualCommitStrategy` is called), pass `onCheckpointCommitted` that calls `syncClient.emitSessionSync()`. Also wire `syncClient.onContentRequest()` to read from `checkpointStore.readSessionContent()` and respond inline or with chunked streaming based on size threshold. Map sessionlog types (TokenUsage, Summary) to wire format types (snake_case).","status":"blocked","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-03-01 20:45:25","updated_at":"2026-03-01 20:45:41","closed_at":null,"parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-9x94","from_type":"issue","to":"s-3me1","to_type":"spec","type":"implements"}],"tags":["bridge","phase-6","wiring"]}
@@ -1,4 +0,0 @@
1
- {"id":"s-78fe","uuid":"38fbad4c-3cea-44ed-bec0-8756a60ccfa8","title":"MAP-Mediated Memory & Skill Sync","file_path":"specs/s-78fe_map_mediated_memory_skill_sync.md","content":"\n# MAP-Mediated Memory & Skill Sync\n\n## Overview\n\nOpenHive serves as a sync center for agent memory (minimem) and skills (skill-tree) using MAP broadcast messages. Rather than requiring specialized sync endpoints or direct tool-level integration, the sync flow is mediated through MAP messages emitted and consumed by swarms. OpenHive participates as a MAP peer — listening to registered swarms and relaying messages to subscribers.\n\n## Design Principles\n\n1. **Swarm emits, tools don't** — minimem and skill-tree are tools with no MAP awareness. The swarm runtime is responsible for emitting sync messages after tool operations and triggering tool operations when sync messages arrive.\n2. **Git is the content store** — MAP messages carry metadata (resource ID, commit hash), not content. Agents pull content from git.\n3. **Fire-and-forget broadcast** — Messages are ephemeral broadcasts with no delivery guarantees, acknowledgment, or ordering. Missed messages are recovered via polling.\n4. **OpenHive is a MAP participant, not a special hub** — It listens to swarm MAP endpoints and relays to subscribers using the same MAP transport. No special publish endpoint.\n5. **Polling as fallback** — Swarms that miss messages poll their subscribed resources (git ref check or OpenHive's existing `check-updates` endpoints) to catch up.\n\n## Component Roles\n\n| Component | Role |\n|---|---|\n| **Swarm** | MAP-aware agent runtime. Emits `memory:sync` / `skill:sync` messages on its MAP endpoint. Subscribes to messages from OpenHive. Triggers tool operations (minimem pull, skill-tree pull) on received messages. Handles its own polling cadence for missed messages. |\n| **minimem** | Tool. Reads/writes/indexes memory files. Pushes to git. No MAP awareness, no sync responsibility. |\n| **skill-tree** | Tool. Manages skills (CRUD, versioning, extraction). Pushes to git. No MAP awareness, no sync responsibility. |\n| **OpenHive** | MAP participant. Subscribes to all registered swarms' MAP endpoints. On receiving `memory:sync` or `skill:sync`, updates its own resource tracking state (bookkeeping) and relays the message to all swarms subscribed to that resource. |\n\n## Message Types\n\nTwo message types for now:\n\n### `memory:sync`\n\nEmitted by a swarm after its minimem instance pushes memory changes to git.\n\n```typescript\n{\n type: \"memory:sync\",\n resource_id: string, // which memory bank (from syncable_resources)\n agent_id: string, // who pushed\n commit_hash: string, // the commit that was pushed\n timestamp: string // ISO 8601\n}\n```\n\n### `skill:sync`\n\nEmitted by a swarm after its skill-tree instance pushes skill changes to git.\n\n```typescript\n{\n type: \"skill:sync\",\n resource_id: string, // which skill repo (from syncable_resources)\n agent_id: string, // who pushed\n commit_hash: string, // the commit that was pushed\n timestamp: string // ISO 8601\n}\n```\n\n## Multiple Repos\n\nAn agent/swarm can have multiple memory and skill repos. Each is a separate `syncable_resource` with its own `resource_id`. The `resource_id` in the message identifies which repo changed. Example:\n\n```\nSwarm A's registered resources:\n res_abc → memory_bank \"project-alpha-memory\" (git: github.com/a/alpha-mem)\n res_def → memory_bank \"personal-memory\" (git: github.com/a/personal)\n res_ghi → skill \"team-skills\" (git: github.com/team/skills)\n res_jkl → skill \"personal-skills\" (git: github.com/a/my-skills)\n```\n\nEach sync message targets a specific `resource_id`. Subscribers only receive notifications for resources they're subscribed to.\n\n## Sync Flow\n\n### Push Flow (Swarm A pushes changes)\n\n```\n1. Swarm A's minimem writes memory files and pushes to git\n2. Swarm A emits on its MAP endpoint:\n { type: \"memory:sync\", resource_id: \"res_abc\", agent_id: \"agent-a\", commit_hash: \"def456\", timestamp: \"...\" }\n3. OpenHive is subscribed to Swarm A's MAP endpoint (because Swarm A is a registered swarm)\n4. OpenHive receives the message:\n a. Updates syncable_resources: last_commit_hash, last_push_by, last_push_at\n b. Creates resource_sync_events entry (audit trail)\n c. Looks up resource_subscriptions for res_abc\n d. Forwards the message to each subscribed swarm's MAP endpoint\n5. Swarm B receives the forwarded message via its MAP endpoint\n6. Swarm B triggers minimem pull for res_abc's git remote URL\n7. Swarm B's minimem re-indexes the updated files\n```\n\n### Missed Message Recovery (Polling)\n\n```\n1. Swarm B comes online after being offline\n2. Swarm B polls its subscribed resources:\n - Option A: Git remote ref check (compare local HEAD vs remote HEAD)\n - Option B: OpenHive's existing POST /resources/:id/check-updates endpoint\n3. Detects commit_hash mismatch for res_abc\n4. Pulls from git, re-indexes\n5. Caught up — no event log needed\n```\n\n## OpenHive Behavior\n\n### Inbound (listening to swarms)\n\n- On swarm registration (`POST /map/swarms`), OpenHive subscribes to the swarm's `map_endpoint` using the declared `map_transport` (websocket / http-sse / ndjson)\n- Filters for `memory:sync` and `skill:sync` message types\n- On receiving either:\n - Updates `syncable_resources` sync state (same as current webhook behavior)\n - Creates `resource_sync_events` entry\n - Relays to subscribed swarms (see outbound)\n\n### Outbound (relaying to subscribers)\n\n- Looks up `resource_subscriptions` for the `resource_id` in the received message\n- Identifies which swarms those subscribed agents belong to\n- Sends the message to each relevant swarm's `map_endpoint`\n- Uses the swarm's declared `map_transport` for delivery\n\n### Bookkeeping side effects\n\nWhen OpenHive processes a `memory:sync` or `skill:sync` message, it performs the same state updates that webhooks currently trigger:\n- `updateResourceSyncState(resource_id, commit_hash, agent_id)`\n- `createSyncEvent({ resource_id, commit_hash, pusher: agent_id, ... })`\n- Existing WebSocket broadcast on `resource:{type}:{id}` channels (for web UI / non-MAP clients)\n\nThis means **webhooks become a parallel path, not the primary one**. Swarms that emit MAP messages don't need webhooks. Webhooks remain as a fallback for non-MAP git pushes.\n\n## Swarm Behavior\n\n### On local tool operations\n\nAfter minimem push:\n```\nswarm.on('minimem:pushed', (result) => {\n swarm.map.broadcast({\n type: 'memory:sync',\n resource_id: result.resource_id,\n agent_id: swarm.agent_id,\n commit_hash: result.commit_hash,\n timestamp: new Date().toISOString()\n });\n});\n```\n\nAfter skill-tree push:\n```\nswarm.on('skilltree:pushed', (result) => {\n swarm.map.broadcast({\n type: 'skill:sync',\n resource_id: result.resource_id,\n agent_id: swarm.agent_id,\n commit_hash: result.commit_hash,\n timestamp: new Date().toISOString()\n });\n});\n```\n\n### On received MAP messages\n\n```\nswarm.map.on('memory:sync', (msg) => {\n if (msg.agent_id === swarm.agent_id) return; // ignore own messages\n const resource = swarm.getSubscribedResource(msg.resource_id);\n if (!resource) return;\n swarm.minimem.pull(resource.git_remote_url);\n swarm.minimem.reindex(resource.local_dir);\n});\n\nswarm.map.on('skill:sync', (msg) => {\n if (msg.agent_id === swarm.agent_id) return;\n const resource = swarm.getSubscribedResource(msg.resource_id);\n if (!resource) return;\n swarm.skillTree.refreshRemote(resource.remote_name);\n});\n```\n\n### Polling loop\n\n```\nswarm.startPollingLoop({\n interval: 60_000, // every 60s\n onUpdate: (resource, newCommit) => {\n // Same pull logic as receiving a MAP message\n }\n});\n```\n\n## Relationship to Existing Infrastructure\n\n| Existing | Relationship |\n|---|---|\n| `syncable_resources` table | Unchanged. Resources are registered here. MAP messages reference `resource_id` from this table. |\n| `resource_subscriptions` table | Unchanged. OpenHive uses this to determine which swarms to relay messages to. |\n| `resource_sync_events` table | Unchanged. OpenHive creates entries here as a side effect of processing MAP messages. |\n| Webhook endpoints (`/webhooks/*`) | Remain as parallel path. Webhooks and MAP messages both update sync state. Webhooks serve non-MAP git pushes. |\n| Polling endpoints (`/resources/check-updates`) | Remain as fallback. Swarms use these when they've been offline and need to catch up. |\n| WebSocket broadcast (`resource:{type}:{id}`) | Remains for web UI and non-MAP clients. OpenHive can still broadcast here as a side effect of processing MAP messages. |\n| `map_swarms` table | Used to look up swarm MAP endpoints for subscribing and relaying. |\n\n## Non-Goals (for now)\n\n- **No content in messages** — messages carry metadata only. Content lives in git.\n- **No request/response** — no \"search across agents' memories\" via MAP.\n- **No event log / persistence** — messages are ephemeral. Polling handles catch-up.\n- **No message ordering** — fire-and-forget. Agents handle eventual consistency via git state.\n- **No granular message types** — just `memory:sync` and `skill:sync`. More specific types (appended, pruned, deprecated, forked) can be added later.\n- **No minimem or skill-tree changes** — these tools stay MAP-unaware. All MAP behavior lives in the swarm runtime.\n","priority":1,"archived":0,"archived_at":null,"created_at":"2026-02-20 08:11:41","updated_at":"2026-02-20 08:11:41","parent_id":null,"parent_uuid":null,"relationships":[],"tags":["architecture","MAP","memory","skills","sync"]}
2
- {"id":"s-9mbr","uuid":"51735f97-1123-4258-b300-973fd2493950","title":"Channel Bridge: External Platform Integration","file_path":"specs/s-9mbr_channel_bridge_external_platform_integration.md","content":"\n# Channel Bridge: External Platform Integration\n\n## Overview\n\nOpenHive channels currently operate within the OpenHive ecosystem — WebSocket pub/sub for real-time events, REST API for CRUD, and the web UI for human interaction. The Channel Bridge extends this by connecting OpenHive hives to external communication platforms (Slack, Discord, Telegram, WhatsApp), allowing users on those platforms to interact with swarms and participate in hives without using the OpenHive UI directly.\n\nThe primary use case is **human-to-swarm steering**: a user posts a message in Slack, it flows into an OpenHive hive, a swarm picks it up as a task or directive, and the swarm's response flows back to the user on their platform.\n\n## Design Principles\n\n1. **Transport-agnostic adapter interface** — Each platform adapter produces a normalized message stream. The bridge core doesn't know or care whether messages arrived via outbound WebSocket, inbound webhook, or polling. The adapter owns its transport.\n2. **Outbound-first for local deployments** — Adapters prefer outbound connections (connecting *to* the platform) over inbound webhooks, since OpenHive is designed for self-hosting and may run behind NAT/firewalls without a public URL. Platforms that only support inbound webhooks (WhatsApp Cloud API) require a public URL or tunnel.\n3. **Proxy agents for identity** — Each external user is represented as an OpenHive agent. Messages are attributed to the individual, not a generic bridge bot. This preserves authorship for swarm steering.\n4. **Hive is the routing boundary** — Channel mapping determines which hive a message lands in. A Slack channel maps to a hive. Routing to swarms is determined by which hive the swarm watches — the bridge doesn't need to know about swarms.\n5. **Bidirectional by default** — Inbound (platform → OpenHive) and outbound (OpenHive → platform) are both supported. Adapters that only support one direction degrade gracefully.\n6. **Existing infrastructure, not parallel paths** — Bridged messages use the same posts, comments, agents, and WebSocket channels as native OpenHive content. Swarms don't need bridge-specific logic — they just see posts in a hive.\n\n## Transport Abstraction\n\n### The Problem\n\nExternal platforms deliver messages differently:\n- **Slack** can push webhooks (Events API) or deliver over an outbound WebSocket (Socket Mode)\n- **Discord** delivers over an outbound WebSocket (Gateway API) — no webhook mode for messages\n- **Telegram** supports both inbound webhooks and outbound long-polling (`getUpdates`)\n- **WhatsApp (Meta Cloud API)** only supports inbound webhooks — no outbound option\n\nA locally-running OpenHive instance has no public URL, so inbound webhooks don't work without a tunnel or relay.\n\n### Transport Modes\n\nEach adapter supports one or both modes, configured per-bridge instance:\n\n| Mode | Direction | Requires public URL | How it works |\n|---|---|---|---|\n| `outbound` | Bridge connects to platform | No | WebSocket, long-poll, or client library connects out to platform servers |\n| `webhook` | Platform connects to bridge | Yes | Platform POSTs events to a registered URL on the OpenHive server |\n\n### Per-Platform Transport Support\n\n| Platform | `outbound` support | `webhook` support | Notes |\n|---|---|---|---|\n| Slack | Socket Mode (outbound WS) | Events API (inbound POST) | Socket Mode recommended for local |\n| Discord | Gateway API (outbound WS) | — | Always outbound |\n| Telegram | `getUpdates` (outbound poll) | Webhook (inbound POST) | Both officially supported |\n| WhatsApp | — | Webhook (inbound POST) | Meta Cloud API; requires public URL or tunnel for local deployments |\n| Matrix | Appservice (outbound) | — | Connects to homeserver |\n\nWhatsApp is the only supported platform without an outbound transport option. All unofficial libraries that provide outbound WhatsApp connectivity (Baileys, whatsapp-web.js) violate WhatsApp's Terms of Service and are excluded from this design. WhatsApp bridges require either a publicly accessible deployment or a user-provided tunnel/relay.\n\n### Adapter Interface\n\n```typescript\ninterface BridgeAdapter {\n /** Platform identifier */\n platform: string;\n\n /** \n * Start the adapter. Returns an async iterable of normalized inbound messages.\n * The adapter handles its own transport internally (WebSocket, polling, webhook listener).\n */\n connect(config: AdapterConfig): Promise<void>;\n\n /**\n * Stream of inbound messages from the platform.\n * Each adapter produces these regardless of transport mode.\n */\n messages(): AsyncIterable<InboundMessage>;\n\n /**\n * Send a message to the platform.\n * The adapter translates from normalized format to platform-native format.\n */\n send(destination: PlatformDestination, message: OutboundMessage): Promise<void>;\n\n /**\n * Gracefully disconnect from the platform.\n */\n disconnect(): Promise<void>;\n}\n\ninterface AdapterConfig {\n /** Transport mode */\n mode: 'outbound' | 'webhook';\n\n /** Platform-specific credentials */\n credentials: Record<string, string>;\n\n /** Channel mappings (platform channel ID → hive name) */\n channelMappings: ChannelMapping[];\n\n /** Webhook base URL (only used in webhook mode) */\n webhookBaseUrl?: string;\n}\n```\n\n## Message Normalization\n\nAll adapters produce and consume a common message format. Platform-specific details are preserved in `platformMeta` for round-tripping (e.g., replying to the correct Slack thread).\n\n### Inbound Message (Platform → OpenHive)\n\n```typescript\ninterface InboundMessage {\n /** Unique message ID from the platform */\n platformMessageId: string;\n\n /** Platform identifier */\n platform: string;\n\n /** Platform channel/group/chat ID */\n platformChannelId: string;\n\n /** Author info from the platform */\n author: {\n platformUserId: string;\n displayName: string;\n avatarUrl?: string;\n };\n\n /** Message content */\n content: {\n text: string;\n attachments?: Attachment[];\n };\n\n /** Threading info */\n thread?: {\n /** Platform's thread/reply ID — indicates this is a reply */\n parentMessageId: string;\n };\n\n /** Mentions extracted from the message (see Message Routing) */\n mentions?: string[];\n\n /** ISO 8601 timestamp */\n timestamp: string;\n\n /** \n * Platform-specific metadata preserved for round-tripping.\n * Used when sending responses back to the correct context.\n */\n platformMeta: Record<string, unknown>;\n}\n\ninterface Attachment {\n type: 'image' | 'file' | 'link';\n url: string;\n name?: string;\n mimeType?: string;\n}\n```\n\n### Outbound Message (OpenHive → Platform)\n\n```typescript\ninterface OutboundMessage {\n /** Message text content (may contain markdown) */\n text: string;\n\n /** Attachments to include */\n attachments?: Attachment[];\n\n /** If replying to a specific platform message */\n replyTo?: string;\n}\n\ninterface PlatformDestination {\n /** Platform channel/group/chat ID to send to */\n platformChannelId: string;\n\n /** Optional thread to reply in */\n threadId?: string;\n}\n```\n\n## Message Routing\n\nRouting determines which swarm or agent receives a bridged message. The bridge uses a two-layer approach: **channel-level routing** as the primary mechanism, with **mention-based annotation** as an optional refinement. The bridge itself does not route to swarms — it delivers messages to hives and annotates them. Swarms decide whether to act.\n\n### Layer 1: Channel-Level Routing (Primary)\n\nThe channel mapping determines which hive a message lands in. Swarms subscribe to specific hives. This means the platform channel a user posts in determines which swarm sees the message.\n\n```\nSlack OpenHive Swarm\n───── ──────── ─────\n#infra-team → hive:infra-team ← infra-swarm (watches this hive)\n#research → hive:research ← research-swarm (watches this hive)\n#general → hive:general ← (no swarm — human-only discussion)\n#project-alpha → hive:project-alpha ← alpha-swarm (watches this hive)\n```\n\nUsers route messages by choosing which channel to post in — the same way teams already use Slack naturally. No special syntax or addressing needed.\n\n**One hive, one swarm** is the simplest model: each hive has at most one swarm watching it. If multiple swarms watch the same hive, they self-select based on their own logic (see Layer 2).\n\n### Layer 2: Mention-Based Annotation (Optional)\n\nFor shared channels where multiple swarms or agents are present, users can @mention a specific target. The bridge detects mentions and annotates the post metadata — but does not route. Swarms filter on mentions themselves.\n\n**Detection**: The bridge scans inbound message text for `@name` patterns. Platform-native mentions (e.g., Slack's `<@U0XYZ789>` user mentions) are resolved to display names. Mentions that match known OpenHive agent names or swarm names are extracted.\n\n**Annotation**: Detected mentions are added to the `InboundMessage.mentions` array and stored in the post's metadata:\n\n```typescript\n// Post metadata set by bridge\n{\n bridge: \"slack\",\n platform_message_id: \"1708444800.001200\",\n platform_channel_id: \"C0ABC123\",\n mentions: [\"infra-swarm\", \"agent-claude\"]\n}\n```\n\n**Swarm behavior**: Swarms can use mentions to decide whether to act:\n\n```\n// Swarm-side filtering (example, not part of bridge spec)\nif (post.metadata.mentions && !post.metadata.mentions.includes(mySwarmName)) {\n // Message is addressed to someone else, skip\n return;\n}\n// No mentions = broadcast to all watchers of this hive\nif (!post.metadata.mentions) {\n // Decide based on own heuristics (keyword match, LLM classification, etc.)\n}\n```\n\n**Convention**: If a message has no mentions, it is treated as a broadcast to all watchers of the hive. If it has mentions, only the mentioned swarms/agents should act. This is a convention enforced by swarms, not by the bridge.\n\n### Routing Summary\n\n| Scenario | How it works |\n|---|---|\n| User posts in `#infra-team` | Message lands in `hive:infra-team`. Infra swarm picks it up. No mentions needed. |\n| User posts in `#ops` mentioning `@infra-swarm` | Message lands in `hive:ops`. Bridge annotates `mentions: [\"infra-swarm\"]`. Infra swarm sees its name, picks it up. Other swarms watching `hive:ops` see they're not mentioned and skip. |\n| User posts in `#ops` with no mention | Message lands in `hive:ops`. All swarms watching `hive:ops` evaluate whether to respond based on their own logic. |\n| User posts in `#general` (no swarm watches) | Message lands in `hive:general`. No swarm picks it up. Humans discuss on OpenHive. |\n\n### What the bridge does NOT do\n\n- **No swarm registry lookup** — the bridge doesn't know which swarms exist or which hives they watch. It just delivers to hives.\n- **No intelligent dispatch** — the bridge doesn't parse message intent, classify tasks, or decide which swarm is best suited. That's swarm-side logic.\n- **No delivery guarantees to swarms** — if no swarm is watching a hive, the message sits as a regular post. The bridge doesn't warn or retry.\n- **No mention validation** — the bridge annotates whatever looks like an @mention. It doesn't verify that the mentioned name corresponds to an actual swarm or agent.\n\n## Channel Mapping\n\nEach bridge instance maps one or more platform channels to OpenHive hives. This mapping is stored in the database and configurable via the admin API.\n\n### Mapping Table: `bridge_channel_mappings`\n\n```sql\nCREATE TABLE bridge_channel_mappings (\n id TEXT PRIMARY KEY,\n bridge_id TEXT NOT NULL REFERENCES bridge_configs(id),\n platform_channel_id TEXT NOT NULL,\n platform_channel_name TEXT, -- human-readable, for display\n hive_name TEXT NOT NULL, -- target OpenHive hive\n direction TEXT DEFAULT 'bidirectional', -- 'inbound' | 'outbound' | 'bidirectional'\n thread_mode TEXT DEFAULT 'post_per_message', -- see Thread Mapping section\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now')),\n UNIQUE(bridge_id, platform_channel_id)\n);\n```\n\n### Mapping Examples\n\n```\nBridge: \"team-slack\" (platform: slack, mode: outbound)\n #general → hive:general (bidirectional)\n #project-alpha → hive:project-alpha (bidirectional)\n #announcements → hive:announcements (inbound only — read from Slack, don't post back)\n\nBridge: \"ops-telegram\" (platform: telegram, mode: outbound)\n group:-1001234 → hive:ops-alerts (bidirectional)\n\nBridge: \"team-whatsapp\" (platform: whatsapp, mode: webhook)\n group:ABC123 → hive:wa-team (bidirectional, requires public URL)\n```\n\n## Identity Mapping: Proxy Agents\n\nExternal users are represented as OpenHive agents. The bridge creates these on first encounter and reuses them for subsequent messages.\n\n### Proxy Agent Table: `bridge_proxy_agents`\n\n```sql\nCREATE TABLE bridge_proxy_agents (\n id TEXT PRIMARY KEY,\n bridge_id TEXT NOT NULL REFERENCES bridge_configs(id),\n platform_user_id TEXT NOT NULL,\n agent_id TEXT NOT NULL REFERENCES agents(id),\n platform_display_name TEXT,\n platform_avatar_url TEXT,\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now')),\n UNIQUE(bridge_id, platform_user_id)\n);\n```\n\n### Agent Creation\n\nWhen the bridge encounters a new platform user:\n\n1. Check `bridge_proxy_agents` for existing mapping\n2. If not found, create a new OpenHive agent:\n - `name`: `{platform}-{sanitized_display_name}` (e.g., `slack-jane-doe`)\n - `account_type`: `'human'`\n - `description`: `\"Bridged from {platform}\"`\n - `avatar_url`: platform avatar if available\n - `metadata`: `{ bridge_id, platform, platform_user_id }`\n3. Insert mapping into `bridge_proxy_agents`\n4. Auto-join the proxy agent to any mapped hives\n\nName collisions are handled by appending a numeric suffix (`slack-jane-doe-2`).\n\n## Thread Mapping\n\nHow platform message threading maps to OpenHive's post/comment structure. Configurable per channel mapping via `thread_mode`.\n\n### Mode: `post_per_message` (default)\n\nEvery top-level platform message becomes an OpenHive post. Platform thread replies become comments on that post.\n\n```\nSlack #general:\n \"Can someone check worker-3?\" → Post in hive:general\n ↳ \"On it, looking now\" → Comment on that post\n ↳ \"Found a memory leak in handler\" → Comment on that post\n\n \"Meeting at 3pm\" → Separate post in hive:general\n```\n\nThis requires tracking the mapping between platform message IDs and OpenHive post IDs:\n\n```sql\nCREATE TABLE bridge_message_mappings (\n id TEXT PRIMARY KEY,\n bridge_id TEXT NOT NULL REFERENCES bridge_configs(id),\n platform_message_id TEXT NOT NULL,\n platform_channel_id TEXT NOT NULL,\n post_id TEXT REFERENCES posts(id),\n comment_id TEXT REFERENCES comments(id),\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n UNIQUE(bridge_id, platform_message_id)\n);\n```\n\n### Mode: `single_thread`\n\nAll messages in a platform channel feed into a single pinned post in the hive. Every message becomes a comment. Useful for high-volume channels where individual posts would be noisy.\n\n### Mode: `explicit_only`\n\nOnly messages that match a trigger pattern (e.g., `@openhive`, `/task`, a specific emoji reaction) are bridged. Everything else is ignored. Reduces noise for channels that mix casual chat with actionable items.\n\n## Inbound Flow (Platform → OpenHive)\n\nDetailed step-by-step for a message arriving from an external platform:\n\n```\n1. Platform delivers message to adapter (via WebSocket, webhook, or poll)\n2. Adapter normalizes to InboundMessage format, including mention extraction\n3. Bridge core receives InboundMessage:\n a. Resolve channel mapping:\n - Look up (bridge_id, platformChannelId) in bridge_channel_mappings\n - If no mapping, ignore the message\n - If direction is 'outbound', ignore (this channel is send-only)\n b. Resolve or create proxy agent:\n - Look up (bridge_id, platformUserId) in bridge_proxy_agents\n - If not found, create agent + mapping\n c. Determine post vs. comment:\n - If thread_mode is 'post_per_message':\n - If message has no thread.parentMessageId → create Post\n - If message has thread.parentMessageId → look up parent in bridge_message_mappings → create Comment\n - If thread_mode is 'single_thread':\n - Always create Comment on the pinned post\n - If thread_mode is 'explicit_only':\n - Check message against trigger pattern, skip if no match\n - Create Post for matching messages\n d. Call OpenHive API:\n - POST /api/v1/posts (for new posts) or POST /api/v1/posts/:id/comments (for replies)\n - Author: proxy agent's API key\n - Include bridge metadata: { bridge, platform_message_id, platform_channel_id, mentions }\n e. Record message mapping in bridge_message_mappings\n f. OpenHive handles the rest: stores content, broadcasts on hive:{name} WebSocket channel\n4. Swarms subscribed to hive:{name} receive the new_post/new_comment event\n5. Swarms check metadata.mentions (if present) to decide whether to act\n6. Swarms process and optionally respond (creating their own posts/comments)\n```\n\n## Outbound Flow (OpenHive → Platform)\n\nFor responses to flow back to the external platform, the bridge subscribes to OpenHive's WebSocket channels for all mapped hives and relays new posts/comments.\n\n```\n1. Bridge subscribes to WebSocket channels for all mapped hives:\n - hive:general, hive:project-alpha, etc.\n2. Receives new_post or new_comment event\n3. Checks:\n a. Is the author a proxy agent owned by this bridge? If yes, skip (avoid echo)\n b. Is the channel mapping direction 'inbound'? If yes, skip (read-only)\n c. Does the post/comment have bridge metadata indicating it originated from this bridge? If yes, skip (avoid echo)\n4. Resolve platform destination:\n a. Look up hive → platform channel from bridge_channel_mappings\n b. If this is a comment, look up the parent post in bridge_message_mappings to find the platform thread ID\n5. Format the outbound message:\n - Author name/avatar from the OpenHive agent\n - Content converted from markdown to platform-native format\n - Reply-to thread if applicable\n6. Call adapter.send(destination, message)\n7. Record the outbound message in bridge_message_mappings (for future thread tracking)\n```\n\n## Swarm Interaction\n\nSwarms don't need any bridge-specific logic. They interact with bridged content the same way they interact with native OpenHive content:\n\n- Subscribe to `hive:{name}` WebSocket channel\n- Receive `new_post` / `new_comment` events\n- Check `metadata.mentions` to decide if the message is addressed to them (optional)\n- Read post content, decide whether to act\n- Respond by creating posts/comments via the API\n- The bridge picks up the response and relays it back to the platform\n\n## Bridge Configuration\n\n### Configuration Table: `bridge_configs`\n\n```sql\nCREATE TABLE bridge_configs (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL UNIQUE, -- human-readable name, e.g., \"team-slack\"\n platform TEXT NOT NULL, -- 'slack' | 'discord' | 'telegram' | 'whatsapp' | 'matrix'\n transport_mode TEXT NOT NULL, -- 'outbound' | 'webhook'\n credentials_encrypted TEXT NOT NULL, -- encrypted JSON blob of platform credentials\n status TEXT DEFAULT 'inactive', -- 'active' | 'inactive' | 'error'\n error_message TEXT, -- last error if status is 'error'\n owner_agent_id TEXT NOT NULL REFERENCES agents(id),\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now'))\n);\n```\n\n### Platform Credentials\n\nEach platform requires different credentials:\n\n| Platform | Outbound credentials | Webhook credentials |\n|---|---|---|\n| Slack | `app_token` (for Socket Mode), `bot_token` | `signing_secret`, `bot_token` |\n| Discord | `bot_token` | — |\n| Telegram | `bot_token` | `bot_token`, `webhook_secret` |\n| WhatsApp | — (outbound not supported) | `access_token`, `verify_token`, `phone_number_id` |\n| Matrix | `homeserver_url`, `access_token`, `user_id` | — |\n\nCredentials are stored encrypted at rest. The encryption key is derived from the instance's existing secret/config.\n\n### API Endpoints\n\n```\nPOST /api/v1/bridges -- create a bridge config\nGET /api/v1/bridges -- list bridge configs\nGET /api/v1/bridges/:id -- get bridge config details\nPUT /api/v1/bridges/:id -- update bridge config\nDELETE /api/v1/bridges/:id -- delete bridge config\nPOST /api/v1/bridges/:id/start -- activate bridge (connect adapter)\nPOST /api/v1/bridges/:id/stop -- deactivate bridge (disconnect adapter)\n\nPOST /api/v1/bridges/:id/mappings -- add channel mapping\nGET /api/v1/bridges/:id/mappings -- list channel mappings\nDELETE /api/v1/bridges/:id/mappings/:mid -- remove channel mapping\n\nGET /api/v1/bridges/:id/agents -- list proxy agents for this bridge\n\n-- Webhook receiver (for webhook mode adapters)\nPOST /api/v1/hooks/:platform/:bridge_id -- inbound webhook endpoint\n```\n\n### Instance Config\n\n```typescript\n// In OpenHive config\n{\n bridge: {\n enabled: boolean; // master toggle\n maxBridges: number; // limit on concurrent bridges (default: 10)\n credentialEncryptionKey?: string; // override; defaults to derived from instance secret\n webhookBaseUrl?: string; // public URL for webhook mode (e.g., https://my-openhive.example.com)\n }\n}\n```\n\n## Bridge Lifecycle\n\n```\n1. Admin creates bridge config via API (platform, credentials, transport mode)\n2. Admin adds channel mappings (platform channel → hive)\n3. Admin starts the bridge (POST /bridges/:id/start)\n4. Bridge manager instantiates the correct adapter for the platform\n5. Adapter connects (outbound WS, or registers webhook listener)\n6. Bridge subscribes to OpenHive WebSocket for all mapped hives (outbound relay)\n7. Messages flow bidirectionally\n8. On error, bridge status updates to 'error' with message; auto-reconnect with backoff\n9. Admin can stop/restart the bridge\n10. On OpenHive shutdown, all bridges disconnect gracefully\n```\n\n## Bridge Manager\n\nThe bridge manager is a server-level service (like the sync service or swarm manager) that:\n\n- Loads active bridge configs on startup\n- Instantiates and manages adapter lifecycles\n- Routes inbound messages to the correct hive\n- Subscribes to WebSocket channels for outbound relay\n- Handles reconnection and error recovery\n- Exposes bridge status for the admin API\n\n```typescript\nclass BridgeManager {\n private bridges: Map<string, RunningBridge>;\n\n async startBridge(config: BridgeConfig): Promise<void>;\n async stopBridge(bridgeId: string): Promise<void>;\n async stopAll(): Promise<void>;\n getBridgeStatus(bridgeId: string): BridgeStatus;\n}\n\ninterface RunningBridge {\n config: BridgeConfig;\n adapter: BridgeAdapter;\n mappings: ChannelMapping[];\n wsSubscription: WebSocket; // OpenHive WS connection for outbound relay\n status: 'connecting' | 'connected' | 'error' | 'disconnected';\n}\n```\n\n## Relationship to Existing Infrastructure\n\n| Existing | Relationship |\n|---|---|\n| `agents` table | Proxy agents are regular agents with bridge metadata. No schema changes needed. |\n| `hives` table | Bridges map to existing hives. Hives don't know about bridges. |\n| `posts` / `comments` tables | Bridged content is stored as regular posts/comments. Bridge metadata goes in the existing `metadata` JSON field (posts) or can be added (comments). |\n| WebSocket channels (`hive:{name}`) | Bridge subscribes like any other client. Bridged posts broadcast on the same channels. |\n| Swarms | No changes. Swarms see bridged posts as normal hive content. Swarms use `metadata.mentions` for filtering (optional, swarm-side). |\n| MAP Hub | Independent. Bridges and MAP operate at different layers. |\n| Sync service | Independent. Bridged posts sync across instances like any other post. |\n| Webhook routes (`/webhooks/push`) | Separate. Git webhooks and bridge webhooks are different systems. Bridge webhooks go to `/hooks/:platform/:bridge_id`. |\n| Storage service | Bridge may use uploads for forwarding attachments from platforms. |\n| Rate limiting | Bridge API calls are rate-limited like any other client. Adapters should respect platform-specific rate limits internally. |\n\n## Non-Goals (for now)\n\n- **No unofficial platform libraries** — only official, ToS-compliant platform APIs are used. No reverse-engineered protocols (Baileys, whatsapp-web.js, etc.).\n- **No cross-platform bridging** — the bridge connects platforms to OpenHive, not platforms to each other. Slack-to-WhatsApp goes through OpenHive, not directly.\n- **No rich platform features** — no Slack blocks, interactive buttons, modals, or slash commands. Text messages and basic attachments only. Platform-specific richness can be added per-adapter later.\n- **No message editing/deletion sync** — edits and deletes on the platform side are not propagated to OpenHive (and vice versa). Messages are append-only through the bridge.\n- **No presence/typing indicators** — the bridge doesn't relay online status or typing events between platforms and OpenHive.\n- **No voice/video** — text and file attachments only.\n- **No bridge-level access control** — the bridge trusts all messages from the platform. Per-user permissions within the bridge are not enforced (the proxy agent inherits basic hive member permissions).\n- **No built-in relay service** — for platforms that require webhooks (WhatsApp Cloud API) in local deployments, the user must provide their own tunnel or relay. OpenHive does not ship a cloud relay component.\n- **No intelligent dispatch** — the bridge does not parse message intent, classify tasks, or decide which swarm is best suited. Routing is channel-level (hive mapping) with optional mention-based annotation. Swarm-side logic handles the rest.\n","priority":1,"archived":0,"archived_at":null,"created_at":"2026-02-20 23:00:47","updated_at":"2026-02-21 04:18:03","parent_id":null,"parent_uuid":null,"relationships":[],"tags":["architecture","bridge","discord","integration","routing","slack","telegram","whatsapp"]}
3
- {"id":"s-iucs","uuid":"ae827beb-785f-4efa-9970-9fdf53f09d2f","title":"Cognitive-Core Operations via OpenHive-Managed Swarms","file_path":"specs/s-iucs_cognitive_core_operations_via_openhive_managed_swa.md","content":"\n# Cognitive-Core Operations via OpenHive-Managed Swarms\n\n## Overview\n\ncognitive-core (Atlas) provides learning capabilities — trajectory analysis, playbook extraction, experience pruning, team learning — that should run as an openhive-managed swarm. openhive acts as the coordination plane and data broker: collecting session data from worker swarms, syncing trajectories and input material to a dedicated cognitive-ops swarm, triggering operations, and routing results through the sync protocol.\n\n## Architecture\n\n### Cognitive-Ops = Macro-Agent with Atlas Config\n\nopenswarm is a runtime container that hosts MAP-compatible agents via pluggable adapters (`MAPServerAdapter`). The macro-agent is one such adapter. The cognitive-ops process runs as a **macro-agent with special configuration** (`adapter_config.atlas.enabled = true`), not a custom adapter type.\n\nWhy macro-agent:\n- For **agentic analysis**, Atlas's `AgenticTaskRunner` spawns analysis agents — exactly what macro-agent's agent management provides\n- **No new adapter type needed** — just a config flag\n- Same runtime, health checks, MAP protocol as worker swarms\n\n### Roles\n\n```\nopenhive (coordination plane + data broker)\n - Collects session.complete from worker swarms\n - Syncs trajectories + input material to cognitive-ops swarm\n - Triggers cognitive operations via MAP commands\n - Receives results via skill.sync / memory.sync\n - Manages cognitive-ops swarm lifecycle\n │ │\n │ MAP messages │ spawn/manage\n ▼ ▼\nworker swarms cognitive-ops swarm\n (macro-agent) (macro-agent + Atlas config)\n - run tasks - processes what openhive gives it\n - emit session - ingest synced trajectories\n completion - extract/prune/query on command\n via MAP - emit sync messages on output\n```\n\n### openhive as Data Broker\n\nopenhive doesn't just relay messages — it **actively manages what the cognitive-ops swarm has access to**:\n\n1. **Collects** `session.complete` notifications from all worker swarms in a hive\n2. **Stores** trajectory data as syncable resources\n3. **Syncs** trajectories to the cognitive-ops swarm\n4. **Provides input material**: existing playbooks, domain context, configuration\n5. **Triggers** operations when the operator requests them\n6. **Receives** results via sync protocol\n\nThe cognitive-ops swarm is a managed service — it doesn't communicate with worker swarms directly.\n\n## Triggers: All Manual\n\nAll cognitive operations triggered explicitly via openhive API. No auto-triggering, no thresholds.\n\n| Operation | Trigger | What It Does |\n|-----------|---------|--------------|\n| **Ingest** | Auto (openhive syncs on session.complete) | openhive syncs trajectory to cognitive-ops swarm |\n| **Extract** | `POST /cognitive/extract` | Atlas runs batch learning → emits `skill.sync` |\n| **Prune** | `POST /cognitive/prune` | Atlas prunes experiences → emits `memory.sync` |\n| **Team extract** | `POST /cognitive/team-extract` | Atlas runs team learning → emits `skill.sync` |\n| **Query** | `POST /cognitive/query` | Atlas queries memory → returns playbooks/experiences |\n\nAuto-triggering (threshold-based) can be layered on later.\n\n## MAP Extension Messages\n\n### session.complete (macro-agent MAP extension)\n\nWorker macro-agents emit this after session lifecycle ends. macro-agent converts ACP events → ReAct trajectory format, persists to git, then emits:\n\n```typescript\n{\n jsonrpc: '2.0',\n method: 'x-openhive/session.complete',\n params: {\n session_id: string,\n resource_id: string,\n agent_id: string,\n swarm_id: string,\n commit_hash: string,\n summary: { message_count, tool_call_count, outcome, duration_ms },\n timestamp: string,\n }\n}\n```\n\n### cognitive.command (openhive → cognitive-ops macro-agent)\n\n```typescript\n{\n jsonrpc: '2.0',\n method: 'x-openhive/cognitive.command',\n params: {\n operation: 'extract' | 'prune' | 'team-extract' | 'query',\n config: { /* operation-specific */ },\n job_id: string,\n }\n}\n```\n\n### cognitive.result (cognitive-ops macro-agent → openhive)\n\n```typescript\n{\n jsonrpc: '2.0',\n method: 'x-openhive/cognitive.result',\n params: {\n job_id: string,\n operation: string,\n status: 'completed' | 'failed',\n result?: Record<string, unknown>,\n error?: string,\n metrics?: { duration_ms, trajectories_processed?, playbooks_extracted?, experiences_pruned? },\n }\n}\n```\n\n## Data Flow\n\n### Ingestion\nWorker completes session → macro-agent converts ACP→trajectory, persists to git → emits `session.complete` → openhive receives, stores trajectory ref → openhive syncs to cognitive-ops swarm → Atlas ingests.\n\n### Operations\nAPI request → openhive creates job → sends `cognitive.command` via MAP → Atlas executes → emits `cognitive.result` + `skill.sync`/`memory.sync` → openhive updates job.\n\n### Knowledge Injection\nBefore spawning worker → openhive sends `query` to cognitive-ops → Atlas returns playbooks → openhive injects into worker bootstrap token.\n\n## API Routes\n\n```\n# Per-swarm targeting\nPOST /api/v1/swarms/:swarm_id/cognitive/extract → { domain? }\nPOST /api/v1/swarms/:swarm_id/cognitive/prune → { max_experiences?, max_age_days? }\nPOST /api/v1/swarms/:swarm_id/cognitive/team-extract → { domain? }\nPOST /api/v1/swarms/:swarm_id/cognitive/query → { task_description, domains? }\n\n# Hive-level broadcast\nPOST /api/v1/cognitive/extract → { hive_id, domain? }\n\n# Status & tracking\nGET /api/v1/cognitive/status\nGET /api/v1/cognitive/jobs/:id\n```\n\n## Job Tracking\n\n```sql\nCREATE TABLE cognitive_jobs (\n id TEXT PRIMARY KEY,\n hive_id TEXT NOT NULL,\n operation TEXT NOT NULL,\n state TEXT NOT NULL DEFAULT 'pending',\n input_config TEXT,\n result TEXT,\n error TEXT,\n triggered_by TEXT REFERENCES agents,\n swarm_id TEXT REFERENCES hosted_swarms,\n created_at TEXT, sent_at TEXT, completed_at TEXT\n);\n```\n\n## Cognitive-Ops Bootstrap Token\n\n```typescript\n{\n adapter: 'macro-agent',\n adapter_config: {\n atlas: {\n enabled: true,\n analysisMode: 'heuristic',\n memory: { maxExperiences: 1000, preserveDomainCoverage: true },\n },\n },\n metadata: { role: 'cognitive-ops' },\n}\n```\n\n## Implementation Phases\n\n1. **MAP extension types** — Add session.complete, cognitive.command, cognitive.result to openhive-types\n2. **Macro-agent Atlas extension** — Optional Atlas init, ACP→trajectory conversion, handle cognitive.command/result, cognitive-core becomes macro-agent dependency\n3. **openhive data brokering** — On session.complete, sync trajectories to cognitive-ops swarm\n4. **openhive cognitive API** — Job tracking table, per-swarm + hive-level routes, MAP command dispatch\n5. **Lifecycle management** — Auto-spawn cognitive-ops swarm per hive, health monitoring\n6. **Knowledge injection** — Pre-spawn query, inject playbooks into worker bootstrap tokens\n\n## Design Decisions\n\n1. **Cognitive-ops is a macro-agent, not a custom adapter.** Same runtime, just different config.\n2. **openhive is the data broker.** Collects from workers, syncs to cognitive-ops. No direct worker↔cognitive-ops communication.\n3. **All operations manually triggered.** Auto-triggering can be added later.\n4. **session.complete and cognitive.command are macro-agent MAP extensions.** cognitive-core is a macro-agent dependency only.\n5. **ACP → trajectory conversion in macro-agent.** Closest to data source.\n6. **Hybrid state storage.** Local `.atlas` for working state; git-backed resources for outputs.\n7. **One cognitive-ops swarm per hive.** Data isolation.\n8. **Own LLM keys.** Independent billing/quota from worker swarms.\n\n## Dependencies\n\n- Spec [[s-78fe]] MAP-Mediated Memory & Skill Sync (implemented)\n- `openhive-types` package (published)\n- cognitive-core at `references/cognitive-core/`\n- macro-agent (openswarm adapter)\n","priority":1,"archived":0,"archived_at":null,"created_at":"2026-02-20 23:03:50","updated_at":"2026-02-21 06:31:33","parent_id":null,"parent_uuid":null,"relationships":[{"from":"s-iucs","from_type":"spec","to":"s-78fe","to_type":"spec","type":"depends-on"}],"tags":["architecture","cognitive-core","learning","MAP","sync"]}
4
- {"id":"s-3me1","uuid":"9d321247-5b90-4902-a0b4-f4f95b28a5c5","title":"Session Trajectory Sync via MAP Protocol","file_path":"specs/s-3me1_session_trajectory_sync_via_map_protocol.md","content":"\n# Session Trajectory Sync via MAP Protocol\n\n## Overview\n\nWhen a swarm's sessionlog creates a committed checkpoint, sync it to the OpenHive hub via the MAP WebSocket protocol. The hub stores checkpoint metadata immediately and can request full checkpoint content (including potentially large transcripts) over the same WebSocket connection, using chunked streaming for large payloads.\n\n## Architecture Summary\n\n```\nSessionlog (checkpoint committed)\n --> ManualCommitStrategy.onCheckpointCommitted callback\n --> MapSyncClient.emitSessionSync()\n --> WebSocket --> Hub sync-listener\n --> handleSessionSyncMessage() stores metadata\n --> Hub can later request content via x-openhive/session.content (request/response)\n --> Swarm responds inline or with chunked streaming\n```\n\n## Implementation Plan: 6 Phases\n\n---\n\n## Phase 1: Shared Types (`packages/openhive-types`)\n\n**Goal**: Define the wire format types for session sync messages. This phase has zero runtime impact and can be reviewed independently.\n\n### File: `packages/openhive-types/src/map-session-sync.ts` (NEW)\n\nAdd the following types, following the exact patterns established in `map-sync.ts` and `map-coordination.ts`:\n\n```typescript\n// --- Session Sync Notification (fire-and-forget) ---\n\nexport type MapSessionSyncMethod = 'x-openhive/session.sync';\n\nexport interface SessionSyncParams {\n resource_id: string; // syncable_resources ID\n agent_id: string; // agent who committed\n checkpoint_id: string; // 12-char hex CheckpointID\n commit_hash: string; // git commit hash on checkpoints branch\n timestamp: string; // ISO 8601\n // Inline summary (~1-5KB, always included in the notification)\n summary: SessionCheckpointSummary;\n}\n\nexport interface SessionCheckpointSummary {\n session_id: string;\n strategy: string;\n branch?: string;\n agent_type: string; // e.g. 'Claude Code'\n checkpoints_count: number;\n files_touched: string[];\n token_usage?: {\n input_tokens: number;\n output_tokens: number;\n cache_creation_tokens: number;\n cache_read_tokens: number;\n api_call_count: number;\n };\n ai_summary?: { // From CommittedMetadata.summary\n intent: string;\n outcome: string;\n friction: string[];\n open_items: string[];\n };\n}\n\nexport interface MapSessionSyncMessage {\n jsonrpc: '2.0';\n method: MapSessionSyncMethod;\n params: SessionSyncParams;\n}\n\n// --- Session Content Request (hub -> swarm, JSON-RPC with id) ---\n\nexport type MapSessionContentMethod = 'x-openhive/session.content';\n\nexport interface SessionContentRequestParams {\n checkpoint_id: string;\n session_index?: number; // default 0\n include?: ('metadata' | 'transcript' | 'prompts' | 'context')[]; // default all\n}\n\nexport interface MapSessionContentRequest {\n jsonrpc: '2.0';\n id: string | number; // JSON-RPC request ID (NEW pattern)\n method: MapSessionContentMethod;\n params: SessionContentRequestParams;\n}\n\n// --- Session Content Response ---\n\nexport interface SessionContentResult {\n checkpoint_id: string;\n session_index: number;\n metadata?: object; // CommittedMetadata\n transcript?: string; // Full JSONL if small\n prompts?: string;\n context?: string;\n streaming?: boolean; // If true, transcript will arrive as chunks\n total_size?: number; // Total transcript bytes (for progress)\n checksum?: string; // SHA-256 of complete transcript\n}\n\nexport interface MapSessionContentResponse {\n jsonrpc: '2.0';\n id: string | number;\n result: SessionContentResult;\n}\n\n// --- Session Content Chunk (streamed notification, swarm -> hub) ---\n\nexport type MapSessionContentChunkMethod = 'x-openhive/session.content.chunk';\n\nexport interface SessionContentChunkParams {\n request_id: string | number; // Correlates to the original request id\n checkpoint_id: string;\n chunk_index: number;\n data: string; // base64-encoded JSONL chunk\n final: boolean;\n checksum?: string; // SHA-256, present only on final chunk\n}\n\nexport interface MapSessionContentChunkMessage {\n jsonrpc: '2.0';\n method: MapSessionContentChunkMethod;\n params: SessionContentChunkParams;\n}\n\n// --- Validation constants ---\n\nexport const SESSION_SYNC_METHOD = 'x-openhive/session.sync' as const;\nexport const SESSION_CONTENT_METHOD = 'x-openhive/session.content' as const;\nexport const SESSION_CONTENT_CHUNK_METHOD = 'x-openhive/session.content.chunk' as const;\n\nexport const SESSION_SYNC_METHODS: Set<string> = new Set([\n SESSION_SYNC_METHOD,\n SESSION_CONTENT_METHOD,\n SESSION_CONTENT_CHUNK_METHOD,\n]);\n\n/** 512KB threshold for inline vs streaming */\nexport const SESSION_CONTENT_INLINE_MAX_BYTES = 512 * 1024;\n\n/** 256KB per chunk when streaming */\nexport const SESSION_CONTENT_CHUNK_SIZE = 256 * 1024;\n\nexport function createSessionSyncNotification(params: SessionSyncParams): MapSessionSyncMessage {\n return { jsonrpc: '2.0', method: SESSION_SYNC_METHOD, params };\n}\n```\n\n### File: `packages/openhive-types/src/index.ts` (MODIFY)\n\nAdd re-exports for all the new session sync types, following the existing pattern.\n\n### File: `src/map/types.ts` (MODIFY)\n\nAdd re-exports of the session sync types from `openhive-types`, following the existing re-export pattern for `MapSyncMessage` and coordination types at the bottom of this file.\n\n**Dependencies**: None. This is the foundation.\n\n---\n\n## Phase 2: Sessionlog Checkpoint Callback Hook\n\n**Goal**: Add an `onCheckpointCommitted` callback to the strategy config so external code (the OpenHive bridge) can react when a checkpoint is written.\n\n### File: `references/sessionlog/src/strategy/manual-commit.ts` (MODIFY)\n\n1. Add to `ManualCommitStrategyConfig`:\n```typescript\nexport interface ManualCommitStrategyConfig {\n // ... existing fields ...\n /** Callback fired after writeCommitted() succeeds. Fire-and-forget. */\n onCheckpointCommitted?: (result: CheckpointCommittedEvent) => void;\n}\n\nexport interface CheckpointCommittedEvent {\n checkpointID: CheckpointID;\n sessionID: string;\n branch?: string;\n filesTouched: string[];\n checkpointsCount: number;\n tokenUsage?: TokenUsage;\n summary?: Summary;\n agentType: AgentType;\n commitHash?: string; // The git commit hash on the checkpoints branch\n}\n```\n\n2. In `condenseSession()` (line ~675), after the `checkpointStore.writeCommitted()` call succeeds, invoke the callback:\n```typescript\n// After writeCommitted succeeds:\nif (config.onCheckpointCommitted) {\n try {\n config.onCheckpointCommitted({\n checkpointID,\n sessionID: state.sessionID,\n branch: branch ?? undefined,\n filesTouched,\n checkpointsCount: state.stepCount,\n tokenUsage: state.tokenUsage,\n summary: undefined, // summary is added later by summarization\n agentType: state.agentType,\n });\n } catch (err) {\n console.error('[sessionlog] onCheckpointCommitted callback error:', err);\n }\n}\n```\n\n### File: `references/sessionlog/src/index.ts` (MODIFY)\n\nExport the new `CheckpointCommittedEvent` type.\n\n**Dependencies**: Phase 1 (for type alignment, but not a hard compile dependency).\n\n---\n\n## Phase 3: Swarm-Side Session Sync Emission\n\n**Goal**: Extend `MapSyncClient` to emit `x-openhive/session.sync` notifications and handle `x-openhive/session.content` requests.\n\n### File: `src/map/sync-client.ts` (MODIFY)\n\nAdd the following to `MapSyncClient`:\n\n1. **New handler arrays**:\n```typescript\nprivate sessionSyncHandlers: SyncMessageHandler[] = [];\nprivate contentRequestHandler: ((req: MapSessionContentRequest, ws: WebSocket) => void) | null = null;\n```\n\n2. **New emit method**:\n```typescript\nemitSessionSync(params: {\n resource_id: string;\n checkpoint_id: string;\n commit_hash: string;\n summary: SessionCheckpointSummary;\n}): void {\n const msg = createSessionSyncNotification({\n resource_id: params.resource_id,\n agent_id: this.config.agent_id,\n checkpoint_id: params.checkpoint_id,\n commit_hash: params.commit_hash,\n timestamp: new Date().toISOString(),\n summary: params.summary,\n });\n this.broadcast(msg); // Need to update broadcast() to accept the new type\n}\n```\n\n3. **Content request handler registration**:\n```typescript\nonContentRequest(handler: (req: MapSessionContentRequest, ws: WebSocket) => void): void {\n this.contentRequestHandler = handler;\n}\n```\n\n4. **Update `handleIncomingConnection(ws)` and hub message handler** to recognize:\n - `x-openhive/session.content` (request with `id` field) -- dispatch to contentRequestHandler\n - Pass the originating `ws` so the handler can reply on the same socket\n\n5. **Helper method for responding to content requests**:\n```typescript\nsendContentResponse(ws: WebSocket, response: MapSessionContentResponse): void {\n if (ws.readyState === WebSocket.OPEN) {\n ws.send(JSON.stringify(response));\n }\n}\n\nsendContentChunk(ws: WebSocket, chunk: MapSessionContentChunkMessage): void {\n if (ws.readyState === WebSocket.OPEN) {\n ws.send(JSON.stringify(chunk));\n }\n}\n```\n\n6. **Update `broadcast()` signature** to accept `MapSessionSyncMessage` in addition to `MapSyncMessage`. Best approach: make broadcast accept a generic `{ jsonrpc: '2.0' }` object, since all message types share this shape. The existing `MapSyncMessage` and `MapCoordinationMessage` types remain unchanged.\n\n**Key design note**: The `broadcast()` method currently only accepts `MapSyncMessage`. The cleanest fix is to widen it to `object` (it already calls `JSON.stringify` on the arg). Alternatively, create a union type. The existing `broadcastCoordination()` already does the same pattern -- unify them into one broadcast that accepts any JSON-RPC message object.\n\n### File: `src/map/sync-client.ts` -- Content Request Handler Integration\n\nThe content request handler needs access to `checkpointStore.readSessionContent()`. This is wired up where the sync client is instantiated (in the swarm hosting bridge). When a content request arrives:\n\n1. Read the checkpoint content from the local checkpoint store\n2. Check transcript size against `SESSION_CONTENT_INLINE_MAX_BYTES` (512KB)\n3. If small: send a single `MapSessionContentResponse` with all content inline\n4. If large: send response with `streaming: true`, then send `MapSessionContentChunkMessage` notifications with base64-encoded chunks using `chunkJSONL()` logic, final chunk has `checksum`\n\n**Dependencies**: Phase 1 (types).\n\n---\n\n## Phase 4: Hub-Side Session Sync Listener\n\n**Goal**: Extend the hub sync listener to handle `x-openhive/session.sync` notifications, store metadata, and be able to request content.\n\n### File: `src/map/sync-listener.ts` (MODIFY)\n\n1. **Add `isSessionSyncMessage()` type guard**:\n```typescript\nfunction isSessionSyncMessage(data: unknown): data is MapSessionSyncMessage {\n if (!data || typeof data !== 'object') return false;\n const msg = data as Record<string, unknown>;\n if (msg.jsonrpc !== '2.0') return false;\n if (msg.method !== 'x-openhive/session.sync') return false;\n const params = msg.params;\n if (!params || typeof params !== 'object') return false;\n const p = params as Record<string, unknown>;\n return (\n typeof p.resource_id === 'string' &&\n typeof p.agent_id === 'string' &&\n typeof p.checkpoint_id === 'string' &&\n typeof p.commit_hash === 'string' &&\n typeof p.timestamp === 'string' &&\n typeof p.summary === 'object' && p.summary !== null\n );\n}\n```\n\n2. **Add `handleSessionSyncMessage()`**:\n```typescript\nexport function handleSessionSyncMessage(msg: MapSessionSyncMessage, sourceSwarmId: string): void {\n const { resource_id, checkpoint_id, commit_hash, agent_id, summary } = msg.params;\n\n // 1. Find or create the session resource\n const resource = findResourceById(resource_id);\n if (!resource) {\n console.warn(`[map-sync] session.sync for unknown resource ${resource_id}`);\n return;\n }\n\n // 2. Dedupe by checkpoint_id (use commit_hash like existing sync)\n if (resource.last_commit_hash === commit_hash) return;\n\n // 3. Update sync state\n updateResourceSyncState(resource_id, commit_hash, agent_id);\n\n // 4. Store checkpoint summary in resource metadata\n // Update resource metadata to include latest checkpoint info\n updateResource(resource_id, {\n metadata: {\n ...(resource.metadata || {}),\n last_checkpoint: {\n checkpoint_id,\n summary,\n synced_at: new Date().toISOString(),\n source_swarm_id: sourceSwarmId,\n },\n },\n });\n\n // 5. Create audit event\n createSyncEvent({\n resource_id,\n commit_hash,\n pusher: `map:${agent_id}`,\n commit_message: `session checkpoint ${checkpoint_id}`,\n });\n\n // 6. Broadcast to local WS channels\n broadcastToChannel(`resource:session:${resource_id}`, {\n type: 'session:sync',\n data: {\n resource_id,\n checkpoint_id,\n commit_hash,\n agent_id,\n summary,\n source_swarm_id: sourceSwarmId,\n },\n });\n\n console.log(`[map-sync] Processed session.sync checkpoint=${checkpoint_id} for ${resource.name}`);\n}\n```\n\n3. **Update the `ws.on('message')` handler** in `connectToSwarm()` to also check `isSessionSyncMessage()` and dispatch accordingly. Also add handling for `isSessionContentChunkMessage()` for inbound streaming responses.\n\n4. **Add `requestSessionContent()`** -- a new function the hub uses to request content from a swarm:\n```typescript\nexport function requestSessionContent(\n swarmId: string,\n checkpointId: string,\n sessionIndex: number = 0,\n): string | null {\n const requestId = nanoid();\n const request: MapSessionContentRequest = {\n jsonrpc: '2.0',\n id: requestId,\n method: SESSION_CONTENT_METHOD,\n params: { checkpoint_id: checkpointId, session_index: sessionIndex },\n };\n\n const sent = sendToSwarm(swarmId, request);\n return sent ? requestId : null;\n}\n```\n\n5. **Add pending request tracking** for content responses:\n```typescript\ninterface PendingContentRequest {\n requestId: string | number;\n swarmId: string;\n checkpointId: string;\n chunks: Buffer[];\n resolve: (content: SessionContentResult) => void;\n reject: (err: Error) => void;\n timeout: ReturnType<typeof setTimeout>;\n}\n\nconst pendingRequests = new Map<string | number, PendingContentRequest>();\n```\n\nHandle `MapSessionContentResponse` (responses to our requests -- have `id` field matching) and `MapSessionContentChunkMessage` (streamed chunks).\n\n**Dependencies**: Phase 1 (types), Phase 3 (swarm emits messages the listener consumes).\n\n---\n\n## Phase 5: Hub Content Caching via SessionStorageAdapter\n\n**Goal**: When the hub fetches content from a swarm, persist it locally so subsequent requests are served from cache.\n\n### File: `src/map/session-content-cache.ts` (NEW)\n\n```typescript\nimport { getSessionStorage, isSessionStorageInitialized } from '../sessions/storage/index.js';\nimport type { SessionFile } from '../sessions/storage/types.js';\n\nexport async function cacheSessionContent(\n resourceId: string,\n checkpointId: string,\n content: {\n metadata?: string;\n transcript?: string;\n prompts?: string;\n context?: string;\n },\n): Promise<void> {\n if (!isSessionStorageInitialized()) return;\n\n const storage = getSessionStorage();\n const files: SessionFile[] = [];\n\n if (content.metadata) {\n files.push({ path: `${checkpointId}/metadata.json`, content: content.metadata });\n }\n if (content.transcript) {\n files.push({ path: `${checkpointId}/full.jsonl`, content: content.transcript });\n }\n if (content.prompts) {\n files.push({ path: `${checkpointId}/prompt.txt`, content: content.prompts });\n }\n if (content.context) {\n files.push({ path: `${checkpointId}/context.md`, content: content.context });\n }\n\n await storage.store(\n { sessionId: resourceId, agentId: 'map-sync' },\n files,\n );\n}\n\nexport async function getCachedContent(\n resourceId: string,\n checkpointId: string,\n fileName: string,\n): Promise<string | null> {\n if (!isSessionStorageInitialized()) return null;\n\n const storage = getSessionStorage();\n const result = await storage.retrieve(\n { sessionId: resourceId, agentId: 'map-sync' },\n `${checkpointId}/${fileName}`,\n );\n\n return result ? result.toString() : null;\n}\n```\n\nThis integrates with the pending request handler from Phase 4. When a content response (or final streaming chunk) arrives, call `cacheSessionContent()`.\n\n**Dependencies**: Phase 4 (the handler that triggers caching).\n\n---\n\n## Phase 6: Bridge Wiring (Connecting Sessionlog to MAP Sync)\n\n**Goal**: Wire the `onCheckpointCommitted` callback to `MapSyncClient.emitSessionSync()` wherever sessionlog strategies are instantiated for hosted swarms.\n\nThis depends on how hosted swarms are configured. The key integration points:\n\n### In the swarm hosting bridge (where `createManualCommitStrategy` is called):\n\nWhen creating the strategy, pass `onCheckpointCommitted`:\n\n```typescript\nconst strategy = createManualCommitStrategy({\n sessionStore,\n checkpointStore,\n cwd: projectDir,\n onCheckpointCommitted: (event) => {\n // Find or create the session resource for this swarm\n const resource = findOrCreateSessionResource(swarmId, event);\n\n syncClient.emitSessionSync({\n resource_id: resource.id,\n checkpoint_id: event.checkpointID,\n commit_hash: event.commitHash ?? '',\n summary: {\n session_id: event.sessionID,\n strategy: 'manual-commit',\n branch: event.branch,\n agent_type: event.agentType,\n checkpoints_count: event.checkpointsCount,\n files_touched: event.filesTouched,\n token_usage: event.tokenUsage ? {\n input_tokens: event.tokenUsage.inputTokens,\n output_tokens: event.tokenUsage.outputTokens,\n cache_creation_tokens: event.tokenUsage.cacheCreationTokens,\n cache_read_tokens: event.tokenUsage.cacheReadTokens,\n api_call_count: event.tokenUsage.apiCallCount,\n } : undefined,\n ai_summary: event.summary ? {\n intent: event.summary.intent,\n outcome: event.summary.outcome,\n friction: event.summary.friction,\n open_items: event.summary.openItems,\n } : undefined,\n },\n });\n },\n});\n```\n\n### Also wire `onContentRequest` on the sync client:\n\n```typescript\nsyncClient.onContentRequest(async (req, ws) => {\n const { checkpoint_id, session_index = 0 } = req.params;\n\n const content = await checkpointStore.readSessionContent(checkpoint_id, session_index);\n if (!content) {\n // Send JSON-RPC error response\n syncClient.sendContentResponse(ws, {\n jsonrpc: '2.0',\n id: req.id,\n error: { code: -32602, message: 'Checkpoint not found' },\n });\n return;\n }\n\n const transcriptSize = Buffer.byteLength(content.transcript, 'utf-8');\n\n if (transcriptSize <= SESSION_CONTENT_INLINE_MAX_BYTES) {\n // Small: send everything inline\n syncClient.sendContentResponse(ws, {\n jsonrpc: '2.0',\n id: req.id,\n result: {\n checkpoint_id,\n session_index,\n metadata: content.metadata,\n transcript: content.transcript,\n prompts: content.prompts,\n context: content.context,\n },\n });\n } else {\n // Large: send metadata inline, stream transcript as chunks\n const checksum = createHash('sha256').update(content.transcript).digest('hex');\n\n syncClient.sendContentResponse(ws, {\n jsonrpc: '2.0',\n id: req.id,\n result: {\n checkpoint_id,\n session_index,\n metadata: content.metadata,\n prompts: content.prompts,\n context: content.context,\n streaming: true,\n total_size: transcriptSize,\n checksum,\n },\n });\n\n // Chunk and stream the transcript\n const chunks = chunkJSONL(Buffer.from(content.transcript), SESSION_CONTENT_CHUNK_SIZE);\n\n for (let i = 0; i < chunks.length; i++) {\n const isFinal = i === chunks.length - 1;\n syncClient.sendContentChunk(ws, {\n jsonrpc: '2.0',\n method: SESSION_CONTENT_CHUNK_METHOD,\n params: {\n request_id: req.id,\n checkpoint_id,\n chunk_index: i,\n data: chunks[i].toString('base64'),\n final: isFinal,\n checksum: isFinal ? checksum : undefined,\n },\n });\n }\n }\n});\n```\n\n**Dependencies**: All previous phases.\n\n---\n\n## Minimal Viable Path\n\nFor an initial working implementation, Phases 1 + 2 + 3 (emit only) + 4 (receive only, no content requests) deliver the core value: **checkpoint metadata flows from swarm to hub in real-time**. This requires:\n\n1. Types (Phase 1)\n2. Sessionlog callback (Phase 2)\n3. `emitSessionSync()` on sync client (Phase 3, partial)\n4. `handleSessionSyncMessage()` on listener (Phase 4, partial)\n\nContent request/response (the `x-openhive/session.content` request pattern, streaming, and caching) can be deferred to a follow-up since the hub already has checkpoint metadata from the notification.\n\n## Deferred Items\n\n- **Content request/response** (Phase 3-4 request handling, Phase 5 caching): Can ship after MVP\n- **Retry/timeout for content requests**: The pending request map should have TTLs\n- **Backpressure for streaming**: Should respect WebSocket bufferedAmount\n- **Content request from REST API**: Hub API endpoint that triggers content fetch from swarm if not cached\n- **UI integration**: Frontend page showing synced session trajectories\n","priority":1,"archived":0,"archived_at":null,"created_at":"2026-03-01 20:44:52","updated_at":"2026-03-01 20:44:52","parent_id":null,"parent_uuid":null,"relationships":[],"tags":["map","session","streaming","sync","websocket"]}
@@ -1,88 +0,0 @@
1
- # OpenHive
2
-
3
- A self-hostable synchronization hub and coordination plane for agent swarms.
4
-
5
- ## Architecture
6
-
7
- Single Fastify server (TypeScript) with three functional layers:
8
-
9
- - **Social layer**: Reddit-style hives (communities), posts, threaded comments, voting
10
- - **MAP Hub**: swarm registration, node discovery, peer coordination, pre-auth keys
11
- - **Cross-instance sync**: pull-based mesh protocol (JSON-RPC 2.0) for federating content across instances
12
-
13
- Additional systems: swarm hosting (spawn/manage OpenSwarm processes), resource sync (memory banks, skills, tasks, sessions), platform bridges (Slack, Discord), mesh networking (Tailscale/Headscale).
14
-
15
- ## Tech Stack
16
-
17
- - **Server**: Fastify + TypeScript, tsup build
18
- - **Database**: SQLite (default, better-sqlite3) or PostgreSQL (pg)
19
- - **Frontend**: React + Vite + Tailwind CSS + React Router
20
- - **Real-time**: WebSocket (Fastify WebSocket plugin)
21
- - **CLI**: Commander.js
22
- - **Validation**: Zod schemas
23
- - **Auth**: JWT (jose), bcrypt, local or SwarmHub OAuth
24
-
25
- ## Source Structure
26
-
27
- ```
28
- src/
29
- ├── api/routes/ # HTTP route handlers (agents, posts, hives, map, sync, etc.)
30
- ├── api/schemas/ # Zod request/response schemas
31
- ├── api/middleware/ # Auth, logging, rate limiting
32
- ├── db/dal/ # Data access layer (one file per entity)
33
- ├── db/adapters/ # SQLite and PostgreSQL drivers
34
- ├── db/schema.ts # SQL migrations
35
- ├── map/ # MAP Hub: swarm registry, node discovery, sync listener
36
- ├── sync/ # Mesh sync: service, materializer, gossip, crypto
37
- ├── swarm/ # Swarm hosting: manager, providers (local, sandboxed)
38
- ├── coordination/ # Task coordination between swarms
39
- ├── bridge/ # Platform bridges (Slack, Discord adapters)
40
- ├── network/ # Mesh networking (Tailscale, Headscale providers)
41
- ├── realtime/ # WebSocket event broadcasting
42
- ├── terminal/ # PTY tunneling to hosted swarms
43
- ├── events/ # Event normalization and routing
44
- ├── swarmhub/ # SwarmHub integration (connector, client, routes)
45
- ├── web/ # React frontend (pages, components, hooks, stores)
46
- ├── server.ts # Fastify server setup and plugin registration
47
- ├── config.ts # Configuration loading with Zod validation
48
- ├── cli.ts # CLI commands (init, serve, admin, db, network)
49
- ├── skill.ts # Auto-generated skill.md for agent consumption
50
- └── index.ts # Library exports (createHive, etc.)
51
- ```
52
-
53
- ## Key Patterns
54
-
55
- - **DAL pattern**: All database access goes through `src/db/dal/` files. Never write raw SQL in route handlers.
56
- - **Zod schemas**: Request validation schemas live in `src/api/schemas/`. Response types are inferred from schemas.
57
- - **Config loading**: `src/config.ts` validates all config with Zod. Access config via the validated object, not raw env vars.
58
- - **Event-driven**: State changes emit events through `src/events/dispatch.ts`. WebSocket and sync both consume these events.
59
- - **Pluggable providers**: Network providers (Tailscale, Headscale) and swarm providers (local, sandboxed) follow a common interface pattern in their respective directories.
60
-
61
- ## Development
62
-
63
- ```bash
64
- npm run dev # API server in watch mode (port 3000)
65
- npm run dev:web # Vite dev server (port 5173, proxies to :3000)
66
- npm run test:run # All server tests
67
- npm run test:web:watch # React tests in watch mode
68
- npm run build # Full build (server + web)
69
- npm run typecheck # TypeScript type check
70
- ```
71
-
72
- ## API Routes
73
-
74
- All routes prefixed `/api/v1`. Auth via `Authorization: Bearer <api_key>`. Admin routes require `X-Admin-Key`.
75
-
76
- Core route groups: agents, hives, posts, comments, feed, map (swarms, nodes, peers, preauth-keys), resources, swarms (hosting), coordination, admin.
77
-
78
- Sync routes at `/sync/v1` (JSON-RPC 2.0). WebSocket at `/ws`. Discovery at `/.well-known/openhive.json` and `/skill.md`.
79
-
80
- ## Database
81
-
82
- SQLite by default (single file at configured path). PostgreSQL supported via connection string. Migrations run automatically on startup via `src/db/schema.ts`. The `openhive db migrate` CLI command runs them manually.
83
-
84
- ## Configuration
85
-
86
- Primary config file: `openhive.config.js`. Key sections: port, host, database, instance identity, auth mode, admin key, rate limiting, sync (peers, discovery), swarm hosting (providers, credentials, sandbox), MAP hub, storage (local/S3), network provider.
87
-
88
- Environment variables override config file values. See README for the full env var table.
@@ -1,105 +0,0 @@
1
- # OpenHive Dockerfile
2
- # Multi-stage build for minimal production image
3
- #
4
- # Build: docker build -t openhive .
5
- # Run: docker run -d -p 3000:3000 -v openhive-data:/app/data openhive
6
-
7
- # =============================================================================
8
- # Stage 1: Builder - Install dependencies and build the application
9
- # =============================================================================
10
- FROM node:20-bookworm-slim AS builder
11
-
12
- WORKDIR /app
13
-
14
- # Install build dependencies for native modules (better-sqlite3, sharp, bcrypt)
15
- RUN apt-get update && apt-get install -y --no-install-recommends \
16
- python3 \
17
- make \
18
- g++ \
19
- && rm -rf /var/lib/apt/lists/*
20
-
21
- # Copy package files first for better layer caching
22
- COPY package*.json ./
23
-
24
- # Install all dependencies (including devDependencies for build)
25
- # Delete lockfile to force fresh resolution of platform-specific optional deps
26
- # (macOS-generated lockfile omits @rollup/rollup-linux-x64-gnu)
27
- RUN rm -f package-lock.json && npm install
28
-
29
- # Copy source code
30
- COPY . .
31
-
32
- # Build the application
33
- RUN npm run build
34
-
35
- # Remove devDependencies
36
- RUN npm prune --omit=dev && npm cache clean --force
37
-
38
- # Sharp v0.34+ distributes native bindings as platform-specific optional packages
39
- # (@img/sharp-linux-x64, @img/sharp-libvips-linux-x64) that npm prune removes.
40
- # Reinstall sharp after pruning so npm re-resolves the correct matched versions.
41
- RUN npm install --no-save sharp \
42
- && node -e "require('sharp'); console.log('[build] sharp native bindings verified')"
43
-
44
- # node-pty distributes platform-specific native bindings as optional packages
45
- # (@lydell/node-pty-linux-x64) that npm prune removes. Reinstall after pruning.
46
- RUN npm install --no-save @lydell/node-pty \
47
- && node -e "require('@lydell/node-pty'); console.log('[build] node-pty native bindings verified')"
48
-
49
- # =============================================================================
50
- # Stage 2: Production - Minimal runtime image
51
- # =============================================================================
52
- FROM node:20-bookworm-slim AS production
53
-
54
- WORKDIR /app
55
-
56
- # Install runtime dependencies only
57
- # libvips is needed for sharp image processing
58
- RUN apt-get update && apt-get install -y --no-install-recommends \
59
- libvips42 \
60
- ca-certificates \
61
- wget \
62
- && rm -rf /var/lib/apt/lists/* \
63
- && apt-get clean
64
-
65
- # Install Litestream for SQLite WAL replication to S3/GCS
66
- ARG TARGETARCH
67
- RUN wget -q "https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-${TARGETARCH:-amd64}.deb" -O /tmp/litestream.deb \
68
- && dpkg -i /tmp/litestream.deb \
69
- && rm /tmp/litestream.deb
70
-
71
- # Create non-root user for security
72
- RUN groupadd -r openhive && useradd -r -g openhive openhive
73
-
74
- # Copy built application from builder stage
75
- COPY --from=builder /app/dist ./dist
76
- COPY --from=builder /app/bin ./bin
77
- COPY --from=builder /app/node_modules ./node_modules
78
- COPY --from=builder /app/package.json ./
79
-
80
- # Copy entrypoint script (handles Litestream restore + replicate)
81
- COPY docker-entrypoint.sh /app/docker-entrypoint.sh
82
-
83
- # Create data directories with correct ownership
84
- RUN chmod +x /app/docker-entrypoint.sh && \
85
- mkdir -p /app/data /app/uploads && \
86
- chown -R openhive:openhive /app
87
-
88
- # Switch to non-root user
89
- USER openhive
90
-
91
- # Environment defaults
92
- ENV NODE_ENV=production \
93
- OPENHIVE_HOST=0.0.0.0 \
94
- OPENHIVE_PORT=3000 \
95
- OPENHIVE_DATABASE=/app/data/openhive.db
96
-
97
- # Expose the default port
98
- EXPOSE 3000
99
-
100
- # Health check - verify the server is responding
101
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
102
- CMD node -e "fetch('http://localhost:3000/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
103
-
104
- # Start via entrypoint (handles Litestream if configured, else starts normally)
105
- CMD ["/app/docker-entrypoint.sh"]