@flyingrobots/graft 0.6.1 → 0.7.1
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 +148 -0
- package/README.md +1 -2
- package/bin/graft.js +26 -26
- 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 +145 -47
- 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 +54 -6
- 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 +6 -0
- package/dist/cli/json-document.d.ts.map +1 -1
- package/dist/cli/json-document.js +12 -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/hooks/posttooluse-read.js +1 -1
- package/dist/hooks/posttooluse-read.js.map +1 -1
- package/dist/hooks/pretooluse-read.js +1 -1
- package/dist/hooks/pretooluse-read.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/daemon-worker-child-pool.d.ts +2 -0
- package/dist/mcp/daemon-worker-child-pool.d.ts.map +1 -1
- package/dist/mcp/daemon-worker-child-pool.js +10 -3
- package/dist/mcp/daemon-worker-child-pool.js.map +1 -1
- package/dist/mcp/daemon-worker-pool.d.ts +1 -1
- package/dist/mcp/daemon-worker-pool.d.ts.map +1 -1
- package/dist/mcp/daemon-worker-pool.js +1 -1
- package/dist/mcp/daemon-worker-pool.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/version.d.ts.map +1 -1
- package/dist/version.js +3 -1
- package/dist/version.js.map +1 -1
- 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 +112 -27
- package/package.json +13 -6
- 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/adapters/canonical-json.ts +0 -56
- package/src/adapters/node-fs.ts +0 -43
- package/src/adapters/node-git.ts +0 -47
- package/src/adapters/node-process-runner.ts +0 -27
- package/src/adapters/repo-paths.ts +0 -22
- package/src/adapters/rotating-ndjson-log.ts +0 -66
- package/src/api/index.ts +0 -107
- package/src/api/repo-local-graft.ts +0 -21
- package/src/api/repo-workspace.ts +0 -34
- package/src/api/tool-bridge.ts +0 -21
- package/src/cli/activity-render.ts +0 -112
- package/src/cli/cli-error.ts +0 -153
- package/src/cli/command-parser.ts +0 -302
- package/src/cli/entrypoint.ts +0 -18
- package/src/cli/index-cmd.ts +0 -94
- package/src/cli/index-model.ts +0 -76
- package/src/cli/init-bootstrap.ts +0 -47
- package/src/cli/init-client-config.ts +0 -299
- package/src/cli/init-model.ts +0 -229
- package/src/cli/init-render.ts +0 -54
- package/src/cli/init-target-hooks.ts +0 -93
- package/src/cli/init.ts +0 -122
- package/src/cli/json-document.ts +0 -144
- package/src/cli/local-history-dag-model.ts +0 -437
- package/src/cli/local-history-dag-render.ts +0 -133
- package/src/cli/local-history-dag.ts +0 -103
- package/src/cli/main.ts +0 -150
- package/src/cli/migrate-local-history.ts +0 -118
- package/src/cli/peer-command.ts +0 -59
- package/src/contracts/capabilities.ts +0 -450
- package/src/contracts/causal-ontology.ts +0 -627
- package/src/contracts/causal-surface-next-action.ts +0 -18
- package/src/contracts/json-object.ts +0 -28
- package/src/contracts/mcp-runtime.ts +0 -16
- package/src/contracts/output-schema-cli.ts +0 -70
- package/src/contracts/output-schema-fragments.ts +0 -831
- package/src/contracts/output-schema-mcp.ts +0 -282
- package/src/contracts/output-schema-meta.ts +0 -119
- package/src/contracts/output-schemas.ts +0 -1230
- package/src/git/diff.ts +0 -100
- package/src/git/target-git-hook-bootstrap.ts +0 -56
- package/src/guards/stream-boundary.ts +0 -110
- package/src/hooks/posttooluse-read.ts +0 -54
- package/src/hooks/pretooluse-read.ts +0 -52
- package/src/hooks/read-governor.ts +0 -95
- package/src/hooks/read-messages.ts +0 -53
- package/src/hooks/shared.ts +0 -168
- package/src/index.ts +0 -1
- package/src/mcp/burden.ts +0 -123
- package/src/mcp/cache.ts +0 -7
- package/src/mcp/cached-file.ts +0 -1
- package/src/mcp/context.ts +0 -187
- package/src/mcp/control-plane/authz-storage.ts +0 -129
- package/src/mcp/control-plane/session-registry.ts +0 -115
- package/src/mcp/control-plane/status-projection.ts +0 -76
- package/src/mcp/control-plane/types.ts +0 -144
- package/src/mcp/daemon-bootstrap.ts +0 -100
- package/src/mcp/daemon-control-plane.ts +0 -310
- package/src/mcp/daemon-job-scheduler.ts +0 -279
- package/src/mcp/daemon-repos.ts +0 -99
- package/src/mcp/daemon-server.ts +0 -165
- package/src/mcp/daemon-session-host.ts +0 -230
- package/src/mcp/daemon-stdio-bridge.ts +0 -260
- package/src/mcp/daemon-worker-child-pool.ts +0 -213
- package/src/mcp/daemon-worker-inline-pool.ts +0 -46
- package/src/mcp/daemon-worker-pool.ts +0 -7
- package/src/mcp/daemon-worker-process.ts +0 -52
- package/src/mcp/daemon-worker-types.ts +0 -66
- package/src/mcp/metrics.ts +0 -176
- package/src/mcp/monitor-health.ts +0 -83
- package/src/mcp/monitor-persistence.ts +0 -54
- package/src/mcp/monitor-tick-job.ts +0 -102
- package/src/mcp/monitor-types.ts +0 -103
- package/src/mcp/persisted-local-history-graph.ts +0 -591
- package/src/mcp/persisted-local-history-policy.ts +0 -501
- package/src/mcp/persisted-local-history-views.ts +0 -250
- package/src/mcp/persisted-local-history.ts +0 -1621
- package/src/mcp/persistent-monitor-runtime.ts +0 -445
- package/src/mcp/policy.ts +0 -75
- package/src/mcp/receipt.ts +0 -201
- package/src/mcp/repo-concurrency.ts +0 -392
- package/src/mcp/repo-overview/filter.ts +0 -44
- package/src/mcp/repo-overview/types.ts +0 -63
- package/src/mcp/repo-overview/view-projection.ts +0 -90
- package/src/mcp/repo-state-git.ts +0 -247
- package/src/mcp/repo-state-observation.ts +0 -203
- package/src/mcp/repo-state-transition.ts +0 -151
- package/src/mcp/repo-state-types.ts +0 -107
- package/src/mcp/repo-state.ts +0 -146
- package/src/mcp/repo-tool-job.ts +0 -102
- package/src/mcp/repo-tool-worker-context.ts +0 -212
- package/src/mcp/repo-workspace.ts +0 -21
- package/src/mcp/run-capture-config.ts +0 -33
- package/src/mcp/runtime-causal-context.ts +0 -72
- package/src/mcp/runtime-observability.ts +0 -217
- package/src/mcp/runtime-staged-target.ts +0 -161
- package/src/mcp/runtime-workspace-overlay.ts +0 -255
- package/src/mcp/secret-scrub.ts +0 -89
- package/src/mcp/semantic-transition-guidance.ts +0 -60
- package/src/mcp/semantic-transition-summary.ts +0 -130
- package/src/mcp/server-context.ts +0 -223
- package/src/mcp/server-invocation.ts +0 -388
- package/src/mcp/server-tool-access.ts +0 -145
- package/src/mcp/server.ts +0 -265
- package/src/mcp/stdio-server.ts +0 -26
- package/src/mcp/stdio.ts +0 -3
- package/src/mcp/tool-registry.ts +0 -80
- package/src/mcp/tools/activity-view.ts +0 -325
- package/src/mcp/tools/budget.ts +0 -23
- package/src/mcp/tools/causal-attach.ts +0 -67
- package/src/mcp/tools/causal-status.ts +0 -58
- package/src/mcp/tools/changed-since.ts +0 -71
- package/src/mcp/tools/code-find.ts +0 -169
- package/src/mcp/tools/code-refs.ts +0 -470
- package/src/mcp/tools/code-show.ts +0 -262
- package/src/mcp/tools/daemon-monitors.ts +0 -14
- package/src/mcp/tools/daemon-repos.ts +0 -22
- package/src/mcp/tools/daemon-sessions.ts +0 -14
- package/src/mcp/tools/daemon-status.ts +0 -12
- package/src/mcp/tools/diagnostic-models.ts +0 -95
- package/src/mcp/tools/doctor.ts +0 -66
- package/src/mcp/tools/explain.ts +0 -84
- package/src/mcp/tools/file-outline.ts +0 -67
- package/src/mcp/tools/git-files.ts +0 -73
- package/src/mcp/tools/graft-diff.ts +0 -35
- package/src/mcp/tools/map-collector.ts +0 -338
- package/src/mcp/tools/map.ts +0 -185
- package/src/mcp/tools/monitor-pause.ts +0 -18
- package/src/mcp/tools/monitor-resume.ts +0 -18
- package/src/mcp/tools/monitor-start.ts +0 -20
- package/src/mcp/tools/monitor-stop.ts +0 -18
- package/src/mcp/tools/precision-live.ts +0 -158
- package/src/mcp/tools/precision-match.ts +0 -54
- package/src/mcp/tools/precision-paths.ts +0 -59
- package/src/mcp/tools/precision-query.ts +0 -127
- package/src/mcp/tools/precision-show.ts +0 -86
- package/src/mcp/tools/precision-visibility.ts +0 -44
- package/src/mcp/tools/precision-warp.ts +0 -90
- package/src/mcp/tools/precision.ts +0 -21
- package/src/mcp/tools/read-range.ts +0 -28
- package/src/mcp/tools/run-capture.ts +0 -149
- package/src/mcp/tools/safe-read.ts +0 -148
- package/src/mcp/tools/since.ts +0 -53
- package/src/mcp/tools/state.ts +0 -39
- package/src/mcp/tools/stats.ts +0 -24
- package/src/mcp/tools/workspace-authorizations.ts +0 -14
- package/src/mcp/tools/workspace-authorize.ts +0 -20
- package/src/mcp/tools/workspace-bind.ts +0 -25
- package/src/mcp/tools/workspace-rebind.ts +0 -25
- package/src/mcp/tools/workspace-revoke.ts +0 -18
- package/src/mcp/tools/workspace-status.ts +0 -12
- package/src/mcp/warp-pool.ts +0 -36
- package/src/mcp/workspace-read-observation-model.ts +0 -48
- package/src/mcp/workspace-read-observation.ts +0 -103
- package/src/mcp/workspace-router-capability.ts +0 -32
- package/src/mcp/workspace-router-history.ts +0 -233
- package/src/mcp/workspace-router-model.ts +0 -131
- package/src/mcp/workspace-router-resolution.ts +0 -71
- package/src/mcp/workspace-router-runtime.ts +0 -243
- package/src/mcp/workspace-router.ts +0 -681
- package/src/metrics/logger.ts +0 -40
- package/src/metrics/types.ts +0 -40
- package/src/operations/cached-file.ts +0 -40
- package/src/operations/diff-identity.ts +0 -127
- package/src/operations/file-outline.ts +0 -48
- package/src/operations/graft-diff.ts +0 -162
- package/src/operations/observation-cache.ts +0 -149
- package/src/operations/read-range.ts +0 -64
- package/src/operations/repo-workspace.ts +0 -339
- package/src/operations/result-dto.ts +0 -23
- package/src/operations/safe-read.ts +0 -118
- package/src/operations/state.ts +0 -66
- package/src/operations/structured-buffer-compare.ts +0 -429
- package/src/operations/structured-buffer-model.ts +0 -456
- package/src/operations/structured-buffer-query.ts +0 -794
- package/src/operations/structured-buffer.ts +0 -181
- package/src/parser/diff.ts +0 -313
- package/src/parser/lang.ts +0 -71
- package/src/parser/markdown.ts +0 -197
- package/src/parser/outline.ts +0 -316
- package/src/parser/runtime.ts +0 -71
- package/src/parser/types.ts +0 -75
- package/src/policy/evaluate.ts +0 -178
- package/src/policy/graftignore.ts +0 -6
- package/src/policy/types.ts +0 -87
- package/src/ports/codec.ts +0 -13
- package/src/ports/filesystem.ts +0 -18
- package/src/ports/git.ts +0 -16
- package/src/ports/guards.ts +0 -68
- package/src/ports/process-runner.ts +0 -22
- package/src/ports/warp.ts +0 -55
- package/src/release/security-gate.ts +0 -102
- package/src/session/tracker.ts +0 -145
- package/src/session/types.ts +0 -23
- package/src/version.ts +0 -3
- 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/observers.ts +0 -100
- package/src/warp/open.ts +0 -93
- package/src/warp/plumbing.d.ts +0 -15
- package/src/warp/symbol-identity.ts +0 -100
- package/src/warp/writer-id.ts +0 -30
package/dist/warp/indexer.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WARP Indexer — walks git history and writes structural delta
|
|
3
|
-
* patches into the WARP graph.
|
|
4
|
-
*/
|
|
5
|
-
import { assignCanonicalSymbolIdentities } from "./symbol-identity.js";
|
|
6
|
-
import { applyModifiedSymbols, emitDirectoryChain, emitSymbols, loadPriorIdentityMap, removeSymbols, resolveParentTick, } from "./indexer-graph.js";
|
|
7
|
-
import { getCommitChanges, getCommitMeta, getParentSha, hasParent, listCommits, prepareChange, } from "./indexer-git.js";
|
|
8
|
-
import { fileNodeId } from "./indexer-model.js";
|
|
9
|
-
export async function indexCommits(warp, options) {
|
|
10
|
-
try {
|
|
11
|
-
return await indexCommitsCore(warp, options);
|
|
12
|
-
}
|
|
13
|
-
catch (err) {
|
|
14
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
15
|
-
return { ok: false, error: message };
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
async function indexCommitsCore(warp, options) {
|
|
19
|
-
const { cwd, git: gitClient } = options;
|
|
20
|
-
const commits = await listCommits(gitClient, cwd, options.from, options.to);
|
|
21
|
-
let patchesWritten = 0;
|
|
22
|
-
const commitTicks = new Map();
|
|
23
|
-
const liveIdentityByFile = new Map();
|
|
24
|
-
for (const sha of commits) {
|
|
25
|
-
const changes = await getCommitChanges(gitClient, sha, cwd);
|
|
26
|
-
const hasRemovals = changes.some((change) => change.status === "D" || change.status === "M" || change.status === "R");
|
|
27
|
-
if (hasRemovals) {
|
|
28
|
-
await warp.materialize();
|
|
29
|
-
}
|
|
30
|
-
const meta = await getCommitMeta(gitClient, sha, cwd);
|
|
31
|
-
const parentExists = await hasParent(gitClient, sha, cwd);
|
|
32
|
-
const parentRef = `${sha}~1`;
|
|
33
|
-
const parentSha = parentExists ? await getParentSha(gitClient, sha, cwd) : null;
|
|
34
|
-
const preparedChanges = await Promise.all(changes.map((change) => prepareChange(gitClient, cwd, sha, parentRef, parentExists, change)));
|
|
35
|
-
const parentTick = await resolveParentTick(warp, commitTicks, parentSha);
|
|
36
|
-
const resolvedChanges = await Promise.all(preparedChanges.map(async (change) => {
|
|
37
|
-
const oldIdentitySourcePath = change.previousPath ?? change.filePath;
|
|
38
|
-
const oldIdentityByPath = await loadPriorIdentityMap(warp, liveIdentityByFile, oldIdentitySourcePath, parentTick);
|
|
39
|
-
const newIdentityByPath = change.lang !== null && change.newOutline !== undefined
|
|
40
|
-
? assignCanonicalSymbolIdentities({
|
|
41
|
-
oldEntries: change.oldOutline,
|
|
42
|
-
newEntries: change.newOutline,
|
|
43
|
-
oldIdentityByPath,
|
|
44
|
-
commitSha: sha,
|
|
45
|
-
filePath: change.filePath,
|
|
46
|
-
})
|
|
47
|
-
: new Map();
|
|
48
|
-
return {
|
|
49
|
-
...change,
|
|
50
|
-
newIdentityByPath,
|
|
51
|
-
};
|
|
52
|
-
}));
|
|
53
|
-
await warp.patch((builder) => {
|
|
54
|
-
const patch = builder;
|
|
55
|
-
const commitId = `commit:${sha}`;
|
|
56
|
-
patch.addNode(commitId);
|
|
57
|
-
patch.setProperty(commitId, "sha", sha);
|
|
58
|
-
patch.setProperty(commitId, "message", meta.message);
|
|
59
|
-
patch.setProperty(commitId, "author", meta.author);
|
|
60
|
-
patch.setProperty(commitId, "email", meta.email);
|
|
61
|
-
patch.setProperty(commitId, "timestamp", meta.timestamp);
|
|
62
|
-
patch.setProperty(commitId, "tick", patchesWritten + 1);
|
|
63
|
-
for (const change of resolvedChanges) {
|
|
64
|
-
if (change.status === "D") {
|
|
65
|
-
if (change.lang !== null) {
|
|
66
|
-
removeSymbols(patch, change.filePath, change.oldOutline, "", commitId);
|
|
67
|
-
}
|
|
68
|
-
patch.removeNode(change.fileId);
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
patch.addNode(change.fileId);
|
|
72
|
-
patch.setProperty(change.fileId, "path", change.filePath);
|
|
73
|
-
patch.setProperty(change.fileId, "lang", change.lang ?? "unknown");
|
|
74
|
-
patch.addEdge(commitId, change.fileId, "touches");
|
|
75
|
-
emitDirectoryChain(patch, change.filePath);
|
|
76
|
-
if (change.lang === null || change.newOutline === undefined || change.jumpLookup === undefined) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (change.status === "R" && change.previousPath !== undefined) {
|
|
80
|
-
removeSymbols(patch, change.previousPath, change.oldOutline, "", commitId);
|
|
81
|
-
patch.removeNode(fileNodeId(change.previousPath));
|
|
82
|
-
emitSymbols(patch, change.filePath, change.newOutline, change.jumpLookup, change.newIdentityByPath, undefined, "", commitId);
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (change.status === "A" || !change.parentExists || change.diff === undefined) {
|
|
86
|
-
emitSymbols(patch, change.filePath, change.newOutline, change.jumpLookup, change.newIdentityByPath, undefined, "", commitId);
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
applyModifiedSymbols(patch, change.filePath, change.fileId, commitId, change.oldOutline, change.newOutline, change.jumpLookup, change.newIdentityByPath);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
patchesWritten++;
|
|
93
|
-
commitTicks.set(sha, patchesWritten);
|
|
94
|
-
for (const change of resolvedChanges) {
|
|
95
|
-
if (change.status === "D") {
|
|
96
|
-
liveIdentityByFile.delete(change.filePath);
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
if (change.previousPath !== undefined && change.previousPath !== change.filePath) {
|
|
100
|
-
liveIdentityByFile.delete(change.previousPath);
|
|
101
|
-
}
|
|
102
|
-
if (change.newOutline !== undefined && change.lang !== null) {
|
|
103
|
-
liveIdentityByFile.set(change.filePath, new Map(change.newIdentityByPath));
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
liveIdentityByFile.delete(change.filePath);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return { ok: true, commitsIndexed: commits.length, patchesWritten, commitTicks };
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=indexer.js.map
|
package/dist/warp/indexer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexer.js","sourceRoot":"","sources":["../../src/warp/indexer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAsD,MAAM,oBAAoB,CAAC;AAIpG,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,IAAgB,EAChB,OAAqB;IAErB,IAAI,CAAC;QACH,OAAO,MAAM,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,EAAE,EAA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C;QACjB,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAErC,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;YACrC,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC1B,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC3C,SAAS;YACX,CAAC;YACD,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,IAAI,MAAM,CAAC,YAAY,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACjF,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACjD,CAAC;YACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;gBAC5D,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACN,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC;AACnF,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { OutlineEntry } from "../parser/types.js";
|
|
2
|
-
export type SymbolIdentityMap = ReadonlyMap<string, string>;
|
|
3
|
-
export declare function buildSymbolPath(parentPath: string, name: string): string;
|
|
4
|
-
export declare function assignCanonicalSymbolIdentities(input: {
|
|
5
|
-
oldEntries: readonly OutlineEntry[];
|
|
6
|
-
newEntries: readonly OutlineEntry[];
|
|
7
|
-
oldIdentityByPath: SymbolIdentityMap;
|
|
8
|
-
commitSha: string;
|
|
9
|
-
filePath: string;
|
|
10
|
-
}): Map<string, string>;
|
|
11
|
-
//# sourceMappingURL=symbol-identity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-identity.d.ts","sourceRoot":"","sources":["../../src/warp/symbol-identity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5D,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAExE;AAmBD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IACpC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IACpC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAetB"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import crypto from "node:crypto";
|
|
2
|
-
import { diffOutlines } from "../parser/diff.js";
|
|
3
|
-
export function buildSymbolPath(parentPath, name) {
|
|
4
|
-
return parentPath.length > 0 ? `${parentPath}.${name}` : name;
|
|
5
|
-
}
|
|
6
|
-
function mintCanonicalSymbolIdentity(commitSha, filePath, symbolPath, entry) {
|
|
7
|
-
const seed = [
|
|
8
|
-
commitSha,
|
|
9
|
-
filePath,
|
|
10
|
-
symbolPath,
|
|
11
|
-
entry.kind,
|
|
12
|
-
entry.signature ?? "",
|
|
13
|
-
String(entry.exported),
|
|
14
|
-
].join("\n");
|
|
15
|
-
return `sid:${crypto.createHash("sha256").update(seed).digest("hex").slice(0, 16)}`;
|
|
16
|
-
}
|
|
17
|
-
export function assignCanonicalSymbolIdentities(input) {
|
|
18
|
-
const assigned = new Map();
|
|
19
|
-
assignLevel({
|
|
20
|
-
oldEntries: input.oldEntries,
|
|
21
|
-
newEntries: input.newEntries,
|
|
22
|
-
oldIdentityByPath: input.oldIdentityByPath,
|
|
23
|
-
commitSha: input.commitSha,
|
|
24
|
-
filePath: input.filePath,
|
|
25
|
-
oldParentPath: "",
|
|
26
|
-
newParentPath: "",
|
|
27
|
-
assigned,
|
|
28
|
-
});
|
|
29
|
-
return assigned;
|
|
30
|
-
}
|
|
31
|
-
function assignLevel(input) {
|
|
32
|
-
const oldByName = new Map();
|
|
33
|
-
for (const entry of input.oldEntries) {
|
|
34
|
-
oldByName.set(entry.name, entry);
|
|
35
|
-
}
|
|
36
|
-
const continuityByNewName = new Map();
|
|
37
|
-
const diff = diffOutlines(input.oldEntries, input.newEntries);
|
|
38
|
-
for (const continuity of diff.continuity) {
|
|
39
|
-
continuityByNewName.set(continuity.newName, continuity.oldName);
|
|
40
|
-
}
|
|
41
|
-
for (const newEntry of input.newEntries) {
|
|
42
|
-
const newSymbolPath = buildSymbolPath(input.newParentPath, newEntry.name);
|
|
43
|
-
const oldName = oldByName.has(newEntry.name)
|
|
44
|
-
? newEntry.name
|
|
45
|
-
: continuityByNewName.get(newEntry.name);
|
|
46
|
-
const oldEntry = oldName !== undefined ? oldByName.get(oldName) : undefined;
|
|
47
|
-
const oldSymbolPath = oldName !== undefined
|
|
48
|
-
? buildSymbolPath(input.oldParentPath, oldName)
|
|
49
|
-
: null;
|
|
50
|
-
const identityId = oldSymbolPath !== null
|
|
51
|
-
? input.oldIdentityByPath.get(oldSymbolPath) ??
|
|
52
|
-
mintCanonicalSymbolIdentity(input.commitSha, input.filePath, newSymbolPath, newEntry)
|
|
53
|
-
: mintCanonicalSymbolIdentity(input.commitSha, input.filePath, newSymbolPath, newEntry);
|
|
54
|
-
input.assigned.set(newSymbolPath, identityId);
|
|
55
|
-
assignLevel({
|
|
56
|
-
oldEntries: oldEntry?.children ?? [],
|
|
57
|
-
newEntries: newEntry.children ?? [],
|
|
58
|
-
oldIdentityByPath: input.oldIdentityByPath,
|
|
59
|
-
commitSha: input.commitSha,
|
|
60
|
-
filePath: input.filePath,
|
|
61
|
-
oldParentPath: oldSymbolPath ?? "",
|
|
62
|
-
newParentPath: newSymbolPath,
|
|
63
|
-
assigned: input.assigned,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=symbol-identity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-identity.js","sourceRoot":"","sources":["../../src/warp/symbol-identity.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,MAAM,UAAU,eAAe,CAAC,UAAkB,EAAE,IAAY;IAC9D,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC;AAED,SAAS,2BAA2B,CAClC,SAAiB,EACjB,QAAgB,EAChB,UAAkB,EAClB,KAAmB;IAEnB,MAAM,IAAI,GAAG;QACX,SAAS;QACT,QAAQ;QACR,UAAU;QACV,KAAK,CAAC,IAAI;QACV,KAAK,CAAC,SAAS,IAAI,EAAE;QACrB,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;KACvB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,OAAO,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,KAM/C;IACC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE3C,WAAW,CAAC;QACV,UAAU,EAAE,KAAK,CAAC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,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5E,MAAM,aAAa,GAAG,OAAO,KAAK,SAAS;YACzC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC;YAC/C,CAAC,CAAC,IAAI,CAAC;QAET,MAAM,UAAU,GAAG,aAAa,KAAK,IAAI;YACvC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC;gBAC1C,2BAA2B,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC;YACvF,CAAC,CAAC,2BAA2B,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;QAE1F,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAE9C,WAAW,CAAC;YACV,UAAU,EAAE,QAAQ,EAAE,QAAQ,IAAI,EAAE;YACpC,UAAU,EAAE,QAAQ,CAAC,QAAQ,IAAI,EAAE;YACnC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,aAAa,EAAE,aAAa,IAAI,EAAE;YAClC,aAAa,EAAE,aAAa;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACzB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// CanonicalJsonCodec — deterministic JSON with sorted keys
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
//
|
|
5
|
-
// Subset of RFC 8785 (JSON Canonicalization Scheme):
|
|
6
|
-
// - Object keys sorted lexicographically at every nesting level
|
|
7
|
-
// - Compact output (no whitespace)
|
|
8
|
-
// - Deterministic: same data always produces the same string
|
|
9
|
-
//
|
|
10
|
-
// Enables stable hashes, diffable logs, reproducible receipts.
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
|
|
13
|
-
import type { JsonCodec } from "../ports/codec.js";
|
|
14
|
-
|
|
15
|
-
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
16
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
const proto = Object.getPrototypeOf(value) as unknown;
|
|
20
|
-
return proto === Object.prototype || proto === null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function sortDeep(value: unknown, seen = new WeakSet()): unknown {
|
|
24
|
-
if (value === null || typeof value !== "object") {
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
if (!isPlainObject(value) && !Array.isArray(value)) {
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
if (seen.has(value)) {
|
|
31
|
-
throw new TypeError("Converting circular structure to JSON");
|
|
32
|
-
}
|
|
33
|
-
seen.add(value);
|
|
34
|
-
try {
|
|
35
|
-
if (Array.isArray(value)) {
|
|
36
|
-
return value.map((v) => sortDeep(v, seen));
|
|
37
|
-
}
|
|
38
|
-
const sorted: Record<string, unknown> = {};
|
|
39
|
-
for (const key of Object.keys(value).sort()) {
|
|
40
|
-
sorted[key] = sortDeep(value[key], seen);
|
|
41
|
-
}
|
|
42
|
-
return sorted;
|
|
43
|
-
} finally {
|
|
44
|
-
seen.delete(value);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export class CanonicalJsonCodec implements JsonCodec {
|
|
49
|
-
encode(value: unknown): string {
|
|
50
|
-
return JSON.stringify(sortDeep(value));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
decode(data: string): unknown {
|
|
54
|
-
return JSON.parse(data) as unknown;
|
|
55
|
-
}
|
|
56
|
-
}
|
package/src/adapters/node-fs.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// Node.js filesystem adapter — implements the FileSystem port
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
|
|
5
|
-
import * as fs from "node:fs";
|
|
6
|
-
import * as fsp from "node:fs/promises";
|
|
7
|
-
import type { FileSystem } from "../ports/filesystem.js";
|
|
8
|
-
|
|
9
|
-
class NodeFileSystem implements FileSystem {
|
|
10
|
-
readFile(path: string, encoding: "utf-8"): Promise<string>;
|
|
11
|
-
readFile(path: string): Promise<Buffer>;
|
|
12
|
-
readFile(path: string, encoding?: "utf-8"): Promise<string | Buffer> {
|
|
13
|
-
if (encoding !== undefined) return fsp.readFile(path, encoding);
|
|
14
|
-
return fsp.readFile(path);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
readdir(path: string): Promise<string[]> {
|
|
18
|
-
return fsp.readdir(path);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
writeFile(path: string, data: string, encoding: "utf-8"): Promise<void> {
|
|
22
|
-
return fsp.writeFile(path, data, encoding);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
appendFile(path: string, data: string, encoding: "utf-8"): Promise<void> {
|
|
26
|
-
return fsp.appendFile(path, data, encoding);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async mkdir(path: string, options: { recursive: true }): Promise<void> {
|
|
30
|
-
await fsp.mkdir(path, options);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async stat(path: string): Promise<{ size: number }> {
|
|
34
|
-
const s = await fsp.stat(path);
|
|
35
|
-
return { size: s.size };
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
readFileSync(path: string, encoding: "utf-8"): string {
|
|
39
|
-
return fs.readFileSync(path, encoding);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const nodeFs: FileSystem = new NodeFileSystem();
|
package/src/adapters/node-git.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// NodeGitClient — implements the GitClient port via GitPlumbing
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
|
|
5
|
-
import GitPlumbing from "@git-stunts/plumbing";
|
|
6
|
-
import type { GitClient, GitRunRequest } from "../ports/git.js";
|
|
7
|
-
|
|
8
|
-
class NodeGitClient implements GitClient {
|
|
9
|
-
private readonly clients = new Map<string, GitPlumbing>();
|
|
10
|
-
|
|
11
|
-
private resolveClient(cwd: string): GitPlumbing {
|
|
12
|
-
const cached = this.clients.get(cwd);
|
|
13
|
-
if (cached !== undefined) return cached;
|
|
14
|
-
const created = GitPlumbing.createDefault({ cwd });
|
|
15
|
-
this.clients.set(cwd, created);
|
|
16
|
-
return created;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async run(request: GitRunRequest) {
|
|
20
|
-
try {
|
|
21
|
-
const plumbing = this.resolveClient(request.cwd);
|
|
22
|
-
const stream = await plumbing.executeStream({ args: [...request.args] });
|
|
23
|
-
const stdout = await stream.collect({
|
|
24
|
-
asString: true,
|
|
25
|
-
...(request.maxBufferBytes !== undefined ? { maxBytes: request.maxBufferBytes } : {}),
|
|
26
|
-
});
|
|
27
|
-
const finished = await stream.finished;
|
|
28
|
-
const error = "error" in finished && finished.error instanceof Error ? finished.error : undefined;
|
|
29
|
-
return {
|
|
30
|
-
status: finished.code,
|
|
31
|
-
stdout: typeof stdout === "string" ? stdout : new TextDecoder().decode(stdout),
|
|
32
|
-
stderr: finished.stderr,
|
|
33
|
-
...(error !== undefined ? { error } : {}),
|
|
34
|
-
};
|
|
35
|
-
} catch (error: unknown) {
|
|
36
|
-
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
37
|
-
return {
|
|
38
|
-
status: 1,
|
|
39
|
-
stdout: "",
|
|
40
|
-
stderr: normalized.message,
|
|
41
|
-
error: normalized,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const nodeGit: GitClient = new NodeGitClient();
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// NodeProcessRunner — implements the ProcessRunner port
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
|
|
5
|
-
import { spawnSync } from "node:child_process";
|
|
6
|
-
import type { ProcessRunRequest, ProcessRunResult, ProcessRunner } from "../ports/process-runner.js";
|
|
7
|
-
|
|
8
|
-
class NodeProcessRunner implements ProcessRunner {
|
|
9
|
-
run(request: ProcessRunRequest): ProcessRunResult {
|
|
10
|
-
const result = spawnSync(request.command, [...request.args], {
|
|
11
|
-
cwd: request.cwd,
|
|
12
|
-
encoding: "utf-8",
|
|
13
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
14
|
-
...(request.timeoutMs !== undefined ? { timeout: request.timeoutMs } : {}),
|
|
15
|
-
...(request.maxBufferBytes !== undefined ? { maxBuffer: request.maxBufferBytes } : {}),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
status: result.status,
|
|
20
|
-
stdout: typeof result.stdout === "string" ? result.stdout : "",
|
|
21
|
-
stderr: typeof result.stderr === "string" ? result.stderr : "",
|
|
22
|
-
...(result.error !== undefined ? { error: result.error } : {}),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const nodeProcessRunner: ProcessRunner = new NodeProcessRunner();
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
|
|
3
|
-
export function createRepoPathResolver(projectRoot: string): (input: string) => string {
|
|
4
|
-
return (input: string): string => {
|
|
5
|
-
if (path.isAbsolute(input)) return input;
|
|
6
|
-
const resolved = path.resolve(projectRoot, input);
|
|
7
|
-
const relative = path.relative(projectRoot, resolved);
|
|
8
|
-
if (relative.startsWith("..")) {
|
|
9
|
-
throw new Error(`Path traversal blocked: ${input}`);
|
|
10
|
-
}
|
|
11
|
-
return resolved;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function toRepoPolicyPath(projectRoot: string, filePath: string): string {
|
|
16
|
-
const absolutePath = path.isAbsolute(filePath) ? filePath : path.resolve(projectRoot, filePath);
|
|
17
|
-
const relativePath = path.relative(projectRoot, absolutePath);
|
|
18
|
-
if (relativePath.length === 0 || relativePath.startsWith("..") || path.isAbsolute(relativePath)) {
|
|
19
|
-
return absolutePath;
|
|
20
|
-
}
|
|
21
|
-
return relativePath.split(path.sep).join("/");
|
|
22
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
import type { JsonCodec } from "../ports/codec.js";
|
|
3
|
-
import type { FileSystem } from "../ports/filesystem.js";
|
|
4
|
-
|
|
5
|
-
export interface RotatingNdjsonLogOptions {
|
|
6
|
-
readonly fs: FileSystem;
|
|
7
|
-
readonly codec: JsonCodec;
|
|
8
|
-
readonly logPath: string;
|
|
9
|
-
readonly maxBytes?: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const DEFAULT_MAX_BYTES = 1_048_576;
|
|
13
|
-
|
|
14
|
-
export class RotatingNdjsonLog {
|
|
15
|
-
private readonly fs: FileSystem;
|
|
16
|
-
private readonly codec: JsonCodec;
|
|
17
|
-
private readonly logPath: string;
|
|
18
|
-
private readonly maxBytes: number;
|
|
19
|
-
|
|
20
|
-
constructor(options: RotatingNdjsonLogOptions) {
|
|
21
|
-
this.fs = options.fs;
|
|
22
|
-
this.codec = options.codec;
|
|
23
|
-
this.logPath = options.logPath;
|
|
24
|
-
this.maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async append(entry: object): Promise<void> {
|
|
28
|
-
const line = this.codec.encode(entry) + "\n";
|
|
29
|
-
const dir = path.dirname(this.logPath);
|
|
30
|
-
await this.fs.mkdir(dir, { recursive: true });
|
|
31
|
-
await this.fs.appendFile(this.logPath, line, "utf-8");
|
|
32
|
-
await this.rotateIfNeeded();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
private async rotateIfNeeded(): Promise<void> {
|
|
36
|
-
let stat: { size: number };
|
|
37
|
-
try {
|
|
38
|
-
stat = await this.fs.stat(this.logPath);
|
|
39
|
-
} catch {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (stat.size <= this.maxBytes) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const content = await this.fs.readFile(this.logPath, "utf-8");
|
|
48
|
-
const lines = content.trimEnd().split("\n");
|
|
49
|
-
let kept = lines.slice(Math.ceil(lines.length / 2));
|
|
50
|
-
|
|
51
|
-
// If slicing left nothing (e.g. a single oversized entry), skip rotation —
|
|
52
|
-
// the file is already at minimum size (one entry).
|
|
53
|
-
if (kept.length === 0) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let result = kept.join("\n") + "\n";
|
|
58
|
-
|
|
59
|
-
while (Buffer.byteLength(result, "utf-8") > this.maxBytes && kept.length > 1) {
|
|
60
|
-
kept = kept.slice(Math.ceil(kept.length / 2));
|
|
61
|
-
result = kept.join("\n") + "\n";
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
await this.fs.writeFile(this.logPath, result, "utf-8");
|
|
65
|
-
}
|
|
66
|
-
}
|
package/src/api/index.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { startDaemonServer } from "../mcp/daemon-server.js";
|
|
2
|
-
import { MCP_TOOL_NAMES } from "../contracts/capabilities.js";
|
|
3
|
-
import { createGraftServer } from "../mcp/server.js";
|
|
4
|
-
import { startStdioServer } from "../mcp/stdio-server.js";
|
|
5
|
-
import { ObservationCache } from "../operations/observation-cache.js";
|
|
6
|
-
import { RepoWorkspace } from "../operations/repo-workspace.js";
|
|
7
|
-
import { StructuredBuffer } from "../operations/structured-buffer.js";
|
|
8
|
-
import type { BufferRange, WarmProjectionBasis, WarmProjectionBundleResult } from "../operations/structured-buffer.js";
|
|
9
|
-
import { GRAFT_VERSION } from "../version.js";
|
|
10
|
-
export { createRepoLocalGraft, type CreateRepoLocalGraftOptions } from "./repo-local-graft.js";
|
|
11
|
-
export { createRepoWorkspace, type CreateRepoWorkspaceOptions } from "./repo-workspace.js";
|
|
12
|
-
export { callGraftTool, parseGraftToolPayload } from "./tool-bridge.js";
|
|
13
|
-
|
|
14
|
-
export interface CreateStructuredBufferOptions {
|
|
15
|
-
readonly basis?: WarmProjectionBasis | undefined;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface CreateProjectionBundleOptions extends CreateStructuredBufferOptions {
|
|
19
|
-
readonly viewport?: BufferRange | undefined;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function createStructuredBuffer(
|
|
23
|
-
path: string,
|
|
24
|
-
content: string,
|
|
25
|
-
options: CreateStructuredBufferOptions = {},
|
|
26
|
-
): StructuredBuffer {
|
|
27
|
-
return new StructuredBuffer({ path, content, basis: options.basis });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function createProjectionBundle(
|
|
31
|
-
path: string,
|
|
32
|
-
content: string,
|
|
33
|
-
options: CreateProjectionBundleOptions = {},
|
|
34
|
-
): WarmProjectionBundleResult {
|
|
35
|
-
const buffer = new StructuredBuffer({ path, content, basis: options.basis });
|
|
36
|
-
try {
|
|
37
|
-
return buffer.projectionBundle({ viewport: options.viewport });
|
|
38
|
-
} finally {
|
|
39
|
-
buffer.dispose();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
GRAFT_VERSION,
|
|
45
|
-
MCP_TOOL_NAMES,
|
|
46
|
-
ObservationCache,
|
|
47
|
-
RepoWorkspace,
|
|
48
|
-
StructuredBuffer,
|
|
49
|
-
createGraftServer,
|
|
50
|
-
startDaemonServer,
|
|
51
|
-
startStdioServer,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type {
|
|
55
|
-
AnchorAffinityResult,
|
|
56
|
-
BufferDiagnostic,
|
|
57
|
-
BufferOutlineResult,
|
|
58
|
-
BufferPoint,
|
|
59
|
-
BufferRange,
|
|
60
|
-
BufferSelection,
|
|
61
|
-
ChangedRegion,
|
|
62
|
-
DiagnosticsResult,
|
|
63
|
-
FoldRegion,
|
|
64
|
-
FoldRegionsResult,
|
|
65
|
-
InjectionRegion,
|
|
66
|
-
InjectionResult,
|
|
67
|
-
NodeLookupResult,
|
|
68
|
-
NodeSummary,
|
|
69
|
-
RenameEditPreview,
|
|
70
|
-
RenamePreviewResult,
|
|
71
|
-
SelectionStepResult,
|
|
72
|
-
SemanticSummaryKind,
|
|
73
|
-
SemanticSummaryResult,
|
|
74
|
-
StructuredBufferDiffResult,
|
|
75
|
-
SymbolOccurrence,
|
|
76
|
-
SymbolOccurrencesResult,
|
|
77
|
-
SyntaxClass,
|
|
78
|
-
SyntaxSpan,
|
|
79
|
-
SyntaxSpanResult,
|
|
80
|
-
WarmProjectionBundleResult,
|
|
81
|
-
WarmProjectionParseStatus,
|
|
82
|
-
WarmProjectionBasis,
|
|
83
|
-
} from "../operations/structured-buffer.js";
|
|
84
|
-
|
|
85
|
-
export type {
|
|
86
|
-
StartDaemonServerOptions,
|
|
87
|
-
} from "../mcp/daemon-server.js";
|
|
88
|
-
|
|
89
|
-
export type {
|
|
90
|
-
CreateGraftServerOptions,
|
|
91
|
-
GraftServer,
|
|
92
|
-
McpToolResult,
|
|
93
|
-
} from "../mcp/server.js";
|
|
94
|
-
|
|
95
|
-
export type {
|
|
96
|
-
McpToolName,
|
|
97
|
-
} from "../contracts/capabilities.js";
|
|
98
|
-
|
|
99
|
-
export type {
|
|
100
|
-
RepoWorkspaceChangedSinceResult,
|
|
101
|
-
RepoWorkspaceFileOutlineResult,
|
|
102
|
-
RepoWorkspaceReadRangeResult,
|
|
103
|
-
RepoWorkspaceRefusedResult,
|
|
104
|
-
RepoWorkspaceSafeReadCacheHitResult,
|
|
105
|
-
RepoWorkspaceSafeReadDiffResult,
|
|
106
|
-
RepoWorkspaceSafeReadResult,
|
|
107
|
-
} from "../operations/repo-workspace.js";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
createGraftServer,
|
|
4
|
-
type CreateGraftServerOptions,
|
|
5
|
-
type GraftServer,
|
|
6
|
-
} from "../mcp/server.js";
|
|
7
|
-
|
|
8
|
-
export interface CreateRepoLocalGraftOptions extends Omit<CreateGraftServerOptions, "mode" | "projectRoot" | "graftDir"> {
|
|
9
|
-
readonly cwd?: string | undefined;
|
|
10
|
-
readonly graftDir?: string | undefined;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function createRepoLocalGraft(options: CreateRepoLocalGraftOptions = {}): GraftServer {
|
|
14
|
-
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
15
|
-
return createGraftServer({
|
|
16
|
-
...options,
|
|
17
|
-
mode: "repo_local",
|
|
18
|
-
projectRoot: cwd,
|
|
19
|
-
graftDir: options.graftDir ?? path.join(cwd, ".graft"),
|
|
20
|
-
});
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
import { CanonicalJsonCodec } from "../adapters/canonical-json.js";
|
|
3
|
-
import { nodeFs } from "../adapters/node-fs.js";
|
|
4
|
-
import { createRepoPathResolver, toRepoPolicyPath } from "../adapters/repo-paths.js";
|
|
5
|
-
import { ObservationCache } from "../operations/observation-cache.js";
|
|
6
|
-
import { RepoWorkspace } from "../operations/repo-workspace.js";
|
|
7
|
-
import { GovernorTracker } from "../session/tracker.js";
|
|
8
|
-
import type { JsonCodec } from "../ports/codec.js";
|
|
9
|
-
import type { FileSystem } from "../ports/filesystem.js";
|
|
10
|
-
|
|
11
|
-
export interface CreateRepoWorkspaceOptions {
|
|
12
|
-
readonly cwd?: string | undefined;
|
|
13
|
-
readonly graftignorePatterns?: readonly string[] | undefined;
|
|
14
|
-
readonly fs?: FileSystem | undefined;
|
|
15
|
-
readonly codec?: JsonCodec | undefined;
|
|
16
|
-
readonly governor?: GovernorTracker | undefined;
|
|
17
|
-
readonly cache?: ObservationCache | undefined;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export async function createRepoWorkspace(options: CreateRepoWorkspaceOptions = {}): Promise<RepoWorkspace> {
|
|
21
|
-
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
22
|
-
const fs = options.fs ?? nodeFs;
|
|
23
|
-
const codec = options.codec ?? new CanonicalJsonCodec();
|
|
24
|
-
return new RepoWorkspace({
|
|
25
|
-
projectRoot: cwd,
|
|
26
|
-
fs,
|
|
27
|
-
codec,
|
|
28
|
-
graftignorePatterns: options.graftignorePatterns ?? await RepoWorkspace.loadGraftignorePatterns(fs, cwd),
|
|
29
|
-
resolvePath: createRepoPathResolver(cwd),
|
|
30
|
-
toPolicyPath: (resolvedPath) => toRepoPolicyPath(cwd, resolvedPath),
|
|
31
|
-
...(options.governor !== undefined ? { governor: options.governor } : {}),
|
|
32
|
-
...(options.cache !== undefined ? { cache: options.cache } : {}),
|
|
33
|
-
});
|
|
34
|
-
}
|
package/src/api/tool-bridge.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { McpToolName } from "../contracts/capabilities.js";
|
|
2
|
-
import { type JsonObject, parseJsonTextObject } from "../contracts/json-object.js";
|
|
3
|
-
import { getMcpOutputSchema, type McpOutputFor } from "../contracts/output-schemas.js";
|
|
4
|
-
import type { GraftServer, McpToolResult } from "../mcp/server.js";
|
|
5
|
-
|
|
6
|
-
export function parseGraftToolPayload(result: McpToolResult): JsonObject {
|
|
7
|
-
const payload = result.content.find((item) => item.type === "text");
|
|
8
|
-
if (payload === undefined) {
|
|
9
|
-
throw new Error("Graft tool result did not contain a text payload");
|
|
10
|
-
}
|
|
11
|
-
return parseJsonTextObject(payload.text, "Graft tool result");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export async function callGraftTool<K extends McpToolName>(
|
|
15
|
-
graft: GraftServer,
|
|
16
|
-
name: K,
|
|
17
|
-
args: JsonObject,
|
|
18
|
-
): Promise<McpOutputFor<K>> {
|
|
19
|
-
const parsed = parseGraftToolPayload(await graft.callTool(name, args));
|
|
20
|
-
return getMcpOutputSchema(name).parse(parsed) as McpOutputFor<K>;
|
|
21
|
-
}
|