contextpro-mcp 0.0.0-stage → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +425 -0
- package/INSTALL.md +218 -0
- package/INSTRUCTIONS.md +33 -0
- package/LICENSE +21 -0
- package/NOTICE +12 -0
- package/README.md +89 -2
- package/SECURITY.md +29 -0
- package/agent-guide.md +354 -0
- package/agent-instructions.md +1 -0
- package/build/core/agent-setup.d.ts +5 -0
- package/build/core/agent-setup.d.ts.map +1 -0
- package/build/core/agent-setup.js +95 -0
- package/build/core/agent-setup.js.map +1 -0
- package/build/core/artifacts.d.ts +64 -0
- package/build/core/artifacts.d.ts.map +1 -0
- package/build/core/artifacts.js +370 -0
- package/build/core/artifacts.js.map +1 -0
- package/build/core/bounded-source.d.ts +15 -0
- package/build/core/bounded-source.d.ts.map +1 -0
- package/build/core/bounded-source.js +78 -0
- package/build/core/bounded-source.js.map +1 -0
- package/build/core/changed-since.d.ts +20 -0
- package/build/core/changed-since.d.ts.map +1 -0
- package/build/core/changed-since.js +43 -0
- package/build/core/changed-since.js.map +1 -0
- package/build/core/chat-model.d.ts +8 -0
- package/build/core/chat-model.d.ts.map +1 -0
- package/build/core/chat-model.js +135 -0
- package/build/core/chat-model.js.map +1 -0
- package/build/core/clustering.d.ts +6 -0
- package/build/core/clustering.d.ts.map +1 -0
- package/build/core/clustering.js +201 -0
- package/build/core/clustering.js.map +1 -0
- package/build/core/context-metadata.d.ts +50 -0
- package/build/core/context-metadata.d.ts.map +1 -0
- package/build/core/context-metadata.js +118 -0
- package/build/core/context-metadata.js.map +1 -0
- package/build/core/data-dir.d.ts +5 -0
- package/build/core/data-dir.d.ts.map +1 -0
- package/build/core/data-dir.js +61 -0
- package/build/core/data-dir.js.map +1 -0
- package/build/core/db-native.d.ts +28 -0
- package/build/core/db-native.d.ts.map +1 -0
- package/build/core/db-native.js +120 -0
- package/build/core/db-native.js.map +1 -0
- package/build/core/db.d.ts +294 -0
- package/build/core/db.d.ts.map +1 -0
- package/build/core/db.js +1047 -0
- package/build/core/db.js.map +1 -0
- package/build/core/doctor.d.ts +13 -0
- package/build/core/doctor.d.ts.map +1 -0
- package/build/core/doctor.js +55 -0
- package/build/core/doctor.js.map +1 -0
- package/build/core/efficiency.d.ts +16 -0
- package/build/core/efficiency.d.ts.map +1 -0
- package/build/core/efficiency.js +170 -0
- package/build/core/efficiency.js.map +1 -0
- package/build/core/embedding-tracker.d.ts +25 -0
- package/build/core/embedding-tracker.d.ts.map +1 -0
- package/build/core/embedding-tracker.js +228 -0
- package/build/core/embedding-tracker.js.map +1 -0
- package/build/core/embeddings.d.ts +90 -0
- package/build/core/embeddings.d.ts.map +1 -0
- package/build/core/embeddings.js +693 -0
- package/build/core/embeddings.js.map +1 -0
- package/build/core/evidence-state.d.ts +42 -0
- package/build/core/evidence-state.d.ts.map +1 -0
- package/build/core/evidence-state.js +153 -0
- package/build/core/evidence-state.js.map +1 -0
- package/build/core/extractor-stamp.d.ts +10 -0
- package/build/core/extractor-stamp.d.ts.map +1 -0
- package/build/core/extractor-stamp.js +51 -0
- package/build/core/extractor-stamp.js.map +1 -0
- package/build/core/feature-brief-cache.d.ts +37 -0
- package/build/core/feature-brief-cache.d.ts.map +1 -0
- package/build/core/feature-brief-cache.js +100 -0
- package/build/core/feature-brief-cache.js.map +1 -0
- package/build/core/file-fingerprint.d.ts +15 -0
- package/build/core/file-fingerprint.d.ts.map +1 -0
- package/build/core/file-fingerprint.js +24 -0
- package/build/core/file-fingerprint.js.map +1 -0
- package/build/core/graph-analytics.d.ts +46 -0
- package/build/core/graph-analytics.d.ts.map +1 -0
- package/build/core/graph-analytics.js +371 -0
- package/build/core/graph-analytics.js.map +1 -0
- package/build/core/hub.d.ts +23 -0
- package/build/core/hub.d.ts.map +1 -0
- package/build/core/hub.js +123 -0
- package/build/core/hub.js.map +1 -0
- package/build/core/ignore-dirs.d.ts +7 -0
- package/build/core/ignore-dirs.d.ts.map +1 -0
- package/build/core/ignore-dirs.js +84 -0
- package/build/core/ignore-dirs.js.map +1 -0
- package/build/core/index-freshness.d.ts +15 -0
- package/build/core/index-freshness.d.ts.map +1 -0
- package/build/core/index-freshness.js +96 -0
- package/build/core/index-freshness.js.map +1 -0
- package/build/core/index-reconcile.d.ts +28 -0
- package/build/core/index-reconcile.d.ts.map +1 -0
- package/build/core/index-reconcile.js +129 -0
- package/build/core/index-reconcile.js.map +1 -0
- package/build/core/local-daemon.d.ts +5 -0
- package/build/core/local-daemon.d.ts.map +1 -0
- package/build/core/local-daemon.js +282 -0
- package/build/core/local-daemon.js.map +1 -0
- package/build/core/memory-graph.d.ts +68 -0
- package/build/core/memory-graph.d.ts.map +1 -0
- package/build/core/memory-graph.js +152 -0
- package/build/core/memory-graph.js.map +1 -0
- package/build/core/native-repair.d.ts +12 -0
- package/build/core/native-repair.d.ts.map +1 -0
- package/build/core/native-repair.js +167 -0
- package/build/core/native-repair.js.map +1 -0
- package/build/core/native-runtime.d.ts +12 -0
- package/build/core/native-runtime.d.ts.map +1 -0
- package/build/core/native-runtime.js +38 -0
- package/build/core/native-runtime.js.map +1 -0
- package/build/core/pagerank.d.ts +29 -0
- package/build/core/pagerank.d.ts.map +1 -0
- package/build/core/pagerank.js +90 -0
- package/build/core/pagerank.js.map +1 -0
- package/build/core/parser-process.d.ts +21 -0
- package/build/core/parser-process.d.ts.map +1 -0
- package/build/core/parser-process.js +103 -0
- package/build/core/parser-process.js.map +1 -0
- package/build/core/parser-worker.d.ts +2 -0
- package/build/core/parser-worker.d.ts.map +1 -0
- package/build/core/parser-worker.js +17 -0
- package/build/core/parser-worker.js.map +1 -0
- package/build/core/parser.d.ts +66 -0
- package/build/core/parser.d.ts.map +1 -0
- package/build/core/parser.js +750 -0
- package/build/core/parser.js.map +1 -0
- package/build/core/path-guard.d.ts +6 -0
- package/build/core/path-guard.d.ts.map +1 -0
- package/build/core/path-guard.js +55 -0
- package/build/core/path-guard.js.map +1 -0
- package/build/core/process-lifecycle.d.ts +30 -0
- package/build/core/process-lifecycle.d.ts.map +1 -0
- package/build/core/process-lifecycle.js +129 -0
- package/build/core/process-lifecycle.js.map +1 -0
- package/build/core/project-config.d.ts +83 -0
- package/build/core/project-config.d.ts.map +1 -0
- package/build/core/project-config.js +302 -0
- package/build/core/project-config.js.map +1 -0
- package/build/core/project-graph.d.ts +69 -0
- package/build/core/project-graph.d.ts.map +1 -0
- package/build/core/project-graph.js +874 -0
- package/build/core/project-graph.js.map +1 -0
- package/build/core/provider-config.d.ts +15 -0
- package/build/core/provider-config.d.ts.map +1 -0
- package/build/core/provider-config.js +67 -0
- package/build/core/provider-config.js.map +1 -0
- package/build/core/provider-usage.d.ts +21 -0
- package/build/core/provider-usage.d.ts.map +1 -0
- package/build/core/provider-usage.js +52 -0
- package/build/core/provider-usage.js.map +1 -0
- package/build/core/python-language-server.d.ts +23 -0
- package/build/core/python-language-server.d.ts.map +1 -0
- package/build/core/python-language-server.js +217 -0
- package/build/core/python-language-server.js.map +1 -0
- package/build/core/python-runtime-identity.d.ts +3 -0
- package/build/core/python-runtime-identity.d.ts.map +1 -0
- package/build/core/python-runtime-identity.js +53 -0
- package/build/core/python-runtime-identity.js.map +1 -0
- package/build/core/reconcile-scheduler.d.ts +20 -0
- package/build/core/reconcile-scheduler.d.ts.map +1 -0
- package/build/core/reconcile-scheduler.js +58 -0
- package/build/core/reconcile-scheduler.js.map +1 -0
- package/build/core/request-context.d.ts +7 -0
- package/build/core/request-context.d.ts.map +1 -0
- package/build/core/request-context.js +17 -0
- package/build/core/request-context.js.map +1 -0
- package/build/core/request-root.d.ts +19 -0
- package/build/core/request-root.d.ts.map +1 -0
- package/build/core/request-root.js +26 -0
- package/build/core/request-root.js.map +1 -0
- package/build/core/root-guard.d.ts +9 -0
- package/build/core/root-guard.d.ts.map +1 -0
- package/build/core/root-guard.js +64 -0
- package/build/core/root-guard.js.map +1 -0
- package/build/core/roots-detect.d.ts +17 -0
- package/build/core/roots-detect.d.ts.map +1 -0
- package/build/core/roots-detect.js +63 -0
- package/build/core/roots-detect.js.map +1 -0
- package/build/core/runtime-session.d.ts +5 -0
- package/build/core/runtime-session.d.ts.map +1 -0
- package/build/core/runtime-session.js +10 -0
- package/build/core/runtime-session.js.map +1 -0
- package/build/core/scip-index.d.ts +71 -0
- package/build/core/scip-index.d.ts.map +1 -0
- package/build/core/scip-index.js +343 -0
- package/build/core/scip-index.js.map +1 -0
- package/build/core/semantic-diff.d.ts +32 -0
- package/build/core/semantic-diff.d.ts.map +1 -0
- package/build/core/semantic-diff.js +259 -0
- package/build/core/semantic-diff.js.map +1 -0
- package/build/core/source-context.d.ts +3 -0
- package/build/core/source-context.d.ts.map +1 -0
- package/build/core/source-context.js +86 -0
- package/build/core/source-context.js.map +1 -0
- package/build/core/source-mask.d.ts +8 -0
- package/build/core/source-mask.d.ts.map +1 -0
- package/build/core/source-mask.js +156 -0
- package/build/core/source-mask.js.map +1 -0
- package/build/core/source-mutation.d.ts +16 -0
- package/build/core/source-mutation.d.ts.map +1 -0
- package/build/core/source-mutation.js +193 -0
- package/build/core/source-mutation.js.map +1 -0
- package/build/core/sql-schema.d.ts +59 -0
- package/build/core/sql-schema.d.ts.map +1 -0
- package/build/core/sql-schema.js +218 -0
- package/build/core/sql-schema.js.map +1 -0
- package/build/core/startup-health.d.ts +40 -0
- package/build/core/startup-health.d.ts.map +1 -0
- package/build/core/startup-health.js +132 -0
- package/build/core/startup-health.js.map +1 -0
- package/build/core/team-ledger.d.ts +60 -0
- package/build/core/team-ledger.d.ts.map +1 -0
- package/build/core/team-ledger.js +171 -0
- package/build/core/team-ledger.js.map +1 -0
- package/build/core/test-impact.d.ts +23 -0
- package/build/core/test-impact.d.ts.map +1 -0
- package/build/core/test-impact.js +131 -0
- package/build/core/test-impact.js.map +1 -0
- package/build/core/tool-metrics.d.ts +29 -0
- package/build/core/tool-metrics.d.ts.map +1 -0
- package/build/core/tool-metrics.js +74 -0
- package/build/core/tool-metrics.js.map +1 -0
- package/build/core/tool-profile.d.ts +12 -0
- package/build/core/tool-profile.d.ts.map +1 -0
- package/build/core/tool-profile.js +102 -0
- package/build/core/tool-profile.js.map +1 -0
- package/build/core/tool-trace.d.ts +8 -0
- package/build/core/tool-trace.d.ts.map +1 -0
- package/build/core/tool-trace.js +70 -0
- package/build/core/tool-trace.js.map +1 -0
- package/build/core/tree-sitter-runtime.d.ts +20 -0
- package/build/core/tree-sitter-runtime.d.ts.map +1 -0
- package/build/core/tree-sitter-runtime.js +324 -0
- package/build/core/tree-sitter-runtime.js.map +1 -0
- package/build/core/tree-sitter.d.ts +6 -0
- package/build/core/tree-sitter.d.ts.map +1 -0
- package/build/core/tree-sitter.js +24 -0
- package/build/core/tree-sitter.js.map +1 -0
- package/build/core/typescript-reference-process.d.ts +30 -0
- package/build/core/typescript-reference-process.d.ts.map +1 -0
- package/build/core/typescript-reference-process.js +124 -0
- package/build/core/typescript-reference-process.js.map +1 -0
- package/build/core/typescript-reference-worker.d.ts +2 -0
- package/build/core/typescript-reference-worker.d.ts.map +1 -0
- package/build/core/typescript-reference-worker.js +14 -0
- package/build/core/typescript-reference-worker.js.map +1 -0
- package/build/core/typescript-references.d.ts +71 -0
- package/build/core/typescript-references.d.ts.map +1 -0
- package/build/core/typescript-references.js +392 -0
- package/build/core/typescript-references.js.map +1 -0
- package/build/core/typescript-skeleton.d.ts +5 -0
- package/build/core/typescript-skeleton.d.ts.map +1 -0
- package/build/core/typescript-skeleton.js +49 -0
- package/build/core/typescript-skeleton.js.map +1 -0
- package/build/core/walker.d.ts +16 -0
- package/build/core/walker.d.ts.map +1 -0
- package/build/core/walker.js +152 -0
- package/build/core/walker.js.map +1 -0
- package/build/core/workspace-router.d.ts +28 -0
- package/build/core/workspace-router.d.ts.map +1 -0
- package/build/core/workspace-router.js +93 -0
- package/build/core/workspace-router.js.map +1 -0
- package/build/core/worktree-gc.d.ts +16 -0
- package/build/core/worktree-gc.d.ts.map +1 -0
- package/build/core/worktree-gc.js +69 -0
- package/build/core/worktree-gc.js.map +1 -0
- package/build/core/worktree-overlay.d.ts +22 -0
- package/build/core/worktree-overlay.d.ts.map +1 -0
- package/build/core/worktree-overlay.js +84 -0
- package/build/core/worktree-overlay.js.map +1 -0
- package/build/core/worktree-root-guard.d.ts +8 -0
- package/build/core/worktree-root-guard.d.ts.map +1 -0
- package/build/core/worktree-root-guard.js +82 -0
- package/build/core/worktree-root-guard.js.map +1 -0
- package/build/core/worktree-seed.d.ts +14 -0
- package/build/core/worktree-seed.d.ts.map +1 -0
- package/build/core/worktree-seed.js +98 -0
- package/build/core/worktree-seed.js.map +1 -0
- package/build/git/shadow.d.ts +40 -0
- package/build/git/shadow.d.ts.map +1 -0
- package/build/git/shadow.js +298 -0
- package/build/git/shadow.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +634 -0
- package/build/index.js.map +1 -0
- package/build/tools/agentic-context.d.ts +86 -0
- package/build/tools/agentic-context.d.ts.map +1 -0
- package/build/tools/agentic-context.js +1546 -0
- package/build/tools/agentic-context.js.map +1 -0
- package/build/tools/blast-radius.d.ts +24 -0
- package/build/tools/blast-radius.d.ts.map +1 -0
- package/build/tools/blast-radius.js +231 -0
- package/build/tools/blast-radius.js.map +1 -0
- package/build/tools/changed-since.d.ts +7 -0
- package/build/tools/changed-since.d.ts.map +1 -0
- package/build/tools/changed-since.js +68 -0
- package/build/tools/changed-since.js.map +1 -0
- package/build/tools/compiler-actions.d.ts +26 -0
- package/build/tools/compiler-actions.d.ts.map +1 -0
- package/build/tools/compiler-actions.js +121 -0
- package/build/tools/compiler-actions.js.map +1 -0
- package/build/tools/context-tree.d.ts +9 -0
- package/build/tools/context-tree.d.ts.map +1 -0
- package/build/tools/context-tree.js +131 -0
- package/build/tools/context-tree.js.map +1 -0
- package/build/tools/context.d.ts +37 -0
- package/build/tools/context.d.ts.map +1 -0
- package/build/tools/context.js +800 -0
- package/build/tools/context.js.map +1 -0
- package/build/tools/diff.d.ts +9 -0
- package/build/tools/diff.d.ts.map +1 -0
- package/build/tools/diff.js +176 -0
- package/build/tools/diff.js.map +1 -0
- package/build/tools/directory-prior.d.ts +16 -0
- package/build/tools/directory-prior.d.ts.map +1 -0
- package/build/tools/directory-prior.js +121 -0
- package/build/tools/directory-prior.js.map +1 -0
- package/build/tools/discovery-documents.d.ts +11 -0
- package/build/tools/discovery-documents.d.ts.map +1 -0
- package/build/tools/discovery-documents.js +71 -0
- package/build/tools/discovery-documents.js.map +1 -0
- package/build/tools/discovery-hints.d.ts +25 -0
- package/build/tools/discovery-hints.d.ts.map +1 -0
- package/build/tools/discovery-hints.js +329 -0
- package/build/tools/discovery-hints.js.map +1 -0
- package/build/tools/efficiency-report.d.ts +13 -0
- package/build/tools/efficiency-report.d.ts.map +1 -0
- package/build/tools/efficiency-report.js +78 -0
- package/build/tools/efficiency-report.js.map +1 -0
- package/build/tools/evidence-retrieval.d.ts +33 -0
- package/build/tools/evidence-retrieval.d.ts.map +1 -0
- package/build/tools/evidence-retrieval.js +200 -0
- package/build/tools/evidence-retrieval.js.map +1 -0
- package/build/tools/exact-references.d.ts +10 -0
- package/build/tools/exact-references.d.ts.map +1 -0
- package/build/tools/exact-references.js +351 -0
- package/build/tools/exact-references.js.map +1 -0
- package/build/tools/explain.d.ts +14 -0
- package/build/tools/explain.d.ts.map +1 -0
- package/build/tools/explain.js +370 -0
- package/build/tools/explain.js.map +1 -0
- package/build/tools/feature-brief.d.ts +7 -0
- package/build/tools/feature-brief.d.ts.map +1 -0
- package/build/tools/feature-brief.js +89 -0
- package/build/tools/feature-brief.js.map +1 -0
- package/build/tools/feature-hub.d.ts +15 -0
- package/build/tools/feature-hub.d.ts.map +1 -0
- package/build/tools/feature-hub.js +404 -0
- package/build/tools/feature-hub.js.map +1 -0
- package/build/tools/file-skeleton.d.ts +7 -0
- package/build/tools/file-skeleton.d.ts.map +1 -0
- package/build/tools/file-skeleton.js +190 -0
- package/build/tools/file-skeleton.js.map +1 -0
- package/build/tools/grep.d.ts +25 -0
- package/build/tools/grep.d.ts.map +1 -0
- package/build/tools/grep.js +341 -0
- package/build/tools/grep.js.map +1 -0
- package/build/tools/impact-delta.d.ts +7 -0
- package/build/tools/impact-delta.d.ts.map +1 -0
- package/build/tools/impact-delta.js +102 -0
- package/build/tools/impact-delta.js.map +1 -0
- package/build/tools/memory-tools.d.ts +69 -0
- package/build/tools/memory-tools.d.ts.map +1 -0
- package/build/tools/memory-tools.js +366 -0
- package/build/tools/memory-tools.js.map +1 -0
- package/build/tools/planning-helpers.d.ts +26 -0
- package/build/tools/planning-helpers.d.ts.map +1 -0
- package/build/tools/planning-helpers.js +269 -0
- package/build/tools/planning-helpers.js.map +1 -0
- package/build/tools/project-graph.d.ts +19 -0
- package/build/tools/project-graph.d.ts.map +1 -0
- package/build/tools/project-graph.js +259 -0
- package/build/tools/project-graph.js.map +1 -0
- package/build/tools/propose-commit.d.ts +9 -0
- package/build/tools/propose-commit.d.ts.map +1 -0
- package/build/tools/propose-commit.js +156 -0
- package/build/tools/propose-commit.js.map +1 -0
- package/build/tools/register-tools.d.ts +18 -0
- package/build/tools/register-tools.d.ts.map +1 -0
- package/build/tools/register-tools.js +1131 -0
- package/build/tools/register-tools.js.map +1 -0
- package/build/tools/reindex.d.ts +76 -0
- package/build/tools/reindex.d.ts.map +1 -0
- package/build/tools/reindex.js +871 -0
- package/build/tools/reindex.js.map +1 -0
- package/build/tools/related.d.ts +6 -0
- package/build/tools/related.d.ts.map +1 -0
- package/build/tools/related.js +143 -0
- package/build/tools/related.js.map +1 -0
- package/build/tools/repo-map.d.ts +59 -0
- package/build/tools/repo-map.d.ts.map +1 -0
- package/build/tools/repo-map.js +270 -0
- package/build/tools/repo-map.js.map +1 -0
- package/build/tools/resolve-symbol.d.ts +41 -0
- package/build/tools/resolve-symbol.d.ts.map +1 -0
- package/build/tools/resolve-symbol.js +250 -0
- package/build/tools/resolve-symbol.js.map +1 -0
- package/build/tools/retrieval-helpers.d.ts +35 -0
- package/build/tools/retrieval-helpers.d.ts.map +1 -0
- package/build/tools/retrieval-helpers.js +302 -0
- package/build/tools/retrieval-helpers.js.map +1 -0
- package/build/tools/scip-index.d.ts +12 -0
- package/build/tools/scip-index.d.ts.map +1 -0
- package/build/tools/scip-index.js +66 -0
- package/build/tools/scip-index.js.map +1 -0
- package/build/tools/scoped-discovery.d.ts +7 -0
- package/build/tools/scoped-discovery.d.ts.map +1 -0
- package/build/tools/scoped-discovery.js +89 -0
- package/build/tools/scoped-discovery.js.map +1 -0
- package/build/tools/search.d.ts +62 -0
- package/build/tools/search.d.ts.map +1 -0
- package/build/tools/search.js +419 -0
- package/build/tools/search.js.map +1 -0
- package/build/tools/semantic-diff.d.ts +7 -0
- package/build/tools/semantic-diff.d.ts.map +1 -0
- package/build/tools/semantic-diff.js +45 -0
- package/build/tools/semantic-diff.js.map +1 -0
- package/build/tools/semantic-identifiers.d.ts +51 -0
- package/build/tools/semantic-identifiers.d.ts.map +1 -0
- package/build/tools/semantic-identifiers.js +522 -0
- package/build/tools/semantic-identifiers.js.map +1 -0
- package/build/tools/semantic-navigate.d.ts +18 -0
- package/build/tools/semantic-navigate.d.ts.map +1 -0
- package/build/tools/semantic-navigate.js +413 -0
- package/build/tools/semantic-navigate.js.map +1 -0
- package/build/tools/semantic-search.d.ts +30 -0
- package/build/tools/semantic-search.d.ts.map +1 -0
- package/build/tools/semantic-search.js +466 -0
- package/build/tools/semantic-search.js.map +1 -0
- package/build/tools/sql-schema.d.ts +23 -0
- package/build/tools/sql-schema.d.ts.map +1 -0
- package/build/tools/sql-schema.js +155 -0
- package/build/tools/sql-schema.js.map +1 -0
- package/build/tools/static-analysis.d.ts +7 -0
- package/build/tools/static-analysis.d.ts.map +1 -0
- package/build/tools/static-analysis.js +331 -0
- package/build/tools/static-analysis.js.map +1 -0
- package/build/tools/status.d.ts +74 -0
- package/build/tools/status.d.ts.map +1 -0
- package/build/tools/status.js +227 -0
- package/build/tools/status.js.map +1 -0
- package/build/tools/symbolic-edit.d.ts +57 -0
- package/build/tools/symbolic-edit.d.ts.map +1 -0
- package/build/tools/symbolic-edit.js +500 -0
- package/build/tools/symbolic-edit.js.map +1 -0
- package/build/tools/test-impact.d.ts +7 -0
- package/build/tools/test-impact.d.ts.map +1 -0
- package/build/tools/test-impact.js +34 -0
- package/build/tools/test-impact.js.map +1 -0
- package/build/tools/test-map.d.ts +8 -0
- package/build/tools/test-map.d.ts.map +1 -0
- package/build/tools/test-map.js +75 -0
- package/build/tools/test-map.js.map +1 -0
- package/docs/README.md +35 -0
- package/docs/architecture.md +35 -0
- package/docs/configuration.md +207 -0
- package/docs/maintenance.md +77 -0
- package/package.json +80 -4
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReconcileResult } from "./index-reconcile.js";
|
|
2
|
+
export interface ReconcileSchedulerOptions {
|
|
3
|
+
rootDir: string;
|
|
4
|
+
/** Force a deep sweep every Nth idle tick even with no signalled activity. */
|
|
5
|
+
forceEverySweeps?: number;
|
|
6
|
+
/** The actual reconcile pass; injectable for tests. */
|
|
7
|
+
sweep: (rootDir: string) => Promise<ReconcileResult>;
|
|
8
|
+
/** Max files to reconcile per sweep, forwarded into the default sweep. */
|
|
9
|
+
maxFilesPerSweep?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ReconcileScheduler {
|
|
12
|
+
/** Mark that the watcher observed file activity since the last sweep. */
|
|
13
|
+
signalActivity: () => void;
|
|
14
|
+
/** Run one scheduling tick; sweeps only when the policy says to. */
|
|
15
|
+
tick: () => Promise<void>;
|
|
16
|
+
/** True while a capped backlog is still draining (caller may tick sooner). */
|
|
17
|
+
isDraining: () => boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function createReconcileScheduler(options: ReconcileSchedulerOptions): ReconcileScheduler;
|
|
20
|
+
//# sourceMappingURL=reconcile-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile-scheduler.d.ts","sourceRoot":"","sources":["../../src/core/reconcile-scheduler.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACrD,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,oEAAoE;IACpE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,8EAA8E;IAC9E,UAAU,EAAE,MAAM,OAAO,CAAC;CAC3B;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,kBAAkB,CA8C/F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Reconcile sweep scheduler — decides WHEN the self-healing reconcile runs.
|
|
2
|
+
//
|
|
3
|
+
// FEATURE: Separates the "when to sweep" policy from the "how to sweep" diff
|
|
4
|
+
// (index-reconcile.ts) so the policy is unit-testable without real timers, a real
|
|
5
|
+
// repo, or the FS watcher. Policy:
|
|
6
|
+
// - Sweep when activity has been signalled since the last sweep (the watcher
|
|
7
|
+
// saw file changes) — fresh edits get reconciled promptly.
|
|
8
|
+
// - Skip the sweep while idle, keeping background cost near-zero between edits.
|
|
9
|
+
// - Force a deep sweep every Nth idle tick anyway, to catch out-of-band changes
|
|
10
|
+
// the watcher cannot see (git checkout/rebase, atomic renames, missed events).
|
|
11
|
+
// - Keep sweeping promptly while a capped backlog is still draining.
|
|
12
|
+
// - Never run two sweeps concurrently.
|
|
13
|
+
const DEFAULT_FORCE_EVERY_SWEEPS = 10;
|
|
14
|
+
export function createReconcileScheduler(options) {
|
|
15
|
+
const forceEverySweeps = Math.max(1, Math.floor(options.forceEverySweeps ?? DEFAULT_FORCE_EVERY_SWEEPS));
|
|
16
|
+
let dirty = false;
|
|
17
|
+
let draining = false;
|
|
18
|
+
let running = false;
|
|
19
|
+
let idleTicks = 0;
|
|
20
|
+
const runSweep = async () => {
|
|
21
|
+
running = true;
|
|
22
|
+
try {
|
|
23
|
+
const result = await options.sweep(options.rootDir);
|
|
24
|
+
// Keep hot while a capped backlog remains so it drains over the next ticks.
|
|
25
|
+
draining = result.pending > 0;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
// A failed sweep must not wedge the scheduler; the next tick retries.
|
|
29
|
+
console.error("Reconcile sweep failed:", error);
|
|
30
|
+
draining = false;
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
running = false;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
signalActivity: () => {
|
|
38
|
+
dirty = true;
|
|
39
|
+
},
|
|
40
|
+
tick: async () => {
|
|
41
|
+
if (running)
|
|
42
|
+
return; // serialize — never overlap sweeps
|
|
43
|
+
const shouldSweep = dirty || draining;
|
|
44
|
+
if (!shouldSweep) {
|
|
45
|
+
idleTicks += 1;
|
|
46
|
+
if (idleTicks < forceEverySweeps)
|
|
47
|
+
return;
|
|
48
|
+
// Forced deep sweep: fall through and sweep this idle tick.
|
|
49
|
+
}
|
|
50
|
+
// Consume the activity signal and reset the idle counter for this sweep.
|
|
51
|
+
dirty = false;
|
|
52
|
+
idleTicks = 0;
|
|
53
|
+
await runSweep();
|
|
54
|
+
},
|
|
55
|
+
isDraining: () => draining,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=reconcile-scheduler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile-scheduler.js","sourceRoot":"","sources":["../../src/core/reconcile-scheduler.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5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,WAAW,EAAE,CAAC;gBACjB,SAAS,IAAI,CAAC,CAAC;gBACf,IAAI,SAAS,GAAG,gBAAgB;oBAAE,OAAO;gBACzC,4DAA4D;YAC9D,CAAC;YAED,yEAAyE;YACzE,KAAK,GAAG,KAAK,CAAC;YACd,SAAS,GAAG,CAAC,CAAC;YACd,MAAM,QAAQ,EAAE,CAAC;QACnB,CAAC;QAED,UAAU,EAAE,GAAY,EAAE,CAAC,QAAQ;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IndexFreshnessResult } from "./index-freshness.js";
|
|
2
|
+
/** Run `fn` with `rootDir` as the active request root. */
|
|
3
|
+
export declare function runWithRequestRoot<T>(rootDir: string, fn: () => Promise<T>): Promise<T>;
|
|
4
|
+
export declare const requestFreshness: () => Map<string, Promise<IndexFreshnessResult>> | undefined;
|
|
5
|
+
/** The active request root, or `fallback` when no request context is established. */
|
|
6
|
+
export declare function currentRoot(fallback: string): string;
|
|
7
|
+
//# sourceMappingURL=request-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/core/request-context.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AASjE,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEvF;AAED,eAAO,MAAM,gBAAgB,QAAO,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,SAA0C,CAAC;AAE5H,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Per-request root context using AsyncLocalStorage.
|
|
2
|
+
// FEATURE: Multi-worktree routing — withRequestActivity establishes the resolved
|
|
3
|
+
// root for the duration of a tool call so handlers read it without threading the
|
|
4
|
+
// value through every signature. Falls back to the server's boot root when no
|
|
5
|
+
// request context is active (CLI paths, tests, direct calls).
|
|
6
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
7
|
+
const storage = new AsyncLocalStorage();
|
|
8
|
+
/** Run `fn` with `rootDir` as the active request root. */
|
|
9
|
+
export function runWithRequestRoot(rootDir, fn) {
|
|
10
|
+
return storage.run({ rootDir, freshness: new Map() }, fn);
|
|
11
|
+
}
|
|
12
|
+
export const requestFreshness = () => storage.getStore()?.freshness;
|
|
13
|
+
/** The active request root, or `fallback` when no request context is established. */
|
|
14
|
+
export function currentRoot(fallback) {
|
|
15
|
+
return storage.getStore()?.rootDir ?? fallback;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=request-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context.js","sourceRoot":"","sources":["../../src/core/request-context.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,iFAAiF;AACjF,iFAAiF;AACjF,8EAA8E;AAC9E,8DAA8D;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQhD,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAkB,CAAC;AAExD,0DAA0D;AAC1D,MAAM,UAAU,kBAAkB,CAAI,OAAe,EAAE,EAAoB;IACzE,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAA2D,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC;AAE5H,qFAAqF;AACrF,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,OAAO,IAAI,QAAQ,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ResolvedWorkspace } from "./workspace-router.js";
|
|
2
|
+
import { type RootsProvider } from "./roots-detect.js";
|
|
3
|
+
export interface RequestRootResolution extends ResolvedWorkspace {
|
|
4
|
+
/** Original args minus the `root` field, ready to forward to the handler. */
|
|
5
|
+
handlerArgs: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolveRequestRootOptions {
|
|
8
|
+
/** Queries the MCP client's advertised workspace roots for auto-detection. */
|
|
9
|
+
rootsProvider?: RootsProvider;
|
|
10
|
+
/** The cwd to attribute the request to when several client roots exist. */
|
|
11
|
+
requestCwd?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the workspace a request targets. Precedence:
|
|
15
|
+
* explicit `args.root` → MCP client roots (auto-detected) → server boot root.
|
|
16
|
+
* The returned `handlerArgs` has `root` removed so existing handlers are unaffected.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveRequestRoot(args: Record<string, unknown> | undefined, defaultRoot: string, options?: ResolveRequestRootOptions): Promise<RequestRootResolution>;
|
|
19
|
+
//# sourceMappingURL=request-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-root.d.ts","sourceRoot":"","sources":["../../src/core/request-root.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGxE,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,qBAAqB,CAAC,CAgBhC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Resolve the effective project root for a single tool request.
|
|
2
|
+
// FEATURE: Multi-worktree routing — a tool may carry an optional `root` argument
|
|
3
|
+
// (or inherit the server's boot root); this resolves it to a workspace and hands
|
|
4
|
+
// back the args with `root` stripped so handlers see their normal shape.
|
|
5
|
+
import { resolveWorkspace } from "./workspace-router.js";
|
|
6
|
+
import { resolveAutoRoot } from "./roots-detect.js";
|
|
7
|
+
import { requireExplicitRootForSharedWorktrees } from "./worktree-root-guard.js";
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the workspace a request targets. Precedence:
|
|
10
|
+
* explicit `args.root` → MCP client roots (auto-detected) → server boot root.
|
|
11
|
+
* The returned `handlerArgs` has `root` removed so existing handlers are unaffected.
|
|
12
|
+
*/
|
|
13
|
+
export async function resolveRequestRoot(args, defaultRoot, options = {}) {
|
|
14
|
+
const safeArgs = args ?? {};
|
|
15
|
+
const rawRoot = safeArgs.root;
|
|
16
|
+
const explicitRoot = typeof rawRoot === "string" && rawRoot.trim().length > 0 ? rawRoot : undefined;
|
|
17
|
+
// Auto-detect from the client's roots only when no explicit root was passed and
|
|
18
|
+
// a provider is available; otherwise fall straight through to the boot root.
|
|
19
|
+
const effectiveRoot = options.rootsProvider
|
|
20
|
+
? await resolveAutoRoot(explicitRoot, defaultRoot, options.rootsProvider, options.requestCwd ?? defaultRoot)
|
|
21
|
+
: explicitRoot;
|
|
22
|
+
const workspace = await resolveWorkspace(effectiveRoot, defaultRoot, explicitRoot ? undefined : requireExplicitRootForSharedWorktrees);
|
|
23
|
+
const { root: _omit, ...handlerArgs } = safeArgs;
|
|
24
|
+
return { ...workspace, handlerArgs };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=request-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-root.js","sourceRoot":"","sources":["../../src/core/request-root.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,iFAAiF;AACjF,iFAAiF;AACjF,yEAAyE;AAEzE,OAAO,EAAE,gBAAgB,EAA0B,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAsB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,0BAA0B,CAAC;AAcjF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAyC,EACzC,WAAmB,EACnB,UAAqC,EAAE;IAEvC,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC9B,MAAM,YAAY,GAAG,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAEpG,gFAAgF;IAChF,6EAA6E;IAC7E,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa;QACzC,CAAC,CAAC,MAAM,eAAe,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,IAAI,WAAW,CAAC;QAC5G,CAAC,CAAC,YAAY,CAAC;IAEjB,MAAM,SAAS,GAAG,MAAM,gBAAgB,CACtC,aAAa,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qCAAqC,CAC7F,CAAC;IACF,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,QAAQ,CAAC;IACjD,OAAO,EAAE,GAAG,SAAS,EAAE,WAAW,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface RootSelection {
|
|
2
|
+
rootDir: string;
|
|
3
|
+
source: "cwd" | "positional" | "flag";
|
|
4
|
+
}
|
|
5
|
+
export declare function isUnexpandedVariable(pathValue: string): boolean;
|
|
6
|
+
export declare function selectRootDir(cwd: string, positional: string[], flagRoot?: string): RootSelection;
|
|
7
|
+
export declare function isUnsafeRoot(rootDir: string): boolean;
|
|
8
|
+
export declare function validateSelectedRoot(selection: RootSelection): RootSelection;
|
|
9
|
+
//# sourceMappingURL=root-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-guard.d.ts","sourceRoot":"","sources":["../../src/core/root-guard.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC;CACvC;AAiBD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,CAQjG;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAUrD;AAaD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,aAAa,GAAG,aAAa,CAQ5E"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Root selection and guardrails — keep one MCP process pinned to one safe project root
|
|
2
|
+
// FEATURE: Multi-project trust — reject dangerous cwd fallbacks and support explicit --root binding
|
|
3
|
+
import { homedir } from "os";
|
|
4
|
+
import { existsSync, realpathSync } from "fs";
|
|
5
|
+
import { join, relative, resolve } from "path";
|
|
6
|
+
function normalize(pathValue) {
|
|
7
|
+
const resolved = resolve(pathValue);
|
|
8
|
+
try {
|
|
9
|
+
return realpathSync(resolved);
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return resolved;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function isInside(parent, child) {
|
|
16
|
+
const rel = relative(parent, child);
|
|
17
|
+
return rel === "" || (!rel.startsWith("..") && rel !== "..");
|
|
18
|
+
}
|
|
19
|
+
// A client that does not expand ${workspaceFolder} passes it literally; the launch directory is a better guess.
|
|
20
|
+
export function isUnexpandedVariable(pathValue) {
|
|
21
|
+
return /\$\{[^}]+\}/.test(pathValue);
|
|
22
|
+
}
|
|
23
|
+
export function selectRootDir(cwd, positional, flagRoot) {
|
|
24
|
+
if (flagRoot && flagRoot.trim().length > 0 && !isUnexpandedVariable(flagRoot)) {
|
|
25
|
+
return { rootDir: normalize(flagRoot), source: "flag" };
|
|
26
|
+
}
|
|
27
|
+
if (positional.length > 0) {
|
|
28
|
+
return { rootDir: normalize(positional[0]), source: "positional" };
|
|
29
|
+
}
|
|
30
|
+
return { rootDir: normalize(cwd), source: "cwd" };
|
|
31
|
+
}
|
|
32
|
+
export function isUnsafeRoot(rootDir) {
|
|
33
|
+
const normalized = normalize(rootDir);
|
|
34
|
+
const home = normalize(homedir());
|
|
35
|
+
if (normalized === "/")
|
|
36
|
+
return true;
|
|
37
|
+
if (normalized === home)
|
|
38
|
+
return true;
|
|
39
|
+
if (isInside(home, normalized) && normalized !== home) {
|
|
40
|
+
const rel = relative(home, normalized);
|
|
41
|
+
return rel.split("/").filter(Boolean).length <= 1;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
// A Git repository directly in the home folder (~/myapp) is a project; ~/Downloads is not.
|
|
46
|
+
function isHomeChildRepository(rootDir) {
|
|
47
|
+
const normalized = normalize(rootDir);
|
|
48
|
+
return normalized !== "/" && normalized !== normalize(homedir()) && existsSync(join(normalized, ".git"));
|
|
49
|
+
}
|
|
50
|
+
function allowUnsafeRootEnabled() {
|
|
51
|
+
const raw = (process.env.CONTEXTPRO_ALLOW_UNSAFE_ROOT ?? process.env.CONTEXTPLUS_ALLOW_UNSAFE_ROOT ?? "").trim().toLowerCase();
|
|
52
|
+
return raw === "1" || raw === "true" || raw === "yes";
|
|
53
|
+
}
|
|
54
|
+
export function validateSelectedRoot(selection) {
|
|
55
|
+
if (!isUnsafeRoot(selection.rootDir))
|
|
56
|
+
return selection;
|
|
57
|
+
if (allowUnsafeRootEnabled())
|
|
58
|
+
return selection;
|
|
59
|
+
if (isHomeChildRepository(selection.rootDir))
|
|
60
|
+
return selection;
|
|
61
|
+
const sourceHint = selection.source === "flag" ? "--root" : selection.source === "positional" ? "positional argument" : "process.cwd()";
|
|
62
|
+
throw new Error(`Unsafe project root "${selection.rootDir}" (source: ${sourceHint}). ContextPro refuses to start at the filesystem root, your home folder, or a folder directly inside it that is not a Git repository, because it would create .contextpro/ and SQLite databases there. Pass --root <project-path> to a real project, or set CONTEXTPRO_ALLOW_UNSAFE_ROOT=true to override.`);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=root-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-guard.js","sourceRoot":"","sources":["../../src/core/root-guard.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,oGAAoG;AAEpG,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAO/C,SAAS,SAAS,CAAC,SAAiB;IAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,QAAQ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AAI,KAAK,CACb,wBAAwB,SAAS,CAAC,OAAO,cAAc,UAAU,4SAA4S,CAC9W,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** A function that returns the client's advertised root URIs (file:// strings). */
|
|
2
|
+
export type RootsProvider = () => Promise<string[]>;
|
|
3
|
+
/**
|
|
4
|
+
* Choose the workspace root a request belongs to from the client's advertised list.
|
|
5
|
+
* - 0 roots → undefined (caller falls back to boot root).
|
|
6
|
+
* - 1 root → that root (the common single-workspace / single-worktree case).
|
|
7
|
+
* - N roots → the one whose directory contains `requestCwd`; undefined if none,
|
|
8
|
+
* since guessing the wrong worktree is worse than falling back.
|
|
9
|
+
*/
|
|
10
|
+
export declare function selectRootFromList(rootUris: string[], requestCwd: string): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the effective root for a request. Precedence:
|
|
13
|
+
* explicit `root` arg → client roots (via provider) → boot root.
|
|
14
|
+
* Provider errors and empty results both fall through to the boot root.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveAutoRoot(explicitRoot: string | undefined, bootRoot: string, rootsProvider: RootsProvider, requestCwd: string): Promise<string>;
|
|
17
|
+
//# sourceMappingURL=roots-detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roots-detect.d.ts","sourceRoot":"","sources":["../../src/core/roots-detect.ts"],"names":[],"mappings":"AASA,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAkBpD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAU7F;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Auto-detect the request's worktree root from the MCP client's `roots` capability.
|
|
2
|
+
// FEATURE: Zero-config multi-worktree routing — when an agent does not pass an
|
|
3
|
+
// explicit `root`, ask the client which workspace roots it has open and pick the
|
|
4
|
+
// one this request belongs to. Degrades silently to the server's boot root when
|
|
5
|
+
// the client advertises no usable roots (or lacks the capability entirely).
|
|
6
|
+
import { resolve } from "path";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
function fileUriToPath(uri) {
|
|
9
|
+
if (!uri.startsWith("file://"))
|
|
10
|
+
return null;
|
|
11
|
+
try {
|
|
12
|
+
return resolve(fileURLToPath(uri));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function isInside(parent, child) {
|
|
19
|
+
const p = resolve(parent);
|
|
20
|
+
const c = resolve(child);
|
|
21
|
+
if (c === p)
|
|
22
|
+
return true;
|
|
23
|
+
return c.startsWith(p.endsWith("/") ? p : `${p}/`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Choose the workspace root a request belongs to from the client's advertised list.
|
|
27
|
+
* - 0 roots → undefined (caller falls back to boot root).
|
|
28
|
+
* - 1 root → that root (the common single-workspace / single-worktree case).
|
|
29
|
+
* - N roots → the one whose directory contains `requestCwd`; undefined if none,
|
|
30
|
+
* since guessing the wrong worktree is worse than falling back.
|
|
31
|
+
*/
|
|
32
|
+
export function selectRootFromList(rootUris, requestCwd) {
|
|
33
|
+
const paths = rootUris.map(fileUriToPath).filter((p) => p !== null);
|
|
34
|
+
if (paths.length === 0)
|
|
35
|
+
return undefined;
|
|
36
|
+
if (paths.length === 1)
|
|
37
|
+
return paths[0];
|
|
38
|
+
// Multiple roots: pick the most specific one that contains the request cwd.
|
|
39
|
+
const containing = paths
|
|
40
|
+
.filter((p) => isInside(p, requestCwd))
|
|
41
|
+
.sort((a, b) => b.length - a.length);
|
|
42
|
+
return containing[0];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the effective root for a request. Precedence:
|
|
46
|
+
* explicit `root` arg → client roots (via provider) → boot root.
|
|
47
|
+
* Provider errors and empty results both fall through to the boot root.
|
|
48
|
+
*/
|
|
49
|
+
export async function resolveAutoRoot(explicitRoot, bootRoot, rootsProvider, requestCwd) {
|
|
50
|
+
if (explicitRoot && explicitRoot.trim().length > 0)
|
|
51
|
+
return explicitRoot;
|
|
52
|
+
try {
|
|
53
|
+
const uris = await rootsProvider();
|
|
54
|
+
const picked = selectRootFromList(uris, requestCwd);
|
|
55
|
+
if (picked)
|
|
56
|
+
return picked;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Client lacks the roots capability or the request failed — use the boot root.
|
|
60
|
+
}
|
|
61
|
+
return bootRoot;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=roots-detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roots-detect.js","sourceRoot":"","sources":["../../src/core/roots-detect.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,+EAA+E;AAC/E,iFAAiF;AACjF,gFAAgF;AAChF,4EAA4E;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAKpC,SAAS,aAAa,CAAC,GAAW;IAChC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,MAAc,EAAE,KAAa;IAC7C,MAAM,CAAC,GA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nC,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACpD,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,+EAA+E;IACjF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const runtimeSessionId: `${string}-${string}-${string}-${string}-${string}`;
|
|
2
|
+
export declare const runtimeSessionStartedAt: number;
|
|
3
|
+
export declare function setToolSchemaTokens(tokens: number): void;
|
|
4
|
+
export declare function getToolSchemaTokens(): number;
|
|
5
|
+
//# sourceMappingURL=runtime-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-session.d.ts","sourceRoot":"","sources":["../../src/core/runtime-session.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,qDAAe,CAAC;AAC7C,eAAO,MAAM,uBAAuB,QAAa,CAAC;AAElD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAExD;AACD,wBAAgB,mBAAmB,IAAI,MAAM,CAA6B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// One identity per MCP process; separate concurrently active agents in shared history.
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
export const runtimeSessionId = randomUUID();
|
|
4
|
+
export const runtimeSessionStartedAt = Date.now();
|
|
5
|
+
let toolSchemaTokens = 0;
|
|
6
|
+
export function setToolSchemaTokens(tokens) {
|
|
7
|
+
toolSchemaTokens = Math.max(0, Math.ceil(tokens));
|
|
8
|
+
}
|
|
9
|
+
export function getToolSchemaTokens() { return toolSchemaTokens; }
|
|
10
|
+
//# sourceMappingURL=runtime-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-session.js","sourceRoot":"","sources":["../../src/core/runtime-session.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAClD,IAAI,gBAAgB,GAAG,CAAC,CAAC;AACzB,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC;AACD,MAAM,UAAU,mBAAmB,KAAa,OAAO,gBAAgB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare const DEFAULT_SCIP_CACHE_PATH = ".contextpro/scip-index.json";
|
|
2
|
+
export interface NormalizedScipRelationship {
|
|
3
|
+
targetSymbol: string;
|
|
4
|
+
isReference: boolean;
|
|
5
|
+
isImplementation: boolean;
|
|
6
|
+
isTypeDefinition: boolean;
|
|
7
|
+
isDefinition: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface NormalizedScipSymbol {
|
|
10
|
+
symbol: string;
|
|
11
|
+
name: string;
|
|
12
|
+
kind?: string;
|
|
13
|
+
file?: string;
|
|
14
|
+
line?: number;
|
|
15
|
+
documentation?: string;
|
|
16
|
+
signature?: string;
|
|
17
|
+
relationships: NormalizedScipRelationship[];
|
|
18
|
+
}
|
|
19
|
+
export interface NormalizedScipOccurrence {
|
|
20
|
+
file: string;
|
|
21
|
+
symbol: string;
|
|
22
|
+
name: string;
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
25
|
+
endLine?: number;
|
|
26
|
+
endColumn?: number;
|
|
27
|
+
role: "definition" | "reference";
|
|
28
|
+
syntaxKind?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface NormalizedScipIndex {
|
|
31
|
+
version: 1;
|
|
32
|
+
sourcePath: string;
|
|
33
|
+
importedAt: string;
|
|
34
|
+
documents: number;
|
|
35
|
+
symbols: NormalizedScipSymbol[];
|
|
36
|
+
occurrences: NormalizedScipOccurrence[];
|
|
37
|
+
}
|
|
38
|
+
export interface ScipExactReference {
|
|
39
|
+
file: string;
|
|
40
|
+
line: number;
|
|
41
|
+
column: number;
|
|
42
|
+
context: string;
|
|
43
|
+
isDefinition: boolean;
|
|
44
|
+
confidence: "SCIP_RESOLVED";
|
|
45
|
+
symbol: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ScipReferenceResult {
|
|
48
|
+
total: number;
|
|
49
|
+
symbol: string;
|
|
50
|
+
symbols: string[];
|
|
51
|
+
confidence: "SCIP_RESOLVED";
|
|
52
|
+
references: ScipExactReference[];
|
|
53
|
+
}
|
|
54
|
+
export interface ScipImportResult {
|
|
55
|
+
cachePath: string;
|
|
56
|
+
index: NormalizedScipIndex;
|
|
57
|
+
}
|
|
58
|
+
export declare function scipSymbolDisplayName(symbol: string): string;
|
|
59
|
+
export declare function normalizeScipIndex(raw: unknown, sourcePath: string): NormalizedScipIndex;
|
|
60
|
+
export declare function importScipIndex(rootDir: string, indexPath: string): Promise<ScipImportResult>;
|
|
61
|
+
export declare function loadScipIndex(rootDir: string, indexPath?: string): Promise<NormalizedScipIndex | null>;
|
|
62
|
+
export declare function scipSymbolNodeId(symbol: string): string;
|
|
63
|
+
export declare function findScipReferences(options: {
|
|
64
|
+
rootDir: string;
|
|
65
|
+
symbolName: string;
|
|
66
|
+
file?: string;
|
|
67
|
+
line?: number;
|
|
68
|
+
limit?: number;
|
|
69
|
+
indexPath?: string;
|
|
70
|
+
}): Promise<ScipReferenceResult | null>;
|
|
71
|
+
//# sourceMappingURL=scip-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scip-index.d.ts","sourceRoot":"","sources":["../../src/core/scip-index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE,MAAM,WAAW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