claude-code-swarm 0.3.2 → 0.3.4

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 (1129) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CLAUDE.md +4 -0
  4. package/README.md +65 -0
  5. package/package.json +4 -4
  6. package/src/__tests__/config.test.mjs +128 -0
  7. package/src/__tests__/index.test.mjs +2 -0
  8. package/src/__tests__/paths.test.mjs +13 -0
  9. package/src/config.mjs +46 -16
  10. package/src/index.mjs +3 -1
  11. package/src/map-connection.mjs +3 -3
  12. package/src/paths.mjs +5 -0
  13. package/src/sidecar-client.mjs +2 -2
  14. package/references/multi-agent-protocol/.sudocode/issues.jsonl +0 -120
  15. package/references/multi-agent-protocol/.sudocode/specs.jsonl +0 -15
  16. package/references/multi-agent-protocol/LICENSE +0 -21
  17. package/references/multi-agent-protocol/README.md +0 -113
  18. package/references/multi-agent-protocol/docs/00-design-specification.md +0 -496
  19. package/references/multi-agent-protocol/docs/01-open-questions.md +0 -1050
  20. package/references/multi-agent-protocol/docs/02-wire-protocol.md +0 -296
  21. package/references/multi-agent-protocol/docs/03-streaming-semantics.md +0 -252
  22. package/references/multi-agent-protocol/docs/04-error-handling.md +0 -231
  23. package/references/multi-agent-protocol/docs/05-connection-model.md +0 -244
  24. package/references/multi-agent-protocol/docs/06-visibility-permissions.md +0 -243
  25. package/references/multi-agent-protocol/docs/07-federation.md +0 -335
  26. package/references/multi-agent-protocol/docs/08-macro-agent-migration.md +0 -253
  27. package/references/multi-agent-protocol/docs/09-authentication.md +0 -748
  28. package/references/multi-agent-protocol/docs/10-environment-awareness.md +0 -242
  29. package/references/multi-agent-protocol/docs/10-mail-protocol.md +0 -553
  30. package/references/multi-agent-protocol/docs/11-anp-inspired-improvements.md +0 -1079
  31. package/references/multi-agent-protocol/docs/11-trajectory-protocol.md +0 -292
  32. package/references/multi-agent-protocol/docs/12-anp-implementation-plan.md +0 -641
  33. package/references/multi-agent-protocol/docs/agent-iam-integration.md +0 -877
  34. package/references/multi-agent-protocol/docs/agentic-mesh-integration-draft.md +0 -459
  35. package/references/multi-agent-protocol/docs/git-transport-draft.md +0 -251
  36. package/references/multi-agent-protocol/docs-site/Gemfile +0 -22
  37. package/references/multi-agent-protocol/docs-site/README.md +0 -82
  38. package/references/multi-agent-protocol/docs-site/_config.yml +0 -91
  39. package/references/multi-agent-protocol/docs-site/_includes/head_custom.html +0 -20
  40. package/references/multi-agent-protocol/docs-site/_sass/color_schemes/map.scss +0 -42
  41. package/references/multi-agent-protocol/docs-site/_sass/custom/custom.scss +0 -34
  42. package/references/multi-agent-protocol/docs-site/examples/full-integration.md +0 -510
  43. package/references/multi-agent-protocol/docs-site/examples/index.md +0 -138
  44. package/references/multi-agent-protocol/docs-site/examples/simple-chat.md +0 -282
  45. package/references/multi-agent-protocol/docs-site/examples/task-queue.md +0 -399
  46. package/references/multi-agent-protocol/docs-site/getting-started/index.md +0 -98
  47. package/references/multi-agent-protocol/docs-site/getting-started/installation.md +0 -219
  48. package/references/multi-agent-protocol/docs-site/getting-started/overview.md +0 -172
  49. package/references/multi-agent-protocol/docs-site/getting-started/quickstart.md +0 -237
  50. package/references/multi-agent-protocol/docs-site/index.md +0 -136
  51. package/references/multi-agent-protocol/docs-site/protocol/authentication.md +0 -391
  52. package/references/multi-agent-protocol/docs-site/protocol/connection-model.md +0 -376
  53. package/references/multi-agent-protocol/docs-site/protocol/design.md +0 -284
  54. package/references/multi-agent-protocol/docs-site/protocol/error-handling.md +0 -312
  55. package/references/multi-agent-protocol/docs-site/protocol/federation.md +0 -449
  56. package/references/multi-agent-protocol/docs-site/protocol/index.md +0 -129
  57. package/references/multi-agent-protocol/docs-site/protocol/permissions.md +0 -398
  58. package/references/multi-agent-protocol/docs-site/protocol/streaming.md +0 -353
  59. package/references/multi-agent-protocol/docs-site/protocol/wire-protocol.md +0 -369
  60. package/references/multi-agent-protocol/docs-site/sdk/api/agent.md +0 -357
  61. package/references/multi-agent-protocol/docs-site/sdk/api/client.md +0 -380
  62. package/references/multi-agent-protocol/docs-site/sdk/api/index.md +0 -62
  63. package/references/multi-agent-protocol/docs-site/sdk/api/server.md +0 -453
  64. package/references/multi-agent-protocol/docs-site/sdk/api/types.md +0 -468
  65. package/references/multi-agent-protocol/docs-site/sdk/guides/agent.md +0 -375
  66. package/references/multi-agent-protocol/docs-site/sdk/guides/authentication.md +0 -405
  67. package/references/multi-agent-protocol/docs-site/sdk/guides/client.md +0 -352
  68. package/references/multi-agent-protocol/docs-site/sdk/guides/index.md +0 -89
  69. package/references/multi-agent-protocol/docs-site/sdk/guides/server.md +0 -360
  70. package/references/multi-agent-protocol/docs-site/sdk/guides/testing.md +0 -446
  71. package/references/multi-agent-protocol/docs-site/sdk/guides/transports.md +0 -363
  72. package/references/multi-agent-protocol/docs-site/sdk/index.md +0 -206
  73. package/references/multi-agent-protocol/package-lock.json +0 -4230
  74. package/references/multi-agent-protocol/package.json +0 -56
  75. package/references/multi-agent-protocol/schema/meta.json +0 -584
  76. package/references/multi-agent-protocol/schema/schema.json +0 -3067
  77. package/references/openhive/.claude/settings.json +0 -6
  78. package/references/openhive/.dockerignore +0 -54
  79. package/references/openhive/.github/workflows/docker.yml +0 -52
  80. package/references/openhive/.sudocode/issues.jsonl +0 -24
  81. package/references/openhive/.sudocode/specs.jsonl +0 -4
  82. package/references/openhive/CLAUDE.md +0 -88
  83. package/references/openhive/Dockerfile +0 -105
  84. package/references/openhive/README.md +0 -745
  85. package/references/openhive/bin/openhive.js +0 -6
  86. package/references/openhive/cloudbuild.yaml +0 -80
  87. package/references/openhive/deploy/cloud-run.sh +0 -106
  88. package/references/openhive/deploy/openhive.env.example +0 -80
  89. package/references/openhive/deploy/openhive.service +0 -91
  90. package/references/openhive/docker-compose.yml +0 -67
  91. package/references/openhive/docker-entrypoint.sh +0 -117
  92. package/references/openhive/docs/API_MIGRATION.md +0 -176
  93. package/references/openhive/docs/DEPLOYMENT.md +0 -847
  94. package/references/openhive/docs/DESIGN_v1.md +0 -489
  95. package/references/openhive/docs/DESIGN_v2.md +0 -564
  96. package/references/openhive/docs/HEADSCALE_HOSTING_SPEC.md +0 -513
  97. package/references/openhive/docs/HIVE_SYNC_DESIGN.md +0 -2362
  98. package/references/openhive/docs/HIVE_SYNC_IMPLEMENTATION_PLAN.md +0 -1169
  99. package/references/openhive/docs/HOSTING.md +0 -601
  100. package/references/openhive/docs/IMPLEMENTATION_PLAN.md +0 -428
  101. package/references/openhive/docs/LOCAL_SETUP.md +0 -506
  102. package/references/openhive/docs/MACRO_AGENT_ATLAS_EXTENSION.md +0 -351
  103. package/references/openhive/docs/MEMORY_BANK_SYNC_SPEC.md +0 -909
  104. package/references/openhive/docs/PLAN_v1.md +0 -471
  105. package/references/openhive/docs/PLAN_v2.md +0 -623
  106. package/references/openhive/docs/WEBSOCKET.md +0 -267
  107. package/references/openhive/docs/openswarm-bootstrap-token-spec.md +0 -240
  108. package/references/openhive/ecosystem.config.cjs +0 -76
  109. package/references/openhive/fly.toml +0 -63
  110. package/references/openhive/package-lock.json +0 -17640
  111. package/references/openhive/package.json +0 -128
  112. package/references/openhive/packages/openhive-types/package-lock.json +0 -1473
  113. package/references/openhive/packages/openhive-types/package.json +0 -42
  114. package/references/openhive/packages/openhive-types/src/index.ts +0 -36
  115. package/references/openhive/packages/openhive-types/src/map-coordination.ts +0 -92
  116. package/references/openhive/packages/openhive-types/src/map-session-sync.ts +0 -50
  117. package/references/openhive/packages/openhive-types/src/map-sync.ts +0 -68
  118. package/references/openhive/packages/openhive-types/tsconfig.json +0 -15
  119. package/references/openhive/packages/openhive-types/tsconfig.tsbuildinfo +0 -1
  120. package/references/openhive/packages/openhive-types/tsup.config.ts +0 -12
  121. package/references/openhive/railway.json +0 -13
  122. package/references/openhive/railway.toml +0 -24
  123. package/references/openhive/render.yaml +0 -51
  124. package/references/openhive/src/__tests__/auth.test.ts +0 -148
  125. package/references/openhive/src/__tests__/bridge/credentials.test.ts +0 -65
  126. package/references/openhive/src/__tests__/bridge/dal.test.ts +0 -279
  127. package/references/openhive/src/__tests__/bridge/inbound.test.ts +0 -349
  128. package/references/openhive/src/__tests__/bridge/manager.test.ts +0 -419
  129. package/references/openhive/src/__tests__/bridge/mentions.test.ts +0 -83
  130. package/references/openhive/src/__tests__/bridge/outbound.test.ts +0 -209
  131. package/references/openhive/src/__tests__/bridge/slack-adapter.test.ts +0 -276
  132. package/references/openhive/src/__tests__/cli.test.ts +0 -342
  133. package/references/openhive/src/__tests__/config.test.ts +0 -205
  134. package/references/openhive/src/__tests__/coordination/coordination.test.ts +0 -1072
  135. package/references/openhive/src/__tests__/coordination/cross-instance.test.ts +0 -540
  136. package/references/openhive/src/__tests__/coordination/e2e.test.ts +0 -780
  137. package/references/openhive/src/__tests__/data-dir.test.ts +0 -332
  138. package/references/openhive/src/__tests__/db.test.ts +0 -258
  139. package/references/openhive/src/__tests__/discovery.test.ts +0 -288
  140. package/references/openhive/src/__tests__/events/dal.test.ts +0 -371
  141. package/references/openhive/src/__tests__/events/dispatch.test.ts +0 -202
  142. package/references/openhive/src/__tests__/events/e2e.test.ts +0 -528
  143. package/references/openhive/src/__tests__/events/normalizers.test.ts +0 -263
  144. package/references/openhive/src/__tests__/events/router.test.ts +0 -314
  145. package/references/openhive/src/__tests__/events/routes.test.ts +0 -407
  146. package/references/openhive/src/__tests__/follows.test.ts +0 -328
  147. package/references/openhive/src/__tests__/helpers/test-dirs.ts +0 -44
  148. package/references/openhive/src/__tests__/ingest-keys.test.ts +0 -925
  149. package/references/openhive/src/__tests__/map/sync-client-content.test.ts +0 -288
  150. package/references/openhive/src/__tests__/map/sync-client.test.ts +0 -500
  151. package/references/openhive/src/__tests__/map/sync-listener.test.ts +0 -504
  152. package/references/openhive/src/__tests__/middleware/hostname-guard.test.ts +0 -73
  153. package/references/openhive/src/__tests__/migrations.test.ts +0 -260
  154. package/references/openhive/src/__tests__/opentasks/client.test.ts +0 -497
  155. package/references/openhive/src/__tests__/opentasks/discovery.test.ts +0 -283
  156. package/references/openhive/src/__tests__/opentasks/e2e.test.ts +0 -767
  157. package/references/openhive/src/__tests__/routes/agents.test.ts +0 -417
  158. package/references/openhive/src/__tests__/routes/opentasks-content.test.ts +0 -493
  159. package/references/openhive/src/__tests__/routes/resource-content.test.ts +0 -1741
  160. package/references/openhive/src/__tests__/sessions/adapters.test.ts +0 -524
  161. package/references/openhive/src/__tests__/sessions/routes.test.ts +0 -1053
  162. package/references/openhive/src/__tests__/sessions/storage.test.ts +0 -545
  163. package/references/openhive/src/__tests__/sessions/trajectory-checkpoints.test.ts +0 -349
  164. package/references/openhive/src/__tests__/sessions/trajectory-routes.test.ts +0 -290
  165. package/references/openhive/src/__tests__/swarm/config.test.ts +0 -125
  166. package/references/openhive/src/__tests__/swarm/credentials.test.ts +0 -254
  167. package/references/openhive/src/__tests__/swarm/dal.test.ts +0 -290
  168. package/references/openhive/src/__tests__/swarm/e2e.test.ts +0 -827
  169. package/references/openhive/src/__tests__/swarm/fixtures/exit-immediately.js +0 -3
  170. package/references/openhive/src/__tests__/swarm/fixtures/map-server.js +0 -147
  171. package/references/openhive/src/__tests__/swarm/fixtures/sleep-server.js +0 -52
  172. package/references/openhive/src/__tests__/swarm/local-provider.test.ts +0 -279
  173. package/references/openhive/src/__tests__/swarm/manager.test.ts +0 -305
  174. package/references/openhive/src/__tests__/swarm/routes.test.ts +0 -396
  175. package/references/openhive/src/__tests__/swarm/workspace.test.ts +0 -257
  176. package/references/openhive/src/__tests__/swarmhub/client.test.ts +0 -324
  177. package/references/openhive/src/__tests__/swarmhub/config.test.ts +0 -213
  178. package/references/openhive/src/__tests__/swarmhub/connector.test.ts +0 -581
  179. package/references/openhive/src/__tests__/swarmhub/routes.test.ts +0 -639
  180. package/references/openhive/src/__tests__/swarmhub/slack-client.test.ts +0 -164
  181. package/references/openhive/src/__tests__/swarmhub/slack-connector.test.ts +0 -164
  182. package/references/openhive/src/__tests__/swarmhub/slack-routes.test.ts +0 -373
  183. package/references/openhive/src/__tests__/swarmhub/webhook-handler.test.ts +0 -295
  184. package/references/openhive/src/__tests__/sync/resource-sync.test.ts +0 -1418
  185. package/references/openhive/src/__tests__/sync/sync.test.ts +0 -800
  186. package/references/openhive/src/api/index.ts +0 -65
  187. package/references/openhive/src/api/middleware/auth.ts +0 -227
  188. package/references/openhive/src/api/middleware/hostname-guard.ts +0 -38
  189. package/references/openhive/src/api/routes/admin.ts +0 -366
  190. package/references/openhive/src/api/routes/agents.ts +0 -223
  191. package/references/openhive/src/api/routes/auth.ts +0 -164
  192. package/references/openhive/src/api/routes/bridges.ts +0 -384
  193. package/references/openhive/src/api/routes/comments.ts +0 -294
  194. package/references/openhive/src/api/routes/coordination.ts +0 -312
  195. package/references/openhive/src/api/routes/events.ts +0 -158
  196. package/references/openhive/src/api/routes/federation.ts +0 -367
  197. package/references/openhive/src/api/routes/feed.ts +0 -212
  198. package/references/openhive/src/api/routes/hives.ts +0 -264
  199. package/references/openhive/src/api/routes/map.ts +0 -674
  200. package/references/openhive/src/api/routes/memory-banks.ts +0 -971
  201. package/references/openhive/src/api/routes/posts.ts +0 -342
  202. package/references/openhive/src/api/routes/resource-content.ts +0 -727
  203. package/references/openhive/src/api/routes/resources.ts +0 -1013
  204. package/references/openhive/src/api/routes/search.ts +0 -45
  205. package/references/openhive/src/api/routes/sessions.ts +0 -1187
  206. package/references/openhive/src/api/routes/swarm-hosting.ts +0 -313
  207. package/references/openhive/src/api/routes/sync-protocol.ts +0 -168
  208. package/references/openhive/src/api/routes/sync.ts +0 -279
  209. package/references/openhive/src/api/routes/uploads.ts +0 -174
  210. package/references/openhive/src/api/routes/webhooks.ts +0 -603
  211. package/references/openhive/src/api/schemas/agents.ts +0 -26
  212. package/references/openhive/src/api/schemas/comments.ts +0 -22
  213. package/references/openhive/src/api/schemas/hives.ts +0 -33
  214. package/references/openhive/src/api/schemas/posts.ts +0 -37
  215. package/references/openhive/src/api/schemas/sync.ts +0 -56
  216. package/references/openhive/src/auth/index.ts +0 -2
  217. package/references/openhive/src/auth/jwks.ts +0 -58
  218. package/references/openhive/src/bridge/adapters/slack.ts +0 -306
  219. package/references/openhive/src/bridge/credentials.ts +0 -72
  220. package/references/openhive/src/bridge/inbound.ts +0 -288
  221. package/references/openhive/src/bridge/index.ts +0 -42
  222. package/references/openhive/src/bridge/manager.ts +0 -425
  223. package/references/openhive/src/bridge/mentions.ts +0 -42
  224. package/references/openhive/src/bridge/outbound.ts +0 -103
  225. package/references/openhive/src/bridge/schema.ts +0 -82
  226. package/references/openhive/src/bridge/types.ts +0 -238
  227. package/references/openhive/src/cli/network.ts +0 -480
  228. package/references/openhive/src/cli.ts +0 -620
  229. package/references/openhive/src/config.ts +0 -611
  230. package/references/openhive/src/coordination/index.ts +0 -43
  231. package/references/openhive/src/coordination/listener.ts +0 -92
  232. package/references/openhive/src/coordination/schema.ts +0 -79
  233. package/references/openhive/src/coordination/service.ts +0 -233
  234. package/references/openhive/src/coordination/types.ts +0 -177
  235. package/references/openhive/src/data-dir.ts +0 -105
  236. package/references/openhive/src/db/adapters/index.ts +0 -21
  237. package/references/openhive/src/db/adapters/postgres.ts +0 -310
  238. package/references/openhive/src/db/adapters/sqlite.ts +0 -56
  239. package/references/openhive/src/db/adapters/types.ts +0 -65
  240. package/references/openhive/src/db/dal/agents.ts +0 -430
  241. package/references/openhive/src/db/dal/bridge.ts +0 -336
  242. package/references/openhive/src/db/dal/comments.ts +0 -213
  243. package/references/openhive/src/db/dal/coordination.ts +0 -361
  244. package/references/openhive/src/db/dal/events.ts +0 -381
  245. package/references/openhive/src/db/dal/follows.ts +0 -96
  246. package/references/openhive/src/db/dal/hives.ts +0 -198
  247. package/references/openhive/src/db/dal/ingest-keys.ts +0 -176
  248. package/references/openhive/src/db/dal/instances.ts +0 -196
  249. package/references/openhive/src/db/dal/invites.ts +0 -123
  250. package/references/openhive/src/db/dal/map.ts +0 -750
  251. package/references/openhive/src/db/dal/posts.ts +0 -274
  252. package/references/openhive/src/db/dal/remote-agents.ts +0 -56
  253. package/references/openhive/src/db/dal/search.ts +0 -238
  254. package/references/openhive/src/db/dal/sync-events.ts +0 -160
  255. package/references/openhive/src/db/dal/sync-groups.ts +0 -100
  256. package/references/openhive/src/db/dal/sync-peer-configs.ts +0 -216
  257. package/references/openhive/src/db/dal/sync-peers.ts +0 -145
  258. package/references/openhive/src/db/dal/syncable-resources.ts +0 -888
  259. package/references/openhive/src/db/dal/trajectory-checkpoints.ts +0 -291
  260. package/references/openhive/src/db/dal/uploads.ts +0 -124
  261. package/references/openhive/src/db/dal/votes.ts +0 -124
  262. package/references/openhive/src/db/index.ts +0 -293
  263. package/references/openhive/src/db/providers/index.ts +0 -75
  264. package/references/openhive/src/db/providers/postgres.ts +0 -529
  265. package/references/openhive/src/db/providers/sqlite.ts +0 -1383
  266. package/references/openhive/src/db/providers/turso.ts +0 -1360
  267. package/references/openhive/src/db/providers/types.ts +0 -516
  268. package/references/openhive/src/db/schema.ts +0 -641
  269. package/references/openhive/src/discovery/index.ts +0 -403
  270. package/references/openhive/src/events/dispatch.ts +0 -106
  271. package/references/openhive/src/events/index.ts +0 -17
  272. package/references/openhive/src/events/normalizers/github.ts +0 -133
  273. package/references/openhive/src/events/normalizers/index.ts +0 -62
  274. package/references/openhive/src/events/normalizers/slack.ts +0 -50
  275. package/references/openhive/src/events/router.ts +0 -156
  276. package/references/openhive/src/events/schema.ts +0 -66
  277. package/references/openhive/src/events/types.ts +0 -130
  278. package/references/openhive/src/federation/index.ts +0 -1
  279. package/references/openhive/src/federation/service.ts +0 -776
  280. package/references/openhive/src/headscale/client.ts +0 -256
  281. package/references/openhive/src/headscale/config.ts +0 -212
  282. package/references/openhive/src/headscale/index.ts +0 -23
  283. package/references/openhive/src/headscale/manager.ts +0 -249
  284. package/references/openhive/src/headscale/sync.ts +0 -272
  285. package/references/openhive/src/headscale/types.ts +0 -231
  286. package/references/openhive/src/index.ts +0 -225
  287. package/references/openhive/src/map/client-entry.ts +0 -26
  288. package/references/openhive/src/map/index.ts +0 -76
  289. package/references/openhive/src/map/schema.ts +0 -119
  290. package/references/openhive/src/map/service.ts +0 -323
  291. package/references/openhive/src/map/sync-client.ts +0 -696
  292. package/references/openhive/src/map/sync-listener.ts +0 -409
  293. package/references/openhive/src/map/types.ts +0 -290
  294. package/references/openhive/src/network/factory.ts +0 -118
  295. package/references/openhive/src/network/headscale-provider.ts +0 -437
  296. package/references/openhive/src/network/index.ts +0 -43
  297. package/references/openhive/src/network/tailscale-client.ts +0 -289
  298. package/references/openhive/src/network/tailscale-provider.ts +0 -287
  299. package/references/openhive/src/network/types.ts +0 -178
  300. package/references/openhive/src/opentasks-client/client.ts +0 -374
  301. package/references/openhive/src/opentasks-client/index.ts +0 -7
  302. package/references/openhive/src/realtime/index.ts +0 -282
  303. package/references/openhive/src/server.ts +0 -1069
  304. package/references/openhive/src/services/email.ts +0 -177
  305. package/references/openhive/src/services/sitemap.ts +0 -135
  306. package/references/openhive/src/sessions/adapters/claude.ts +0 -466
  307. package/references/openhive/src/sessions/adapters/codex.ts +0 -265
  308. package/references/openhive/src/sessions/adapters/index.ts +0 -263
  309. package/references/openhive/src/sessions/adapters/raw.ts +0 -144
  310. package/references/openhive/src/sessions/adapters/types.ts +0 -83
  311. package/references/openhive/src/sessions/index.ts +0 -50
  312. package/references/openhive/src/sessions/storage/adapters/gcs.ts +0 -277
  313. package/references/openhive/src/sessions/storage/adapters/local.ts +0 -240
  314. package/references/openhive/src/sessions/storage/adapters/s3.ts +0 -321
  315. package/references/openhive/src/sessions/storage/index.ts +0 -231
  316. package/references/openhive/src/sessions/storage/types.ts +0 -189
  317. package/references/openhive/src/sessions/types.ts +0 -415
  318. package/references/openhive/src/shared/types/index.ts +0 -45
  319. package/references/openhive/src/shared/types/map-coordination.ts +0 -92
  320. package/references/openhive/src/shared/types/map-session-sync.ts +0 -170
  321. package/references/openhive/src/shared/types/map-sync.ts +0 -68
  322. package/references/openhive/src/skill.ts +0 -203
  323. package/references/openhive/src/storage/adapters/local.ts +0 -169
  324. package/references/openhive/src/storage/adapters/s3.ts +0 -195
  325. package/references/openhive/src/storage/index.ts +0 -64
  326. package/references/openhive/src/storage/types.ts +0 -69
  327. package/references/openhive/src/swarm/credentials.ts +0 -98
  328. package/references/openhive/src/swarm/dal.ts +0 -206
  329. package/references/openhive/src/swarm/index.ts +0 -28
  330. package/references/openhive/src/swarm/manager.ts +0 -917
  331. package/references/openhive/src/swarm/providers/local.ts +0 -338
  332. package/references/openhive/src/swarm/providers/sandboxed-local.ts +0 -478
  333. package/references/openhive/src/swarm/providers/workspace.ts +0 -52
  334. package/references/openhive/src/swarm/schema.ts +0 -43
  335. package/references/openhive/src/swarm/types.ts +0 -333
  336. package/references/openhive/src/swarmhub/client.ts +0 -279
  337. package/references/openhive/src/swarmhub/connector.ts +0 -463
  338. package/references/openhive/src/swarmhub/index.ts +0 -43
  339. package/references/openhive/src/swarmhub/routes.ts +0 -296
  340. package/references/openhive/src/swarmhub/types.ts +0 -213
  341. package/references/openhive/src/swarmhub/webhook-handler.ts +0 -126
  342. package/references/openhive/src/sync/compaction.ts +0 -193
  343. package/references/openhive/src/sync/coordination-hooks.ts +0 -154
  344. package/references/openhive/src/sync/crypto.ts +0 -79
  345. package/references/openhive/src/sync/gossip.ts +0 -136
  346. package/references/openhive/src/sync/hooks.ts +0 -202
  347. package/references/openhive/src/sync/materializer-repo.ts +0 -256
  348. package/references/openhive/src/sync/materializer.ts +0 -682
  349. package/references/openhive/src/sync/middleware.ts +0 -140
  350. package/references/openhive/src/sync/peer-resolver.ts +0 -157
  351. package/references/openhive/src/sync/resource-hooks.ts +0 -161
  352. package/references/openhive/src/sync/schema.ts +0 -158
  353. package/references/openhive/src/sync/service.ts +0 -990
  354. package/references/openhive/src/sync/types.ts +0 -369
  355. package/references/openhive/src/terminal/index.ts +0 -4
  356. package/references/openhive/src/terminal/pty-manager.ts +0 -337
  357. package/references/openhive/src/terminal/resolve-tui.ts +0 -44
  358. package/references/openhive/src/terminal/terminal-ws.ts +0 -251
  359. package/references/openhive/src/types.ts +0 -442
  360. package/references/openhive/src/utils/git-remote.ts +0 -329
  361. package/references/openhive/src/web/App.tsx +0 -77
  362. package/references/openhive/src/web/__tests__/components/dashboard/RecentActivity.test.tsx +0 -77
  363. package/references/openhive/src/web/__tests__/components/dashboard/StatsOverview.test.tsx +0 -62
  364. package/references/openhive/src/web/__tests__/components/dashboard/SwarmStatusSummary.test.tsx +0 -122
  365. package/references/openhive/src/web/__tests__/components/dashboard/SyncResourcesStatus.test.tsx +0 -104
  366. package/references/openhive/src/web/__tests__/components/layout/Sidebar.test.tsx +0 -110
  367. package/references/openhive/src/web/__tests__/components/swarm/StatusBadges.test.tsx +0 -65
  368. package/references/openhive/src/web/__tests__/components/terminal/query-responses.test.ts +0 -143
  369. package/references/openhive/src/web/__tests__/components/terminal/terminal-mouse.test.ts +0 -509
  370. package/references/openhive/src/web/__tests__/hooks/useEventsApi.test.ts +0 -378
  371. package/references/openhive/src/web/__tests__/pages/Dashboard.test.tsx +0 -57
  372. package/references/openhive/src/web/__tests__/pages/Events.test.tsx +0 -886
  373. package/references/openhive/src/web/__tests__/pages/Explore.test.tsx +0 -63
  374. package/references/openhive/src/web/__tests__/routing.test.tsx +0 -79
  375. package/references/openhive/src/web/__tests__/setup.ts +0 -37
  376. package/references/openhive/src/web/__tests__/stores/dashboard.test.ts +0 -49
  377. package/references/openhive/src/web/components/common/AgentBadge.tsx +0 -58
  378. package/references/openhive/src/web/components/common/Avatar.tsx +0 -78
  379. package/references/openhive/src/web/components/common/ErrorBoundary.tsx +0 -76
  380. package/references/openhive/src/web/components/common/Highlight.tsx +0 -79
  381. package/references/openhive/src/web/components/common/ImageUpload.tsx +0 -209
  382. package/references/openhive/src/web/components/common/LoadingSpinner.tsx +0 -37
  383. package/references/openhive/src/web/components/common/Logo.tsx +0 -21
  384. package/references/openhive/src/web/components/common/Markdown.tsx +0 -53
  385. package/references/openhive/src/web/components/common/ProtectedRoute.tsx +0 -18
  386. package/references/openhive/src/web/components/common/ThemeToggle.tsx +0 -38
  387. package/references/openhive/src/web/components/common/TimeAgo.tsx +0 -17
  388. package/references/openhive/src/web/components/common/Toast.tsx +0 -70
  389. package/references/openhive/src/web/components/common/VoteButtons.tsx +0 -100
  390. package/references/openhive/src/web/components/dashboard/RecentActivity.tsx +0 -100
  391. package/references/openhive/src/web/components/dashboard/StatsOverview.tsx +0 -40
  392. package/references/openhive/src/web/components/dashboard/SwarmStatusSummary.tsx +0 -89
  393. package/references/openhive/src/web/components/dashboard/SyncResourcesStatus.tsx +0 -81
  394. package/references/openhive/src/web/components/feed/FeedControls.tsx +0 -38
  395. package/references/openhive/src/web/components/feed/NewPostsIndicator.tsx +0 -75
  396. package/references/openhive/src/web/components/feed/PostCard.tsx +0 -129
  397. package/references/openhive/src/web/components/feed/PostList.tsx +0 -83
  398. package/references/openhive/src/web/components/layout/Footer.tsx +0 -5
  399. package/references/openhive/src/web/components/layout/Layout.tsx +0 -29
  400. package/references/openhive/src/web/components/layout/Sidebar.tsx +0 -348
  401. package/references/openhive/src/web/components/post/CommentForm.tsx +0 -59
  402. package/references/openhive/src/web/components/post/CommentTree.tsx +0 -145
  403. package/references/openhive/src/web/components/resources/MemoryBrowser.tsx +0 -208
  404. package/references/openhive/src/web/components/resources/OpenTasksSummary.tsx +0 -138
  405. package/references/openhive/src/web/components/resources/SkillBrowser.tsx +0 -284
  406. package/references/openhive/src/web/components/swarm/StatusBadges.tsx +0 -56
  407. package/references/openhive/src/web/components/terminal/TerminalPanel.tsx +0 -485
  408. package/references/openhive/src/web/components/terminal/index.ts +0 -2
  409. package/references/openhive/src/web/components/terminal/query-responses.ts +0 -70
  410. package/references/openhive/src/web/components/terminal/terminal-mouse.ts +0 -222
  411. package/references/openhive/src/web/hooks/useApi.ts +0 -740
  412. package/references/openhive/src/web/hooks/useDocumentTitle.ts +0 -49
  413. package/references/openhive/src/web/hooks/useInfiniteScroll.ts +0 -58
  414. package/references/openhive/src/web/hooks/useRealtimeUpdates.ts +0 -154
  415. package/references/openhive/src/web/hooks/useWebSocket.ts +0 -225
  416. package/references/openhive/src/web/index.html +0 -73
  417. package/references/openhive/src/web/lib/api.ts +0 -518
  418. package/references/openhive/src/web/main.tsx +0 -32
  419. package/references/openhive/src/web/pages/About.tsx +0 -131
  420. package/references/openhive/src/web/pages/Agent.tsx +0 -130
  421. package/references/openhive/src/web/pages/Agents.tsx +0 -69
  422. package/references/openhive/src/web/pages/AuthCallback.tsx +0 -75
  423. package/references/openhive/src/web/pages/Dashboard.tsx +0 -41
  424. package/references/openhive/src/web/pages/Events.tsx +0 -1025
  425. package/references/openhive/src/web/pages/Explore.tsx +0 -43
  426. package/references/openhive/src/web/pages/Hive.tsx +0 -134
  427. package/references/openhive/src/web/pages/Hives.tsx +0 -64
  428. package/references/openhive/src/web/pages/Home.tsx +0 -43
  429. package/references/openhive/src/web/pages/Login.tsx +0 -122
  430. package/references/openhive/src/web/pages/Post.tsx +0 -216
  431. package/references/openhive/src/web/pages/ResourceDetail.tsx +0 -426
  432. package/references/openhive/src/web/pages/Resources.tsx +0 -276
  433. package/references/openhive/src/web/pages/Search.tsx +0 -234
  434. package/references/openhive/src/web/pages/SessionDetail.tsx +0 -703
  435. package/references/openhive/src/web/pages/Sessions.tsx +0 -129
  436. package/references/openhive/src/web/pages/Settings.tsx +0 -826
  437. package/references/openhive/src/web/pages/SwarmCraft.tsx +0 -16
  438. package/references/openhive/src/web/pages/Swarms.tsx +0 -981
  439. package/references/openhive/src/web/pages/Terminal.tsx +0 -69
  440. package/references/openhive/src/web/postcss.config.js +0 -5
  441. package/references/openhive/src/web/public/favicon.svg +0 -11
  442. package/references/openhive/src/web/public/manifest.json +0 -21
  443. package/references/openhive/src/web/stores/auth.ts +0 -207
  444. package/references/openhive/src/web/stores/dashboard.ts +0 -23
  445. package/references/openhive/src/web/stores/realtime.ts +0 -90
  446. package/references/openhive/src/web/stores/theme.ts +0 -70
  447. package/references/openhive/src/web/stores/toast.ts +0 -63
  448. package/references/openhive/src/web/styles/globals.css +0 -503
  449. package/references/openhive/src/web/sw.ts +0 -228
  450. package/references/openhive/src/web/utils/serviceWorker.ts +0 -86
  451. package/references/openhive/src/web/vite.config.ts +0 -81
  452. package/references/openhive/tsconfig.json +0 -32
  453. package/references/openhive/tsup.config.ts +0 -17
  454. package/references/openhive/vitest.config.ts +0 -30
  455. package/references/openhive/vitest.web.config.ts +0 -20
  456. package/references/opentasks/.claude/settings.json +0 -6
  457. package/references/opentasks/.claude-plugin/plugin.json +0 -20
  458. package/references/opentasks/.lintstagedrc.json +0 -4
  459. package/references/opentasks/.prettierignore +0 -4
  460. package/references/opentasks/.prettierrc.json +0 -11
  461. package/references/opentasks/.sudocode/issues.jsonl +0 -89
  462. package/references/opentasks/.sudocode/specs.jsonl +0 -24
  463. package/references/opentasks/README.md +0 -401
  464. package/references/opentasks/docs/ARCHITECTURE.md +0 -841
  465. package/references/opentasks/docs/DESIGN.md +0 -689
  466. package/references/opentasks/docs/INTERFACE.md +0 -670
  467. package/references/opentasks/docs/PERSISTENCE.md +0 -1638
  468. package/references/opentasks/docs/PROVIDERS.md +0 -1412
  469. package/references/opentasks/docs/SCHEMA.md +0 -815
  470. package/references/opentasks/docs/TESTING.md +0 -1081
  471. package/references/opentasks/eslint.config.js +0 -58
  472. package/references/opentasks/package-lock.json +0 -4348
  473. package/references/opentasks/package.json +0 -81
  474. package/references/opentasks/skills/opentasks/SKILL.md +0 -139
  475. package/references/opentasks/skills/opentasks/dependency-management.md +0 -119
  476. package/references/opentasks/skills/opentasks/feedback-and-review.md +0 -100
  477. package/references/opentasks/skills/opentasks/linking-external-data.md +0 -103
  478. package/references/opentasks/skills/opentasks/spec-to-implementation.md +0 -98
  479. package/references/opentasks/src/__tests__/cli-tools.test.ts +0 -800
  480. package/references/opentasks/src/__tests__/cli.test.ts +0 -97
  481. package/references/opentasks/src/__tests__/p1-p3-gaps.test.ts +0 -635
  482. package/references/opentasks/src/cli.ts +0 -929
  483. package/references/opentasks/src/client/__tests__/client-crud.test.ts +0 -546
  484. package/references/opentasks/src/client/__tests__/client.test.ts +0 -658
  485. package/references/opentasks/src/client/__tests__/socket-discovery.test.ts +0 -122
  486. package/references/opentasks/src/client/client.ts +0 -560
  487. package/references/opentasks/src/client/index.ts +0 -32
  488. package/references/opentasks/src/config/__tests__/defaults.test.ts +0 -66
  489. package/references/opentasks/src/config/__tests__/env.test.ts +0 -155
  490. package/references/opentasks/src/config/__tests__/index.test.ts +0 -148
  491. package/references/opentasks/src/config/__tests__/loader.test.ts +0 -173
  492. package/references/opentasks/src/config/__tests__/merge.test.ts +0 -121
  493. package/references/opentasks/src/config/__tests__/schema.test.ts +0 -446
  494. package/references/opentasks/src/config/defaults.ts +0 -18
  495. package/references/opentasks/src/config/env.ts +0 -170
  496. package/references/opentasks/src/config/errors.ts +0 -33
  497. package/references/opentasks/src/config/index.ts +0 -63
  498. package/references/opentasks/src/config/loader.ts +0 -90
  499. package/references/opentasks/src/config/merge.ts +0 -64
  500. package/references/opentasks/src/config/schema.ts +0 -767
  501. package/references/opentasks/src/core/__tests__/conditional-redirects.test.ts +0 -116
  502. package/references/opentasks/src/core/__tests__/connections.test.ts +0 -194
  503. package/references/opentasks/src/core/__tests__/hash.test.ts +0 -161
  504. package/references/opentasks/src/core/__tests__/id.test.ts +0 -175
  505. package/references/opentasks/src/core/__tests__/init.test.ts +0 -115
  506. package/references/opentasks/src/core/__tests__/location.test.ts +0 -94
  507. package/references/opentasks/src/core/__tests__/merge-driver.test.ts +0 -300
  508. package/references/opentasks/src/core/__tests__/redirects.test.ts +0 -169
  509. package/references/opentasks/src/core/__tests__/resolve-location-target.test.ts +0 -468
  510. package/references/opentasks/src/core/__tests__/uri.test.ts +0 -228
  511. package/references/opentasks/src/core/__tests__/worktree.test.ts +0 -160
  512. package/references/opentasks/src/core/conditional-redirects.ts +0 -100
  513. package/references/opentasks/src/core/connections.ts +0 -217
  514. package/references/opentasks/src/core/discover.ts +0 -195
  515. package/references/opentasks/src/core/hash.ts +0 -74
  516. package/references/opentasks/src/core/id.ts +0 -174
  517. package/references/opentasks/src/core/index.ts +0 -108
  518. package/references/opentasks/src/core/init.ts +0 -66
  519. package/references/opentasks/src/core/location.ts +0 -139
  520. package/references/opentasks/src/core/merge-driver.ts +0 -280
  521. package/references/opentasks/src/core/redirects.ts +0 -182
  522. package/references/opentasks/src/core/uri.ts +0 -270
  523. package/references/opentasks/src/core/worktree.ts +0 -504
  524. package/references/opentasks/src/daemon/__tests__/e2e-live-agent.test.ts +0 -344
  525. package/references/opentasks/src/daemon/__tests__/e2e-session-pipeline.test.ts +0 -447
  526. package/references/opentasks/src/daemon/__tests__/e2e-watch.test.ts +0 -279
  527. package/references/opentasks/src/daemon/__tests__/entire-linker.test.ts +0 -1074
  528. package/references/opentasks/src/daemon/__tests__/entire-watcher.test.ts +0 -659
  529. package/references/opentasks/src/daemon/__tests__/flush.test.ts +0 -306
  530. package/references/opentasks/src/daemon/__tests__/integration.test.ts +0 -338
  531. package/references/opentasks/src/daemon/__tests__/ipc.test.ts +0 -406
  532. package/references/opentasks/src/daemon/__tests__/lifecycle.test.ts +0 -378
  533. package/references/opentasks/src/daemon/__tests__/lock.test.ts +0 -240
  534. package/references/opentasks/src/daemon/__tests__/methods/graph.test.ts +0 -372
  535. package/references/opentasks/src/daemon/__tests__/methods/provider.test.ts +0 -238
  536. package/references/opentasks/src/daemon/__tests__/methods/tools.test.ts +0 -690
  537. package/references/opentasks/src/daemon/__tests__/multi-location.test.ts +0 -945
  538. package/references/opentasks/src/daemon/__tests__/registry.test.ts +0 -268
  539. package/references/opentasks/src/daemon/__tests__/watcher.test.ts +0 -329
  540. package/references/opentasks/src/daemon/entire-linker.ts +0 -615
  541. package/references/opentasks/src/daemon/entire-watcher.ts +0 -415
  542. package/references/opentasks/src/daemon/factory.ts +0 -133
  543. package/references/opentasks/src/daemon/flush.ts +0 -168
  544. package/references/opentasks/src/daemon/index.ts +0 -120
  545. package/references/opentasks/src/daemon/ipc.ts +0 -491
  546. package/references/opentasks/src/daemon/lifecycle.ts +0 -1106
  547. package/references/opentasks/src/daemon/location-state.ts +0 -481
  548. package/references/opentasks/src/daemon/lock.ts +0 -168
  549. package/references/opentasks/src/daemon/methods/__tests__/graph.test.ts +0 -359
  550. package/references/opentasks/src/daemon/methods/__tests__/provider.test.ts +0 -227
  551. package/references/opentasks/src/daemon/methods/__tests__/tools.test.ts +0 -360
  552. package/references/opentasks/src/daemon/methods/__tests__/watch.test.ts +0 -656
  553. package/references/opentasks/src/daemon/methods/archive.ts +0 -193
  554. package/references/opentasks/src/daemon/methods/graph.ts +0 -274
  555. package/references/opentasks/src/daemon/methods/lifecycle.ts +0 -112
  556. package/references/opentasks/src/daemon/methods/location.ts +0 -118
  557. package/references/opentasks/src/daemon/methods/provider.ts +0 -159
  558. package/references/opentasks/src/daemon/methods/tools.ts +0 -221
  559. package/references/opentasks/src/daemon/methods/watch.ts +0 -206
  560. package/references/opentasks/src/daemon/registry.ts +0 -244
  561. package/references/opentasks/src/daemon/types.ts +0 -163
  562. package/references/opentasks/src/daemon/watcher.ts +0 -248
  563. package/references/opentasks/src/entire/__tests__/agent-registry.test.ts +0 -127
  564. package/references/opentasks/src/entire/__tests__/claude-generator.test.ts +0 -49
  565. package/references/opentasks/src/entire/__tests__/commit-msg.test.ts +0 -89
  566. package/references/opentasks/src/entire/__tests__/cursor-agent.test.ts +0 -224
  567. package/references/opentasks/src/entire/__tests__/flush-sentinel.test.ts +0 -93
  568. package/references/opentasks/src/entire/__tests__/gemini-agent.test.ts +0 -375
  569. package/references/opentasks/src/entire/__tests__/git-hooks.test.ts +0 -85
  570. package/references/opentasks/src/entire/__tests__/hook-managers.test.ts +0 -128
  571. package/references/opentasks/src/entire/__tests__/opencode-agent.test.ts +0 -329
  572. package/references/opentasks/src/entire/__tests__/redaction.test.ts +0 -143
  573. package/references/opentasks/src/entire/__tests__/session-store.test.ts +0 -83
  574. package/references/opentasks/src/entire/__tests__/summarize.test.ts +0 -346
  575. package/references/opentasks/src/entire/__tests__/transcript-timestamp.test.ts +0 -127
  576. package/references/opentasks/src/entire/__tests__/types.test.ts +0 -112
  577. package/references/opentasks/src/entire/__tests__/utils.test.ts +0 -296
  578. package/references/opentasks/src/entire/__tests__/validation.test.ts +0 -103
  579. package/references/opentasks/src/entire/__tests__/worktree.test.ts +0 -66
  580. package/references/opentasks/src/entire/agent/registry.ts +0 -143
  581. package/references/opentasks/src/entire/agent/session-types.ts +0 -117
  582. package/references/opentasks/src/entire/agent/types.ts +0 -217
  583. package/references/opentasks/src/entire/commands/clean.ts +0 -134
  584. package/references/opentasks/src/entire/commands/disable.ts +0 -85
  585. package/references/opentasks/src/entire/commands/doctor.ts +0 -152
  586. package/references/opentasks/src/entire/commands/enable.ts +0 -149
  587. package/references/opentasks/src/entire/commands/explain.ts +0 -271
  588. package/references/opentasks/src/entire/commands/reset.ts +0 -105
  589. package/references/opentasks/src/entire/commands/resume.ts +0 -194
  590. package/references/opentasks/src/entire/commands/rewind.ts +0 -204
  591. package/references/opentasks/src/entire/commands/status.ts +0 -150
  592. package/references/opentasks/src/entire/config.ts +0 -153
  593. package/references/opentasks/src/entire/git-operations.ts +0 -485
  594. package/references/opentasks/src/entire/hooks/git-hooks.ts +0 -171
  595. package/references/opentasks/src/entire/hooks/lifecycle.ts +0 -224
  596. package/references/opentasks/src/entire/index.ts +0 -644
  597. package/references/opentasks/src/entire/security/redaction.ts +0 -263
  598. package/references/opentasks/src/entire/session/state-machine.ts +0 -463
  599. package/references/opentasks/src/entire/store/checkpoint-store.ts +0 -489
  600. package/references/opentasks/src/entire/store/native-store.ts +0 -178
  601. package/references/opentasks/src/entire/store/provider-types.ts +0 -99
  602. package/references/opentasks/src/entire/store/session-store.ts +0 -233
  603. package/references/opentasks/src/entire/strategy/attribution.ts +0 -300
  604. package/references/opentasks/src/entire/strategy/common.ts +0 -222
  605. package/references/opentasks/src/entire/strategy/content-overlap.ts +0 -242
  606. package/references/opentasks/src/entire/strategy/manual-commit.ts +0 -1008
  607. package/references/opentasks/src/entire/strategy/types.ts +0 -285
  608. package/references/opentasks/src/entire/summarize/claude-generator.ts +0 -119
  609. package/references/opentasks/src/entire/summarize/summarize.ts +0 -432
  610. package/references/opentasks/src/entire/types.ts +0 -408
  611. package/references/opentasks/src/entire/utils/chunk-files.ts +0 -49
  612. package/references/opentasks/src/entire/utils/commit-message.ts +0 -65
  613. package/references/opentasks/src/entire/utils/detect-agent.ts +0 -36
  614. package/references/opentasks/src/entire/utils/hook-managers.ts +0 -118
  615. package/references/opentasks/src/entire/utils/ide-tags.ts +0 -32
  616. package/references/opentasks/src/entire/utils/paths.ts +0 -59
  617. package/references/opentasks/src/entire/utils/preview-rewind.ts +0 -86
  618. package/references/opentasks/src/entire/utils/rewind-conflict.ts +0 -121
  619. package/references/opentasks/src/entire/utils/shadow-branch.ts +0 -113
  620. package/references/opentasks/src/entire/utils/string-utils.ts +0 -46
  621. package/references/opentasks/src/entire/utils/todo-extract.ts +0 -193
  622. package/references/opentasks/src/entire/utils/trailers.ts +0 -190
  623. package/references/opentasks/src/entire/utils/transcript-parse.ts +0 -177
  624. package/references/opentasks/src/entire/utils/transcript-timestamp.ts +0 -61
  625. package/references/opentasks/src/entire/utils/tree-ops.ts +0 -227
  626. package/references/opentasks/src/entire/utils/tty.ts +0 -72
  627. package/references/opentasks/src/entire/utils/validation.ts +0 -67
  628. package/references/opentasks/src/entire/utils/worktree.ts +0 -58
  629. package/references/opentasks/src/graph/EdgeTypeRegistry.ts +0 -330
  630. package/references/opentasks/src/graph/FederatedGraph.ts +0 -796
  631. package/references/opentasks/src/graph/GraphologyAdapter.ts +0 -374
  632. package/references/opentasks/src/graph/HydratingFederatedGraph.ts +0 -533
  633. package/references/opentasks/src/graph/__tests__/EdgeTypeRegistry.test.ts +0 -263
  634. package/references/opentasks/src/graph/__tests__/FederatedGraph.test.ts +0 -821
  635. package/references/opentasks/src/graph/__tests__/GraphologyAdapter.test.ts +0 -408
  636. package/references/opentasks/src/graph/__tests__/HydratingFederatedGraph.test.ts +0 -735
  637. package/references/opentasks/src/graph/__tests__/debounce.test.ts +0 -276
  638. package/references/opentasks/src/graph/__tests__/e2e-store-roundtrip.test.ts +0 -349
  639. package/references/opentasks/src/graph/__tests__/edge-cases.test.ts +0 -595
  640. package/references/opentasks/src/graph/__tests__/expansion.test.ts +0 -304
  641. package/references/opentasks/src/graph/__tests__/git-graph-syncer.test.ts +0 -572
  642. package/references/opentasks/src/graph/__tests__/provider-store.test.ts +0 -1091
  643. package/references/opentasks/src/graph/__tests__/query.test.ts +0 -991
  644. package/references/opentasks/src/graph/__tests__/store.test.ts +0 -998
  645. package/references/opentasks/src/graph/__tests__/sync.test.ts +0 -178
  646. package/references/opentasks/src/graph/__tests__/validation.test.ts +0 -657
  647. package/references/opentasks/src/graph/coordination.ts +0 -454
  648. package/references/opentasks/src/graph/debounce.ts +0 -154
  649. package/references/opentasks/src/graph/expansion.ts +0 -364
  650. package/references/opentasks/src/graph/git-graph-syncer.ts +0 -321
  651. package/references/opentasks/src/graph/history.ts +0 -438
  652. package/references/opentasks/src/graph/index.ts +0 -145
  653. package/references/opentasks/src/graph/provider-store.ts +0 -1077
  654. package/references/opentasks/src/graph/query.ts +0 -651
  655. package/references/opentasks/src/graph/store.ts +0 -861
  656. package/references/opentasks/src/graph/sync.ts +0 -116
  657. package/references/opentasks/src/graph/types.ts +0 -420
  658. package/references/opentasks/src/graph/validation.ts +0 -520
  659. package/references/opentasks/src/index.ts +0 -270
  660. package/references/opentasks/src/materialization/CLAUDE.md +0 -88
  661. package/references/opentasks/src/materialization/README.md +0 -187
  662. package/references/opentasks/src/materialization/__tests__/archive-methods.test.ts +0 -194
  663. package/references/opentasks/src/materialization/__tests__/archiver.test.ts +0 -528
  664. package/references/opentasks/src/materialization/__tests__/config.test.ts +0 -123
  665. package/references/opentasks/src/materialization/__tests__/git-remote-store.test.ts +0 -533
  666. package/references/opentasks/src/materialization/__tests__/graph-id.test.ts +0 -82
  667. package/references/opentasks/src/materialization/__tests__/http-remote-store.test.ts +0 -263
  668. package/references/opentasks/src/materialization/__tests__/materialize-before-archive.test.ts +0 -246
  669. package/references/opentasks/src/materialization/__tests__/remote-store-factory.test.ts +0 -152
  670. package/references/opentasks/src/materialization/__tests__/snapshot.test.ts +0 -209
  671. package/references/opentasks/src/materialization/archiver.ts +0 -318
  672. package/references/opentasks/src/materialization/git-archive-store.ts +0 -568
  673. package/references/opentasks/src/materialization/git-remote-store.ts +0 -551
  674. package/references/opentasks/src/materialization/graph-id.ts +0 -173
  675. package/references/opentasks/src/materialization/http-remote-store.ts +0 -190
  676. package/references/opentasks/src/materialization/index.ts +0 -62
  677. package/references/opentasks/src/materialization/remote-store-factory.ts +0 -55
  678. package/references/opentasks/src/materialization/snapshot.ts +0 -230
  679. package/references/opentasks/src/materialization/types.ts +0 -410
  680. package/references/opentasks/src/providers/__tests__/beads.test.ts +0 -752
  681. package/references/opentasks/src/providers/__tests__/claude-tasks.test.ts +0 -485
  682. package/references/opentasks/src/providers/__tests__/entire-e2e.test.ts +0 -692
  683. package/references/opentasks/src/providers/__tests__/entire-sessionlog-e2e.test.ts +0 -1113
  684. package/references/opentasks/src/providers/__tests__/entire.test.ts +0 -1016
  685. package/references/opentasks/src/providers/__tests__/from-config.test.ts +0 -183
  686. package/references/opentasks/src/providers/__tests__/global.test.ts +0 -515
  687. package/references/opentasks/src/providers/__tests__/materialization.test.ts +0 -567
  688. package/references/opentasks/src/providers/__tests__/native.test.ts +0 -693
  689. package/references/opentasks/src/providers/__tests__/registry.test.ts +0 -232
  690. package/references/opentasks/src/providers/beads.ts +0 -1155
  691. package/references/opentasks/src/providers/claude-tasks.ts +0 -402
  692. package/references/opentasks/src/providers/entire.ts +0 -608
  693. package/references/opentasks/src/providers/from-config.ts +0 -210
  694. package/references/opentasks/src/providers/global.ts +0 -460
  695. package/references/opentasks/src/providers/index.ts +0 -147
  696. package/references/opentasks/src/providers/location.ts +0 -237
  697. package/references/opentasks/src/providers/materialization.ts +0 -346
  698. package/references/opentasks/src/providers/native.ts +0 -725
  699. package/references/opentasks/src/providers/registry.ts +0 -114
  700. package/references/opentasks/src/providers/sudocode.ts +0 -1292
  701. package/references/opentasks/src/providers/sync.ts +0 -485
  702. package/references/opentasks/src/providers/traits/RelationshipQueryable.ts +0 -169
  703. package/references/opentasks/src/providers/traits/TaskManageable.ts +0 -211
  704. package/references/opentasks/src/providers/traits/Watchable.ts +0 -260
  705. package/references/opentasks/src/providers/traits/__tests__/RelationshipQueryable.test.ts +0 -217
  706. package/references/opentasks/src/providers/traits/__tests__/TaskManageable.test.ts +0 -241
  707. package/references/opentasks/src/providers/traits/index.ts +0 -42
  708. package/references/opentasks/src/providers/types.ts +0 -439
  709. package/references/opentasks/src/schema/__tests__/validation.test.ts +0 -283
  710. package/references/opentasks/src/schema/base.ts +0 -88
  711. package/references/opentasks/src/schema/edges.ts +0 -78
  712. package/references/opentasks/src/schema/index.ts +0 -37
  713. package/references/opentasks/src/schema/nodes.ts +0 -119
  714. package/references/opentasks/src/schema/storage.ts +0 -130
  715. package/references/opentasks/src/schema/validation.ts +0 -209
  716. package/references/opentasks/src/storage/__tests__/atomic-write.test.ts +0 -227
  717. package/references/opentasks/src/storage/__tests__/file-lock.test.ts +0 -120
  718. package/references/opentasks/src/storage/__tests__/jsonl.test.ts +0 -267
  719. package/references/opentasks/src/storage/__tests__/locked-writer.test.ts +0 -134
  720. package/references/opentasks/src/storage/__tests__/sqlite.test.ts +0 -572
  721. package/references/opentasks/src/storage/atomic-write.ts +0 -86
  722. package/references/opentasks/src/storage/file-lock.ts +0 -215
  723. package/references/opentasks/src/storage/index.ts +0 -24
  724. package/references/opentasks/src/storage/interface.ts +0 -289
  725. package/references/opentasks/src/storage/jsonl.ts +0 -264
  726. package/references/opentasks/src/storage/locked-writer.ts +0 -140
  727. package/references/opentasks/src/storage/sqlite-schema.ts +0 -177
  728. package/references/opentasks/src/storage/sqlite.ts +0 -791
  729. package/references/opentasks/src/tools/__tests__/annotate.test.ts +0 -381
  730. package/references/opentasks/src/tools/__tests__/link.test.ts +0 -299
  731. package/references/opentasks/src/tools/__tests__/query.test.ts +0 -350
  732. package/references/opentasks/src/tools/__tests__/task.test.ts +0 -218
  733. package/references/opentasks/src/tools/annotate.ts +0 -277
  734. package/references/opentasks/src/tools/index.ts +0 -57
  735. package/references/opentasks/src/tools/link.ts +0 -163
  736. package/references/opentasks/src/tools/query.ts +0 -468
  737. package/references/opentasks/src/tools/task.ts +0 -213
  738. package/references/opentasks/src/tools/types.ts +0 -451
  739. package/references/opentasks/src/tracking/__tests__/claude-tool-categorizer.test.ts +0 -223
  740. package/references/opentasks/src/tracking/__tests__/transcript-extractor.test.ts +0 -262
  741. package/references/opentasks/src/tracking/claude-tool-categorizer.ts +0 -155
  742. package/references/opentasks/src/tracking/index.ts +0 -32
  743. package/references/opentasks/src/tracking/skill-tracker.ts +0 -322
  744. package/references/opentasks/src/tracking/transcript-extractor.ts +0 -225
  745. package/references/opentasks/tests/e2e/helpers/assertions.ts +0 -211
  746. package/references/opentasks/tests/e2e/helpers/beads-helpers.ts +0 -487
  747. package/references/opentasks/tests/e2e/helpers/fixtures.ts +0 -236
  748. package/references/opentasks/tests/e2e/helpers/index.ts +0 -122
  749. package/references/opentasks/tests/e2e/helpers/sudocode-helpers.ts +0 -341
  750. package/references/opentasks/tests/e2e/helpers/system-setup.ts +0 -504
  751. package/references/opentasks/tests/e2e/helpers/test-agent.ts +0 -504
  752. package/references/opentasks/tests/e2e/infrastructure.e2e.test.ts +0 -521
  753. package/references/opentasks/tests/e2e/skill-tracking.e2e.test.ts +0 -625
  754. package/references/opentasks/tests/e2e/workflows/feedback-loop.e2e.test.ts +0 -279
  755. package/references/opentasks/tests/e2e/workflows/multi-agent.e2e.test.ts +0 -304
  756. package/references/opentasks/tests/e2e/workflows/provider-sync/background-sync.e2e.test.ts +0 -292
  757. package/references/opentasks/tests/e2e/workflows/provider-sync/beads-provider-compat.e2e.test.ts +0 -249
  758. package/references/opentasks/tests/e2e/workflows/provider-sync/cross-provider-edges.e2e.test.ts +0 -407
  759. package/references/opentasks/tests/e2e/workflows/provider-sync/federated-ready.e2e.test.ts +0 -504
  760. package/references/opentasks/tests/e2e/workflows/provider-sync/hydration.e2e.test.ts +0 -340
  761. package/references/opentasks/tests/e2e/workflows/provider-sync/materialization.e2e.test.ts +0 -370
  762. package/references/opentasks/tests/e2e/workflows/provider-sync/sudocode-provider-compat.e2e.test.ts +0 -683
  763. package/references/opentasks/tests/e2e/workflows/provider-sync/watchable-beads.e2e.test.ts +0 -573
  764. package/references/opentasks/tests/e2e/workflows/spec-driven.e2e.test.ts +0 -244
  765. package/references/opentasks/tests/e2e/worktree-location.e2e.test.ts +0 -699
  766. package/references/opentasks/tests/integration/daemon/helpers.ts +0 -147
  767. package/references/opentasks/tests/integration/daemon/ipc.integration.test.ts +0 -343
  768. package/references/opentasks/tests/integration/daemon/lifecycle.integration.test.ts +0 -407
  769. package/references/opentasks/tests/integration/graph/federated-graph.integration.test.ts +0 -660
  770. package/references/opentasks/tests/integration/helpers/flags.ts +0 -28
  771. package/references/opentasks/tests/integration/helpers/index.ts +0 -47
  772. package/references/opentasks/tests/integration/helpers/process.ts +0 -133
  773. package/references/opentasks/tests/integration/helpers/temp.ts +0 -105
  774. package/references/opentasks/tests/integration/helpers/wait.ts +0 -133
  775. package/references/opentasks/tests/integration/helpers.test.ts +0 -120
  776. package/references/opentasks/tests/integration/providers/beads-task-manageable.integration.test.ts +0 -450
  777. package/references/opentasks/tests/integration/providers/beads.integration.test.ts +0 -388
  778. package/references/opentasks/tests/integration/providers/native-task-manageable.integration.test.ts +0 -667
  779. package/references/opentasks/tests/integration/providers/sudocode-task-manageable.integration.test.ts +0 -406
  780. package/references/opentasks/tests/integration/providers/sudocode.integration.test.ts +0 -342
  781. package/references/opentasks/tests/integration/storage/jsonl-durability.integration.test.ts +0 -390
  782. package/references/opentasks/tests/integration/storage/sqlite-durability.integration.test.ts +0 -527
  783. package/references/opentasks/tests/integration/worktree/redirect-location-resolution.integration.test.ts +0 -578
  784. package/references/opentasks/tests/integration/worktree/worktree-flow.integration.test.ts +0 -656
  785. package/references/opentasks/tsconfig.json +0 -18
  786. package/references/opentasks/vitest.config.ts +0 -27
  787. package/references/opentasks/vitest.e2e.config.ts +0 -35
  788. package/references/opentasks/vitest.integration.config.ts +0 -19
  789. package/references/openteams/.claude/settings.json +0 -6
  790. package/references/openteams/CLAUDE.md +0 -98
  791. package/references/openteams/README.md +0 -508
  792. package/references/openteams/SKILL.md +0 -198
  793. package/references/openteams/design.md +0 -250
  794. package/references/openteams/docs/visual-editor-design.md +0 -1225
  795. package/references/openteams/editor/index.html +0 -15
  796. package/references/openteams/editor/package.json +0 -39
  797. package/references/openteams/editor/src/App.tsx +0 -48
  798. package/references/openteams/editor/src/components/canvas/Canvas.tsx +0 -131
  799. package/references/openteams/editor/src/components/canvas/QuickAddMenu.tsx +0 -134
  800. package/references/openteams/editor/src/components/edges/PeerRouteEdge.tsx +0 -82
  801. package/references/openteams/editor/src/components/edges/SignalFlowEdge.tsx +0 -77
  802. package/references/openteams/editor/src/components/edges/SpawnEdge.tsx +0 -54
  803. package/references/openteams/editor/src/components/inspector/ChannelInspector.tsx +0 -158
  804. package/references/openteams/editor/src/components/inspector/EdgeInspector.tsx +0 -168
  805. package/references/openteams/editor/src/components/inspector/Inspector.tsx +0 -46
  806. package/references/openteams/editor/src/components/inspector/RoleInspector.tsx +0 -508
  807. package/references/openteams/editor/src/components/inspector/TeamInspector.tsx +0 -126
  808. package/references/openteams/editor/src/components/nodes/ChannelNode.tsx +0 -103
  809. package/references/openteams/editor/src/components/nodes/RoleNode.tsx +0 -157
  810. package/references/openteams/editor/src/components/nodes/node-styles.ts +0 -101
  811. package/references/openteams/editor/src/components/sidebar/Sidebar.tsx +0 -227
  812. package/references/openteams/editor/src/components/toolbar/ExportModal.tsx +0 -110
  813. package/references/openteams/editor/src/components/toolbar/ImportModal.tsx +0 -139
  814. package/references/openteams/editor/src/components/toolbar/Toolbar.tsx +0 -190
  815. package/references/openteams/editor/src/hooks/use-autosave.ts +0 -126
  816. package/references/openteams/editor/src/hooks/use-keyboard.ts +0 -106
  817. package/references/openteams/editor/src/hooks/use-validation.ts +0 -45
  818. package/references/openteams/editor/src/index.css +0 -245
  819. package/references/openteams/editor/src/lib/auto-layout.ts +0 -51
  820. package/references/openteams/editor/src/lib/bundled-templates.ts +0 -42
  821. package/references/openteams/editor/src/lib/compiler.ts +0 -75
  822. package/references/openteams/editor/src/lib/load-template.ts +0 -103
  823. package/references/openteams/editor/src/lib/rebuild-edges.ts +0 -104
  824. package/references/openteams/editor/src/lib/serializer.ts +0 -408
  825. package/references/openteams/editor/src/lib/signal-catalog.ts +0 -50
  826. package/references/openteams/editor/src/lib/validator.ts +0 -172
  827. package/references/openteams/editor/src/main.tsx +0 -10
  828. package/references/openteams/editor/src/stores/canvas-store.ts +0 -80
  829. package/references/openteams/editor/src/stores/config-store.ts +0 -243
  830. package/references/openteams/editor/src/stores/history-store.ts +0 -143
  831. package/references/openteams/editor/src/stores/theme-store.ts +0 -66
  832. package/references/openteams/editor/src/stores/ui-store.ts +0 -46
  833. package/references/openteams/editor/src/stores/validation-store.ts +0 -27
  834. package/references/openteams/editor/src/types/editor.ts +0 -74
  835. package/references/openteams/editor/src/vite-env.d.ts +0 -1
  836. package/references/openteams/editor/tests/compiler.test.ts +0 -151
  837. package/references/openteams/editor/tests/e2e-add-remove.test.ts +0 -386
  838. package/references/openteams/editor/tests/e2e-components.test.tsx +0 -424
  839. package/references/openteams/editor/tests/e2e-export-roundtrip.test.ts +0 -299
  840. package/references/openteams/editor/tests/e2e-template-load.test.ts +0 -204
  841. package/references/openteams/editor/tests/e2e-ui-store.test.ts +0 -126
  842. package/references/openteams/editor/tests/e2e-undo-redo.test.ts +0 -203
  843. package/references/openteams/editor/tests/e2e-validation.test.ts +0 -307
  844. package/references/openteams/editor/tests/serializer.test.ts +0 -142
  845. package/references/openteams/editor/tests/setup.ts +0 -52
  846. package/references/openteams/editor/tests/validator.test.ts +0 -92
  847. package/references/openteams/editor/tsconfig.json +0 -21
  848. package/references/openteams/editor/tsconfig.tsbuildinfo +0 -1
  849. package/references/openteams/editor/vite.config.ts +0 -28
  850. package/references/openteams/examples/bmad-method/prompts/analyst/ROLE.md +0 -16
  851. package/references/openteams/examples/bmad-method/prompts/analyst/SOUL.md +0 -5
  852. package/references/openteams/examples/bmad-method/prompts/architect/ROLE.md +0 -24
  853. package/references/openteams/examples/bmad-method/prompts/architect/SOUL.md +0 -5
  854. package/references/openteams/examples/bmad-method/prompts/developer/ROLE.md +0 -25
  855. package/references/openteams/examples/bmad-method/prompts/developer/SOUL.md +0 -5
  856. package/references/openteams/examples/bmad-method/prompts/master/ROLE.md +0 -21
  857. package/references/openteams/examples/bmad-method/prompts/master/SOUL.md +0 -5
  858. package/references/openteams/examples/bmad-method/prompts/pm/ROLE.md +0 -20
  859. package/references/openteams/examples/bmad-method/prompts/pm/SOUL.md +0 -5
  860. package/references/openteams/examples/bmad-method/prompts/qa/ROLE.md +0 -17
  861. package/references/openteams/examples/bmad-method/prompts/qa/SOUL.md +0 -5
  862. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/ROLE.md +0 -23
  863. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/SOUL.md +0 -5
  864. package/references/openteams/examples/bmad-method/prompts/scrum-master/ROLE.md +0 -27
  865. package/references/openteams/examples/bmad-method/prompts/scrum-master/SOUL.md +0 -5
  866. package/references/openteams/examples/bmad-method/prompts/tech-writer/ROLE.md +0 -21
  867. package/references/openteams/examples/bmad-method/prompts/tech-writer/SOUL.md +0 -5
  868. package/references/openteams/examples/bmad-method/prompts/ux-designer/ROLE.md +0 -16
  869. package/references/openteams/examples/bmad-method/prompts/ux-designer/SOUL.md +0 -5
  870. package/references/openteams/examples/bmad-method/roles/analyst.yaml +0 -9
  871. package/references/openteams/examples/bmad-method/roles/architect.yaml +0 -9
  872. package/references/openteams/examples/bmad-method/roles/developer.yaml +0 -8
  873. package/references/openteams/examples/bmad-method/roles/master.yaml +0 -8
  874. package/references/openteams/examples/bmad-method/roles/pm.yaml +0 -9
  875. package/references/openteams/examples/bmad-method/roles/qa.yaml +0 -8
  876. package/references/openteams/examples/bmad-method/roles/quick-flow-dev.yaml +0 -8
  877. package/references/openteams/examples/bmad-method/roles/scrum-master.yaml +0 -9
  878. package/references/openteams/examples/bmad-method/roles/tech-writer.yaml +0 -8
  879. package/references/openteams/examples/bmad-method/roles/ux-designer.yaml +0 -8
  880. package/references/openteams/examples/bmad-method/team.yaml +0 -161
  881. package/references/openteams/examples/bug-fix-pipeline/roles/fixer.yaml +0 -9
  882. package/references/openteams/examples/bug-fix-pipeline/roles/investigator.yaml +0 -8
  883. package/references/openteams/examples/bug-fix-pipeline/roles/pr-creator.yaml +0 -6
  884. package/references/openteams/examples/bug-fix-pipeline/roles/triager.yaml +0 -7
  885. package/references/openteams/examples/bug-fix-pipeline/roles/verifier.yaml +0 -8
  886. package/references/openteams/examples/bug-fix-pipeline/team.yaml +0 -88
  887. package/references/openteams/examples/codebase-migration/roles/assessor.yaml +0 -7
  888. package/references/openteams/examples/codebase-migration/roles/migrator.yaml +0 -9
  889. package/references/openteams/examples/codebase-migration/roles/planner.yaml +0 -5
  890. package/references/openteams/examples/codebase-migration/roles/test-extractor.yaml +0 -9
  891. package/references/openteams/examples/codebase-migration/roles/validator.yaml +0 -7
  892. package/references/openteams/examples/codebase-migration/team.yaml +0 -81
  893. package/references/openteams/examples/docs-sync/roles/adr-writer.yaml +0 -7
  894. package/references/openteams/examples/docs-sync/roles/api-doc-writer.yaml +0 -7
  895. package/references/openteams/examples/docs-sync/roles/change-detector.yaml +0 -7
  896. package/references/openteams/examples/docs-sync/roles/doc-reviewer.yaml +0 -7
  897. package/references/openteams/examples/docs-sync/roles/guide-writer.yaml +0 -7
  898. package/references/openteams/examples/docs-sync/team.yaml +0 -84
  899. package/references/openteams/examples/gsd/prompts/codebase-mapper/ROLE.md +0 -17
  900. package/references/openteams/examples/gsd/prompts/codebase-mapper/SOUL.md +0 -5
  901. package/references/openteams/examples/gsd/prompts/debugger/ROLE.md +0 -25
  902. package/references/openteams/examples/gsd/prompts/debugger/SOUL.md +0 -5
  903. package/references/openteams/examples/gsd/prompts/executor/ROLE.md +0 -34
  904. package/references/openteams/examples/gsd/prompts/executor/SOUL.md +0 -5
  905. package/references/openteams/examples/gsd/prompts/integration-checker/ROLE.md +0 -18
  906. package/references/openteams/examples/gsd/prompts/integration-checker/SOUL.md +0 -3
  907. package/references/openteams/examples/gsd/prompts/orchestrator/ROLE.md +0 -42
  908. package/references/openteams/examples/gsd/prompts/orchestrator/SOUL.md +0 -5
  909. package/references/openteams/examples/gsd/prompts/phase-researcher/ROLE.md +0 -15
  910. package/references/openteams/examples/gsd/prompts/phase-researcher/SOUL.md +0 -3
  911. package/references/openteams/examples/gsd/prompts/plan-checker/ROLE.md +0 -17
  912. package/references/openteams/examples/gsd/prompts/plan-checker/SOUL.md +0 -3
  913. package/references/openteams/examples/gsd/prompts/planner/ROLE.md +0 -28
  914. package/references/openteams/examples/gsd/prompts/planner/SOUL.md +0 -5
  915. package/references/openteams/examples/gsd/prompts/project-researcher/ROLE.md +0 -16
  916. package/references/openteams/examples/gsd/prompts/project-researcher/SOUL.md +0 -3
  917. package/references/openteams/examples/gsd/prompts/research-synthesizer/ROLE.md +0 -13
  918. package/references/openteams/examples/gsd/prompts/research-synthesizer/SOUL.md +0 -3
  919. package/references/openteams/examples/gsd/prompts/roadmapper/ROLE.md +0 -14
  920. package/references/openteams/examples/gsd/prompts/roadmapper/SOUL.md +0 -3
  921. package/references/openteams/examples/gsd/prompts/verifier/ROLE.md +0 -19
  922. package/references/openteams/examples/gsd/prompts/verifier/SOUL.md +0 -5
  923. package/references/openteams/examples/gsd/roles/codebase-mapper.yaml +0 -8
  924. package/references/openteams/examples/gsd/roles/debugger.yaml +0 -8
  925. package/references/openteams/examples/gsd/roles/executor.yaml +0 -8
  926. package/references/openteams/examples/gsd/roles/integration-checker.yaml +0 -8
  927. package/references/openteams/examples/gsd/roles/orchestrator.yaml +0 -9
  928. package/references/openteams/examples/gsd/roles/phase-researcher.yaml +0 -7
  929. package/references/openteams/examples/gsd/roles/plan-checker.yaml +0 -8
  930. package/references/openteams/examples/gsd/roles/planner.yaml +0 -8
  931. package/references/openteams/examples/gsd/roles/project-researcher.yaml +0 -8
  932. package/references/openteams/examples/gsd/roles/research-synthesizer.yaml +0 -7
  933. package/references/openteams/examples/gsd/roles/roadmapper.yaml +0 -7
  934. package/references/openteams/examples/gsd/roles/verifier.yaml +0 -8
  935. package/references/openteams/examples/gsd/team.yaml +0 -154
  936. package/references/openteams/examples/incident-response/roles/communicator.yaml +0 -5
  937. package/references/openteams/examples/incident-response/roles/fix-proposer.yaml +0 -7
  938. package/references/openteams/examples/incident-response/roles/incident-triager.yaml +0 -8
  939. package/references/openteams/examples/incident-response/roles/investigator.yaml +0 -8
  940. package/references/openteams/examples/incident-response/team.yaml +0 -68
  941. package/references/openteams/examples/pr-review-checks/roles/code-reviewer.yaml +0 -7
  942. package/references/openteams/examples/pr-review-checks/roles/security-scanner.yaml +0 -6
  943. package/references/openteams/examples/pr-review-checks/roles/summarizer.yaml +0 -6
  944. package/references/openteams/examples/pr-review-checks/roles/test-checker.yaml +0 -8
  945. package/references/openteams/examples/pr-review-checks/team.yaml +0 -64
  946. package/references/openteams/examples/security-audit/roles/code-analyzer.yaml +0 -6
  947. package/references/openteams/examples/security-audit/roles/dep-scanner.yaml +0 -7
  948. package/references/openteams/examples/security-audit/roles/fixer.yaml +0 -9
  949. package/references/openteams/examples/security-audit/roles/pr-creator.yaml +0 -6
  950. package/references/openteams/examples/security-audit/roles/prioritizer.yaml +0 -6
  951. package/references/openteams/examples/security-audit/roles/secrets-scanner.yaml +0 -6
  952. package/references/openteams/examples/security-audit/roles/verifier.yaml +0 -8
  953. package/references/openteams/examples/security-audit/team.yaml +0 -102
  954. package/references/openteams/media/banner.png +0 -0
  955. package/references/openteams/media/editor.png +0 -0
  956. package/references/openteams/package-lock.json +0 -4804
  957. package/references/openteams/package.json +0 -58
  958. package/references/openteams/schema/role.schema.json +0 -147
  959. package/references/openteams/schema/team.schema.json +0 -311
  960. package/references/openteams/src/cli/editor.ts +0 -170
  961. package/references/openteams/src/cli/generate.test.ts +0 -191
  962. package/references/openteams/src/cli/generate.ts +0 -220
  963. package/references/openteams/src/cli/prompt-utils.ts +0 -42
  964. package/references/openteams/src/cli/template.test.ts +0 -365
  965. package/references/openteams/src/cli/template.ts +0 -205
  966. package/references/openteams/src/cli.ts +0 -22
  967. package/references/openteams/src/generators/agent-prompt-generator.test.ts +0 -332
  968. package/references/openteams/src/generators/agent-prompt-generator.ts +0 -527
  969. package/references/openteams/src/generators/package-generator.test.ts +0 -129
  970. package/references/openteams/src/generators/package-generator.ts +0 -102
  971. package/references/openteams/src/generators/skill-generator.test.ts +0 -246
  972. package/references/openteams/src/generators/skill-generator.ts +0 -388
  973. package/references/openteams/src/index.ts +0 -84
  974. package/references/openteams/src/template/builtins.test.ts +0 -74
  975. package/references/openteams/src/template/builtins.ts +0 -108
  976. package/references/openteams/src/template/install-service.test.ts +0 -452
  977. package/references/openteams/src/template/install-service.ts +0 -332
  978. package/references/openteams/src/template/loader.test.ts +0 -1696
  979. package/references/openteams/src/template/loader.ts +0 -804
  980. package/references/openteams/src/template/resolver.test.ts +0 -304
  981. package/references/openteams/src/template/resolver.ts +0 -251
  982. package/references/openteams/src/template/types.ts +0 -229
  983. package/references/openteams/tsconfig.cjs.json +0 -7
  984. package/references/openteams/tsconfig.esm.json +0 -8
  985. package/references/openteams/tsconfig.json +0 -16
  986. package/references/openteams/vitest.config.ts +0 -9
  987. package/references/sessionlog/.husky/pre-commit +0 -1
  988. package/references/sessionlog/.lintstagedrc.json +0 -4
  989. package/references/sessionlog/.prettierignore +0 -4
  990. package/references/sessionlog/.prettierrc.json +0 -11
  991. package/references/sessionlog/LICENSE +0 -21
  992. package/references/sessionlog/README.md +0 -453
  993. package/references/sessionlog/eslint.config.js +0 -58
  994. package/references/sessionlog/package-lock.json +0 -3672
  995. package/references/sessionlog/package.json +0 -65
  996. package/references/sessionlog/src/__tests__/agent-hooks.test.ts +0 -570
  997. package/references/sessionlog/src/__tests__/agent-registry.test.ts +0 -127
  998. package/references/sessionlog/src/__tests__/claude-code-hooks.test.ts +0 -225
  999. package/references/sessionlog/src/__tests__/claude-generator.test.ts +0 -46
  1000. package/references/sessionlog/src/__tests__/commit-msg.test.ts +0 -86
  1001. package/references/sessionlog/src/__tests__/cursor-agent.test.ts +0 -224
  1002. package/references/sessionlog/src/__tests__/e2e-live.test.ts +0 -890
  1003. package/references/sessionlog/src/__tests__/event-log.test.ts +0 -183
  1004. package/references/sessionlog/src/__tests__/flush-sentinel.test.ts +0 -105
  1005. package/references/sessionlog/src/__tests__/gemini-agent.test.ts +0 -375
  1006. package/references/sessionlog/src/__tests__/git-hooks.test.ts +0 -78
  1007. package/references/sessionlog/src/__tests__/hook-managers.test.ts +0 -121
  1008. package/references/sessionlog/src/__tests__/lifecycle-tasks.test.ts +0 -759
  1009. package/references/sessionlog/src/__tests__/opencode-agent.test.ts +0 -338
  1010. package/references/sessionlog/src/__tests__/redaction.test.ts +0 -136
  1011. package/references/sessionlog/src/__tests__/session-repo.test.ts +0 -353
  1012. package/references/sessionlog/src/__tests__/session-store.test.ts +0 -166
  1013. package/references/sessionlog/src/__tests__/setup-ccweb.test.ts +0 -466
  1014. package/references/sessionlog/src/__tests__/skill-live.test.ts +0 -461
  1015. package/references/sessionlog/src/__tests__/summarize.test.ts +0 -348
  1016. package/references/sessionlog/src/__tests__/task-plan-e2e.test.ts +0 -610
  1017. package/references/sessionlog/src/__tests__/task-plan-live.test.ts +0 -632
  1018. package/references/sessionlog/src/__tests__/transcript-timestamp.test.ts +0 -121
  1019. package/references/sessionlog/src/__tests__/types.test.ts +0 -166
  1020. package/references/sessionlog/src/__tests__/utils.test.ts +0 -333
  1021. package/references/sessionlog/src/__tests__/validation.test.ts +0 -103
  1022. package/references/sessionlog/src/__tests__/worktree.test.ts +0 -57
  1023. package/references/sessionlog/src/agent/registry.ts +0 -143
  1024. package/references/sessionlog/src/agent/session-types.ts +0 -113
  1025. package/references/sessionlog/src/agent/types.ts +0 -220
  1026. package/references/sessionlog/src/cli.ts +0 -597
  1027. package/references/sessionlog/src/commands/clean.ts +0 -133
  1028. package/references/sessionlog/src/commands/disable.ts +0 -84
  1029. package/references/sessionlog/src/commands/doctor.ts +0 -145
  1030. package/references/sessionlog/src/commands/enable.ts +0 -202
  1031. package/references/sessionlog/src/commands/explain.ts +0 -261
  1032. package/references/sessionlog/src/commands/reset.ts +0 -105
  1033. package/references/sessionlog/src/commands/resume.ts +0 -180
  1034. package/references/sessionlog/src/commands/rewind.ts +0 -195
  1035. package/references/sessionlog/src/commands/setup-ccweb.ts +0 -275
  1036. package/references/sessionlog/src/commands/status.ts +0 -172
  1037. package/references/sessionlog/src/config.ts +0 -165
  1038. package/references/sessionlog/src/events/event-log.ts +0 -126
  1039. package/references/sessionlog/src/git-operations.ts +0 -558
  1040. package/references/sessionlog/src/hooks/git-hooks.ts +0 -165
  1041. package/references/sessionlog/src/hooks/lifecycle.ts +0 -391
  1042. package/references/sessionlog/src/index.ts +0 -650
  1043. package/references/sessionlog/src/security/redaction.ts +0 -283
  1044. package/references/sessionlog/src/session/state-machine.ts +0 -452
  1045. package/references/sessionlog/src/store/checkpoint-store.ts +0 -509
  1046. package/references/sessionlog/src/store/native-store.ts +0 -173
  1047. package/references/sessionlog/src/store/provider-types.ts +0 -99
  1048. package/references/sessionlog/src/store/session-store.ts +0 -266
  1049. package/references/sessionlog/src/strategy/attribution.ts +0 -296
  1050. package/references/sessionlog/src/strategy/common.ts +0 -207
  1051. package/references/sessionlog/src/strategy/content-overlap.ts +0 -228
  1052. package/references/sessionlog/src/strategy/manual-commit.ts +0 -988
  1053. package/references/sessionlog/src/strategy/types.ts +0 -279
  1054. package/references/sessionlog/src/summarize/claude-generator.ts +0 -115
  1055. package/references/sessionlog/src/summarize/summarize.ts +0 -432
  1056. package/references/sessionlog/src/types.ts +0 -508
  1057. package/references/sessionlog/src/utils/chunk-files.ts +0 -49
  1058. package/references/sessionlog/src/utils/commit-message.ts +0 -65
  1059. package/references/sessionlog/src/utils/detect-agent.ts +0 -36
  1060. package/references/sessionlog/src/utils/hook-managers.ts +0 -125
  1061. package/references/sessionlog/src/utils/ide-tags.ts +0 -32
  1062. package/references/sessionlog/src/utils/paths.ts +0 -79
  1063. package/references/sessionlog/src/utils/preview-rewind.ts +0 -80
  1064. package/references/sessionlog/src/utils/rewind-conflict.ts +0 -121
  1065. package/references/sessionlog/src/utils/shadow-branch.ts +0 -109
  1066. package/references/sessionlog/src/utils/string-utils.ts +0 -46
  1067. package/references/sessionlog/src/utils/todo-extract.ts +0 -188
  1068. package/references/sessionlog/src/utils/trailers.ts +0 -187
  1069. package/references/sessionlog/src/utils/transcript-parse.ts +0 -177
  1070. package/references/sessionlog/src/utils/transcript-timestamp.ts +0 -59
  1071. package/references/sessionlog/src/utils/tree-ops.ts +0 -219
  1072. package/references/sessionlog/src/utils/tty.ts +0 -72
  1073. package/references/sessionlog/src/utils/validation.ts +0 -65
  1074. package/references/sessionlog/src/utils/worktree.ts +0 -58
  1075. package/references/sessionlog/src/wire-types.ts +0 -59
  1076. package/references/sessionlog/templates/setup-env.sh +0 -153
  1077. package/references/sessionlog/tsconfig.json +0 -18
  1078. package/references/sessionlog/vitest.config.ts +0 -12
  1079. package/references/swarmkit/LICENSE +0 -21
  1080. package/references/swarmkit/README.md +0 -130
  1081. package/references/swarmkit/docs/design.md +0 -453
  1082. package/references/swarmkit/docs/package-setup-reference.md +0 -519
  1083. package/references/swarmkit/package-lock.json +0 -1938
  1084. package/references/swarmkit/package.json +0 -43
  1085. package/references/swarmkit/src/cli.ts +0 -41
  1086. package/references/swarmkit/src/commands/add.ts +0 -126
  1087. package/references/swarmkit/src/commands/doctor.ts +0 -117
  1088. package/references/swarmkit/src/commands/hive.ts +0 -279
  1089. package/references/swarmkit/src/commands/init/phases/configure.ts +0 -96
  1090. package/references/swarmkit/src/commands/init/phases/global-setup.ts +0 -102
  1091. package/references/swarmkit/src/commands/init/phases/packages.ts +0 -44
  1092. package/references/swarmkit/src/commands/init/phases/project.ts +0 -81
  1093. package/references/swarmkit/src/commands/init/phases/use-case.ts +0 -47
  1094. package/references/swarmkit/src/commands/init/state.test.ts +0 -23
  1095. package/references/swarmkit/src/commands/init/state.ts +0 -22
  1096. package/references/swarmkit/src/commands/init/wizard.ts +0 -160
  1097. package/references/swarmkit/src/commands/init.ts +0 -17
  1098. package/references/swarmkit/src/commands/login.ts +0 -106
  1099. package/references/swarmkit/src/commands/logout.ts +0 -22
  1100. package/references/swarmkit/src/commands/remove.ts +0 -72
  1101. package/references/swarmkit/src/commands/status.ts +0 -101
  1102. package/references/swarmkit/src/commands/update.ts +0 -62
  1103. package/references/swarmkit/src/commands/whoami.ts +0 -41
  1104. package/references/swarmkit/src/config/global.test.ts +0 -258
  1105. package/references/swarmkit/src/config/global.ts +0 -141
  1106. package/references/swarmkit/src/config/keys.test.ts +0 -109
  1107. package/references/swarmkit/src/config/keys.ts +0 -49
  1108. package/references/swarmkit/src/doctor/checks.test.ts +0 -366
  1109. package/references/swarmkit/src/doctor/checks.ts +0 -292
  1110. package/references/swarmkit/src/doctor/types.ts +0 -33
  1111. package/references/swarmkit/src/hub/auth-flow.test.ts +0 -127
  1112. package/references/swarmkit/src/hub/auth-flow.ts +0 -144
  1113. package/references/swarmkit/src/hub/client.test.ts +0 -224
  1114. package/references/swarmkit/src/hub/client.ts +0 -185
  1115. package/references/swarmkit/src/hub/credentials.test.ts +0 -132
  1116. package/references/swarmkit/src/hub/credentials.ts +0 -51
  1117. package/references/swarmkit/src/index.ts +0 -116
  1118. package/references/swarmkit/src/packages/installer.test.ts +0 -365
  1119. package/references/swarmkit/src/packages/installer.ts +0 -206
  1120. package/references/swarmkit/src/packages/plugin.test.ts +0 -141
  1121. package/references/swarmkit/src/packages/plugin.ts +0 -46
  1122. package/references/swarmkit/src/packages/registry.test.ts +0 -235
  1123. package/references/swarmkit/src/packages/registry.ts +0 -209
  1124. package/references/swarmkit/src/packages/setup.test.ts +0 -1349
  1125. package/references/swarmkit/src/packages/setup.ts +0 -635
  1126. package/references/swarmkit/src/utils/ui.test.ts +0 -115
  1127. package/references/swarmkit/src/utils/ui.ts +0 -62
  1128. package/references/swarmkit/tsconfig.json +0 -17
  1129. package/references/swarmkit/vitest.config.ts +0 -9
@@ -1,1638 +0,0 @@
1
- # OpenTasks Persistence Layer
2
-
3
- This document describes the persistence architecture for OpenTasks. The design enables flexible, pluggable storage while maintaining a consistent graph data model.
4
-
5
- **See also:** [DESIGN.md](./DESIGN.md) (vision) · [SCHEMA.md](./SCHEMA.md) (data model) · [ARCHITECTURE.md](./ARCHITECTURE.md) (hierarchy, daemon) · [PROVIDERS.md](./PROVIDERS.md) (integrations) · [INTERFACE.md](./INTERFACE.md) (API)
6
-
7
- ---
8
-
9
- ## Design Goals
10
-
11
- 1. **Modular persisters** — Pluggable storage backends (like [TinyBase](https://tinybase.org/guides/persistence/))
12
- 2. **Git-native source of truth** — JSONL files for version control (like beads/sudocode)
13
- 3. **Fast queries** — SQLite cache layer for complex queries
14
- 4. **Agent-friendly editing** — Markdown file expansion for direct file editing
15
- 5. **Incremental sync** — Dirty tracking to minimize writes
16
- 6. **Multi-location support** — Worktrees, redirects, delegated storage
17
- 7. **Provider integration** — Delegate to underlying systems (beads, etc.)
18
-
19
- ---
20
-
21
- ## Architecture Overview
22
-
23
- ```
24
- ┌─────────────────────────────────────────────────────────────────┐
25
- │ Application Layer │
26
- │ (Graph operations, queries, mutations) │
27
- └─────────────────────────────────────────────────────────────────┘
28
-
29
- ┌─────────────────────────────────────────────────────────────────┐
30
- │ Persistence Manager │
31
- │ - Coordinates persisters │
32
- │ - Manages dirty tracking │
33
- │ - Handles flush scheduling │
34
- └─────────────────────────────────────────────────────────────────┘
35
-
36
- ┌─────────────────────────────────────────────────────────────────┐
37
- │ Persister Interface │
38
- │ getPersisted() | setPersisted() | subscribe() | unsubscribe() │
39
- └─────────────────────────────────────────────────────────────────┘
40
- ↓ ↓ ↓
41
- ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────────────┐
42
- │ JSONL Persister │ │ SQLite Persister│ │ Markdown Persister │
43
- │ (source of truth)│ │ (query cache) │ │ (file expansion) │
44
- └─────────────────┘ └─────────────────┘ └─────────────────────────┘
45
- ↓ ↓ ↓
46
- ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────────────┐
47
- │ graph.jsonl │ │ cache.db │ │ context/*.md, tasks/*.md│
48
- │ (git-tracked) │ │ (gitignored) │ │ (git-tracked) │
49
- └─────────────────┘ └─────────────────┘ └─────────────────────────┘
50
- ```
51
-
52
- ---
53
-
54
- ## Persister Interface
55
-
56
- Inspired by [TinyBase's persister model](https://tinybase.org/guides/persistence/custom-persistence/), OpenTasks uses a modular interface for storage backends.
57
-
58
- ```typescript
59
- /**
60
- * Core persister interface
61
- * Each persister handles one storage format/location
62
- */
63
- interface Persister<ListenerHandle = unknown> {
64
- /** Unique identifier for this persister */
65
- readonly id: string
66
-
67
- /** Human-readable name */
68
- readonly name: string
69
-
70
- /** Persister capabilities */
71
- readonly capabilities: PersisterCapabilities
72
-
73
- /**
74
- * Load graph data from persistence layer
75
- * Returns null/undefined if no data exists
76
- */
77
- getPersisted(): Promise<PersistedGraph | null | undefined>
78
-
79
- /**
80
- * Save graph data to persistence layer
81
- * @param getContent - Function to get current graph state
82
- * @param changes - Optional incremental changes (for dirty tracking)
83
- */
84
- setPersisted(
85
- getContent: () => PersistedGraph,
86
- changes?: GraphChanges
87
- ): Promise<void>
88
-
89
- /**
90
- * Subscribe to external changes in persistence layer
91
- * @param listener - Called when external changes detected
92
- * @returns Handle for unsubscribing
93
- */
94
- subscribe(listener: PersisterListener): ListenerHandle
95
-
96
- /**
97
- * Unsubscribe from external changes
98
- */
99
- unsubscribe(handle: ListenerHandle): void
100
-
101
- /**
102
- * Optional: Destroy/cleanup resources
103
- */
104
- destroy?(): Promise<void>
105
- }
106
-
107
- interface PersisterCapabilities {
108
- /** Can read data */
109
- read: boolean
110
- /** Can write data */
111
- write: boolean
112
- /** Can watch for external changes */
113
- watch: boolean
114
- /** Supports incremental updates (vs full rewrite) */
115
- incremental: boolean
116
- /** Is source of truth (vs cache) */
117
- authoritative: boolean
118
- }
119
-
120
- interface PersistedGraph {
121
- nodes: StoredNode[]
122
- edges: StoredEdge[]
123
- metadata?: GraphMetadata
124
- }
125
-
126
- interface GraphChanges {
127
- /** Nodes that were added/modified */
128
- dirtyNodes: string[]
129
- /** Nodes that were deleted */
130
- deletedNodes: string[]
131
- /** Edges that were added/modified */
132
- dirtyEdges: string[]
133
- /** Edges that were deleted */
134
- deletedEdges: string[]
135
- }
136
-
137
- type PersisterListener = (changes?: GraphChanges) => void
138
- ```
139
-
140
- ---
141
-
142
- ## Built-in Persisters
143
-
144
- ### 1. JSONL Persister (Source of Truth)
145
-
146
- Primary storage format, git-tracked and merge-friendly.
147
-
148
- ```typescript
149
- interface JSONLPersisterConfig {
150
- /** Path to JSONL file(s) */
151
- path: string | {
152
- nodes: string // e.g., "graph.jsonl" or split files
153
- edges?: string // e.g., "edges.jsonl"
154
- }
155
-
156
- /** Whether to split by node type */
157
- splitByType?: boolean // context.jsonl, tasks.jsonl, etc.
158
-
159
- /** Atomic write strategy */
160
- atomicWrite?: 'rename' | 'write-sync' | 'none'
161
-
162
- /** Content hashing for dedup */
163
- contentHashing?: boolean
164
- }
165
-
166
- const jsonlPersister = createJSONLPersister({
167
- path: '.opentasks/graph.jsonl',
168
- atomicWrite: 'rename',
169
- contentHashing: true,
170
- })
171
- ```
172
-
173
- **Features:**
174
- - **Append-only writes** — updates append a new line with the same ID and newer `updated_at` (never overwrite in-place)
175
- - Content hashing to detect actual changes
176
- - On load, deduplicate by keeping latest `updated_at` per ID
177
- - Custom merge driver for conflict-free git merges (see [plans/PHASE-3.md](./plans/PHASE-3.md))
178
- - Periodic compaction to remove duplicate entries
179
-
180
- **File Format:**
181
- ```jsonl
182
- {"id":"c-a2b3","type":"context","title":"Auth requirements",...}
183
- {"id":"t-x7k9","type":"task","title":"Implement login",...}
184
- {"id":"x-r8s9","type":"edge","from_id":"t-x7k9","to_id":"c-a2b3",...}
185
- ```
186
-
187
- ### 2. SQLite Persister (Query Cache)
188
-
189
- Fast query layer, rebuilt from JSONL.
190
-
191
- ```typescript
192
- interface SQLitePersisterConfig {
193
- /** Path to database file */
194
- path: string // e.g., ".opentasks/cache.db"
195
-
196
- /** WAL mode for better concurrency */
197
- walMode?: boolean
198
-
199
- /** Rebuild triggers */
200
- rebuildOn?: ('startup' | 'jsonl-change' | 'manual')[]
201
-
202
- /** Indexes to create */
203
- indexes?: IndexConfig[]
204
- }
205
-
206
- const sqlitePersister = createSQLitePersister({
207
- path: '.opentasks/cache.db',
208
- walMode: true,
209
- rebuildOn: ['startup', 'jsonl-change'],
210
- })
211
- ```
212
-
213
- **Features:**
214
- - Indexes on common query patterns (status, priority, type, etc.)
215
- - Views for computed queries (ready_issues, blocked_issues)
216
- - Dirty tracking table for incremental export
217
- - Content hash table for dedup
218
- - Gitignored (ephemeral cache)
219
-
220
- **Schema:**
221
- ```sql
222
- -- Core tables
223
- CREATE TABLE nodes (
224
- id TEXT PRIMARY KEY,
225
- uuid TEXT UNIQUE,
226
- type TEXT NOT NULL,
227
- title TEXT NOT NULL,
228
- content TEXT,
229
- status TEXT,
230
- priority INTEGER,
231
- -- ... other fields
232
- content_hash TEXT,
233
- created_at TEXT,
234
- updated_at TEXT
235
- );
236
-
237
- CREATE TABLE edges (
238
- id TEXT PRIMARY KEY,
239
- from_id TEXT NOT NULL,
240
- to_id TEXT NOT NULL,
241
- type TEXT NOT NULL,
242
- created_at TEXT
243
- );
244
-
245
- -- Dirty tracking
246
- CREATE TABLE dirty_nodes (
247
- node_id TEXT PRIMARY KEY,
248
- marked_at TEXT NOT NULL
249
- );
250
-
251
- CREATE TABLE export_hashes (
252
- node_id TEXT PRIMARY KEY,
253
- content_hash TEXT NOT NULL
254
- );
255
-
256
- -- Metadata
257
- CREATE TABLE metadata (
258
- key TEXT PRIMARY KEY,
259
- value TEXT
260
- );
261
-
262
- -- Views
263
- CREATE VIEW ready_issues AS
264
- SELECT i.* FROM nodes i
265
- WHERE i.type = 'issue'
266
- AND i.status = 'open'
267
- AND i.archived IS NOT TRUE
268
- AND NOT EXISTS (
269
- SELECT 1 FROM edges e
270
- JOIN nodes blocker ON e.from_id = blocker.id
271
- WHERE e.to_id = i.id
272
- AND e.type = 'blocks'
273
- AND blocker.status != 'closed'
274
- );
275
- ```
276
-
277
- ### 3. Markdown Persister (File Expansion)
278
-
279
- Expands nodes to individual markdown files for agent editing.
280
-
281
- ```typescript
282
- interface MarkdownPersisterConfig {
283
- /** Base directory for markdown files */
284
- basePath: string // e.g., ".opentasks/"
285
-
286
- /** Directory structure */
287
- structure: {
288
- context?: string // e.g., "context/" → .opentasks/context/*.md
289
- tasks?: string // e.g., "tasks/"
290
- feedback?: string // e.g., "feedback/"
291
- }
292
-
293
- /** Filename pattern */
294
- filenamePattern?: 'id' | 'id-title' | 'title-slug'
295
-
296
- /** Frontmatter format */
297
- frontmatter?: 'yaml' | 'toml' | 'json'
298
-
299
- /** Which node types to expand */
300
- expandTypes?: NodeType[]
301
-
302
- /** Bidirectional sync */
303
- watchFiles?: boolean
304
- }
305
-
306
- const markdownPersister = createMarkdownPersister({
307
- basePath: '.opentasks/',
308
- structure: {
309
- context: 'context/',
310
- tasks: 'tasks/',
311
- },
312
- filenamePattern: 'id-title',
313
- frontmatter: 'yaml',
314
- watchFiles: true,
315
- })
316
- ```
317
-
318
- **Features:**
319
- - Bidirectional sync (JSONL ↔ Markdown)
320
- - Frontmatter for metadata, body for content
321
- - File watcher for external changes
322
- - Agents can edit markdown directly with standard tools
323
- - Git-tracked alongside JSONL
324
-
325
- **File Format:**
326
- ```markdown
327
- ---
328
- id: c-a2b3
329
- type: context
330
- title: Authentication Requirements
331
- status: active
332
- priority: 1
333
- tags:
334
- - auth
335
- - security
336
- created_at: 2025-01-26T10:00:00Z
337
- updated_at: 2025-01-26T10:00:00Z
338
- ---
339
-
340
- ## Overview
341
-
342
- Users should be able to authenticate using OAuth2...
343
-
344
- ## Requirements
345
-
346
- 1. Support Google and GitHub OAuth providers
347
- 2. Session management with secure cookies
348
- 3. ...
349
- ```
350
-
351
- ### 4. Provider Persister (Delegated Storage)
352
-
353
- Delegates storage to an underlying system (beads, sudocode, etc.).
354
-
355
- ```typescript
356
- interface ProviderPersisterConfig {
357
- /** Provider integration to use */
358
- provider: Integration
359
-
360
- /** Sync direction */
361
- direction: 'read-only' | 'write-through' | 'bidirectional'
362
-
363
- /** Conflict resolution */
364
- conflictStrategy: 'local-wins' | 'remote-wins' | 'manual'
365
-
366
- /** Node filter (which nodes to delegate) */
367
- filter?: (node: Node) => boolean
368
- }
369
-
370
- const beadsPersister = createProviderPersister({
371
- provider: beadsIntegration,
372
- direction: 'bidirectional',
373
- conflictStrategy: 'remote-wins',
374
- filter: (node) => node.source === 'beads',
375
- })
376
- ```
377
-
378
- **Features:**
379
- - Routes operations to underlying provider
380
- - Respects provider's native storage format
381
- - Syncs changes bidirectionally
382
- - Can filter which nodes are delegated
383
-
384
- ---
385
-
386
- ## Persistence Manager
387
-
388
- Coordinates multiple persisters with priority and sync logic.
389
-
390
- ```typescript
391
- interface PersistenceManagerConfig {
392
- /** Ordered list of persisters (first = highest priority for reads) */
393
- persisters: Persister[]
394
-
395
- /** Flush configuration */
396
- flush: {
397
- /** Debounce delay for batching writes */
398
- debounceMs: number // e.g., 5000 (5 seconds)
399
-
400
- /** Maximum delay before forced flush */
401
- maxDelayMs: number // e.g., 30000 (30 seconds)
402
-
403
- /** Flush on shutdown */
404
- flushOnShutdown: boolean
405
- }
406
-
407
- /** Sync configuration */
408
- sync: {
409
- /** Auto-import on external changes */
410
- autoImport: boolean
411
-
412
- /** Auto-export dirty nodes */
413
- autoExport: boolean
414
-
415
- /** Incremental threshold (full export if more dirty) */
416
- incrementalThreshold: number // e.g., 1000
417
- incrementalRatio: number // e.g., 0.2 (20%)
418
- }
419
- }
420
-
421
- class PersistenceManager {
422
- constructor(config: PersistenceManagerConfig)
423
-
424
- /** Load graph from persisters (merges with priority) */
425
- async load(): Promise<Graph>
426
-
427
- /** Mark nodes as dirty (triggers flush scheduling) */
428
- markDirty(nodeIds: string[]): void
429
-
430
- /** Force immediate flush */
431
- async flush(): Promise<void>
432
-
433
- /** Shutdown with final flush */
434
- async shutdown(): Promise<void>
435
-
436
- /** Subscribe to graph changes (from any persister) */
437
- subscribe(listener: GraphListener): () => void
438
- }
439
- ```
440
-
441
- ### Flush Manager
442
-
443
- Event-driven flush coordination (inspired by beads' FlushManager).
444
-
445
- ```typescript
446
- /**
447
- * FlushManager handles debounced, batched writes
448
- * Single goroutine/async loop owns all state (no locks needed)
449
- */
450
- class FlushManager {
451
- private dirtyNodes: Set<string> = new Set()
452
- private debounceTimer: Timer | null = null
453
- private maxDelayTimer: Timer | null = null
454
-
455
- /** Mark node as dirty, schedule flush */
456
- markDirty(nodeId: string): void {
457
- this.dirtyNodes.add(nodeId)
458
- this.scheduleFlush()
459
- }
460
-
461
- /** Schedule debounced flush */
462
- private scheduleFlush(): void {
463
- // Reset debounce timer
464
- if (this.debounceTimer) clearTimeout(this.debounceTimer)
465
- this.debounceTimer = setTimeout(() => this.flush(), this.debounceMs)
466
-
467
- // Start max delay timer if not running
468
- if (!this.maxDelayTimer) {
469
- this.maxDelayTimer = setTimeout(() => this.flush(), this.maxDelayMs)
470
- }
471
- }
472
-
473
- /** Execute flush */
474
- private async flush(): Promise<void> {
475
- if (this.dirtyNodes.size === 0) return
476
-
477
- const toFlush = new Set(this.dirtyNodes)
478
- this.dirtyNodes.clear()
479
- this.clearTimers()
480
-
481
- // Determine full vs incremental export
482
- const totalNodes = await this.getTotalNodeCount()
483
- const dirtyRatio = toFlush.size / totalNodes
484
- const useIncremental =
485
- totalNodes > this.incrementalThreshold &&
486
- dirtyRatio < this.incrementalRatio
487
-
488
- // Execute flush on each persister
489
- for (const persister of this.persisters) {
490
- if (persister.capabilities.write) {
491
- await persister.setPersisted(
492
- () => this.getGraphContent(),
493
- useIncremental ? { dirtyNodes: [...toFlush] } : undefined
494
- )
495
- }
496
- }
497
- }
498
- }
499
- ```
500
-
501
- ---
502
-
503
- ## Dirty Tracking
504
-
505
- Track which nodes have changed for incremental sync.
506
-
507
- ```typescript
508
- interface DirtyTracker {
509
- /** Mark node as dirty */
510
- markDirty(nodeId: string): void
511
-
512
- /** Mark multiple nodes as dirty */
513
- markDirtyBatch(nodeIds: string[]): void
514
-
515
- /** Get all dirty node IDs */
516
- getDirtyNodes(): string[]
517
-
518
- /** Clear dirty status for exported nodes */
519
- clearDirty(nodeIds: string[]): void
520
-
521
- /** Clear all dirty status */
522
- clearAll(): void
523
- }
524
-
525
- interface ContentHashTracker {
526
- /** Get last exported hash for node */
527
- getExportHash(nodeId: string): string | null
528
-
529
- /** Set export hash after successful export */
530
- setExportHash(nodeId: string, hash: string): void
531
-
532
- /** Check if node content has changed */
533
- hasChanged(nodeId: string, currentHash: string): boolean
534
-
535
- /** Clear all hashes (forces full re-export) */
536
- clearAll(): void
537
- }
538
- ```
539
-
540
- **Integration with SQLite cache:**
541
- ```sql
542
- -- Mark node dirty
543
- INSERT OR REPLACE INTO dirty_nodes (node_id, marked_at)
544
- VALUES (?, datetime('now'));
545
-
546
- -- Get dirty nodes (ordered by marked time)
547
- SELECT node_id FROM dirty_nodes ORDER BY marked_at;
548
-
549
- -- Clear dirty after export
550
- DELETE FROM dirty_nodes WHERE node_id IN (?);
551
-
552
- -- Track export hashes
553
- INSERT OR REPLACE INTO export_hashes (node_id, content_hash)
554
- VALUES (?, ?);
555
-
556
- -- Check if changed
557
- SELECT content_hash FROM export_hashes WHERE node_id = ?;
558
- ```
559
-
560
- ---
561
-
562
- ## Multi-Location Support
563
-
564
- ### Location Identity
565
-
566
- Each `.opentasks/` directory has a deterministic identity. See [plans/PHASE-2.md](./plans/PHASE-2.md) for full specification.
567
-
568
- ```typescript
569
- interface Location {
570
- /** Deterministic hash: SHA256(git_remote_url + ":" + repo_relative_path) → 8-char base36 */
571
- hash: string
572
-
573
- /** Random UUID v4 for uniqueness guarantee */
574
- uuid: string
575
-
576
- /** Human-readable name */
577
- name: string
578
- }
579
- ```
580
-
581
- ### Explicit Connections (Not Discovery)
582
-
583
- Locations declare connections explicitly in `config.json`. No filesystem discovery at runtime.
584
-
585
- ```typescript
586
- interface Connection {
587
- /** Location hash of the target */
588
- hash: string
589
-
590
- /** Relative or absolute path to target's .opentasks/ */
591
- path: string
592
-
593
- /** Relationship: peer, parent, worker, manager */
594
- role: string
595
-
596
- /** Human-readable name */
597
- name?: string
598
- }
599
- ```
600
-
601
- ### Redirect Support (Role-Based)
602
-
603
- For worktree and multi-location scenarios. Redirects use **roles** (set by orchestrator in config), not agent identity.
604
-
605
- ```typescript
606
- interface RedirectRule {
607
- /** Operations to redirect */
608
- operations: ('read' | 'write')[]
609
-
610
- /** Pattern for node IDs (glob): "*", "i-*", "s-*" */
611
- pattern: string
612
-
613
- /** Target location (hash URI or relative path) */
614
- target: string
615
-
616
- /** Lower = higher priority, default 100 */
617
- priority: number
618
-
619
- /** What to do if target unreachable */
620
- fallback: 'local' | 'error'
621
-
622
- /** Conditions (optional) */
623
- when?: {
624
- role?: string // from config.json role field (trusted)
625
- branch?: string // git branch glob pattern
626
- }
627
- }
628
- ```
629
-
630
- Rule evaluation: sorted by priority (ascending), first match wins. Max redirect depth: 3 hops.
631
-
632
- ### Worktree Registration (Explicit, Not Passive)
633
-
634
- Worktrees are registered explicitly via `opentasks worktree setup`, not auto-detected from `.git` files. This stores actual paths and avoids assumptions about directory layout.
635
-
636
- ```typescript
637
- interface RegisteredWorktree {
638
- /** Worktree root path */
639
- path: string
640
-
641
- /** Path to .opentasks/ directory */
642
- opentasksPath: string
643
-
644
- /** Location hash */
645
- hash: string
646
-
647
- /** Git branch */
648
- branch: string
649
-
650
- /** Role: manager or worker */
651
- role: 'manager' | 'worker'
652
-
653
- /** Location hash of redirect target (if worker) */
654
- redirectTarget?: string
655
- }
656
- ```
657
-
658
- Registry stored at `.git/opentasks/worktrees.json` (shared across worktrees, daemon is sole writer).
659
-
660
- See [plans/PHASE-3.md](./plans/PHASE-3.md) for worktree CLI specification.
661
-
662
- ---
663
-
664
- ## Sync Strategies
665
-
666
- ### Import Strategy
667
-
668
- ```typescript
669
- interface ImportStrategy {
670
- /** Detect if import needed */
671
- needsImport(): Promise<boolean>
672
-
673
- /** Execute import */
674
- import(): Promise<ImportResult>
675
- }
676
-
677
- interface ImportResult {
678
- imported: number
679
- conflicts: ConflictInfo[]
680
- errors: Error[]
681
- }
682
-
683
- // Content-hash based detection (git-proof)
684
- class ContentHashImportStrategy implements ImportStrategy {
685
- async needsImport(): Promise<boolean> {
686
- const currentHash = await this.computeJSONLHash()
687
- const storedHash = await this.getStoredJSONLHash()
688
- return currentHash !== storedHash
689
- }
690
- }
691
- ```
692
-
693
- ### Export Strategy
694
-
695
- ```typescript
696
- interface ExportStrategy {
697
- /** Determine export mode */
698
- getMode(): 'full' | 'incremental'
699
-
700
- /** Execute export */
701
- export(mode: 'full' | 'incremental'): Promise<ExportResult>
702
- }
703
-
704
- interface ExportResult {
705
- exported: number
706
- mode: 'full' | 'incremental'
707
- duration: number
708
- }
709
-
710
- // Incremental with fallback to full
711
- class HybridExportStrategy implements ExportStrategy {
712
- getMode(): 'full' | 'incremental' {
713
- const dirtyCount = this.getDirtyCount()
714
- const totalCount = this.getTotalCount()
715
-
716
- if (totalCount < this.incrementalThreshold) return 'full'
717
- if (dirtyCount / totalCount > this.incrementalRatio) return 'full'
718
- return 'incremental'
719
- }
720
- }
721
- ```
722
-
723
- ### Conflict Resolution
724
-
725
- ```typescript
726
- interface ConflictResolver {
727
- /** Detect conflicts */
728
- detectConflicts(local: Node, remote: Node): Conflict | null
729
-
730
- /** Resolve conflict */
731
- resolve(conflict: Conflict, strategy: ConflictStrategy): Node
732
- }
733
-
734
- type ConflictStrategy =
735
- | 'local-wins'
736
- | 'remote-wins'
737
- | 'newer-wins'
738
- | 'merge'
739
- | 'manual'
740
-
741
- interface Conflict {
742
- nodeId: string
743
- local: Node
744
- remote: Node
745
- type: 'update-update' | 'update-delete' | 'delete-update'
746
- }
747
- ```
748
-
749
- ---
750
-
751
- ## Atomic Operations
752
-
753
- ### Atomic File Writes
754
-
755
- ```typescript
756
- /**
757
- * Atomic write using temp file + rename
758
- * Prevents partial writes on crash
759
- */
760
- async function atomicWrite(
761
- path: string,
762
- content: string | Buffer
763
- ): Promise<void> {
764
- const tempPath = `${path}.${process.pid}.tmp`
765
-
766
- try {
767
- await fs.writeFile(tempPath, content)
768
- await fs.rename(tempPath, path)
769
- } catch (error) {
770
- // Clean up temp file on failure
771
- await fs.unlink(tempPath).catch(() => {})
772
- throw error
773
- }
774
- }
775
- ```
776
-
777
- ### Transaction Support
778
-
779
- ```typescript
780
- interface Transaction {
781
- /** Begin transaction */
782
- begin(): Promise<void>
783
-
784
- /** Commit transaction */
785
- commit(): Promise<void>
786
-
787
- /** Rollback transaction */
788
- rollback(): Promise<void>
789
-
790
- /** Execute in transaction */
791
- execute<T>(fn: () => Promise<T>): Promise<T>
792
- }
793
-
794
- // Two-phase commit for multi-persister writes
795
- class MultiPersisterTransaction implements Transaction {
796
- async execute<T>(fn: () => Promise<T>): Promise<T> {
797
- await this.begin()
798
- try {
799
- const result = await fn()
800
- await this.commit()
801
- return result
802
- } catch (error) {
803
- await this.rollback()
804
- throw error
805
- }
806
- }
807
- }
808
- ```
809
-
810
- ---
811
-
812
- ## Configuration
813
-
814
- ### Default Configuration
815
-
816
- ```typescript
817
- const defaultPersistenceConfig: PersistenceManagerConfig = {
818
- persisters: [
819
- createJSONLPersister({
820
- path: '.opentasks/graph.jsonl',
821
- atomicWrite: 'rename',
822
- contentHashing: true,
823
- }),
824
- createSQLitePersister({
825
- path: '.opentasks/cache.db',
826
- walMode: true,
827
- rebuildOn: ['startup', 'jsonl-change'],
828
- }),
829
- ],
830
-
831
- flush: {
832
- debounceMs: 5000,
833
- maxDelayMs: 30000,
834
- flushOnShutdown: true,
835
- },
836
-
837
- sync: {
838
- autoImport: true,
839
- autoExport: true,
840
- incrementalThreshold: 1000,
841
- incrementalRatio: 0.2,
842
- },
843
- }
844
- ```
845
-
846
- ### With Markdown Expansion
847
-
848
- ```typescript
849
- const withMarkdownConfig: PersistenceManagerConfig = {
850
- persisters: [
851
- createJSONLPersister({ /* ... */ }),
852
- createSQLitePersister({ /* ... */ }),
853
- createMarkdownPersister({
854
- basePath: '.opentasks/',
855
- structure: {
856
- context: 'context/',
857
- tasks: 'tasks/',
858
- },
859
- watchFiles: true,
860
- }),
861
- ],
862
- // ...
863
- }
864
- ```
865
-
866
- ### With Provider Delegation
867
-
868
- ```typescript
869
- const withBeadsConfig: PersistenceManagerConfig = {
870
- persisters: [
871
- // Local storage for opentasks-native nodes
872
- createJSONLPersister({ /* ... */ }),
873
- createSQLitePersister({ /* ... */ }),
874
-
875
- // Delegate to beads for beads-sourced nodes
876
- createProviderPersister({
877
- provider: beadsIntegration,
878
- direction: 'bidirectional',
879
- filter: (node) => node.source === 'beads',
880
- }),
881
- ],
882
- // ...
883
- }
884
- ```
885
-
886
- ---
887
-
888
- ## File Structure
889
-
890
- ```
891
- .opentasks/
892
- ├── graph.jsonl # Source of truth: nodes + edges, append-only (git-tracked)
893
- ├── tombstones.jsonl # Soft-deleted nodes (configurable gitignore)
894
- ├── cache.db # SQLite cache in WAL mode (gitignored, can be rebuilt)
895
- ├── config.json # Configuration, connections, role, redirects
896
- ├── write.lock # Advisory lock for JSONL writes (gitignored)
897
- ├── context/ # Optional: markdown expansion
898
- │ ├── c-a2b3-auth-requirements.md
899
- │ └── c-c4d5-api-design.md
900
- └── tasks/ # Optional: markdown expansion
901
- ├── t-x7k9-implement-login.md
902
- └── i-y8z0-add-tests.md
903
-
904
- .git/opentasks/ # Shared across all worktrees (Phase 3)
905
- ├── daemon.sock # Single daemon socket
906
- ├── daemon.lock # Daemon PID lock
907
- └── worktrees.json # Registered worktrees
908
- ```
909
-
910
- See [plans/CORE-ARCHITECTURE.md](./plans/CORE-ARCHITECTURE.md) for cross-location architecture and daemon details.
911
-
912
- **.gitignore:**
913
- ```gitignore
914
- # Cache files (rebuilt from JSONL)
915
- .opentasks/cache.db
916
- .opentasks/cache.db-*
917
-
918
- # Write lock
919
- .opentasks/write.lock
920
-
921
- # Temp files
922
- .opentasks/*.tmp
923
-
924
- # Optional: tombstones (user choice)
925
- # .opentasks/tombstones.jsonl
926
- ```
927
-
928
- **.gitattributes:**
929
- ```gitattributes
930
- # Custom merge driver for conflict-free JSONL merges
931
- .opentasks/graph.jsonl merge=opentasks
932
- ```
933
-
934
- ---
935
-
936
- ## Open Questions
937
-
938
- - [ ] **Split vs single JSONL**: One `graph.jsonl` or split by type?
939
- - [ ] **Cross-persister transactions**: How to ensure atomicity across JSONL + SQLite + Markdown?
940
- - [ ] **Compaction trigger**: Automatic vs manual compaction scheduling?
941
-
942
- ---
943
-
944
- ## Markdown Sync Design
945
-
946
- Bidirectional sync between JSONL (source of truth) and Markdown files (agent-editable).
947
-
948
- ### The Challenge
949
-
950
- ```
951
- ┌─────────────────┐
952
- │ git pull │
953
- │ git checkout │
954
- └────────┬────────┘
955
-
956
- ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
957
- │ graph.jsonl │←──→│ Daemon │←──→│ context/*.md │
958
- │ (git-tracked) │ │ (mediator) │ │ (git-tracked) │
959
- └─────────────────┘ └─────────────────┘ └─────────────────┘
960
- ↑ ↑
961
- │ │
962
- git operations user/agent edits
963
- (merge, rebase) (random access)
964
- ```
965
-
966
- **Conflict scenarios:**
967
- 1. **Git updates JSONL** → markdown files need refresh
968
- 2. **User edits markdown** → JSONL needs update
969
- 3. **Both change simultaneously** → conflict resolution needed
970
- 4. **Git updates both** → merge may create inconsistencies
971
-
972
- ### Content Hash Tracking
973
-
974
- Track hashes at multiple levels to detect changes:
975
-
976
- ```typescript
977
- interface SyncState {
978
- /** Per-node tracking */
979
- nodes: Map<string, NodeSyncState>
980
-
981
- /** File-level tracking */
982
- files: Map<string, FileSyncState>
983
-
984
- /** Last successful sync timestamp */
985
- lastSync: string
986
- }
987
-
988
- interface NodeSyncState {
989
- nodeId: string
990
-
991
- /** Hash of node content in JSONL */
992
- jsonlHash: string
993
-
994
- /** Hash of node content in markdown (if expanded) */
995
- markdownHash?: string
996
-
997
- /** Hash at last successful sync */
998
- lastSyncHash: string
999
-
1000
- /** Sync status */
1001
- status: 'synced' | 'jsonl-ahead' | 'markdown-ahead' | 'conflict'
1002
- }
1003
-
1004
- interface FileSyncState {
1005
- path: string
1006
-
1007
- /** File content hash */
1008
- contentHash: string
1009
-
1010
- /** File mtime (for quick dirty check) */
1011
- mtime: number
1012
-
1013
- /** Associated node ID */
1014
- nodeId: string
1015
- }
1016
- ```
1017
-
1018
- ### Sync Algorithm
1019
-
1020
- ```typescript
1021
- class MarkdownSyncManager {
1022
- /**
1023
- * Detect and categorize changes
1024
- */
1025
- async detectChanges(): Promise<SyncChanges> {
1026
- const changes: SyncChanges = {
1027
- jsonlUpdated: [], // JSONL changed, markdown needs update
1028
- markdownUpdated: [], // Markdown changed, JSONL needs update
1029
- conflicts: [], // Both changed differently
1030
- newInJsonl: [], // New nodes to expand to markdown
1031
- deletedInJsonl: [], // Nodes removed, delete markdown files
1032
- }
1033
-
1034
- for (const [nodeId, state] of this.syncState.nodes) {
1035
- const currentJsonlHash = await this.computeJsonlHash(nodeId)
1036
- const currentMarkdownHash = await this.computeMarkdownHash(nodeId)
1037
-
1038
- const jsonlChanged = currentJsonlHash !== state.jsonlHash
1039
- const markdownChanged = currentMarkdownHash !== state.markdownHash
1040
-
1041
- if (jsonlChanged && markdownChanged) {
1042
- // Both changed - potential conflict
1043
- if (currentJsonlHash === currentMarkdownHash) {
1044
- // Same content - no conflict, just update state
1045
- changes.jsonlUpdated.push(nodeId) // or markdownUpdated, same result
1046
- } else {
1047
- changes.conflicts.push({
1048
- nodeId,
1049
- jsonlHash: currentJsonlHash,
1050
- markdownHash: currentMarkdownHash,
1051
- })
1052
- }
1053
- } else if (jsonlChanged) {
1054
- changes.jsonlUpdated.push(nodeId)
1055
- } else if (markdownChanged) {
1056
- changes.markdownUpdated.push(nodeId)
1057
- }
1058
- }
1059
-
1060
- return changes
1061
- }
1062
-
1063
- /**
1064
- * Apply sync with conflict resolution
1065
- */
1066
- async sync(strategy: SyncStrategy): Promise<SyncResult> {
1067
- const changes = await this.detectChanges()
1068
-
1069
- // Handle non-conflicting changes
1070
- for (const nodeId of changes.jsonlUpdated) {
1071
- await this.updateMarkdownFromJsonl(nodeId)
1072
- }
1073
-
1074
- for (const nodeId of changes.markdownUpdated) {
1075
- await this.updateJsonlFromMarkdown(nodeId)
1076
- }
1077
-
1078
- // Handle conflicts based on strategy
1079
- for (const conflict of changes.conflicts) {
1080
- await this.resolveConflict(conflict, strategy)
1081
- }
1082
-
1083
- // Update sync state
1084
- await this.updateSyncState()
1085
-
1086
- return { /* results */ }
1087
- }
1088
- }
1089
- ```
1090
-
1091
- ### Conflict Resolution Strategies
1092
-
1093
- ```typescript
1094
- type SyncStrategy =
1095
- | 'jsonl-wins' // JSONL is authoritative
1096
- | 'markdown-wins' // Markdown edits take priority
1097
- | 'newer-wins' // Compare timestamps
1098
- | 'merge-content' // Attempt content merge
1099
- | 'manual' // Create .conflict file for user
1100
- | 'interactive' // Prompt user/agent
1101
-
1102
- interface ConflictResolution {
1103
- strategy: SyncStrategy
1104
-
1105
- /** For merge-content: how to merge */
1106
- mergeOptions?: {
1107
- /** Merge frontmatter (metadata) */
1108
- frontmatter: 'jsonl' | 'markdown' | 'merge-fields'
1109
-
1110
- /** Merge body (content) */
1111
- body: 'jsonl' | 'markdown' | 'diff3'
1112
- }
1113
-
1114
- /** For manual: where to write conflict file */
1115
- conflictFilePattern?: string // e.g., "{path}.conflict"
1116
- }
1117
- ```
1118
-
1119
- ### Recommended Default Strategy
1120
-
1121
- ```typescript
1122
- const defaultSyncStrategy: ConflictResolution = {
1123
- strategy: 'merge-content',
1124
- mergeOptions: {
1125
- // Metadata: JSONL wins (more structured, less likely user-edited)
1126
- frontmatter: 'merge-fields', // Per-field: newer timestamp wins
1127
-
1128
- // Content: Markdown wins (user/agent edits are intentional)
1129
- body: 'markdown',
1130
- },
1131
- }
1132
- ```
1133
-
1134
- **Rationale:**
1135
- - **Frontmatter/metadata**: JSONL is structured, edits there are programmatic
1136
- - **Body/content**: Markdown edits are intentional (user or agent writing)
1137
- - **Fallback**: If merge fails, create `.conflict` file
1138
-
1139
- ### Git Operation Handling
1140
-
1141
- ```typescript
1142
- interface GitEventHandler {
1143
- /**
1144
- * Called after git pull/merge/checkout
1145
- * JSONL may have changed, need to refresh markdown
1146
- */
1147
- async onGitUpdate(): Promise<void> {
1148
- // 1. Detect JSONL changes via content hash
1149
- const jsonlChanged = await this.hasJsonlChanged()
1150
-
1151
- if (jsonlChanged) {
1152
- // 2. Check for uncommitted markdown changes
1153
- const uncommittedMd = await this.getUncommittedMarkdownChanges()
1154
-
1155
- if (uncommittedMd.length > 0) {
1156
- // 3. Stash markdown changes, apply JSONL, re-apply markdown
1157
- await this.stashMarkdownChanges(uncommittedMd)
1158
- await this.refreshMarkdownFromJsonl()
1159
- await this.reapplyMarkdownChanges(uncommittedMd)
1160
- } else {
1161
- // Simple case: just refresh markdown
1162
- await this.refreshMarkdownFromJsonl()
1163
- }
1164
- }
1165
- }
1166
-
1167
- /**
1168
- * Called before git commit
1169
- * Ensure JSONL is up-to-date with markdown changes
1170
- */
1171
- async onPreCommit(): Promise<void> {
1172
- // Sync markdown changes to JSONL before commit
1173
- await this.syncMarkdownToJsonl()
1174
- }
1175
- }
1176
- ```
1177
-
1178
- ### File Watcher Integration
1179
-
1180
- ```typescript
1181
- interface FileWatcher {
1182
- /** Watch markdown directory for changes */
1183
- watch(paths: string[], callback: WatchCallback): WatchHandle
1184
-
1185
- /** Debounce rapid changes */
1186
- debounceMs: number // e.g., 500ms
1187
-
1188
- /** Ignore patterns */
1189
- ignore: string[] // e.g., ['*.tmp', '*.conflict']
1190
- }
1191
-
1192
- class MarkdownFileWatcher {
1193
- private watcher: FSWatcher
1194
- private pending: Map<string, NodeJS.Timeout> = new Map()
1195
-
1196
- constructor(private syncManager: MarkdownSyncManager) {}
1197
-
1198
- async onFileChange(path: string, event: 'change' | 'add' | 'unlink') {
1199
- // Debounce rapid changes
1200
- if (this.pending.has(path)) {
1201
- clearTimeout(this.pending.get(path))
1202
- }
1203
-
1204
- this.pending.set(path, setTimeout(async () => {
1205
- this.pending.delete(path)
1206
-
1207
- switch (event) {
1208
- case 'change':
1209
- await this.syncManager.onMarkdownChanged(path)
1210
- break
1211
- case 'add':
1212
- await this.syncManager.onMarkdownCreated(path)
1213
- break
1214
- case 'unlink':
1215
- await this.syncManager.onMarkdownDeleted(path)
1216
- break
1217
- }
1218
- }, this.debounceMs))
1219
- }
1220
- }
1221
- ```
1222
-
1223
- ---
1224
-
1225
- ## Compaction Strategy
1226
-
1227
- Prevent JSONL files from growing unbounded. Inspired by beads' tiered compaction.
1228
-
1229
- ### The Problem
1230
-
1231
- ```
1232
- graph.jsonl grows over time:
1233
- - New nodes added
1234
- - Node updates append (for merge-friendliness)
1235
- - Deleted nodes become tombstones
1236
- - Old closed issues accumulate
1237
-
1238
- Without compaction:
1239
- - File size grows linearly
1240
- - Parse time increases
1241
- - Git history bloats
1242
- ```
1243
-
1244
- ### Compaction Levels
1245
-
1246
- ```typescript
1247
- interface CompactionConfig {
1248
- /** Enable automatic compaction */
1249
- enabled: boolean
1250
-
1251
- /** Tier 1: Basic compaction */
1252
- tier1: {
1253
- /** Days after close before eligible */
1254
- afterDays: number // default: 30
1255
-
1256
- /** Don't compact if has open dependents within N levels */
1257
- dependencyLevels: number // default: 2
1258
-
1259
- /** Summarization approach */
1260
- summarize: 'truncate' | 'llm' | 'none'
1261
-
1262
- /** Target size reduction */
1263
- targetReduction: number // default: 0.7 (70%)
1264
- }
1265
-
1266
- /** Tier 2: Aggressive compaction */
1267
- tier2: {
1268
- afterDays: number // default: 90
1269
- dependencyLevels: number // default: 5
1270
- targetReduction: number // default: 0.95 (95%)
1271
- }
1272
-
1273
- /** Tombstone cleanup */
1274
- tombstones: {
1275
- /** TTL before hard delete */
1276
- ttlDays: number // default: 30
1277
-
1278
- /** Minimum TTL (safety) */
1279
- minTtlDays: number // default: 7
1280
- }
1281
-
1282
- /** JSONL file management */
1283
- file: {
1284
- /** Max entries before triggering compaction */
1285
- maxEntries: number // default: 10000
1286
-
1287
- /** Max file size before triggering */
1288
- maxSizeMb: number // default: 10
1289
-
1290
- /** Compact on daemon startup */
1291
- compactOnStartup: boolean
1292
- }
1293
- }
1294
- ```
1295
-
1296
- ### Compaction Operations
1297
-
1298
- ```typescript
1299
- interface Compactor {
1300
- /**
1301
- * Analyze compaction candidates
1302
- */
1303
- analyze(): Promise<CompactionAnalysis>
1304
-
1305
- /**
1306
- * Execute compaction
1307
- */
1308
- compact(options: CompactOptions): Promise<CompactionResult>
1309
-
1310
- /**
1311
- * Prune expired tombstones
1312
- */
1313
- pruneTombstones(): Promise<PruneResult>
1314
-
1315
- /**
1316
- * Rewrite JSONL (dedupe entries, remove old versions)
1317
- */
1318
- rewriteJsonl(): Promise<RewriteResult>
1319
- }
1320
-
1321
- interface CompactionAnalysis {
1322
- /** Nodes eligible for Tier 1 */
1323
- tier1Candidates: NodeSummary[]
1324
-
1325
- /** Nodes eligible for Tier 2 */
1326
- tier2Candidates: NodeSummary[]
1327
-
1328
- /** Expired tombstones */
1329
- expiredTombstones: string[]
1330
-
1331
- /** Duplicate entries (same node, multiple versions) */
1332
- duplicateEntries: number
1333
-
1334
- /** Current file size */
1335
- currentSizeMb: number
1336
-
1337
- /** Estimated size after compaction */
1338
- estimatedSizeMb: number
1339
- }
1340
- ```
1341
-
1342
- ### JSONL Rewrite Strategy
1343
-
1344
- ```typescript
1345
- /**
1346
- * Rewrite JSONL to remove duplicates and old versions
1347
- * Only keeps latest version of each node
1348
- */
1349
- async function rewriteJsonl(path: string): Promise<void> {
1350
- const nodes = new Map<string, StoredNode>()
1351
- const edges = new Map<string, StoredEdge>()
1352
-
1353
- // Read all entries, keep only latest
1354
- for await (const line of readLines(path)) {
1355
- const entry = JSON.parse(line)
1356
-
1357
- if (entry.type === 'edge' || entry.id?.startsWith('x-')) {
1358
- edges.set(entry.id, entry)
1359
- } else {
1360
- // Compare timestamps, keep newer
1361
- const existing = nodes.get(entry.id)
1362
- if (!existing || entry.updated_at > existing.updated_at) {
1363
- nodes.set(entry.id, entry)
1364
- }
1365
- }
1366
- }
1367
-
1368
- // Filter out archived/deleted beyond retention
1369
- const retained = [...nodes.values()].filter(node => {
1370
- if (node.deleted_at) {
1371
- const age = Date.now() - new Date(node.deleted_at).getTime()
1372
- return age < TOMBSTONE_TTL_MS
1373
- }
1374
- return true
1375
- })
1376
-
1377
- // Atomic rewrite
1378
- const tempPath = `${path}.${process.pid}.tmp`
1379
- const output = fs.createWriteStream(tempPath)
1380
-
1381
- for (const node of retained) {
1382
- output.write(JSON.stringify(node) + '\n')
1383
- }
1384
- for (const edge of edges.values()) {
1385
- output.write(JSON.stringify(edge) + '\n')
1386
- }
1387
-
1388
- await output.close()
1389
- await fs.rename(tempPath, path)
1390
- }
1391
- ```
1392
-
1393
- ### Content Summarization
1394
-
1395
- For Tier 1+ compaction, optionally summarize content:
1396
-
1397
- ```typescript
1398
- interface ContentSummarizer {
1399
- /**
1400
- * Summarize node content
1401
- * Can use LLM or simple truncation
1402
- */
1403
- summarize(node: Node): Promise<SummarizedNode>
1404
- }
1405
-
1406
- interface SummarizedNode {
1407
- /** Compressed content */
1408
- content: string
1409
-
1410
- /** Original content size */
1411
- originalSize: number
1412
-
1413
- /** Compressed content size */
1414
- compressedSize: number
1415
-
1416
- /** Reduction percentage */
1417
- reductionPct: number
1418
- }
1419
-
1420
- // Simple truncation summarizer
1421
- class TruncateSummarizer implements ContentSummarizer {
1422
- async summarize(node: Node): Promise<SummarizedNode> {
1423
- const original = node.content || ''
1424
- const maxLength = 500
1425
-
1426
- const compressed = original.length > maxLength
1427
- ? original.slice(0, maxLength) + '\n\n[Content truncated during compaction]'
1428
- : original
1429
-
1430
- return {
1431
- content: compressed,
1432
- originalSize: original.length,
1433
- compressedSize: compressed.length,
1434
- reductionPct: 1 - (compressed.length / original.length),
1435
- }
1436
- }
1437
- }
1438
-
1439
- // LLM-based summarizer (like beads' Haiku integration)
1440
- class LLMSummarizer implements ContentSummarizer {
1441
- async summarize(node: Node): Promise<SummarizedNode> {
1442
- const prompt = `
1443
- Summarize this completed task for archival:
1444
-
1445
- Title: ${node.title}
1446
- Content: ${node.content}
1447
-
1448
- Provide:
1449
- - Summary: 2-3 sentences on what was done
1450
- - Key Decisions: Important technical choices
1451
- - Resolution: One sentence on outcome
1452
-
1453
- Keep it shorter than the original.
1454
- `
1455
-
1456
- const summary = await this.llm.complete(prompt)
1457
-
1458
- return {
1459
- content: summary,
1460
- originalSize: (node.content || '').length,
1461
- compressedSize: summary.length,
1462
- reductionPct: 1 - (summary.length / (node.content || '').length),
1463
- }
1464
- }
1465
- }
1466
- ```
1467
-
1468
- ### Snapshot for Recovery
1469
-
1470
- Before compaction, save original for potential recovery:
1471
-
1472
- ```typescript
1473
- interface CompactionSnapshot {
1474
- /** Node ID */
1475
- nodeId: string
1476
-
1477
- /** Compaction level applied */
1478
- level: number
1479
-
1480
- /** Full original content */
1481
- originalContent: string
1482
-
1483
- /** Original metadata */
1484
- originalMetadata: Record<string, unknown>
1485
-
1486
- /** When compacted */
1487
- compactedAt: string
1488
-
1489
- /** Git commit at compaction (for recovery) */
1490
- gitCommit?: string
1491
- }
1492
-
1493
- // Store in SQLite (not JSONL - too large)
1494
- // Can be pruned after longer retention (e.g., 1 year)
1495
- ```
1496
-
1497
- ### Pinned Nodes
1498
-
1499
- Protect important nodes from compaction:
1500
-
1501
- ```typescript
1502
- interface Node {
1503
- // ... other fields
1504
-
1505
- /** Protected from compaction */
1506
- pinned?: boolean
1507
-
1508
- /** Why pinned */
1509
- pinReason?: string
1510
- }
1511
-
1512
- // Compactor skips pinned nodes
1513
- function isCompactionEligible(node: Node): boolean {
1514
- if (node.pinned) return false
1515
- if (node.status !== 'closed') return false
1516
- if (hasOpenDependents(node)) return false
1517
- // ... other checks
1518
- }
1519
- ```
1520
-
1521
- ---
1522
-
1523
- ## Daemon Architecture
1524
-
1525
- ### Phased Approach
1526
-
1527
- - **Phase 2**: No daemon. SQLite WAL mode handles concurrent reads. Advisory file lock (`write.lock`) serializes JSONL writes. Direct file access only.
1528
- - **Phase 3**: Single daemon per git repository at `.git/opentasks/daemon.sock`. Manages all registered worktrees.
1529
-
1530
- ### Why a Single Daemon per Git Repo? (Phase 3)
1531
-
1532
- 1. **File watching** — Monitor JSONL and markdown for changes across all worktrees
1533
- 2. **Debounced writes** — Batch rapid changes before persisting
1534
- 3. **Cross-location coordination** — Multiple agents sharing state via in-process function calls (not IPC hops)
1535
- 4. **Background sync** — Provider sync, remote fetch
1536
- 5. **Compaction** — Periodic cleanup without blocking operations
1537
- 6. **Branch caching** — Watch `.git/HEAD` for branch changes
1538
-
1539
- **Why NOT one daemon per location (previous design):**
1540
- - N+1 processes for agent swarms is wasteful
1541
- - Cross-location queries require IPC between daemons (latency)
1542
- - Claim atomicity requires distributed coordination
1543
- - Process lifecycle management is complex (orphaned daemons)
1544
-
1545
- ### Daemon Location
1546
-
1547
- ```
1548
- .git/opentasks/
1549
- ├── daemon.sock # Unix socket (shared by all worktrees)
1550
- ├── daemon.lock # PID lock
1551
- └── worktrees.json # Registered worktrees
1552
- ```
1553
-
1554
- Socket lives in `.git/opentasks/` because `.git/` is shared across all worktrees. No global registry needed — any worktree finds the daemon at the same path.
1555
-
1556
- ### IPC Protocol
1557
-
1558
- ```typescript
1559
- interface DaemonRequest {
1560
- id: string
1561
- method: DaemonMethod
1562
- params?: unknown
1563
- }
1564
-
1565
- interface DaemonResponse {
1566
- id: string
1567
- result?: unknown
1568
- error?: { code: number; message: string }
1569
- }
1570
-
1571
- type DaemonMethod =
1572
- // Graph operations (include location parameter)
1573
- | 'graph.get'
1574
- | 'graph.query'
1575
- | 'graph.create'
1576
- | 'graph.update'
1577
- | 'graph.delete'
1578
-
1579
- // Sync operations
1580
- | 'sync.flush'
1581
- | 'sync.import'
1582
-
1583
- // Lifecycle
1584
- | 'daemon.ping'
1585
- | 'daemon.health'
1586
- | 'daemon.status'
1587
- | 'daemon.shutdown'
1588
-
1589
- // Worktree management
1590
- | 'worktree.register'
1591
- | 'worktree.unregister'
1592
- | 'worktree.list'
1593
- | 'worktree.find'
1594
-
1595
- // Connections
1596
- | 'connection.health'
1597
- ```
1598
-
1599
- See [plans/PHASE-3.md](./plans/PHASE-3.md) for full daemon specification, auto-start behavior, and lifecycle.
1600
-
1601
- ---
1602
-
1603
- ## Open Questions (Resolved)
1604
-
1605
- | Question | Resolution |
1606
- |----------|------------|
1607
- | Split vs single JSONL | **Single `graph.jsonl`** with compaction to manage size |
1608
- | Markdown sync priority | **Merge strategy**: frontmatter from JSONL, body from markdown |
1609
- | Compaction strategy | **Tiered**: 30 days → Tier 1, 90 days → Tier 2, with LLM summarization option |
1610
- | Daemon model | **Single daemon per git repo** (Phase 3 only); Phase 2 uses WAL + file locks |
1611
- | JSONL write mode | **Append-only** — updates append new line, never overwrite in-place |
1612
- | Git merge conflicts | **Custom merge driver** with field-level three-way merge |
1613
- | Location discovery | **One-time setup aid** (`opentasks discover`), not runtime; explicit connections |
1614
- | Worktree detection | **Explicit registration** via `opentasks worktree setup`, not passive detection |
1615
- | Redirect conditions | **Role-based** (set in config by orchestrator), not agent-identity-based |
1616
- | Global registry | **Eliminated** — socket at `.git/opentasks/daemon.sock` + explicit connections |
1617
-
1618
- ---
1619
-
1620
- ## References
1621
-
1622
- ### Beads Persistence Patterns
1623
- - **FlushManager**: Event-driven, single-goroutine flush coordination with debouncing
1624
- - **Dirty tracking**: Per-node dirty flags with `marked_at` ordering
1625
- - **Content hashing**: SHA256 of substantive fields for dedup
1626
- - **Atomic writes**: Temp file with PID suffix + rename
1627
- - **Multi-repo export**: Filter by prefix, route to separate files
1628
- - **Worktree redirect**: `.beads/redirect` file for shared state
1629
-
1630
- ### TinyBase Persister Model
1631
- - [Custom Persistence Guide](https://tinybase.org/guides/persistence/custom-persistence/)
1632
- - [Persister Interface](https://tinybase.org/api/persisters/interfaces/persister/persister/)
1633
- - Four core methods: `getPersisted`, `setPersisted`, `subscribe`, `unsubscribe`
1634
-
1635
- ### Sudocode Three-Layer Model
1636
- - Markdown ↔ JSONL ↔ SQLite with bidirectional sync
1637
- - File watcher for markdown changes
1638
- - Frontmatter for metadata, body for content