@flyingrobots/graft 0.6.1 → 0.7.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.
- package/CHANGELOG.md +135 -0
- package/README.md +1 -1
- package/dist/adapters/json-text-decoder.d.ts +3 -0
- package/dist/adapters/json-text-decoder.d.ts.map +1 -0
- package/dist/adapters/json-text-decoder.js +12 -0
- package/dist/adapters/json-text-decoder.js.map +1 -0
- package/dist/adapters/node-paths.d.ts +3 -0
- package/dist/adapters/node-paths.d.ts.map +1 -0
- package/dist/adapters/node-paths.js +29 -0
- package/dist/adapters/node-paths.js.map +1 -0
- package/dist/adapters/repo-paths.d.ts.map +1 -1
- package/dist/adapters/repo-paths.js +40 -5
- package/dist/adapters/repo-paths.js.map +1 -1
- package/dist/api/tool-bridge.d.ts +1 -1
- package/dist/api/tool-bridge.d.ts.map +1 -1
- package/dist/api/tool-bridge.js +1 -1
- package/dist/api/tool-bridge.js.map +1 -1
- package/dist/cli/cli-error.d.ts.map +1 -1
- package/dist/cli/cli-error.js +47 -10
- package/dist/cli/cli-error.js.map +1 -1
- package/dist/cli/command-parser.d.ts +12 -3
- package/dist/cli/command-parser.d.ts.map +1 -1
- package/dist/cli/command-parser.js +161 -2
- package/dist/cli/command-parser.js.map +1 -1
- package/dist/cli/daemon-status-model.d.ts +87 -0
- package/dist/cli/daemon-status-model.d.ts.map +1 -0
- package/dist/cli/daemon-status-model.js +142 -0
- package/dist/cli/daemon-status-model.js.map +1 -0
- package/dist/cli/daemon-status-render.d.ts +3 -0
- package/dist/cli/daemon-status-render.d.ts.map +1 -0
- package/dist/cli/daemon-status-render.js +100 -0
- package/dist/cli/daemon-status-render.js.map +1 -0
- package/dist/cli/daemon-status.d.ts +7 -0
- package/dist/cli/daemon-status.d.ts.map +1 -0
- package/dist/cli/daemon-status.js +79 -0
- package/dist/cli/daemon-status.js.map +1 -0
- package/dist/cli/git-graft-enhance-model.d.ts +67 -0
- package/dist/cli/git-graft-enhance-model.d.ts.map +1 -0
- package/dist/cli/git-graft-enhance-model.js +55 -0
- package/dist/cli/git-graft-enhance-model.js.map +1 -0
- package/dist/cli/git-graft-enhance-render.d.ts +3 -0
- package/dist/cli/git-graft-enhance-render.d.ts.map +1 -0
- package/dist/cli/git-graft-enhance-render.js +29 -0
- package/dist/cli/git-graft-enhance-render.js.map +1 -0
- package/dist/cli/git-graft-enhance.d.ts +14 -0
- package/dist/cli/git-graft-enhance.d.ts.map +1 -0
- package/dist/cli/git-graft-enhance.js +29 -0
- package/dist/cli/git-graft-enhance.js.map +1 -0
- package/dist/cli/index-cmd.d.ts.map +1 -1
- package/dist/cli/index-cmd.js +18 -21
- package/dist/cli/index-cmd.js.map +1 -1
- package/dist/cli/index-model.d.ts +5 -9
- package/dist/cli/index-model.d.ts.map +1 -1
- package/dist/cli/index-model.js +20 -18
- package/dist/cli/index-model.js.map +1 -1
- package/dist/cli/init-client-config.d.ts +12 -7
- package/dist/cli/init-client-config.d.ts.map +1 -1
- package/dist/cli/init-client-config.js +105 -43
- package/dist/cli/init-client-config.js.map +1 -1
- package/dist/cli/init-model.d.ts +9 -2
- package/dist/cli/init-model.d.ts.map +1 -1
- package/dist/cli/init-model.js +52 -4
- package/dist/cli/init-model.js.map +1 -1
- package/dist/cli/init-render.d.ts.map +1 -1
- package/dist/cli/init-render.js +2 -2
- package/dist/cli/init-render.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +11 -9
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/json-document.d.ts +5 -0
- package/dist/cli/json-document.d.ts.map +1 -1
- package/dist/cli/json-document.js +9 -0
- package/dist/cli/json-document.js.map +1 -1
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +49 -7
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migrate-local-history.d.ts.map +1 -1
- package/dist/cli/migrate-local-history.js +3 -2
- package/dist/cli/migrate-local-history.js.map +1 -1
- package/dist/cli/peer-command.d.ts +1 -1
- package/dist/cli/peer-command.d.ts.map +1 -1
- package/dist/cli/peer-command.js +1 -1
- package/dist/cli/peer-command.js.map +1 -1
- package/dist/contracts/capabilities.d.ts +5 -5
- package/dist/contracts/capabilities.d.ts.map +1 -1
- package/dist/contracts/capabilities.js +89 -0
- package/dist/contracts/capabilities.js.map +1 -1
- package/dist/contracts/causal-ontology.d.ts +17 -17
- package/dist/contracts/json-object.d.ts +0 -1
- package/dist/contracts/json-object.d.ts.map +1 -1
- package/dist/contracts/json-object.js +0 -10
- package/dist/contracts/json-object.js.map +1 -1
- package/dist/contracts/output-schema-cli.d.ts +277 -25
- package/dist/contracts/output-schema-cli.d.ts.map +1 -1
- package/dist/contracts/output-schema-cli.js +35 -3
- package/dist/contracts/output-schema-cli.js.map +1 -1
- package/dist/contracts/output-schema-fragments.d.ts +212 -87
- package/dist/contracts/output-schema-fragments.d.ts.map +1 -1
- package/dist/contracts/output-schema-fragments.js +49 -2
- package/dist/contracts/output-schema-fragments.js.map +1 -1
- package/dist/contracts/output-schema-mcp.d.ts +372 -47
- package/dist/contracts/output-schema-mcp.d.ts.map +1 -1
- package/dist/contracts/output-schema-mcp.js +217 -1
- package/dist/contracts/output-schema-mcp.js.map +1 -1
- package/dist/contracts/output-schema-meta.d.ts +2 -2
- package/dist/contracts/output-schema-meta.d.ts.map +1 -1
- package/dist/contracts/output-schemas.d.ts +7 -7
- package/dist/contracts/output-schemas.d.ts.map +1 -1
- package/dist/contracts/output-schemas.js +294 -6
- package/dist/contracts/output-schemas.js.map +1 -1
- package/dist/git/diff.d.ts +11 -0
- package/dist/git/diff.d.ts.map +1 -1
- package/dist/git/diff.js +50 -6
- package/dist/git/diff.js.map +1 -1
- package/dist/mcp/burden.d.ts.map +1 -1
- package/dist/mcp/burden.js +9 -0
- package/dist/mcp/burden.js.map +1 -1
- package/dist/mcp/context.d.ts +3 -2
- package/dist/mcp/context.d.ts.map +1 -1
- package/dist/mcp/context.js +2 -37
- package/dist/mcp/context.js.map +1 -1
- package/dist/mcp/daemon-server.d.ts +2 -0
- package/dist/mcp/daemon-server.d.ts.map +1 -1
- package/dist/mcp/daemon-server.js +6 -1
- package/dist/mcp/daemon-server.js.map +1 -1
- package/dist/mcp/daemon-session-host.d.ts +1 -0
- package/dist/mcp/daemon-session-host.d.ts.map +1 -1
- package/dist/mcp/daemon-session-host.js +3 -0
- package/dist/mcp/daemon-session-host.js.map +1 -1
- package/dist/mcp/daemon-stdio-bridge.d.ts +1 -0
- package/dist/mcp/daemon-stdio-bridge.d.ts.map +1 -1
- package/dist/mcp/daemon-stdio-bridge.js +1 -0
- package/dist/mcp/daemon-stdio-bridge.js.map +1 -1
- package/dist/mcp/monitor-tick-job.d.ts +1 -0
- package/dist/mcp/monitor-tick-job.d.ts.map +1 -1
- package/dist/mcp/monitor-tick-job.js +84 -29
- package/dist/mcp/monitor-tick-job.js.map +1 -1
- package/dist/mcp/monitor-types.d.ts +1 -1
- package/dist/mcp/monitor-types.d.ts.map +1 -1
- package/dist/mcp/persisted-local-history-graph.d.ts +2 -2
- package/dist/mcp/persisted-local-history-graph.d.ts.map +1 -1
- package/dist/mcp/persisted-local-history-graph.js +3 -2
- package/dist/mcp/persisted-local-history-graph.js.map +1 -1
- package/dist/mcp/persisted-local-history.d.ts +5 -5
- package/dist/mcp/persisted-local-history.js +2 -2
- package/dist/mcp/persisted-local-history.js.map +1 -1
- package/dist/mcp/persistent-monitor-runtime.d.ts +1 -0
- package/dist/mcp/persistent-monitor-runtime.d.ts.map +1 -1
- package/dist/mcp/persistent-monitor-runtime.js +35 -0
- package/dist/mcp/persistent-monitor-runtime.js.map +1 -1
- package/dist/mcp/repo-tool-worker-context.d.ts.map +1 -1
- package/dist/mcp/repo-tool-worker-context.js +5 -2
- package/dist/mcp/repo-tool-worker-context.js.map +1 -1
- package/dist/mcp/server-context.d.ts.map +1 -1
- package/dist/mcp/server-context.js +13 -0
- package/dist/mcp/server-context.js.map +1 -1
- package/dist/mcp/server-tool-access.d.ts +1 -1
- package/dist/mcp/server-tool-access.d.ts.map +1 -1
- package/dist/mcp/server-tool-access.js +3 -1
- package/dist/mcp/server-tool-access.js.map +1 -1
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +5 -3
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-registry.d.ts.map +1 -1
- package/dist/mcp/tool-registry.js +18 -0
- package/dist/mcp/tool-registry.js.map +1 -1
- package/dist/mcp/tools/code-find.d.ts.map +1 -1
- package/dist/mcp/tools/code-find.js +20 -0
- package/dist/mcp/tools/code-find.js.map +1 -1
- package/dist/mcp/tools/code-show.d.ts.map +1 -1
- package/dist/mcp/tools/code-show.js +24 -0
- package/dist/mcp/tools/code-show.js.map +1 -1
- package/dist/mcp/tools/diagnostic-models.d.ts +2 -0
- package/dist/mcp/tools/diagnostic-models.d.ts.map +1 -1
- package/dist/mcp/tools/doctor.d.ts.map +1 -1
- package/dist/mcp/tools/doctor.js +18 -1
- package/dist/mcp/tools/doctor.js.map +1 -1
- package/dist/mcp/tools/export-surface-diff.d.ts +3 -0
- package/dist/mcp/tools/export-surface-diff.d.ts.map +1 -0
- package/dist/mcp/tools/export-surface-diff.js +24 -0
- package/dist/mcp/tools/export-surface-diff.js.map +1 -0
- package/dist/mcp/tools/file-outline.js +1 -1
- package/dist/mcp/tools/file-outline.js.map +1 -1
- package/dist/mcp/tools/graft-edit.d.ts +3 -0
- package/dist/mcp/tools/graft-edit.d.ts.map +1 -0
- package/dist/mcp/tools/graft-edit.js +192 -0
- package/dist/mcp/tools/graft-edit.js.map +1 -0
- package/dist/mcp/tools/knowledge-map.d.ts +3 -0
- package/dist/mcp/tools/knowledge-map.d.ts.map +1 -0
- package/dist/mcp/tools/knowledge-map.js +31 -0
- package/dist/mcp/tools/knowledge-map.js.map +1 -0
- package/dist/mcp/tools/monitor-nudge.d.ts +3 -0
- package/dist/mcp/tools/monitor-nudge.d.ts.map +1 -0
- package/dist/mcp/tools/monitor-nudge.js +17 -0
- package/dist/mcp/tools/monitor-nudge.js.map +1 -0
- package/dist/mcp/tools/precision-warp.d.ts +3 -3
- package/dist/mcp/tools/precision-warp.d.ts.map +1 -1
- package/dist/mcp/tools/precision-warp.js +24 -15
- package/dist/mcp/tools/precision-warp.js.map +1 -1
- package/dist/mcp/tools/refactor-difficulty.d.ts +3 -0
- package/dist/mcp/tools/refactor-difficulty.d.ts.map +1 -0
- package/dist/mcp/tools/refactor-difficulty.js +36 -0
- package/dist/mcp/tools/refactor-difficulty.js.map +1 -0
- package/dist/mcp/tools/safe-read.js +2 -2
- package/dist/mcp/tools/safe-read.js.map +1 -1
- package/dist/mcp/tools/structural-blame.d.ts +3 -0
- package/dist/mcp/tools/structural-blame.d.ts.map +1 -0
- package/dist/mcp/tools/structural-blame.js +44 -0
- package/dist/mcp/tools/structural-blame.js.map +1 -0
- package/dist/mcp/tools/structural-churn.d.ts +3 -0
- package/dist/mcp/tools/structural-churn.d.ts.map +1 -0
- package/dist/mcp/tools/structural-churn.js +28 -0
- package/dist/mcp/tools/structural-churn.js.map +1 -0
- package/dist/mcp/tools/structural-log.d.ts +3 -0
- package/dist/mcp/tools/structural-log.d.ts.map +1 -0
- package/dist/mcp/tools/structural-log.js +38 -0
- package/dist/mcp/tools/structural-log.js.map +1 -0
- package/dist/mcp/tools/structural-review.d.ts +3 -0
- package/dist/mcp/tools/structural-review.d.ts.map +1 -0
- package/dist/mcp/tools/structural-review.js +55 -0
- package/dist/mcp/tools/structural-review.js.map +1 -0
- package/dist/mcp/warp-pool.d.ts +4 -4
- package/dist/mcp/warp-pool.d.ts.map +1 -1
- package/dist/mcp/warp-pool.js.map +1 -1
- package/dist/mcp/workspace-router-model.d.ts +2 -2
- package/dist/mcp/workspace-router-model.d.ts.map +1 -1
- package/dist/mcp/workspace-router-runtime.d.ts +3 -3
- package/dist/mcp/workspace-router-runtime.d.ts.map +1 -1
- package/dist/mcp/workspace-router-runtime.js +4 -1
- package/dist/mcp/workspace-router-runtime.js.map +1 -1
- package/dist/mcp/workspace-router.d.ts +3 -2
- package/dist/mcp/workspace-router.d.ts.map +1 -1
- package/dist/mcp/workspace-router.js +6 -0
- package/dist/mcp/workspace-router.js.map +1 -1
- package/dist/operations/adaptive-projection.d.ts +22 -0
- package/dist/operations/adaptive-projection.d.ts.map +1 -0
- package/dist/operations/adaptive-projection.js +36 -0
- package/dist/operations/adaptive-projection.js.map +1 -0
- package/dist/operations/agent-handoff.d.ts +25 -0
- package/dist/operations/agent-handoff.d.ts.map +1 -0
- package/dist/operations/agent-handoff.js +36 -0
- package/dist/operations/agent-handoff.js.map +1 -0
- package/dist/operations/capture-range.d.ts +33 -0
- package/dist/operations/capture-range.d.ts.map +1 -0
- package/dist/operations/capture-range.js +45 -0
- package/dist/operations/capture-range.js.map +1 -0
- package/dist/operations/conversation-primer.d.ts +27 -0
- package/dist/operations/conversation-primer.d.ts.map +1 -0
- package/dist/operations/conversation-primer.js +52 -0
- package/dist/operations/conversation-primer.js.map +1 -0
- package/dist/operations/cross-session-resume.d.ts +28 -0
- package/dist/operations/cross-session-resume.d.ts.map +1 -0
- package/dist/operations/cross-session-resume.js +79 -0
- package/dist/operations/cross-session-resume.js.map +1 -0
- package/dist/operations/deterministic-replay.d.ts +39 -0
- package/dist/operations/deterministic-replay.d.ts.map +1 -0
- package/dist/operations/deterministic-replay.js +90 -0
- package/dist/operations/deterministic-replay.js.map +1 -0
- package/dist/operations/export-surface-diff.d.ts +36 -0
- package/dist/operations/export-surface-diff.d.ts.map +1 -0
- package/dist/operations/export-surface-diff.js +298 -0
- package/dist/operations/export-surface-diff.js.map +1 -0
- package/dist/operations/footprint-parallelism.d.ts +25 -0
- package/dist/operations/footprint-parallelism.d.ts.map +1 -0
- package/dist/operations/footprint-parallelism.js +79 -0
- package/dist/operations/footprint-parallelism.js.map +1 -0
- package/dist/operations/graft-diff.d.ts.map +1 -1
- package/dist/operations/graft-diff.js +14 -7
- package/dist/operations/graft-diff.js.map +1 -1
- package/dist/operations/horizon-of-readability.d.ts +23 -0
- package/dist/operations/horizon-of-readability.d.ts.map +1 -0
- package/dist/operations/horizon-of-readability.js +39 -0
- package/dist/operations/horizon-of-readability.js.map +1 -0
- package/dist/operations/import-reference-impact.d.ts +13 -0
- package/dist/operations/import-reference-impact.d.ts.map +1 -0
- package/dist/operations/import-reference-impact.js +101 -0
- package/dist/operations/import-reference-impact.js.map +1 -0
- package/dist/operations/knowledge-map.d.ts +30 -0
- package/dist/operations/knowledge-map.d.ts.map +1 -0
- package/dist/operations/knowledge-map.js +64 -0
- package/dist/operations/knowledge-map.js.map +1 -0
- package/dist/operations/observation-cache.d.ts +8 -2
- package/dist/operations/observation-cache.d.ts.map +1 -1
- package/dist/operations/observation-cache.js +17 -5
- package/dist/operations/observation-cache.js.map +1 -1
- package/dist/operations/projection-safety.d.ts +31 -0
- package/dist/operations/projection-safety.d.ts.map +1 -0
- package/dist/operations/projection-safety.js +77 -0
- package/dist/operations/projection-safety.js.map +1 -0
- package/dist/operations/repo-workspace.js +3 -3
- package/dist/operations/repo-workspace.js.map +1 -1
- package/dist/operations/semantic-drift.d.ts +27 -0
- package/dist/operations/semantic-drift.d.ts.map +1 -0
- package/dist/operations/semantic-drift.js +46 -0
- package/dist/operations/semantic-drift.js.map +1 -0
- package/dist/operations/session-filtration.d.ts +36 -0
- package/dist/operations/session-filtration.d.ts.map +1 -0
- package/dist/operations/session-filtration.js +48 -0
- package/dist/operations/session-filtration.js.map +1 -0
- package/dist/operations/session-replay.d.ts +17 -0
- package/dist/operations/session-replay.d.ts.map +1 -0
- package/dist/operations/session-replay.js +59 -0
- package/dist/operations/session-replay.js.map +1 -0
- package/dist/operations/sludge-detector.d.ts +45 -0
- package/dist/operations/sludge-detector.d.ts.map +1 -0
- package/dist/operations/sludge-detector.js +278 -0
- package/dist/operations/sludge-detector.js.map +1 -0
- package/dist/operations/structural-blame.d.ts +67 -0
- package/dist/operations/structural-blame.d.ts.map +1 -0
- package/dist/operations/structural-blame.js +111 -0
- package/dist/operations/structural-blame.js.map +1 -0
- package/dist/operations/structural-review.d.ts +47 -0
- package/dist/operations/structural-review.d.ts.map +1 -0
- package/dist/operations/structural-review.js +225 -0
- package/dist/operations/structural-review.js.map +1 -0
- package/dist/operations/teaching-hints.d.ts +18 -0
- package/dist/operations/teaching-hints.d.ts.map +1 -0
- package/dist/operations/teaching-hints.js +35 -0
- package/dist/operations/teaching-hints.js.map +1 -0
- package/dist/parser/diff.d.ts +2 -0
- package/dist/parser/diff.d.ts.map +1 -1
- package/dist/parser/diff.js +7 -0
- package/dist/parser/diff.js.map +1 -1
- package/dist/ports/paths.d.ts +17 -0
- package/dist/ports/paths.d.ts.map +1 -0
- package/dist/ports/{warp.js → paths.js} +2 -2
- package/dist/ports/paths.js.map +1 -0
- package/dist/warp/ast-emitter.d.ts +28 -0
- package/dist/warp/ast-emitter.d.ts.map +1 -0
- package/dist/warp/ast-emitter.js +90 -0
- package/dist/warp/ast-emitter.js.map +1 -0
- package/dist/warp/ast-import-resolver.d.ts +13 -0
- package/dist/warp/ast-import-resolver.d.ts.map +1 -0
- package/dist/warp/ast-import-resolver.js +259 -0
- package/dist/warp/ast-import-resolver.js.map +1 -0
- package/dist/warp/commit-meta.d.ts +8 -0
- package/dist/warp/commit-meta.d.ts.map +1 -0
- package/dist/warp/commit-meta.js +13 -0
- package/dist/warp/commit-meta.js.map +1 -0
- package/dist/warp/context.d.ts +10 -0
- package/dist/warp/context.d.ts.map +1 -0
- package/dist/warp/context.js +26 -0
- package/dist/warp/context.js.map +1 -0
- package/dist/warp/dead-symbols.d.ts +40 -0
- package/dist/warp/dead-symbols.d.ts.map +1 -0
- package/dist/warp/dead-symbols.js +127 -0
- package/dist/warp/dead-symbols.js.map +1 -0
- package/dist/warp/drift-sentinel.d.ts +30 -0
- package/dist/warp/drift-sentinel.d.ts.map +1 -0
- package/dist/warp/drift-sentinel.js +65 -0
- package/dist/warp/drift-sentinel.js.map +1 -0
- package/dist/warp/index-head.d.ts +32 -0
- package/dist/warp/index-head.d.ts.map +1 -0
- package/dist/warp/index-head.js +245 -0
- package/dist/warp/index-head.js.map +1 -0
- package/dist/warp/observers.d.ts +6 -6
- package/dist/warp/observers.d.ts.map +1 -1
- package/dist/warp/observers.js +5 -4
- package/dist/warp/observers.js.map +1 -1
- package/dist/warp/open.d.ts +5 -4
- package/dist/warp/open.d.ts.map +1 -1
- package/dist/warp/open.js +24 -49
- package/dist/warp/open.js.map +1 -1
- package/dist/warp/outline-diff-trailer.d.ts +26 -0
- package/dist/warp/outline-diff-trailer.d.ts.map +1 -0
- package/dist/warp/outline-diff-trailer.js +68 -0
- package/dist/warp/outline-diff-trailer.js.map +1 -0
- package/dist/warp/refactor-difficulty.d.ts +38 -0
- package/dist/warp/refactor-difficulty.d.ts.map +1 -0
- package/dist/warp/refactor-difficulty.js +169 -0
- package/dist/warp/refactor-difficulty.js.map +1 -0
- package/dist/warp/references.d.ts +22 -0
- package/dist/warp/references.d.ts.map +1 -0
- package/dist/warp/references.js +57 -0
- package/dist/warp/references.js.map +1 -0
- package/dist/warp/stale-docs.d.ts +56 -0
- package/dist/warp/stale-docs.d.ts.map +1 -0
- package/dist/warp/stale-docs.js +149 -0
- package/dist/warp/stale-docs.js.map +1 -0
- package/dist/warp/structural-drift-detection.d.ts +49 -0
- package/dist/warp/structural-drift-detection.d.ts.map +1 -0
- package/dist/warp/structural-drift-detection.js +51 -0
- package/dist/warp/structural-drift-detection.js.map +1 -0
- package/dist/warp/structural-queries.d.ts +49 -0
- package/dist/warp/structural-queries.d.ts.map +1 -0
- package/dist/warp/structural-queries.js +175 -0
- package/dist/warp/structural-queries.js.map +1 -0
- package/dist/warp/symbol-timeline.d.ts +34 -0
- package/dist/warp/symbol-timeline.d.ts.map +1 -0
- package/dist/warp/symbol-timeline.js +127 -0
- package/dist/warp/symbol-timeline.js.map +1 -0
- package/dist/warp/traverse-hydrate.d.ts +23 -0
- package/dist/warp/traverse-hydrate.d.ts.map +1 -0
- package/dist/warp/traverse-hydrate.js +39 -0
- package/dist/warp/traverse-hydrate.js.map +1 -0
- package/dist/warp/warp-reference-count.d.ts +19 -0
- package/dist/warp/warp-reference-count.d.ts.map +1 -0
- package/dist/warp/warp-reference-count.js +32 -0
- package/dist/warp/warp-reference-count.js.map +1 -0
- package/dist/warp/warp-structural-blame.d.ts +20 -0
- package/dist/warp/warp-structural-blame.d.ts.map +1 -0
- package/dist/warp/warp-structural-blame.js +43 -0
- package/dist/warp/warp-structural-blame.js.map +1 -0
- package/dist/warp/warp-structural-churn.d.ts +30 -0
- package/dist/warp/warp-structural-churn.d.ts.map +1 -0
- package/dist/warp/warp-structural-churn.js +213 -0
- package/dist/warp/warp-structural-churn.js.map +1 -0
- package/dist/warp/warp-structural-log.d.ts +35 -0
- package/dist/warp/warp-structural-log.d.ts.map +1 -0
- package/dist/warp/warp-structural-log.js +104 -0
- package/dist/warp/warp-structural-log.js.map +1 -0
- package/docs/CLI.md +68 -4
- package/docs/MCP.md +23 -0
- package/docs/SETUP.md +101 -20
- package/package.json +5 -3
- package/src/adapters/json-text-decoder.ts +11 -0
- package/src/adapters/node-paths.ts +35 -0
- package/src/adapters/repo-paths.ts +45 -4
- package/src/api/tool-bridge.ts +2 -1
- package/src/cli/cli-error.ts +49 -10
- package/src/cli/command-parser.ts +185 -3
- package/src/cli/daemon-status-model.ts +238 -0
- package/src/cli/daemon-status-render.ts +102 -0
- package/src/cli/daemon-status.ts +100 -0
- package/src/cli/git-graft-enhance-model.ts +131 -0
- package/src/cli/git-graft-enhance-render.ts +33 -0
- package/src/cli/git-graft-enhance.ts +54 -0
- package/src/cli/index-cmd.ts +18 -22
- package/src/cli/index-model.ts +21 -22
- package/src/cli/init-client-config.ts +167 -38
- package/src/cli/init-model.ts +57 -2
- package/src/cli/init-render.ts +2 -2
- package/src/cli/init.ts +11 -9
- package/src/cli/json-document.ts +11 -0
- package/src/cli/main.ts +53 -6
- package/src/cli/migrate-local-history.ts +3 -2
- package/src/cli/peer-command.ts +2 -1
- package/src/contracts/capabilities.ts +90 -0
- package/src/contracts/json-object.ts +1 -11
- package/src/contracts/output-schema-cli.ts +36 -3
- package/src/contracts/output-schema-fragments.ts +52 -2
- package/src/contracts/output-schema-mcp.ts +219 -0
- package/src/contracts/output-schemas.ts +300 -6
- package/src/git/diff.ts +61 -0
- package/src/mcp/burden.ts +9 -0
- package/src/mcp/context.ts +5 -42
- package/src/mcp/daemon-server.ts +8 -1
- package/src/mcp/daemon-session-host.ts +4 -0
- package/src/mcp/daemon-stdio-bridge.ts +2 -0
- package/src/mcp/monitor-tick-job.ts +90 -39
- package/src/mcp/monitor-types.ts +1 -1
- package/src/mcp/persisted-local-history-graph.ts +5 -4
- package/src/mcp/persisted-local-history.ts +2 -2
- package/src/mcp/persistent-monitor-runtime.ts +37 -0
- package/src/mcp/repo-tool-worker-context.ts +5 -2
- package/src/mcp/server-context.ts +15 -2
- package/src/mcp/server-tool-access.ts +4 -1
- package/src/mcp/server.ts +8 -3
- package/src/mcp/tool-registry.ts +18 -0
- package/src/mcp/tools/code-find.ts +23 -0
- package/src/mcp/tools/code-show.ts +27 -0
- package/src/mcp/tools/diagnostic-models.ts +2 -0
- package/src/mcp/tools/doctor.ts +18 -1
- package/src/mcp/tools/export-surface-diff.ts +26 -0
- package/src/mcp/tools/file-outline.ts +1 -1
- package/src/mcp/tools/graft-edit.ts +276 -0
- package/src/mcp/tools/knowledge-map.ts +34 -0
- package/src/mcp/tools/monitor-nudge.ts +19 -0
- package/src/mcp/tools/precision-warp.ts +27 -16
- package/src/mcp/tools/refactor-difficulty.ts +42 -0
- package/src/mcp/tools/safe-read.ts +2 -2
- package/src/mcp/tools/structural-blame.ts +55 -0
- package/src/mcp/tools/structural-churn.ts +28 -0
- package/src/mcp/tools/structural-log.ts +41 -0
- package/src/mcp/tools/structural-review.ts +63 -0
- package/src/mcp/warp-pool.ts +6 -6
- package/src/mcp/workspace-router-model.ts +2 -2
- package/src/mcp/workspace-router-runtime.ts +11 -8
- package/src/mcp/workspace-router.ts +9 -2
- package/src/operations/adaptive-projection.ts +54 -0
- package/src/operations/agent-handoff.ts +59 -0
- package/src/operations/capture-range.ts +64 -0
- package/src/operations/conversation-primer.ts +82 -0
- package/src/operations/cross-session-resume.ts +104 -0
- package/src/operations/deterministic-replay.ts +143 -0
- package/src/operations/export-surface-diff.ts +355 -0
- package/src/operations/footprint-parallelism.ts +98 -0
- package/src/operations/graft-diff.ts +14 -7
- package/src/operations/horizon-of-readability.ts +60 -0
- package/src/operations/import-reference-impact.ts +143 -0
- package/src/operations/knowledge-map.ts +96 -0
- package/src/operations/observation-cache.ts +20 -4
- package/src/operations/projection-safety.ts +111 -0
- package/src/operations/repo-workspace.ts +3 -3
- package/src/operations/semantic-drift.ts +70 -0
- package/src/operations/session-filtration.ts +76 -0
- package/src/operations/session-replay.ts +73 -0
- package/src/operations/sludge-detector.ts +356 -0
- package/src/operations/structural-blame.ts +197 -0
- package/src/operations/structural-review.ts +317 -0
- package/src/operations/teaching-hints.ts +52 -0
- package/src/parser/diff.ts +7 -0
- package/src/ports/paths.ts +22 -0
- package/src/warp/ast-emitter.ts +133 -0
- package/src/warp/ast-import-resolver.ts +333 -0
- package/src/warp/commit-meta.ts +19 -0
- package/src/warp/context.ts +48 -0
- package/src/warp/dead-symbols.ts +174 -0
- package/src/warp/drift-sentinel.ts +101 -0
- package/src/warp/index-head.ts +348 -0
- package/src/warp/observers.ts +8 -7
- package/src/warp/open.ts +40 -66
- package/src/warp/outline-diff-trailer.ts +100 -0
- package/src/warp/plumbing.d.ts +11 -2
- package/src/warp/refactor-difficulty.ts +257 -0
- package/src/warp/references.ts +77 -0
- package/src/warp/stale-docs.ts +210 -0
- package/src/warp/structural-drift-detection.ts +97 -0
- package/src/warp/structural-queries.ts +258 -0
- package/src/warp/symbol-timeline.ts +209 -0
- package/src/warp/traverse-hydrate.ts +61 -0
- package/src/warp/warp-reference-count.ts +47 -0
- package/src/warp/warp-structural-blame.ts +65 -0
- package/src/warp/warp-structural-churn.ts +309 -0
- package/src/warp/warp-structural-log.ts +149 -0
- package/dist/ports/warp.d.ts +0 -45
- package/dist/ports/warp.d.ts.map +0 -1
- package/dist/ports/warp.js.map +0 -1
- package/dist/warp/identity-resolver.d.ts +0 -14
- package/dist/warp/identity-resolver.d.ts.map +0 -1
- package/dist/warp/identity-resolver.js +0 -31
- package/dist/warp/identity-resolver.js.map +0 -1
- package/dist/warp/indexer-git.d.ts +0 -22
- package/dist/warp/indexer-git.d.ts.map +0 -1
- package/dist/warp/indexer-git.js +0 -148
- package/dist/warp/indexer-git.js.map +0 -1
- package/dist/warp/indexer-graph.d.ts +0 -17
- package/dist/warp/indexer-graph.d.ts.map +0 -1
- package/dist/warp/indexer-graph.js +0 -179
- package/dist/warp/indexer-graph.js.map +0 -1
- package/dist/warp/indexer-model.d.ts +0 -51
- package/dist/warp/indexer-model.d.ts.map +0 -1
- package/dist/warp/indexer-model.js +0 -21
- package/dist/warp/indexer-model.js.map +0 -1
- package/dist/warp/indexer.d.ts +0 -9
- package/dist/warp/indexer.d.ts.map +0 -1
- package/dist/warp/indexer.js +0 -112
- package/dist/warp/indexer.js.map +0 -1
- package/dist/warp/symbol-identity.d.ts +0 -11
- package/dist/warp/symbol-identity.d.ts.map +0 -1
- package/dist/warp/symbol-identity.js +0 -67
- package/dist/warp/symbol-identity.js.map +0 -1
- package/src/ports/warp.ts +0 -55
- package/src/warp/identity-resolver.ts +0 -35
- package/src/warp/indexer-git.ts +0 -182
- package/src/warp/indexer-graph.ts +0 -276
- package/src/warp/indexer-model.ts +0 -69
- package/src/warp/indexer.ts +0 -186
- package/src/warp/symbol-identity.ts +0 -100
|
@@ -78,6 +78,34 @@ const tripwireSchema = z.object({
|
|
|
78
78
|
recommendation: z.string(),
|
|
79
79
|
}).strict();
|
|
80
80
|
|
|
81
|
+
const graftEditReasonSchema = z.enum([
|
|
82
|
+
"NOT_FOUND",
|
|
83
|
+
"OLD_STRING_NOT_FOUND",
|
|
84
|
+
"OLD_STRING_AMBIGUOUS",
|
|
85
|
+
"BINARY",
|
|
86
|
+
"LOCKFILE",
|
|
87
|
+
"MINIFIED",
|
|
88
|
+
"BUILD_OUTPUT",
|
|
89
|
+
"SECRET",
|
|
90
|
+
"GRAFTIGNORE",
|
|
91
|
+
]);
|
|
92
|
+
|
|
93
|
+
const graftEditDriftWarningSchema = z.object({
|
|
94
|
+
kind: z.literal("structural_pattern_reintroduced"),
|
|
95
|
+
severity: z.literal("advisory"),
|
|
96
|
+
pattern: z.literal("jsdoc_typedef"),
|
|
97
|
+
basis: z.literal("session_local_graft_edit"),
|
|
98
|
+
message: z.string(),
|
|
99
|
+
current: z.object({
|
|
100
|
+
path: z.string(),
|
|
101
|
+
direction: z.literal("added"),
|
|
102
|
+
}).strict(),
|
|
103
|
+
previous: z.object({
|
|
104
|
+
path: z.string(),
|
|
105
|
+
direction: z.literal("removed"),
|
|
106
|
+
}).strict(),
|
|
107
|
+
}).strict();
|
|
108
|
+
|
|
81
109
|
const outlineEntrySchema: z.ZodType = z.lazy(() => z.object({
|
|
82
110
|
_brand: z.literal("OutlineEntry").optional(),
|
|
83
111
|
kind: z.string(),
|
|
@@ -120,6 +148,7 @@ const diffEntrySchema: z.ZodType = z.lazy(() => z.object({
|
|
|
120
148
|
_brand: z.literal("DiffEntry").optional(),
|
|
121
149
|
name: z.string(),
|
|
122
150
|
kind: z.string(),
|
|
151
|
+
exported: z.boolean().optional(),
|
|
123
152
|
signature: z.string().optional(),
|
|
124
153
|
oldSignature: z.string().optional(),
|
|
125
154
|
childDiff: outlineDiffSchema.optional(),
|
|
@@ -141,6 +170,45 @@ const burdenByKindSchema = z.object({
|
|
|
141
170
|
diagnostic: burdenBucketSchema,
|
|
142
171
|
}).strict();
|
|
143
172
|
|
|
173
|
+
const sludgeSignalSchema = z.object({
|
|
174
|
+
kind: z.enum([
|
|
175
|
+
"phantom_shape",
|
|
176
|
+
"cast_density",
|
|
177
|
+
"homeless_constructor",
|
|
178
|
+
"free_function_data_behavior",
|
|
179
|
+
"god_file",
|
|
180
|
+
]),
|
|
181
|
+
severity: z.enum(["low", "medium", "high"]),
|
|
182
|
+
message: z.string(),
|
|
183
|
+
line: z.number().int().positive().optional(),
|
|
184
|
+
symbol: z.string().optional(),
|
|
185
|
+
evidence: z.string(),
|
|
186
|
+
}).strict();
|
|
187
|
+
|
|
188
|
+
const sludgeFileReportSchema = z.object({
|
|
189
|
+
path: z.string(),
|
|
190
|
+
score: z.number().int().nonnegative(),
|
|
191
|
+
metrics: z.object({
|
|
192
|
+
typedefCount: z.number().int().nonnegative(),
|
|
193
|
+
typeCastCount: z.number().int().nonnegative(),
|
|
194
|
+
classCount: z.number().int().nonnegative(),
|
|
195
|
+
functionCount: z.number().int().nonnegative(),
|
|
196
|
+
symbolCount: z.number().int().nonnegative(),
|
|
197
|
+
homelessConstructorCount: z.number().int().nonnegative(),
|
|
198
|
+
freeFunctionDataBehaviorCount: z.number().int().nonnegative(),
|
|
199
|
+
}).strict(),
|
|
200
|
+
signals: z.array(sludgeSignalSchema),
|
|
201
|
+
}).strict();
|
|
202
|
+
|
|
203
|
+
const sludgeReportSchema = z.object({
|
|
204
|
+
scannedFiles: z.number().int().nonnegative(),
|
|
205
|
+
filesWithSignals: z.number().int().nonnegative(),
|
|
206
|
+
totalSignals: z.number().int().nonnegative(),
|
|
207
|
+
score: z.number().int().nonnegative(),
|
|
208
|
+
files: z.array(sludgeFileReportSchema),
|
|
209
|
+
summary: z.string(),
|
|
210
|
+
}).strict();
|
|
211
|
+
|
|
144
212
|
const receiptSchema = z.object({
|
|
145
213
|
sessionId: z.string(),
|
|
146
214
|
traceId: z.string(),
|
|
@@ -193,6 +261,33 @@ const runtimeLocalProvenanceSchema = z.object({
|
|
|
193
261
|
provenanceLevel: z.literal("artifact_history"),
|
|
194
262
|
}).strict();
|
|
195
263
|
|
|
264
|
+
const gitGraftEnhanceBodySchema = z.object({
|
|
265
|
+
range: z.object({
|
|
266
|
+
since: z.string(),
|
|
267
|
+
head: z.string(),
|
|
268
|
+
}).strict(),
|
|
269
|
+
structural: z.object({
|
|
270
|
+
changedFiles: z.number().int().nonnegative(),
|
|
271
|
+
addedSymbols: z.number().int().nonnegative(),
|
|
272
|
+
removedSymbols: z.number().int().nonnegative(),
|
|
273
|
+
changedSymbols: z.number().int().nonnegative(),
|
|
274
|
+
topFilesByChangeCount: z.array(z.object({
|
|
275
|
+
path: z.string(),
|
|
276
|
+
status: z.string(),
|
|
277
|
+
changeCount: z.number().int().nonnegative(),
|
|
278
|
+
summary: z.string(),
|
|
279
|
+
}).strict()),
|
|
280
|
+
}).strict(),
|
|
281
|
+
exports: z.object({
|
|
282
|
+
changed: z.boolean(),
|
|
283
|
+
semverImpact: z.enum(["major", "minor", "patch", "none"]),
|
|
284
|
+
addedExports: z.number().int().nonnegative(),
|
|
285
|
+
removedExports: z.number().int().nonnegative(),
|
|
286
|
+
changedExports: z.number().int().nonnegative(),
|
|
287
|
+
}).strict(),
|
|
288
|
+
warnings: z.array(z.string()),
|
|
289
|
+
}).strict();
|
|
290
|
+
|
|
196
291
|
const runtimeStagedTargetSchema = z.discriminatedUnion("availability", [
|
|
197
292
|
runtimeLocalProvenanceSchema.extend({
|
|
198
293
|
availability: z.literal("none"),
|
|
@@ -540,7 +635,7 @@ const activeCausalWorkspaceSchema = z.object({
|
|
|
540
635
|
latestReadEvent: readEventSchema.nullable(),
|
|
541
636
|
latestStageEvent: stageEventSchema.nullable(),
|
|
542
637
|
latestTransitionEvent: transitionEventSchema.nullable(),
|
|
543
|
-
repoConcurrency: repoConcurrencySummarySchema,
|
|
638
|
+
repoConcurrency: repoConcurrencySummarySchema.nullable(),
|
|
544
639
|
checkoutEpoch: z.number().int().nonnegative(),
|
|
545
640
|
lastTransition: repoTransitionSchema.nullable(),
|
|
546
641
|
semanticTransition: repoSemanticTransitionSchema.nullable(),
|
|
@@ -693,7 +788,7 @@ const monitorStatusSchema = z.object({
|
|
|
693
788
|
|
|
694
789
|
const monitorActionSchema = z.object({
|
|
695
790
|
ok: z.boolean(),
|
|
696
|
-
action: z.enum(["start", "pause", "resume", "stop"]),
|
|
791
|
+
action: z.enum(["start", "pause", "resume", "stop", "nudge"]),
|
|
697
792
|
created: z.boolean(),
|
|
698
793
|
changed: z.boolean(),
|
|
699
794
|
status: monitorStatusSchema.optional(),
|
|
@@ -818,6 +913,20 @@ const mcpOutputBodySchemas: Record<McpToolName, z.ZodType> = {
|
|
|
818
913
|
lastReadAt: z.string().optional(),
|
|
819
914
|
diff: outlineDiffSchema.optional(),
|
|
820
915
|
}).strict(),
|
|
916
|
+
graft_edit: z.object({
|
|
917
|
+
path: z.string(),
|
|
918
|
+
operation: z.literal("replace"),
|
|
919
|
+
projection: z.enum(["edited", "refused"]),
|
|
920
|
+
status: z.enum(["edited", "refused"]),
|
|
921
|
+
changed: z.boolean(),
|
|
922
|
+
matches: z.number().int().nonnegative(),
|
|
923
|
+
replacements: z.number().int().nonnegative(),
|
|
924
|
+
reason: graftEditReasonSchema.optional(),
|
|
925
|
+
reasonDetail: z.string().optional(),
|
|
926
|
+
next: z.array(z.string()).optional(),
|
|
927
|
+
actual: actualSchema.optional(),
|
|
928
|
+
driftWarnings: z.array(graftEditDriftWarningSchema).optional(),
|
|
929
|
+
}).strict(),
|
|
821
930
|
file_outline: z.union([
|
|
822
931
|
z.object({
|
|
823
932
|
path: z.string(),
|
|
@@ -949,6 +1058,7 @@ const mcpOutputBodySchemas: Record<McpToolName, z.ZodType> = {
|
|
|
949
1058
|
monitor_start: monitorActionSchema,
|
|
950
1059
|
monitor_pause: monitorActionSchema,
|
|
951
1060
|
monitor_resume: monitorActionSchema,
|
|
1061
|
+
monitor_nudge: monitorActionSchema,
|
|
952
1062
|
monitor_stop: monitorActionSchema,
|
|
953
1063
|
workspace_authorize: workspaceAuthorizeSchema,
|
|
954
1064
|
workspace_authorizations: z.object({
|
|
@@ -1018,6 +1128,7 @@ const mcpOutputBodySchemas: Record<McpToolName, z.ZodType> = {
|
|
|
1018
1128
|
attribution: attributionSummarySchema,
|
|
1019
1129
|
persistedLocalHistory: persistedLocalHistorySummarySchema,
|
|
1020
1130
|
recommendedNextAction: causalSurfaceNextActionSchema,
|
|
1131
|
+
sludge: sludgeReportSchema.optional(),
|
|
1021
1132
|
}).strict(),
|
|
1022
1133
|
stats: z.object({
|
|
1023
1134
|
totalReads: z.number().int().nonnegative(),
|
|
@@ -1029,10 +1140,170 @@ const mcpOutputBodySchemas: Record<McpToolName, z.ZodType> = {
|
|
|
1029
1140
|
totalNonReadBytesReturned: z.number().int().nonnegative(),
|
|
1030
1141
|
burdenByKind: burdenByKindSchema,
|
|
1031
1142
|
}).strict(),
|
|
1143
|
+
graft_churn: z.object({
|
|
1144
|
+
entries: z.array(z.object({
|
|
1145
|
+
symbol: z.string(),
|
|
1146
|
+
filePath: z.string(),
|
|
1147
|
+
kind: z.string(),
|
|
1148
|
+
changeCount: z.number().int().positive(),
|
|
1149
|
+
lastChangedSha: z.string(),
|
|
1150
|
+
lastChangedDate: z.string(),
|
|
1151
|
+
}).strict()),
|
|
1152
|
+
totalSymbols: z.number().int().nonnegative(),
|
|
1153
|
+
totalCommitsAnalyzed: z.number().int().nonnegative(),
|
|
1154
|
+
summary: z.string(),
|
|
1155
|
+
}).strict(),
|
|
1156
|
+
graft_exports: z.object({
|
|
1157
|
+
base: z.string(),
|
|
1158
|
+
head: z.string(),
|
|
1159
|
+
added: z.array(z.object({
|
|
1160
|
+
symbol: z.string(),
|
|
1161
|
+
filePath: z.string(),
|
|
1162
|
+
kind: z.string(),
|
|
1163
|
+
changeType: z.literal("added"),
|
|
1164
|
+
signature: z.string().optional(),
|
|
1165
|
+
}).strict()),
|
|
1166
|
+
removed: z.array(z.object({
|
|
1167
|
+
symbol: z.string(),
|
|
1168
|
+
filePath: z.string(),
|
|
1169
|
+
kind: z.string(),
|
|
1170
|
+
changeType: z.literal("removed"),
|
|
1171
|
+
signature: z.string().optional(),
|
|
1172
|
+
}).strict()),
|
|
1173
|
+
changed: z.array(z.object({
|
|
1174
|
+
symbol: z.string(),
|
|
1175
|
+
filePath: z.string(),
|
|
1176
|
+
kind: z.string(),
|
|
1177
|
+
changeType: z.literal("signature_changed"),
|
|
1178
|
+
signature: z.string().optional(),
|
|
1179
|
+
previousSignature: z.string().optional(),
|
|
1180
|
+
}).strict()),
|
|
1181
|
+
semverImpact: z.enum(["major", "minor", "patch", "none"]),
|
|
1182
|
+
summary: z.string(),
|
|
1183
|
+
}).strict(),
|
|
1184
|
+
graft_log: z.object({
|
|
1185
|
+
entries: z.array(z.object({
|
|
1186
|
+
sha: z.string(),
|
|
1187
|
+
message: z.string(),
|
|
1188
|
+
author: z.string(),
|
|
1189
|
+
date: z.string(),
|
|
1190
|
+
symbols: z.object({
|
|
1191
|
+
added: z.array(z.object({
|
|
1192
|
+
name: z.string(),
|
|
1193
|
+
kind: z.string(),
|
|
1194
|
+
signature: z.string().optional(),
|
|
1195
|
+
exported: z.boolean(),
|
|
1196
|
+
filePath: z.string(),
|
|
1197
|
+
}).strict()),
|
|
1198
|
+
removed: z.array(z.object({
|
|
1199
|
+
name: z.string(),
|
|
1200
|
+
kind: z.string(),
|
|
1201
|
+
signature: z.string().optional(),
|
|
1202
|
+
exported: z.boolean(),
|
|
1203
|
+
filePath: z.string(),
|
|
1204
|
+
}).strict()),
|
|
1205
|
+
changed: z.array(z.object({
|
|
1206
|
+
name: z.string(),
|
|
1207
|
+
kind: z.string(),
|
|
1208
|
+
signature: z.string().optional(),
|
|
1209
|
+
exported: z.boolean(),
|
|
1210
|
+
filePath: z.string(),
|
|
1211
|
+
}).strict()),
|
|
1212
|
+
}).strict(),
|
|
1213
|
+
summary: z.string(),
|
|
1214
|
+
}).strict()),
|
|
1215
|
+
count: z.number().int().nonnegative(),
|
|
1216
|
+
layer: z.literal("commit_worldline"),
|
|
1217
|
+
}).strict(),
|
|
1218
|
+
graft_blame: z.object({
|
|
1219
|
+
symbol: z.string(),
|
|
1220
|
+
filePath: z.string(),
|
|
1221
|
+
changeCount: z.number().int().nonnegative(),
|
|
1222
|
+
createdInCommit: z.string().nullable(),
|
|
1223
|
+
lastSignatureChange: z.string().nullable(),
|
|
1224
|
+
referenceCount: z.number().int().nonnegative(),
|
|
1225
|
+
history: z.array(z.object({
|
|
1226
|
+
sha: z.string(),
|
|
1227
|
+
tick: z.number(),
|
|
1228
|
+
changeKind: z.string(),
|
|
1229
|
+
present: z.boolean(),
|
|
1230
|
+
signature: z.string().nullable(),
|
|
1231
|
+
}).strict()),
|
|
1232
|
+
}).strict(),
|
|
1233
|
+
graft_difficulty: z.object({
|
|
1234
|
+
symbol: z.string(),
|
|
1235
|
+
path: z.string().optional(),
|
|
1236
|
+
entries: z.array(z.object({
|
|
1237
|
+
symbol: z.string(),
|
|
1238
|
+
filePath: z.string(),
|
|
1239
|
+
kind: z.string(),
|
|
1240
|
+
score: z.number().nonnegative(),
|
|
1241
|
+
risk: z.enum(["low", "medium", "high"]),
|
|
1242
|
+
recommendation: z.enum(["refactor_freely", "refactor_with_tests", "plan_before_refactor"]),
|
|
1243
|
+
curvature: z.object({
|
|
1244
|
+
changeCount: z.number().int().nonnegative(),
|
|
1245
|
+
signatureChangeCount: z.number().int().nonnegative(),
|
|
1246
|
+
score: z.number().nonnegative(),
|
|
1247
|
+
}).strict(),
|
|
1248
|
+
friction: z.object({
|
|
1249
|
+
referenceCount: z.number().int().nonnegative(),
|
|
1250
|
+
referencingFiles: z.array(z.string()),
|
|
1251
|
+
score: z.number().nonnegative(),
|
|
1252
|
+
}).strict(),
|
|
1253
|
+
}).strict()),
|
|
1254
|
+
total: z.number().int().nonnegative(),
|
|
1255
|
+
summary: z.string(),
|
|
1256
|
+
}).strict(),
|
|
1257
|
+
graft_review: z.object({
|
|
1258
|
+
base: z.string(),
|
|
1259
|
+
head: z.string(),
|
|
1260
|
+
totalFiles: z.number().int().nonnegative(),
|
|
1261
|
+
categories: z.object({
|
|
1262
|
+
structural: z.number().int().nonnegative(),
|
|
1263
|
+
formatting: z.number().int().nonnegative(),
|
|
1264
|
+
test: z.number().int().nonnegative(),
|
|
1265
|
+
docs: z.number().int().nonnegative(),
|
|
1266
|
+
config: z.number().int().nonnegative(),
|
|
1267
|
+
}).strict(),
|
|
1268
|
+
files: z.array(z.object({
|
|
1269
|
+
path: z.string(),
|
|
1270
|
+
category: z.enum(["structural", "formatting", "test", "docs", "config"]),
|
|
1271
|
+
structuralChanges: z.object({
|
|
1272
|
+
added: z.number().int().nonnegative(),
|
|
1273
|
+
removed: z.number().int().nonnegative(),
|
|
1274
|
+
changed: z.number().int().nonnegative(),
|
|
1275
|
+
}).strict().optional(),
|
|
1276
|
+
}).strict()),
|
|
1277
|
+
breakingChanges: z.array(z.object({
|
|
1278
|
+
symbol: z.string(),
|
|
1279
|
+
kind: z.string(),
|
|
1280
|
+
filePath: z.string(),
|
|
1281
|
+
changeType: z.enum(["removed_export", "signature_changed", "type_changed"]),
|
|
1282
|
+
previousSignature: z.string().optional(),
|
|
1283
|
+
newSignature: z.string().optional(),
|
|
1284
|
+
impactedFiles: z.number().int().nonnegative(),
|
|
1285
|
+
impactedFilePaths: z.array(z.string()),
|
|
1286
|
+
}).strict()),
|
|
1287
|
+
summary: z.string(),
|
|
1288
|
+
}).strict(),
|
|
1289
|
+
knowledge_map: z.object({
|
|
1290
|
+
totalFiles: z.number().int().nonnegative(),
|
|
1291
|
+
totalSymbols: z.number().int().nonnegative(),
|
|
1292
|
+
files: z.array(z.object({
|
|
1293
|
+
path: z.string(),
|
|
1294
|
+
symbols: z.array(z.string()),
|
|
1295
|
+
readCount: z.number().int().positive(),
|
|
1296
|
+
lastReadAt: z.string(),
|
|
1297
|
+
stale: z.boolean(),
|
|
1298
|
+
}).strict()),
|
|
1299
|
+
staleFiles: z.array(z.string()),
|
|
1300
|
+
directoryCoverage: z.record(z.string(), z.number().int().nonnegative()),
|
|
1301
|
+
}).strict(),
|
|
1032
1302
|
};
|
|
1033
1303
|
|
|
1034
1304
|
export const MCP_OUTPUT_SCHEMAS: Record<McpToolName, z.ZodType> = {
|
|
1035
1305
|
safe_read: withMcpCommon("safe_read", mcpOutputBodySchemas.safe_read),
|
|
1306
|
+
graft_edit: withMcpCommon("graft_edit", mcpOutputBodySchemas.graft_edit),
|
|
1036
1307
|
file_outline: withMcpCommon("file_outline", mcpOutputBodySchemas.file_outline),
|
|
1037
1308
|
read_range: withMcpCommon("read_range", mcpOutputBodySchemas.read_range),
|
|
1038
1309
|
changed_since: withMcpCommon("changed_since", mcpOutputBodySchemas.changed_since),
|
|
@@ -1049,6 +1320,7 @@ export const MCP_OUTPUT_SCHEMAS: Record<McpToolName, z.ZodType> = {
|
|
|
1049
1320
|
monitor_start: withMcpCommon("monitor_start", mcpOutputBodySchemas.monitor_start),
|
|
1050
1321
|
monitor_pause: withMcpCommon("monitor_pause", mcpOutputBodySchemas.monitor_pause),
|
|
1051
1322
|
monitor_resume: withMcpCommon("monitor_resume", mcpOutputBodySchemas.monitor_resume),
|
|
1323
|
+
monitor_nudge: withMcpCommon("monitor_nudge", mcpOutputBodySchemas.monitor_nudge),
|
|
1052
1324
|
monitor_stop: withMcpCommon("monitor_stop", mcpOutputBodySchemas.monitor_stop),
|
|
1053
1325
|
workspace_authorize: withMcpCommon("workspace_authorize", mcpOutputBodySchemas.workspace_authorize),
|
|
1054
1326
|
workspace_authorizations: withMcpCommon(
|
|
@@ -1069,6 +1341,13 @@ export const MCP_OUTPUT_SCHEMAS: Record<McpToolName, z.ZodType> = {
|
|
|
1069
1341
|
explain: withMcpCommon("explain", mcpOutputBodySchemas.explain),
|
|
1070
1342
|
doctor: withMcpCommon("doctor", mcpOutputBodySchemas.doctor),
|
|
1071
1343
|
stats: withMcpCommon("stats", mcpOutputBodySchemas.stats),
|
|
1344
|
+
graft_churn: withMcpCommon("graft_churn", mcpOutputBodySchemas.graft_churn),
|
|
1345
|
+
graft_exports: withMcpCommon("graft_exports", mcpOutputBodySchemas.graft_exports),
|
|
1346
|
+
graft_log: withMcpCommon("graft_log", mcpOutputBodySchemas.graft_log),
|
|
1347
|
+
graft_blame: withMcpCommon("graft_blame", mcpOutputBodySchemas.graft_blame),
|
|
1348
|
+
graft_difficulty: withMcpCommon("graft_difficulty", mcpOutputBodySchemas.graft_difficulty),
|
|
1349
|
+
graft_review: withMcpCommon("graft_review", mcpOutputBodySchemas.graft_review),
|
|
1350
|
+
knowledge_map: withMcpCommon("knowledge_map", mcpOutputBodySchemas.knowledge_map),
|
|
1072
1351
|
};
|
|
1073
1352
|
|
|
1074
1353
|
const initActionSchema = z.object({
|
|
@@ -1100,7 +1379,16 @@ const suggestedMcpServerSchema = z.object({
|
|
|
1100
1379
|
mcpServers: z.object({
|
|
1101
1380
|
graft: z.object({
|
|
1102
1381
|
command: z.literal("npx"),
|
|
1103
|
-
args: z.
|
|
1382
|
+
args: z.union([
|
|
1383
|
+
z.tuple([z.literal("-y"), z.literal("@flyingrobots/graft"), z.literal("serve")]),
|
|
1384
|
+
z.tuple([
|
|
1385
|
+
z.literal("-y"),
|
|
1386
|
+
z.literal("@flyingrobots/graft"),
|
|
1387
|
+
z.literal("serve"),
|
|
1388
|
+
z.literal("--runtime"),
|
|
1389
|
+
z.literal("daemon"),
|
|
1390
|
+
]),
|
|
1391
|
+
]),
|
|
1104
1392
|
}).strict(),
|
|
1105
1393
|
}).strict(),
|
|
1106
1394
|
}).strict();
|
|
@@ -1117,9 +1405,8 @@ export const CLI_OUTPUT_SCHEMAS: Record<CliCommandName, z.ZodType> = {
|
|
|
1117
1405
|
index: withCliCommon("index", z.object({
|
|
1118
1406
|
ok: z.boolean(),
|
|
1119
1407
|
cwd: z.string(),
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
patchesWritten: z.number().int().nonnegative().optional(),
|
|
1408
|
+
filesIndexed: z.number().int().nonnegative().optional(),
|
|
1409
|
+
nodesEmitted: z.number().int().nonnegative().optional(),
|
|
1123
1410
|
error: z.string().optional(),
|
|
1124
1411
|
}).strict()),
|
|
1125
1412
|
read_safe: withCliPeerCommon("read_safe", mcpOutputBodySchemas.safe_read),
|
|
@@ -1131,6 +1418,12 @@ export const CLI_OUTPUT_SCHEMAS: Record<CliCommandName, z.ZodType> = {
|
|
|
1131
1418
|
struct_map: withCliPeerCommon("struct_map", mcpOutputBodySchemas.graft_map),
|
|
1132
1419
|
symbol_show: withCliPeerCommon("symbol_show", mcpOutputBodySchemas.code_show),
|
|
1133
1420
|
symbol_find: withCliPeerCommon("symbol_find", mcpOutputBodySchemas.code_find),
|
|
1421
|
+
struct_churn: withCliPeerCommon("struct_churn", mcpOutputBodySchemas.graft_churn),
|
|
1422
|
+
struct_exports: withCliPeerCommon("struct_exports", mcpOutputBodySchemas.graft_exports),
|
|
1423
|
+
struct_log: withCliPeerCommon("struct_log", mcpOutputBodySchemas.graft_log),
|
|
1424
|
+
symbol_blame: withCliPeerCommon("symbol_blame", mcpOutputBodySchemas.graft_blame),
|
|
1425
|
+
symbol_difficulty: withCliPeerCommon("symbol_difficulty", mcpOutputBodySchemas.graft_difficulty),
|
|
1426
|
+
struct_review: withCliPeerCommon("struct_review", mcpOutputBodySchemas.graft_review),
|
|
1134
1427
|
diag_doctor: withCliPeerCommon("diag_doctor", mcpOutputBodySchemas.doctor),
|
|
1135
1428
|
diag_activity: withCliPeerCommon("diag_activity", mcpOutputBodySchemas.activity_view),
|
|
1136
1429
|
diag_explain: withCliPeerCommon("diag_explain", mcpOutputBodySchemas.explain),
|
|
@@ -1167,6 +1460,7 @@ export const CLI_OUTPUT_SCHEMAS: Record<CliCommandName, z.ZodType> = {
|
|
|
1167
1460
|
edges: z.array(z.record(z.string(), z.unknown())),
|
|
1168
1461
|
error: z.string().optional(),
|
|
1169
1462
|
}).strict()),
|
|
1463
|
+
git_graft_enhance: withCliCommon("git_graft_enhance", gitGraftEnhanceBodySchema),
|
|
1170
1464
|
};
|
|
1171
1465
|
|
|
1172
1466
|
export function getMcpOutputSchemaMeta(tool: McpToolName): OutputSchemaMeta {
|
package/src/git/diff.ts
CHANGED
|
@@ -48,6 +48,67 @@ async function objectExists(ref: string, filePath: string, cwd: string, gitClien
|
|
|
48
48
|
* Throws GitError for invalid refs or non-git directories.
|
|
49
49
|
* Returns empty array only when there are genuinely no changes.
|
|
50
50
|
*/
|
|
51
|
+
|
|
52
|
+
export type ChangedFileStatus = "added" | "modified" | "deleted" | "renamed";
|
|
53
|
+
|
|
54
|
+
export interface ChangedFile {
|
|
55
|
+
readonly path: string;
|
|
56
|
+
readonly status: ChangedFileStatus;
|
|
57
|
+
readonly oldPath?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const STATUS_MAP: Record<string, ChangedFileStatus> = {
|
|
61
|
+
A: "added",
|
|
62
|
+
M: "modified",
|
|
63
|
+
D: "deleted",
|
|
64
|
+
R: "renamed",
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
function parseNameStatus(output: string): ChangedFile[] {
|
|
68
|
+
if (output === "") return [];
|
|
69
|
+
const lines = output.split("\n");
|
|
70
|
+
const result: ChangedFile[] = [];
|
|
71
|
+
for (const line of lines) {
|
|
72
|
+
const statusCode = line[0];
|
|
73
|
+
if (statusCode === undefined) continue;
|
|
74
|
+
const baseStatus = statusCode === "R" || statusCode === "C" ? statusCode : statusCode;
|
|
75
|
+
const status = STATUS_MAP[baseStatus] ?? "modified";
|
|
76
|
+
const parts = line.split("\t");
|
|
77
|
+
if (statusCode === "R" || statusCode === "C") {
|
|
78
|
+
const oldPath = parts[1];
|
|
79
|
+
const newPath = parts[2];
|
|
80
|
+
if (oldPath !== undefined && newPath !== undefined) {
|
|
81
|
+
result.push({ path: newPath, status, oldPath });
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
const filePath = parts[1];
|
|
85
|
+
if (filePath !== undefined) {
|
|
86
|
+
result.push({ path: filePath, status });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* List files changed between two refs with rename detection.
|
|
95
|
+
* Returns structured data including status and old path for renames.
|
|
96
|
+
*/
|
|
97
|
+
export async function getChangedFilesWithStatus(opts: ChangedFilesOptions): Promise<ChangedFile[]> {
|
|
98
|
+
const base = opts.base ?? "HEAD";
|
|
99
|
+
const args = opts.head !== undefined
|
|
100
|
+
? ["diff-tree", "--no-commit-id", "--name-status", "-M", "-r", base, opts.head]
|
|
101
|
+
: ["diff-index", "--name-status", "-M", base, "--"];
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
const output = (await git(opts.git, args, opts.cwd)).trim();
|
|
105
|
+
return parseNameStatus(output);
|
|
106
|
+
} catch (err: unknown) {
|
|
107
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
108
|
+
throw new GitError(`git diff failed: ${msg}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
51
112
|
export async function getChangedFiles(opts: ChangedFilesOptions): Promise<string[]> {
|
|
52
113
|
const base = opts.base ?? "HEAD";
|
|
53
114
|
const args = opts.head !== undefined
|
package/src/mcp/burden.ts
CHANGED
|
@@ -15,6 +15,7 @@ const ZERO_BUCKET: BurdenBucket = Object.freeze({ calls: 0, bytesReturned: 0 });
|
|
|
15
15
|
|
|
16
16
|
const TOOL_BURDEN_KIND: Record<McpToolName, BurdenKind> = {
|
|
17
17
|
safe_read: "read",
|
|
18
|
+
graft_edit: "state",
|
|
18
19
|
file_outline: "read",
|
|
19
20
|
read_range: "read",
|
|
20
21
|
changed_since: "read",
|
|
@@ -31,6 +32,7 @@ const TOOL_BURDEN_KIND: Record<McpToolName, BurdenKind> = {
|
|
|
31
32
|
monitor_start: "diagnostic",
|
|
32
33
|
monitor_pause: "diagnostic",
|
|
33
34
|
monitor_resume: "diagnostic",
|
|
35
|
+
monitor_nudge: "diagnostic",
|
|
34
36
|
monitor_stop: "diagnostic",
|
|
35
37
|
workspace_authorize: "diagnostic",
|
|
36
38
|
workspace_authorizations: "diagnostic",
|
|
@@ -48,6 +50,13 @@ const TOOL_BURDEN_KIND: Record<McpToolName, BurdenKind> = {
|
|
|
48
50
|
explain: "diagnostic",
|
|
49
51
|
doctor: "diagnostic",
|
|
50
52
|
stats: "diagnostic",
|
|
53
|
+
graft_churn: "search",
|
|
54
|
+
graft_exports: "search",
|
|
55
|
+
graft_log: "search",
|
|
56
|
+
graft_blame: "search",
|
|
57
|
+
graft_difficulty: "search",
|
|
58
|
+
graft_review: "search",
|
|
59
|
+
knowledge_map: "diagnostic",
|
|
51
60
|
};
|
|
52
61
|
|
|
53
62
|
export function emptyBurdenByKind(): BurdenByKind {
|
package/src/mcp/context.ts
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// ToolContext — shared dependencies injected into every tool handler
|
|
3
3
|
// ---------------------------------------------------------------------------
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import * as path from "node:path";
|
|
5
|
+
import { createRepoPathResolver } from "../adapters/repo-paths.js";
|
|
7
6
|
import type { ObservationCache } from "./cache.js";
|
|
8
7
|
import type { Metrics } from "./metrics.js";
|
|
9
8
|
import type { GovernorTracker } from "../session/tracker.js";
|
|
@@ -12,7 +11,7 @@ import type { FileSystem } from "../ports/filesystem.js";
|
|
|
12
11
|
import type { JsonCodec } from "../ports/codec.js";
|
|
13
12
|
import type { ProcessRunner } from "../ports/process-runner.js";
|
|
14
13
|
import type { GitClient } from "../ports/git.js";
|
|
15
|
-
import type {
|
|
14
|
+
import type { WarpContext } from "../warp/context.js";
|
|
16
15
|
import type { RepoObservation } from "./repo-state.js";
|
|
17
16
|
import type { RunCaptureConfig } from "./run-capture-config.js";
|
|
18
17
|
import type { RuntimeObservabilityState, ToolCallFootprintRegion } from "./runtime-observability.js";
|
|
@@ -81,7 +80,7 @@ export interface ToolContext {
|
|
|
81
80
|
readonly regions?: readonly ToolCallFootprintRegion[];
|
|
82
81
|
}): void;
|
|
83
82
|
resolvePath(relative: string): string;
|
|
84
|
-
getWarp(): Promise<
|
|
83
|
+
getWarp(): Promise<WarpContext>;
|
|
85
84
|
getRepoState(): RepoObservation;
|
|
86
85
|
getCausalContext(): RuntimeCausalContext;
|
|
87
86
|
getWorkspaceOverlayFooting(): Promise<RuntimeWorkspaceOverlayFooting | null>;
|
|
@@ -100,6 +99,7 @@ export interface ToolContext {
|
|
|
100
99
|
pauseMonitor(request: WorkspaceBindRequest): Promise<MonitorActionResult>;
|
|
101
100
|
resumeMonitor(request: WorkspaceBindRequest): Promise<MonitorActionResult>;
|
|
102
101
|
stopMonitor(request: WorkspaceBindRequest): Promise<MonitorActionResult>;
|
|
102
|
+
nudgeMonitor(request: WorkspaceBindRequest): Promise<MonitorActionResult>;
|
|
103
103
|
listWorkspaceAuthorizations(): Promise<readonly AuthorizedWorkspaceView[]>;
|
|
104
104
|
authorizeWorkspace(request: WorkspaceAuthorizeRequest): Promise<WorkspaceAuthorizeResult>;
|
|
105
105
|
revokeWorkspace(request: WorkspaceBindRequest): Promise<WorkspaceRevokeResult>;
|
|
@@ -111,44 +111,7 @@ export interface ToolContext {
|
|
|
111
111
|
* Symlinks are resolved before the confinement check to prevent escapes.
|
|
112
112
|
*/
|
|
113
113
|
export function createPathResolver(projectRoot: string): (input: string) => string {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// Resolve the project root itself through symlinks for consistent comparison
|
|
117
|
-
let realProjectRoot: string;
|
|
118
|
-
try {
|
|
119
|
-
realProjectRoot = fs.realpathSync(normalizedRoot);
|
|
120
|
-
} catch {
|
|
121
|
-
realProjectRoot = normalizedRoot;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return (input: string): string => {
|
|
125
|
-
// Resolve: absolute paths are taken as-is, relative paths join to projectRoot
|
|
126
|
-
const resolved = path.isAbsolute(input)
|
|
127
|
-
? path.resolve(input)
|
|
128
|
-
: path.resolve(normalizedRoot, input);
|
|
129
|
-
|
|
130
|
-
// Logical confinement check (catches ".." traversal without needing fs access)
|
|
131
|
-
const logicalRel = path.relative(normalizedRoot, resolved);
|
|
132
|
-
if (logicalRel.startsWith("..") || path.isAbsolute(logicalRel)) {
|
|
133
|
-
throw new Error(`Path traversal blocked: ${input}`);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Resolve symlinks before a second confinement check to prevent symlink escapes
|
|
137
|
-
let real: string;
|
|
138
|
-
try {
|
|
139
|
-
real = fs.realpathSync(resolved);
|
|
140
|
-
} catch {
|
|
141
|
-
// Target doesn't exist yet — return the logical path (already passed confinement)
|
|
142
|
-
return resolved;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Symlink confinement check: the real path must be within the real project root
|
|
146
|
-
const realRel = path.relative(realProjectRoot, real);
|
|
147
|
-
if (realRel.startsWith("..") || path.isAbsolute(realRel)) {
|
|
148
|
-
throw new Error(`Path traversal blocked: ${input}`);
|
|
149
|
-
}
|
|
150
|
-
return resolved;
|
|
151
|
-
};
|
|
114
|
+
return createRepoPathResolver(projectRoot);
|
|
152
115
|
}
|
|
153
116
|
|
|
154
117
|
/**
|
package/src/mcp/daemon-server.ts
CHANGED
|
@@ -34,6 +34,8 @@ export interface StartDaemonServerOptions {
|
|
|
34
34
|
readonly env?: Readonly<Record<string, string | undefined>> | undefined;
|
|
35
35
|
readonly runCapture?: Partial<RunCaptureConfig> | undefined;
|
|
36
36
|
readonly runtimeObservability?: Partial<RuntimeObservabilityState> | undefined;
|
|
37
|
+
readonly workerPoolSize?: number | undefined;
|
|
38
|
+
readonly persistedLocalHistoryGraph?: boolean | undefined;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export interface GraftDaemonServer {
|
|
@@ -55,7 +57,9 @@ export async function startDaemonServer(options: StartDaemonServerOptions = {}):
|
|
|
55
57
|
graftDir,
|
|
56
58
|
});
|
|
57
59
|
const daemonScheduler = new DaemonJobScheduler();
|
|
58
|
-
const daemonWorkerPool = new ChildProcessDaemonWorkerPool(
|
|
60
|
+
const daemonWorkerPool = new ChildProcessDaemonWorkerPool({
|
|
61
|
+
...(options.workerPoolSize !== undefined ? { size: options.workerPoolSize } : {}),
|
|
62
|
+
});
|
|
59
63
|
const monitorRuntime = new PersistentMonitorRuntime({
|
|
60
64
|
fs: nodeFs,
|
|
61
65
|
codec: new CanonicalJsonCodec(),
|
|
@@ -103,6 +107,9 @@ export async function startDaemonServer(options: StartDaemonServerOptions = {}):
|
|
|
103
107
|
...(options.runtimeObservability !== undefined
|
|
104
108
|
? { runtimeObservability: options.runtimeObservability }
|
|
105
109
|
: {}),
|
|
110
|
+
...(options.persistedLocalHistoryGraph !== undefined
|
|
111
|
+
? { persistedLocalHistoryGraph: options.persistedLocalHistoryGraph }
|
|
112
|
+
: {}),
|
|
106
113
|
});
|
|
107
114
|
|
|
108
115
|
const httpServer = http.createServer((req, res) => {
|
|
@@ -40,6 +40,7 @@ export interface CreateDaemonSessionHostOptions {
|
|
|
40
40
|
readonly env?: Readonly<Record<string, string | undefined>> | undefined;
|
|
41
41
|
readonly runCapture?: Partial<RunCaptureConfig> | undefined;
|
|
42
42
|
readonly runtimeObservability?: Partial<RuntimeObservabilityState> | undefined;
|
|
43
|
+
readonly persistedLocalHistoryGraph?: boolean | undefined;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export interface DaemonSessionHost {
|
|
@@ -125,6 +126,9 @@ async function createDaemonSession(
|
|
|
125
126
|
...(options.runtimeObservability !== undefined
|
|
126
127
|
? { runtimeObservability: options.runtimeObservability }
|
|
127
128
|
: {}),
|
|
129
|
+
...(options.persistedLocalHistoryGraph !== undefined
|
|
130
|
+
? { persistedLocalHistoryGraph: options.persistedLocalHistoryGraph }
|
|
131
|
+
: {}),
|
|
128
132
|
});
|
|
129
133
|
const session: DaemonSession = {
|
|
130
134
|
id: newSessionId,
|
|
@@ -176,6 +176,7 @@ function internalErrorResponse(
|
|
|
176
176
|
|
|
177
177
|
export interface StartDaemonBackedStdioBridgeOptions {
|
|
178
178
|
socketPath?: string;
|
|
179
|
+
spawnIfMissing?: boolean;
|
|
179
180
|
ensureReady?: ((options?: EnsureDaemonReadyOptions) => Promise<string>) | undefined;
|
|
180
181
|
}
|
|
181
182
|
|
|
@@ -184,6 +185,7 @@ export async function startDaemonBackedStdioBridge(
|
|
|
184
185
|
): Promise<void> {
|
|
185
186
|
const socketPath = await (options.ensureReady ?? ensureDaemonReady)({
|
|
186
187
|
...(options.socketPath !== undefined ? { socketPath: options.socketPath } : {}),
|
|
188
|
+
...(options.spawnIfMissing !== undefined ? { spawnIfMissing: options.spawnIfMissing } : {}),
|
|
187
189
|
});
|
|
188
190
|
const stdioTransport = new StdioServerTransport();
|
|
189
191
|
const daemonTransport = new StreamableHTTPClientTransport(
|