airaknit 1.1.2-rc.9
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.
- package/LICENSE +84 -0
- package/README.md +202 -0
- package/bin/airaknit +9 -0
- package/bin/airaknit-project +14 -0
- package/bin/kanna +9 -0
- package/dist/client/assets/CompactSummaryMessage-Yw0BDWEJ.js +1 -0
- package/dist/client/assets/ExitPlanModeMessage-DIdkQ4uF.js +1 -0
- package/dist/client/assets/LocalFilePreviewDialog-DQx2eiCc.js +3 -0
- package/dist/client/assets/LocalProjectsSection-C4xlWkgS.js +1 -0
- package/dist/client/assets/TextMessage-B5G39DEJ.js +1 -0
- package/dist/client/assets/UserMessage-CIkWk-0L.js +1 -0
- package/dist/client/assets/_basePickBy-CVrAFfnZ.js +1 -0
- package/dist/client/assets/_baseUniq-JL-aaF4P.js +1 -0
- package/dist/client/assets/arc-B07zg7ol.js +1 -0
- package/dist/client/assets/architecture-YZFGNWBL-PSLVJL3p.js +1 -0
- package/dist/client/assets/architectureDiagram-Q4EWVU46-DfWIF1G_.js +36 -0
- package/dist/client/assets/array-BGFCBI0e.js +1 -0
- package/dist/client/assets/blockDiagram-DXYQGD6D-CzwIeo_B.js +132 -0
- package/dist/client/assets/bundle-mjs-BDE2gWbQ.js +1 -0
- package/dist/client/assets/button-DO50qOGv.js +1 -0
- package/dist/client/assets/c4Diagram-AHTNJAMY-CR8DCQRE.js +10 -0
- package/dist/client/assets/channel-Dj-UUfaF.js +1 -0
- package/dist/client/assets/chunk-2KRD3SAO-dznP-cn8.js +1 -0
- package/dist/client/assets/chunk-336JU56O-Dqss5Vu6.js +2 -0
- package/dist/client/assets/chunk-426QAEUC-CEKis_0_.js +1 -0
- package/dist/client/assets/chunk-4BX2VUAB-BYOv0Gm1.js +1 -0
- package/dist/client/assets/chunk-4TB4RGXK-BxzubH5S.js +206 -0
- package/dist/client/assets/chunk-55IACEB6-BSlTj03a.js +1 -0
- package/dist/client/assets/chunk-5FUZZQ4R-9Au93Bi1.js +62 -0
- package/dist/client/assets/chunk-5PVQY5BW-BhksHFEZ.js +2 -0
- package/dist/client/assets/chunk-67CJDMHE-BFwhz-8t.js +1 -0
- package/dist/client/assets/chunk-7N4EOEYR-BDUPds87.js +1 -0
- package/dist/client/assets/chunk-AA7GKIK3-CEWTdyXO.js +1 -0
- package/dist/client/assets/chunk-BO2N2NFS-D0LvxnhU.js +103 -0
- package/dist/client/assets/chunk-BSJP7CBP-BNJnK6sq.js +1 -0
- package/dist/client/assets/chunk-Bj-mKKzh.js +1 -0
- package/dist/client/assets/chunk-CIAEETIT-CYhfoCeN.js +1 -0
- package/dist/client/assets/chunk-EDXVE4YY-C5ovJLc0.js +1 -0
- package/dist/client/assets/chunk-ENJZ2VHE-HOhYaeGr.js +10 -0
- package/dist/client/assets/chunk-FMBD7UC4-BLCiKcAQ.js +15 -0
- package/dist/client/assets/chunk-FOC6F5B3-B6GtY2ek.js +1 -0
- package/dist/client/assets/chunk-ICPOFSXX-DPoIZoC5.js +122 -0
- package/dist/client/assets/chunk-K5T4RW27-BsKN63rv.js +94 -0
- package/dist/client/assets/chunk-KGLVRYIC-BUGn9uuY.js +1 -0
- package/dist/client/assets/chunk-LIHQZDEY-DhaZyo03.js +1 -0
- package/dist/client/assets/chunk-ORNJ4GCN-DlpeeJyi.js +1 -0
- package/dist/client/assets/chunk-OYMX7WX6-Dc9q7aYA.js +231 -0
- package/dist/client/assets/chunk-QZHKN3VN-BEdrPoSb.js +1 -0
- package/dist/client/assets/chunk-U2HBQHQK-CIB3Bjjd.js +70 -0
- package/dist/client/assets/chunk-X2U36JSP-CtB-o8Yp.js +1 -0
- package/dist/client/assets/chunk-XPW4576I-C6iHhX_8.js +32 -0
- package/dist/client/assets/chunk-YZCP3GAM-CTmKr6ZH.js +1 -0
- package/dist/client/assets/chunk-ZZ45TVLE-BgU8A2RF.js +1 -0
- package/dist/client/assets/classDiagram-6PBFFD2Q-Bqk5e679.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-6pSaZOkC.js +1 -0
- package/dist/client/assets/client-BrKWI4CM.js +1 -0
- package/dist/client/assets/client-CGgNRU9w.js +1 -0
- package/dist/client/assets/client-DMSLRzg9.js +6 -0
- package/dist/client/assets/clone-DWcL7whJ.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-CrV5wsV_.js +1 -0
- package/dist/client/assets/cytoscape.esm--aLzKuep.js +321 -0
- package/dist/client/assets/dagre-CuRxWcrj.js +1 -0
- package/dist/client/assets/dagre-KV5264BT-BIDiVnkA.js +4 -0
- package/dist/client/assets/defaultLocale-CRZydyG6.js +1 -0
- package/dist/client/assets/diagram-5BDNPKRD-i1kjKRCB.js +10 -0
- package/dist/client/assets/diagram-G4DWMVQ6-9ZSLuhbl.js +24 -0
- package/dist/client/assets/diagram-MMDJMWI5-B4_CUjgv.js +43 -0
- package/dist/client/assets/diagram-TYMM5635-Ct5eTGS8.js +24 -0
- package/dist/client/assets/dist-CuB4kiSK.js +1 -0
- package/dist/client/assets/erDiagram-SMLLAGMA-Cy38ercc.js +85 -0
- package/dist/client/assets/flowDiagram-DWJPFMVM-CZKuYl0V.js +162 -0
- package/dist/client/assets/ganttDiagram-T4ZO3ILL-DLPjCh7a.js +292 -0
- package/dist/client/assets/gitGraph-7Q5UKJZL-DqbrtEp9.js +1 -0
- package/dist/client/assets/gitGraphDiagram-UUTBAWPF-BoRBkDhQ.js +106 -0
- package/dist/client/assets/graphlib-BcQ6qlQh.js +1 -0
- package/dist/client/assets/highlighted-body-OFNGDK62-BEpBVDTX.js +1 -0
- package/dist/client/assets/index-CetCiuqP.js +105 -0
- package/dist/client/assets/index-N29Mip7A.css +1 -0
- package/dist/client/assets/info-OMHHGYJF-D98DRBJX.js +1 -0
- package/dist/client/assets/infoDiagram-42DDH7IO-BAcdTWbt.js +2 -0
- package/dist/client/assets/init-B8gtcn7T.js +1 -0
- package/dist/client/assets/isArrayLikeObject-D8SJFmkN.js +1 -0
- package/dist/client/assets/isEmpty-BF3YX5Jk.js +1 -0
- package/dist/client/assets/ishikawaDiagram-UXIWVN3A-Ynu2VKdC.js +70 -0
- package/dist/client/assets/journeyDiagram-VCZTEJTY-BjfhQaN3.js +139 -0
- package/dist/client/assets/jsx-runtime-CyI9ICYU.js +1 -0
- package/dist/client/assets/kanban-definition-6JOO6SKY-JLXH9zUJ.js +89 -0
- package/dist/client/assets/katex-B94qP8b6.js +265 -0
- package/dist/client/assets/lib--QVjyxmL.js +29 -0
- package/dist/client/assets/lib-B6rgJiZ9.js +1 -0
- package/dist/client/assets/line-DCrYfLBn.js +1 -0
- package/dist/client/assets/linear-_4upLmeo.js +1 -0
- package/dist/client/assets/mermaid-GHXKKRXX-rwJHYUmW.js +1 -0
- package/dist/client/assets/mermaid-parser.core-KZinfW8o.js +4 -0
- package/dist/client/assets/mermaid.core-QqY9gSNe.js +11 -0
- package/dist/client/assets/mindmap-definition-QFDTVHPH-TWgHDAzp.js +96 -0
- package/dist/client/assets/ordinal-CCj7PWgZ.js +1 -0
- package/dist/client/assets/packet-4T2RLAQJ-DEvfkn3F.js +1 -0
- package/dist/client/assets/path-DZF-JdEe.js +1 -0
- package/dist/client/assets/pie-ZZUOXDRM-72e6WVjb.js +1 -0
- package/dist/client/assets/pieDiagram-DEJITSTG-Cl8PCsoj.js +30 -0
- package/dist/client/assets/preload-helper-rov5CBGT.js +1 -0
- package/dist/client/assets/pty-client-DZ27IS00.js +1 -0
- package/dist/client/assets/ptyInstancesStore-D9ag7SYd.js +1 -0
- package/dist/client/assets/quadrantDiagram-34T5L4WZ-CHyVGp9E.js +7 -0
- package/dist/client/assets/radar-PYXPWWZC-Cp7xd_EY.js +1 -0
- package/dist/client/assets/react-CClhXMB2.js +1 -0
- package/dist/client/assets/react-Dd6D81m0.js +1 -0
- package/dist/client/assets/react-dom--G6_6fQ_.js +1 -0
- package/dist/client/assets/requirementDiagram-MS252O5E-DaanG2iM.js +84 -0
- package/dist/client/assets/rough.esm-BsmKo2S5.js +1 -0
- package/dist/client/assets/sankeyDiagram-XADWPNL6-B_fhLY36.js +10 -0
- package/dist/client/assets/sequenceDiagram-FGHM5R23-C5FNrveI.js +157 -0
- package/dist/client/assets/src-DeTlMJAU.js +1 -0
- package/dist/client/assets/stateDiagram-FHFEXIEX-nTTcdjjQ.js +1 -0
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Dw0632j_.js +1 -0
- package/dist/client/assets/timeline-definition-GMOUNBTQ-DkQV1yP8.js +120 -0
- package/dist/client/assets/treeView-SZITEDCU-ZLIgC7_K.js +1 -0
- package/dist/client/assets/treemap-W4RFUUIX-BqaMbB6N.js +1 -0
- package/dist/client/assets/uiIdentityOverlay-Ba7GNj7m.js +1 -0
- package/dist/client/assets/vennDiagram-DHZGUBPP-DbZ2xgs6.js +34 -0
- package/dist/client/assets/wardley-RL74JXVD-DXQS8zf4.js +1 -0
- package/dist/client/assets/wardleyDiagram-NUSXRM2D-BzCJ6MAu.js +20 -0
- package/dist/client/assets/xychartDiagram-5P7HB3ND-BSlFecop.js +7 -0
- package/dist/client/favicon.png +0 -0
- package/dist/client/favicon.svg +15 -0
- package/dist/client/fonts/body-medium.woff2 +0 -0
- package/dist/client/fonts/body-regular-italic.woff2 +0 -0
- package/dist/client/fonts/body-regular.woff2 +0 -0
- package/dist/client/fonts/body-semibold.woff2 +0 -0
- package/dist/client/index.html +31 -0
- package/dist/client/manifest.webmanifest +12 -0
- package/dist/client/sw.js +32 -0
- package/package.json +122 -0
- package/src/nats/auth-callout/callout-config.test.ts +93 -0
- package/src/nats/auth-callout/callout-config.ts +109 -0
- package/src/nats/auth-callout/callout.integration.test.ts +332 -0
- package/src/nats/auth-callout/keys.ts +103 -0
- package/src/nats/auth-callout/responder.ts +241 -0
- package/src/nats/auth-callout/scope-policy.test.ts +159 -0
- package/src/nats/auth-callout/scope-policy.ts +210 -0
- package/src/nats/auth-callout/token.test.ts +163 -0
- package/src/nats/auth-callout/token.ts +157 -0
- package/src/nats/nats-daemon-callout.ts +194 -0
- package/src/nats/nats-daemon.test.ts +77 -0
- package/src/nats/nats-daemon.ts +50 -0
- package/src/nats/nats-token.test.ts +61 -0
- package/src/nats/nats-token.ts +59 -0
- package/src/runner/coordination-mcp-integration.test.ts +134 -0
- package/src/runner/nats-coordination-client.test.ts +49 -0
- package/src/runner/nats-coordination-client.ts +94 -0
- package/src/runner/runner-agent.test.ts +469 -0
- package/src/runner/runner-agent.ts +453 -0
- package/src/runner/runner-credential.test.ts +93 -0
- package/src/runner/runner-credential.ts +82 -0
- package/src/runner/runner-nats.test.ts +495 -0
- package/src/runner/runner-nats.ts +323 -0
- package/src/runner/runner-pair.test.ts +107 -0
- package/src/runner/runner-pair.ts +81 -0
- package/src/runner/runner.test.ts +135 -0
- package/src/runner/runner.ts +212 -0
- package/src/runner/turn-factories.test.ts +97 -0
- package/src/runner/turn-factories.ts +475 -0
- package/src/server/agent-config-journey.test.ts +106 -0
- package/src/server/agent.ts +8 -0
- package/src/server/auto-continue/auth-error-detector.ts +66 -0
- package/src/server/auto-continue/limit-detector.ts +194 -0
- package/src/server/bm25.test.ts +92 -0
- package/src/server/bm25.ts +101 -0
- package/src/server/chat-events-jetstream.test.ts +135 -0
- package/src/server/claude-harness.ts +360 -0
- package/src/server/claude-pty/agent-normalizers.ts +309 -0
- package/src/server/claude-pty/auth.test.ts +38 -0
- package/src/server/claude-pty/auth.ts +32 -0
- package/src/server/claude-pty/claude-session-registry.adapter.ts +81 -0
- package/src/server/claude-pty/claude-session-registry.test.ts +149 -0
- package/src/server/claude-pty/driver.test.ts +902 -0
- package/src/server/claude-pty/driver.ts +807 -0
- package/src/server/claude-pty/jsonl-path.adapter.ts +57 -0
- package/src/server/claude-pty/jsonl-path.test.ts +114 -0
- package/src/server/claude-pty/jsonl-to-event.test.ts +241 -0
- package/src/server/claude-pty/jsonl-to-event.ts +174 -0
- package/src/server/claude-pty/output-ring.test.ts +35 -0
- package/src/server/claude-pty/output-ring.ts +25 -0
- package/src/server/claude-pty/parity-matrix.test.ts +227 -0
- package/src/server/claude-pty/pid-registry.adapter.ts +135 -0
- package/src/server/claude-pty/pid-registry.test.ts +122 -0
- package/src/server/claude-pty/preflight/binary-fingerprint.adapter.ts +20 -0
- package/src/server/claude-pty/preflight/binary-fingerprint.test.ts +32 -0
- package/src/server/claude-pty/pty-instance-registry.test.ts +177 -0
- package/src/server/claude-pty/pty-instance-registry.ts +166 -0
- package/src/server/claude-pty/pty-memory-sampler.adapter.test.ts +103 -0
- package/src/server/claude-pty/pty-memory-sampler.adapter.ts +85 -0
- package/src/server/claude-pty/pty-process.adapter.ts +66 -0
- package/src/server/claude-pty/pty-process.test.ts +49 -0
- package/src/server/claude-pty/resolve-binary.adapter.ts +106 -0
- package/src/server/claude-pty/resolve-binary.test.ts +118 -0
- package/src/server/claude-pty/runtime-dir.adapter.ts +19 -0
- package/src/server/claude-pty/settings-writer.adapter.ts +27 -0
- package/src/server/claude-pty/settings-writer.test.ts +22 -0
- package/src/server/claude-pty/smoke-test-io.adapter.ts +28 -0
- package/src/server/claude-pty/smoke-test.test.ts +191 -0
- package/src/server/claude-pty/smoke-test.ts +185 -0
- package/src/server/claude-pty/subagent-orchestrator.ts +887 -0
- package/src/server/claude-pty/tool-callback.ts +274 -0
- package/src/server/claude-pty/tui-control.test.ts +272 -0
- package/src/server/claude-pty/tui-control.ts +182 -0
- package/src/server/claude-pty/tui-source.adapter.test.ts +360 -0
- package/src/server/claude-pty/tui-source.adapter.ts +343 -0
- package/src/server/claude-pty/tunnel-gateway.ts +12 -0
- package/src/server/claude-pty-mcp/canonical-args.ts +15 -0
- package/src/server/claude-pty-mcp/fs-stat.adapter.ts +8 -0
- package/src/server/claude-pty-mcp/history-primer.ts +90 -0
- package/src/server/claude-pty-mcp/http-server.adapter.ts +33 -0
- package/src/server/claude-pty-mcp/mcp-http.ts +177 -0
- package/src/server/claude-pty-mcp/mcp.ts +412 -0
- package/src/server/claude-pty-mcp/mention-parser.ts +25 -0
- package/src/server/claude-pty-mcp/paths.ts +24 -0
- package/src/server/claude-pty-mcp/permission-gate.ts +243 -0
- package/src/server/claude-pty-mcp/terminal-pid-registry.adapter.ts +107 -0
- package/src/server/claude-pty-mcp/tools/ask-user-question.test.ts +119 -0
- package/src/server/claude-pty-mcp/tools/ask-user-question.ts +61 -0
- package/src/server/claude-pty-mcp/tools/bash.adapter.ts +76 -0
- package/src/server/claude-pty-mcp/tools/bash.test.ts +56 -0
- package/src/server/claude-pty-mcp/tools/delegate-subagent.test.ts +155 -0
- package/src/server/claude-pty-mcp/tools/delegate-subagent.ts +111 -0
- package/src/server/claude-pty-mcp/tools/edit.adapter.ts +95 -0
- package/src/server/claude-pty-mcp/tools/edit.test.ts +93 -0
- package/src/server/claude-pty-mcp/tools/exit-plan-mode.test.ts +61 -0
- package/src/server/claude-pty-mcp/tools/exit-plan-mode.ts +50 -0
- package/src/server/claude-pty-mcp/tools/glob.adapter.ts +86 -0
- package/src/server/claude-pty-mcp/tools/glob.test.ts +61 -0
- package/src/server/claude-pty-mcp/tools/grep.adapter.ts +126 -0
- package/src/server/claude-pty-mcp/tools/grep.test.ts +62 -0
- package/src/server/claude-pty-mcp/tools/read.adapter.ts +58 -0
- package/src/server/claude-pty-mcp/tools/read.test.ts +62 -0
- package/src/server/claude-pty-mcp/tools/tool-callback-shim.ts +42 -0
- package/src/server/claude-pty-mcp/tools/webfetch.test.ts +81 -0
- package/src/server/claude-pty-mcp/tools/webfetch.ts +82 -0
- package/src/server/claude-pty-mcp/tools/websearch.test.ts +40 -0
- package/src/server/claude-pty-mcp/tools/websearch.ts +42 -0
- package/src/server/claude-pty-mcp/tools/write.adapter.ts +60 -0
- package/src/server/claude-pty-mcp/tools/write.test.ts +52 -0
- package/src/server/claude-pty-mcp/uploads.adapter.ts +98 -0
- package/src/server/claude-pty-mcp/uploads.ts +38 -0
- package/src/server/claude-turn.test.ts +176 -0
- package/src/server/cli-runtime.test.ts +456 -0
- package/src/server/cli-runtime.ts +374 -0
- package/src/server/cli-supervisor.ts +81 -0
- package/src/server/cli.ts +78 -0
- package/src/server/client-log-forwarder.test.ts +74 -0
- package/src/server/client-log-forwarder.ts +75 -0
- package/src/server/codex-app-server-protocol.ts +449 -0
- package/src/server/codex-app-server.test.ts +2990 -0
- package/src/server/codex-app-server.ts +1713 -0
- package/src/server/coordination-integration.test.ts +63 -0
- package/src/server/coordination-mcp.test.ts +149 -0
- package/src/server/coordination-mcp.ts +197 -0
- package/src/server/delegation-coordinator.test.ts +675 -0
- package/src/server/delegation-coordinator.ts +454 -0
- package/src/server/discovery.test.ts +211 -0
- package/src/server/discovery.ts +301 -0
- package/src/server/event-store-agent-config.test.ts +124 -0
- package/src/server/event-store-coordination.test.ts +149 -0
- package/src/server/event-store-profile.test.ts +132 -0
- package/src/server/event-store-repo.test.ts +154 -0
- package/src/server/event-store-runner-team.test.ts +104 -0
- package/src/server/event-store.test.ts +342 -0
- package/src/server/event-store.ts +2208 -0
- package/src/server/events.ts +379 -0
- package/src/server/extension-router.test.ts +183 -0
- package/src/server/extension-router.ts +114 -0
- package/src/server/extensions/agents/server.test.ts +191 -0
- package/src/server/extensions/agents/server.ts +108 -0
- package/src/server/extensions/c3/server.test.ts +284 -0
- package/src/server/extensions/c3/server.ts +212 -0
- package/src/server/extensions/code/server.test.ts +200 -0
- package/src/server/extensions/code/server.ts +150 -0
- package/src/server/extensions.config.ts +10 -0
- package/src/server/external-open.ts +69 -0
- package/src/server/generate-fork-context.ts +58 -0
- package/src/server/generate-merge-context.test.ts +290 -0
- package/src/server/generate-merge-context.ts +141 -0
- package/src/server/generate-title.ts +36 -0
- package/src/server/git-clone-policy.test.ts +138 -0
- package/src/server/git-clone-policy.ts +27 -0
- package/src/server/harness-types.ts +1 -0
- package/src/server/journey-verification.test.ts +640 -0
- package/src/server/journey-verification.ts +195 -0
- package/src/server/machine-name.ts +22 -0
- package/src/server/nats-auth.test.ts +92 -0
- package/src/server/nats-auth.ts +6 -0
- package/src/server/nats-bind-guard.test.ts +71 -0
- package/src/server/nats-bind-guard.ts +42 -0
- package/src/server/nats-bridge.test.ts +141 -0
- package/src/server/nats-bridge.ts +111 -0
- package/src/server/nats-connector.test.ts +56 -0
- package/src/server/nats-connector.ts +71 -0
- package/src/server/nats-daemon-manager.test.ts +76 -0
- package/src/server/nats-daemon-manager.ts +174 -0
- package/src/server/nats-publisher.test.ts +356 -0
- package/src/server/nats-publisher.ts +271 -0
- package/src/server/nats-responders.test.ts +1018 -0
- package/src/server/nats-responders.ts +925 -0
- package/src/server/nats-streams.test.ts +112 -0
- package/src/server/nats-streams.ts +129 -0
- package/src/server/oauth-pool/oauth-responders.ts +185 -0
- package/src/server/oauth-pool/oauth-settings-store.ts +173 -0
- package/src/server/oauth-pool/oauth-token-pool.ts +303 -0
- package/src/server/orchestration.test.ts +1063 -0
- package/src/server/orchestration.ts +716 -0
- package/src/server/pairing-endpoints.test.ts +171 -0
- package/src/server/pairing-store.test.ts +154 -0
- package/src/server/pairing-store.ts +124 -0
- package/src/server/paths.ts +27 -0
- package/src/server/pr3-liveness.test.ts +252 -0
- package/src/server/process-utils.ts +10 -0
- package/src/server/project-cli.ts +180 -0
- package/src/server/provider-catalog.test.ts +177 -0
- package/src/server/provider-catalog.ts +146 -0
- package/src/server/pty-responders.ts +345 -0
- package/src/server/push-notifications.test.ts +234 -0
- package/src/server/push-notifications.ts +188 -0
- package/src/server/quick-response.test.ts +196 -0
- package/src/server/quick-response.ts +154 -0
- package/src/server/read-models-agent-config.test.ts +59 -0
- package/src/server/read-models-coordination.test.ts +69 -0
- package/src/server/read-models.test.ts +332 -0
- package/src/server/read-models.ts +258 -0
- package/src/server/repo-journey.test.ts +96 -0
- package/src/server/repo-manager.test.ts +118 -0
- package/src/server/repo-manager.ts +97 -0
- package/src/server/repo-status.test.ts +54 -0
- package/src/server/repo-status.ts +82 -0
- package/src/server/restart.test.ts +27 -0
- package/src/server/restart.ts +30 -0
- package/src/server/runner-incompatible-gate.test.ts +383 -0
- package/src/server/runner-manager.test.ts +72 -0
- package/src/server/runner-manager.ts +312 -0
- package/src/server/runner-pairing-urls.test.ts +59 -0
- package/src/server/runner-pairing-urls.ts +67 -0
- package/src/server/runner-proxy.test.ts +456 -0
- package/src/server/runner-proxy.ts +494 -0
- package/src/server/runner-router.test.ts +429 -0
- package/src/server/runner-router.ts +212 -0
- package/src/server/runner-routing.test.ts +584 -0
- package/src/server/runtime-registry.test.ts +436 -0
- package/src/server/runtime-registry.ts +307 -0
- package/src/server/sandbox-health.test.ts +127 -0
- package/src/server/sandbox-health.ts +94 -0
- package/src/server/sandbox-journey.test.ts +232 -0
- package/src/server/sandbox-manager.test.ts +146 -0
- package/src/server/sandbox-manager.ts +159 -0
- package/src/server/server.test.ts +287 -0
- package/src/server/server.ts +1108 -0
- package/src/server/session-discovery.test.ts +129 -0
- package/src/server/session-discovery.ts +475 -0
- package/src/server/session-index.test.ts +362 -0
- package/src/server/session-index.ts +119 -0
- package/src/server/session-seed.ts +288 -0
- package/src/server/share.test.ts +108 -0
- package/src/server/share.ts +113 -0
- package/src/server/skill-discovery.test.ts +201 -0
- package/src/server/skill-discovery.ts +77 -0
- package/src/server/storage/test-helpers.ts +67 -0
- package/src/server/terminal-manager.test.ts +309 -0
- package/src/server/terminal-manager.ts +354 -0
- package/src/server/transcript-consumer.test.ts +339 -0
- package/src/server/transcript-consumer.ts +162 -0
- package/src/server/transcript-search.test.ts +193 -0
- package/src/server/transcript-search.ts +83 -0
- package/src/server/transcript-utils.ts +52 -0
- package/src/server/update-manager.test.ts +107 -0
- package/src/server/update-manager.ts +230 -0
- package/src/server/workflow-engine.test.ts +251 -0
- package/src/server/workflow-engine.ts +169 -0
- package/src/server/workflow-mcp.ts +49 -0
- package/src/server/workflow-store.test.ts +155 -0
- package/src/server/workflow-store.ts +139 -0
- package/src/server/workspace-agent-integration.test.ts +167 -0
- package/src/server/workspace-agent-routes.test.ts +127 -0
- package/src/server/workspace-agent-routes.ts +89 -0
- package/src/server/workspace-agent.test.ts +103 -0
- package/src/server/workspace-agent.ts +102 -0
- package/src/server/workspace-cli.test.ts +79 -0
- package/src/server/workspace-config-manager.test.ts +109 -0
- package/src/server/workspace-config-manager.ts +83 -0
- package/src/server/workspace-directory-policy.test.ts +109 -0
- package/src/server/workspace-directory-policy.ts +56 -0
- package/src/shared/agent-config-types.ts +25 -0
- package/src/shared/branding.test.ts +42 -0
- package/src/shared/branding.ts +54 -0
- package/src/shared/compression.test.ts +85 -0
- package/src/shared/compression.ts +42 -0
- package/src/shared/coordination-store.test.ts +24 -0
- package/src/shared/coordination-store.ts +26 -0
- package/src/shared/dev-ports.test.ts +84 -0
- package/src/shared/dev-ports.ts +100 -0
- package/src/shared/extension-types.ts +45 -0
- package/src/shared/fork-presets.ts +54 -0
- package/src/shared/harness-types.test.ts +15 -0
- package/src/shared/harness-types.ts +21 -0
- package/src/shared/log-sink.test.ts +112 -0
- package/src/shared/log-sink.ts +185 -0
- package/src/shared/mention-pattern.ts +7 -0
- package/src/shared/merge-presets.ts +41 -0
- package/src/shared/nats-subjects.test.ts +61 -0
- package/src/shared/nats-subjects.ts +131 -0
- package/src/shared/permission-policy.ts +136 -0
- package/src/shared/ports.ts +3 -0
- package/src/shared/preset-types.ts +15 -0
- package/src/shared/profile-types.ts +49 -0
- package/src/shared/projectFileUrl.ts +36 -0
- package/src/shared/protocol.ts +153 -0
- package/src/shared/pty-instance.ts +43 -0
- package/src/shared/puggy/diagnostics/result.ts +18 -0
- package/src/shared/puggy/expressions/evaluate.ts +292 -0
- package/src/shared/puggy/index.test.ts +101 -0
- package/src/shared/puggy/index.ts +69 -0
- package/src/shared/puggy/parser/ast.ts +110 -0
- package/src/shared/puggy/parser/parser.ts +624 -0
- package/src/shared/puggy/renderer/html.ts +447 -0
- package/src/shared/runner-protocol.test.ts +277 -0
- package/src/shared/runner-protocol.ts +210 -0
- package/src/shared/runner-team-types.ts +73 -0
- package/src/shared/runtime-types.ts +48 -0
- package/src/shared/sandbox-types.ts +53 -0
- package/src/shared/tailwind-build.test.ts +12 -0
- package/src/shared/tinkaria-system-prompt.ts +101 -0
- package/src/shared/tools.test.ts +335 -0
- package/src/shared/tools.ts +397 -0
- package/src/shared/transcript-entries.ts +27 -0
- package/src/shared/transcript-render.test.ts +225 -0
- package/src/shared/transcript-render.ts +467 -0
- package/src/shared/types.ts +1031 -0
- package/src/shared/vite-config.test.ts +47 -0
- package/src/shared/web-context.test.ts +110 -0
- package/src/shared/web-context.ts +76 -0
- package/src/shared/workflow-types.ts +51 -0
- package/src/shared/workspace-types.ts +100 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { describe, test, expect, afterEach } from "bun:test"
|
|
2
|
+
import { EventStore } from "./event-store"
|
|
3
|
+
import { deriveWorkspaceCoordinationSnapshot } from "./read-models"
|
|
4
|
+
import { rmSync, mkdirSync } from "node:fs"
|
|
5
|
+
import { join } from "node:path"
|
|
6
|
+
|
|
7
|
+
const TEST_DIR = join(import.meta.dir, ".test-coordination-integration")
|
|
8
|
+
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
rmSync(TEST_DIR, { recursive: true, force: true })
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
describe("coordination integration", () => {
|
|
14
|
+
test("full lifecycle: add todo → claim → complete → read model → compact → replay", async () => {
|
|
15
|
+
mkdirSync(TEST_DIR, { recursive: true })
|
|
16
|
+
const store = new EventStore(TEST_DIR)
|
|
17
|
+
await store.initialize()
|
|
18
|
+
const project = await store.openProject("/tmp/test-coord-integration", "Test")
|
|
19
|
+
const workspaceId = project.id
|
|
20
|
+
|
|
21
|
+
await store.addTodo(workspaceId, "t-1", "Build feature", "high", "session-a")
|
|
22
|
+
await store.claimTodo(workspaceId, "t-1", "session-b")
|
|
23
|
+
await store.completeTodo(workspaceId, "t-1", ["feature.ts"])
|
|
24
|
+
await store.createClaim(workspaceId, "c-1", "Refactor", ["src/a.ts"], "session-a")
|
|
25
|
+
await store.setRule(workspaceId, "r-1", "No any types", "user")
|
|
26
|
+
|
|
27
|
+
const snapshot = deriveWorkspaceCoordinationSnapshot(store.state, workspaceId)
|
|
28
|
+
expect(snapshot.todos).toHaveLength(1)
|
|
29
|
+
expect(snapshot.todos[0].status).toBe("complete")
|
|
30
|
+
expect(snapshot.claims).toHaveLength(1)
|
|
31
|
+
expect(snapshot.rules).toHaveLength(1)
|
|
32
|
+
|
|
33
|
+
await store.compact()
|
|
34
|
+
|
|
35
|
+
const store2 = new EventStore(TEST_DIR)
|
|
36
|
+
await store2.initialize()
|
|
37
|
+
const snapshot2 = deriveWorkspaceCoordinationSnapshot(store2.state, workspaceId)
|
|
38
|
+
expect(snapshot2.todos).toHaveLength(1)
|
|
39
|
+
expect(snapshot2.todos[0].description).toBe("Build feature")
|
|
40
|
+
expect(snapshot2.todos[0].status).toBe("complete")
|
|
41
|
+
expect(snapshot2.claims).toHaveLength(1)
|
|
42
|
+
expect(snapshot2.claims[0].intent).toBe("Refactor")
|
|
43
|
+
expect(snapshot2.rules).toHaveLength(1)
|
|
44
|
+
expect(snapshot2.rules[0].content).toBe("No any types")
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test("claim conflict detection end-to-end", async () => {
|
|
48
|
+
mkdirSync(TEST_DIR, { recursive: true })
|
|
49
|
+
const store = new EventStore(TEST_DIR)
|
|
50
|
+
await store.initialize()
|
|
51
|
+
const project = await store.openProject("/tmp/test-coord-conflict", "Test")
|
|
52
|
+
const workspaceId = project.id
|
|
53
|
+
|
|
54
|
+
await store.createClaim(workspaceId, "c-1", "Auth refactor", ["src/auth.ts", "src/middleware.ts"], "s-1")
|
|
55
|
+
await store.createClaim(workspaceId, "c-2", "Fix middleware", ["src/middleware.ts"], "s-2")
|
|
56
|
+
|
|
57
|
+
const snapshot = deriveWorkspaceCoordinationSnapshot(store.state, workspaceId)
|
|
58
|
+
const conflictClaim = snapshot.claims.find((c) => c.id === "c-2")
|
|
59
|
+
expect(conflictClaim).toBeDefined()
|
|
60
|
+
expect(conflictClaim!.status).toBe("conflict")
|
|
61
|
+
expect(conflictClaim!.conflictsWith).toBe("c-1")
|
|
62
|
+
})
|
|
63
|
+
})
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { describe, test, expect, afterEach } from "bun:test"
|
|
2
|
+
import { createCoordinationMcpServer } from "./coordination-mcp"
|
|
3
|
+
import { EventStore } from "./event-store"
|
|
4
|
+
import { rmSync, mkdirSync } from "node:fs"
|
|
5
|
+
import { join } from "node:path"
|
|
6
|
+
|
|
7
|
+
const TEST_DIR = join(import.meta.dir, ".test-coordination-mcp")
|
|
8
|
+
|
|
9
|
+
function createTestStore() {
|
|
10
|
+
mkdirSync(TEST_DIR, { recursive: true })
|
|
11
|
+
return new EventStore(TEST_DIR)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
rmSync(TEST_DIR, { recursive: true, force: true })
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
async function createStoreWithProject() {
|
|
19
|
+
const store = createTestStore()
|
|
20
|
+
await store.initialize()
|
|
21
|
+
const project = await store.openProject("/tmp/coord-mcp-test")
|
|
22
|
+
return { store, workspaceId: project.id }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type ToolRegistry = Record<string, { handler: (args: Record<string, unknown>) => Promise<unknown> }>
|
|
26
|
+
|
|
27
|
+
function getTools(store: EventStore) {
|
|
28
|
+
const server = createCoordinationMcpServer(store)
|
|
29
|
+
return (server.instance as unknown as { _registeredTools: ToolRegistry })._registeredTools
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe("createCoordinationMcpServer", () => {
|
|
33
|
+
test("registers all 12 coordination tools", async () => {
|
|
34
|
+
const store = createTestStore()
|
|
35
|
+
await store.initialize()
|
|
36
|
+
|
|
37
|
+
const server = createCoordinationMcpServer(store)
|
|
38
|
+
const tools = Object.keys(
|
|
39
|
+
(server.instance as unknown as { _registeredTools: Record<string, unknown> })._registeredTools
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
expect(tools).toEqual([
|
|
43
|
+
"workspace_todo_add",
|
|
44
|
+
"workspace_todo_claim",
|
|
45
|
+
"workspace_todo_complete",
|
|
46
|
+
"workspace_todo_abandon",
|
|
47
|
+
"workspace_claim_create",
|
|
48
|
+
"workspace_claim_release",
|
|
49
|
+
"workspace_worktree_create",
|
|
50
|
+
"workspace_worktree_assign",
|
|
51
|
+
"workspace_worktree_remove",
|
|
52
|
+
"workspace_rule_set",
|
|
53
|
+
"workspace_rule_remove",
|
|
54
|
+
"workspace_snapshot_get",
|
|
55
|
+
])
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
describe("coordination MCP tool handlers", () => {
|
|
60
|
+
test("workspace_todo_add creates a todo and returns it", async () => {
|
|
61
|
+
const { store, workspaceId } = await createStoreWithProject()
|
|
62
|
+
const tools = getTools(store)
|
|
63
|
+
|
|
64
|
+
const result = await tools.workspace_todo_add.handler({
|
|
65
|
+
workspaceId,
|
|
66
|
+
description: "Fix the login bug",
|
|
67
|
+
priority: "high",
|
|
68
|
+
createdBy: "session-a",
|
|
69
|
+
}) as { content: Array<{ text: string }> }
|
|
70
|
+
|
|
71
|
+
const todo = JSON.parse(result.content[0].text)
|
|
72
|
+
expect(todo.description).toBe("Fix the login bug")
|
|
73
|
+
expect(todo.priority).toBe("high")
|
|
74
|
+
expect(todo.status).toBe("open")
|
|
75
|
+
expect(todo.createdBy).toBe("session-a")
|
|
76
|
+
expect(todo.id).toBeDefined()
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
test("workspace_claim_create detects conflicts on overlapping files", async () => {
|
|
80
|
+
const { store, workspaceId } = await createStoreWithProject()
|
|
81
|
+
const tools = getTools(store)
|
|
82
|
+
|
|
83
|
+
// First claim — no conflict
|
|
84
|
+
await tools.workspace_claim_create.handler({
|
|
85
|
+
workspaceId,
|
|
86
|
+
intent: "Refactor auth",
|
|
87
|
+
files: ["src/auth.ts", "src/login.ts"],
|
|
88
|
+
sessionId: "s-1",
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
// Overlapping claim — should detect conflict
|
|
92
|
+
const conflictResult = await tools.workspace_claim_create.handler({
|
|
93
|
+
workspaceId,
|
|
94
|
+
intent: "Fix login",
|
|
95
|
+
files: ["src/login.ts"],
|
|
96
|
+
sessionId: "s-2",
|
|
97
|
+
}) as { content: Array<{ text: string }> }
|
|
98
|
+
|
|
99
|
+
const claim = JSON.parse(conflictResult.content[0].text)
|
|
100
|
+
expect(claim.status).toBe("conflict")
|
|
101
|
+
expect(claim.conflictsWith).toBeDefined()
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
test("workspace_snapshot_get returns full coordination state", async () => {
|
|
105
|
+
const { store, workspaceId } = await createStoreWithProject()
|
|
106
|
+
const tools = getTools(store)
|
|
107
|
+
|
|
108
|
+
await tools.workspace_todo_add.handler({ workspaceId, description: "Task A" })
|
|
109
|
+
await tools.workspace_rule_set.handler({ workspaceId, content: "Use strict TypeScript" })
|
|
110
|
+
|
|
111
|
+
const result = await tools.workspace_snapshot_get.handler({ workspaceId }) as { content: Array<{ text: string }> }
|
|
112
|
+
|
|
113
|
+
const snapshot = JSON.parse(result.content[0].text)
|
|
114
|
+
expect(snapshot.workspaceId).toBe(workspaceId)
|
|
115
|
+
expect(snapshot.todos).toHaveLength(1)
|
|
116
|
+
expect(snapshot.rules).toHaveLength(1)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
test("todo lifecycle: add → claim → complete", async () => {
|
|
120
|
+
const { store, workspaceId } = await createStoreWithProject()
|
|
121
|
+
const tools = getTools(store)
|
|
122
|
+
|
|
123
|
+
// Add
|
|
124
|
+
const addResult = await tools.workspace_todo_add.handler({
|
|
125
|
+
workspaceId,
|
|
126
|
+
description: "Build feature X",
|
|
127
|
+
createdBy: "s-1",
|
|
128
|
+
}) as { content: Array<{ text: string }> }
|
|
129
|
+
const todoId = JSON.parse(addResult.content[0].text).id
|
|
130
|
+
|
|
131
|
+
// Claim
|
|
132
|
+
const claimResult = await tools.workspace_todo_claim.handler({
|
|
133
|
+
workspaceId,
|
|
134
|
+
todoId,
|
|
135
|
+
sessionId: "s-2",
|
|
136
|
+
}) as { content: Array<{ text: string }> }
|
|
137
|
+
expect(JSON.parse(claimResult.content[0].text).status).toBe("claimed")
|
|
138
|
+
expect(JSON.parse(claimResult.content[0].text).claimedBy).toBe("s-2")
|
|
139
|
+
|
|
140
|
+
// Complete
|
|
141
|
+
const completeResult = await tools.workspace_todo_complete.handler({
|
|
142
|
+
workspaceId,
|
|
143
|
+
todoId,
|
|
144
|
+
outputs: ["feature-x.ts"],
|
|
145
|
+
}) as { content: Array<{ text: string }> }
|
|
146
|
+
expect(JSON.parse(completeResult.content[0].text).status).toBe("complete")
|
|
147
|
+
expect(JSON.parse(completeResult.content[0].text).outputs).toEqual(["feature-x.ts"])
|
|
148
|
+
})
|
|
149
|
+
})
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { createSdkMcpServer, tool } from "@anthropic-ai/claude-agent-sdk"
|
|
2
|
+
import { z } from "zod/v4"
|
|
3
|
+
import { randomUUID } from "node:crypto"
|
|
4
|
+
import type { CoordinationStore } from "../shared/coordination-store"
|
|
5
|
+
import type { WorkspaceCoordinationSnapshot } from "../shared/workspace-types"
|
|
6
|
+
import { deriveCoordinationSnapshot } from "./read-models"
|
|
7
|
+
|
|
8
|
+
function json(data: unknown) {
|
|
9
|
+
return { content: [{ type: "text" as const, text: JSON.stringify(data) }] }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Fetch the full snapshot, using remote getSnapshot when state is not in-process. */
|
|
13
|
+
async function getProjectSnapshot(store: CoordinationStore, workspaceId: string): Promise<WorkspaceCoordinationSnapshot> {
|
|
14
|
+
if (store.getSnapshot) {
|
|
15
|
+
return store.getSnapshot(workspaceId)
|
|
16
|
+
}
|
|
17
|
+
return deriveCoordinationSnapshot(store.state, workspaceId)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Read back an entity after mutation — tries in-process state first, falls back to snapshot. */
|
|
21
|
+
async function readBackEntity(
|
|
22
|
+
store: CoordinationStore,
|
|
23
|
+
workspaceId: string,
|
|
24
|
+
collection: "todos" | "claims" | "worktrees" | "rules",
|
|
25
|
+
entityId: string,
|
|
26
|
+
): Promise<unknown> {
|
|
27
|
+
const coord = store.state.coordinationByWorkspace.get(workspaceId)
|
|
28
|
+
if (coord) return coord[collection].get(entityId) ?? { id: entityId }
|
|
29
|
+
const snapshot = await getProjectSnapshot(store, workspaceId)
|
|
30
|
+
const list = snapshot[collection] as Array<{ id: string }>
|
|
31
|
+
return list.find((e) => e.id === entityId) ?? { id: entityId }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function createCoordinationMcpServer(store: CoordinationStore) {
|
|
35
|
+
return createSdkMcpServer({
|
|
36
|
+
name: "project-coordination",
|
|
37
|
+
tools: [
|
|
38
|
+
tool(
|
|
39
|
+
"workspace_todo_add",
|
|
40
|
+
"Add a shared todo to a project's coordination board. Returns the created todo.",
|
|
41
|
+
{
|
|
42
|
+
workspaceId: z.string().describe("The project ID"),
|
|
43
|
+
description: z.string().describe("What needs to be done"),
|
|
44
|
+
priority: z.enum(["high", "normal", "low"]).optional().describe("Priority level (default: normal)"),
|
|
45
|
+
createdBy: z.string().optional().describe("Session or user creating the todo"),
|
|
46
|
+
},
|
|
47
|
+
async (args) => {
|
|
48
|
+
const todoId = randomUUID()
|
|
49
|
+
await store.addTodo(args.workspaceId, todoId, args.description, args.priority ?? "normal", args.createdBy ?? "unknown")
|
|
50
|
+
return json(await readBackEntity(store, args.workspaceId, "todos", todoId))
|
|
51
|
+
},
|
|
52
|
+
),
|
|
53
|
+
tool(
|
|
54
|
+
"workspace_todo_claim",
|
|
55
|
+
"Claim a todo for a session. Sets status to 'claimed'.",
|
|
56
|
+
{
|
|
57
|
+
workspaceId: z.string().describe("The project ID"),
|
|
58
|
+
todoId: z.string().describe("The todo to claim"),
|
|
59
|
+
sessionId: z.string().describe("The session claiming the todo"),
|
|
60
|
+
},
|
|
61
|
+
async (args) => {
|
|
62
|
+
await store.claimTodo(args.workspaceId, args.todoId, args.sessionId)
|
|
63
|
+
return json(await readBackEntity(store, args.workspaceId, "todos", args.todoId))
|
|
64
|
+
},
|
|
65
|
+
),
|
|
66
|
+
tool(
|
|
67
|
+
"workspace_todo_complete",
|
|
68
|
+
"Mark a todo as complete with optional output artifacts.",
|
|
69
|
+
{
|
|
70
|
+
workspaceId: z.string().describe("The project ID"),
|
|
71
|
+
todoId: z.string().describe("The todo to complete"),
|
|
72
|
+
outputs: z.array(z.string()).optional().describe("Output file paths or artifact references"),
|
|
73
|
+
},
|
|
74
|
+
async (args) => {
|
|
75
|
+
await store.completeTodo(args.workspaceId, args.todoId, args.outputs ?? [])
|
|
76
|
+
return json(await readBackEntity(store, args.workspaceId, "todos", args.todoId))
|
|
77
|
+
},
|
|
78
|
+
),
|
|
79
|
+
tool(
|
|
80
|
+
"workspace_todo_abandon",
|
|
81
|
+
"Abandon a todo. Sets status to 'abandoned'.",
|
|
82
|
+
{
|
|
83
|
+
workspaceId: z.string().describe("The project ID"),
|
|
84
|
+
todoId: z.string().describe("The todo to abandon"),
|
|
85
|
+
},
|
|
86
|
+
async (args) => {
|
|
87
|
+
await store.abandonTodo(args.workspaceId, args.todoId)
|
|
88
|
+
return json(await readBackEntity(store, args.workspaceId, "todos", args.todoId))
|
|
89
|
+
},
|
|
90
|
+
),
|
|
91
|
+
tool(
|
|
92
|
+
"workspace_claim_create",
|
|
93
|
+
"Declare intent to work on files. If files overlap with an existing active claim, the claim is created with 'conflict' status.",
|
|
94
|
+
{
|
|
95
|
+
workspaceId: z.string().describe("The project ID"),
|
|
96
|
+
intent: z.string().describe("What you intend to do with these files"),
|
|
97
|
+
files: z.array(z.string()).describe("File paths being claimed"),
|
|
98
|
+
sessionId: z.string().describe("The session creating the claim"),
|
|
99
|
+
},
|
|
100
|
+
async (args) => {
|
|
101
|
+
const claimId = randomUUID()
|
|
102
|
+
await store.createClaim(args.workspaceId, claimId, args.intent, args.files, args.sessionId)
|
|
103
|
+
return json(await readBackEntity(store, args.workspaceId, "claims", claimId))
|
|
104
|
+
},
|
|
105
|
+
),
|
|
106
|
+
tool(
|
|
107
|
+
"workspace_claim_release",
|
|
108
|
+
"Release a file claim when done working on those files.",
|
|
109
|
+
{
|
|
110
|
+
workspaceId: z.string().describe("The project ID"),
|
|
111
|
+
claimId: z.string().describe("The claim to release"),
|
|
112
|
+
},
|
|
113
|
+
async (args) => {
|
|
114
|
+
await store.releaseClaim(args.workspaceId, args.claimId)
|
|
115
|
+
return json(await readBackEntity(store, args.workspaceId, "claims", args.claimId))
|
|
116
|
+
},
|
|
117
|
+
),
|
|
118
|
+
tool(
|
|
119
|
+
"workspace_worktree_create",
|
|
120
|
+
"Create a git worktree for isolated work on a branch.",
|
|
121
|
+
{
|
|
122
|
+
workspaceId: z.string().describe("The project ID"),
|
|
123
|
+
branch: z.string().describe("Branch name for the worktree"),
|
|
124
|
+
baseBranch: z.string().optional().describe("Base branch to create from (default: main)"),
|
|
125
|
+
},
|
|
126
|
+
async (args) => {
|
|
127
|
+
const worktreeId = randomUUID()
|
|
128
|
+
await store.createWorktree(args.workspaceId, worktreeId, args.branch, args.baseBranch ?? "main", "")
|
|
129
|
+
return json(await readBackEntity(store, args.workspaceId, "worktrees", worktreeId))
|
|
130
|
+
},
|
|
131
|
+
),
|
|
132
|
+
tool(
|
|
133
|
+
"workspace_worktree_assign",
|
|
134
|
+
"Assign a worktree to a session.",
|
|
135
|
+
{
|
|
136
|
+
workspaceId: z.string().describe("The project ID"),
|
|
137
|
+
worktreeId: z.string().describe("The worktree to assign"),
|
|
138
|
+
sessionId: z.string().describe("The session to assign to"),
|
|
139
|
+
},
|
|
140
|
+
async (args) => {
|
|
141
|
+
await store.assignWorktree(args.workspaceId, args.worktreeId, args.sessionId)
|
|
142
|
+
return json(await readBackEntity(store, args.workspaceId, "worktrees", args.worktreeId))
|
|
143
|
+
},
|
|
144
|
+
),
|
|
145
|
+
tool(
|
|
146
|
+
"workspace_worktree_remove",
|
|
147
|
+
"Remove a worktree.",
|
|
148
|
+
{
|
|
149
|
+
workspaceId: z.string().describe("The project ID"),
|
|
150
|
+
worktreeId: z.string().describe("The worktree to remove"),
|
|
151
|
+
},
|
|
152
|
+
async (args) => {
|
|
153
|
+
await store.removeWorktree(args.workspaceId, args.worktreeId)
|
|
154
|
+
return json({ ok: true, worktreeId: args.worktreeId })
|
|
155
|
+
},
|
|
156
|
+
),
|
|
157
|
+
tool(
|
|
158
|
+
"workspace_rule_set",
|
|
159
|
+
"Set a project rule or instruction that applies to all sessions.",
|
|
160
|
+
{
|
|
161
|
+
workspaceId: z.string().describe("The project ID"),
|
|
162
|
+
ruleId: z.string().optional().describe("Rule ID (auto-generated if omitted)"),
|
|
163
|
+
content: z.string().describe("The rule content"),
|
|
164
|
+
setBy: z.string().optional().describe("Who set this rule"),
|
|
165
|
+
},
|
|
166
|
+
async (args) => {
|
|
167
|
+
const ruleId = args.ruleId ?? randomUUID()
|
|
168
|
+
await store.setRule(args.workspaceId, ruleId, args.content, args.setBy ?? "unknown")
|
|
169
|
+
return json(await readBackEntity(store, args.workspaceId, "rules", ruleId))
|
|
170
|
+
},
|
|
171
|
+
),
|
|
172
|
+
tool(
|
|
173
|
+
"workspace_rule_remove",
|
|
174
|
+
"Remove a project rule.",
|
|
175
|
+
{
|
|
176
|
+
workspaceId: z.string().describe("The project ID"),
|
|
177
|
+
ruleId: z.string().describe("The rule to remove"),
|
|
178
|
+
},
|
|
179
|
+
async (args) => {
|
|
180
|
+
await store.removeRule(args.workspaceId, args.ruleId)
|
|
181
|
+
return json({ ok: true, ruleId: args.ruleId })
|
|
182
|
+
},
|
|
183
|
+
),
|
|
184
|
+
tool(
|
|
185
|
+
"workspace_snapshot_get",
|
|
186
|
+
"Get the current coordination snapshot for a project — all active todos, claims, worktrees, and rules.",
|
|
187
|
+
{
|
|
188
|
+
workspaceId: z.string().describe("The project ID"),
|
|
189
|
+
},
|
|
190
|
+
async (args) => {
|
|
191
|
+
const snapshot = await getProjectSnapshot(store, args.workspaceId)
|
|
192
|
+
return json(snapshot)
|
|
193
|
+
},
|
|
194
|
+
),
|
|
195
|
+
],
|
|
196
|
+
})
|
|
197
|
+
}
|