@voybio/ace-swarm 0.1.0

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 (334) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/LICENSE +186 -0
  3. package/README.md +229 -0
  4. package/assets/.agents/ACE/ACE-Init/AGENTS.md +210 -0
  5. package/assets/.agents/ACE/ACE-Init/instructions.md +118 -0
  6. package/assets/.agents/ACE/ACE_coders/AGENTS.md +154 -0
  7. package/assets/.agents/ACE/ACE_coders/INSTRUCTIONS.md +216 -0
  8. package/assets/.agents/ACE/AGENT_REGISTRY.md +70 -0
  9. package/assets/.agents/ACE/AGENT_REGISTRY_7.md +9 -0
  10. package/assets/.agents/ACE/DIRECTIVE_KERNEL.md +234 -0
  11. package/assets/.agents/ACE/UI/AGENTS.md +115 -0
  12. package/assets/.agents/ACE/UI/instructions.md +178 -0
  13. package/assets/.agents/ACE/VOS/ACE_VOS_MISSING_INFO_MATRIX.md +42 -0
  14. package/assets/.agents/ACE/VOS/AGENTS.md +72 -0
  15. package/assets/.agents/ACE/VOS/instructions.md +211 -0
  16. package/assets/.agents/ACE/agent-astgrep/AGENTS.md +123 -0
  17. package/assets/.agents/ACE/agent-astgrep/instructions.md +91 -0
  18. package/assets/.agents/ACE/agent-builder/AGENTS.md +172 -0
  19. package/assets/.agents/ACE/agent-builder/instructions.md +137 -0
  20. package/assets/.agents/ACE/agent-docs/AGENTS.md +159 -0
  21. package/assets/.agents/ACE/agent-docs/instructions.md +133 -0
  22. package/assets/.agents/ACE/agent-eval/AGENTS.md +46 -0
  23. package/assets/.agents/ACE/agent-eval/instructions.md +56 -0
  24. package/assets/.agents/ACE/agent-memory/AGENTS.md +49 -0
  25. package/assets/.agents/ACE/agent-memory/instructions.md +50 -0
  26. package/assets/.agents/ACE/agent-observability/AGENTS.md +46 -0
  27. package/assets/.agents/ACE/agent-observability/instructions.md +50 -0
  28. package/assets/.agents/ACE/agent-ops/AGENTS.md +201 -0
  29. package/assets/.agents/ACE/agent-ops/instructions.md +136 -0
  30. package/assets/.agents/ACE/agent-qa/AGENTS.md +189 -0
  31. package/assets/.agents/ACE/agent-qa/instructions.md +121 -0
  32. package/assets/.agents/ACE/agent-release/AGENTS.md +48 -0
  33. package/assets/.agents/ACE/agent-release/instructions.md +49 -0
  34. package/assets/.agents/ACE/agent-research/AGENTS.md +160 -0
  35. package/assets/.agents/ACE/agent-research/instructions.md +118 -0
  36. package/assets/.agents/ACE/agent-security/AGENTS.md +48 -0
  37. package/assets/.agents/ACE/agent-security/instructions.md +50 -0
  38. package/assets/.agents/ACE/agent-skeptic/AGENTS.md +178 -0
  39. package/assets/.agents/ACE/agent-skeptic/instructions.md +196 -0
  40. package/assets/.agents/ACE/agent-spec/AGENTS.md +169 -0
  41. package/assets/.agents/ACE/agent-spec/instructions.md +116 -0
  42. package/assets/.agents/ACE/orchestrator/AGENTS.md +365 -0
  43. package/assets/.agents/ACE/orchestrator/instructions.md +231 -0
  44. package/assets/.agents/skills/ace-orchestrator/SKILL.md +63 -0
  45. package/assets/.agents/skills/ace-orchestrator/references/engineering-bootstrap-playbook.md +360 -0
  46. package/assets/.agents/skills/astgrep-index/SKILL.md +58 -0
  47. package/assets/.agents/skills/codemunch/SKILL.md +65 -0
  48. package/assets/.agents/skills/codemunch/references/ast-driven-protocol.md +543 -0
  49. package/assets/.agents/skills/codesnipe/SKILL.md +64 -0
  50. package/assets/.agents/skills/codesnipe/references/dual-codebase-playbook.md +671 -0
  51. package/assets/.agents/skills/eval-harness/SKILL.md +203 -0
  52. package/assets/.agents/skills/handoff-lint/SKILL.md +164 -0
  53. package/assets/.agents/skills/incident-commander/SKILL.md +174 -0
  54. package/assets/.agents/skills/landing-review-watcher/SKILL.md +68 -0
  55. package/assets/.agents/skills/memory-curator/SKILL.md +179 -0
  56. package/assets/.agents/skills/problem-triage/SKILL.md +57 -0
  57. package/assets/.agents/skills/problem-triage/agents/openai.yaml +3 -0
  58. package/assets/.agents/skills/release-sentry/SKILL.md +189 -0
  59. package/assets/.agents/skills/risk-quant/SKILL.md +190 -0
  60. package/assets/.agents/skills/schema-forge/SKILL.md +174 -0
  61. package/assets/.agents/skills/skill-auditor/SKILL.md +52 -0
  62. package/assets/.agents/skills/state-auditor/SKILL.md +182 -0
  63. package/assets/.github/hooks/ace-copilot.json +68 -0
  64. package/assets/agent-state/ACE_WORKFLOW.md +131 -0
  65. package/assets/agent-state/ARTIFACT_MANIFEST.json +5 -0
  66. package/assets/agent-state/AST_GREP_COMMANDS.md +121 -0
  67. package/assets/agent-state/AST_GREP_INDEX.json +13 -0
  68. package/assets/agent-state/AST_GREP_INDEX.md +15 -0
  69. package/assets/agent-state/DECISIONS.md +7 -0
  70. package/assets/agent-state/EVIDENCE_LOG.md +7 -0
  71. package/assets/agent-state/HANDOFF.json +24 -0
  72. package/assets/agent-state/INTERFACE_REGISTRY.md +75 -0
  73. package/assets/agent-state/MODULES/gates/gate-autonomy.json +7 -0
  74. package/assets/agent-state/MODULES/gates/gate-completeness.json +7 -0
  75. package/assets/agent-state/MODULES/gates/gate-correctness.json +7 -0
  76. package/assets/agent-state/MODULES/gates/gate-evaluation.json +7 -0
  77. package/assets/agent-state/MODULES/gates/gate-operability.json +7 -0
  78. package/assets/agent-state/MODULES/gates/gate-security.json +7 -0
  79. package/assets/agent-state/MODULES/gates/gate-typescript-public-surface.json +7 -0
  80. package/assets/agent-state/MODULES/registry.json +41 -0
  81. package/assets/agent-state/MODULES/roles/capability-astgrep.json +49 -0
  82. package/assets/agent-state/MODULES/roles/capability-build.json +39 -0
  83. package/assets/agent-state/MODULES/roles/capability-docs.json +38 -0
  84. package/assets/agent-state/MODULES/roles/capability-eval.json +20 -0
  85. package/assets/agent-state/MODULES/roles/capability-memory.json +20 -0
  86. package/assets/agent-state/MODULES/roles/capability-observability.json +20 -0
  87. package/assets/agent-state/MODULES/roles/capability-ops.json +45 -0
  88. package/assets/agent-state/MODULES/roles/capability-qa.json +40 -0
  89. package/assets/agent-state/MODULES/roles/capability-release.json +21 -0
  90. package/assets/agent-state/MODULES/roles/capability-research.json +44 -0
  91. package/assets/agent-state/MODULES/roles/capability-security.json +21 -0
  92. package/assets/agent-state/MODULES/roles/capability-skeptic.json +48 -0
  93. package/assets/agent-state/MODULES/roles/capability-spec.json +42 -0
  94. package/assets/agent-state/MODULES/schemas/ACE_RUNTIME_PROFILE.schema.json +289 -0
  95. package/assets/agent-state/MODULES/schemas/ARTIFACT_MANIFEST.schema.json +185 -0
  96. package/assets/agent-state/MODULES/schemas/HANDOFF.agent-state.schema.json +124 -0
  97. package/assets/agent-state/MODULES/schemas/HANDOFF.schema.json +55 -0
  98. package/assets/agent-state/MODULES/schemas/RUNTIME_EXECUTOR_SESSION_REGISTRY.schema.json +290 -0
  99. package/assets/agent-state/MODULES/schemas/RUNTIME_TOOL_SPEC_REGISTRY.schema.json +144 -0
  100. package/assets/agent-state/MODULES/schemas/STATUS_EVENT.schema.json +84 -0
  101. package/assets/agent-state/MODULES/schemas/SWARM_HANDOFF.schema.json +138 -0
  102. package/assets/agent-state/MODULES/schemas/TRACKER_SNAPSHOT.schema.json +134 -0
  103. package/assets/agent-state/MODULES/schemas/VERICIFY_BRIDGE_SNAPSHOT.schema.json +157 -0
  104. package/assets/agent-state/MODULES/schemas/VERICIFY_PROCESS_POST_LOG.schema.json +93 -0
  105. package/assets/agent-state/MODULES/schemas/WORKSPACE_SESSION_REGISTRY.schema.json +133 -0
  106. package/assets/agent-state/PROVENANCE_LOG.md +28 -0
  107. package/assets/agent-state/QUALITY_GATES.md +15 -0
  108. package/assets/agent-state/RISKS.md +8 -0
  109. package/assets/agent-state/SCOPE.md +20 -0
  110. package/assets/agent-state/SKILL_CATALOG.md +48 -0
  111. package/assets/agent-state/STATUS.md +8 -0
  112. package/assets/agent-state/STATUS_EVENTS.ndjson +1 -0
  113. package/assets/agent-state/TASK.md +18 -0
  114. package/assets/agent-state/TEAL_CONFIG.md +117 -0
  115. package/assets/agent-state/handoff-registry.json +5 -0
  116. package/assets/agent-state/index-fingerprints.json +7 -0
  117. package/assets/agent-state/index.json +32 -0
  118. package/assets/agent-state/run-ledger.json +5 -0
  119. package/assets/agent-state/runtime-executor-sessions.json +5 -0
  120. package/assets/agent-state/runtime-tool-specs.json +5 -0
  121. package/assets/agent-state/runtime-workspaces.json +5 -0
  122. package/assets/agent-state/todo-state.json +7 -0
  123. package/assets/agent-state/tracker-snapshot.json +7 -0
  124. package/assets/agent-state/vericify/ace-bridge.json +60 -0
  125. package/assets/agent-state/vericify/process-posts.json +5 -0
  126. package/assets/instructions/ACE.instructions.md +187 -0
  127. package/assets/instructions/ACE_Coder.instructions.md +146 -0
  128. package/assets/instructions/ACE_UI.instructions.md +178 -0
  129. package/assets/instructions/ACE_VOS.instructions.md +211 -0
  130. package/assets/scripts/ace-hook-dispatch.mjs +538 -0
  131. package/assets/scripts/bootstrap-workspace.sh +27 -0
  132. package/assets/scripts/copilot-hook-dispatch.mjs +3 -0
  133. package/assets/scripts/eval-harness.sh +68 -0
  134. package/assets/scripts/render-mcp-configs.sh +396 -0
  135. package/assets/tasks/README.md +48 -0
  136. package/assets/tasks/SWARM_HANDOFF.example.json +53 -0
  137. package/assets/tasks/SWARM_HANDOFF.example_ui_to_coders.json +55 -0
  138. package/assets/tasks/SWARM_HANDOFF.example_vos_to_ui.json +55 -0
  139. package/assets/tasks/SWARM_HANDOFF.template.json +52 -0
  140. package/assets/tasks/cli_work_split.md +22 -0
  141. package/assets/tasks/lessons.md +17 -0
  142. package/assets/tasks/role_tasks.md +206 -0
  143. package/assets/tasks/todo.md +23 -0
  144. package/dist/ace-autonomy.d.ts +137 -0
  145. package/dist/ace-autonomy.js +472 -0
  146. package/dist/ace-context.d.ts +29 -0
  147. package/dist/ace-context.js +240 -0
  148. package/dist/ace-internal-tools.d.ts +8 -0
  149. package/dist/ace-internal-tools.js +76 -0
  150. package/dist/ace-server-instructions.d.ts +12 -0
  151. package/dist/ace-server-instructions.js +324 -0
  152. package/dist/agent-runtime/role-adapters.d.ts +29 -0
  153. package/dist/agent-runtime/role-adapters.js +573 -0
  154. package/dist/astgrep-index.d.ts +24 -0
  155. package/dist/astgrep-index.js +476 -0
  156. package/dist/cli.d.ts +3 -0
  157. package/dist/cli.js +591 -0
  158. package/dist/git-ops.d.ts +53 -0
  159. package/dist/git-ops.js +238 -0
  160. package/dist/handoff-registry.d.ts +71 -0
  161. package/dist/handoff-registry.js +422 -0
  162. package/dist/helpers.d.ts +126 -0
  163. package/dist/helpers.js +1687 -0
  164. package/dist/index-store.d.ts +51 -0
  165. package/dist/index-store.js +328 -0
  166. package/dist/index.d.ts +3 -0
  167. package/dist/index.js +7 -0
  168. package/dist/internal-tool-runtime.d.ts +21 -0
  169. package/dist/internal-tool-runtime.js +136 -0
  170. package/dist/job-scheduler.d.ts +175 -0
  171. package/dist/job-scheduler.js +1217 -0
  172. package/dist/kanban.d.ts +27 -0
  173. package/dist/kanban.js +339 -0
  174. package/dist/local-model-runtime.d.ts +40 -0
  175. package/dist/local-model-runtime.js +174 -0
  176. package/dist/model-bridge.d.ts +54 -0
  177. package/dist/model-bridge.js +587 -0
  178. package/dist/orchestrator-supervisor.d.ts +100 -0
  179. package/dist/orchestrator-supervisor.js +399 -0
  180. package/dist/problem-triage.d.ts +23 -0
  181. package/dist/problem-triage.js +448 -0
  182. package/dist/prompts.d.ts +7 -0
  183. package/dist/prompts.js +628 -0
  184. package/dist/public-surface.d.ts +30 -0
  185. package/dist/public-surface.js +316 -0
  186. package/dist/resources.d.ts +7 -0
  187. package/dist/resources.js +545 -0
  188. package/dist/run-ledger.d.ts +36 -0
  189. package/dist/run-ledger.js +257 -0
  190. package/dist/runtime-command.d.ts +18 -0
  191. package/dist/runtime-command.js +76 -0
  192. package/dist/runtime-executor.d.ts +104 -0
  193. package/dist/runtime-executor.js +985 -0
  194. package/dist/runtime-profile.d.ts +116 -0
  195. package/dist/runtime-profile.js +532 -0
  196. package/dist/runtime-tool-specs.d.ts +68 -0
  197. package/dist/runtime-tool-specs.js +527 -0
  198. package/dist/safe-edit.d.ts +52 -0
  199. package/dist/safe-edit.js +255 -0
  200. package/dist/schemas.d.ts +44 -0
  201. package/dist/schemas.js +830 -0
  202. package/dist/semantic-cache.d.ts +147 -0
  203. package/dist/semantic-cache.js +552 -0
  204. package/dist/semantic-hash.d.ts +83 -0
  205. package/dist/semantic-hash.js +346 -0
  206. package/dist/server.d.ts +10 -0
  207. package/dist/server.js +46 -0
  208. package/dist/shared.d.ts +136 -0
  209. package/dist/shared.js +269 -0
  210. package/dist/skill-auditor.d.ts +26 -0
  211. package/dist/skill-auditor.js +184 -0
  212. package/dist/skill-catalog.d.ts +60 -0
  213. package/dist/skill-catalog.js +305 -0
  214. package/dist/status-events.d.ts +40 -0
  215. package/dist/status-events.js +269 -0
  216. package/dist/store/ace-packed-store.d.ts +69 -0
  217. package/dist/store/ace-packed-store.js +434 -0
  218. package/dist/store/bootstrap-store.d.ts +46 -0
  219. package/dist/store/bootstrap-store.js +242 -0
  220. package/dist/store/catalog-builder.d.ts +21 -0
  221. package/dist/store/catalog-builder.js +68 -0
  222. package/dist/store/importer.d.ts +19 -0
  223. package/dist/store/importer.js +157 -0
  224. package/dist/store/knowledge-bake.d.ts +59 -0
  225. package/dist/store/knowledge-bake.js +339 -0
  226. package/dist/store/materializers/hook-context-materializer.d.ts +25 -0
  227. package/dist/store/materializers/hook-context-materializer.js +100 -0
  228. package/dist/store/materializers/host-file-materializer.d.ts +37 -0
  229. package/dist/store/materializers/host-file-materializer.js +271 -0
  230. package/dist/store/materializers/todo-syncer.d.ts +30 -0
  231. package/dist/store/materializers/todo-syncer.js +140 -0
  232. package/dist/store/materializers/vericify-projector.d.ts +38 -0
  233. package/dist/store/materializers/vericify-projector.js +239 -0
  234. package/dist/store/repositories/discovery-repository.d.ts +24 -0
  235. package/dist/store/repositories/discovery-repository.js +58 -0
  236. package/dist/store/repositories/handoff-repository.d.ts +31 -0
  237. package/dist/store/repositories/handoff-repository.js +67 -0
  238. package/dist/store/repositories/ledger-repository.d.ts +26 -0
  239. package/dist/store/repositories/ledger-repository.js +49 -0
  240. package/dist/store/repositories/runtime-kv-repository.d.ts +16 -0
  241. package/dist/store/repositories/runtime-kv-repository.js +36 -0
  242. package/dist/store/repositories/scheduler-repository.d.ts +50 -0
  243. package/dist/store/repositories/scheduler-repository.js +123 -0
  244. package/dist/store/repositories/session-repository.d.ts +33 -0
  245. package/dist/store/repositories/session-repository.js +82 -0
  246. package/dist/store/repositories/todo-repository.d.ts +31 -0
  247. package/dist/store/repositories/todo-repository.js +77 -0
  248. package/dist/store/repositories/tracker-repository.d.ts +25 -0
  249. package/dist/store/repositories/tracker-repository.js +43 -0
  250. package/dist/store/repositories/vericify-repository.d.ts +32 -0
  251. package/dist/store/repositories/vericify-repository.js +58 -0
  252. package/dist/store/skills-install.d.ts +28 -0
  253. package/dist/store/skills-install.js +86 -0
  254. package/dist/store/state-reader.d.ts +49 -0
  255. package/dist/store/state-reader.js +111 -0
  256. package/dist/store/store-artifacts.d.ts +12 -0
  257. package/dist/store/store-artifacts.js +138 -0
  258. package/dist/store/store-snapshot.d.ts +19 -0
  259. package/dist/store/store-snapshot.js +140 -0
  260. package/dist/store/topology-bake.d.ts +15 -0
  261. package/dist/store/topology-bake.js +215 -0
  262. package/dist/store/types.d.ts +155 -0
  263. package/dist/store/types.js +35 -0
  264. package/dist/store/workspace-snapshot.d.ts +26 -0
  265. package/dist/store/workspace-snapshot.js +107 -0
  266. package/dist/store/write-queue.d.ts +7 -0
  267. package/dist/store/write-queue.js +26 -0
  268. package/dist/todo-state.d.ts +41 -0
  269. package/dist/todo-state.js +399 -0
  270. package/dist/tools-agent.d.ts +7 -0
  271. package/dist/tools-agent.js +1542 -0
  272. package/dist/tools-discovery.d.ts +6 -0
  273. package/dist/tools-discovery.js +178 -0
  274. package/dist/tools-drift.d.ts +13 -0
  275. package/dist/tools-drift.js +357 -0
  276. package/dist/tools-files.d.ts +6 -0
  277. package/dist/tools-files.js +679 -0
  278. package/dist/tools-framework.d.ts +7 -0
  279. package/dist/tools-framework.js +1414 -0
  280. package/dist/tools-git.d.ts +6 -0
  281. package/dist/tools-git.js +183 -0
  282. package/dist/tools-handoff.d.ts +32 -0
  283. package/dist/tools-handoff.js +489 -0
  284. package/dist/tools-lifecycle.d.ts +6 -0
  285. package/dist/tools-lifecycle.js +205 -0
  286. package/dist/tools-memory.d.ts +6 -0
  287. package/dist/tools-memory.js +260 -0
  288. package/dist/tools-scheduler.d.ts +6 -0
  289. package/dist/tools-scheduler.js +228 -0
  290. package/dist/tools-skills.d.ts +3 -0
  291. package/dist/tools-skills.js +104 -0
  292. package/dist/tools-todo.d.ts +6 -0
  293. package/dist/tools-todo.js +154 -0
  294. package/dist/tools.d.ts +9 -0
  295. package/dist/tools.js +33 -0
  296. package/dist/tracker-adapters.d.ts +74 -0
  297. package/dist/tracker-adapters.js +776 -0
  298. package/dist/tracker-sync.d.ts +10 -0
  299. package/dist/tracker-sync.js +84 -0
  300. package/dist/tui/agent-runner.d.ts +137 -0
  301. package/dist/tui/agent-runner.js +466 -0
  302. package/dist/tui/agent-worker.d.ts +10 -0
  303. package/dist/tui/agent-worker.js +347 -0
  304. package/dist/tui/chat.d.ts +84 -0
  305. package/dist/tui/chat.js +368 -0
  306. package/dist/tui/commands.d.ts +57 -0
  307. package/dist/tui/commands.js +432 -0
  308. package/dist/tui/dashboard.d.ts +24 -0
  309. package/dist/tui/dashboard.js +110 -0
  310. package/dist/tui/index.d.ts +114 -0
  311. package/dist/tui/index.js +1059 -0
  312. package/dist/tui/input.d.ts +49 -0
  313. package/dist/tui/input.js +336 -0
  314. package/dist/tui/layout.d.ts +116 -0
  315. package/dist/tui/layout.js +367 -0
  316. package/dist/tui/ollama.d.ts +116 -0
  317. package/dist/tui/ollama.js +192 -0
  318. package/dist/tui/openai-compatible.d.ts +63 -0
  319. package/dist/tui/openai-compatible.js +370 -0
  320. package/dist/tui/provider-discovery.d.ts +59 -0
  321. package/dist/tui/provider-discovery.js +530 -0
  322. package/dist/tui/renderer.d.ts +166 -0
  323. package/dist/tui/renderer.js +304 -0
  324. package/dist/tui/tabs.d.ts +70 -0
  325. package/dist/tui/tabs.js +208 -0
  326. package/dist/tui/telemetry.d.ts +56 -0
  327. package/dist/tui/telemetry.js +106 -0
  328. package/dist/vericify-bridge.d.ts +146 -0
  329. package/dist/vericify-bridge.js +571 -0
  330. package/dist/vericify-context.d.ts +10 -0
  331. package/dist/vericify-context.js +72 -0
  332. package/dist/workspace-manager.d.ts +107 -0
  333. package/dist/workspace-manager.js +636 -0
  334. package/package.json +83 -0
@@ -0,0 +1,271 @@
1
+ /**
2
+ * HostFileMaterializer
3
+ *
4
+ * Writes the minimal host-facing shim files that must remain on disk because
5
+ * external tools do not read the ACE store directly.
6
+ *
7
+ * The store remains authoritative. These files are projections only.
8
+ */
9
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
10
+ import { dirname, join, resolve } from "node:path";
11
+ import { fileURLToPath } from "node:url";
12
+ import { buildHostInstructionText } from "../../ace-server-instructions.js";
13
+ import { ALL_MCP_CLIENTS, getAllMcpServerConfigSnippets, getMcpClientInstallHint, getMcpServerConfigSnippet, } from "../../helpers.js";
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+ const HOOK_COMMAND = "node ./.agents/ACE/scripts/ace/ace-hook-dispatch.mjs";
16
+ const HOST_KNOWLEDGE_PREFIX = "knowledge/host";
17
+ function ensureDir(path) {
18
+ const dir = dirname(path);
19
+ if (!existsSync(dir))
20
+ mkdirSync(dir, { recursive: true });
21
+ }
22
+ function write(path, content) {
23
+ ensureDir(path);
24
+ writeFileSync(path, content, "utf8");
25
+ return path;
26
+ }
27
+ function buildCopilotHookSettings() {
28
+ const hook = {
29
+ type: "command",
30
+ command: HOOK_COMMAND,
31
+ windows: "node .\\\\.agents\\\\ACE\\\\scripts\\\\ace\\\\ace-hook-dispatch.mjs",
32
+ timeout: 10,
33
+ };
34
+ return JSON.stringify({
35
+ hooks: {
36
+ SessionStart: [hook],
37
+ UserPromptSubmit: [hook],
38
+ PreToolUse: [hook],
39
+ PostToolUse: [hook],
40
+ PreCompact: [hook],
41
+ SubagentStart: [hook],
42
+ SubagentStop: [hook],
43
+ Stop: [hook],
44
+ },
45
+ }, null, 2);
46
+ }
47
+ function buildClaudeHookSettings() {
48
+ const hook = {
49
+ type: "command",
50
+ command: HOOK_COMMAND,
51
+ };
52
+ return JSON.stringify({
53
+ hooks: {
54
+ SessionStart: [{ matcher: "", hooks: [hook] }],
55
+ UserPromptSubmit: [{ matcher: "", hooks: [hook] }],
56
+ PreToolUse: [{ matcher: "", hooks: [hook] }],
57
+ PostToolUse: [{ matcher: "", hooks: [hook] }],
58
+ PreCompact: [{ matcher: "", hooks: [hook] }],
59
+ SubagentStart: [{ matcher: "", hooks: [hook] }],
60
+ SubagentStop: [{ matcher: "", hooks: [hook] }],
61
+ Stop: [{ matcher: "", hooks: [hook] }],
62
+ },
63
+ }, null, 2);
64
+ }
65
+ function buildCodexHookSettings() {
66
+ return [
67
+ "# ACE lifecycle hook scaffold for Codex-compatible runtimes.",
68
+ "# Merge or source these entries in the host hook config that supports SessionStart/SubagentStart hooks.",
69
+ "",
70
+ ...["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PreCompact", "SubagentStart", "SubagentStop", "Stop"].flatMap((event) => ["[[hooks]]", `event = "${event}"`, `command = "${HOOK_COMMAND}"`, ""]),
71
+ ].join("\n");
72
+ }
73
+ function getAssetsScriptsRoot() {
74
+ const packaged = resolve(__dirname, "..", "..", "..", "assets", "scripts");
75
+ if (existsSync(packaged))
76
+ return packaged;
77
+ return resolve(__dirname, "..", "..", "..", "..", "assets", "scripts");
78
+ }
79
+ export class HostFileMaterializer {
80
+ store;
81
+ workspaceRoot;
82
+ packageName;
83
+ constructor(store, workspaceRoot, packageName = "@voybio/ace-swarm") {
84
+ this.store = store;
85
+ this.workspaceRoot = workspaceRoot;
86
+ this.packageName = packageName;
87
+ }
88
+ ace(...parts) {
89
+ return join(this.workspaceRoot, ".agents", "ACE", ...parts);
90
+ }
91
+ root(...parts) {
92
+ return join(this.workspaceRoot, ...parts);
93
+ }
94
+ hostKey(...parts) {
95
+ return `${HOST_KNOWLEDGE_PREFIX}/${parts.join("/")}`;
96
+ }
97
+ async materializeProjectedText(absPath, keyParts, fallbackContent) {
98
+ const key = this.hostKey(...keyParts);
99
+ const existing = await this.store.getBlob(key);
100
+ const content = existing ?? fallbackContent;
101
+ if (existing === undefined) {
102
+ await this.store.setBlob(key, fallbackContent);
103
+ }
104
+ return write(absPath, content);
105
+ }
106
+ async seedProjectedText(entry) {
107
+ const key = this.hostKey(...entry.keyParts);
108
+ const existing = await this.store.getBlob(key);
109
+ if (existing === undefined) {
110
+ await this.store.setBlob(key, entry.fallbackContent);
111
+ }
112
+ }
113
+ async materializeEntry(entry) {
114
+ return this.materializeProjectedText(entry.absPath, entry.keyParts, entry.fallbackContent);
115
+ }
116
+ buildInstructionShimEntries() {
117
+ return [
118
+ {
119
+ absPath: this.root("AGENTS.md"),
120
+ keyParts: ["AGENTS.md"],
121
+ fallbackContent: buildHostInstructionText("codex", this.workspaceRoot),
122
+ },
123
+ {
124
+ absPath: this.root("CLAUDE.md"),
125
+ keyParts: ["CLAUDE.md"],
126
+ fallbackContent: buildHostInstructionText("claude", this.workspaceRoot),
127
+ },
128
+ {
129
+ absPath: this.root(".cursorrules"),
130
+ keyParts: [".cursorrules"],
131
+ fallbackContent: buildHostInstructionText("cursor", this.workspaceRoot),
132
+ },
133
+ {
134
+ absPath: this.root(".github", "copilot-instructions.md"),
135
+ keyParts: [".github", "copilot-instructions.md"],
136
+ fallbackContent: buildHostInstructionText("copilot", this.workspaceRoot),
137
+ },
138
+ ];
139
+ }
140
+ buildHookFileEntries() {
141
+ return [
142
+ {
143
+ absPath: this.root(".claude", "settings.json"),
144
+ keyParts: [".claude", "settings.json"],
145
+ fallbackContent: JSON.stringify(JSON.parse(buildClaudeHookSettings()), null, 2),
146
+ },
147
+ {
148
+ absPath: this.root(".github", "hooks", "ace-copilot.json"),
149
+ keyParts: [".github", "hooks", "ace-copilot.json"],
150
+ fallbackContent: JSON.stringify(JSON.parse(buildCopilotHookSettings()), null, 2),
151
+ },
152
+ {
153
+ absPath: this.root(".cursor", "hooks.json"),
154
+ keyParts: [".cursor", "hooks.json"],
155
+ fallbackContent: JSON.stringify(JSON.parse(buildCopilotHookSettings()), null, 2),
156
+ },
157
+ ];
158
+ }
159
+ buildOptionalHookBundleEntries() {
160
+ return [
161
+ {
162
+ absPath: this.root(".vscode", "ace-hooks.json"),
163
+ keyParts: [".vscode", "ace-hooks.json"],
164
+ fallbackContent: JSON.stringify(JSON.parse(buildCopilotHookSettings()), null, 2),
165
+ },
166
+ {
167
+ absPath: this.root(".mcp-config", "codex.hooks.toml"),
168
+ keyParts: [".mcp-config", "codex.hooks.toml"],
169
+ fallbackContent: buildCodexHookSettings(),
170
+ },
171
+ {
172
+ absPath: this.root(".mcp-config", "gemini.hooks.json"),
173
+ keyParts: [".mcp-config", "gemini.hooks.json"],
174
+ fallbackContent: buildCopilotHookSettings(),
175
+ },
176
+ {
177
+ absPath: this.root(".mcp-config", "antigravity.hooks.json"),
178
+ keyParts: [".mcp-config", "antigravity.hooks.json"],
179
+ fallbackContent: buildCopilotHookSettings(),
180
+ },
181
+ ];
182
+ }
183
+ buildScriptEntries() {
184
+ return ["ace-hook-dispatch.mjs", "copilot-hook-dispatch.mjs"].map((scriptName) => {
185
+ const src = join(getAssetsScriptsRoot(), scriptName);
186
+ return {
187
+ absPath: this.ace("scripts", "ace", scriptName),
188
+ keyParts: [".agents", "ACE", "scripts", "ace", scriptName],
189
+ fallbackContent: readFileSync(src, "utf8"),
190
+ };
191
+ });
192
+ }
193
+ buildWorkspaceScriptEntries() {
194
+ return this.buildScriptEntries().filter((entry) => entry.keyParts.at(-1) === "ace-hook-dispatch.mjs");
195
+ }
196
+ buildMcpBundleEntries() {
197
+ const snippets = getAllMcpServerConfigSnippets();
198
+ const fileNames = {
199
+ codex: "codex.config.toml",
200
+ vscode: "vscode.mcp.json",
201
+ claude: "claude_desktop_config.json",
202
+ cursor: "cursor.mcp.json",
203
+ antigravity: "antigravity.mcp.json",
204
+ };
205
+ const entries = [];
206
+ for (const client of ALL_MCP_CLIENTS) {
207
+ entries.push({
208
+ absPath: this.root(".mcp-config", fileNames[client]),
209
+ keyParts: [".mcp-config", fileNames[client]],
210
+ fallbackContent: snippets[client],
211
+ });
212
+ }
213
+ entries.push({
214
+ absPath: this.root(".mcp-config", "README.md"),
215
+ keyParts: [".mcp-config", "README.md"],
216
+ fallbackContent: [
217
+ "# ACE MCP Client Config Bundle",
218
+ "",
219
+ `Generated for ${this.packageName}. Prefer global or user-level MCP installs; this bundle is stored in ace-state.zarr for export and repair.`,
220
+ "",
221
+ "## Files",
222
+ ...ALL_MCP_CLIENTS.map((client) => `- ${client}: ${fileNames[client]}`),
223
+ "",
224
+ "## Install Hints",
225
+ ...ALL_MCP_CLIENTS.map((client) => `- ${client}: ${getMcpClientInstallHint(client)}`),
226
+ ].join("\n"),
227
+ });
228
+ return entries;
229
+ }
230
+ buildVsCodeMcpEntry() {
231
+ return {
232
+ absPath: this.root(".vscode", "mcp.json"),
233
+ keyParts: [".vscode", "mcp.json"],
234
+ fallbackContent: getMcpServerConfigSnippet("vscode"),
235
+ };
236
+ }
237
+ buildAllProjectedEntries() {
238
+ return [
239
+ ...this.buildInstructionShimEntries(),
240
+ ...this.buildHookFileEntries(),
241
+ ...this.buildOptionalHookBundleEntries(),
242
+ ...this.buildScriptEntries(),
243
+ ...this.buildMcpBundleEntries(),
244
+ this.buildVsCodeMcpEntry(),
245
+ ];
246
+ }
247
+ async seedStorePayload() {
248
+ for (const entry of this.buildAllProjectedEntries()) {
249
+ await this.seedProjectedText(entry);
250
+ }
251
+ }
252
+ async materializeAll(opts = {}) {
253
+ const paths = [];
254
+ const includeMcpConfig = opts.includeMcpConfig ?? false;
255
+ const includeClientConfigBundle = opts.includeClientConfigBundle ?? false;
256
+ await this.seedStorePayload();
257
+ if (!includeMcpConfig && !includeClientConfigBundle) {
258
+ return paths;
259
+ }
260
+ if (includeMcpConfig) {
261
+ paths.push(await this.materializeEntry(this.buildVsCodeMcpEntry()));
262
+ }
263
+ if (includeClientConfigBundle) {
264
+ for (const entry of this.buildInstructionShimEntries()) {
265
+ paths.push(await this.materializeEntry(entry));
266
+ }
267
+ }
268
+ return paths;
269
+ }
270
+ }
271
+ //# sourceMappingURL=host-file-materializer.js.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * TodoSyncer
3
+ *
4
+ * Bidirectional sync between tasks/todo.md (human-editable) and the store.
5
+ *
6
+ * - On write: store → tasks/todo.md (ACE writes todo state from store)
7
+ * - On read: tasks/todo.md → store (if externally modified by mtime + hash)
8
+ *
9
+ * tasks/todo.md format:
10
+ * - [ ] Todo item title (id: todo-001)
11
+ * - [x] Completed item (id: todo-002)
12
+ * - [~] In progress (id: todo-003)
13
+ * - [!] Blocked (id: todo-004)
14
+ */
15
+ import { AcePackedStore } from "../ace-packed-store.js";
16
+ export declare class TodoSyncer {
17
+ private store;
18
+ private workspaceRoot;
19
+ private repo;
20
+ private lastHash;
21
+ private todoMdPath;
22
+ constructor(store: AcePackedStore, workspaceRoot: string);
23
+ /** Write store todo state → tasks/todo.md */
24
+ writeToFile(): Promise<void>;
25
+ /** Check if tasks/todo.md was modified externally, and if so ingest changes */
26
+ syncFromFile(): Promise<boolean>;
27
+ /** Initialize todo.md with starter content if it doesn't exist */
28
+ initStarter(): Promise<void>;
29
+ }
30
+ //# sourceMappingURL=todo-syncer.d.ts.map
@@ -0,0 +1,140 @@
1
+ /**
2
+ * TodoSyncer
3
+ *
4
+ * Bidirectional sync between tasks/todo.md (human-editable) and the store.
5
+ *
6
+ * - On write: store → tasks/todo.md (ACE writes todo state from store)
7
+ * - On read: tasks/todo.md → store (if externally modified by mtime + hash)
8
+ *
9
+ * tasks/todo.md format:
10
+ * - [ ] Todo item title (id: todo-001)
11
+ * - [x] Completed item (id: todo-002)
12
+ * - [~] In progress (id: todo-003)
13
+ * - [!] Blocked (id: todo-004)
14
+ */
15
+ import { writeFileSync, readFileSync, existsSync, mkdirSync } from "fs";
16
+ import { join, dirname } from "path";
17
+ import { createHash } from "crypto";
18
+ import { TodoRepository } from "../repositories/todo-repository.js";
19
+ const STATUS_ICONS = {
20
+ pending: " ",
21
+ in_progress: "~",
22
+ done: "x",
23
+ blocked: "!",
24
+ cancelled: "-",
25
+ };
26
+ const ICON_STATUS = {
27
+ " ": "pending",
28
+ "~": "in_progress",
29
+ x: "done",
30
+ "!": "blocked",
31
+ "-": "cancelled",
32
+ };
33
+ function sha256(content) {
34
+ return createHash("sha256").update(content, "utf8").digest("hex");
35
+ }
36
+ function renderTodoMd(todos) {
37
+ const lines = ["# Tasks\n"];
38
+ const byStatus = {};
39
+ for (const t of todos) {
40
+ (byStatus[t.status] ??= []).push(t);
41
+ }
42
+ const order = ["in_progress", "pending", "blocked", "done", "cancelled"];
43
+ for (const status of order) {
44
+ const group = byStatus[status];
45
+ if (!group?.length)
46
+ continue;
47
+ const icon = STATUS_ICONS[status];
48
+ for (const t of group) {
49
+ const priority = t.priority ? ` [${t.priority}]` : "";
50
+ const assignee = t.assigned_to ? ` @${t.assigned_to}` : "";
51
+ lines.push(`- [${icon}] ${t.title}${priority}${assignee} (id: ${t.id})`);
52
+ if (t.notes)
53
+ lines.push(` > ${t.notes}`);
54
+ }
55
+ }
56
+ return lines.join("\n") + "\n";
57
+ }
58
+ function parseTodoMd(content) {
59
+ const results = [];
60
+ for (const line of content.split("\n")) {
61
+ const match = line.match(/^- \[(.)\] (.+)/);
62
+ if (!match)
63
+ continue;
64
+ const [, iconChar, rest] = match;
65
+ const status = ICON_STATUS[iconChar] ?? "pending";
66
+ // Extract id if present
67
+ const idMatch = rest.match(/\(id: ([^)]+)\)/);
68
+ const id = idMatch?.[1];
69
+ const title = rest.replace(/\s*\(id: [^)]+\)/, "").replace(/\s*\[[^\]]+\]/, "").replace(/\s*@\S+/, "").trim();
70
+ results.push({ id, title, status });
71
+ }
72
+ return results;
73
+ }
74
+ export class TodoSyncer {
75
+ store;
76
+ workspaceRoot;
77
+ repo;
78
+ lastHash = "";
79
+ todoMdPath;
80
+ constructor(store, workspaceRoot) {
81
+ this.store = store;
82
+ this.workspaceRoot = workspaceRoot;
83
+ this.repo = new TodoRepository(store);
84
+ // Canonical ACE path: .agents/ACE/tasks/todo.md (mirrors ACE_TASKS_ROOT_REL in helpers.ts)
85
+ this.todoMdPath = join(workspaceRoot, ".agents", "ACE", "tasks", "todo.md");
86
+ }
87
+ /** Write store todo state → tasks/todo.md */
88
+ async writeToFile() {
89
+ const todos = await this.repo.getAll();
90
+ const content = renderTodoMd(todos);
91
+ const dir = dirname(this.todoMdPath);
92
+ if (!existsSync(dir))
93
+ mkdirSync(dir, { recursive: true });
94
+ writeFileSync(this.todoMdPath, content, "utf8");
95
+ this.lastHash = sha256(content);
96
+ }
97
+ /** Check if tasks/todo.md was modified externally, and if so ingest changes */
98
+ async syncFromFile() {
99
+ if (!existsSync(this.todoMdPath))
100
+ return false;
101
+ const content = readFileSync(this.todoMdPath, "utf8");
102
+ const currentHash = sha256(content);
103
+ if (currentHash === this.lastHash)
104
+ return false; // not modified
105
+ const parsed = parseTodoMd(content);
106
+ let changed = false;
107
+ for (const item of parsed) {
108
+ if (!item.id)
109
+ continue; // can't sync without id
110
+ const existing = await this.repo.get(item.id);
111
+ if (!existing)
112
+ continue;
113
+ if (existing.status !== item.status || existing.title !== item.title) {
114
+ await this.repo.update(item.id, { title: item.title, status: item.status });
115
+ changed = true;
116
+ }
117
+ }
118
+ this.lastHash = currentHash;
119
+ return changed;
120
+ }
121
+ /** Initialize todo.md with starter content if it doesn't exist */
122
+ async initStarter() {
123
+ if (existsSync(this.todoMdPath))
124
+ return;
125
+ const dir = dirname(this.todoMdPath);
126
+ if (!existsSync(dir))
127
+ mkdirSync(dir, { recursive: true });
128
+ const starter = `# Tasks\n\n- [ ] Initiate ACE (id: todo-001)\n`;
129
+ writeFileSync(this.todoMdPath, starter, "utf8");
130
+ this.lastHash = sha256(starter);
131
+ // Seed into store
132
+ await this.repo.create({
133
+ id: "todo-001",
134
+ title: "Initiate ACE",
135
+ status: "pending",
136
+ priority: "high",
137
+ });
138
+ }
139
+ }
140
+ //# sourceMappingURL=todo-syncer.js.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * VericifyProjector
3
+ *
4
+ * Writes 5 Vericify-facing files from store state on every relevant mutation.
5
+ * These are MIRRORS only — the store is source of truth.
6
+ *
7
+ * All files live under .agents/ACE/ (the canonical ACE namespace as defined
8
+ * by ACE_ROOT_REL in helpers.ts and remapped via ACE_MANAGED_PREFIXES).
9
+ *
10
+ * Files projected:
11
+ * .agents/ACE/agent-state/handoff-registry.json
12
+ * .agents/ACE/agent-state/todo-state.json ← schema: { version, updated_at, order[], nodes{} }
13
+ * .agents/ACE/agent-state/run-ledger.json ← schema: { version, updated_at, entries[] }
14
+ * .agents/ACE/agent-state/STATUS_EVENTS.ndjson ← schema: StatusEventRecord per line
15
+ * .agents/ACE/agent-state/vericify/process-posts.json
16
+ */
17
+ import { AcePackedStore } from "../ace-packed-store.js";
18
+ export declare class VericifyProjector {
19
+ private store;
20
+ private workspaceRoot;
21
+ private handoffs;
22
+ private todos;
23
+ private ledger;
24
+ private tracker;
25
+ private vericify;
26
+ constructor(store: AcePackedStore, workspaceRoot: string);
27
+ private operationalRel;
28
+ projectAll(): Promise<void>;
29
+ projectHandoffs(): Promise<void>;
30
+ projectTodos(): Promise<void>;
31
+ projectLedger(): Promise<void>;
32
+ projectStatusEvents(): Promise<void>;
33
+ projectVericifyPosts(): Promise<void>;
34
+ private _write;
35
+ private _trackChecksum;
36
+ checkExternalModification(relPath: string, currentContent: string): Promise<boolean>;
37
+ }
38
+ //# sourceMappingURL=vericify-projector.d.ts.map