@lzehrung/codegraph 3.0.1 → 3.1.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/README.md +17 -17
- package/codegraph-skill/codegraph/SKILL.md +6 -2
- package/dist/agent/artifact.d.ts.map +1 -1
- package/dist/agent/artifact.js +4 -9
- package/dist/agent/artifact.js.map +1 -1
- package/dist/agent/call-hierarchy.d.ts +4 -2
- package/dist/agent/call-hierarchy.d.ts.map +1 -1
- package/dist/agent/call-hierarchy.js +20 -29
- package/dist/agent/call-hierarchy.js.map +1 -1
- package/dist/agent/explain.d.ts.map +1 -1
- package/dist/agent/explain.js +24 -18
- package/dist/agent/explain.js.map +1 -1
- package/dist/agent/explore.d.ts.map +1 -1
- package/dist/agent/explore.js +2 -11
- package/dist/agent/explore.js.map +1 -1
- package/dist/agent/file-view.d.ts.map +1 -1
- package/dist/agent/file-view.js +4 -12
- package/dist/agent/file-view.js.map +1 -1
- package/dist/agent/normalize.d.ts +0 -3
- package/dist/agent/normalize.d.ts.map +1 -1
- package/dist/agent/normalize.js +1 -7
- package/dist/agent/normalize.js.map +1 -1
- package/dist/agent/orient.d.ts.map +1 -1
- package/dist/agent/orient.js +2 -6
- package/dist/agent/orient.js.map +1 -1
- package/dist/agent/packet.d.ts.map +1 -1
- package/dist/agent/packet.js +2 -5
- package/dist/agent/packet.js.map +1 -1
- package/dist/agent/query-index/content.d.ts.map +1 -1
- package/dist/agent/query-index/content.js +2 -6
- package/dist/agent/query-index/content.js.map +1 -1
- package/dist/agent/query-index/update.d.ts.map +1 -1
- package/dist/agent/query-index/update.js +8 -45
- package/dist/agent/query-index/update.js.map +1 -1
- package/dist/agent/query-index/worker-pool.d.ts.map +1 -1
- package/dist/agent/query-index/worker-pool.js +2 -1
- package/dist/agent/query-index/worker-pool.js.map +1 -1
- package/dist/agent/refactor-plan.d.ts +2 -2
- package/dist/agent/refactor-plan.d.ts.map +1 -1
- package/dist/agent/refactor-plan.js +11 -57
- package/dist/agent/refactor-plan.js.map +1 -1
- package/dist/agent/rename-preview.d.ts.map +1 -1
- package/dist/agent/rename-preview.js +166 -23
- package/dist/agent/rename-preview.js.map +1 -1
- package/dist/agent/search.d.ts +13 -0
- package/dist/agent/search.d.ts.map +1 -1
- package/dist/agent/search.js +17 -26
- package/dist/agent/search.js.map +1 -1
- package/dist/agent/semantic-symbols.d.ts +1 -1
- package/dist/agent/semantic-symbols.d.ts.map +1 -1
- package/dist/agent/semantic-symbols.js +2 -5
- package/dist/agent/semantic-symbols.js.map +1 -1
- package/dist/agent/semantic.d.ts +5 -0
- package/dist/agent/semantic.d.ts.map +1 -1
- package/dist/agent/semantic.js +12 -1
- package/dist/agent/semantic.js.map +1 -1
- package/dist/agent/session.d.ts +9 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +59 -41
- package/dist/agent/session.js.map +1 -1
- package/dist/agent/type-hierarchy.d.ts +4 -2
- package/dist/agent/type-hierarchy.d.ts.map +1 -1
- package/dist/agent/type-hierarchy.js +19 -31
- package/dist/agent/type-hierarchy.js.map +1 -1
- package/dist/agent/workspace-symbols.d.ts +1 -1
- package/dist/agent/workspace-symbols.d.ts.map +1 -1
- package/dist/agent/workspace-symbols.js +7 -15
- package/dist/agent/workspace-symbols.js.map +1 -1
- package/dist/analysis-summary.d.ts +1 -4
- package/dist/analysis-summary.d.ts.map +1 -1
- package/dist/analysis-summary.js +58 -19
- package/dist/analysis-summary.js.map +1 -1
- package/dist/bin/cli.js +41060 -27641
- package/dist/bin/query-index-worker.js +268 -241
- package/dist/bootstrap/tree-sitter-languages.d.ts +2 -0
- package/dist/bootstrap/tree-sitter-languages.d.ts.map +1 -1
- package/dist/bootstrap/tree-sitter-languages.js +6 -19
- package/dist/bootstrap/tree-sitter-languages.js.map +1 -1
- package/dist/chunking/chunk-matches.d.ts.map +1 -1
- package/dist/chunking/chunk-matches.js +6 -42
- package/dist/chunking/chunk-matches.js.map +1 -1
- package/dist/chunking/chunk-split.d.ts +7 -0
- package/dist/chunking/chunk-split.d.ts.map +1 -1
- package/dist/chunking/chunk-split.js +3 -3
- package/dist/chunking/chunk-split.js.map +1 -1
- package/dist/chunking/chunk-text-file.js +2 -30
- package/dist/chunking/chunk-text-file.js.map +1 -1
- package/dist/cli/affected.d.ts.map +1 -1
- package/dist/cli/affected.js +1 -9
- package/dist/cli/affected.js.map +1 -1
- package/dist/cli/call-hierarchy.js +3 -6
- package/dist/cli/call-hierarchy.js.map +1 -1
- package/dist/cli/chunk.d.ts.map +1 -1
- package/dist/cli/chunk.js +4 -11
- package/dist/cli/chunk.js.map +1 -1
- package/dist/cli/command-table.d.ts.map +1 -1
- package/dist/cli/command-table.js +7 -0
- package/dist/cli/command-table.js.map +1 -1
- package/dist/cli/context.d.ts +1 -0
- package/dist/cli/context.d.ts.map +1 -1
- package/dist/cli/context.js +1 -1
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +1 -11
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/duplicates.d.ts +5 -0
- package/dist/cli/duplicates.d.ts.map +1 -1
- package/dist/cli/duplicates.js +15 -2
- package/dist/cli/duplicates.js.map +1 -1
- package/dist/cli/graph.d.ts +4 -12
- package/dist/cli/graph.d.ts.map +1 -1
- package/dist/cli/graph.js +17 -8
- package/dist/cli/graph.js.map +1 -1
- package/dist/cli/help.d.ts +4 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +17 -9
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.d.ts +2 -12
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/links.d.ts.map +1 -1
- package/dist/cli/links.js +4 -10
- package/dist/cli/links.js.map +1 -1
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +5 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/module-locals.d.ts +8 -0
- package/dist/cli/module-locals.d.ts.map +1 -0
- package/dist/cli/module-locals.js +9 -0
- package/dist/cli/module-locals.js.map +1 -0
- package/dist/cli/navigation.d.ts +2 -0
- package/dist/cli/navigation.d.ts.map +1 -1
- package/dist/cli/navigation.js +3 -5
- package/dist/cli/navigation.js.map +1 -1
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +6 -1
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/pretty.d.ts +1 -0
- package/dist/cli/pretty.d.ts.map +1 -1
- package/dist/cli/pretty.js +6 -8
- package/dist/cli/pretty.js.map +1 -1
- package/dist/cli/progress.d.ts.map +1 -1
- package/dist/cli/progress.js +42 -16
- package/dist/cli/progress.js.map +1 -1
- package/dist/cli/refactor-plan.js +2 -5
- package/dist/cli/refactor-plan.js.map +1 -1
- package/dist/cli/rename-preview.js +2 -5
- package/dist/cli/rename-preview.js.map +1 -1
- package/dist/cli/review.d.ts +6 -16
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +2 -0
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/server.d.ts.map +1 -1
- package/dist/cli/server.js +9 -10
- package/dist/cli/server.js.map +1 -1
- package/dist/cli/type-hierarchy.js +8 -8
- package/dist/cli/type-hierarchy.js.map +1 -1
- package/dist/cli/viewer.js +1 -1
- package/dist/cli/viewer.js.map +1 -1
- package/dist/document-links/asciidoc.d.ts.map +1 -1
- package/dist/document-links/asciidoc.js +4 -16
- package/dist/document-links/asciidoc.js.map +1 -1
- package/dist/document-links/check.d.ts.map +1 -1
- package/dist/document-links/check.js +1 -3
- package/dist/document-links/check.js.map +1 -1
- package/dist/document-links/html.d.ts.map +1 -1
- package/dist/document-links/html.js +6 -44
- package/dist/document-links/html.js.map +1 -1
- package/dist/document-links/markdown.d.ts.map +1 -1
- package/dist/document-links/markdown.js +4 -13
- package/dist/document-links/markdown.js.map +1 -1
- package/dist/document-links/rst.d.ts.map +1 -1
- package/dist/document-links/rst.js +7 -31
- package/dist/document-links/rst.js.map +1 -1
- package/dist/document-links/sfc.d.ts.map +1 -1
- package/dist/document-links/sfc.js +2 -5
- package/dist/document-links/sfc.js.map +1 -1
- package/dist/document-links/shared.d.ts +2 -0
- package/dist/document-links/shared.d.ts.map +1 -1
- package/dist/document-links/shared.js +13 -0
- package/dist/document-links/shared.js.map +1 -1
- package/dist/drift/artifact.d.ts.map +1 -1
- package/dist/drift/artifact.js +4 -27
- package/dist/drift/artifact.js.map +1 -1
- package/dist/drift/git.d.ts.map +1 -1
- package/dist/drift/git.js +10 -2
- package/dist/drift/git.js.map +1 -1
- package/dist/drift/graph-edges.d.ts +4 -0
- package/dist/drift/graph-edges.d.ts.map +1 -0
- package/dist/drift/graph-edges.js +15 -0
- package/dist/drift/graph-edges.js.map +1 -0
- package/dist/drift/snapshot.d.ts.map +1 -1
- package/dist/drift/snapshot.js +2 -17
- package/dist/drift/snapshot.js.map +1 -1
- package/dist/duplicates/candidates.d.ts +61 -0
- package/dist/duplicates/candidates.d.ts.map +1 -0
- package/dist/duplicates/candidates.js +873 -0
- package/dist/duplicates/candidates.js.map +1 -0
- package/dist/duplicates/progress.d.ts +17 -0
- package/dist/duplicates/progress.d.ts.map +1 -0
- package/dist/duplicates/progress.js +57 -0
- package/dist/duplicates/progress.js.map +1 -0
- package/dist/duplicates/scoring.d.ts +9 -40
- package/dist/duplicates/scoring.d.ts.map +1 -1
- package/dist/duplicates/scoring.js +34 -414
- package/dist/duplicates/scoring.js.map +1 -1
- package/dist/duplicates/types.d.ts +30 -1
- package/dist/duplicates/types.d.ts.map +1 -1
- package/dist/duplicates/unit-cache.d.ts +11 -1
- package/dist/duplicates/unit-cache.d.ts.map +1 -1
- package/dist/duplicates/unit-cache.js +20 -2
- package/dist/duplicates/unit-cache.js.map +1 -1
- package/dist/duplicates/units.d.ts +4 -2
- package/dist/duplicates/units.d.ts.map +1 -1
- package/dist/duplicates/units.js +47 -25
- package/dist/duplicates/units.js.map +1 -1
- package/dist/duplicates.d.ts +1 -0
- package/dist/duplicates.d.ts.map +1 -1
- package/dist/duplicates.js +116 -62
- package/dist/duplicates.js.map +1 -1
- package/dist/graph-builder.d.ts +1 -1
- package/dist/graph-builder.d.ts.map +1 -1
- package/dist/graph-builder.js +3 -2
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-edge-collector.d.ts +3 -1
- package/dist/graph-edge-collector.d.ts.map +1 -1
- package/dist/graph-edge-collector.js +38 -6
- package/dist/graph-edge-collector.js.map +1 -1
- package/dist/graphs/angularjs.d.ts.map +1 -1
- package/dist/graphs/angularjs.js +2 -9
- package/dist/graphs/angularjs.js.map +1 -1
- package/dist/graphs/edge-resolution.d.ts +4 -0
- package/dist/graphs/edge-resolution.d.ts.map +1 -1
- package/dist/graphs/edge-resolution.js +2 -0
- package/dist/graphs/edge-resolution.js.map +1 -1
- package/dist/graphs/external/manifests.d.ts.map +1 -1
- package/dist/graphs/external/manifests.js +1 -6
- package/dist/graphs/external/manifests.js.map +1 -1
- package/dist/graphs/specifiers.d.ts.map +1 -1
- package/dist/graphs/specifiers.js +47 -26
- package/dist/graphs/specifiers.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts +2 -0
- package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/edge-passes.js +9 -3
- package/dist/graphs/symbol-graph-detailed/edge-passes.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts +3 -3
- package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/receiver-calls.js +2 -26
- package/dist/graphs/symbol-graph-detailed/receiver-calls.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed.js +38 -1
- package/dist/graphs/symbol-graph-detailed.js.map +1 -1
- package/dist/impact/analyzer.d.ts.map +1 -1
- package/dist/impact/analyzer.js +23 -17
- package/dist/impact/analyzer.js.map +1 -1
- package/dist/impact/budgets.d.ts.map +1 -1
- package/dist/impact/budgets.js +3 -9
- package/dist/impact/budgets.js.map +1 -1
- package/dist/impact/call-compatibility.d.ts.map +1 -1
- package/dist/impact/call-compatibility.js +3 -12
- package/dist/impact/call-compatibility.js.map +1 -1
- package/dist/impact/context.d.ts +6 -0
- package/dist/impact/context.d.ts.map +1 -1
- package/dist/impact/context.js +2 -2
- package/dist/impact/context.js.map +1 -1
- package/dist/impact/direct.d.ts.map +1 -1
- package/dist/impact/direct.js +2 -6
- package/dist/impact/direct.js.map +1 -1
- package/dist/impact/map.d.ts +3 -1
- package/dist/impact/map.d.ts.map +1 -1
- package/dist/impact/map.js +12 -5
- package/dist/impact/map.js.map +1 -1
- package/dist/impact/providers/base.js +1 -1
- package/dist/impact/providers/base.js.map +1 -1
- package/dist/impact/reference-cache.d.ts.map +1 -1
- package/dist/impact/reference-cache.js +1 -24
- package/dist/impact/reference-cache.js.map +1 -1
- package/dist/impact/report-shared.d.ts +2 -1
- package/dist/impact/report-shared.d.ts.map +1 -1
- package/dist/impact/report-shared.js +10 -0
- package/dist/impact/report-shared.js.map +1 -1
- package/dist/impact/report-suggestions.d.ts.map +1 -1
- package/dist/impact/report-suggestions.js +2 -8
- package/dist/impact/report-suggestions.js.map +1 -1
- package/dist/impact/report.d.ts.map +1 -1
- package/dist/impact/report.js +2 -8
- package/dist/impact/report.js.map +1 -1
- package/dist/impact/streaming.d.ts.map +1 -1
- package/dist/impact/streaming.js +3 -8
- package/dist/impact/streaming.js.map +1 -1
- package/dist/indexer/build-cache/manifest.d.ts.map +1 -1
- package/dist/indexer/build-cache/manifest.js +10 -108
- package/dist/indexer/build-cache/manifest.js.map +1 -1
- package/dist/indexer/build-cache/module-cache.d.ts +6 -1
- package/dist/indexer/build-cache/module-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache/module-cache.js +25 -2
- package/dist/indexer/build-cache/module-cache.js.map +1 -1
- package/dist/indexer/build-cache/options.d.ts +38 -1
- package/dist/indexer/build-cache/options.d.ts.map +1 -1
- package/dist/indexer/build-cache/options.js +38 -1
- package/dist/indexer/build-cache/options.js.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.js +48 -99
- package/dist/indexer/build-cache/project-snapshot.js.map +1 -1
- package/dist/indexer/build-cache/reports.d.ts +1 -0
- package/dist/indexer/build-cache/reports.d.ts.map +1 -1
- package/dist/indexer/build-cache/reports.js +10 -0
- package/dist/indexer/build-cache/reports.js.map +1 -1
- package/dist/indexer/build-index.d.ts +2 -0
- package/dist/indexer/build-index.d.ts.map +1 -1
- package/dist/indexer/build-index.js +187 -57
- package/dist/indexer/build-index.js.map +1 -1
- package/dist/indexer/build-workers.d.ts +7 -1
- package/dist/indexer/build-workers.d.ts.map +1 -1
- package/dist/indexer/build-workers.js +12 -0
- package/dist/indexer/build-workers.js.map +1 -1
- package/dist/indexer/call-hierarchy.d.ts.map +1 -1
- package/dist/indexer/call-hierarchy.js +5 -17
- package/dist/indexer/call-hierarchy.js.map +1 -1
- package/dist/indexer/compilation-units.d.ts +32 -20
- package/dist/indexer/compilation-units.d.ts.map +1 -1
- package/dist/indexer/compilation-units.js +139 -145
- package/dist/indexer/compilation-units.js.map +1 -1
- package/dist/indexer/cpp-callables.d.ts.map +1 -1
- package/dist/indexer/cpp-callables.js +2 -7
- package/dist/indexer/cpp-callables.js.map +1 -1
- package/dist/indexer/import-types.d.ts +5 -0
- package/dist/indexer/import-types.d.ts.map +1 -1
- package/dist/indexer/import-types.js.map +1 -1
- package/dist/indexer/imports/binding-ranges.d.ts +5 -12
- package/dist/indexer/imports/binding-ranges.d.ts.map +1 -1
- package/dist/indexer/imports/binding-ranges.js +13 -19
- package/dist/indexer/imports/binding-ranges.js.map +1 -1
- package/dist/indexer/imports/context.d.ts +6 -0
- package/dist/indexer/imports/context.d.ts.map +1 -1
- package/dist/indexer/imports/import-binding-tables.d.ts +28 -13
- package/dist/indexer/imports/import-binding-tables.d.ts.map +1 -1
- package/dist/indexer/imports/import-binding-tables.js +179 -178
- package/dist/indexer/imports/import-binding-tables.js.map +1 -1
- package/dist/indexer/imports/js-text-imports.d.ts +0 -1
- package/dist/indexer/imports/js-text-imports.d.ts.map +1 -1
- package/dist/indexer/imports/js-text-imports.js +0 -176
- package/dist/indexer/imports/js-text-imports.js.map +1 -1
- package/dist/indexer/imports/language-specific.d.ts.map +1 -1
- package/dist/indexer/imports/language-specific.js +4 -8
- package/dist/indexer/imports/language-specific.js.map +1 -1
- package/dist/indexer/imports/python.d.ts +0 -1
- package/dist/indexer/imports/python.d.ts.map +1 -1
- package/dist/indexer/imports/python.js +1 -29
- package/dist/indexer/imports/python.js.map +1 -1
- package/dist/indexer/imports/text-import-extractors.d.ts +2 -9
- package/dist/indexer/imports/text-import-extractors.d.ts.map +1 -1
- package/dist/indexer/imports/text-import-extractors.js +0 -284
- package/dist/indexer/imports/text-import-extractors.js.map +1 -1
- package/dist/indexer/imports.d.ts +15 -0
- package/dist/indexer/imports.d.ts.map +1 -1
- package/dist/indexer/imports.js +82 -44
- package/dist/indexer/imports.js.map +1 -1
- package/dist/indexer/incremental-plan.d.ts +0 -1
- package/dist/indexer/incremental-plan.d.ts.map +1 -1
- package/dist/indexer/incremental-plan.js +6 -12
- package/dist/indexer/incremental-plan.js.map +1 -1
- package/dist/indexer/name-lookup-policies/implicit-self.d.ts.map +1 -1
- package/dist/indexer/name-lookup-policies/implicit-self.js +25 -4
- package/dist/indexer/name-lookup-policies/implicit-self.js.map +1 -1
- package/dist/indexer/name-resolution-types.d.ts +5 -0
- package/dist/indexer/name-resolution-types.d.ts.map +1 -1
- package/dist/indexer/name-resolution.d.ts.map +1 -1
- package/dist/indexer/name-resolution.js +2 -0
- package/dist/indexer/name-resolution.js.map +1 -1
- package/dist/indexer/navigation-cpp.d.ts.map +1 -1
- package/dist/indexer/navigation-cpp.js +3 -5
- package/dist/indexer/navigation-cpp.js.map +1 -1
- package/dist/indexer/navigation-goto.d.ts +49 -3
- package/dist/indexer/navigation-goto.d.ts.map +1 -1
- package/dist/indexer/navigation-goto.js +500 -106
- package/dist/indexer/navigation-goto.js.map +1 -1
- package/dist/indexer/navigation-local.d.ts +7 -0
- package/dist/indexer/navigation-local.d.ts.map +1 -1
- package/dist/indexer/navigation-local.js +22 -2
- package/dist/indexer/navigation-local.js.map +1 -1
- package/dist/indexer/navigation-php.d.ts +0 -1
- package/dist/indexer/navigation-php.d.ts.map +1 -1
- package/dist/indexer/navigation-php.js +1 -7
- package/dist/indexer/navigation-php.js.map +1 -1
- package/dist/indexer/navigation-references.d.ts +1 -0
- package/dist/indexer/navigation-references.d.ts.map +1 -1
- package/dist/indexer/navigation-references.js +134 -23
- package/dist/indexer/navigation-references.js.map +1 -1
- package/dist/indexer/navigation-resolve.d.ts +22 -0
- package/dist/indexer/navigation-resolve.d.ts.map +1 -1
- package/dist/indexer/navigation-resolve.js +73 -8
- package/dist/indexer/navigation-resolve.js.map +1 -1
- package/dist/indexer/navigation.d.ts +4 -1
- package/dist/indexer/navigation.d.ts.map +1 -1
- package/dist/indexer/navigation.js +398 -95
- package/dist/indexer/navigation.js.map +1 -1
- package/dist/indexer/python-property-decorator.d.ts +11 -0
- package/dist/indexer/python-property-decorator.d.ts.map +1 -0
- package/dist/indexer/python-property-decorator.js +30 -0
- package/dist/indexer/python-property-decorator.js.map +1 -0
- package/dist/indexer/shared-owner-identity.d.ts +3 -1
- package/dist/indexer/shared-owner-identity.d.ts.map +1 -1
- package/dist/indexer/shared-owner-identity.js +40 -12
- package/dist/indexer/shared-owner-identity.js.map +1 -1
- package/dist/indexer/shared.d.ts +10 -0
- package/dist/indexer/shared.d.ts.map +1 -1
- package/dist/indexer/shared.js +8 -0
- package/dist/indexer/shared.js.map +1 -1
- package/dist/indexer/star-import-precedence.d.ts +5 -1
- package/dist/indexer/star-import-precedence.d.ts.map +1 -1
- package/dist/indexer/star-import-precedence.js +12 -19
- package/dist/indexer/star-import-precedence.js.map +1 -1
- package/dist/indexer/type-hierarchy.d.ts.map +1 -1
- package/dist/indexer/type-hierarchy.js +8 -9
- package/dist/indexer/type-hierarchy.js.map +1 -1
- package/dist/indexer/types.d.ts +49 -1
- package/dist/indexer/types.d.ts.map +1 -1
- package/dist/indexer/types.js.map +1 -1
- package/dist/indexer/workspace-symbols.d.ts.map +1 -1
- package/dist/indexer/workspace-symbols.js +3 -13
- package/dist/indexer/workspace-symbols.js.map +1 -1
- package/dist/installer/locks.d.ts +1 -0
- package/dist/installer/locks.d.ts.map +1 -1
- package/dist/installer/locks.js +4 -8
- package/dist/installer/locks.js.map +1 -1
- package/dist/installer/registry.d.ts.map +1 -1
- package/dist/installer/registry.js +9 -15
- package/dist/installer/registry.js.map +1 -1
- package/dist/languages/callable-arity.d.ts.map +1 -1
- package/dist/languages/callable-arity.js +1 -38
- package/dist/languages/callable-arity.js.map +1 -1
- package/dist/languages/definitions/csharp.d.ts.map +1 -1
- package/dist/languages/definitions/csharp.js +5 -13
- package/dist/languages/definitions/csharp.js.map +1 -1
- package/dist/languages/definitions/java.d.ts.map +1 -1
- package/dist/languages/definitions/java.js +4 -13
- package/dist/languages/definitions/java.js.map +1 -1
- package/dist/languages/definitions/kotlin.d.ts.map +1 -1
- package/dist/languages/definitions/kotlin.js +4 -8
- package/dist/languages/definitions/kotlin.js.map +1 -1
- package/dist/languages/definitions/python.d.ts.map +1 -1
- package/dist/languages/definitions/python.js +5 -3
- package/dist/languages/definitions/python.js.map +1 -1
- package/dist/languages/import-statement-parsers.d.ts +0 -30
- package/dist/languages/import-statement-parsers.d.ts.map +1 -1
- package/dist/languages/import-statement-parsers.js +1 -81
- package/dist/languages/import-statement-parsers.js.map +1 -1
- package/dist/languages/sfc.d.ts.map +1 -1
- package/dist/languages/sfc.js +8 -43
- package/dist/languages/sfc.js.map +1 -1
- package/dist/lifecycle/manifest.d.ts.map +1 -1
- package/dist/lifecycle/manifest.js +11 -29
- package/dist/lifecycle/manifest.js.map +1 -1
- package/dist/mcp/cancellation.d.ts +6 -0
- package/dist/mcp/cancellation.d.ts.map +1 -0
- package/dist/mcp/cancellation.js +11 -0
- package/dist/mcp/cancellation.js.map +1 -0
- package/dist/mcp/handlers.d.ts +54 -3
- package/dist/mcp/handlers.d.ts.map +1 -1
- package/dist/mcp/handlers.js +186 -42
- package/dist/mcp/handlers.js.map +1 -1
- package/dist/mcp/http-transport.d.ts.map +1 -1
- package/dist/mcp/http-transport.js +9 -2
- package/dist/mcp/http-transport.js.map +1 -1
- package/dist/mcp/index-readiness.d.ts +114 -0
- package/dist/mcp/index-readiness.d.ts.map +1 -0
- package/dist/mcp/index-readiness.js +264 -0
- package/dist/mcp/index-readiness.js.map +1 -0
- package/dist/mcp/project-watcher.d.ts +125 -0
- package/dist/mcp/project-watcher.d.ts.map +1 -0
- package/dist/mcp/project-watcher.js +643 -0
- package/dist/mcp/project-watcher.js.map +1 -0
- package/dist/mcp/protocol.d.ts.map +1 -1
- package/dist/mcp/protocol.js +23 -10
- package/dist/mcp/protocol.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +11 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/stale-install.d.ts +13 -0
- package/dist/mcp/stale-install.d.ts.map +1 -0
- package/dist/mcp/stale-install.js +30 -0
- package/dist/mcp/stale-install.js.map +1 -0
- package/dist/native/byte-index.d.ts +1 -0
- package/dist/native/byte-index.d.ts.map +1 -1
- package/dist/native/byte-index.js +1 -1
- package/dist/native/byte-index.js.map +1 -1
- package/dist/native/contracts.d.ts +1 -0
- package/dist/native/contracts.d.ts.map +1 -1
- package/dist/native/native-backend-report.d.ts +2 -1
- package/dist/native/native-backend-report.d.ts.map +1 -1
- package/dist/native/native-backend-report.js +23 -0
- package/dist/native/native-backend-report.js.map +1 -1
- package/dist/native/tree-shape.d.ts +5 -7
- package/dist/native/tree-shape.d.ts.map +1 -1
- package/dist/native/tree-shape.js +11 -10
- package/dist/native/tree-shape.js.map +1 -1
- package/dist/presentation/bounds.d.ts +2 -0
- package/dist/presentation/bounds.d.ts.map +1 -1
- package/dist/presentation/bounds.js +8 -0
- package/dist/presentation/bounds.js.map +1 -1
- package/dist/review/candidates.d.ts.map +1 -1
- package/dist/review/candidates.js +4 -25
- package/dist/review/candidates.js.map +1 -1
- package/dist/review/deleted.js +1 -1
- package/dist/review/deleted.js.map +1 -1
- package/dist/review/report.d.ts.map +1 -1
- package/dist/review/report.js +4 -2
- package/dist/review/report.js.map +1 -1
- package/dist/review/summaries.d.ts.map +1 -1
- package/dist/review/summaries.js +14 -35
- package/dist/review/summaries.js.map +1 -1
- package/dist/review.d.ts +6 -0
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +5 -6
- package/dist/review.js.map +1 -1
- package/dist/scss/navigation.d.ts +13 -0
- package/dist/scss/navigation.d.ts.map +1 -0
- package/dist/scss/navigation.js +150 -0
- package/dist/scss/navigation.js.map +1 -0
- package/dist/scss/resolution.d.ts +190 -0
- package/dist/scss/resolution.d.ts.map +1 -0
- package/dist/scss/resolution.js +1802 -0
- package/dist/scss/resolution.js.map +1 -0
- package/dist/scss/syntax.d.ts +181 -0
- package/dist/scss/syntax.d.ts.map +1 -0
- package/dist/scss/syntax.js +1436 -0
- package/dist/scss/syntax.js.map +1 -0
- package/dist/sql/classify-sql-file.d.ts +7 -0
- package/dist/sql/classify-sql-file.d.ts.map +1 -1
- package/dist/sql/classify-sql-file.js +9 -0
- package/dist/sql/classify-sql-file.js.map +1 -1
- package/dist/sql/extract-facts.d.ts.map +1 -1
- package/dist/sql/extract-facts.js +517 -77
- package/dist/sql/extract-facts.js.map +1 -1
- package/dist/sql/lex.d.ts +100 -1
- package/dist/sql/lex.d.ts.map +1 -1
- package/dist/sql/lex.js +473 -11
- package/dist/sql/lex.js.map +1 -1
- package/dist/sql/lookup.d.ts +17 -0
- package/dist/sql/lookup.d.ts.map +1 -1
- package/dist/sql/lookup.js +21 -0
- package/dist/sql/lookup.js.map +1 -1
- package/dist/sql/navigation.d.ts +28 -1
- package/dist/sql/navigation.d.ts.map +1 -1
- package/dist/sql/navigation.js +474 -84
- package/dist/sql/navigation.js.map +1 -1
- package/dist/sql/object-mentions.d.ts +24 -0
- package/dist/sql/object-mentions.d.ts.map +1 -0
- package/dist/sql/object-mentions.js +233 -0
- package/dist/sql/object-mentions.js.map +1 -0
- package/dist/sql/review.d.ts +3 -0
- package/dist/sql/review.d.ts.map +1 -1
- package/dist/sql/review.js +15 -14
- package/dist/sql/review.js.map +1 -1
- package/dist/sql/routine-mentions.d.ts +61 -0
- package/dist/sql/routine-mentions.d.ts.map +1 -0
- package/dist/sql/routine-mentions.js +868 -0
- package/dist/sql/routine-mentions.js.map +1 -0
- package/dist/sql/source-graph.d.ts +18 -3
- package/dist/sql/source-graph.d.ts.map +1 -1
- package/dist/sql/source-graph.js +109 -32
- package/dist/sql/source-graph.js.map +1 -1
- package/dist/sqlite/raw-query-worker-pool.d.ts.map +1 -1
- package/dist/sqlite/raw-query-worker-pool.js +2 -0
- package/dist/sqlite/raw-query-worker-pool.js.map +1 -1
- package/dist/sqlite/types.d.ts +6 -5
- package/dist/sqlite/types.d.ts.map +1 -1
- package/dist/sqlite/write.d.ts.map +1 -1
- package/dist/sqlite/write.js.map +1 -1
- package/dist/sqlite-driver.d.ts +0 -1
- package/dist/sqlite-driver.d.ts.map +1 -1
- package/dist/sqlite-driver.js +0 -11
- package/dist/sqlite-driver.js.map +1 -1
- package/dist/terraform/navigation.d.ts.map +1 -1
- package/dist/terraform/navigation.js +1 -3
- package/dist/terraform/navigation.js.map +1 -1
- package/dist/terraform/syntax.d.ts.map +1 -1
- package/dist/terraform/syntax.js +1 -4
- package/dist/terraform/syntax.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/util/ast.d.ts +5 -0
- package/dist/util/ast.d.ts.map +1 -1
- package/dist/util/ast.js +10 -0
- package/dist/util/ast.js.map +1 -1
- package/dist/util/atomic-file.d.ts +22 -0
- package/dist/util/atomic-file.d.ts.map +1 -0
- package/dist/util/atomic-file.js +106 -0
- package/dist/util/atomic-file.js.map +1 -0
- package/dist/util/collections.d.ts +5 -0
- package/dist/util/collections.d.ts.map +1 -1
- package/dist/util/collections.js +26 -0
- package/dist/util/collections.js.map +1 -1
- package/dist/util/concurrency.d.ts +8 -0
- package/dist/util/concurrency.d.ts.map +1 -1
- package/dist/util/concurrency.js +16 -0
- package/dist/util/concurrency.js.map +1 -1
- package/dist/util/confined-file.d.ts.map +1 -1
- package/dist/util/confined-file.js +1 -3
- package/dist/util/confined-file.js.map +1 -1
- package/dist/util/csharp-tree.d.ts +65 -0
- package/dist/util/csharp-tree.d.ts.map +1 -0
- package/dist/util/csharp-tree.js +266 -0
- package/dist/util/csharp-tree.js.map +1 -0
- package/dist/util/errors.d.ts +1 -0
- package/dist/util/errors.d.ts.map +1 -1
- package/dist/util/errors.js +3 -0
- package/dist/util/errors.js.map +1 -1
- package/dist/util/graph-edges.d.ts +2 -0
- package/dist/util/graph-edges.d.ts.map +1 -1
- package/dist/util/graph-edges.js +11 -0
- package/dist/util/graph-edges.js.map +1 -1
- package/dist/util/guards.d.ts +1 -0
- package/dist/util/guards.d.ts.map +1 -1
- package/dist/util/guards.js +6 -0
- package/dist/util/guards.js.map +1 -1
- package/dist/util/identifiers.d.ts +0 -24
- package/dist/util/identifiers.d.ts.map +1 -1
- package/dist/util/identifiers.js +0 -24
- package/dist/util/identifiers.js.map +1 -1
- package/dist/util/jvm-tree.d.ts +58 -0
- package/dist/util/jvm-tree.d.ts.map +1 -0
- package/dist/util/jvm-tree.js +153 -0
- package/dist/util/jvm-tree.js.map +1 -0
- package/dist/util/package-exports.d.ts +0 -22
- package/dist/util/package-exports.d.ts.map +1 -1
- package/dist/util/package-exports.js +25 -5
- package/dist/util/package-exports.js.map +1 -1
- package/dist/util/paths.d.ts +1 -0
- package/dist/util/paths.d.ts.map +1 -1
- package/dist/util/paths.js +10 -4
- package/dist/util/paths.js.map +1 -1
- package/dist/util/resolution/csharp.d.ts +20 -8
- package/dist/util/resolution/csharp.d.ts.map +1 -1
- package/dist/util/resolution/csharp.js +126 -127
- package/dist/util/resolution/csharp.js.map +1 -1
- package/dist/util/resolution/files.d.ts +6 -0
- package/dist/util/resolution/files.d.ts.map +1 -1
- package/dist/util/resolution/files.js +74 -21
- package/dist/util/resolution/files.js.map +1 -1
- package/dist/util/resolution/jvm.d.ts +21 -1
- package/dist/util/resolution/jvm.d.ts.map +1 -1
- package/dist/util/resolution/jvm.js +168 -100
- package/dist/util/resolution/jvm.js.map +1 -1
- package/dist/util/resolution/project-symbols.d.ts +1 -1
- package/dist/util/resolution/project-symbols.d.ts.map +1 -1
- package/dist/util/resolution/project-symbols.js.map +1 -1
- package/dist/util/resolution/specifier-targets.d.ts +4 -0
- package/dist/util/resolution/specifier-targets.d.ts.map +1 -1
- package/dist/util/resolution/specifier-targets.js +11 -3
- package/dist/util/resolution/specifier-targets.js.map +1 -1
- package/dist/util/resolution.d.ts.map +1 -1
- package/dist/util/resolution.js +21 -7
- package/dist/util/resolution.js.map +1 -1
- package/dist/util/syntax-tree.d.ts +16 -0
- package/dist/util/syntax-tree.d.ts.map +1 -0
- package/dist/util/syntax-tree.js +34 -0
- package/dist/util/syntax-tree.js.map +1 -0
- package/dist/util/text-scanning.d.ts +6 -0
- package/dist/util/text-scanning.d.ts.map +1 -0
- package/dist/util/text-scanning.js +35 -0
- package/dist/util/text-scanning.js.map +1 -0
- package/dist/util/trivia-tables.d.ts +13 -8
- package/dist/util/trivia-tables.d.ts.map +1 -1
- package/dist/util/trivia-tables.js +13 -72
- package/dist/util/trivia-tables.js.map +1 -1
- package/dist/util/trivia.d.ts +10 -3
- package/dist/util/trivia.d.ts.map +1 -1
- package/dist/util/trivia.js +209 -79
- package/dist/util/trivia.js.map +1 -1
- package/dist/util/windows-process-drain.d.ts.map +1 -1
- package/dist/util/windows-process-drain.js.map +1 -1
- package/dist/util/worker-threads.d.ts +16 -0
- package/dist/util/worker-threads.d.ts.map +1 -1
- package/dist/util/worker-threads.js +118 -0
- package/dist/util/worker-threads.js.map +1 -1
- package/dist/worker/native-worker-pool.d.ts.map +1 -1
- package/dist/worker/native-worker-pool.js +2 -1
- package/dist/worker/native-worker-pool.js.map +1 -1
- package/docs/mcp.md +82 -8
- package/package.json +7 -7
|
@@ -16,4 +16,122 @@ export function resolveWorkerThreadCount(options) {
|
|
|
16
16
|
}
|
|
17
17
|
return Math.min(Math.max(os.availableParallelism() - 1, 1), max);
|
|
18
18
|
}
|
|
19
|
+
const NO_REQUIRE_ESM_FLAG = "--no-experimental-require-module";
|
|
20
|
+
const REQUIRE_ESM_FLAGS = ["--experimental-require-module", NO_REQUIRE_ESM_FLAG];
|
|
21
|
+
/**
|
|
22
|
+
* Host options that a worker thread must keep, so that it loads code the way its host does: preloads, resolution
|
|
23
|
+
* conditions, loaders, source maps, warning policy, and the module-loading feature switches. Node accepts only some
|
|
24
|
+
* options in a worker's `execArgv` and throws `ERR_WORKER_INVALID_EXEC_ARGV` for the rest. Node 22.16 and 24.15 both
|
|
25
|
+
* reject every V8 option (`--max-old-space-size`, `--stack-trace-limit`, `--expose-gc`, `--jitless`, ...) and every
|
|
26
|
+
* process-wide option (`--title`, `--openssl-config`, `--icu-data-dir`, `--report-on-fatalerror`, ...), and they
|
|
27
|
+
* reject `--cpu-prof-dir` and `--experimental-default-type`. A worker that is started with `--inspect-brk` or
|
|
28
|
+
* `--inspect-wait` stops until a debugger attaches, and `--cpu-prof` writes a profile per worker. Which options Node
|
|
29
|
+
* accepts changes between versions and `process.allowedNodeEnvironmentFlags` does not tell (it lists the rejected
|
|
30
|
+
* V8 and process-wide options too), so an option that is not listed here is not passed on, and an unknown future
|
|
31
|
+
* option can never make pool creation throw. Every listed option was started in a worker on Node 22.16 and 24.15.
|
|
32
|
+
*/
|
|
33
|
+
const WORKER_INHERITED_FLAGS = {
|
|
34
|
+
"--require": true,
|
|
35
|
+
"-r": true,
|
|
36
|
+
"--import": true,
|
|
37
|
+
"--conditions": true,
|
|
38
|
+
"-C": true,
|
|
39
|
+
"--loader": true,
|
|
40
|
+
"--experimental-loader": true,
|
|
41
|
+
"--enable-source-maps": true,
|
|
42
|
+
"--warnings": true,
|
|
43
|
+
"--no-warnings": true,
|
|
44
|
+
"--deprecation": true,
|
|
45
|
+
"--no-deprecation": true,
|
|
46
|
+
"--trace-deprecation": true,
|
|
47
|
+
"--throw-deprecation": true,
|
|
48
|
+
"--pending-deprecation": true,
|
|
49
|
+
"--trace-warnings": true,
|
|
50
|
+
"--disable-warning": true,
|
|
51
|
+
"--preserve-symlinks": true,
|
|
52
|
+
"--preserve-symlinks-main": true,
|
|
53
|
+
"--experimental-vm-modules": true,
|
|
54
|
+
"--experimental-strip-types": true,
|
|
55
|
+
"--experimental-transform-types": true,
|
|
56
|
+
"--experimental-detect-module": true,
|
|
57
|
+
"--no-experimental-detect-module": true,
|
|
58
|
+
"--experimental-import-meta-resolve": true,
|
|
59
|
+
"--experimental-require-module": true,
|
|
60
|
+
"--no-experimental-require-module": true,
|
|
61
|
+
};
|
|
62
|
+
/** The option name of an `execArgv` or `NODE_OPTIONS` token as Node reads it: without an `=value` part, and with `_`
|
|
63
|
+
* in a long option name read as `-` (`--experimental_require_module=true` is `--experimental-require-module`). */
|
|
64
|
+
function optionName(token) {
|
|
65
|
+
const name = token.split("=", 1)[0] ?? token;
|
|
66
|
+
return name.startsWith("--") ? `--${name.slice(2).replaceAll("_", "-")}` : name;
|
|
67
|
+
}
|
|
68
|
+
/** Keeps the options of `execArgv` that a worker thread accepts and needs. An option owns the value tokens (those
|
|
69
|
+
* that do not start with `-`) that follow it, as in `--require ./preload.cjs`. */
|
|
70
|
+
function inheritableExecArgv(execArgv) {
|
|
71
|
+
const kept = [];
|
|
72
|
+
let keeping = false;
|
|
73
|
+
for (const token of execArgv) {
|
|
74
|
+
if (token.startsWith("-")) {
|
|
75
|
+
const name = optionName(token);
|
|
76
|
+
keeping = Object.hasOwn(WORKER_INHERITED_FLAGS, name) && process.allowedNodeEnvironmentFlags.has(name);
|
|
77
|
+
}
|
|
78
|
+
if (keeping)
|
|
79
|
+
kept.push(token);
|
|
80
|
+
}
|
|
81
|
+
return kept;
|
|
82
|
+
}
|
|
83
|
+
/** Splits `NODE_OPTIONS` the way Node does: tokens are separated by spaces, and a double-quoted part may hold spaces
|
|
84
|
+
* and escape a character with a backslash. */
|
|
85
|
+
function nodeOptionsTokens(nodeOptions) {
|
|
86
|
+
const tokens = [];
|
|
87
|
+
let current = "";
|
|
88
|
+
let inQuotes = false;
|
|
89
|
+
let pending = false;
|
|
90
|
+
for (let i = 0; i < nodeOptions.length; i += 1) {
|
|
91
|
+
const char = nodeOptions[i];
|
|
92
|
+
if (inQuotes && char === "\\" && i + 1 < nodeOptions.length) {
|
|
93
|
+
i += 1;
|
|
94
|
+
current += nodeOptions[i];
|
|
95
|
+
}
|
|
96
|
+
else if (char === '"') {
|
|
97
|
+
inQuotes = !inQuotes;
|
|
98
|
+
pending = true;
|
|
99
|
+
}
|
|
100
|
+
else if (char === " " && !inQuotes) {
|
|
101
|
+
if (pending || current)
|
|
102
|
+
tokens.push(current);
|
|
103
|
+
current = "";
|
|
104
|
+
pending = false;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
current += char;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (pending || current)
|
|
111
|
+
tokens.push(current);
|
|
112
|
+
return tokens;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* `execArgv` for the worker threads of a Piscina pool. Piscina's worker calls `require()` on its task module before
|
|
116
|
+
* it falls back to `import()`, and this package's workers are ES modules, so on Node 22 that first load runs through
|
|
117
|
+
* `require(esm)`. Terminating a worker thread while it is in that load aborts the whole process on Node 22.16
|
|
118
|
+
* (`FATAL ERROR: v8::Module::IsGraphAsync must be used on an instantiated module`), and `pool.destroy()` terminates
|
|
119
|
+
* every worker that has not finished starting. With `require(esm)` off, the `require()` fails at once and the
|
|
120
|
+
* `import()` after it can be interrupted safely.
|
|
121
|
+
*
|
|
122
|
+
* An explicit `execArgv` replaces the command-line options that a worker inherits, so this returns the host's options
|
|
123
|
+
* that {@link WORKER_INHERITED_FLAGS} lists (a host started with `node --require ./preload.cjs` still runs that preload
|
|
124
|
+
* in its workers), followed by `--no-experimental-require-module` when this Node knows it and the host has not chosen
|
|
125
|
+
* a require-module option itself. A worker re-reads `NODE_OPTIONS` from the environment, and its `execArgv` wins over
|
|
126
|
+
* it, so a require-module option in `NODE_OPTIONS` (for a preload that requires an ES module) counts as the host's
|
|
127
|
+
* choice too, and appending the flag then would override it.
|
|
128
|
+
*/
|
|
129
|
+
export function piscinaWorkerExecArgv() {
|
|
130
|
+
const execArgv = inheritableExecArgv(process.execArgv);
|
|
131
|
+
const hostChoseRequireEsm = [...execArgv, ...nodeOptionsTokens(process.env.NODE_OPTIONS ?? "")].some((token) => REQUIRE_ESM_FLAGS.includes(optionName(token)));
|
|
132
|
+
if (!hostChoseRequireEsm && process.allowedNodeEnvironmentFlags.has(NO_REQUIRE_ESM_FLAG)) {
|
|
133
|
+
execArgv.push(NO_REQUIRE_ESM_FLAG);
|
|
134
|
+
}
|
|
135
|
+
return execArgv;
|
|
136
|
+
}
|
|
19
137
|
//# sourceMappingURL=worker-threads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-threads.js","sourceRoot":"","sources":["../../src/util/worker-threads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AAWzB;kEACkE;AAClE,MAAM,UAAU,wBAAwB,CAAC,OAAkC;IACzE,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,UAAU,CAAC,mDA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CAAC,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"native-worker-pool.d.ts","sourceRoot":"","sources":["../../src/worker/native-worker-pool.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEzF,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC;AAEvD,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAKF,wBAAgB,8BAA8B,CAAC,oBAAoB,SAA4B,GAAG,MAAM,CAEvG;AAED,wBAAgB,8BAA8B,CAC5C,SAAS,CAAC,EAAE,MAAM,EAClB,oBAAoB,SAA4B,GAC/C,MAAM,CAMR;AAMD,wBAAgB,uBAAuB,IAAI,MAAM,CAahD;AAED,wBAAgB,sBAAsB,CAAC,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAkB9E"}
|
|
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { Piscina } from "piscina";
|
|
6
|
-
import { resolveWorkerThreadCount } from "../util/worker-threads.js";
|
|
6
|
+
import { piscinaWorkerExecArgv, resolveWorkerThreadCount } from "../util/worker-threads.js";
|
|
7
7
|
import { markWindowsProcessDrainRequired } from "../util/windows-process-drain.js";
|
|
8
8
|
const HARD_MAX_THREADS = 64;
|
|
9
9
|
const DEFAULT_NATIVE_THREAD_CAP = 8;
|
|
@@ -44,6 +44,7 @@ export function createNativeWorkerPool(opts) {
|
|
|
44
44
|
markWindowsProcessDrainRequired();
|
|
45
45
|
return new Piscina({
|
|
46
46
|
filename: workerPath,
|
|
47
|
+
execArgv: piscinaWorkerExecArgv(),
|
|
47
48
|
minThreads: 1,
|
|
48
49
|
maxThreads: threads,
|
|
49
50
|
maxQueue: opts?.maxQueue ?? threads * 4,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-worker-pool.js","sourceRoot":"","sources":["../../src/worker/native-worker-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"native-worker-pool.js","sourceRoot":"","sources":["../../src/worker/native-worker-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAenF,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC,MAAM,UAAU,8BAA8B,CAAC,oBAAoB,GAAG,EAAE,CAAC,oBAAoB,EAAE;IAC7F,OAAO,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAA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QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,YAAY,GAAG,CAAC;QACnF,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACvC,CAAC,CAAC,gBAAgB,CAAC;IACvB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IACrE,MAAM,UAAU,GAAG,uBAAuB,EAAE,CAAC;IAC7C,+BAA+B,EAAE,CAAC;IAClC,OAAO,IAAI,OAAO,CAAC;QACjB,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,qBAAqB,EAAE;QACjC,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,IAAI,EAAE,QAAQ,IAAI,OAAO,GAAG,CAAC;QACvC,WAAW,EAAE,MAAM;QACnB,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;KAC3E,CAAC,CAAC;AACL,CAAC"}
|
package/docs/mcp.md
CHANGED
|
@@ -20,7 +20,7 @@ codegraph server status --root /path/to/repo --json
|
|
|
20
20
|
codegraph server stop --root /path/to/repo
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
`server start` serializes lifecycle changes, launches `mcp serve`, waits for a same-root process and startup identity proved by a challenged `/health` response, then records the process at `.codegraph/server.json`. It defaults to `127.0.0.1:7331`; use `--host` explicitly for a non-loopback bind, `--replace` only to restart a live server for the same root, and `--startup-timeout-ms <1-86400000>` when
|
|
23
|
+
`server start` serializes lifecycle changes, launches `mcp serve`, waits for a same-root process and startup identity proved by a challenged `/health` response, then records the process at `.codegraph/server.json`. It defaults to `127.0.0.1:7331`; use `--host` explicitly for a non-loopback bind, `--replace` only to restart a live server for the same root, and `--startup-timeout-ms <1-86400000>` when the process needs more than the 15-second default to start answering `/health`. The index warmup runs in the background after that and does not count against the timeout.
|
|
24
24
|
|
|
25
25
|
`server start --json` emits `status: "started"`, the registry fields, and `update`. `server status` retries challenged HTTP health checks and reports a verification remedy instead of removing metadata for an unreachable or identity-mismatched server. `server stop` removes only confirmed stale metadata or signals a Codegraph process whose proven health identity matches the registry.
|
|
26
26
|
|
|
@@ -32,14 +32,16 @@ Use `mcp serve` directly when another process manager owns the server:
|
|
|
32
32
|
codegraph mcp serve --root /path/to/repo --port 7331
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
The server answers `initialize` and `tools/list` as soon as it is serving, then builds the base session cache and the search index in the background (the default, `--warmup`). Pass `--warmup-symbols` to also build the detailed symbol graph in the background, or `--no-warmup` to build nothing up front:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
38
|
codegraph mcp serve --root . --stdio --no-warmup
|
|
39
39
|
codegraph mcp serve --root . --port 7331 --warmup-symbols
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
`--warmup
|
|
42
|
+
With `--no-warmup`, the first tool call that needs the index starts the build. In every mode, `search`, `explore`, `orient`, `get_file` with `includeGraphContext`, `review`, `packet_get`, `workspace_symbols`, and `impact` wait for a running build for at most `--index-wait-ms` (default 15000) and then answer `index_building`; every other tool waits for the index without a limit. See [Cold start and `index_building`](#cold-start-and-index_building).
|
|
43
|
+
|
|
44
|
+
The server also watches the project for file changes and refreshes the index in the background. Pass `--no-watch` to turn that off; see [File watcher](#file-watcher).
|
|
43
45
|
|
|
44
46
|
The shared HTTP endpoint is `http://127.0.0.1:7331/mcp`. HTTP binds to `127.0.0.1` by default; pass `--host <host>` only when another machine or container must reach it.
|
|
45
47
|
|
|
@@ -49,7 +51,9 @@ HTTP protocol sessions track last activity, cap concurrent legacy sessions (defa
|
|
|
49
51
|
|
|
50
52
|
Each MCP server permits four concurrent tool calls by default across every HTTP request and protocol session; a saturated server returns a retryable busy error rather than queueing unbounded work. The programmatic server options `mcpToolConcurrency`, `httpBodyTimeoutMs`, and `mcpToolTimeoutMs` tune concurrency, the 30-second HTTP request-body deadline, and the 5-minute per-tool execution deadline; an HTTP body that misses its deadline receives `408 Request Timeout`, while an expired tool call is aborted and names its configured limit. Completed legacy requests refresh session activity before idle eviction is considered.
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
`mcpIndexWaitMs` (CLI `--index-wait-ms`) bounds only the wait of those tools for an index build, not the tool call itself; see [Cold start and `index_building`](#cold-start-and-index_building).
|
|
55
|
+
|
|
56
|
+
Client cancellation returns promptly, but does not discard shared index or artifact work. A cancelled call continues to occupy its concurrency slot until its underlying operation settles, preventing a burst of abandoned requests from exceeding the configured resource bound; the MCP SDK aborts the individual in-flight HTTP request when its response socket closes without closing the shared protocol session. Shutdown rejects new calls and waits for active work, for the startup warmup, and for every index load that a call started, including one whose call stopped waiting or failed, before invalidating shared session resources.
|
|
53
57
|
|
|
54
58
|
Use stdio for a client-owned subprocess. Use HTTP for one long-running codegraph process per repository, then point every MCP-capable IDE, terminal, or agent client at the same local URL. Exact config keys vary by client, but the MCP settings should use HTTP/Streamable HTTP transport plus the `/mcp` URL instead of a `command`/`args` stdio launch.
|
|
55
59
|
|
|
@@ -67,6 +71,8 @@ On Windows, installed-package servers map the verified native addon from `%LOCAL
|
|
|
67
71
|
|
|
68
72
|
The published CLI and MCP runtime is a self-contained bundle rather than a set of lazy content-hashed chunks. This prevents an in-place package upgrade from deleting code that an already running server has not loaded yet; restart the client after an upgrade to select the new runtime.
|
|
69
73
|
|
|
74
|
+
A server that keeps running through an upgrade can still need a module that the upgrade removed. The tool call then returns `isError: true` with a message that the codegraph package changed on disk and the MCP server must be restarted, in place of Node's `Cannot find module` text.
|
|
75
|
+
|
|
70
76
|
Run `codegraph doctor` in the installed release to inspect `native.origin`, `native.update`, and any stale npm retirement siblings. `updateSafeForCurrentProcess` describes only the process running doctor; it does not prove that no other process or filesystem service holds a package file.
|
|
71
77
|
|
|
72
78
|
## Tools
|
|
@@ -86,7 +92,7 @@ The server exposes the same bounded primitives as the CLI and library session la
|
|
|
86
92
|
- `get_file`: bounded project file read with `offset`/`limit` line pagination, exact `number<TAB>line` content, and optional direct graph context.
|
|
87
93
|
- `get_symbol`: resolve a stable search or explain handle.
|
|
88
94
|
- `goto`: definition lookup by portable handle, qualified `file::symbol` path, or file position.
|
|
89
|
-
- `refs`: references by portable handle, qualified `file::symbol` path, or file position. Collection `limit` defaults to 25 and caps at 500 (`DEFAULT_MCP_COLLECTION_LIMIT` / `MAX_MCP_COLLECTION_LIMIT` in `src/mcp/tools.ts`). The response pairs `references` with `limit`, `totalSeen`, `truncated`, and `omitted`; `truncated` is exact because the lookup probes one reference past the limit. When truncated, `totalSeen` and `omitted` are lower bounds from the bounded probe, not full corpus-wide counts. Successful results also include `referenceCoverage`: `complete` means every statically linked candidate known to the current index was checked, while `partial` identifies one or more of `parser_degraded`, `unresolved_import`, `strategy_unavailable`, `name_equivalence_unavailable`, and `truncated` reasons, in that order, plus any known affected files. `strategy_unavailable` means that an applicable reference strategy could not prove all candidate sites, such as when a required scan did not run or a member access had an unknown receiver type. `name_equivalence_unavailable` means that a name-equivalence decision could not be verified. This scope does not certify unknown dynamic or bare imports. Resolved named and default import declaration references use top-level `importBinding` to identify `imported` source-name tokens and distinct `local` alias/default tokens.
|
|
95
|
+
- `refs`: references by portable handle, qualified `file::symbol` path, or file position. Collection `limit` defaults to 25 and caps at 500 (`DEFAULT_MCP_COLLECTION_LIMIT` / `MAX_MCP_COLLECTION_LIMIT` in `src/mcp/tools.ts`). The response pairs `references` with `limit`, `totalSeen`, `truncated`, and `omitted`; `truncated` is exact because the lookup probes one reference past the limit. When truncated, `totalSeen` and `omitted` are lower bounds from the bounded probe, not full corpus-wide counts. Successful results also include `referenceCoverage`: `complete` means every statically linked candidate known to the current index was checked, while `partial` identifies one or more of `parser_degraded`, `parse_error`, `unresolved_import`, `strategy_unavailable`, `name_equivalence_unavailable`, and `truncated` reasons, in that order, plus any known affected files. For non-SCSS definitions, any ERROR/MISSING region in a candidate or scanned file makes coverage partial regardless of its contents. `strategy_unavailable` means that an applicable reference strategy could not prove all candidate sites, such as when a required scan did not run or a member access had an unknown receiver type. `name_equivalence_unavailable` means that a name-equivalence decision could not be verified. This scope does not certify unknown dynamic or bare imports. Resolved named and default import declaration references use top-level `importBinding` to identify `imported` source-name tokens and distinct `local` alias/default tokens.
|
|
90
96
|
- `file_deps`, `path`: dependency navigation; pass `direction: "deps"` or `"rdeps"` to `file_deps`. `file_deps` uses the same collection `limit` default 25 / max 500 as `refs`. `file_deps.file` accepts a portable symbol handle or qualified symbol path and traverses its declaring file. `dependencies`/`reverseDependencies` carry the same `limit`/`totalSeen`/`truncated`/`omitted` metadata as `refs`, so a capped prefix is always distinguishable from a complete result; when truncated, `totalSeen` and `omitted` are lower bounds from the bounded probe, not full graph-wide counts.
|
|
91
97
|
- `impact`: compact git-range impact analysis (`format: "compact"`, `impacted`, diagnostics). Bounded by default.
|
|
92
98
|
- `review`: git-range review report (`riskSummary`, `reviewTasks`, candidate tests). MCP is a bounded transport: `projectFiles`, `changedFiles` (including per-file `symbols`), `graphDelta`, and `candidateTests` are capped at the response's `limits` with exact per-collection `omittedCounts`, and `summary` totals stay accurate for the full report. Library callers that need the complete unbounded report call `buildReviewReport` directly instead of going through MCP.
|
|
@@ -113,20 +119,86 @@ For MCP `explore`, `includeSource` defaults to `false`: source-bearing packets d
|
|
|
113
119
|
|
|
114
120
|
## Session lifecycle
|
|
115
121
|
|
|
116
|
-
MCP keeps one codegraph session warm for the configured root. That makes follow-up calls cheaper than separate CLI invocations. `mcp serve`
|
|
122
|
+
MCP keeps one codegraph session warm for the configured root. That makes follow-up calls cheaper than separate CLI invocations. `mcp serve` builds the base session cache and the search index in the background once it is serving, so a cold discovery-and-build cost no longer delays `initialize` or `tools/list`. Pass `--no-warmup` to build only when a tool call needs the index, or `--warmup-symbols` to also build the detailed symbol graph.
|
|
117
123
|
On the first `tools/call`, codegraph can emit `notifications/message` and, when the request includes `_meta.progressToken`, `notifications/progress` before the final result. Stdio carries them inline, and modern Streamable HTTP clients that accept `text/event-stream` receive them as a stream.
|
|
118
124
|
|
|
119
|
-
|
|
125
|
+
The `startup_timeout_ms = 20000` Codex example below is enough for a large repository: the server answers `initialize` at once and no longer builds before it serves. A client's per-request timeout is what a cold build can exceed, and [Cold start and `index_building`](#cold-start-and-index_building) keeps each request inside it.
|
|
120
126
|
|
|
121
127
|
Text and hybrid searches reuse a prepared handle for `.codegraph/cache/index-v1/search-v1.sqlite` and cache identical responses by snapshot identity and request options. A detected refresh or explicit `refresh_index` closes the handle and clears cached responses before the next snapshot.
|
|
122
128
|
|
|
123
129
|
If the sidecar is busy or unavailable, MCP uses the same exact in-memory matcher. [How it works](./how-it-works.md#cache-and-session-behavior) explains the search cache.
|
|
124
130
|
|
|
125
|
-
Use `refresh_index` to rebuild the snapshot, reset SQLite artifact state, or recover after a change burst exceeds automatic limits. Concurrent refresh, artifact build,
|
|
131
|
+
Use `refresh_index` to rebuild the snapshot, reset SQLite artifact state, or recover after a change burst exceeds automatic limits (the [file watcher](#file-watcher) rebuilds in the background after such a burst unless `--no-watch` is set). Concurrent refresh, artifact build, automatic SQLite artifact refresh, and file watcher refresh operations serialize per MCP server, so each bundle is written consistently and no two index builds overlap. With write access, `query_sqlite` refreshes codegraph SQLite artifacts after small edits; otherwise it refuses stale rows. `artifact_build` refuses stale indexes, so run `refresh_index` after large change bursts.
|
|
126
132
|
A session created with `freshness: { policy: "manual" }` (only possible when a library caller passes its own session to `createCodegraphMcpHandlers`) reports `freshness.state: "unchecked"`. It records no file signatures, so it cannot check a SQLite artifact or build a new one: `query_sqlite` rejects a stale artifact with that explanation, and `artifact_build` fails. Rebuild the artifact from a session whose policy is `check` or `auto`, for example with `codegraph artifact --sqlite`.
|
|
127
133
|
`get_file` reads live bytes from disk after path confinement. It does not require a fresh index; only an explicit `includeGraphContext: true` checks indexed freshness and adds direct graph context, so returned file bytes and `totalLines` remain live even when `freshness` reports stale context.
|
|
128
134
|
Tool schemas are flat JSON objects for broad client compatibility; argument combinations such as `refs` handle-vs-position mode are validated by the server. Legacy paired names (`callers`, `callees`, `supertypes`, `subtypes`, `deps`, and `rdeps`) remain accepted by `tools/call` as aliases, but only the unified tools appear in `tools/list`.
|
|
129
135
|
|
|
136
|
+
### Cold start and `index_building`
|
|
137
|
+
|
|
138
|
+
The first run on a large project builds the index from scratch, which can take longer than the 30 seconds that MCP clients commonly allow for one request. The main read tools stay inside that window:
|
|
139
|
+
|
|
140
|
+
- `initialize` and `tools/list` answer at once on stdio and HTTP. The warmup starts after the server is serving and runs in the background; the HTTP server listens before it ends.
|
|
141
|
+
- `search`, `explore`, `orient`, `get_file` with `includeGraphContext`, `review`, `packet_get`, `workspace_symbols`, and `impact` wait for the builds they read for at most `--index-wait-ms` (default 15000). The warmup and concurrent calls share each build, so a call joins one that is running instead of starting another.
|
|
142
|
+
- Every other tool, such as `goto`, `refs`, `calls`, `file_deps`, `query_sqlite`, `refresh_index`, and `artifact_build`, waits for the index without a limit, as it did before. A client that calls one of them during a cold build needs a request timeout that covers the build.
|
|
143
|
+
- `get_file` without `includeGraphContext` never waits: it reads the file from disk under the same root confinement as always. A `review` of a range without a changed file is answered from git and waits for nothing.
|
|
144
|
+
|
|
145
|
+
When one of these tools waits at all, it first waits for a build that is running, because it checks freshness against it, then for what it reads:
|
|
146
|
+
|
|
147
|
+
| Tool | Reads |
|
|
148
|
+
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
149
|
+
| `search` | The project index. `hybrid`, `symbol`, and `graph` also read the symbol graph, and `hybrid` and `text` the search index. A `path` search without `from` lists files and reads no index. |
|
|
150
|
+
| `explore` | What a `hybrid` `search` reads. With `includeSource` (off by default over MCP) and `maxPackets` above 0, also the detailed symbol graph and the duplicate analysis. |
|
|
151
|
+
| `orient` | The project index. |
|
|
152
|
+
| `workspace_symbols` | The project index. |
|
|
153
|
+
| `impact` | The project index. |
|
|
154
|
+
| `get_file` | The project index, only with `includeGraphContext`. |
|
|
155
|
+
| `review` | The project index and the duplicate analysis, for a range with a changed file. |
|
|
156
|
+
| `packet_get` | The detailed symbol graph, and for a file or symbol target the duplicate analysis (a SQL object or an unresolved target needs none). A `review:` target reads no session build. |
|
|
157
|
+
|
|
158
|
+
A call of these tools that has waited `--index-wait-ms` without its builds ending returns a normal result, not an error, and the builds continue:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"status": "index_building",
|
|
163
|
+
"tool": "search",
|
|
164
|
+
"message": "Codegraph is still building the index for this project (Building search index, 19s so far). The build continues in the background; call 'search' again to wait for it.",
|
|
165
|
+
"retryAfterMs": 1000,
|
|
166
|
+
"waitedMs": 15003,
|
|
167
|
+
"progress": { "activity": "Building search index", "elapsedMs": 19100 }
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- Call the same tool again. The retry joins the builds that run, waits for what is left of them, up to the same budget, and then returns the normal result.
|
|
172
|
+
- `progress.activity` names what is running, such as `Indexing files` or `Preparing duplicate analysis`. `current` and `total` appear only while the work has a measurable total, such as files parsed.
|
|
173
|
+
- A cancelled request stops waiting at once; the builds are not cancelled.
|
|
174
|
+
- When the session is replaced while a call waits, because a file changed, the file watcher refreshed, or `refresh_index` ran, the call builds what it reads again inside the same budget, up to three times in all.
|
|
175
|
+
- The budget is a timer on the server's event loop. The builds hand the loop back every few milliseconds, between files, so the answer normally arrives within a second or two of the budget. A single large file can hold the loop longer, and a call also runs its own work once its builds end (a `review` of a large diff, for example), so keep the budget at least ten seconds below the client's timeout.
|
|
176
|
+
|
|
177
|
+
Choose a request timeout longer than `--index-wait-ms`: the default of 15 seconds leaves a client that allows 30 fifteen seconds for the work that follows the builds; for a project where that is not enough, lower the budget. For a client that allows less, lower the budget (`--index-wait-ms 8000`); for one that allows more, raise it, or pass `--index-wait-ms 0` to make these tools wait for as long as the builds take too (the per-tool deadline still applies). Library callers set `mcpIndexWaitMs`. The setting belongs to the server: `codegraph.config.json` has no key for it.
|
|
178
|
+
|
|
179
|
+
### File watcher
|
|
180
|
+
|
|
181
|
+
`mcp serve` and `server start` watch the project root while the server runs, unless you pass `--no-watch`. The watcher is a hint: the freshness check that every index-backed tool call runs stays the authority, so a missed event costs speed, never correctness.
|
|
182
|
+
|
|
183
|
+
- A file event outside the directories that default discovery ignores (`node_modules`, `.git`, `.codegraph`, `dist`, `build`, `target`, Python virtual environments, and the others listed under [Project config](./cli.md#project-config)) clears the cached freshness result at once. The next query then runs the full check instead of reusing a result that can be up to 5 seconds old. A tree that `discovery.includeGlobs` re-includes stays ignored here, so its edits wait for the freshness check. A cache directory that `--cache-dir`, `CODEGRAPH_CACHE_DIR`, or an absolute `cache.location` placed inside the project is ignored too, because the server writes there itself. The two are compared as real paths, so a project root or cache directory spelled through a symlink or junction still matches.
|
|
184
|
+
- 500 ms after the last event, and at least 5 seconds after the previous background refresh ended, the server runs the freshness check and rebuilds the index in the background. Each new event restarts the 500 ms wait, so no refresh starts while events still arrive. A query that arrives during the rebuild waits for it, as on a cold start.
|
|
185
|
+
- The background rebuild also covers a change burst above the automatic refresh limits (50 files or 2 MB, for example a branch switch), which a query alone reports as `stale` until `refresh_index`. A session that cannot read its configuration keeps its snapshot, as it does without the watcher.
|
|
186
|
+
- One refresh runs at a time, and events during it schedule exactly one more. A refresh takes its turn in the same queue as `refresh_index`, `artifact_build`, and the automatic SQLite artifact refresh, so `refresh_index` waits for a rebuild that is running instead of starting a second one beside it. A refresh that still waits for its turn when a newer event arrives, or when the watcher pauses, gives the turn up: the burst that the event belongs to starts its own refresh once it settles. On Linux, each read of the file list for the per-directory watches takes its turn in that queue as well, so the first read of a server that started with `--no-warmup` cannot overlap a `refresh_index`. A failed refresh writes `[codegraph] watch refresh failed: <message>` to stderr and leaves the freshness check as it was.
|
|
187
|
+
- When the server shuts down (stdin closes, or the HTTP server closes), it stops the watches and timers at once, then waits for a refresh that is running, for a read of the file list that has started, for the startup warmup, and for every index load that the warmup or a call started, including one whose call stopped waiting and one that ran beside a load that failed, before it releases the session, so that none writes the cache or the file signatures afterwards.
|
|
188
|
+
- After 30 minutes without a tool call, the server closes every watch and cancels pending refreshes, including one that still waits for its turn behind a `refresh_index` or an `artifact_build`. The next tool call reopens the watches and clears the cached freshness result first, so the check sees every edit made during the pause. This matters most for `codegraph server start`, whose process lives until `server stop`.
|
|
189
|
+
- Windows and macOS use one recursive watch on the root. Other platforms use one watch per directory that holds a discovered file, because Node's recursive watching on Linux walks the whole tree, `node_modules` included, and can exhaust inotify watches.
|
|
190
|
+
- A watch that is lost with its directory (a deleted project root on Windows, a removed and recreated directory on Linux) closes at the first event that names the directory and counts as a change; the next refresh opens it again once the directory exists.
|
|
191
|
+
- On Linux, a directory that appears later gets its watch from the event that reports it, and a directory that a file list named keeps its watch after the list stops naming it because its last source file was deleted. Either watch, and the ones above it, stay until the directory is removed, even while the directory holds only a placeholder such as `.gitkeep` or other directories, so that a source file added later is seen. At most 128 watches that no file list names stay open at once, the ones above those directories included. Past that, an event opens no watch, and the next refresh closes the watches that were opened longest ago.
|
|
192
|
+
- If the system runs out of watches or file descriptors, the server logs `file watching disabled: <code>` and relies on the freshness check alone. Network drives and some container mounts may not deliver events; the freshness check still applies.
|
|
193
|
+
- With `--no-warmup`, the watches open on the first tool call. Handlers from `createCodegraphMcpHandlers` and servers started with a caller-supplied `session` are not watched.
|
|
194
|
+
|
|
195
|
+
The CLI exposes only `--no-watch`. Library callers of `serveCodegraphMcp` can tune the watcher (see the [library API](./library-api.md)):
|
|
196
|
+
|
|
197
|
+
- `watch`: `false` turns the watcher off. Defaults to on.
|
|
198
|
+
- `watchDebounceMs`: quiet time after the last event. Defaults to `500`.
|
|
199
|
+
- `watchMinRefreshIntervalMs`: minimum time from the end of one background refresh to the start of the next. Defaults to `5000`.
|
|
200
|
+
- `watchIdleMs`: time without a tool call before the watcher pauses; `0` never pauses. Defaults to `1800000` (30 minutes).
|
|
201
|
+
|
|
130
202
|
### `workspace_symbols`
|
|
131
203
|
|
|
132
204
|
Call `workspace_symbols` with flat fields `query`, optional `kinds`, `exportedOnly`, `includeImports`, `fileGlob`, and `limit`. Imports are excluded by default; `fileGlob` matches project-relative paths, the default limit is 50, and both the schema and handler enforce a maximum of 500.
|
|
@@ -187,6 +259,8 @@ Only resolved, indexed `extends` and `implements` relationships are returned. Im
|
|
|
187
259
|
|
|
188
260
|
Call `get_file` with a project-relative `file`. `offset` is the 1-based first line, `limit` is the maximum returned lines, and `maxBytes` bounds unnumbered raw page text including its line separators; defaults are `1`, `2000`, and `80000`, with output-page caps of `10000` lines and `500000` bytes. A separate 16 MiB hard input-size limit rejects larger raw reads and structural text-config summaries before unbounded I/O, bounding complete-stream binary/UTF-8 validation and total-line counting rather than returned page size.
|
|
189
261
|
|
|
262
|
+
`file` is required and must be a project-relative path string. A missing, `null`, or non-string value is rejected with JSON-RPC `-32602` and `Invalid parameters for get_file: file: expected a project-relative file path string, received null`.
|
|
263
|
+
|
|
190
264
|
```json
|
|
191
265
|
{
|
|
192
266
|
"file": "src/auth.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lzehrung/codegraph",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -82,20 +82,20 @@
|
|
|
82
82
|
"license": "MIT",
|
|
83
83
|
"description": "Multi-language repository map for agents and humans: MCP tools, dependency graphs, symbol indexes, impact review, and bounded source evidence.",
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@lzehrung/codegraph-core": "3.
|
|
86
|
-
"@lzehrung/codegraph-native": "^2.
|
|
87
|
-
"@modelcontextprotocol/node": "^2.
|
|
88
|
-
"@modelcontextprotocol/server": "^2.
|
|
85
|
+
"@lzehrung/codegraph-core": "3.1.1",
|
|
86
|
+
"@lzehrung/codegraph-native": "^2.1.1",
|
|
87
|
+
"@modelcontextprotocol/node": "^2.1.1",
|
|
88
|
+
"@modelcontextprotocol/server": "^2.3.1",
|
|
89
89
|
"jsonc-parser": "^3.3.1",
|
|
90
90
|
"picomatch": "^4.0.3",
|
|
91
91
|
"piscina": "^4.9.4",
|
|
92
92
|
"smol-toml": "^1.9.1",
|
|
93
93
|
"tinyglobby": "^0.2.17",
|
|
94
94
|
"tsconfig-paths": "^4.2.0",
|
|
95
|
-
"zod": "^4.
|
|
95
|
+
"zod": "^4.6.7"
|
|
96
96
|
},
|
|
97
97
|
"overrides": {
|
|
98
|
-
"@hono/node-server": "^2.
|
|
98
|
+
"@hono/node-server": "^2.1.3",
|
|
99
99
|
"@emnapi/core": "1.11.3",
|
|
100
100
|
"@emnapi/runtime": "1.11.3"
|
|
101
101
|
}
|