@flyingrobots/graft 0.6.0 → 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/ADVANCED_GUIDE.md +52 -0
- package/CHANGELOG.md +142 -0
- package/GUIDE.md +53 -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 +779 -0
- package/package.json +10 -7
- 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/docs/SETUP.md
ADDED
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
# Graft Setup Guide
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g @flyingrobots/graft
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Or run without installing:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @flyingrobots/graft
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick setup
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @flyingrobots/graft init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Scaffolds your project for graft in one command:
|
|
22
|
+
- Creates `.graftignore` (template with examples)
|
|
23
|
+
- Adds `.graft/` to `.gitignore`
|
|
24
|
+
- Generates a `CLAUDE.md` snippet instructing agents to prefer graft tools
|
|
25
|
+
- Prints Claude Code hook and MCP config for manual setup
|
|
26
|
+
|
|
27
|
+
If you use `--write-codex-mcp`, `init` also seeds `AGENTS.md` so Codex
|
|
28
|
+
has a repo-local instruction layer alongside the MCP config.
|
|
29
|
+
|
|
30
|
+
Idempotent — safe to run again without duplicating entries.
|
|
31
|
+
|
|
32
|
+
`init` bootstraps repo-local files and client config. The default MCP
|
|
33
|
+
runtime is repo-local stdio. Use `--mcp-runtime daemon` only when you
|
|
34
|
+
want generated MCP config to launch the daemon-backed stdio bridge.
|
|
35
|
+
|
|
36
|
+
## Choose Your Setup Path
|
|
37
|
+
|
|
38
|
+
Use this table when you want the shortest path instead of reading the
|
|
39
|
+
whole setup guide front-to-back.
|
|
40
|
+
|
|
41
|
+
| If you want... | Use this path | What happens |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| Claude Code MCP only in this repo | `npx @flyingrobots/graft init --write-claude-mcp` | Writes or merges `.mcp.json` |
|
|
44
|
+
| Claude Code MCP plus hook enforcement in this repo | `npx @flyingrobots/graft init --write-claude-mcp --write-claude-hooks` | Writes or merges `.mcp.json` and `.claude/settings.json` |
|
|
45
|
+
| Cursor MCP in this repo | `npx @flyingrobots/graft init --write-cursor-mcp` | Writes or merges `.cursor/mcp.json` |
|
|
46
|
+
| Windsurf MCP in this repo | `npx @flyingrobots/graft init --write-windsurf-mcp` | Writes or merges `.codeium/windsurf/mcp_config.json` |
|
|
47
|
+
| Continue MCP in this repo | `npx @flyingrobots/graft init --write-continue-mcp` | Writes or merges `.continue/config.json` |
|
|
48
|
+
| Cline MCP in this repo | `npx @flyingrobots/graft init --write-cline-mcp` | Writes or merges `.vscode/cline_mcp_settings.json` |
|
|
49
|
+
| Codex MCP in this repo | `npx @flyingrobots/graft init --write-codex-mcp` | Writes or merges `.codex/config.toml` and seeds `AGENTS.md` |
|
|
50
|
+
| Daemon-backed MCP in this repo | `npx @flyingrobots/graft init --mcp-runtime daemon --write-*-mcp` | Writes or merges client config that launches `graft serve --runtime daemon` |
|
|
51
|
+
| Manual review before any config file write | `npx @flyingrobots/graft init` | Scaffolds repo files and prints the manual MCP / hook snippets |
|
|
52
|
+
| Global config instead of project-local config | Edit your client's global MCP settings manually | Use the repo-local or daemon-backed `serve` args shown below |
|
|
53
|
+
| Another MCP-compatible client | Add graft manually to that client's MCP config | Use `command = npx` with either `serve` or `serve --runtime daemon` |
|
|
54
|
+
|
|
55
|
+
## Governed Read Posture By Client
|
|
56
|
+
|
|
57
|
+
MCP availability is not the same thing as a governed default read path.
|
|
58
|
+
Use this table to see what each client actually gets today.
|
|
59
|
+
|
|
60
|
+
| Client path | MCP bootstrap | Repo-local instruction layer | Native read guardrail | Current posture |
|
|
61
|
+
|---|---|---|---|---|
|
|
62
|
+
| Claude Code with hooks | `--write-claude-mcp --write-claude-hooks` | `CLAUDE.md` | Yes, via `PreToolUse` / `PostToolUse` | Closest current default-governed path |
|
|
63
|
+
| Codex | `--write-codex-mcp` | `AGENTS.md` | No | Strong bootstrap guidance plus MCP, but no native-read interception |
|
|
64
|
+
| Cursor / Windsurf / Continue / Cline | `--write-*-mcp` | None written automatically today | No | MCP available, but governed reads still depend on agent choice |
|
|
65
|
+
| Other MCP-compatible clients | Manual MCP config | None written automatically today | No | MCP only |
|
|
66
|
+
|
|
67
|
+
## Deployment Posture
|
|
68
|
+
|
|
69
|
+
Graft's supported deployment posture today is local-user with two
|
|
70
|
+
distinct runtime paths:
|
|
71
|
+
|
|
72
|
+
- repo-local `serve`: one stdio MCP server per repo checkout plus
|
|
73
|
+
repo-local bootstrap files such as `CLAUDE.md` or `AGENTS.md`
|
|
74
|
+
- `graft daemon`: a separate same-user local runtime on a Unix socket or
|
|
75
|
+
Windows named pipe, with `/mcp` for MCP traffic and `/healthz` for
|
|
76
|
+
liveness
|
|
77
|
+
|
|
78
|
+
The daemon is available as an explicit opt-in MCP bootstrap runtime. It
|
|
79
|
+
is not the default because it uses a stricter contract:
|
|
80
|
+
|
|
81
|
+
- daemon sessions start unbound
|
|
82
|
+
- workspace binding requires prior authorization through the daemon
|
|
83
|
+
control plane
|
|
84
|
+
- canonical repo identity, live worktree identity, and session-local
|
|
85
|
+
state remain separate
|
|
86
|
+
- `run_capture` stays default-denied unless an authorized workspace
|
|
87
|
+
explicitly enables it
|
|
88
|
+
|
|
89
|
+
Daemon control-plane inspection now exists through MCP tools:
|
|
90
|
+
|
|
91
|
+
- `daemon_status`
|
|
92
|
+
- `daemon_repos`
|
|
93
|
+
- `daemon_sessions`
|
|
94
|
+
- `daemon_monitors`
|
|
95
|
+
- `monitor_start`
|
|
96
|
+
- `monitor_pause`
|
|
97
|
+
- `monitor_resume`
|
|
98
|
+
- `monitor_stop`
|
|
99
|
+
- `workspace_authorizations`
|
|
100
|
+
- `workspace_authorize`
|
|
101
|
+
- `workspace_bind`
|
|
102
|
+
- `workspace_status`
|
|
103
|
+
- `workspace_rebind`
|
|
104
|
+
- `workspace_revoke`
|
|
105
|
+
|
|
106
|
+
Human operators can inspect the same read-side daemon posture without
|
|
107
|
+
opening raw MCP JSON:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx @flyingrobots/graft daemon status
|
|
111
|
+
npx @flyingrobots/graft daemon status --socket /path/to/mcp.sock
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`daemon status` is read-only. It shows daemon health, session counts,
|
|
115
|
+
workspace authorization/bind posture, monitor summary, scheduler
|
|
116
|
+
pressure, and worker pressure. It does not authorize, revoke, bind,
|
|
117
|
+
rebind, pause, resume, start, or stop daemon resources.
|
|
118
|
+
|
|
119
|
+
Practical daemon-backed MCP first-use sequence:
|
|
120
|
+
|
|
121
|
+
1. configure your MCP client with `graft serve --runtime daemon`
|
|
122
|
+
2. let the bridge auto-start the daemon, or start `npx @flyingrobots/graft daemon`
|
|
123
|
+
3. call `workspace_authorize` with the target `cwd`
|
|
124
|
+
4. call `workspace_bind` with the target `cwd`
|
|
125
|
+
5. then use repository-scoped tools such as `safe_read` or `graft_map`
|
|
126
|
+
|
|
127
|
+
### MCP runtime selection
|
|
128
|
+
|
|
129
|
+
Repo-local stdio is the default and remains the simplest path:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"graft": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": ["-y", "@flyingrobots/graft", "serve"]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Daemon-backed stdio keeps the same MCP client shape but changes the
|
|
143
|
+
runtime:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"graft": {
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["-y", "@flyingrobots/graft", "serve", "--runtime", "daemon"]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Use repo-local stdio when you want one MCP server bound directly to the
|
|
157
|
+
current checkout. Use daemon-backed stdio when you want daemon-only
|
|
158
|
+
capabilities such as shared worker pools, persistent monitors, and
|
|
159
|
+
daemon control-plane inspection. Daemon-backed sessions start unbound;
|
|
160
|
+
repository-scoped tools require `workspace_authorize` and
|
|
161
|
+
`workspace_bind`.
|
|
162
|
+
|
|
163
|
+
### One-step bootstrap
|
|
164
|
+
|
|
165
|
+
Write project-local client config directly when you want `init` to do
|
|
166
|
+
the wiring for you:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
npx @flyingrobots/graft init --write-claude-mcp --write-claude-hooks
|
|
170
|
+
npx @flyingrobots/graft init --write-cursor-mcp
|
|
171
|
+
npx @flyingrobots/graft init --write-windsurf-mcp
|
|
172
|
+
npx @flyingrobots/graft init --write-continue-mcp
|
|
173
|
+
npx @flyingrobots/graft init --write-cline-mcp
|
|
174
|
+
npx @flyingrobots/graft init --write-codex-mcp
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Add `--mcp-runtime daemon` before a `--write-*-mcp` flag to generate
|
|
178
|
+
daemon-backed stdio config instead of the default repo-local stdio
|
|
179
|
+
config:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
npx @flyingrobots/graft init --mcp-runtime daemon --write-codex-mcp
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Supported write flags:
|
|
186
|
+
|
|
187
|
+
- `--mcp-runtime repo-local` -> generate repo-local `graft serve` MCP
|
|
188
|
+
config; this is the default
|
|
189
|
+
- `--mcp-runtime daemon` -> generate `graft serve --runtime daemon` MCP
|
|
190
|
+
config
|
|
191
|
+
- `--write-claude-mcp` -> writes or merges `.mcp.json`
|
|
192
|
+
- `--write-claude-hooks` -> writes or merges `.claude/settings.json`
|
|
193
|
+
- `--write-cursor-mcp` -> writes or merges `.cursor/mcp.json`
|
|
194
|
+
- `--write-windsurf-mcp` -> writes or merges `.codeium/windsurf/mcp_config.json`
|
|
195
|
+
- `--write-continue-mcp` -> writes or merges `.continue/config.json`
|
|
196
|
+
- `--write-cline-mcp` -> writes or merges `.vscode/cline_mcp_settings.json`
|
|
197
|
+
- `--write-codex-mcp` -> writes or merges `.codex/config.toml` and
|
|
198
|
+
seeds `AGENTS.md`
|
|
199
|
+
|
|
200
|
+
These writes are project-local and idempotent. Existing config is
|
|
201
|
+
preserved, and graft entries are only added when missing.
|
|
202
|
+
|
|
203
|
+
For automation, CLI commands support `--json`:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npx @flyingrobots/graft init --json
|
|
207
|
+
npx @flyingrobots/graft index --path src/app.ts --json
|
|
208
|
+
npx @flyingrobots/graft read safe src/app.ts --json
|
|
209
|
+
npx @flyingrobots/graft struct diff --json
|
|
210
|
+
npx @flyingrobots/graft symbol find 'create*' --json
|
|
211
|
+
npx @flyingrobots/graft diag activity --json
|
|
212
|
+
npx @flyingrobots/graft diag doctor --json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Grouped CLI namespaces:
|
|
216
|
+
|
|
217
|
+
- `read` — `safe`, `outline`, `range`, `changed`
|
|
218
|
+
- `struct` — `diff`, `since`, `map`
|
|
219
|
+
- `symbol` — `show`, `find`, `blame`, `difficulty`
|
|
220
|
+
- `diag` — `activity`, `doctor`, `explain`, `stats`, `capture`
|
|
221
|
+
|
|
222
|
+
## MCP Configuration
|
|
223
|
+
|
|
224
|
+
Graft runs as an MCP server over stdio. Add it to your editor or
|
|
225
|
+
agent's MCP configuration.
|
|
226
|
+
|
|
227
|
+
The default runtime is repo-local:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
npx @flyingrobots/graft serve
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
The daemon-backed runtime is explicit:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
npx @flyingrobots/graft serve --runtime daemon
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
When the daemon-backed bridge cannot reach a daemon, it attempts to
|
|
240
|
+
start one and waits for `/healthz`. Use `--no-autostart` when you want
|
|
241
|
+
startup to fail instead of launching the daemon. Once connected,
|
|
242
|
+
daemon sessions remain unbound until authorized and bound through the
|
|
243
|
+
daemon workspace tools.
|
|
244
|
+
|
|
245
|
+
### Claude Code
|
|
246
|
+
|
|
247
|
+
Add to `.mcp.json` in your project root (per-project) or
|
|
248
|
+
`~/.claude.json` (global):
|
|
249
|
+
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"mcpServers": {
|
|
253
|
+
"graft": {
|
|
254
|
+
"command": "npx",
|
|
255
|
+
"args": ["-y", "@flyingrobots/graft", "serve"]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Project-local shortcut:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
npx @flyingrobots/graft init --write-claude-mcp
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Cursor
|
|
268
|
+
|
|
269
|
+
Add to `.cursor/mcp.json` in your project root:
|
|
270
|
+
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"mcpServers": {
|
|
274
|
+
"graft": {
|
|
275
|
+
"command": "npx",
|
|
276
|
+
"args": ["-y", "@flyingrobots/graft", "serve"]
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Project-local shortcut:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npx @flyingrobots/graft init --write-cursor-mcp
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Windsurf
|
|
289
|
+
|
|
290
|
+
Add to `.codeium/windsurf/mcp_config.json` in your project root:
|
|
291
|
+
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"mcpServers": {
|
|
295
|
+
"graft": {
|
|
296
|
+
"command": "npx",
|
|
297
|
+
"args": ["-y", "@flyingrobots/graft", "serve"]
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Project-local shortcut:
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
npx @flyingrobots/graft init --write-windsurf-mcp
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### VS Code + Continue
|
|
310
|
+
|
|
311
|
+
Add to `.continue/config.json`:
|
|
312
|
+
|
|
313
|
+
```json
|
|
314
|
+
{
|
|
315
|
+
"mcpServers": [
|
|
316
|
+
{
|
|
317
|
+
"name": "graft",
|
|
318
|
+
"command": "npx",
|
|
319
|
+
"args": ["-y", "@flyingrobots/graft", "serve"]
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Project-local shortcut:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
npx @flyingrobots/graft init --write-continue-mcp
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Cline
|
|
332
|
+
|
|
333
|
+
Add via Cline's MCP settings UI, or in
|
|
334
|
+
`.vscode/cline_mcp_settings.json`:
|
|
335
|
+
|
|
336
|
+
```json
|
|
337
|
+
{
|
|
338
|
+
"mcpServers": {
|
|
339
|
+
"graft": {
|
|
340
|
+
"command": "npx",
|
|
341
|
+
"args": ["-y", "@flyingrobots/graft", "serve"]
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
Project-local shortcut:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
npx @flyingrobots/graft init --write-cline-mcp
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Codex
|
|
354
|
+
|
|
355
|
+
Add to `.codex/config.toml` in your project root (per-project) or
|
|
356
|
+
`~/.codex/config.toml` (global):
|
|
357
|
+
|
|
358
|
+
```toml
|
|
359
|
+
[mcp_servers.graft]
|
|
360
|
+
command = "npx"
|
|
361
|
+
args = ["-y", "@flyingrobots/graft", "serve"]
|
|
362
|
+
startup_timeout_sec = 120
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Project-local shortcut:
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
npx @flyingrobots/graft init --write-codex-mcp
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
That explicit write path also creates or merges `AGENTS.md` with graft
|
|
372
|
+
read guidance so Codex sees repo-local instructions as well as the MCP
|
|
373
|
+
server config.
|
|
374
|
+
If you already have an older graft block in `.codex/config.toml`,
|
|
375
|
+
rerunning that command will add the safer startup timeout without
|
|
376
|
+
duplicating the server entry.
|
|
377
|
+
|
|
378
|
+
The larger startup timeout is intentional. Cold `npx` startup can spend
|
|
379
|
+
enough time in package acquisition and bootstrap to exceed Codex's
|
|
380
|
+
default 30 second budget even when the graft server itself is healthy.
|
|
381
|
+
|
|
382
|
+
**Note:** Codex may ask you to approve external MCP tool calls the
|
|
383
|
+
first time it uses graft. If you trust the local server, choose
|
|
384
|
+
"Always allow" so normal graft tool use does not require a prompt on
|
|
385
|
+
every call.
|
|
386
|
+
|
|
387
|
+
### Any MCP-compatible client
|
|
388
|
+
|
|
389
|
+
The pattern is the same everywhere:
|
|
390
|
+
|
|
391
|
+
- **Command**: `npx`
|
|
392
|
+
- **Args**: `["-y", "@flyingrobots/graft", "serve"]`
|
|
393
|
+
- **Transport**: stdio (the default for most clients)
|
|
394
|
+
|
|
395
|
+
If your client doesn't support `npx`, install globally and use:
|
|
396
|
+
|
|
397
|
+
- **Command**: `graft`
|
|
398
|
+
- **Args**: `["serve"]`
|
|
399
|
+
|
|
400
|
+
This section shows the repo-local stdio path. If you connect through
|
|
401
|
+
`graft daemon` instead, the MCP session starts `unbound` and needs
|
|
402
|
+
`workspace_authorize` plus `workspace_bind` before repository-scoped
|
|
403
|
+
tool calls.
|
|
404
|
+
|
|
405
|
+
## Claude Code Hooks
|
|
406
|
+
|
|
407
|
+
Two hooks work together to govern agent reads:
|
|
408
|
+
|
|
409
|
+
- **PreToolUse** — blocks banned files and redirects large JS/TS reads
|
|
410
|
+
before the native read happens
|
|
411
|
+
- **PostToolUse** — backstop education if an oversized code read still
|
|
412
|
+
completes
|
|
413
|
+
|
|
414
|
+
### Setup
|
|
415
|
+
|
|
416
|
+
Add to `.claude/settings.json` in your project root:
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"hooks": {
|
|
421
|
+
"PreToolUse": [
|
|
422
|
+
{
|
|
423
|
+
"matcher": "Read",
|
|
424
|
+
"hooks": [
|
|
425
|
+
{
|
|
426
|
+
"type": "command",
|
|
427
|
+
"command": "node --import tsx node_modules/@flyingrobots/graft/src/hooks/pretooluse-read.ts"
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
],
|
|
432
|
+
"PostToolUse": [
|
|
433
|
+
{
|
|
434
|
+
"matcher": "Read",
|
|
435
|
+
"hooks": [
|
|
436
|
+
{
|
|
437
|
+
"type": "command",
|
|
438
|
+
"command": "node --import tsx node_modules/@flyingrobots/graft/src/hooks/posttooluse-read.ts"
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
Project-local shortcut:
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
npx @flyingrobots/graft init --write-claude-hooks
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
If developing graft itself, replace the `node_modules/...` paths
|
|
454
|
+
with local paths:
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
src/hooks/pretooluse-read.ts (PreToolUse)
|
|
458
|
+
src/hooks/posttooluse-read.ts (PostToolUse)
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
### PreToolUse — ban enforcement
|
|
462
|
+
|
|
463
|
+
When the agent calls `Read(file_path)`, the PreToolUse hook:
|
|
464
|
+
|
|
465
|
+
1. Evaluates the file against graft's policy
|
|
466
|
+
2. **Banned files** (binaries, lockfiles, secrets, `.graftignore`
|
|
467
|
+
matches): exits 2 (block) with refusal reason and next steps
|
|
468
|
+
3. **Large JS/TS files**: exits 2 with a redirect to `safe_read`,
|
|
469
|
+
`file_outline`, and `read_range`
|
|
470
|
+
4. **Everything else**: exits 0 — lets native Read proceed
|
|
471
|
+
|
|
472
|
+
This is the current "default governed" path for Claude Code: large
|
|
473
|
+
code reads are redirected before the full file lands in context.
|
|
474
|
+
Other file types and other clients still rely on MCP usage or future
|
|
475
|
+
integration work.
|
|
476
|
+
|
|
477
|
+
### PostToolUse — backstop education
|
|
478
|
+
|
|
479
|
+
After a Read completes, the PostToolUse hook evaluates what
|
|
480
|
+
`safe_read` would have done for large JS/TS files and tells the agent
|
|
481
|
+
the cost:
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
[graft] This large code read bypassed graft's governed path for src/mcp/server.ts.
|
|
485
|
+
safe_read would have returned a structural outline (2048 bytes) instead of 450 lines (18.0KB),
|
|
486
|
+
saving 16.0KB of context. Threshold: 150 lines / 12KB.
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
This feedback appears only if an oversized JS/TS read still completes.
|
|
490
|
+
With a working PreToolUse hook, that should be a backstop signal rather
|
|
491
|
+
than the normal path. Small files, non-JS/TS files, and nonexistent
|
|
492
|
+
files produce no feedback. The hook always exits 0 — it never blocks.
|
|
493
|
+
|
|
494
|
+
### Limitations
|
|
495
|
+
|
|
496
|
+
Both hooks run as standalone processes — they do not share state
|
|
497
|
+
with the MCP server. This means:
|
|
498
|
+
|
|
499
|
+
- No session-depth dynamic caps (early/mid/late)
|
|
500
|
+
- No re-read suppression or cache hits
|
|
501
|
+
- No structural diffs on changed files
|
|
502
|
+
- No metrics tracking or receipts
|
|
503
|
+
|
|
504
|
+
For the full experience, agents should use graft's MCP tools
|
|
505
|
+
(`safe_read`, `file_outline`, `read_range`) directly. The hooks
|
|
506
|
+
make Claude closer to a default-governed path for large code reads, but
|
|
507
|
+
the MCP server remains the full governor and non-Claude clients still
|
|
508
|
+
need explicit integration.
|
|
509
|
+
|
|
510
|
+
### Disabling
|
|
511
|
+
|
|
512
|
+
To disable hooks locally without removing the project config,
|
|
513
|
+
add to `.claude/settings.local.json`:
|
|
514
|
+
|
|
515
|
+
```json
|
|
516
|
+
{
|
|
517
|
+
"hooks": {}
|
|
518
|
+
}
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
## Tool Reference
|
|
522
|
+
|
|
523
|
+
| Tool | Description |
|
|
524
|
+
|------|-------------|
|
|
525
|
+
| `safe_read` | Policy-enforced file read. Returns full content for small files, structural outline with jump table for large files, or refusal with reason code for banned files. Detects re-reads and returns cached outlines or structural diffs. |
|
|
526
|
+
| `file_outline` | Structural skeleton of a file — function signatures, class shapes, exports. Includes a jump table mapping each symbol to its line range for targeted `read_range` follow-ups. |
|
|
527
|
+
| `read_range` | Read a bounded range of lines from a file. Maximum 250 lines. Use jump table entries from `file_outline` or `safe_read` to target specific symbols. |
|
|
528
|
+
| `changed_since` | Check if a file changed since it was last read. Returns structural diff (added/removed/changed symbols) or "unchanged". Peek mode by default; pass `consume: true` to update the observation cache. |
|
|
529
|
+
| `graft_diff` | Structural diff between two git refs. Shows added, removed, and changed symbols per file — not line hunks. Defaults to working tree vs HEAD. Policy-denied files are omitted from `files` and surfaced in `refused`. |
|
|
530
|
+
| `graft_since` | Structural changes since a git ref. Shows added/removed/changed symbols per file and a summary line. Policy-denied files are omitted from `files` and surfaced in `refused`. |
|
|
531
|
+
| `graft_map` | Structural directory map of files and symbols under a path, with explicit denied-file reporting. |
|
|
532
|
+
| `code_show` | Focus on a symbol by name and return its source with line metadata. |
|
|
533
|
+
| `code_find` | Search symbols across the project by approximate name or glob pattern, with optional kind/path filter. |
|
|
534
|
+
| `graft_difficulty` | Refactor difficulty score for a symbol. Combines WARP churn curvature with reference-edge friction and returns the scalar plus the underlying factors. |
|
|
535
|
+
| `code_refs` | Search import sites, callsites, property access, or literal text references with explicit text-fallback provenance, pattern, and scope. |
|
|
536
|
+
| `activity_view` | Bounded between-commit activity for the active workspace, including commit anchor, grouped recent activity, and degraded posture. |
|
|
537
|
+
| `doctor` | Runtime health check including layered-worldline repo state and burden summary. Accepts an opt-in `sludge` scan for parser-backed structural smell signals. |
|
|
538
|
+
| `stats` | Decision metrics for the current server session, including burden by tool kind. |
|
|
539
|
+
| `explain` | Human-readable meaning and recommended action for a reason code. |
|
|
540
|
+
| `run_capture` | Execute a shell command and return the last N lines of output (default 60). This tool is outside graft's bounded-read policy contract, responses include an explicit `policyBoundary` marker, log persistence can be disabled, and persisted output is redacted for obvious secrets by default. |
|
|
541
|
+
| `state_save` | Save session working state (max 8 KB). Use for session bookmarks: current task, files modified, next planned actions. |
|
|
542
|
+
| `state_load` | Load previously saved session state. Returns null if no state has been saved. |
|
|
543
|
+
|
|
544
|
+
MCP responses include versioned `_schema` metadata and `_receipt`
|
|
545
|
+
fields. CLI peer commands also return versioned `_schema` metadata;
|
|
546
|
+
the declared contracts live in `src/contracts/output-schemas.ts`.
|
|
547
|
+
| `doctor` | Runtime health check. Shows project root, parser status, active thresholds, session depth, message count, and a compact burden summary. With `sludge: true`, reports parser-backed structural smell signals. |
|
|
548
|
+
| `set_budget` | Declare a session byte budget. Graft tightens read thresholds as the budget drains — no single read may consume more than 5% of remaining budget. Call once at session start. |
|
|
549
|
+
| `explain` | Explain a graft reason code. Returns human-readable meaning and recommended next action for any code (e.g., `BINARY`, `BUDGET_CAP`). Case-insensitive. |
|
|
550
|
+
| `stats` | Decision metrics for the current session. Total reads, outlines, refusals, cache hits, bytes avoided, and returned-byte burden by tool kind. |
|
|
551
|
+
|
|
552
|
+
Every MCP tool response includes:
|
|
553
|
+
- `_receipt` — runtime decision metadata
|
|
554
|
+
- `_schema` — versioned output contract metadata
|
|
555
|
+
|
|
556
|
+
Declared output contracts live in `src/contracts/output-schemas.ts`.
|
|
557
|
+
| `graft_since` | Structural changes since a git ref. Shows symbols added, removed, and changed per file — not line hunks. Includes per-file summary lines. Policy-denied files are omitted from `files` and surfaced in `refused`. |
|
|
558
|
+
| `graft_map` | Structural map of a directory — all files and their symbols (function signatures, class shapes, exports) in one call. Uses tree-sitter to parse the working tree directly. Policy-denied files are omitted from `files` and surfaced in `refused`. |
|
|
559
|
+
|
|
560
|
+
## What the agent sees
|
|
561
|
+
|
|
562
|
+
Once configured, the agent gains the MCP tool surface. Here's what
|
|
563
|
+
happens when it uses those tools:
|
|
564
|
+
|
|
565
|
+
### Reading files
|
|
566
|
+
|
|
567
|
+
The agent calls `safe_read` instead of reading files directly.
|
|
568
|
+
Graft decides what to return:
|
|
569
|
+
|
|
570
|
+
- **Small files** (< 150 lines, < 12 KB): full content, as normal.
|
|
571
|
+
- **Large files**: a structural outline showing function signatures,
|
|
572
|
+
class shapes, and exports — with a jump table mapping each symbol
|
|
573
|
+
to its line range. The agent can then use `read_range` to read
|
|
574
|
+
specific sections.
|
|
575
|
+
- **Banned files** (binaries, lockfiles, `.env`, minified bundles,
|
|
576
|
+
build output): refused with a reason code and suggested
|
|
577
|
+
alternatives.
|
|
578
|
+
- **Re-reads**: if the agent reads the same unchanged file twice,
|
|
579
|
+
graft returns the cached outline instead of the full content.
|
|
580
|
+
If the file changed, it returns a structural diff (added/removed/
|
|
581
|
+
changed symbols).
|
|
582
|
+
|
|
583
|
+
### Structural memory (WARP)
|
|
584
|
+
|
|
585
|
+
`graft_since` shows what changed structurally between any two git
|
|
586
|
+
refs — symbols added, removed, and changed per file. Policy-denied
|
|
587
|
+
files are excluded from the visible file list and reported explicitly
|
|
588
|
+
in `refused`.
|
|
589
|
+
|
|
590
|
+
`graft_map` gives a structural map of any directory — every file
|
|
591
|
+
and its symbols (function signatures, class shapes, exports) in
|
|
592
|
+
one call. Denied files are surfaced explicitly instead of silently
|
|
593
|
+
disappearing.
|
|
594
|
+
|
|
595
|
+
Both tools work on the current working tree. Persistent structural indexing is
|
|
596
|
+
lazy: use `graft index --path <path>` from the CLI to refresh one tracked source
|
|
597
|
+
file at `HEAD`, or let read/search surfaces opportunistically refresh the files
|
|
598
|
+
they touch. Unbounded whole-repo eager indexing is guarded.
|
|
599
|
+
|
|
600
|
+
### Structural navigation
|
|
601
|
+
|
|
602
|
+
`file_outline` returns the structural skeleton of any file —
|
|
603
|
+
function signatures, class members, exports — without the bodies.
|
|
604
|
+
Each symbol has a line range so the agent can follow up with
|
|
605
|
+
`read_range` for the specific code it needs.
|
|
606
|
+
|
|
607
|
+
### Git diffs
|
|
608
|
+
|
|
609
|
+
`graft_diff` shows what changed between git refs at the symbol
|
|
610
|
+
level: "function `foo` gained a parameter" instead of line hunks.
|
|
611
|
+
Denied files are excluded from the visible diff and reported in
|
|
612
|
+
`refused`.
|
|
613
|
+
|
|
614
|
+
### Budget governor
|
|
615
|
+
|
|
616
|
+
If the agent calls `set_budget(bytes)` at session start, graft
|
|
617
|
+
tracks cumulative bytes consumed and tightens thresholds as the
|
|
618
|
+
budget drains. No single read may consume more than 5% of remaining
|
|
619
|
+
budget. When the budget is exhausted, all reads return outlines.
|
|
620
|
+
|
|
621
|
+
Budget status appears in every receipt:
|
|
622
|
+
```json
|
|
623
|
+
"budget": { "total": 500000, "consumed": 14345, "remaining": 485655, "fraction": 0.029 }
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
### Session awareness
|
|
627
|
+
|
|
628
|
+
Graft tracks the session and tightens policy as context pressure
|
|
629
|
+
grows:
|
|
630
|
+
|
|
631
|
+
| Session stage | Max read size |
|
|
632
|
+
|---------------|---------------|
|
|
633
|
+
| Early (< 100 messages) | 20 KB |
|
|
634
|
+
| Mid (100–500 messages) | 10 KB |
|
|
635
|
+
| Late (> 500 messages) | 4 KB |
|
|
636
|
+
|
|
637
|
+
Tripwires warn when sessions are going off the rails (> 500
|
|
638
|
+
messages, edit-bash loops, runaway tool calls).
|
|
639
|
+
|
|
640
|
+
### Receipts
|
|
641
|
+
|
|
642
|
+
Every response includes a `_receipt` block with session ID,
|
|
643
|
+
trace ID, sequence number, latency, projection type, bytes
|
|
644
|
+
returned, and cumulative counters. This is for usage analysis and
|
|
645
|
+
correlation — you can usually ignore it.
|
|
646
|
+
|
|
647
|
+
If MCP runtime observability is enabled, `traceId` and `seq` line up
|
|
648
|
+
with `.graft/logs/mcp-runtime.ndjson`. `doctor` also reports the
|
|
649
|
+
current runtime log path and policy.
|
|
650
|
+
|
|
651
|
+
## Configuration
|
|
652
|
+
|
|
653
|
+
### .graftignore
|
|
654
|
+
|
|
655
|
+
Create a `.graftignore` file in your project root to ban
|
|
656
|
+
additional file patterns:
|
|
657
|
+
|
|
658
|
+
```text
|
|
659
|
+
# Generated files
|
|
660
|
+
*.generated.ts
|
|
661
|
+
*.snap
|
|
662
|
+
|
|
663
|
+
# Vendor code
|
|
664
|
+
vendor/**
|
|
665
|
+
|
|
666
|
+
# Large data files
|
|
667
|
+
data/**/*.json
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
Patterns follow the same syntax as `.gitignore` (glob matching
|
|
671
|
+
via picomatch).
|
|
672
|
+
|
|
673
|
+
### Policy defaults
|
|
674
|
+
|
|
675
|
+
| Setting | Default | Description |
|
|
676
|
+
|---------|---------|-------------|
|
|
677
|
+
| Line threshold | 150 | Files over this → outline |
|
|
678
|
+
| Byte threshold | 12 KB | Files over this → outline |
|
|
679
|
+
| Max range | 250 lines | read_range cap |
|
|
680
|
+
| State cap | 8 KB | state_save max size |
|
|
681
|
+
| Capture tail | 60 lines | run_capture default |
|
|
682
|
+
|
|
683
|
+
These are not yet configurable at runtime (planned for a future
|
|
684
|
+
release).
|
|
685
|
+
|
|
686
|
+
### run_capture posture
|
|
687
|
+
|
|
688
|
+
`run_capture` is a diagnostic shell escape hatch, not a bounded-read
|
|
689
|
+
tool. For broader or more sensitive deployments:
|
|
690
|
+
|
|
691
|
+
- set `GRAFT_ENABLE_RUN_CAPTURE=0` to disable execution entirely
|
|
692
|
+
- set `GRAFT_RUN_CAPTURE_PERSIST=0` to avoid writing `.graft/logs/capture.log`
|
|
693
|
+
- persisted capture output is redacted for obvious secret-shaped values
|
|
694
|
+
by default
|
|
695
|
+
|
|
696
|
+
In the local daemon runtime, `run_capture` stays disabled by default and
|
|
697
|
+
requires an explicit operator-authorized capability profile rather than
|
|
698
|
+
inheriting local repo-scoped trust.
|
|
699
|
+
|
|
700
|
+
### MCP runtime observability
|
|
701
|
+
|
|
702
|
+
MCP runtime observability writes metadata-only session and tool-call
|
|
703
|
+
events to `.graft/logs/mcp-runtime.ndjson`. The log intentionally does
|
|
704
|
+
not include raw file content, query text, or other request payload
|
|
705
|
+
values.
|
|
706
|
+
|
|
707
|
+
- set `GRAFT_ENABLE_MCP_RUNTIME_LOG=0` to disable MCP runtime logging
|
|
708
|
+
- set `GRAFT_MCP_RUNTIME_LOG_PATH=/abs/path/mcp-runtime.ndjson` to move
|
|
709
|
+
the log
|
|
710
|
+
- set `GRAFT_MCP_RUNTIME_LOG_MAX_BYTES=2097152` to change retention size
|
|
711
|
+
|
|
712
|
+
## Troubleshooting
|
|
713
|
+
|
|
714
|
+
### "Tool not found" or no graft tools visible
|
|
715
|
+
|
|
716
|
+
- Verify the CLI is installed: `npx @flyingrobots/graft --help`
|
|
717
|
+
- Verify the MCP transport starts: `npx @flyingrobots/graft serve`
|
|
718
|
+
(should start the server; Ctrl+C to stop)
|
|
719
|
+
- Check your MCP config syntax — JSON must be valid
|
|
720
|
+
- Restart your editor/agent after adding MCP config
|
|
721
|
+
- Some clients cache tool lists — try reopening the project
|
|
722
|
+
|
|
723
|
+
### Codex says `user cancelled MCP tool call`
|
|
724
|
+
|
|
725
|
+
This can be a Codex approval issue rather than a graft failure.
|
|
726
|
+
Codex may require permission for external MCP tool calls. If those
|
|
727
|
+
prompts are denied, or cannot be shown in a non-interactive run, the
|
|
728
|
+
tool call may appear as cancelled.
|
|
729
|
+
|
|
730
|
+
- Run Codex interactively and approve graft tool calls
|
|
731
|
+
- If you trust the server, choose "Always allow" for graft
|
|
732
|
+
- Retry the call after granting permission
|
|
733
|
+
- If graft still fails, run `doctor` first to separate Codex setup
|
|
734
|
+
problems from graft runtime problems
|
|
735
|
+
|
|
736
|
+
### Agent keeps getting outlines instead of content
|
|
737
|
+
|
|
738
|
+
Your files are over 150 lines or 12 KB. This is intentional.
|
|
739
|
+
The agent should use the jump table from the outline to
|
|
740
|
+
`read_range` the specific section it needs.
|
|
741
|
+
|
|
742
|
+
### Agent can't read a file (refused)
|
|
743
|
+
|
|
744
|
+
Check the reason code in the response:
|
|
745
|
+
- `BINARY` — binary file, use `ls -lh` or `file` for metadata
|
|
746
|
+
- `LOCKFILE` — read `package.json` instead
|
|
747
|
+
- `SECRET` — `.env` files are banned for safety
|
|
748
|
+
- `BUILD_OUTPUT` — read the source file, not `dist/`
|
|
749
|
+
- `UNSUPPORTED_LANGUAGE` — no parser-backed outline exists for this file type yet; use `read_range` or a full read when appropriate
|
|
750
|
+
- `GRAFTIGNORE` — file matches a `.graftignore` pattern
|
|
751
|
+
|
|
752
|
+
### run_capture is disabled
|
|
753
|
+
|
|
754
|
+
If `run_capture` returns `run_capture is disabled by configuration`,
|
|
755
|
+
the server was started with shell capture turned off.
|
|
756
|
+
|
|
757
|
+
- local repo-scoped sessions can re-enable it by unsetting
|
|
758
|
+
`GRAFT_ENABLE_RUN_CAPTURE=0`
|
|
759
|
+
- shared or harder security postures should generally leave it disabled
|
|
760
|
+
|
|
761
|
+
### graft is slow on first call
|
|
762
|
+
|
|
763
|
+
Tree-sitter WASM grammars load on first parse (~200ms). Subsequent
|
|
764
|
+
calls are fast.
|
|
765
|
+
|
|
766
|
+
## Verify it works
|
|
767
|
+
|
|
768
|
+
After setup, ask your agent to read a large file in your project.
|
|
769
|
+
Instead of dumping the entire file, it should return an outline
|
|
770
|
+
with a jump table. That's graft working.
|
|
771
|
+
|
|
772
|
+
You can also ask the agent to call `doctor` to verify:
|
|
773
|
+
|
|
774
|
+
```
|
|
775
|
+
Use the doctor tool to check graft's health.
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
This returns the project root, parser status, active thresholds,
|
|
779
|
+
and session depth.
|