macro-agent 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (660) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/.sudocode/issues.jsonl +28 -0
  3. package/.sudocode/specs.jsonl +8 -0
  4. package/CLAUDE.md +25 -17
  5. package/README.md +11 -29
  6. package/dist/acp/macro-agent.d.ts +15 -0
  7. package/dist/acp/macro-agent.d.ts.map +1 -1
  8. package/dist/acp/macro-agent.js +131 -35
  9. package/dist/acp/macro-agent.js.map +1 -1
  10. package/dist/acp/types.d.ts +32 -1
  11. package/dist/acp/types.d.ts.map +1 -1
  12. package/dist/acp/types.js.map +1 -1
  13. package/dist/agent/agent-manager.d.ts +65 -1
  14. package/dist/agent/agent-manager.d.ts.map +1 -1
  15. package/dist/agent/agent-manager.js +544 -200
  16. package/dist/agent/agent-manager.js.map +1 -1
  17. package/dist/agent/types.d.ts +8 -1
  18. package/dist/agent/types.d.ts.map +1 -1
  19. package/dist/agent/types.js.map +1 -1
  20. package/dist/api/server.d.ts +8 -1
  21. package/dist/api/server.d.ts.map +1 -1
  22. package/dist/api/server.js +136 -8
  23. package/dist/api/server.js.map +1 -1
  24. package/dist/api/types.d.ts +1 -1
  25. package/dist/api/types.d.ts.map +1 -1
  26. package/dist/auth/index.d.ts +2 -0
  27. package/dist/auth/index.d.ts.map +1 -0
  28. package/dist/auth/index.js +2 -0
  29. package/dist/auth/index.js.map +1 -0
  30. package/dist/auth/token.d.ts +41 -0
  31. package/dist/auth/token.d.ts.map +1 -0
  32. package/dist/auth/token.js +73 -0
  33. package/dist/auth/token.js.map +1 -0
  34. package/dist/cli/acp.d.ts +2 -23
  35. package/dist/cli/acp.d.ts.map +1 -1
  36. package/dist/cli/acp.js +197 -61
  37. package/dist/cli/acp.js.map +1 -1
  38. package/dist/cli/index.js +152 -16
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/cli/mcp.d.ts +6 -0
  41. package/dist/cli/mcp.d.ts.map +1 -1
  42. package/dist/cli/mcp.js +279 -173
  43. package/dist/cli/mcp.js.map +1 -1
  44. package/dist/cli/parse-args.d.ts +20 -0
  45. package/dist/cli/parse-args.d.ts.map +1 -0
  46. package/dist/cli/parse-args.js +43 -0
  47. package/dist/cli/parse-args.js.map +1 -0
  48. package/dist/cli/stable-instance-id.d.ts +8 -0
  49. package/dist/cli/stable-instance-id.d.ts.map +1 -0
  50. package/dist/cli/stable-instance-id.js +14 -0
  51. package/dist/cli/stable-instance-id.js.map +1 -0
  52. package/dist/config/project-config.d.ts +85 -7
  53. package/dist/config/project-config.d.ts.map +1 -1
  54. package/dist/config/project-config.js +133 -20
  55. package/dist/config/project-config.js.map +1 -1
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +2 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/lifecycle/handlers/index.d.ts +7 -3
  61. package/dist/lifecycle/handlers/index.d.ts.map +1 -1
  62. package/dist/lifecycle/handlers/index.js +25 -8
  63. package/dist/lifecycle/handlers/index.js.map +1 -1
  64. package/dist/lifecycle/types.d.ts +2 -0
  65. package/dist/lifecycle/types.d.ts.map +1 -1
  66. package/dist/lifecycle/types.js.map +1 -1
  67. package/dist/map/adapter/acp-over-map.d.ts +17 -0
  68. package/dist/map/adapter/acp-over-map.d.ts.map +1 -1
  69. package/dist/map/adapter/acp-over-map.js +384 -23
  70. package/dist/map/adapter/acp-over-map.js.map +1 -1
  71. package/dist/map/adapter/connection-manager.d.ts.map +1 -1
  72. package/dist/map/adapter/connection-manager.js +3 -0
  73. package/dist/map/adapter/connection-manager.js.map +1 -1
  74. package/dist/map/adapter/event-log.d.ts +87 -0
  75. package/dist/map/adapter/event-log.d.ts.map +1 -0
  76. package/dist/map/adapter/event-log.js +122 -0
  77. package/dist/map/adapter/event-log.js.map +1 -0
  78. package/dist/map/adapter/event-translator.js +6 -6
  79. package/dist/map/adapter/event-translator.js.map +1 -1
  80. package/dist/map/adapter/extensions/agent-lifecycle.d.ts +82 -0
  81. package/dist/map/adapter/extensions/agent-lifecycle.d.ts.map +1 -0
  82. package/dist/map/adapter/extensions/agent-lifecycle.js +164 -0
  83. package/dist/map/adapter/extensions/agent-lifecycle.js.map +1 -0
  84. package/dist/map/adapter/extensions/index.d.ts +13 -1
  85. package/dist/map/adapter/extensions/index.d.ts.map +1 -1
  86. package/dist/map/adapter/extensions/index.js +61 -0
  87. package/dist/map/adapter/extensions/index.js.map +1 -1
  88. package/dist/map/adapter/extensions/mcp-bridge.d.ts +57 -0
  89. package/dist/map/adapter/extensions/mcp-bridge.d.ts.map +1 -0
  90. package/dist/map/adapter/extensions/mcp-bridge.js +745 -0
  91. package/dist/map/adapter/extensions/mcp-bridge.js.map +1 -0
  92. package/dist/map/adapter/extensions/rename.d.ts +29 -0
  93. package/dist/map/adapter/extensions/rename.d.ts.map +1 -0
  94. package/dist/map/adapter/extensions/rename.js +49 -0
  95. package/dist/map/adapter/extensions/rename.js.map +1 -0
  96. package/dist/map/adapter/extensions/streams.d.ts +95 -0
  97. package/dist/map/adapter/extensions/streams.d.ts.map +1 -0
  98. package/dist/map/adapter/extensions/streams.js +515 -0
  99. package/dist/map/adapter/extensions/streams.js.map +1 -0
  100. package/dist/map/adapter/extensions/task.d.ts.map +1 -1
  101. package/dist/map/adapter/extensions/task.js +10 -0
  102. package/dist/map/adapter/extensions/task.js.map +1 -1
  103. package/dist/map/adapter/extensions/update-metadata.d.ts +29 -0
  104. package/dist/map/adapter/extensions/update-metadata.d.ts.map +1 -0
  105. package/dist/map/adapter/extensions/update-metadata.js +67 -0
  106. package/dist/map/adapter/extensions/update-metadata.js.map +1 -0
  107. package/dist/map/adapter/index.d.ts +2 -1
  108. package/dist/map/adapter/index.d.ts.map +1 -1
  109. package/dist/map/adapter/index.js +10 -2
  110. package/dist/map/adapter/index.js.map +1 -1
  111. package/dist/map/adapter/interface.d.ts +2 -0
  112. package/dist/map/adapter/interface.d.ts.map +1 -1
  113. package/dist/map/adapter/map-adapter.d.ts +3 -0
  114. package/dist/map/adapter/map-adapter.d.ts.map +1 -1
  115. package/dist/map/adapter/map-adapter.js +258 -35
  116. package/dist/map/adapter/map-adapter.js.map +1 -1
  117. package/dist/map/adapter/subscription-manager.d.ts.map +1 -1
  118. package/dist/map/adapter/subscription-manager.js +5 -1
  119. package/dist/map/adapter/subscription-manager.js.map +1 -1
  120. package/dist/map/adapter/types.d.ts +3 -1
  121. package/dist/map/adapter/types.d.ts.map +1 -1
  122. package/dist/mcp/map-client.d.ts +39 -0
  123. package/dist/mcp/map-client.d.ts.map +1 -0
  124. package/dist/mcp/map-client.js +129 -0
  125. package/dist/mcp/map-client.js.map +1 -0
  126. package/dist/mcp/mcp-server.d.ts +16 -0
  127. package/dist/mcp/mcp-server.d.ts.map +1 -1
  128. package/dist/mcp/mcp-server.js +125 -88
  129. package/dist/mcp/mcp-server.js.map +1 -1
  130. package/dist/mcp/tools/done.d.ts.map +1 -1
  131. package/dist/mcp/tools/done.js +18 -0
  132. package/dist/mcp/tools/done.js.map +1 -1
  133. package/dist/mcp/types.d.ts +9 -1
  134. package/dist/mcp/types.d.ts.map +1 -1
  135. package/dist/mcp/types.js.map +1 -1
  136. package/dist/metrics/metrics.js +1 -1
  137. package/dist/metrics/metrics.js.map +1 -1
  138. package/dist/roles/builtin/coordinator.d.ts.map +1 -1
  139. package/dist/roles/builtin/coordinator.js +2 -1
  140. package/dist/roles/builtin/coordinator.js.map +1 -1
  141. package/dist/roles/builtin/integrator.d.ts.map +1 -1
  142. package/dist/roles/builtin/integrator.js +2 -1
  143. package/dist/roles/builtin/integrator.js.map +1 -1
  144. package/dist/roles/builtin/worker.d.ts.map +1 -1
  145. package/dist/roles/builtin/worker.js +3 -1
  146. package/dist/roles/builtin/worker.js.map +1 -1
  147. package/dist/roles/capabilities.d.ts +9 -1
  148. package/dist/roles/capabilities.d.ts.map +1 -1
  149. package/dist/roles/capabilities.js +27 -7
  150. package/dist/roles/capabilities.js.map +1 -1
  151. package/dist/roles/config-loader.d.ts +6 -6
  152. package/dist/roles/config-loader.d.ts.map +1 -1
  153. package/dist/roles/config-loader.js +8 -7
  154. package/dist/roles/config-loader.js.map +1 -1
  155. package/dist/roles/registry.d.ts +2 -2
  156. package/dist/roles/registry.js +2 -2
  157. package/dist/roles/types.d.ts +3 -1
  158. package/dist/roles/types.d.ts.map +1 -1
  159. package/dist/server/combined-server.d.ts +28 -1
  160. package/dist/server/combined-server.d.ts.map +1 -1
  161. package/dist/server/combined-server.js +111 -8
  162. package/dist/server/combined-server.js.map +1 -1
  163. package/dist/store/event-store.d.ts +2 -1
  164. package/dist/store/event-store.d.ts.map +1 -1
  165. package/dist/store/event-store.js +80 -24
  166. package/dist/store/event-store.js.map +1 -1
  167. package/dist/store/instance.d.ts +1 -1
  168. package/dist/store/instance.d.ts.map +1 -1
  169. package/dist/store/instance.js +2 -2
  170. package/dist/store/instance.js.map +1 -1
  171. package/dist/store/types/agents.d.ts +23 -0
  172. package/dist/store/types/agents.d.ts.map +1 -1
  173. package/dist/store/types/events.d.ts +1 -1
  174. package/dist/store/types/events.d.ts.map +1 -1
  175. package/dist/task/backend/index.d.ts +47 -29
  176. package/dist/task/backend/index.d.ts.map +1 -1
  177. package/dist/task/backend/index.js +109 -71
  178. package/dist/task/backend/index.js.map +1 -1
  179. package/dist/task/backend/memory.d.ts +1 -0
  180. package/dist/task/backend/memory.d.ts.map +1 -1
  181. package/dist/task/backend/memory.js +3 -0
  182. package/dist/task/backend/memory.js.map +1 -1
  183. package/dist/task/backend/opentasks/backend.d.ts +140 -0
  184. package/dist/task/backend/opentasks/backend.d.ts.map +1 -0
  185. package/dist/task/backend/opentasks/backend.js +1023 -0
  186. package/dist/task/backend/opentasks/backend.js.map +1 -0
  187. package/dist/task/backend/opentasks/client.d.ts +337 -0
  188. package/dist/task/backend/opentasks/client.d.ts.map +1 -0
  189. package/dist/task/backend/opentasks/client.js +225 -0
  190. package/dist/task/backend/opentasks/client.js.map +1 -0
  191. package/dist/task/backend/opentasks/daemon-manager.d.ts +89 -0
  192. package/dist/task/backend/opentasks/daemon-manager.d.ts.map +1 -0
  193. package/dist/task/backend/opentasks/daemon-manager.js +195 -0
  194. package/dist/task/backend/opentasks/daemon-manager.js.map +1 -0
  195. package/dist/task/backend/opentasks/index.d.ts +21 -0
  196. package/dist/task/backend/opentasks/index.d.ts.map +1 -0
  197. package/dist/task/backend/opentasks/index.js +21 -0
  198. package/dist/task/backend/opentasks/index.js.map +1 -0
  199. package/dist/task/backend/opentasks/mapping.d.ts +48 -0
  200. package/dist/task/backend/opentasks/mapping.d.ts.map +1 -0
  201. package/dist/task/backend/opentasks/mapping.js +77 -0
  202. package/dist/task/backend/opentasks/mapping.js.map +1 -0
  203. package/dist/task/backend/types.d.ts +33 -53
  204. package/dist/task/backend/types.d.ts.map +1 -1
  205. package/dist/task/backend/types.js +7 -11
  206. package/dist/task/backend/types.js.map +1 -1
  207. package/dist/task/backend/unified-tool-provider.d.ts +57 -0
  208. package/dist/task/backend/unified-tool-provider.d.ts.map +1 -0
  209. package/dist/task/backend/unified-tool-provider.js +623 -0
  210. package/dist/task/backend/unified-tool-provider.js.map +1 -0
  211. package/dist/teams/index.d.ts +3 -1
  212. package/dist/teams/index.d.ts.map +1 -1
  213. package/dist/teams/index.js +2 -0
  214. package/dist/teams/index.js.map +1 -1
  215. package/dist/teams/seed-defaults.d.ts +20 -0
  216. package/dist/teams/seed-defaults.d.ts.map +1 -0
  217. package/dist/teams/seed-defaults.js +71 -0
  218. package/dist/teams/seed-defaults.js.map +1 -0
  219. package/dist/teams/team-loader.d.ts +7 -3
  220. package/dist/teams/team-loader.d.ts.map +1 -1
  221. package/dist/teams/team-loader.js +156 -164
  222. package/dist/teams/team-loader.js.map +1 -1
  223. package/dist/teams/team-manager.d.ts +112 -0
  224. package/dist/teams/team-manager.d.ts.map +1 -0
  225. package/dist/teams/team-manager.js +305 -0
  226. package/dist/teams/team-manager.js.map +1 -0
  227. package/dist/teams/team-runtime.d.ts +125 -19
  228. package/dist/teams/team-runtime.d.ts.map +1 -1
  229. package/dist/teams/team-runtime.js +529 -119
  230. package/dist/teams/team-runtime.js.map +1 -1
  231. package/dist/teams/types.d.ts +41 -151
  232. package/dist/teams/types.d.ts.map +1 -1
  233. package/dist/teams/types.js +2 -3
  234. package/dist/teams/types.js.map +1 -1
  235. package/docs/architecture.md +7 -6
  236. package/docs/configuration.md +26 -62
  237. package/docs/implementation-details.md +5 -5
  238. package/docs/implementation-summary.md +17 -17
  239. package/docs/plan-self-driving-support.md +4 -4
  240. package/docs/spec-self-driving-support.md +10 -10
  241. package/docs/team-templates.md +2 -2
  242. package/docs/teams.md +76 -3
  243. package/docs/troubleshooting.md +10 -11
  244. package/package.json +7 -4
  245. package/references/minimem/.claude/settings.json +7 -0
  246. package/references/minimem/.sudocode/issues.jsonl +18 -0
  247. package/references/minimem/.sudocode/specs.jsonl +1 -0
  248. package/references/minimem/CLAUDE.md +310 -0
  249. package/references/minimem/README.md +562 -0
  250. package/references/minimem/claude-plugin/.claude-plugin/plugin.json +10 -0
  251. package/references/minimem/claude-plugin/.mcp.json +7 -0
  252. package/references/minimem/claude-plugin/README.md +158 -0
  253. package/references/minimem/claude-plugin/commands/recall.md +47 -0
  254. package/references/minimem/claude-plugin/commands/remember.md +41 -0
  255. package/references/minimem/claude-plugin/hooks/__tests__/hooks.test.ts +272 -0
  256. package/references/minimem/claude-plugin/hooks/hooks.json +27 -0
  257. package/references/minimem/claude-plugin/hooks/session-end.sh +86 -0
  258. package/references/minimem/claude-plugin/hooks/session-start.sh +85 -0
  259. package/references/minimem/claude-plugin/skills/memory/SKILL.md +108 -0
  260. package/references/minimem/media/banner.png +0 -0
  261. package/references/minimem/package-lock.json +5373 -0
  262. package/references/minimem/package.json +72 -0
  263. package/references/minimem/scripts/postbuild.js +35 -0
  264. package/references/minimem/src/__tests__/edge-cases.test.ts +371 -0
  265. package/references/minimem/src/__tests__/errors.test.ts +265 -0
  266. package/references/minimem/src/__tests__/helpers.ts +199 -0
  267. package/references/minimem/src/__tests__/internal.test.ts +407 -0
  268. package/references/minimem/src/__tests__/knowledge.test.ts +287 -0
  269. package/references/minimem/src/__tests__/minimem.integration.test.ts +1127 -0
  270. package/references/minimem/src/__tests__/session.test.ts +190 -0
  271. package/references/minimem/src/cli/__tests__/commands.test.ts +759 -0
  272. package/references/minimem/src/cli/commands/__tests__/conflicts.test.ts +141 -0
  273. package/references/minimem/src/cli/commands/append.ts +76 -0
  274. package/references/minimem/src/cli/commands/config.ts +262 -0
  275. package/references/minimem/src/cli/commands/conflicts.ts +413 -0
  276. package/references/minimem/src/cli/commands/daemon.ts +169 -0
  277. package/references/minimem/src/cli/commands/index.ts +12 -0
  278. package/references/minimem/src/cli/commands/init.ts +88 -0
  279. package/references/minimem/src/cli/commands/mcp.ts +177 -0
  280. package/references/minimem/src/cli/commands/push-pull.ts +213 -0
  281. package/references/minimem/src/cli/commands/search.ts +158 -0
  282. package/references/minimem/src/cli/commands/status.ts +84 -0
  283. package/references/minimem/src/cli/commands/sync-init.ts +290 -0
  284. package/references/minimem/src/cli/commands/sync.ts +70 -0
  285. package/references/minimem/src/cli/commands/upsert.ts +197 -0
  286. package/references/minimem/src/cli/config.ts +584 -0
  287. package/references/minimem/src/cli/index.ts +264 -0
  288. package/references/minimem/src/cli/shared.ts +161 -0
  289. package/references/minimem/src/cli/sync/__tests__/central.test.ts +152 -0
  290. package/references/minimem/src/cli/sync/__tests__/conflicts.test.ts +209 -0
  291. package/references/minimem/src/cli/sync/__tests__/daemon.test.ts +118 -0
  292. package/references/minimem/src/cli/sync/__tests__/detection.test.ts +207 -0
  293. package/references/minimem/src/cli/sync/__tests__/integration.test.ts +476 -0
  294. package/references/minimem/src/cli/sync/__tests__/registry.test.ts +363 -0
  295. package/references/minimem/src/cli/sync/__tests__/state.test.ts +255 -0
  296. package/references/minimem/src/cli/sync/__tests__/validation.test.ts +193 -0
  297. package/references/minimem/src/cli/sync/__tests__/watcher.test.ts +178 -0
  298. package/references/minimem/src/cli/sync/central.ts +292 -0
  299. package/references/minimem/src/cli/sync/conflicts.ts +204 -0
  300. package/references/minimem/src/cli/sync/daemon.ts +407 -0
  301. package/references/minimem/src/cli/sync/detection.ts +138 -0
  302. package/references/minimem/src/cli/sync/index.ts +107 -0
  303. package/references/minimem/src/cli/sync/operations.ts +373 -0
  304. package/references/minimem/src/cli/sync/registry.ts +279 -0
  305. package/references/minimem/src/cli/sync/state.ts +355 -0
  306. package/references/minimem/src/cli/sync/validation.ts +206 -0
  307. package/references/minimem/src/cli/sync/watcher.ts +234 -0
  308. package/references/minimem/src/cli/version.ts +34 -0
  309. package/references/minimem/src/core/index.ts +9 -0
  310. package/references/minimem/src/core/indexer.ts +628 -0
  311. package/references/minimem/src/core/searcher.ts +221 -0
  312. package/references/minimem/src/db/schema.ts +183 -0
  313. package/references/minimem/src/db/sqlite-vec.ts +24 -0
  314. package/references/minimem/src/embeddings/__tests__/embeddings.test.ts +431 -0
  315. package/references/minimem/src/embeddings/batch-gemini.ts +392 -0
  316. package/references/minimem/src/embeddings/batch-openai.ts +409 -0
  317. package/references/minimem/src/embeddings/embeddings.ts +434 -0
  318. package/references/minimem/src/index.ts +109 -0
  319. package/references/minimem/src/internal.ts +299 -0
  320. package/references/minimem/src/minimem.ts +1276 -0
  321. package/references/minimem/src/search/__tests__/hybrid.test.ts +247 -0
  322. package/references/minimem/src/search/graph.ts +234 -0
  323. package/references/minimem/src/search/hybrid.ts +151 -0
  324. package/references/minimem/src/search/search.ts +256 -0
  325. package/references/minimem/src/server/__tests__/mcp.test.ts +341 -0
  326. package/references/minimem/src/server/__tests__/tools.test.ts +364 -0
  327. package/references/minimem/src/server/mcp.ts +326 -0
  328. package/references/minimem/src/server/tools.ts +720 -0
  329. package/references/minimem/src/session.ts +460 -0
  330. package/references/minimem/tsconfig.json +19 -0
  331. package/references/minimem/tsup.config.ts +26 -0
  332. package/references/minimem/vitest.config.ts +24 -0
  333. package/references/openteams/.claude/settings.json +6 -0
  334. package/references/openteams/README.md +1 -0
  335. package/references/openteams/SKILL.md +341 -0
  336. package/references/openteams/design.md +411 -0
  337. package/references/openteams/examples/bmad-method/prompts/analyst/ROLE.md +16 -0
  338. package/references/openteams/examples/bmad-method/prompts/analyst/SOUL.md +5 -0
  339. package/references/openteams/examples/bmad-method/prompts/architect/ROLE.md +24 -0
  340. package/references/openteams/examples/bmad-method/prompts/architect/SOUL.md +5 -0
  341. package/references/openteams/examples/bmad-method/prompts/developer/ROLE.md +25 -0
  342. package/references/openteams/examples/bmad-method/prompts/developer/SOUL.md +5 -0
  343. package/references/openteams/examples/bmad-method/prompts/master/ROLE.md +21 -0
  344. package/references/openteams/examples/bmad-method/prompts/master/SOUL.md +5 -0
  345. package/references/openteams/examples/bmad-method/prompts/pm/ROLE.md +20 -0
  346. package/references/openteams/examples/bmad-method/prompts/pm/SOUL.md +5 -0
  347. package/references/openteams/examples/bmad-method/prompts/qa/ROLE.md +17 -0
  348. package/references/openteams/examples/bmad-method/prompts/qa/SOUL.md +5 -0
  349. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/ROLE.md +23 -0
  350. package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/SOUL.md +5 -0
  351. package/references/openteams/examples/bmad-method/prompts/scrum-master/ROLE.md +27 -0
  352. package/references/openteams/examples/bmad-method/prompts/scrum-master/SOUL.md +5 -0
  353. package/references/openteams/examples/bmad-method/prompts/tech-writer/ROLE.md +21 -0
  354. package/references/openteams/examples/bmad-method/prompts/tech-writer/SOUL.md +5 -0
  355. package/references/openteams/examples/bmad-method/prompts/ux-designer/ROLE.md +16 -0
  356. package/references/openteams/examples/bmad-method/prompts/ux-designer/SOUL.md +5 -0
  357. package/references/openteams/examples/bmad-method/roles/analyst.yaml +9 -0
  358. package/references/openteams/examples/bmad-method/roles/architect.yaml +9 -0
  359. package/references/openteams/examples/bmad-method/roles/developer.yaml +8 -0
  360. package/references/openteams/examples/bmad-method/roles/master.yaml +8 -0
  361. package/references/openteams/examples/bmad-method/roles/pm.yaml +9 -0
  362. package/references/openteams/examples/bmad-method/roles/qa.yaml +8 -0
  363. package/references/openteams/examples/bmad-method/roles/quick-flow-dev.yaml +8 -0
  364. package/references/openteams/examples/bmad-method/roles/scrum-master.yaml +9 -0
  365. package/references/openteams/examples/bmad-method/roles/tech-writer.yaml +8 -0
  366. package/references/openteams/examples/bmad-method/roles/ux-designer.yaml +8 -0
  367. package/references/openteams/examples/bmad-method/team.yaml +161 -0
  368. package/references/openteams/examples/get-shit-done/prompts/codebase-mapper/ROLE.md +17 -0
  369. package/references/openteams/examples/get-shit-done/prompts/codebase-mapper/SOUL.md +5 -0
  370. package/references/openteams/examples/get-shit-done/prompts/debugger/ROLE.md +25 -0
  371. package/references/openteams/examples/get-shit-done/prompts/debugger/SOUL.md +5 -0
  372. package/references/openteams/examples/get-shit-done/prompts/executor/ROLE.md +34 -0
  373. package/references/openteams/examples/get-shit-done/prompts/executor/SOUL.md +5 -0
  374. package/references/openteams/examples/get-shit-done/prompts/integration-checker/ROLE.md +18 -0
  375. package/references/openteams/examples/get-shit-done/prompts/integration-checker/SOUL.md +3 -0
  376. package/references/openteams/examples/get-shit-done/prompts/orchestrator/ROLE.md +42 -0
  377. package/references/openteams/examples/get-shit-done/prompts/orchestrator/SOUL.md +5 -0
  378. package/references/openteams/examples/get-shit-done/prompts/phase-researcher/ROLE.md +15 -0
  379. package/references/openteams/examples/get-shit-done/prompts/phase-researcher/SOUL.md +3 -0
  380. package/references/openteams/examples/get-shit-done/prompts/plan-checker/ROLE.md +17 -0
  381. package/references/openteams/examples/get-shit-done/prompts/plan-checker/SOUL.md +3 -0
  382. package/references/openteams/examples/get-shit-done/prompts/planner/ROLE.md +28 -0
  383. package/references/openteams/examples/get-shit-done/prompts/planner/SOUL.md +5 -0
  384. package/references/openteams/examples/get-shit-done/prompts/project-researcher/ROLE.md +16 -0
  385. package/references/openteams/examples/get-shit-done/prompts/project-researcher/SOUL.md +3 -0
  386. package/references/openteams/examples/get-shit-done/prompts/research-synthesizer/ROLE.md +13 -0
  387. package/references/openteams/examples/get-shit-done/prompts/research-synthesizer/SOUL.md +3 -0
  388. package/references/openteams/examples/get-shit-done/prompts/roadmapper/ROLE.md +14 -0
  389. package/references/openteams/examples/get-shit-done/prompts/roadmapper/SOUL.md +3 -0
  390. package/references/openteams/examples/get-shit-done/prompts/verifier/ROLE.md +19 -0
  391. package/references/openteams/examples/get-shit-done/prompts/verifier/SOUL.md +5 -0
  392. package/references/openteams/examples/get-shit-done/roles/codebase-mapper.yaml +8 -0
  393. package/references/openteams/examples/get-shit-done/roles/debugger.yaml +8 -0
  394. package/references/openteams/examples/get-shit-done/roles/executor.yaml +8 -0
  395. package/references/openteams/examples/get-shit-done/roles/integration-checker.yaml +8 -0
  396. package/references/openteams/examples/get-shit-done/roles/orchestrator.yaml +9 -0
  397. package/references/openteams/examples/get-shit-done/roles/phase-researcher.yaml +7 -0
  398. package/references/openteams/examples/get-shit-done/roles/plan-checker.yaml +8 -0
  399. package/references/openteams/examples/get-shit-done/roles/planner.yaml +8 -0
  400. package/references/openteams/examples/get-shit-done/roles/project-researcher.yaml +8 -0
  401. package/references/openteams/examples/get-shit-done/roles/research-synthesizer.yaml +7 -0
  402. package/references/openteams/examples/get-shit-done/roles/roadmapper.yaml +7 -0
  403. package/references/openteams/examples/get-shit-done/roles/verifier.yaml +8 -0
  404. package/references/openteams/examples/get-shit-done/team.yaml +154 -0
  405. package/references/openteams/package-lock.json +2181 -0
  406. package/references/openteams/package.json +48 -0
  407. package/references/openteams/schema/role.schema.json +125 -0
  408. package/references/openteams/schema/team.schema.json +284 -0
  409. package/references/openteams/src/cli/agent.ts +104 -0
  410. package/references/openteams/src/cli/cli.test.ts +381 -0
  411. package/references/openteams/src/cli/generate.ts +220 -0
  412. package/references/openteams/src/cli/message.ts +241 -0
  413. package/references/openteams/src/cli/task.ts +154 -0
  414. package/references/openteams/src/cli/team.ts +104 -0
  415. package/references/openteams/src/cli/template.ts +207 -0
  416. package/references/openteams/src/cli.ts +45 -0
  417. package/references/openteams/src/db/database.test.ts +185 -0
  418. package/references/openteams/src/db/database.ts +240 -0
  419. package/references/openteams/src/generators/agent-prompt-generator.test.ts +332 -0
  420. package/references/openteams/src/generators/agent-prompt-generator.ts +521 -0
  421. package/references/openteams/src/generators/package-generator.test.ts +129 -0
  422. package/references/openteams/src/generators/package-generator.ts +102 -0
  423. package/references/openteams/src/generators/skill-generator.test.ts +246 -0
  424. package/references/openteams/src/generators/skill-generator.ts +374 -0
  425. package/references/openteams/src/index.ts +104 -0
  426. package/references/openteams/src/services/agent-service.test.ts +158 -0
  427. package/references/openteams/src/services/agent-service.ts +84 -0
  428. package/references/openteams/src/services/communication-service.test.ts +455 -0
  429. package/references/openteams/src/services/communication-service.ts +371 -0
  430. package/references/openteams/src/services/message-service.test.ts +342 -0
  431. package/references/openteams/src/services/message-service.ts +203 -0
  432. package/references/openteams/src/services/task-service.test.ts +434 -0
  433. package/references/openteams/src/services/task-service.ts +239 -0
  434. package/references/openteams/src/services/team-service.test.ts +181 -0
  435. package/references/openteams/src/services/team-service.ts +139 -0
  436. package/references/openteams/src/services/template-service.test.ts +306 -0
  437. package/references/openteams/src/services/template-service.ts +182 -0
  438. package/references/openteams/src/spawner/acp-factory.ts +96 -0
  439. package/references/openteams/src/spawner/interface.ts +31 -0
  440. package/references/openteams/src/spawner/mock.test.ts +93 -0
  441. package/references/openteams/src/spawner/mock.ts +59 -0
  442. package/references/openteams/src/template/loader.test.ts +1319 -0
  443. package/references/openteams/src/template/loader.ts +698 -0
  444. package/references/openteams/src/template/types.ts +200 -0
  445. package/references/openteams/src/types.ts +205 -0
  446. package/references/openteams/tsconfig.json +18 -0
  447. package/references/openteams/vitest.config.ts +9 -0
  448. package/references/skill-tree/.claude/settings.json +6 -0
  449. package/references/skill-tree/.sudocode/issues.jsonl +11 -0
  450. package/references/skill-tree/.sudocode/specs.jsonl +1 -0
  451. package/references/skill-tree/CLAUDE.md +150 -0
  452. package/references/skill-tree/README.md +324 -0
  453. package/references/skill-tree/docs/GAPS_v1.md +221 -0
  454. package/references/skill-tree/docs/INTEGRATION_PLAN.md +467 -0
  455. package/references/skill-tree/docs/TODOS.md +91 -0
  456. package/references/skill-tree/docs/anthropic_skill_guide.md +1364 -0
  457. package/references/skill-tree/docs/design/federated-skill-trees.md +524 -0
  458. package/references/skill-tree/docs/design/multi-agent-sync.md +759 -0
  459. package/references/skill-tree/docs/scraper/BRAINSTORM.md +583 -0
  460. package/references/skill-tree/docs/scraper/POC_PLAN.md +420 -0
  461. package/references/skill-tree/docs/scraper/README.md +170 -0
  462. package/references/skill-tree/examples/basic-usage.ts +190 -0
  463. package/references/skill-tree/package-lock.json +1509 -0
  464. package/references/skill-tree/package.json +66 -0
  465. package/references/skill-tree/scraper/README.md +123 -0
  466. package/references/skill-tree/scraper/docs/DESIGN.md +683 -0
  467. package/references/skill-tree/scraper/docs/PLAN.md +336 -0
  468. package/references/skill-tree/scraper/drizzle.config.ts +10 -0
  469. package/references/skill-tree/scraper/package-lock.json +6329 -0
  470. package/references/skill-tree/scraper/package.json +68 -0
  471. package/references/skill-tree/scraper/test/fixtures/invalid-skill/missing-description.md +7 -0
  472. package/references/skill-tree/scraper/test/fixtures/invalid-skill/missing-name.md +7 -0
  473. package/references/skill-tree/scraper/test/fixtures/minimal-skill/SKILL.md +27 -0
  474. package/references/skill-tree/scraper/test/fixtures/skill-json/SKILL.json +21 -0
  475. package/references/skill-tree/scraper/test/fixtures/skill-with-meta/SKILL.md +54 -0
  476. package/references/skill-tree/scraper/test/fixtures/skill-with-meta/_meta.json +24 -0
  477. package/references/skill-tree/scraper/test/fixtures/valid-skill/SKILL.md +93 -0
  478. package/references/skill-tree/scraper/test/fixtures/valid-skill/_meta.json +22 -0
  479. package/references/skill-tree/scraper/tsup.config.ts +14 -0
  480. package/references/skill-tree/scraper/vitest.config.ts +17 -0
  481. package/references/skill-tree/scripts/convert-to-vitest.ts +166 -0
  482. package/references/skill-tree/skills/skill-writer/SKILL.md +339 -0
  483. package/references/skill-tree/skills/skill-writer/references/examples.md +326 -0
  484. package/references/skill-tree/skills/skill-writer/references/patterns.md +210 -0
  485. package/references/skill-tree/skills/skill-writer/references/quality-checklist.md +123 -0
  486. package/references/skill-tree/test/run-all.ts +106 -0
  487. package/references/skill-tree/test/utils.ts +128 -0
  488. package/references/skill-tree/vitest.config.ts +16 -0
  489. package/src/__tests__/e2e/agent-spawn-visibility.e2e.test.ts +761 -0
  490. package/src/__tests__/e2e/full-agent-conflict-resolution.e2e.test.ts +2 -2
  491. package/src/__tests__/e2e/mcp-thin-client-bridge.e2e.test.ts +304 -0
  492. package/src/__tests__/e2e/mcp-tools-available.e2e.test.ts +324 -0
  493. package/src/__tests__/e2e/multi-agent.e2e.test.ts +5 -5
  494. package/src/__tests__/e2e/spawn-session-streaming.e2e.test.ts +563 -0
  495. package/src/acp/__tests__/integration.test.ts +56 -31
  496. package/src/acp/__tests__/macro-agent.test.ts +16 -7
  497. package/src/acp/macro-agent.ts +170 -36
  498. package/src/acp/types.ts +46 -1
  499. package/src/agent/__tests__/agent-manager.test.ts +228 -2
  500. package/src/agent/agent-manager.ts +809 -285
  501. package/src/agent/types.ts +12 -1
  502. package/src/api/__tests__/server.test.ts +203 -4
  503. package/src/api/server.ts +169 -10
  504. package/src/api/types.ts +3 -1
  505. package/src/auth/__tests__/token.test.ts +100 -0
  506. package/src/auth/index.ts +1 -0
  507. package/src/auth/token.ts +82 -0
  508. package/src/cli/__tests__/acp.test.ts +1 -1
  509. package/src/cli/__tests__/stable-instance-id.test.ts +1 -1
  510. package/src/cli/acp.ts +197 -72
  511. package/src/cli/index.ts +125 -15
  512. package/src/cli/mcp.ts +315 -197
  513. package/src/cli/parse-args.ts +54 -0
  514. package/src/cli/stable-instance-id.ts +14 -0
  515. package/src/config/project-config.ts +214 -27
  516. package/src/index.ts +3 -0
  517. package/src/lifecycle/__tests__/cascade-termination.test.ts +1 -1
  518. package/src/lifecycle/__tests__/handlers.test.ts +53 -0
  519. package/src/lifecycle/handlers/index.ts +25 -8
  520. package/src/lifecycle/types.ts +3 -0
  521. package/src/map/adapter/__tests__/acp-over-map-cancel.test.ts +22 -4
  522. package/src/map/adapter/__tests__/acp-over-map-getmodels.test.ts +355 -0
  523. package/src/map/adapter/__tests__/acp-over-map-history.test.ts +263 -0
  524. package/src/map/adapter/__tests__/acp-over-map-persistence.e2e.test.ts +1 -1
  525. package/src/map/adapter/__tests__/event-broadcast.test.ts +420 -0
  526. package/src/map/adapter/__tests__/event-log.test.ts +527 -0
  527. package/src/map/adapter/__tests__/event-translator.test.ts +3 -3
  528. package/src/map/adapter/__tests__/extensions.test.ts +408 -0
  529. package/src/map/adapter/__tests__/map-adapter.test.ts +99 -0
  530. package/src/map/adapter/__tests__/mcp-bridge.test.ts +1187 -0
  531. package/src/map/adapter/__tests__/multi-client-broadcast.test.ts +711 -0
  532. package/src/map/adapter/__tests__/stream-extensions.test.ts +494 -0
  533. package/src/map/adapter/__tests__/websocket-integration.test.ts +218 -0
  534. package/src/map/adapter/acp-over-map.ts +678 -66
  535. package/src/map/adapter/connection-manager.ts +3 -0
  536. package/src/map/adapter/event-log.ts +208 -0
  537. package/src/map/adapter/event-translator.ts +6 -6
  538. package/src/map/adapter/extensions/agent-lifecycle.ts +267 -0
  539. package/src/map/adapter/extensions/index.ts +96 -0
  540. package/src/map/adapter/extensions/mcp-bridge.ts +995 -0
  541. package/src/map/adapter/extensions/streams.ts +839 -0
  542. package/src/map/adapter/extensions/task.ts +11 -0
  543. package/src/map/adapter/extensions/update-metadata.ts +126 -0
  544. package/src/map/adapter/index.ts +33 -0
  545. package/src/map/adapter/interface.ts +2 -0
  546. package/src/map/adapter/map-adapter.ts +312 -47
  547. package/src/map/adapter/subscription-manager.ts +5 -1
  548. package/src/map/adapter/types.ts +10 -1
  549. package/src/mcp/__tests__/map-client.test.ts +386 -0
  550. package/src/mcp/__tests__/mcp-server-thin-client.test.ts +368 -0
  551. package/src/mcp/__tests__/mcp-server.test.ts +100 -1
  552. package/src/mcp/map-client.ts +177 -0
  553. package/src/mcp/mcp-server.ts +205 -103
  554. package/src/mcp/tools/done.ts +19 -0
  555. package/src/mcp/types.ts +6 -1
  556. package/src/metrics/metrics.ts +1 -1
  557. package/src/monitor/__tests__/stale-agent-flow.integration.test.ts +1 -1
  558. package/src/roles/__tests__/config-loader.test.ts +7 -7
  559. package/src/roles/builtin/coordinator.ts +2 -0
  560. package/src/roles/builtin/integrator.ts +2 -0
  561. package/src/roles/builtin/worker.ts +3 -0
  562. package/src/roles/capabilities.ts +28 -7
  563. package/src/roles/config-loader.ts +8 -7
  564. package/src/roles/registry.ts +2 -2
  565. package/src/roles/types.ts +7 -0
  566. package/src/server/__tests__/combined-server.test.ts +94 -21
  567. package/src/server/combined-server.ts +203 -33
  568. package/src/steering/__tests__/steering-integration.test.ts +1 -1
  569. package/src/store/__tests__/event-store-oob.test.ts +109 -0
  570. package/src/store/__tests__/event-store.test.ts +196 -1
  571. package/src/store/__tests__/instance.test.ts +3 -3
  572. package/src/store/event-store.ts +92 -23
  573. package/src/store/instance.ts +2 -2
  574. package/src/store/types/agents.ts +20 -0
  575. package/src/store/types/events.ts +1 -1
  576. package/src/task/backend/__tests__/create-task-backend.test.ts +225 -0
  577. package/src/task/backend/__tests__/e2e/unified-tool-provider-opentasks.e2e.test.ts +524 -0
  578. package/src/task/backend/__tests__/memory-pull-mode.test.ts +153 -0
  579. package/src/task/backend/__tests__/unified-tool-provider.test.ts +579 -0
  580. package/src/task/backend/index.ts +156 -106
  581. package/src/task/backend/memory.ts +4 -0
  582. package/src/task/backend/opentasks/__tests__/backend.test.ts +968 -0
  583. package/src/task/backend/opentasks/__tests__/daemon-manager.test.ts +406 -0
  584. package/src/task/backend/opentasks/__tests__/mapping.test.ts +84 -0
  585. package/src/task/backend/opentasks/__tests__/opentasks-backend.e2e.test.ts +1338 -0
  586. package/src/task/backend/opentasks/backend.ts +1323 -0
  587. package/src/task/backend/opentasks/client.ts +652 -0
  588. package/src/task/backend/opentasks/daemon-manager.ts +256 -0
  589. package/src/task/backend/opentasks/index.ts +69 -0
  590. package/src/task/backend/opentasks/mapping.ts +94 -0
  591. package/src/task/backend/types.ts +42 -66
  592. package/src/task/backend/unified-tool-provider.ts +779 -0
  593. package/src/teams/CLAUDE.md +180 -0
  594. package/src/teams/__tests__/cross-subsystem.integration.test.ts +1 -1
  595. package/src/teams/__tests__/e2e/workspace-isolation.e2e.test.ts +1263 -0
  596. package/src/teams/__tests__/team-manager.test.ts +814 -0
  597. package/src/teams/__tests__/team-system.test.ts +1291 -8
  598. package/src/teams/index.ts +21 -3
  599. package/src/teams/seed-defaults.ts +79 -0
  600. package/src/teams/team-loader.ts +202 -236
  601. package/src/teams/team-manager.ts +387 -0
  602. package/src/teams/team-runtime.ts +592 -121
  603. package/src/teams/types.ts +99 -200
  604. package/test_fixtures/README.md +2 -3
  605. package/test_fixtures/fixtures/index.ts +0 -3
  606. package/test_fixtures/fixtures/projects/project-with-specs.ts +7 -149
  607. package/test_fixtures/fixtures/repos/index.ts +1 -3
  608. package/test_fixtures/fixtures/repos/temp-repo-factory.ts +0 -116
  609. package/test_fixtures/fixtures/repos/types.ts +0 -11
  610. package/test_fixtures/harness/__tests__/fixtures.test.ts +10 -102
  611. package/test_fixtures/harness/__tests__/temp-repo-and-simulator.test.ts +0 -33
  612. package/test_fixtures/harness/simulator/agent-simulator.ts +4 -4
  613. package/vitest.config.ts +1 -1
  614. package/vitest.e2e.config.ts +1 -1
  615. package/vitest.setup.ts +1 -30
  616. package/.macro-agent/teams/self-driving/prompts/grinder.md +0 -27
  617. package/.macro-agent/teams/self-driving/prompts/judge.md +0 -27
  618. package/.macro-agent/teams/self-driving/prompts/planner.md +0 -33
  619. package/.macro-agent/teams/self-driving/roles/grinder.yaml +0 -17
  620. package/.macro-agent/teams/self-driving/roles/judge.yaml +0 -24
  621. package/.macro-agent/teams/self-driving/roles/planner.yaml +0 -18
  622. package/.macro-agent/teams/self-driving/team.yaml +0 -103
  623. package/.macro-agent/teams/structured/prompts/developer.md +0 -26
  624. package/.macro-agent/teams/structured/prompts/lead.md +0 -25
  625. package/.macro-agent/teams/structured/prompts/reviewer.md +0 -24
  626. package/.macro-agent/teams/structured/roles/developer.yaml +0 -12
  627. package/.macro-agent/teams/structured/roles/lead.yaml +0 -11
  628. package/.macro-agent/teams/structured/roles/reviewer.yaml +0 -19
  629. package/.macro-agent/teams/structured/team.yaml +0 -89
  630. package/docs/sudocode-integration.md +0 -383
  631. package/src/task/backend/__tests__/backend-parity.test.ts +0 -451
  632. package/src/task/backend/__tests__/tool-provider-edge-cases.test.ts +0 -430
  633. package/src/task/backend/__tests__/tool-provider.test.ts +0 -983
  634. package/src/task/backend/sudocode/__tests__/backend-edge-cases.test.ts +0 -575
  635. package/src/task/backend/sudocode/__tests__/backend.test.ts +0 -1194
  636. package/src/task/backend/sudocode/__tests__/client-integration.test.ts +0 -418
  637. package/src/task/backend/sudocode/__tests__/client.test.ts +0 -345
  638. package/src/task/backend/sudocode/__tests__/e2e/backend.e2e.test.ts +0 -753
  639. package/src/task/backend/sudocode/__tests__/e2e/server-client.e2e.test.ts +0 -680
  640. package/src/task/backend/sudocode/__tests__/e2e-workflow.test.ts +0 -666
  641. package/src/task/backend/sudocode/__tests__/integration/standalone-client.integration.test.ts +0 -396
  642. package/src/task/backend/sudocode/__tests__/integration/sudocode-cli.integration.test.ts +0 -328
  643. package/src/task/backend/sudocode/__tests__/integration/test-utils.ts +0 -175
  644. package/src/task/backend/sudocode/__tests__/mapping-edge-cases.test.ts +0 -265
  645. package/src/task/backend/sudocode/__tests__/server-client.test.ts +0 -675
  646. package/src/task/backend/sudocode/__tests__/sync-policy-edge-cases.test.ts +0 -521
  647. package/src/task/backend/sudocode/__tests__/sync-policy.test.ts +0 -519
  648. package/src/task/backend/sudocode/__tests__/tools.test.ts +0 -471
  649. package/src/task/backend/sudocode/backend.ts +0 -1237
  650. package/src/task/backend/sudocode/client.ts +0 -515
  651. package/src/task/backend/sudocode/index.ts +0 -120
  652. package/src/task/backend/sudocode/mapping.ts +0 -93
  653. package/src/task/backend/sudocode/server-client.ts +0 -522
  654. package/src/task/backend/sudocode/standalone-client.ts +0 -623
  655. package/src/task/backend/sudocode/sync-policy.ts +0 -387
  656. package/src/task/backend/sudocode/tools.ts +0 -896
  657. package/src/task/backend/tool-provider.ts +0 -506
  658. package/test_fixtures/fixtures/sudocode/index.ts +0 -29
  659. package/test_fixtures/fixtures/sudocode/issues.ts +0 -185
  660. package/test_fixtures/fixtures/sudocode/specs.ts +0 -159
@@ -13,12 +13,12 @@ Seven resolved design decisions (RD1–RD7) guide the implementation:
13
13
  | **RD3** | `spawn_rules` translate to capability additions (e.g., `planner: [grinder]` → `agent.spawn.grinder`) |
14
14
  | **RD4** | Team `customPrompt` replaces base role `systemPrompt` entirely |
15
15
  | **RD5** | Optimistic strategy is thin — validation is the judge agent's job |
16
- | **RD6** | Team selection via `.macro-agent/config.json` with CLI `--team` override |
16
+ | **RD6** | Team selection via `.multiagent/config.json` with CLI `--team` override |
17
17
  | **RD7** | Use `js-yaml` for YAML parsing |
18
18
 
19
19
  ## Phase 0–1: Team Template System
20
20
 
21
- **New modules**: `src/teams/`, `.macro-agent/teams/self-driving/`
21
+ **New modules**: `src/teams/`, `.multiagent/teams/self-driving/`
22
22
 
23
23
  ### Data Model (`src/teams/types.ts`)
24
24
 
@@ -371,21 +371,21 @@ src/mcp/tools/list_claimable_tasks.ts
371
371
  src/metrics/metrics.ts
372
372
  src/metrics/index.ts
373
373
 
374
- .macro-agent/teams/self-driving/team.yaml
375
- .macro-agent/teams/self-driving/roles/planner.yaml
376
- .macro-agent/teams/self-driving/roles/grinder.yaml
377
- .macro-agent/teams/self-driving/roles/judge.yaml
378
- .macro-agent/teams/self-driving/prompts/planner.md
379
- .macro-agent/teams/self-driving/prompts/grinder.md
380
- .macro-agent/teams/self-driving/prompts/judge.md
381
-
382
- .macro-agent/teams/structured/team.yaml
383
- .macro-agent/teams/structured/roles/lead.yaml
384
- .macro-agent/teams/structured/roles/developer.yaml
385
- .macro-agent/teams/structured/roles/reviewer.yaml
386
- .macro-agent/teams/structured/prompts/lead.md
387
- .macro-agent/teams/structured/prompts/developer.md
388
- .macro-agent/teams/structured/prompts/reviewer.md
374
+ .multiagent/teams/self-driving/team.yaml
375
+ .multiagent/teams/self-driving/roles/planner.yaml
376
+ .multiagent/teams/self-driving/roles/grinder.yaml
377
+ .multiagent/teams/self-driving/roles/judge.yaml
378
+ .multiagent/teams/self-driving/prompts/planner.md
379
+ .multiagent/teams/self-driving/prompts/grinder.md
380
+ .multiagent/teams/self-driving/prompts/judge.md
381
+
382
+ .multiagent/teams/structured/team.yaml
383
+ .multiagent/teams/structured/roles/lead.yaml
384
+ .multiagent/teams/structured/roles/developer.yaml
385
+ .multiagent/teams/structured/roles/reviewer.yaml
386
+ .multiagent/teams/structured/prompts/lead.md
387
+ .multiagent/teams/structured/prompts/developer.md
388
+ .multiagent/teams/structured/prompts/reviewer.md
389
389
 
390
390
  docs/teams.md
391
391
  docs/implementation-summary.md
@@ -38,7 +38,7 @@ Team templates are directories of YAML configuration files that compose roles, d
38
38
  - **Programmatic API**: Define teams in TypeScript. More flexible but requires code changes for each team shape. Rejected — config is more accessible and shareable.
39
39
  - **Single monolithic config**: One file per team. Rejected — doesn't compose well with the existing layered role override system.
40
40
 
41
- **Rationale**: The existing `.macro-agent/roles/*.yaml` pattern already supports custom roles with inheritance. Team templates extend this with a `team.yaml` manifest that declares which roles participate, how they're spawned, and what strategies they use. The same role definitions work in both structured and self-driving modes — only the orchestration layer differs.
41
+ **Rationale**: The existing `.multiagent/roles/*.yaml` pattern already supports custom roles with inheritance. Team templates extend this with a `team.yaml` manifest that declares which roles participate, how they're spawned, and what strategies they use. The same role definitions work in both structured and self-driving modes — only the orchestration layer differs.
42
42
 
43
43
  ### D2: Task Pull via `claim_task` with Optimistic Locking
44
44
 
@@ -179,7 +179,7 @@ These are computed from existing events (spawn, terminate, task status changes,
179
179
  ```
180
180
  ┌─────────────────────────────────────────────────────────────┐
181
181
  │ Team Template │
182
- │ .macro-agent/teams/self-driving/ │
182
+ │ .multiagent/teams/self-driving/ │
183
183
  │ ├── team.yaml # Manifest: roles, strategy, config │
184
184
  │ ├── roles/ # Role overrides/extensions │
185
185
  │ │ ├── planner.yaml # extends: coordinator │
@@ -352,7 +352,7 @@ observability:
352
352
  Everything else builds on this. Delivers the modular team loading layer.
353
353
 
354
354
  - [ ] 1.1 Define `TeamManifest` TypeScript types in `src/teams/types.ts` — covers team.yaml schema: name, description, version, roles, bootstrap, integration, tasks, observability sections
355
- - [ ] 1.2 Implement `TeamLoader` in `src/teams/team-loader.ts` — reads `.macro-agent/teams/<name>/` directory, parses `team.yaml`, validates schema, reads role YAML files, reads prompt template files
355
+ - [ ] 1.2 Implement `TeamLoader` in `src/teams/team-loader.ts` — reads `.multiagent/teams/<name>/` directory, parses `team.yaml`, validates schema, reads role YAML files, reads prompt template files
356
356
  - [ ] 1.3 Implement `TeamRuntime` in `src/teams/team-runtime.ts` — takes a parsed `TeamManifest` and wires it into the system: registers roles into RoleRegistry, selects integration strategy, sets TaskBackend mode, stores active team state
357
357
  - [ ] 1.4 Add team context to `AgentManager.spawn()` — propagate `MACRO_TEAM_NAME`, `MACRO_INTEGRATION_STRATEGY`, `MACRO_TASK_MODE` environment variables; include team section in system prompt generation
358
358
  - [ ] 1.5 Add `--team <name>` flag to CLI start command — loads team via TeamLoader, initializes TeamRuntime, then proceeds with existing boot flow
@@ -360,7 +360,7 @@ Everything else builds on this. Delivers the modular team loading layer.
360
360
  - [ ] 1.7 Add `GET /api/team` endpoint — returns active team config or `{ active: false }`
361
361
  - [ ] 1.8 Write unit tests for TeamLoader (manifest parsing, validation, defaults) and TeamRuntime (role registration, config propagation)
362
362
  - [ ] 1.9 Write integration test: load a test team template, verify roles registered, agents spawned with correct env vars and prompts
363
- - [ ] 1.10 Create reference team template `.macro-agent/teams/self-driving/` with team.yaml, planner/grinder/judge role definitions, and prompt templates
363
+ - [ ] 1.10 Create reference team template `.multiagent/teams/self-driving/` with team.yaml, planner/grinder/judge role definitions, and prompt templates
364
364
 
365
365
  ### Phase 2: Pluggable Integration Strategies (can parallelize with Phase 3)
366
366
 
@@ -75,16 +75,16 @@ The `OptimisticIntegrationStrategy.land()` pushes changes and emits a `validatio
75
75
 
76
76
  Rather than requiring `--team` on every invocation, the active team is stored in macro-agent project-level configuration.
77
77
 
78
- **Decision**: Add a `team` field to `.macro-agent/config.json` (new file, alongside existing `.macro-agent/roles.json`). The CLI `--team` flag overrides the config. When neither is set, no team is loaded (existing behavior).
78
+ **Decision**: Add a `team` field to `.multiagent/config.json` (new file, alongside existing `.multiagent/roles.json`). The CLI `--team` flag overrides the config. When neither is set, no team is loaded (existing behavior).
79
79
 
80
80
  ```json
81
- // .macro-agent/config.json
81
+ // .multiagent/config.json
82
82
  {
83
83
  "team": "self-driving"
84
84
  }
85
85
  ```
86
86
 
87
- **Loading priority**: CLI `--team` flag > `.macro-agent/config.json` > no team (default)
87
+ **Loading priority**: CLI `--team` flag > `.multiagent/config.json` > no team (default)
88
88
 
89
89
  ### RD7: YAML library
90
90
 
@@ -112,7 +112,7 @@ Rather than requiring `--team` on every invocation, the active team is stored in
112
112
 
113
113
  | | |
114
114
  |---|---|
115
- | **What** | Read `.macro-agent/config.json` for project-level settings (starting with `team` field) |
115
+ | **What** | Read `.multiagent/config.json` for project-level settings (starting with `team` field) |
116
116
  | **Where** | New: `src/config/project-config.ts` |
117
117
  | **Schema** | `{ team?: string, [key: string]: unknown }` |
118
118
  | **Loading** | On CLI start/chat, read config file. CLI flags override. Missing file = empty config |
@@ -136,7 +136,7 @@ Rather than requiring `--team` on every invocation, the active team is stored in
136
136
 
137
137
  | | |
138
138
  |---|---|
139
- | **What** | Reads `.macro-agent/teams/<name>/` directory, parses and validates team.yaml, resolves role inheritance, loads prompts, loads MCP server configs |
139
+ | **What** | Reads `.multiagent/teams/<name>/` directory, parses and validates team.yaml, resolves role inheritance, loads prompts, loads MCP server configs |
140
140
  | **Where** | New: `src/teams/team-loader.ts` |
141
141
  | **Interface** | `TeamLoader.load(teamName: string, basePath?: string): Promise<TeamManifest>` |
142
142
  | **Dependencies** | `js-yaml` (new), `zod` (existing), `RoleRegistry` (for resolving `extends` chains) |
@@ -188,11 +188,11 @@ Rather than requiring `--team` on every invocation, the active team is stored in
188
188
 
189
189
  | | |
190
190
  |---|---|
191
- | **What** | Add `--team <name>` CLI flag, read `.macro-agent/config.json`, initialize TeamRuntime in start/chat flows |
191
+ | **What** | Add `--team <name>` CLI flag, read `.multiagent/config.json`, initialize TeamRuntime in start/chat flows |
192
192
  | **Where** | Modified: `src/cli/index.ts` |
193
193
  | **Flow** | 1. Read project config (P0.2) 2. Determine team name (CLI flag > config > none) 3. If team: load via TeamLoader, create TeamRuntime, initialize, then bootstrap after server starts |
194
194
  | **Constraint** | Chat command also supports team loading (interactive mode with team agents) |
195
- | **Success** | `multiagent-cli start --team self-driving` loads team, bootstraps agents. `multiagent-cli start` with `.macro-agent/config.json` containing `"team": "self-driving"` does the same |
195
+ | **Success** | `multiagent-cli start --team self-driving` loads team, bootstraps agents. `multiagent-cli start` with `.multiagent/config.json` containing `"team": "self-driving"` does the same |
196
196
  | **Test** | Integration test: CLI start with team flag, verify agents spawned with correct roles |
197
197
 
198
198
  #### P1.7: MCP subprocess team context
@@ -222,7 +222,7 @@ Rather than requiring `--team` on every invocation, the active team is stored in
222
222
  | | |
223
223
  |---|---|
224
224
  | **What** | Complete team template for the self-driving pattern |
225
- | **Where** | New: `.macro-agent/teams/self-driving/` with team.yaml, roles/*.yaml, prompts/*.md |
225
+ | **Where** | New: `.multiagent/teams/self-driving/` with team.yaml, roles/*.yaml, prompts/*.md |
226
226
  | **Roles** | planner (extends coordinator), grinder (extends worker), judge (extends monitor) |
227
227
  | **Topology** | Root: planner. Companions: judge. spawn_rules: planner→[grinder,planner], others→[] |
228
228
  | **Communication** | Channels: task_updates, work_coordination, health. Peer routes: judge↔planner |
@@ -379,7 +379,7 @@ Rather than requiring `--team` on every invocation, the active team is stored in
379
379
  | | |
380
380
  |---|---|
381
381
  | **What** | Finalize self-driving and structured reference templates. Add docs. Run E2E test |
382
- | **Where** | `.macro-agent/teams/self-driving/`, `.macro-agent/teams/structured/`, `docs/teams.md` |
382
+ | **Where** | `.multiagent/teams/self-driving/`, `.multiagent/teams/structured/`, `docs/teams.md` |
383
383
  | **E2E test** | Full cycle: load self-driving team → planner creates tasks → grinders claim and complete → judge monitors → trunk integration |
384
384
  | **Success** | E2E test passes. Documentation covers schema reference, custom strategy guide, examples |
385
385
 
@@ -391,7 +391,7 @@ Rather than requiring `--team` on every invocation, the active team is stored in
391
391
 
392
392
  | Phase | Criterion |
393
393
  |-------|-----------|
394
- | **P0** | `done()` works with any role that has `lifecycle.done` capability. `.macro-agent/config.json` is read on startup |
394
+ | **P0** | `done()` works with any role that has `lifecycle.done` capability. `.multiagent/config.json` is read on startup |
395
395
  | **P1** | `multiagent-cli start --team self-driving` loads a team, registers roles, spawns root + companions, agents have correct prompts and topics. MCP subprocess picks up team config from EventStore. Existing behavior without `--team` is unchanged |
396
396
  | **P2** | Worker `done()` dispatches to configured integration strategy. `queue` strategy produces identical behavior to current merge queue. `trunk` strategy pushes directly. Existing merge queue tests pass |
397
397
  | **P3** | Agents with `task.claim` capability can `claim_task()` → `done()` → `claim_task()` in a loop. Idle timeout triggers graceful exit |
@@ -23,7 +23,7 @@ Team templates make these compositions **declarative and loadable** without modi
23
23
  A team template is a directory. The structure is designed to be interoperable with other multi-agent systems — the core topology and role structure uses a generic schema, while macro-agent specific configuration lives in clearly namespaced extension fields.
24
24
 
25
25
  ```
26
- .macro-agent/teams/<team-name>/
26
+ .multiagent/teams/<team-name>/
27
27
  ├── team.yaml # Manifest: topology, communication, modes
28
28
  ├── roles/ # Role definitions
29
29
  │ ├── <role-name>.yaml
@@ -578,7 +578,7 @@ Reads and validates the template directory:
578
578
 
579
579
  ```
580
580
  TeamLoader.load(teamName, basePath?)
581
- 1. Resolve: .macro-agent/teams/<teamName>/
581
+ 1. Resolve: .multiagent/teams/<teamName>/
582
582
  2. Parse team.yaml, validate schema
583
583
  3. For each role in manifest:
584
584
  a. Load roles/<role>.yaml if present
package/docs/teams.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Team Templates
2
2
 
3
- Team templates define reusable multi-agent configurations that can be loaded and bootstrapped by the TeamRuntime. Templates live in `.macro-agent/teams/<name>/` directories.
3
+ Team templates define reusable multi-agent configurations that can be loaded and bootstrapped by the TeamRuntime. Templates live in `.multiagent/teams/<name>/` directories.
4
4
 
5
5
  ## Directory Structure
6
6
 
7
7
  ```
8
- .macro-agent/teams/<name>/
8
+ .multiagent/teams/<name>/
9
9
  ├── team.yaml # Main manifest (required)
10
10
  ├── roles/
11
11
  │ ├── <role>.yaml # Custom role definitions
@@ -127,6 +127,79 @@ macro_agent:
127
127
  max_duration_ms: number
128
128
  ```
129
129
 
130
+ ## Team Manager
131
+
132
+ The `TeamManager` (`src/teams/team-manager.ts`) owns team instance lifecycle at the server level. It supports multiple concurrent teams, each running independently with its own runtime, agent membership, and communication rules.
133
+
134
+ ### Starting Teams
135
+
136
+ Teams can be started in three ways:
137
+
138
+ 1. **Config auto-start**: Set `team` (default) and/or `teams` entries with `autoStart: true` in `.multiagent/config.json`
139
+ 2. **REST API**: `POST /api/teams { "template": "self-driving" }`
140
+ 3. **Environment**: `MACRO_TEAMS=self-driving,structured` (comma-separated, all auto-start)
141
+
142
+ ```json
143
+ {
144
+ "team": "self-driving",
145
+ "teams": {
146
+ "qa": { "autoStart": false },
147
+ "monitoring": { "template": "observer-team", "autoStart": true }
148
+ }
149
+ }
150
+ ```
151
+
152
+ Boot sequence: starts "self-driving" (default) + "monitoring" (autoStart). "qa" is available on demand via the REST API.
153
+
154
+ ### Agent Membership Model
155
+
156
+ Agents relate to teams in three ways:
157
+
158
+ **Bootstrap agents** — Spawned as a unit when a team starts. The root agent and all companions defined in `topology` are created together during `teamManager.startTeam()`. They are peers (`parent: null`), not parent-child.
159
+
160
+ **Dynamic children** — Spawned at runtime by bootstrap agents (or their descendants). The composite spawn interceptor detects that the parent belongs to a team and injects team context: env vars (`MACRO_TEAM_NAME`, `MACRO_TASK_MODE`), topic subscriptions, and MCP servers. A lifecycle listener auto-registers the child in the parent's team. These agents are not pre-declared — they grow the team dynamically based on `spawn_rules`.
161
+
162
+ **Standalone agents** — Spawned outside any team (e.g., via `POST /api/agents` or direct `agentManager.spawn()` with no team-member parent). No team context is injected, no team filters apply.
163
+
164
+ ```
165
+ startTeam("self-driving")
166
+ → spawns planner (root) ← bootstrap
167
+ → spawns judge (companion) ← bootstrap
168
+
169
+ planner spawns grinder ← dynamic child, auto-joins self-driving
170
+ grinder spawns sub-grinder ← dynamic child, auto-joins self-driving
171
+
172
+ POST /api/agents { task: "..." } ← standalone, no team
173
+ ```
174
+
175
+ ### Composite Dispatch
176
+
177
+ When multiple teams run concurrently, the TeamManager installs composite functions on the shared services that route to the correct team's runtime based on agent-to-team membership:
178
+
179
+ - **Spawn interceptor**: Looks up the parent agent's team, delegates to that team's interceptor to inject role-specific context, and tags the child with `team_instance`.
180
+ - **Signal filter**: Uses the **recipient's** team filter. If the recipient isn't in any team, falls back to the **sender's** team filter. If neither is in a team, the signal is allowed.
181
+ - **Emission validator**: Uses the **sender's** team to check whether the emitted signal is in the role's allowed emissions list.
182
+
183
+ ### Cross-Team Messaging
184
+
185
+ Agents from different teams can communicate via explicit addressing. Both the sender's emission rules and the recipient's signal filter apply independently:
186
+
187
+ - Emission validator checks whether the sender is allowed to emit the signal (sender's team rules)
188
+ - Signal filter checks whether the recipient is allowed to receive the signal (recipient's team rules)
189
+
190
+ ### Team Instance Tracking
191
+
192
+ Each team instance gets a unique ID (format: `{templateName}-{counter}`, e.g., `self-driving-1`). Every agent is tagged with its `team_instance` in the EventStore for durable tracking. Each team also emits a scoped `team_config` event with its `team_instance` field, which MCP subprocesses use to discover the correct team configuration via the `MACRO_TEAM_NAME` environment variable.
193
+
194
+ ### REST API
195
+
196
+ | Method | Path | Description |
197
+ |--------|------|-------------|
198
+ | `POST` | `/api/teams` | Start a team instance (`{ "template": "name" }`) |
199
+ | `GET` | `/api/teams` | List all running team instances |
200
+ | `GET` | `/api/teams/:id` | Get team instance details |
201
+ | `DELETE` | `/api/teams/:id` | Teardown a team instance |
202
+
130
203
  ## Task Assignment Modes
131
204
 
132
205
  ### Push Mode
@@ -188,7 +261,7 @@ Hierarchical development with explicit assignment. Uses push-mode task assignmen
188
261
 
189
262
  ## Creating a Custom Team
190
263
 
191
- 1. Create directory: `.macro-agent/teams/my-team/`
264
+ 1. Create directory: `.multiagent/teams/my-team/`
192
265
  2. Write `team.yaml` with your manifest
193
266
  3. Define custom roles in `roles/`
194
267
  4. Write system prompts in `prompts/`
@@ -107,11 +107,11 @@ Common issues and solutions when using macro-agent.
107
107
  - Check for A blocks B, B blocks A situations
108
108
  - Use `getBlocking()` to trace dependency chains
109
109
 
110
- 3. **Stale blocker state (Sudocode)**
111
- - Sudocode issues may be closed but task not updated
110
+ 3. **Stale blocker state**
111
+ - External issues may be closed but task not updated
112
112
  - Refresh task state: `await backend.get(taskId)`
113
113
 
114
- ### Task-issue binding issues (Sudocode)
114
+ ### Task-issue binding issues (OpenTasks)
115
115
 
116
116
  **Symptoms:**
117
117
  - Tasks created without `external_id`
@@ -129,21 +129,20 @@ Common issues and solutions when using macro-agent.
129
129
  });
130
130
  ```
131
131
 
132
- 2. **Sync policy configuration**
132
+ 2. **Backend configuration**
133
133
  ```typescript
134
- // Check sync policy in backend config
134
+ // Check backend config
135
135
  const config = {
136
136
  backend: {
137
- type: 'sudocode',
138
- projectPath: '/path/to/project',
139
- // Sync policy affects status propagation
137
+ type: 'opentasks',
138
+ socketPath: '/path/to/socket',
140
139
  },
141
140
  };
142
141
  ```
143
142
 
144
- 3. **Sudocode connectivity**
145
- - Check sudocode server is running
146
- - Verify `SUDOCODE_PROJECT_PATH` is correct
143
+ 3. **OpenTasks connectivity**
144
+ - Check OpenTasks server is running
145
+ - Verify `OPENTASKS_SOCKET_PATH` is correct
147
146
 
148
147
  ## Workspace Issues
149
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "macro-agent",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Interact with multiple agents as if they were a single agent.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -49,18 +49,21 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.25.1",
52
- "@multi-agent-protocol/sdk": "^0.0.9",
52
+ "@multi-agent-protocol/sdk": "^0.0.12",
53
53
  "@sudocode-ai/claude-code-acp": "^0.13.9",
54
- "acp-factory": "^0.1.10",
54
+ "acp-factory": "^0.1.12",
55
55
  "better-sqlite3": "^12.5.0",
56
56
  "chalk": "^5.6.2",
57
57
  "commander": "^14.0.2",
58
- "git-cascade": "0.0.1",
59
58
  "express": "^5.2.1",
59
+ "git-cascade": "0.0.1",
60
60
  "js-yaml": "^4.1.1",
61
61
  "nanoid": "^5.0.0",
62
+ "openteams": "^0.1.1",
63
+ "opentasks": "^0.0.3",
62
64
  "tinybase": "^5.0.0",
63
65
  "ulid": "^3.0.2",
66
+ "unique-names-generator": "^4.7.1",
64
67
  "ws": "^8.18.3",
65
68
  "zod": "^4.2.1"
66
69
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "attribution":
3
+ {
4
+ "commit": "",
5
+ "pr": ""
6
+ }
7
+ }
@@ -0,0 +1,18 @@
1
+ {"id":"i-7edu","uuid":"d7e8cb3b-73c5-4ac8-b0c3-75d30b3af857","title":"Implement global and per-directory config system for sync","content":"## Overview\nExtend the existing config system to support sync-related configuration at both global and per-directory levels.\n\n## Acceptance Criteria\n- [ ] Global config at `~/.config/minimem/config.json` supports:\n - `centralRepo`: path to central repository\n - `sync.conflictStrategy`: default merge strategy\n - `sync.autoSync`: boolean for daemon auto-sync\n - `sync.autoCommit`: boolean for auto-committing\n- [ ] Per-directory config at `.minimem/config.json` supports:\n - `sync.enabled`: boolean\n - `sync.path`: path in central repo\n - `sync.include`: glob patterns for files to sync\n - `sync.exclude`: glob patterns to exclude\n- [ ] Default include pattern: `[\"MEMORY.md\", \"memory/**/*.md\"]`\n- [ ] Config loading merges global defaults with per-directory overrides\n- [ ] `minimem config set` and `minimem config get` work for sync settings\n\n## Technical Notes\n- Extend existing `src/cli/config.ts`\n- Use JSON schema validation for config\n- Handle `~` expansion in paths\n\n## Implements\n[[s-2wx5]] - Config system requirement","status":"closed","priority":0,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:55:58","updated_at":"2026-02-03 05:36:54","closed_at":"2026-02-03 05:36:54","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-7edu","from_type":"issue","to":"i-1ce6","to_type":"issue","type":"blocks"},{"from":"i-7edu","from_type":"issue","to":"i-1tlk","to_type":"issue","type":"blocks"},{"from":"i-7edu","from_type":"issue","to":"i-8gam","to_type":"issue","type":"blocks"},{"from":"i-7edu","from_type":"issue","to":"i-dvoe","to_type":"issue","type":"blocks"},{"from":"i-7edu","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["cli","config","foundation"],"feedback":[{"id":"a8f202b4-f0a8-4455-816d-78bbb53e06f5","from_id":"i-7edu","to_id":"s-2wx5","feedback_type":"comment","content":"Implemented config system for sync with:\n- Extended CliConfig with sync section (enabled, path, include, exclude)\n- Added GlobalConfig type for XDG config (~/.config/minimem/config.json)\n- Added centralRepo, machineId, and sync settings to global config\n- Added expandPath utility for ~ expansion\n- Added loadXdgConfig, saveXdgConfig functions\n- Added getMachineId function (generates hostname-{random4hex})\n- Added getSyncConfig to merge local + global with defaults\n- Updated config command to display sync settings\n- Added --xdg-global flag to config command\n- All 39 tests pass","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-03T05:36:54.045Z","updated_at":"2026-02-03T05:36:54.045Z"}]}
2
+ {"id":"i-1tlk","uuid":"855b8770-3183-4956-8b80-d9b7b26b173f","title":"Implement directory type auto-detection","content":"## Overview\nDetect which of the four directory types a memory directory is: project-bound, standalone, hybrid, or unmanaged.\n\n## Acceptance Criteria\n- [ ] `detectDirectoryType(dir: string)` function returns one of:\n - `project-bound`: inside git repo, no sync config\n - `standalone`: has sync config, not inside git repo\n - `hybrid`: inside git repo AND has sync config\n - `unmanaged`: no git repo, no sync config\n- [ ] Detection checks for `.git` in parent directories\n- [ ] Detection reads `.minimem/config.json` for sync config\n- [ ] Exported for use by other commands (sync, push, pull, daemon)\n- [ ] Unit tests for all four detection cases\n\n## Technical Notes\n- Walk up directory tree looking for `.git`\n- Check for `sync.enabled` in local config\n- Consider caching result per session\n\n## Implements\n[[s-2wx5]] - Auto-detection requirement","status":"closed","priority":0,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:06","updated_at":"2026-02-03 05:37:57","closed_at":"2026-02-03 05:37:57","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-1tlk","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["detection","foundation"]}
3
+ {"id":"i-31u0","uuid":"900cf512-3ed8-47d7-a6bb-3ea7e8668e43","title":"Implement machine ID generation and storage","content":"## Overview\nGenerate a unique machine identifier for registry tracking, stored in global config.\n\n## Acceptance Criteria\n- [ ] `getMachineId()` returns consistent ID for this machine\n- [ ] ID format: `{hostname}-{random-suffix}` (e.g., `macbook-pro-a1b2`)\n- [ ] Generated once on first use, stored in global config\n- [ ] Random suffix is 4 hex characters\n- [ ] Function is idempotent (same ID on repeated calls)\n\n## Technical Notes\n- Use `os.hostname()` for hostname\n- Use `crypto.randomBytes(2).toString('hex')` for suffix\n- Store in `~/.config/minimem/config.json` as `machineId`\n\n## Implements\n[[s-2wx5]] - Machine ID for registry","status":"closed","priority":0,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:10","updated_at":"2026-02-03 05:36:54","closed_at":"2026-02-03 05:36:54","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-31u0","from_type":"issue","to":"i-dvoe","to_type":"issue","type":"blocks"},{"from":"i-31u0","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["config","foundation"]}
4
+ {"id":"i-1ce6","uuid":"ec0bde24-9cb6-4545-88bb-87f7c552d028","title":"Implement central repo initialization (sync init-central)","content":"## Overview\nCreate a new central repository for syncing memories, or configure an existing repo as central.\n\n## Acceptance Criteria\n- [ ] `minimem sync init-central <path>` creates new central repo:\n - Initializes git repo if not exists\n - Creates `.gitignore` (ignores `*.db`, `staging/`, `conflicts/`)\n - Creates empty `.minimem-registry.json`\n - Creates README.md explaining the repo\n- [ ] If path is existing git repo, adds registry file if missing\n- [ ] Warns if existing repo has unusual structure\n- [ ] Sets `centralRepo` in global config after creation\n- [ ] Validates path is writable\n\n## Technical Notes\n- Use `simple-git` for git operations\n- Create directory structure atomically\n\n## Implements\n[[s-2wx5]] - Bootstrap Flow A","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:17","updated_at":"2026-02-03 05:40:19","closed_at":"2026-02-03 05:40:19","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-1ce6","from_type":"issue","to":"i-1ll7","to_type":"issue","type":"blocks"},{"from":"i-1ce6","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["bootstrap","central-repo","cli"]}
5
+ {"id":"i-dvoe","uuid":"ad511324-6191-4e0c-bbf4-5be94f92a63e","title":"Implement registry system for path collision prevention","content":"## Overview\nManage the `.minimem-registry.json` file in central repo to track all sync mappings and prevent path collisions.\n\n## Acceptance Criteria\n- [ ] Registry schema with mappings array:\n - `path`: central repo path\n - `localPath`: local directory path\n - `machineId`: machine identifier\n - `lastSync`: ISO timestamp\n- [ ] `readRegistry(centralRepo)` loads registry\n- [ ] `writeRegistry(centralRepo, registry)` saves registry\n- [ ] `checkCollision(registry, path, localPath, machineId)` returns:\n - `none`: path is free\n - `same-machine`: can remap (update)\n - `collision`: different machine has this path\n- [ ] `addMapping(registry, mapping)` adds/updates entry\n- [ ] `removeMapping(registry, path, machineId)` removes entry\n- [ ] Registry file is created if missing\n\n## Technical Notes\n- Atomic writes (write to temp, rename)\n- Handle concurrent access gracefully\n\n## Implements\n[[s-2wx5]] - Central Repo Registry","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:22","updated_at":"2026-02-03 05:40:20","closed_at":"2026-02-03 05:40:20","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-dvoe","from_type":"issue","to":"i-1ll7","to_type":"issue","type":"blocks"},{"from":"i-dvoe","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["central-repo","registry"]}
6
+ {"id":"i-1ll7","uuid":"9ea75ed5-2fa2-430b-87d1-4f7a7f518d4a","title":"Implement sync init command with collision validation","content":"## Overview\nInitialize sync for a memory directory, mapping it to a path in the central repo with collision checking.\n\n## Acceptance Criteria\n- [ ] `minimem sync init --path <central-path>` for current directory\n- [ ] `minimem sync init --local <dir> --path <central-path>` for explicit directory\n- [ ] Validates central repo is configured\n- [ ] Checks registry for path collisions, blocks if collision detected\n- [ ] Creates `.minimem/config.json` with sync settings\n- [ ] Registers mapping in central repo registry\n- [ ] Performs initial sync (pull if central has content, push if local-only)\n- [ ] Shows clear error messages for:\n - Central repo not configured\n - Path already mapped by different directory\n - Local directory doesn't exist\n\n## Technical Notes\n- Requires: config system, registry system, machine ID\n- Initial sync direction based on which side has content\n\n## Implements\n[[s-2wx5]] - Bootstrap Flow C","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:29","updated_at":"2026-02-03 05:42:51","closed_at":"2026-02-03 05:42:51","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-1ll7","from_type":"issue","to":"i-7gne","to_type":"issue","type":"blocks"},{"from":"i-1ll7","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["cli","sync-setup"]}
7
+ {"id":"i-7gne","uuid":"b793a113-8ab4-4921-82e7-273f16320a0a","title":"Implement sync list and sync remove commands","content":"## Overview\nCommands to view all sync mappings and remove a directory from sync.\n\n## Acceptance Criteria\n- [ ] `minimem sync list` shows all mappings from registry:\n - Central path\n - Local path\n - Machine ID\n - Last sync time\n - Highlights current machine's mappings\n- [ ] `minimem sync remove` removes current directory from sync:\n - Removes from local `.minimem/config.json`\n - Removes from central repo registry\n - Does NOT delete synced files (just unlinks)\n- [ ] `minimem sync remove --local <dir>` for explicit directory\n- [ ] Confirms before removing\n\n## Technical Notes\n- Read registry from central repo\n- Format output as table\n\n## Implements\n[[s-2wx5]] - CLI commands for sync management","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:33","updated_at":"2026-02-03 05:42:57","closed_at":"2026-02-03 05:42:57","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-7gne","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["cli","sync-setup"]}
8
+ {"id":"i-8gam","uuid":"4450c802-d293-45e1-8a6b-76c476764814","title":"Implement sync state tracking with content hashing","content":"## Overview\nTrack the sync state of files using content hashes to detect changes and conflicts.\n\n## Acceptance Criteria\n- [ ] Sync state stored in `.minimem/sync-state.json`:\n - `lastSync`: ISO timestamp\n - `files`: map of filename to hash info\n- [ ] Each file entry has:\n - `localHash`: SHA-256 of local content\n - `remoteHash`: SHA-256 of remote content\n - `lastSyncedHash`: hash at last successful sync\n- [ ] `computeFileHash(filePath)` returns SHA-256 hex\n- [ ] `loadSyncState(dir)` reads state file\n- [ ] `saveSyncState(dir, state)` writes state file\n- [ ] `updateSyncState(dir, files)` updates hashes after sync\n- [ ] Handles missing state file (first sync)\n\n## Technical Notes\n- Use `crypto.createHash('sha256')`\n- Atomic writes for state file\n- Only track files matching include/exclude patterns\n\n## Implements\n[[s-2wx5]] - Conflict Detection (Hash + Shadow)","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:41","updated_at":"2026-02-03 05:42:50","closed_at":"2026-02-03 05:42:50","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-8gam","from_type":"issue","to":"i-3jn4","to_type":"issue","type":"blocks"},{"from":"i-8gam","from_type":"issue","to":"i-5ooa","to_type":"issue","type":"blocks"},{"from":"i-8gam","from_type":"issue","to":"i-9fm3","to_type":"issue","type":"blocks"},{"from":"i-8gam","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["core-sync","state"]}
9
+ {"id":"i-5ooa","uuid":"17bc44e4-1373-4fde-8114-06320d27b71e","title":"Implement push command","content":"## Overview\nPush local memory files to the central repository.\n\n## Acceptance Criteria\n- [ ] `minimem push` syncs current directory to central repo\n- [ ] `minimem push --dir <path>` for explicit directory\n- [ ] Only pushes files matching include/exclude patterns\n- [ ] Uses atomic staging:\n 1. Copy to `.minimem/staging/{timestamp}/`\n 2. Validate all files copied\n 3. Move to central repo path\n 4. Clean up staging\n- [ ] Updates sync state after successful push\n- [ ] Updates registry `lastSync` timestamp\n- [ ] Detects conflicts (both sides changed) and delegates to conflict handler\n- [ ] Shows summary: files pushed, conflicts found, errors\n\n## Technical Notes\n- Requires: sync state, config, registry\n- Use conflict detection before overwriting\n\n## Implements\n[[s-2wx5]] - Push command","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:46","updated_at":"2026-02-03 05:45:16","closed_at":"2026-02-03 05:45:16","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-5ooa","from_type":"issue","to":"i-25ys","to_type":"issue","type":"blocks"},{"from":"i-5ooa","from_type":"issue","to":"i-7l8f","to_type":"issue","type":"blocks"},{"from":"i-5ooa","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["cli","core-sync"]}
10
+ {"id":"i-3jn4","uuid":"5c9b07bf-718d-47b2-bc32-5b19b9087d33","title":"Implement pull command","content":"## Overview\nPull memory files from the central repository to local directory.\n\n## Acceptance Criteria\n- [ ] `minimem pull` syncs central repo to current directory\n- [ ] `minimem pull --dir <path>` for explicit directory\n- [ ] Only pulls files matching include/exclude patterns\n- [ ] Uses atomic staging:\n 1. Copy from central to `.minimem/staging/{timestamp}/`\n 2. Validate all files copied\n 3. Move to local directory\n 4. Clean up staging\n- [ ] Updates sync state after successful pull\n- [ ] Detects conflicts (both sides changed) and delegates to conflict handler\n- [ ] Shows summary: files pulled, conflicts found, errors\n- [ ] Creates local directories as needed\n\n## Technical Notes\n- Requires: sync state, config, registry\n- Mirror of push logic but reversed direction\n\n## Implements\n[[s-2wx5]] - Pull command","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:48","updated_at":"2026-02-03 05:45:16","closed_at":"2026-02-03 05:45:16","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-3jn4","from_type":"issue","to":"i-25ys","to_type":"issue","type":"blocks"},{"from":"i-3jn4","from_type":"issue","to":"i-7l8f","to_type":"issue","type":"blocks"},{"from":"i-3jn4","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["cli","core-sync"]}
11
+ {"id":"i-9fm3","uuid":"f5cb95c3-ba65-4ffe-a863-da414d6dc801","title":"Implement conflict detection algorithm","content":"## Overview\nDetect when both local and remote have changed since last sync, requiring conflict resolution.\n\n## Acceptance Criteria\n- [ ] `detectConflicts(dir, centralRepo)` returns list of:\n - `file`: filename\n - `status`: `no-change` | `local-only` | `remote-only` | `conflict`\n - `localHash`, `remoteHash`, `baseHash`\n- [ ] Algorithm per file:\n - If localHash == remoteHash → `no-change`\n - If localHash == baseHash → `remote-only` (pull)\n - If remoteHash == baseHash → `local-only` (push)\n - Else → `conflict`\n- [ ] Creates shadow copy for conflicts:\n - `.minimem/shadows/{filename}.base` from lastSyncedHash content\n- [ ] Handles new files (no base hash)\n- [ ] Handles deleted files\n\n## Technical Notes\n- Shadow copies needed for 3-way merge\n- Consider file renames (future enhancement)\n\n## Implements\n[[s-2wx5]] - Conflict Detection Algorithm","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:56:56","updated_at":"2026-02-03 05:45:12","closed_at":"2026-02-03 05:45:12","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-9fm3","from_type":"issue","to":"i-3jn4","to_type":"issue","type":"blocks"},{"from":"i-9fm3","from_type":"issue","to":"i-5ooa","to_type":"issue","type":"blocks"},{"from":"i-9fm3","from_type":"issue","to":"i-8t0z","to_type":"issue","type":"blocks"},{"from":"i-9fm3","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["conflict","core-sync"]}
12
+ {"id":"i-8t0z","uuid":"f4a413ac-3349-4d99-9c24-b6ba0cbe982e","title":"Implement merge resolution strategies","content":"## Overview\nApply configured merge strategy when conflicts are detected.\n\n## Acceptance Criteria\n- [ ] `resolveConflict(file, strategy, options)` applies strategy:\n - `keep-both`: Append both with conflict markers and timestamps\n - `merge`: Git-style 3-way merge using diff3\n - `manual`: Move to quarantine, fail sync for this file\n - `last-write-wins`: Use file with later mtime\n- [ ] Keep-both format:\n ```\n <<<<<<< LOCAL (2024-01-15 10:30)\n local content\n =======\n remote content\n >>>>>>> REMOTE (2024-01-15 09:45)\n ```\n- [ ] Merge resolver hook support:\n - If `mergeResolver` configured, spawn external tool\n - Wait for tool to exit\n - Read merged result\n- [ ] Returns: `resolved` | `quarantined` | `failed`\n\n## Technical Notes\n- Use `diff3` or similar for 3-way merge\n- External tools get paths: base, local, remote, output\n\n## Implements\n[[s-2wx5]] - Merge Resolution Strategies","status":"closed","priority":1,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:57:02","updated_at":"2026-02-03 05:45:17","closed_at":"2026-02-03 05:45:17","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-8t0z","from_type":"issue","to":"i-9a8e","to_type":"issue","type":"blocks"},{"from":"i-8t0z","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["conflict","merge"]}
13
+ {"id":"i-9a8e","uuid":"57a30353-f397-4bce-9478-3b429da858ee","title":"Implement quarantine and recovery system","content":"## Overview\nQuarantine conflicted files and provide recovery commands for failed syncs.\n\n## Acceptance Criteria\n- [ ] Quarantine structure:\n ```\n .minimem/conflicts/{timestamp}/\n ├── {filename}.local\n ├── {filename}.remote\n └── {filename}.base\n ```\n- [ ] `quarantineConflict(file, local, remote, base)` saves copies\n- [ ] `minimem sync conflicts` lists all quarantined conflicts:\n - Timestamp, filename, local/remote timestamps\n- [ ] `minimem sync resolve <file>` opens merge tool for manual resolution\n- [ ] `minimem sync recover` retries last failed sync\n- [ ] Sync log at `.minimem/sync.log`:\n - Timestamp, operation, result, errors\n- [ ] Cleanup old quarantine (configurable retention)\n\n## Technical Notes\n- Quarantine preserves all versions for safety\n- Recovery reads from staging if present\n\n## Implements\n[[s-2wx5]] - Sync Failure Recovery","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:57:08","updated_at":"2026-02-03 07:24:05","closed_at":"2026-02-03 07:24:05","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-9a8e","from_type":"issue","to":"i-65zj","to_type":"issue","type":"blocks"},{"from":"i-9a8e","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["cli","conflict","recovery"],"feedback":[{"id":"c65a26ed-b934-4357-89e3-05ab096f6ced","from_id":"i-9a8e","to_id":"s-2wx5","feedback_type":"comment","content":"Implemented quarantine and recovery system:\n- Quarantine structure in `.minimem/conflicts/{timestamp}/` with `.local`, `.remote`, `.base` files\n- `quarantineConflict()` and `listQuarantinedConflicts()` in conflicts.ts\n- CLI commands: `sync:conflicts`, `sync:resolve <timestamp>`, `sync:cleanup`\n- Sync log at `.minimem/sync.log` with JSONL format\n- `sync:log` command to view history\n- Auto-detects merge tools (code, meld, kdiff3, vimdiff)\n- Cleanup supports --days and --dry-run options","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-03T07:24:04.899Z","updated_at":"2026-02-03T07:24:04.899Z"}]}
14
+ {"id":"i-7l8f","uuid":"95c7277b-dfb0-47c0-8092-51116a648069","title":"Implement file watcher with debouncing","content":"## Overview\nWatch memory directories for file changes with debouncing to avoid rapid-fire syncs.\n\n## Acceptance Criteria\n- [ ] `createFileWatcher(dir, options)` returns watcher instance\n- [ ] Watches files matching include/exclude patterns\n- [ ] Debounces changes (default 2 seconds):\n - Multiple rapid changes trigger single callback\n - Configurable debounce interval\n- [ ] Emits events: `change`, `add`, `unlink`\n- [ ] Ignores `.minimem/` directory (staging, conflicts, db)\n- [ ] `watcher.close()` cleans up\n- [ ] Works cross-platform (macOS, Linux, Windows)\n\n## Technical Notes\n- Use `chokidar` for cross-platform watching\n- Debounce per-file or batch all changes\n- Consider `usePolling` fallback for network drives\n\n## Implements\n[[s-2wx5]] - Daemon file watching","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:57:15","updated_at":"2026-02-03 07:30:17","closed_at":"2026-02-03 07:30:17","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-7l8f","from_type":"issue","to":"i-3ko0","to_type":"issue","type":"blocks"},{"from":"i-7l8f","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["daemon","watcher"],"feedback":[{"id":"9ec16de1-c190-4de5-871d-80cd5eebdf1d","from_id":"i-7l8f","to_id":"s-2wx5","feedback_type":"comment","content":"Implemented file watcher with debouncing in src/cli/sync/watcher.ts:\n- `createFileWatcher(dir, options)` returns watcher instance\n- Watches files matching include/exclude patterns (default: MEMORY.md, memory/*.md)\n- Debounces changes (default 2 seconds, configurable)\n- Emits batched 'changes' events with event type (add, change, unlink)\n- Ignores .minimem/ directory automatically\n- `createMultiDirWatcher()` for watching multiple directories\n- Uses chokidar for cross-platform support\n- Supports usePolling option for network drives\n- `watcher.close()` cleans up resources","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-03T07:30:17.354Z","updated_at":"2026-02-03T07:30:17.354Z"}]}
15
+ {"id":"i-3ko0","uuid":"d113f827-40c7-4072-9c1e-d7b95c10c661","title":"Implement daemon core with auto-sync","content":"## Overview\nBackground daemon that watches configured directories and syncs automatically.\n\n## Acceptance Criteria\n- [ ] `minimem daemon` starts daemon in foreground\n- [ ] `minimem daemon --background` detaches (writes PID file)\n- [ ] `minimem daemon stop` stops running daemon\n- [ ] `minimem daemon status` shows daemon state\n- [ ] Daemon behavior:\n - Reads all directories with sync config from registry\n - Starts file watcher for each\n - On local change: triggers push (if autoSync enabled)\n - Watches central repo for changes (polling or git hooks)\n - On central change: triggers pull to affected directories\n- [ ] Respects `autoCommit` setting (stage only vs commit)\n- [ ] Logs activity to `.minimem/daemon.log`\n- [ ] Graceful shutdown on SIGTERM/SIGINT\n\n## Technical Notes\n- Use PID file for singleton daemon\n- Consider systemd/launchd integration later\n\n## Implements\n[[s-2wx5]] - Daemon Architecture","status":"closed","priority":2,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:57:21","updated_at":"2026-02-03 07:32:36","closed_at":"2026-02-03 07:32:36","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-3ko0","from_type":"issue","to":"i-5skx","to_type":"issue","type":"blocks"},{"from":"i-3ko0","from_type":"issue","to":"i-65zj","to_type":"issue","type":"blocks"},{"from":"i-3ko0","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["auto-sync","daemon"],"feedback":[{"id":"a6defc05-2fc0-4c4c-ba67-33e9a311330e","from_id":"i-3ko0","to_id":"s-2wx5","feedback_type":"comment","content":"Implemented daemon core in src/cli/sync/daemon.ts and src/cli/commands/daemon.ts:\n- `minimem daemon` starts daemon in foreground\n- `minimem daemon --background` detaches with PID file\n- `minimem daemon:stop` stops running daemon\n- `minimem daemon:status` shows daemon state\n- `minimem daemon:logs` shows daemon log with -f/--follow option\n- Daemon reads sync-enabled directories from registry\n- Auto-syncs on local changes when autoSync is enabled\n- Polls central repo for remote changes\n- Logs activity to ~/.minimem/daemon.log with rotation\n- Graceful shutdown on SIGTERM/SIGINT","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-03T07:32:36.150Z","updated_at":"2026-02-03T07:32:36.150Z"}]}
16
+ {"id":"i-5skx","uuid":"66e3932f-7064-4d65-a2f5-8c40dd69ed76","title":"Implement registry validation in daemon","content":"## Overview\nDaemon periodically validates registry for path collisions and warns users.\n\n## Acceptance Criteria\n- [ ] Daemon checks registry on startup\n- [ ] Periodic validation (configurable interval, default 5 minutes)\n- [ ] Detects invalid states:\n - Same path mapped by multiple machines\n - Stale mappings (machine not seen in X days)\n - Local directory no longer exists\n- [ ] Warnings logged and optionally shown to user\n- [ ] Does not auto-fix, just warns\n- [ ] `minimem sync validate` manual validation command\n\n## Technical Notes\n- Avoid spamming warnings (once per issue per session)\n- Consider notification system integration\n\n## Implements\n[[s-2wx5]] - Daemon validates registry","status":"closed","priority":3,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:57:25","updated_at":"2026-02-03 07:35:11","closed_at":"2026-02-03 07:35:11","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-5skx","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["daemon","registry","validation"],"feedback":[{"id":"7235dfb2-ab25-4b72-b673-e9472ae54bdf","from_id":"i-5skx","to_id":"s-2wx5","feedback_type":"comment","content":"Implemented registry validation in src/cli/sync/validation.ts:\n- Detects path collisions (same path mapped by different machines)\n- Detects stale mappings (not synced in 30+ days)\n- Detects missing local directories (for current machine only)\n- `minimem sync:validate` CLI command with JSON output option\n- Daemon validates registry on startup and periodically (every 5 minutes)\n- Warnings logged to daemon.log without spamming","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-03T07:35:11.209Z","updated_at":"2026-02-03T07:35:11.209Z"}]}
17
+ {"id":"i-25ys","uuid":"93fdc287-ae2b-49fa-905f-d109eb12da84","title":"Implement sync status command","content":"## Overview\nShow sync status across all configured directories.\n\n## Acceptance Criteria\n- [ ] `minimem sync status` shows for each synced directory:\n - Local path\n - Central repo path\n - Last sync time\n - Status: `synced` | `local-changes` | `remote-changes` | `conflicts`\n - Number of pending changes\n- [ ] `minimem sync status --dir <path>` for specific directory\n- [ ] Color-coded output (green=synced, yellow=changes, red=conflicts)\n- [ ] Shows daemon status (running/stopped)\n- [ ] Quick summary line at end\n\n## Technical Notes\n- Reads sync state files\n- Compares current hashes to detect pending changes\n- Does not perform sync, just reports\n\n## Implements\n[[s-2wx5]] - Status command (nice to have)","status":"closed","priority":3,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:57:32","updated_at":"2026-02-03 07:20:56","closed_at":"2026-02-03 07:20:56","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-25ys","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["cli","status"],"feedback":[{"id":"b06307fd-5ecc-4c1c-ad85-bce61065228e","from_id":"i-25ys","to_id":"s-2wx5","feedback_type":"comment","content":"Implemented sync:status command in src/cli/commands/push-pull.ts. Shows sync status with counts for unchanged, local changes, remote changes, new files, deleted files, and conflicts. Color-coding deferred to future enhancement. Daemon status will be added when daemon is implemented.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-03T07:20:56.704Z","updated_at":"2026-02-03T07:20:56.704Z"}]}
18
+ {"id":"i-65zj","uuid":"3f63eb98-b13e-4ba9-8a97-7e2b28d019ce","title":"Write integration tests for git sync system","content":"## Overview\nEnd-to-end tests for the complete sync workflow.\n\n## Acceptance Criteria\n- [ ] Test bootstrap flows:\n - Fresh central repo creation\n - Existing repo as central\n - Directory sync init\n - Clone setup on \"new machine\" (simulated)\n- [ ] Test sync operations:\n - Push local changes\n - Pull remote changes\n - Bidirectional sync\n- [ ] Test conflict scenarios:\n - Both sides changed, keep-both resolution\n - Conflict quarantine\n - Recovery from failed sync\n- [ ] Test collision prevention:\n - Block duplicate path mapping\n - Allow same-machine remap\n- [ ] Test daemon (if feasible):\n - Auto-sync on file change\n - Registry validation warnings\n- [ ] Use temp directories, no real git remotes\n\n## Technical Notes\n- Mock git operations or use real local repos\n- Clean up temp directories after tests\n- Consider test isolation\n\n## Implements\n[[s-2wx5]] - Success Criteria validation","status":"closed","priority":3,"assignee":null,"archived":0,"archived_at":null,"created_at":"2026-02-02 23:57:37","updated_at":"2026-02-03 18:40:36","closed_at":"2026-02-03 18:40:36","parent_id":null,"parent_uuid":null,"relationships":[{"from":"i-65zj","from_type":"issue","to":"s-2wx5","to_type":"spec","type":"implements"}],"tags":["integration","testing"],"feedback":[{"id":"ee25b64f-eaa8-4f55-ae5f-73863958c6a6","from_id":"i-65zj","to_id":"s-2wx5","feedback_type":"comment","content":"Implemented comprehensive integration tests in src/cli/sync/__tests__/integration.test.ts:\n\n**Bootstrap Flows:**\n- Fresh central repo creation and validation\n- XDG config setup with central repo path\n- Directory sync initialization\n- Clone setup simulation on \"new machine\"\n\n**Sync Operations:**\n- Push local changes to central\n- Pull remote changes to local\n- Bidirectional sync\n\n**Conflict Scenarios:**\n- Detect conflicts when both sides changed\n- Keep-both strategy for conflict resolution\n- Quarantine conflicts for manual resolution\n\n**Collision Prevention:**\n- Block duplicate path mapping from different machines\n- Allow same machine to remap path\n- Allow different paths for different machines\n- Detect collisions in validation\n\n**Full Workflow Test:**\n- Complete end-to-end sync workflow covering all components\n\nTotal: 133 tests across 10 test files, all passing.","agent":"alexngai","anchor":null,"dismissed":false,"created_at":"2026-02-03T18:40:35.831Z","updated_at":"2026-02-03T18:40:35.831Z"}]}
@@ -0,0 +1 @@
1
+ {"id":"s-2wx5","uuid":"f2e6f765-0ff1-40ee-b93c-4ea832231e94","title":"Git Sync System for Memory Directories","file_path":"specs/s-2wx5_git_sync_system_for_memory_directories.md","content":"# Git Sync System for Memory Directories\n\n## Context\n\nminimem stores memories as plain Markdown files which are inherently git-friendly. However, users need a way to sync memories across machines and collaborate with others. The SQLite database with embeddings is **not** the source of truth and should never be committed—it's rebuilt locally via `minimem sync`.\n\nUsers have two distinct use cases:\n1. **Project-bound memories** - embedded directly in code repos alongside source code\n2. **Standalone memories** - scattered directories that should sync to a central repository\n3. **Hybrid** - project memories that are ALSO synced to a central repo for aggregation\n\n## Out of Scope\n\n- Real-time collaborative editing (not Google Docs)\n- Full git client replacement (we use git, not replace it)\n- Remote repository hosting (user provides their own)\n- Encryption at rest (use git-crypt or similar if needed)\n\n## Requirements\n\n### Must Have\n\n- [ ] CLI commands to configure sync mappings between local directories and central repo paths\n- [ ] Auto-detection of directory type (project-bound, standalone, hybrid)\n- [ ] Push/pull commands to sync directories with central repo\n- [ ] Configurable merge resolution strategies\n- [ ] Support for multiple directories syncing to one central repo\n- [ ] Path collision validation on init\n- [ ] Graceful sync failure recovery with atomic operations\n\n### Should Have\n\n- [ ] Daemon for automatic sync with file watching\n- [ ] Git hooks integration in central repo (post-pull triggers local sync)\n- [ ] Merge resolver hook for custom conflict resolution tools\n- [ ] Sync state registry in central repo to detect collisions\n\n### Nice to Have\n\n- [ ] Integration with MCP server (daemon runs alongside)\n- [ ] Periodic sync fallback when file watching unavailable\n- [ ] Status command showing sync state across all configured directories\n\n## Design\n\n### Directory Types\n\n| Type | Detection | Git Management | Sync Behavior |\n|------|-----------|----------------|---------------|\n| **Project-bound** | Inside git repo, no sync config | User handles git | No sync |\n| **Standalone** | Has sync config, not in project git | minimem manages | Full sync |\n| **Hybrid** | Inside git repo AND has sync config | User handles project git | Also syncs to central |\n| **Unmanaged** | No git repo, no sync config | None | Prompt to set up |\n\n### Auto-Detection Logic\n\n```\nIs there a sync config in .minimem/config.json?\n├─ Yes: \n│ └─ Is directory inside a git repo?\n│ ├─ Yes → Hybrid (user manages project git, minimem syncs to central)\n│ └─ No → Standalone (minimem manages sync)\n└─ No:\n └─ Is directory inside a git repo?\n ├─ Yes → Project-bound (user manages everything)\n └─ No → Unmanaged (prompt to set up sync?)\n```\n\n### Configuration\n\n**Global config** (`~/.config/minimem/config.json`):\n```json\n{\n \"centralRepo\": \"~/memories-repo\",\n \"sync\": {\n \"conflictStrategy\": \"keep-both\",\n \"autoSync\": true,\n \"autoCommit\": false\n }\n}\n```\n\n**Per-directory config** (`.minimem/config.json`):\n```json\n{\n \"sync\": {\n \"enabled\": true,\n \"path\": \"global/\",\n \"include\": [\"MEMORY.md\", \"memory/**/*.md\"],\n \"exclude\": [\"memory/drafts/**\"]\n }\n}\n```\n\n**Default sync scope:** `MEMORY.md` + `memory/**/*.md`\n\n### Central Repo Registry\n\nThe central repo maintains a registry to prevent path collisions:\n\n**`.minimem-registry.json`** (in central repo root):\n```json\n{\n \"mappings\": [\n {\n \"path\": \"global/\",\n \"localPath\": \"~/.minimem\",\n \"machineId\": \"macbook-pro-a1b2\",\n \"lastSync\": \"2024-01-15T10:30:00Z\"\n },\n {\n \"path\": \"work/\",\n \"localPath\": \"~/work/memories\",\n \"machineId\": \"macbook-pro-a1b2\",\n \"lastSync\": \"2024-01-15T10:30:00Z\"\n }\n ]\n}\n```\n\n**Collision detection:**\n- On `sync init`: check registry, block if path already mapped by different local path\n- Daemon: periodically validate registry, warn on conflicts\n- Same machine can remap (update), different machine with same path = collision\n\n### CLI Commands\n\n```bash\n# === Central Repo Setup ===\n\n# Use existing repo as central\nminimem config set centralRepo ~/existing-memories-repo\n\n# Initialize new central repo\nminimem sync init-central ~/new-memories-repo\n# Creates repo structure, .gitignore, registry file\n\n# === Directory Sync Setup ===\n\n# Initialize sync for current directory\nminimem sync init --path global/\n# Validates path not already mapped, updates registry\n\n# Explicit paths\nminimem sync init --local ~/work/memories --path work/\n\n# List all sync mappings (from registry)\nminimem sync list\n\n# Remove mapping\nminimem sync remove\n# Removes from local config and registry\n\n# === Sync Operations ===\n\nminimem push # local → central repo\nminimem pull # central repo → local\nminimem sync status # show sync state for all directories\n```\n\n### Conflict Detection (Hybrid: Hash + Shadow)\n\n**Sync state tracking** (`.minimem/sync-state.json`):\n```json\n{\n \"lastSync\": \"2024-01-15T10:30:00Z\",\n \"files\": {\n \"MEMORY.md\": {\n \"localHash\": \"abc123\",\n \"remoteHash\": \"abc123\",\n \"lastSyncedHash\": \"abc123\"\n },\n \"memory/2024-01-15.md\": {\n \"localHash\": \"def456\",\n \"remoteHash\": \"def456\",\n \"lastSyncedHash\": \"def456\"\n }\n }\n}\n```\n\n**Detection algorithm:**\n```\nFor each file:\n localHash = hash(local file)\n remoteHash = hash(central repo file)\n baseHash = lastSyncedHash from sync-state.json\n \n if localHash == remoteHash:\n → No change, skip\n elif localHash == baseHash:\n → Only remote changed, pull\n elif remoteHash == baseHash:\n → Only local changed, push\n else:\n → Both changed, CONFLICT\n → Create shadow copy for 3-way merge\n → Apply merge strategy\n```\n\n**Shadow copies** (created only on conflict):\n- `.minimem/shadows/{filename}.base` - last synced version\n- Used as merge base for 3-way merge\n- Cleaned up after resolution\n\n### Merge Resolution Strategies\n\n| Strategy | Behavior | Use Case |\n|----------|----------|----------|\n| `merge` | Git-style 3-way merge | Technical content |\n| `keep-both` | Append both versions with separator | **Default for memories** |\n| `manual` | Fail, open in merge tool | Critical content |\n| `last-write-wins` | Overwrite with latest timestamp | Low-stakes |\n\n**Keep-both format:**\n```markdown\n<<<<<<< LOCAL (2024-01-15 10:30)\nLocal version of content\n=======\nRemote version of content\n>>>>>>> REMOTE (2024-01-15 09:45)\n```\n\nMerge resolver hook:\n```json\n{\n \"sync\": {\n \"conflictStrategy\": \"manual\",\n \"mergeResolver\": \"code --wait --merge\"\n }\n}\n```\n\n### Sync Failure Recovery (Atomic + Quarantine)\n\n**Atomic sync process:**\n```\n1. Create staging: .minimem/staging/{timestamp}/\n2. Copy files to staging\n3. Validate all files copied successfully\n4. On success: move staging → final destination\n5. On failure: \n - Leave staging intact\n - Log error to .minimem/sync.log\n - Notify user\n```\n\n**Quarantine for conflicts:**\n```\n.minimem/\n├── conflicts/\n│ └── 2024-01-15T10-30-00/\n│ ├── MEMORY.md.local\n│ ├── MEMORY.md.remote\n│ └── MEMORY.md.base\n└── staging/\n └── {in-progress sync files}\n```\n\n**Recovery commands:**\n```bash\nminimem sync recover # retry failed sync\nminimem sync conflicts # list unresolved conflicts\nminimem sync resolve <file> # manually resolve conflict\n```\n\n### Daemon Architecture\n\n```\n ┌─────────────────┐\n │ Daemon │\n └────────┬────────┘\n │\n ┌───────────────────┼───────────────────┐\n │ │ │\n ▼ ▼ ▼\n Watch local dirs Watch central repo Validate registry\n (file changes) (git pull detected) (detect collisions)\n │ │ │\n ▼ ▼ ▼\n Debounce + Push Pull to local dirs Warn on conflicts\n```\n\n**Daemon responsibilities:**\n- Watch configured directories for file changes\n- Debounce rapid changes (e.g., 2 second delay)\n- Trigger push on local changes (if autoSync enabled)\n- Watch central repo for pulls (git hooks or polling)\n- Periodically validate registry for path collisions\n- Stage changes only by default (autoCommit: false)\n\nDaemon modes:\n- Standalone: `minimem daemon`\n- Integrated: runs with MCP server\n- System service: launchd/systemd\n\n### Bootstrap Flows\n\n**Flow A: Fresh central repo**\n```bash\nminimem sync init-central ~/memories-repo\n# Creates:\n# ~/memories-repo/\n# ├── .git/\n# ├── .gitignore # ignores *.db, staging/, conflicts/\n# ├── .minimem-registry.json\n# └── README.md\n\nminimem config set centralRepo ~/memories-repo\n```\n\n**Flow B: Existing repo as central**\n```bash\nminimem config set centralRepo ~/existing-repo\n# Validates repo exists\n# Creates .minimem-registry.json if missing\n# Warns if structure looks unusual\n```\n\n**Flow C: Add directory to sync**\n```bash\ncd ~/.minimem\nminimem sync init --path global/\n# Checks registry for collision\n# Updates .minimem/config.json\n# Registers in central repo\n# Initial sync (pull or push based on state)\n```\n\n**Flow D: Clone setup on new machine**\n```bash\ngit clone <central-repo> ~/memories-repo\nminimem config set centralRepo ~/memories-repo\nminimem sync list # shows all registered paths\nminimem sync init --local ~/.minimem --path global/\n# Links local directory to existing central path\n# Updates registry with new machine ID\n# Pulls content from central\n```\n\n### Central Repo Structure\n\n```\nmemories-repo/ # git repo\n├── .git/\n├── .gitignore\n├── .minimem-registry.json # path collision prevention\n├── global/ # maps to ~/.minimem/\n│ ├── MEMORY.md\n│ └── memory/\n├── work/ # maps to ~/work/memories/\n│ ├── MEMORY.md\n│ └── memory/\n└── projects/\n └── projectA/ # hybrid: also in project repo\n ├── MEMORY.md\n └── memory/\n```\n\n## Success Criteria\n\n- [ ] User can configure a central repo and map multiple directories to it\n- [ ] `minimem push/pull` correctly syncs files between local and central\n- [ ] Conflicts are detected using hash comparison and resolved with keep-both strategy\n- [ ] Path collisions are prevented via registry validation on init\n- [ ] Auto-detection correctly identifies all four directory types\n- [ ] Sync failures are recoverable via atomic operations and quarantine\n- [ ] Daemon watches for changes and syncs automatically when enabled\n- [ ] Daemon detects and warns about registry conflicts\n\n## Technical Considerations\n\n- Use `chokidar` for cross-platform file watching\n- Git operations via `simple-git` library\n- Debounce file changes (2 second default) before sync\n- Content hashing with SHA-256 for conflict detection\n- Machine ID from `os.hostname()` + random suffix on first run\n- Store machine ID in global config\n- Central repo only contains `.md` files, registry, and gitignore\n\n## Decisions Made\n\n| Question | Decision | Rationale |\n|----------|----------|-----------|\n| Daemon auto-commit? | Configurable, default off | User controls when to commit |\n| Conflict strategy default? | `keep-both` | Never lose memory data |\n| Lock mechanism? | Atomic staging | Simpler than locks, same safety |\n| Path collision handling? | Registry + validation on init | Prevent rather than recover |\n","priority":1,"archived":0,"archived_at":null,"created_at":"2026-02-02 06:36:19","updated_at":"2026-02-02 23:50:18","parent_id":null,"parent_uuid":null,"relationships":[],"tags":["cli","daemon","git","sync"]}