@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
package/src/cli/cli-error.ts
CHANGED
|
@@ -39,29 +39,50 @@ export function describeCliFailure(argv: readonly string[]): CliErrorDetails {
|
|
|
39
39
|
|
|
40
40
|
if (group === "serve") {
|
|
41
41
|
return {
|
|
42
|
-
usage: "graft serve",
|
|
43
|
-
nextSteps: [
|
|
42
|
+
usage: "graft serve [--runtime <repo-local|daemon>] [--socket <path>] [--no-autostart]",
|
|
43
|
+
nextSteps: [
|
|
44
|
+
"`graft serve` is repo-local stdio. Use `graft serve --runtime daemon` for the daemon-backed stdio bridge.",
|
|
45
|
+
],
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
if (group === "daemon") {
|
|
50
|
+
if (subcommand === "status") {
|
|
51
|
+
return {
|
|
52
|
+
usage: "graft daemon status [--socket <path>]",
|
|
53
|
+
nextSteps: ["Start the daemon with `graft daemon` or target another daemon with `--socket <path>`."],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
48
56
|
return {
|
|
49
|
-
usage: "graft daemon [--socket <path>]",
|
|
50
|
-
nextSteps: ["Run `graft
|
|
57
|
+
usage: "graft daemon [--socket <path>] | graft daemon status [--socket <path>]",
|
|
58
|
+
nextSteps: ["Run `graft daemon status` to inspect an already-running daemon without mutating daemon state."],
|
|
51
59
|
};
|
|
52
60
|
}
|
|
53
61
|
|
|
62
|
+
if (group === "doctor") {
|
|
63
|
+
return { usage: "graft doctor [--sludge] [--path <path>] [--json]" };
|
|
64
|
+
}
|
|
65
|
+
|
|
54
66
|
if (group === "index") {
|
|
55
67
|
return {
|
|
56
|
-
usage: "graft index [<
|
|
57
|
-
nextSteps: ["Use `--json` for machine-readable output."],
|
|
68
|
+
usage: "graft index [--path <path>] [--json]",
|
|
69
|
+
nextSteps: ["Use `--path <path>` for lazy per-file indexing and `--json` for machine-readable output."],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (group === "enhance") {
|
|
74
|
+
return {
|
|
75
|
+
usage: "git-graft enhance --since <ref> [--head <ref>] [--json]",
|
|
76
|
+
nextSteps: [
|
|
77
|
+
"Use `git graft enhance --since <ref>` after package install, or `git-graft enhance --since <ref>` via the direct binary.",
|
|
78
|
+
],
|
|
58
79
|
};
|
|
59
80
|
}
|
|
60
81
|
|
|
61
82
|
if (group === "init") {
|
|
62
83
|
return {
|
|
63
84
|
usage:
|
|
64
|
-
"graft init [--json] [--write-claude-mcp] [--write-claude-hooks] "
|
|
85
|
+
"graft init [--json] [--mcp-runtime <repo-local|daemon>] [--write-claude-mcp] [--write-claude-hooks] "
|
|
65
86
|
+ "[--write-target-git-hooks] [--write-codex-mcp] [--write-cursor-mcp] "
|
|
66
87
|
+ "[--write-windsurf-mcp] [--write-continue-mcp] [--write-cline-mcp]",
|
|
67
88
|
nextSteps: ["Run `graft help` to confirm the repo-local bootstrap surfaces."],
|
|
@@ -97,8 +118,20 @@ export function describeCliFailure(argv: readonly string[]): CliErrorDetails {
|
|
|
97
118
|
if (subcommand === "map") {
|
|
98
119
|
return { usage: "graft struct map [<directory>] [--json]" };
|
|
99
120
|
}
|
|
121
|
+
if (subcommand === "churn") {
|
|
122
|
+
return { usage: "graft struct churn [--path <path>] [--limit <n>] [--json]" };
|
|
123
|
+
}
|
|
124
|
+
if (subcommand === "exports") {
|
|
125
|
+
return { usage: "graft struct exports [<base-ref> <head-ref>] [--json]" };
|
|
126
|
+
}
|
|
127
|
+
if (subcommand === "log") {
|
|
128
|
+
return { usage: "graft struct log [--path <path>] [--limit <n>] [--json]" };
|
|
129
|
+
}
|
|
130
|
+
if (subcommand === "review") {
|
|
131
|
+
return { usage: "graft struct review [--base <ref>] [--head <ref>] [--json]" };
|
|
132
|
+
}
|
|
100
133
|
return {
|
|
101
|
-
usage: "graft struct <diff|since|map> ...",
|
|
134
|
+
usage: "graft struct <diff|since|map|churn|exports|log|review> ...",
|
|
102
135
|
nextSteps: ["Run `graft help` to see the available structural subcommands."],
|
|
103
136
|
};
|
|
104
137
|
}
|
|
@@ -110,8 +143,14 @@ export function describeCliFailure(argv: readonly string[]): CliErrorDetails {
|
|
|
110
143
|
if (subcommand === "show") {
|
|
111
144
|
return { usage: "graft symbol show <symbol> [--path <path>] [--ref <ref>] [--json]" };
|
|
112
145
|
}
|
|
146
|
+
if (subcommand === "blame") {
|
|
147
|
+
return { usage: "graft symbol blame <symbol> [--path <path>] [--json]" };
|
|
148
|
+
}
|
|
149
|
+
if (subcommand === "difficulty") {
|
|
150
|
+
return { usage: "graft symbol difficulty <symbol> [--path <path>] [--limit <n>] [--json]" };
|
|
151
|
+
}
|
|
113
152
|
return {
|
|
114
|
-
usage: "graft symbol <find|show> ...",
|
|
153
|
+
usage: "graft symbol <find|show|blame|difficulty> ...",
|
|
115
154
|
nextSteps: ["Run `graft help` to see the available symbol subcommands."],
|
|
116
155
|
};
|
|
117
156
|
}
|
|
@@ -130,7 +169,7 @@ export function describeCliFailure(argv: readonly string[]): CliErrorDetails {
|
|
|
130
169
|
return { usage: "graft diag local-history-dag [--limit <n>] [--json]" };
|
|
131
170
|
}
|
|
132
171
|
if (subcommand === "doctor") {
|
|
133
|
-
return { usage: "graft diag doctor [--json]" };
|
|
172
|
+
return { usage: "graft diag doctor [--sludge] [--path <path>] [--json]" };
|
|
134
173
|
}
|
|
135
174
|
if (subcommand === "explain") {
|
|
136
175
|
return { usage: "graft diag explain <reason-code> [--json]" };
|
|
@@ -12,6 +12,19 @@ export interface ParsedCommand {
|
|
|
12
12
|
args: Record<string, unknown>;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export type ServeRuntime = "repo-local" | "daemon";
|
|
16
|
+
|
|
17
|
+
export interface ParsedServeCommand {
|
|
18
|
+
readonly runtime: ServeRuntime;
|
|
19
|
+
readonly socketPath?: string | undefined;
|
|
20
|
+
readonly spawnIfMissing?: boolean | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ParsedDaemonCommand {
|
|
24
|
+
readonly action: "start" | "status";
|
|
25
|
+
readonly socketPath?: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
15
28
|
export function resolveEntrypointArgs(
|
|
16
29
|
args: readonly string[],
|
|
17
30
|
stdinIsTTY: boolean | undefined,
|
|
@@ -65,10 +78,50 @@ function parsePositiveInt(raw: string | undefined, flag: string): number {
|
|
|
65
78
|
return value;
|
|
66
79
|
}
|
|
67
80
|
|
|
68
|
-
export function parseDaemonCommand(cwd: string, argv: string[]):
|
|
81
|
+
export function parseDaemonCommand(cwd: string, argv: string[]): ParsedDaemonCommand {
|
|
82
|
+
const action = argv[0] === "status" ? "status" : "start";
|
|
83
|
+
if (action === "status") {
|
|
84
|
+
argv.shift();
|
|
85
|
+
}
|
|
69
86
|
const socketPath = consumeOption(argv, "--socket");
|
|
70
87
|
expectNoArgs(argv);
|
|
71
|
-
return
|
|
88
|
+
return {
|
|
89
|
+
action,
|
|
90
|
+
...(socketPath !== undefined ? { socketPath: path.resolve(cwd, socketPath) } : {}),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function parseServeRuntime(raw: string | undefined): ServeRuntime {
|
|
95
|
+
if (raw === undefined || raw === "repo-local") {
|
|
96
|
+
return "repo-local";
|
|
97
|
+
}
|
|
98
|
+
if (raw === "daemon") {
|
|
99
|
+
return "daemon";
|
|
100
|
+
}
|
|
101
|
+
throw new Error(`--runtime must be repo-local or daemon, got ${raw}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function parseServeCommand(cwd: string, argv: string[]): ParsedServeCommand {
|
|
105
|
+
const runtime = parseServeRuntime(consumeOption(argv, "--runtime"));
|
|
106
|
+
const socketPath = consumeOption(argv, "--socket");
|
|
107
|
+
const noAutostart = consumeFlag(argv, "--no-autostart");
|
|
108
|
+
expectNoArgs(argv);
|
|
109
|
+
|
|
110
|
+
if (runtime === "repo-local") {
|
|
111
|
+
if (socketPath !== undefined) {
|
|
112
|
+
throw new Error("--socket requires --runtime daemon");
|
|
113
|
+
}
|
|
114
|
+
if (noAutostart) {
|
|
115
|
+
throw new Error("--no-autostart requires --runtime daemon");
|
|
116
|
+
}
|
|
117
|
+
return { runtime };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
runtime,
|
|
122
|
+
...(socketPath !== undefined ? { socketPath: path.resolve(cwd, socketPath) } : {}),
|
|
123
|
+
...(noAutostart ? { spawnIfMissing: false } : {}),
|
|
124
|
+
};
|
|
72
125
|
}
|
|
73
126
|
|
|
74
127
|
export function parseGlobalOptions(
|
|
@@ -161,6 +214,62 @@ function parseStructCommand(argv: string[]): ParsedCommand {
|
|
|
161
214
|
};
|
|
162
215
|
}
|
|
163
216
|
|
|
217
|
+
if (subcommand === "churn") {
|
|
218
|
+
const filePath = consumeOption(argv, "--path");
|
|
219
|
+
const limitRaw = consumeOption(argv, "--limit");
|
|
220
|
+
expectNoArgs(argv);
|
|
221
|
+
return {
|
|
222
|
+
command: "struct_churn",
|
|
223
|
+
json,
|
|
224
|
+
args: {
|
|
225
|
+
...(filePath !== undefined ? { path: filePath } : {}),
|
|
226
|
+
...(limitRaw !== undefined ? { limit: parsePositiveInt(limitRaw, "--limit") } : {}),
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (subcommand === "exports") {
|
|
232
|
+
const base = argv[0]?.startsWith("--") === false ? consumePositional(argv, "base ref") : undefined;
|
|
233
|
+
const head = argv[0]?.startsWith("--") === false ? consumePositional(argv, "head ref") : undefined;
|
|
234
|
+
expectNoArgs(argv);
|
|
235
|
+
return {
|
|
236
|
+
command: "struct_exports",
|
|
237
|
+
json,
|
|
238
|
+
args: {
|
|
239
|
+
...(base !== undefined ? { base } : {}),
|
|
240
|
+
...(head !== undefined ? { head } : {}),
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (subcommand === "log") {
|
|
246
|
+
const filePath = consumeOption(argv, "--path");
|
|
247
|
+
const limitRaw = consumeOption(argv, "--limit");
|
|
248
|
+
expectNoArgs(argv);
|
|
249
|
+
return {
|
|
250
|
+
command: "struct_log",
|
|
251
|
+
json,
|
|
252
|
+
args: {
|
|
253
|
+
...(filePath !== undefined ? { path: filePath } : {}),
|
|
254
|
+
...(limitRaw !== undefined ? { limit: parsePositiveInt(limitRaw, "--limit") } : {}),
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (subcommand === "review") {
|
|
260
|
+
const base = consumeOption(argv, "--base");
|
|
261
|
+
const head = consumeOption(argv, "--head");
|
|
262
|
+
expectNoArgs(argv);
|
|
263
|
+
return {
|
|
264
|
+
command: "struct_review",
|
|
265
|
+
json,
|
|
266
|
+
args: {
|
|
267
|
+
...(base !== undefined ? { base } : {}),
|
|
268
|
+
...(head !== undefined ? { head } : {}),
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
164
273
|
throw new Error(`Unknown struct subcommand: ${subcommand}`);
|
|
165
274
|
}
|
|
166
275
|
|
|
@@ -200,6 +309,36 @@ function parseSymbolCommand(argv: string[]): ParsedCommand {
|
|
|
200
309
|
};
|
|
201
310
|
}
|
|
202
311
|
|
|
312
|
+
if (subcommand === "blame") {
|
|
313
|
+
const symbol = consumePositional(argv, "symbol");
|
|
314
|
+
const filePath = consumeOption(argv, "--path");
|
|
315
|
+
expectNoArgs(argv);
|
|
316
|
+
return {
|
|
317
|
+
command: "symbol_blame",
|
|
318
|
+
json,
|
|
319
|
+
args: {
|
|
320
|
+
symbol,
|
|
321
|
+
...(filePath !== undefined ? { path: filePath } : {}),
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (subcommand === "difficulty") {
|
|
327
|
+
const symbol = consumePositional(argv, "symbol");
|
|
328
|
+
const filePath = consumeOption(argv, "--path");
|
|
329
|
+
const limitRaw = consumeOption(argv, "--limit");
|
|
330
|
+
expectNoArgs(argv);
|
|
331
|
+
return {
|
|
332
|
+
command: "symbol_difficulty",
|
|
333
|
+
json,
|
|
334
|
+
args: {
|
|
335
|
+
symbol,
|
|
336
|
+
...(filePath !== undefined ? { path: filePath } : {}),
|
|
337
|
+
...(limitRaw !== undefined ? { limit: parsePositiveInt(limitRaw, "--limit") } : {}),
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
203
342
|
throw new Error(`Unknown symbol subcommand: ${subcommand}`);
|
|
204
343
|
}
|
|
205
344
|
|
|
@@ -224,8 +363,17 @@ function parseDiagCommand(argv: string[]): ParsedCommand {
|
|
|
224
363
|
const json = consumeFlag(argv, "--json");
|
|
225
364
|
|
|
226
365
|
if (subcommand === "doctor") {
|
|
366
|
+
const sludge = consumeFlag(argv, "--sludge");
|
|
367
|
+
const filePath = consumeOption(argv, "--path");
|
|
227
368
|
expectNoArgs(argv);
|
|
228
|
-
return {
|
|
369
|
+
return {
|
|
370
|
+
command: "diag_doctor",
|
|
371
|
+
json,
|
|
372
|
+
args: {
|
|
373
|
+
...(sludge ? { sludge } : {}),
|
|
374
|
+
...(filePath !== undefined ? { path: filePath } : {}),
|
|
375
|
+
},
|
|
376
|
+
};
|
|
229
377
|
}
|
|
230
378
|
|
|
231
379
|
if (subcommand === "activity") {
|
|
@@ -289,14 +437,48 @@ function parseDiagCommand(argv: string[]): ParsedCommand {
|
|
|
289
437
|
throw new Error(`Unknown diag subcommand: ${subcommand}`);
|
|
290
438
|
}
|
|
291
439
|
|
|
440
|
+
function parseEnhanceCommand(argv: string[]): ParsedCommand {
|
|
441
|
+
const json = consumeFlag(argv, "--json");
|
|
442
|
+
const since = consumeOption(argv, "--since");
|
|
443
|
+
const head = consumeOption(argv, "--head");
|
|
444
|
+
if (since === undefined) {
|
|
445
|
+
expectNoArgs(argv);
|
|
446
|
+
throw new Error("Missing --since");
|
|
447
|
+
}
|
|
448
|
+
expectNoArgs(argv);
|
|
449
|
+
return {
|
|
450
|
+
command: "git_graft_enhance",
|
|
451
|
+
json,
|
|
452
|
+
args: {
|
|
453
|
+
since,
|
|
454
|
+
...(head !== undefined ? { head } : {}),
|
|
455
|
+
},
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
292
459
|
export function parseCommand(argv: string[]): ParsedCommand {
|
|
293
460
|
const group = consumePositional(argv, "command");
|
|
294
461
|
|
|
462
|
+
if (group === "doctor") {
|
|
463
|
+
const json = consumeFlag(argv, "--json");
|
|
464
|
+
const sludge = consumeFlag(argv, "--sludge");
|
|
465
|
+
const filePath = consumeOption(argv, "--path");
|
|
466
|
+
expectNoArgs(argv);
|
|
467
|
+
return {
|
|
468
|
+
command: "diag_doctor",
|
|
469
|
+
json,
|
|
470
|
+
args: {
|
|
471
|
+
...(sludge ? { sludge } : {}),
|
|
472
|
+
...(filePath !== undefined ? { path: filePath } : {}),
|
|
473
|
+
},
|
|
474
|
+
};
|
|
475
|
+
}
|
|
295
476
|
if (group === "read") return parseReadCommand(argv);
|
|
296
477
|
if (group === "struct") return parseStructCommand(argv);
|
|
297
478
|
if (group === "symbol") return parseSymbolCommand(argv);
|
|
298
479
|
if (group === "migrate") return parseMigrateCommand(argv);
|
|
299
480
|
if (group === "diag") return parseDiagCommand(argv);
|
|
481
|
+
if (group === "enhance") return parseEnhanceCommand(argv);
|
|
300
482
|
|
|
301
483
|
throw new Error(`Unknown command: ${group}`);
|
|
302
484
|
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import { type z } from "zod";
|
|
3
|
+
import { mcpOutputBodySchemas } from "../contracts/output-schema-mcp.js";
|
|
4
|
+
|
|
5
|
+
export type DaemonStatusPayload = z.output<typeof mcpOutputBodySchemas.daemon_status>;
|
|
6
|
+
export type DaemonSessionsPayload = z.output<typeof mcpOutputBodySchemas.daemon_sessions>;
|
|
7
|
+
export type DaemonReposPayload = z.output<typeof mcpOutputBodySchemas.daemon_repos>;
|
|
8
|
+
export type DaemonMonitorsPayload = z.output<typeof mcpOutputBodySchemas.daemon_monitors>;
|
|
9
|
+
export type WorkspaceStatusPayload = z.output<typeof mcpOutputBodySchemas.workspace_status>;
|
|
10
|
+
export type WorkspaceAuthorizationsPayload = z.output<typeof mcpOutputBodySchemas.workspace_authorizations>;
|
|
11
|
+
|
|
12
|
+
export interface DaemonStatusReadSnapshot {
|
|
13
|
+
readonly status: DaemonStatusPayload;
|
|
14
|
+
readonly sessions?: DaemonSessionsPayload | undefined;
|
|
15
|
+
readonly currentRepo?: DaemonReposPayload | undefined;
|
|
16
|
+
readonly monitors?: DaemonMonitorsPayload | undefined;
|
|
17
|
+
readonly workspaceStatus?: WorkspaceStatusPayload | undefined;
|
|
18
|
+
readonly authorizations?: WorkspaceAuthorizationsPayload | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type UnknownCount = number | "unknown";
|
|
22
|
+
export type DaemonHealth = "ok" | "degraded";
|
|
23
|
+
export type DaemonCurrentAuthorization = "authorized" | "not_authorized" | "unknown";
|
|
24
|
+
export type DaemonCurrentBindState = "bound" | "unbound" | "unknown";
|
|
25
|
+
export type DaemonSchedulerPressure = "idle" | "running" | "queued" | "saturated";
|
|
26
|
+
export type DaemonWorkerPressure = "idle" | "busy" | "saturated" | "unknown";
|
|
27
|
+
|
|
28
|
+
export interface DaemonStatusModel {
|
|
29
|
+
readonly command: "daemon_status";
|
|
30
|
+
readonly cwd: string;
|
|
31
|
+
readonly daemon: {
|
|
32
|
+
readonly health: DaemonHealth;
|
|
33
|
+
readonly transport: DaemonStatusPayload["transport"];
|
|
34
|
+
readonly socketPath: string;
|
|
35
|
+
readonly mcpPath: string;
|
|
36
|
+
readonly healthPath: string;
|
|
37
|
+
readonly startedAt: string;
|
|
38
|
+
readonly sameUserOnly: true;
|
|
39
|
+
readonly activeWarpRepos: number;
|
|
40
|
+
};
|
|
41
|
+
readonly sessions: {
|
|
42
|
+
readonly total: number;
|
|
43
|
+
readonly bound: number;
|
|
44
|
+
readonly unbound: number;
|
|
45
|
+
readonly listed: UnknownCount;
|
|
46
|
+
};
|
|
47
|
+
readonly workspaces: {
|
|
48
|
+
readonly authorized: number;
|
|
49
|
+
readonly authorizedRepos: number;
|
|
50
|
+
readonly bound: UnknownCount;
|
|
51
|
+
readonly current: {
|
|
52
|
+
readonly cwd: string;
|
|
53
|
+
readonly authorization: DaemonCurrentAuthorization;
|
|
54
|
+
readonly bindState: DaemonCurrentBindState;
|
|
55
|
+
readonly repoId: string | null;
|
|
56
|
+
readonly worktreeRoot: string | null;
|
|
57
|
+
readonly activeSessions: number | null;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
readonly monitors: {
|
|
61
|
+
readonly total: number;
|
|
62
|
+
readonly running: number;
|
|
63
|
+
readonly paused: number;
|
|
64
|
+
readonly stopped: number;
|
|
65
|
+
readonly failing: number;
|
|
66
|
+
readonly backlog: number;
|
|
67
|
+
readonly listed: UnknownCount;
|
|
68
|
+
};
|
|
69
|
+
readonly scheduler: {
|
|
70
|
+
readonly maxConcurrentJobs: number;
|
|
71
|
+
readonly activeJobs: number;
|
|
72
|
+
readonly queuedJobs: number;
|
|
73
|
+
readonly interactiveQueuedJobs: number;
|
|
74
|
+
readonly backgroundQueuedJobs: number;
|
|
75
|
+
readonly longestQueuedWaitMs: number;
|
|
76
|
+
readonly pressure: DaemonSchedulerPressure;
|
|
77
|
+
};
|
|
78
|
+
readonly workers: {
|
|
79
|
+
readonly mode: DaemonStatusPayload["workers"]["mode"];
|
|
80
|
+
readonly totalWorkers: number;
|
|
81
|
+
readonly busyWorkers: number;
|
|
82
|
+
readonly idleWorkers: number;
|
|
83
|
+
readonly queuedTasks: number;
|
|
84
|
+
readonly pressure: DaemonWorkerPressure;
|
|
85
|
+
};
|
|
86
|
+
readonly degraded: readonly string[];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface CurrentWorkspacePosture {
|
|
90
|
+
readonly authorization: DaemonCurrentAuthorization;
|
|
91
|
+
readonly repoId: string | null;
|
|
92
|
+
readonly worktreeRoot: string | null;
|
|
93
|
+
readonly activeSessions: number | null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function normalizePath(value: string): string {
|
|
97
|
+
return path.resolve(value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function schedulerPressure(status: DaemonStatusPayload): DaemonSchedulerPressure {
|
|
101
|
+
if (status.scheduler.queuedJobs > 0) return "queued";
|
|
102
|
+
if (status.scheduler.activeJobs >= status.scheduler.maxConcurrentJobs) return "saturated";
|
|
103
|
+
if (status.scheduler.activeJobs > 0) return "running";
|
|
104
|
+
return "idle";
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function workerPressure(status: DaemonStatusPayload): DaemonWorkerPressure {
|
|
108
|
+
if (status.workers.totalWorkers === 0) return "unknown";
|
|
109
|
+
if (status.workers.queuedTasks > 0 || status.workers.busyWorkers >= status.workers.totalWorkers) {
|
|
110
|
+
return "saturated";
|
|
111
|
+
}
|
|
112
|
+
if (status.workers.busyWorkers > 0) return "busy";
|
|
113
|
+
return "idle";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function buildDegradedReasons(status: DaemonStatusPayload): string[] {
|
|
117
|
+
const reasons: string[] = [];
|
|
118
|
+
if (status.failingMonitors > 0) reasons.push("failing_monitors");
|
|
119
|
+
if (status.backlogMonitors > 0) reasons.push("monitor_backlog");
|
|
120
|
+
if (status.scheduler.queuedJobs > 0) reasons.push("scheduler_queue");
|
|
121
|
+
if (status.scheduler.failedJobs > 0) reasons.push("scheduler_failures");
|
|
122
|
+
if (status.workers.queuedTasks > 0) reasons.push("worker_queue");
|
|
123
|
+
if (status.workers.failedTasks > 0) reasons.push("worker_failures");
|
|
124
|
+
return reasons;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function currentPosture(
|
|
128
|
+
cwd: string,
|
|
129
|
+
snapshot: DaemonStatusReadSnapshot,
|
|
130
|
+
): CurrentWorkspacePosture {
|
|
131
|
+
const normalizedCwd = normalizePath(cwd);
|
|
132
|
+
const currentRepo = snapshot.currentRepo?.repos[0];
|
|
133
|
+
const currentWorktree = currentRepo?.worktrees.find((worktree) => {
|
|
134
|
+
return normalizePath(worktree.worktreeRoot) === normalizedCwd;
|
|
135
|
+
}) ?? currentRepo?.worktrees[0];
|
|
136
|
+
|
|
137
|
+
const exactAuthorization = snapshot.authorizations?.workspaces.find((workspace) => {
|
|
138
|
+
return normalizePath(workspace.worktreeRoot) === normalizedCwd;
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
if (currentRepo !== undefined || exactAuthorization !== undefined) {
|
|
142
|
+
return {
|
|
143
|
+
authorization: "authorized",
|
|
144
|
+
repoId: currentRepo?.repoId ?? exactAuthorization?.repoId ?? null,
|
|
145
|
+
worktreeRoot: currentWorktree?.worktreeRoot ?? exactAuthorization?.worktreeRoot ?? null,
|
|
146
|
+
activeSessions: currentWorktree?.activeSessions ?? exactAuthorization?.activeSessions ?? null,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (snapshot.authorizations !== undefined || snapshot.currentRepo !== undefined) {
|
|
151
|
+
return {
|
|
152
|
+
authorization: "not_authorized",
|
|
153
|
+
repoId: null,
|
|
154
|
+
worktreeRoot: null,
|
|
155
|
+
activeSessions: null,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
authorization: "unknown",
|
|
161
|
+
repoId: null,
|
|
162
|
+
worktreeRoot: null,
|
|
163
|
+
activeSessions: null,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function buildDaemonStatusModel(input: {
|
|
168
|
+
readonly cwd: string;
|
|
169
|
+
readonly snapshot: DaemonStatusReadSnapshot;
|
|
170
|
+
}): DaemonStatusModel {
|
|
171
|
+
const { cwd, snapshot } = input;
|
|
172
|
+
const { status } = snapshot;
|
|
173
|
+
const degraded = buildDegradedReasons(status);
|
|
174
|
+
const current = currentPosture(cwd, snapshot);
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
command: "daemon_status",
|
|
178
|
+
cwd,
|
|
179
|
+
daemon: {
|
|
180
|
+
health: degraded.length === 0 ? "ok" : "degraded",
|
|
181
|
+
transport: status.transport,
|
|
182
|
+
socketPath: status.socketPath,
|
|
183
|
+
mcpPath: status.mcpPath,
|
|
184
|
+
healthPath: status.healthPath,
|
|
185
|
+
startedAt: status.startedAt,
|
|
186
|
+
sameUserOnly: status.sameUserOnly,
|
|
187
|
+
activeWarpRepos: status.activeWarpRepos,
|
|
188
|
+
},
|
|
189
|
+
sessions: {
|
|
190
|
+
total: status.activeSessions,
|
|
191
|
+
bound: status.boundSessions,
|
|
192
|
+
unbound: status.unboundSessions,
|
|
193
|
+
listed: snapshot.sessions?.sessions.length ?? "unknown",
|
|
194
|
+
},
|
|
195
|
+
workspaces: {
|
|
196
|
+
authorized: status.authorizedWorkspaces,
|
|
197
|
+
authorizedRepos: status.authorizedRepos,
|
|
198
|
+
bound: snapshot.authorizations === undefined
|
|
199
|
+
? "unknown"
|
|
200
|
+
: snapshot.authorizations.workspaces.filter((workspace) => workspace.activeSessions > 0).length,
|
|
201
|
+
current: {
|
|
202
|
+
cwd,
|
|
203
|
+
authorization: current.authorization,
|
|
204
|
+
bindState: snapshot.workspaceStatus?.bindState ?? "unknown",
|
|
205
|
+
repoId: current.repoId,
|
|
206
|
+
worktreeRoot: current.worktreeRoot,
|
|
207
|
+
activeSessions: current.activeSessions,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
monitors: {
|
|
211
|
+
total: status.totalMonitors,
|
|
212
|
+
running: status.runningMonitors,
|
|
213
|
+
paused: status.pausedMonitors,
|
|
214
|
+
stopped: status.stoppedMonitors,
|
|
215
|
+
failing: status.failingMonitors,
|
|
216
|
+
backlog: status.backlogMonitors,
|
|
217
|
+
listed: snapshot.monitors?.monitors.length ?? "unknown",
|
|
218
|
+
},
|
|
219
|
+
scheduler: {
|
|
220
|
+
maxConcurrentJobs: status.scheduler.maxConcurrentJobs,
|
|
221
|
+
activeJobs: status.scheduler.activeJobs,
|
|
222
|
+
queuedJobs: status.scheduler.queuedJobs,
|
|
223
|
+
interactiveQueuedJobs: status.scheduler.interactiveQueuedJobs,
|
|
224
|
+
backgroundQueuedJobs: status.scheduler.backgroundQueuedJobs,
|
|
225
|
+
longestQueuedWaitMs: status.scheduler.longestQueuedWaitMs,
|
|
226
|
+
pressure: schedulerPressure(status),
|
|
227
|
+
},
|
|
228
|
+
workers: {
|
|
229
|
+
mode: status.workers.mode,
|
|
230
|
+
totalWorkers: status.workers.totalWorkers,
|
|
231
|
+
busyWorkers: status.workers.busyWorkers,
|
|
232
|
+
idleWorkers: status.workers.idleWorkers,
|
|
233
|
+
queuedTasks: status.workers.queuedTasks,
|
|
234
|
+
pressure: workerPressure(status),
|
|
235
|
+
},
|
|
236
|
+
degraded,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { headerBox, table } from "@flyingrobots/bijou";
|
|
2
|
+
import { initDefaultContext } from "@flyingrobots/bijou-node";
|
|
3
|
+
import type { DaemonStatusModel, UnknownCount } from "./daemon-status-model.js";
|
|
4
|
+
|
|
5
|
+
function count(value: UnknownCount): string {
|
|
6
|
+
return typeof value === "number" ? String(value) : value;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function currentAuthLabel(value: DaemonStatusModel["workspaces"]["current"]["authorization"]): string {
|
|
10
|
+
if (value === "authorized") return "ok";
|
|
11
|
+
if (value === "not_authorized") return "none";
|
|
12
|
+
return "unknown";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function renderDaemonStatus(model: DaemonStatusModel): string {
|
|
16
|
+
const ctx = initDefaultContext();
|
|
17
|
+
const rows = [
|
|
18
|
+
[
|
|
19
|
+
"runtime",
|
|
20
|
+
[
|
|
21
|
+
`transport ${model.daemon.transport}`,
|
|
22
|
+
`started ${model.daemon.startedAt}`,
|
|
23
|
+
`warp repos ${String(model.daemon.activeWarpRepos)}`,
|
|
24
|
+
].join("; "),
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"sessions",
|
|
28
|
+
[
|
|
29
|
+
`total ${String(model.sessions.total)}`,
|
|
30
|
+
`bound ${String(model.sessions.bound)}`,
|
|
31
|
+
`unbound ${String(model.sessions.unbound)}`,
|
|
32
|
+
`listed ${count(model.sessions.listed)}`,
|
|
33
|
+
].join("; "),
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"workspaces",
|
|
37
|
+
[
|
|
38
|
+
`auth ${String(model.workspaces.authorized)}`,
|
|
39
|
+
`repos ${String(model.workspaces.authorizedRepos)}`,
|
|
40
|
+
`bound ${count(model.workspaces.bound)}`,
|
|
41
|
+
`current ${currentAuthLabel(model.workspaces.current.authorization)}`,
|
|
42
|
+
`status-session ${model.workspaces.current.bindState}`,
|
|
43
|
+
`active ${model.workspaces.current.activeSessions === null ? "unknown" : String(model.workspaces.current.activeSessions)}`,
|
|
44
|
+
].join("; "),
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"monitors",
|
|
48
|
+
[
|
|
49
|
+
`total ${String(model.monitors.total)}`,
|
|
50
|
+
`running ${String(model.monitors.running)}`,
|
|
51
|
+
`paused ${String(model.monitors.paused)}`,
|
|
52
|
+
`stopped ${String(model.monitors.stopped)}`,
|
|
53
|
+
`failing ${String(model.monitors.failing)}`,
|
|
54
|
+
`backlog ${String(model.monitors.backlog)}`,
|
|
55
|
+
`listed ${count(model.monitors.listed)}`,
|
|
56
|
+
].join("; "),
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"scheduler",
|
|
60
|
+
[
|
|
61
|
+
model.scheduler.pressure,
|
|
62
|
+
`active ${String(model.scheduler.activeJobs)}/${String(model.scheduler.maxConcurrentJobs)}`,
|
|
63
|
+
`queued ${String(model.scheduler.queuedJobs)}`,
|
|
64
|
+
`interactive ${String(model.scheduler.interactiveQueuedJobs)}`,
|
|
65
|
+
`background ${String(model.scheduler.backgroundQueuedJobs)}`,
|
|
66
|
+
`longest wait ${String(model.scheduler.longestQueuedWaitMs)}ms`,
|
|
67
|
+
].join("; "),
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"workers",
|
|
71
|
+
[
|
|
72
|
+
model.workers.pressure,
|
|
73
|
+
model.workers.mode,
|
|
74
|
+
`busy ${String(model.workers.busyWorkers)}/${String(model.workers.totalWorkers)}`,
|
|
75
|
+
`idle ${String(model.workers.idleWorkers)}`,
|
|
76
|
+
`queued ${String(model.workers.queuedTasks)}`,
|
|
77
|
+
].join("; "),
|
|
78
|
+
],
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
return [
|
|
82
|
+
headerBox("Daemon Status", {
|
|
83
|
+
detail: `health: ${model.daemon.health}`,
|
|
84
|
+
width: 80,
|
|
85
|
+
ctx,
|
|
86
|
+
}),
|
|
87
|
+
`cwd: ${model.cwd}`,
|
|
88
|
+
`socket: ${model.daemon.socketPath}`,
|
|
89
|
+
`mcp: ${model.daemon.mcpPath}`,
|
|
90
|
+
"",
|
|
91
|
+
table({
|
|
92
|
+
ctx,
|
|
93
|
+
columns: [
|
|
94
|
+
{ header: "Surface" },
|
|
95
|
+
{ header: "State" },
|
|
96
|
+
],
|
|
97
|
+
rows,
|
|
98
|
+
}),
|
|
99
|
+
"",
|
|
100
|
+
`degraded: ${model.degraded.length === 0 ? "none" : model.degraded.join(", ")}`,
|
|
101
|
+
].join("\n").trimEnd();
|
|
102
|
+
}
|