@lzehrung/codegraph 2.1.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/LICENSE +21 -0
- package/README.md +448 -0
- package/THIRD_PARTY_NOTICES +77 -0
- package/codegraph-skill/codegraph/SKILL.md +262 -0
- package/dist/agent/artifact.d.ts +65 -0
- package/dist/agent/artifact.d.ts.map +1 -0
- package/dist/agent/artifact.js +616 -0
- package/dist/agent/artifact.js.map +1 -0
- package/dist/agent/bounds.d.ts +12 -0
- package/dist/agent/bounds.d.ts.map +1 -0
- package/dist/agent/bounds.js +25 -0
- package/dist/agent/bounds.js.map +1 -0
- package/dist/agent/callHierarchy.d.ts +28 -0
- package/dist/agent/callHierarchy.d.ts.map +1 -0
- package/dist/agent/callHierarchy.js +82 -0
- package/dist/agent/callHierarchy.js.map +1 -0
- package/dist/agent/explain.d.ts +136 -0
- package/dist/agent/explain.d.ts.map +1 -0
- package/dist/agent/explain.js +743 -0
- package/dist/agent/explain.js.map +1 -0
- package/dist/agent/explore.d.ts +67 -0
- package/dist/agent/explore.d.ts.map +1 -0
- package/dist/agent/explore.js +474 -0
- package/dist/agent/explore.js.map +1 -0
- package/dist/agent/fileView.d.ts +55 -0
- package/dist/agent/fileView.d.ts.map +1 -0
- package/dist/agent/fileView.js +528 -0
- package/dist/agent/fileView.js.map +1 -0
- package/dist/agent/followUps.d.ts +9 -0
- package/dist/agent/followUps.d.ts.map +1 -0
- package/dist/agent/followUps.js +164 -0
- package/dist/agent/followUps.js.map +1 -0
- package/dist/agent/handles.d.ts +29 -0
- package/dist/agent/handles.d.ts.map +1 -0
- package/dist/agent/handles.js +103 -0
- package/dist/agent/handles.js.map +1 -0
- package/dist/agent/normalize.d.ts +19 -0
- package/dist/agent/normalize.d.ts.map +1 -0
- package/dist/agent/normalize.js +45 -0
- package/dist/agent/normalize.js.map +1 -0
- package/dist/agent/orient.d.ts +55 -0
- package/dist/agent/orient.d.ts.map +1 -0
- package/dist/agent/orient.js +307 -0
- package/dist/agent/orient.js.map +1 -0
- package/dist/agent/packet.d.ts +28 -0
- package/dist/agent/packet.d.ts.map +1 -0
- package/dist/agent/packet.js +138 -0
- package/dist/agent/packet.js.map +1 -0
- package/dist/agent/query-index/candidates.d.ts +4 -0
- package/dist/agent/query-index/candidates.d.ts.map +1 -0
- package/dist/agent/query-index/candidates.js +89 -0
- package/dist/agent/query-index/candidates.js.map +1 -0
- package/dist/agent/query-index/content.d.ts +36 -0
- package/dist/agent/query-index/content.d.ts.map +1 -0
- package/dist/agent/query-index/content.js +124 -0
- package/dist/agent/query-index/content.js.map +1 -0
- package/dist/agent/query-index/paths.d.ts +12 -0
- package/dist/agent/query-index/paths.d.ts.map +1 -0
- package/dist/agent/query-index/paths.js +41 -0
- package/dist/agent/query-index/paths.js.map +1 -0
- package/dist/agent/query-index/queryIndexWorker.d.ts +8 -0
- package/dist/agent/query-index/queryIndexWorker.d.ts.map +1 -0
- package/dist/agent/query-index/queryIndexWorker.js +11 -0
- package/dist/agent/query-index/queryIndexWorker.js.map +1 -0
- package/dist/agent/query-index/schema.d.ts +26 -0
- package/dist/agent/query-index/schema.d.ts.map +1 -0
- package/dist/agent/query-index/schema.js +171 -0
- package/dist/agent/query-index/schema.js.map +1 -0
- package/dist/agent/query-index/sessionStore.d.ts +5 -0
- package/dist/agent/query-index/sessionStore.d.ts.map +1 -0
- package/dist/agent/query-index/sessionStore.js +53 -0
- package/dist/agent/query-index/sessionStore.js.map +1 -0
- package/dist/agent/query-index/sourceIdentity.d.ts +3 -0
- package/dist/agent/query-index/sourceIdentity.d.ts.map +1 -0
- package/dist/agent/query-index/sourceIdentity.js +12 -0
- package/dist/agent/query-index/sourceIdentity.js.map +1 -0
- package/dist/agent/query-index/store.d.ts +48 -0
- package/dist/agent/query-index/store.d.ts.map +1 -0
- package/dist/agent/query-index/store.js +372 -0
- package/dist/agent/query-index/store.js.map +1 -0
- package/dist/agent/query-index/update.d.ts +9 -0
- package/dist/agent/query-index/update.d.ts.map +1 -0
- package/dist/agent/query-index/update.js +309 -0
- package/dist/agent/query-index/update.js.map +1 -0
- package/dist/agent/query-index/workerPool.d.ts +5 -0
- package/dist/agent/query-index/workerPool.d.ts.map +1 -0
- package/dist/agent/query-index/workerPool.js +82 -0
- package/dist/agent/query-index/workerPool.js.map +1 -0
- package/dist/agent/refactorPlan.d.ts +40 -0
- package/dist/agent/refactorPlan.d.ts.map +1 -0
- package/dist/agent/refactorPlan.js +234 -0
- package/dist/agent/refactorPlan.js.map +1 -0
- package/dist/agent/renamePreview.d.ts +60 -0
- package/dist/agent/renamePreview.d.ts.map +1 -0
- package/dist/agent/renamePreview.js +1008 -0
- package/dist/agent/renamePreview.js.map +1 -0
- package/dist/agent/search.d.ts +77 -0
- package/dist/agent/search.d.ts.map +1 -0
- package/dist/agent/search.js +1002 -0
- package/dist/agent/search.js.map +1 -0
- package/dist/agent/semantic.d.ts +35 -0
- package/dist/agent/semantic.d.ts.map +1 -0
- package/dist/agent/semantic.js +2 -0
- package/dist/agent/semantic.js.map +1 -0
- package/dist/agent/semanticSymbols.d.ts +16 -0
- package/dist/agent/semanticSymbols.d.ts.map +1 -0
- package/dist/agent/semanticSymbols.js +96 -0
- package/dist/agent/semanticSymbols.js.map +1 -0
- package/dist/agent/session.d.ts +71 -0
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/agent/session.js +432 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/sessionLifecycle.d.ts +5 -0
- package/dist/agent/sessionLifecycle.d.ts.map +1 -0
- package/dist/agent/sessionLifecycle.js +18 -0
- package/dist/agent/sessionLifecycle.js.map +1 -0
- package/dist/agent/shell.d.ts +2 -0
- package/dist/agent/shell.d.ts.map +1 -0
- package/dist/agent/shell.js +6 -0
- package/dist/agent/shell.js.map +1 -0
- package/dist/agent/symbolLookup.d.ts +12 -0
- package/dist/agent/symbolLookup.d.ts.map +1 -0
- package/dist/agent/symbolLookup.js +26 -0
- package/dist/agent/symbolLookup.js.map +1 -0
- package/dist/agent/typeHierarchy.d.ts +39 -0
- package/dist/agent/typeHierarchy.d.ts.map +1 -0
- package/dist/agent/typeHierarchy.js +125 -0
- package/dist/agent/typeHierarchy.js.map +1 -0
- package/dist/agent/workspaceSymbols.d.ts +18 -0
- package/dist/agent/workspaceSymbols.d.ts.map +1 -0
- package/dist/agent/workspaceSymbols.js +75 -0
- package/dist/agent/workspaceSymbols.js.map +1 -0
- package/dist/agent-tools.d.ts +280 -0
- package/dist/agent-tools.d.ts.map +1 -0
- package/dist/agent-tools.js +669 -0
- package/dist/agent-tools.js.map +1 -0
- package/dist/agent.d.ts +35 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +19 -0
- package/dist/agent.js.map +1 -0
- package/dist/analysisSummary.d.ts +19 -0
- package/dist/analysisSummary.d.ts.map +1 -0
- package/dist/analysisSummary.js +80 -0
- package/dist/analysisSummary.js.map +1 -0
- package/dist/bin/cli.js +105144 -0
- package/dist/bin/queryIndexWorker.js +3914 -0
- package/dist/bootstrap/treeSitterLanguages.d.ts +5 -0
- package/dist/bootstrap/treeSitterLanguages.d.ts.map +1 -0
- package/dist/bootstrap/treeSitterLanguages.js +41 -0
- package/dist/bootstrap/treeSitterLanguages.js.map +1 -0
- package/dist/chunking/chunkBlocks.d.ts +9 -0
- package/dist/chunking/chunkBlocks.d.ts.map +1 -0
- package/dist/chunking/chunkBlocks.js +60 -0
- package/dist/chunking/chunkBlocks.js.map +1 -0
- package/dist/chunking/chunkFile.d.ts +34 -0
- package/dist/chunking/chunkFile.d.ts.map +1 -0
- package/dist/chunking/chunkFile.js +153 -0
- package/dist/chunking/chunkFile.js.map +1 -0
- package/dist/chunking/chunkId.d.ts +7 -0
- package/dist/chunking/chunkId.d.ts.map +1 -0
- package/dist/chunking/chunkId.js +30 -0
- package/dist/chunking/chunkId.js.map +1 -0
- package/dist/chunking/chunkMatches.d.ts +4 -0
- package/dist/chunking/chunkMatches.d.ts.map +1 -0
- package/dist/chunking/chunkMatches.js +65 -0
- package/dist/chunking/chunkMatches.js.map +1 -0
- package/dist/chunking/chunkMerge.d.ts +4 -0
- package/dist/chunking/chunkMerge.d.ts.map +1 -0
- package/dist/chunking/chunkMerge.js +144 -0
- package/dist/chunking/chunkMerge.js.map +1 -0
- package/dist/chunking/chunkSFC.d.ts +18 -0
- package/dist/chunking/chunkSFC.d.ts.map +1 -0
- package/dist/chunking/chunkSFC.js +165 -0
- package/dist/chunking/chunkSFC.js.map +1 -0
- package/dist/chunking/chunkSplit.d.ts +6 -0
- package/dist/chunking/chunkSplit.d.ts.map +1 -0
- package/dist/chunking/chunkSplit.js +170 -0
- package/dist/chunking/chunkSplit.js.map +1 -0
- package/dist/chunking/chunkTextFile.d.ts +28 -0
- package/dist/chunking/chunkTextFile.d.ts.map +1 -0
- package/dist/chunking/chunkTextFile.js +107 -0
- package/dist/chunking/chunkTextFile.js.map +1 -0
- package/dist/chunking/languageConfig.d.ts +35 -0
- package/dist/chunking/languageConfig.d.ts.map +1 -0
- package/dist/chunking/languageConfig.js +24 -0
- package/dist/chunking/languageConfig.js.map +1 -0
- package/dist/chunking/tokenizer.d.ts +2 -0
- package/dist/chunking/tokenizer.d.ts.map +1 -0
- package/dist/chunking/tokenizer.js +6 -0
- package/dist/chunking/tokenizer.js.map +1 -0
- package/dist/chunking/types.d.ts +54 -0
- package/dist/chunking/types.d.ts.map +1 -0
- package/dist/chunking/types.js +2 -0
- package/dist/chunking/types.js.map +1 -0
- package/dist/cli/affected.d.ts +32 -0
- package/dist/cli/affected.d.ts.map +1 -0
- package/dist/cli/affected.js +235 -0
- package/dist/cli/affected.js.map +1 -0
- package/dist/cli/artifact.d.ts +4 -0
- package/dist/cli/artifact.d.ts.map +1 -0
- package/dist/cli/artifact.js +35 -0
- package/dist/cli/artifact.js.map +1 -0
- package/dist/cli/bootstrap.d.ts +3 -0
- package/dist/cli/bootstrap.d.ts.map +1 -0
- package/dist/cli/bootstrap.js +8 -0
- package/dist/cli/bootstrap.js.map +1 -0
- package/dist/cli/callHierarchy.d.ts +6 -0
- package/dist/cli/callHierarchy.d.ts.map +1 -0
- package/dist/cli/callHierarchy.js +65 -0
- package/dist/cli/callHierarchy.js.map +1 -0
- package/dist/cli/chunk.d.ts +4 -0
- package/dist/cli/chunk.d.ts.map +1 -0
- package/dist/cli/chunk.js +109 -0
- package/dist/cli/chunk.js.map +1 -0
- package/dist/cli/commandCatalog.d.ts +14 -0
- package/dist/cli/commandCatalog.d.ts.map +1 -0
- package/dist/cli/commandCatalog.js +109 -0
- package/dist/cli/commandCatalog.js.map +1 -0
- package/dist/cli/commandTable.d.ts +16 -0
- package/dist/cli/commandTable.d.ts.map +1 -0
- package/dist/cli/commandTable.js +716 -0
- package/dist/cli/commandTable.js.map +1 -0
- package/dist/cli/compileCache.d.ts +17 -0
- package/dist/cli/compileCache.d.ts.map +1 -0
- package/dist/cli/compileCache.js +63 -0
- package/dist/cli/compileCache.js.map +1 -0
- package/dist/cli/context.d.ts +87 -0
- package/dist/cli/context.d.ts.map +1 -0
- package/dist/cli/context.js +322 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/discoveryGlobs.d.ts +11 -0
- package/dist/cli/discoveryGlobs.d.ts.map +1 -0
- package/dist/cli/discoveryGlobs.js +74 -0
- package/dist/cli/discoveryGlobs.js.map +1 -0
- package/dist/cli/doctor.d.ts +33 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +143 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/drift.d.ts +18 -0
- package/dist/cli/drift.d.ts.map +1 -0
- package/dist/cli/drift.js +101 -0
- package/dist/cli/drift.js.map +1 -0
- package/dist/cli/duplicateSimilarity.d.ts +10 -0
- package/dist/cli/duplicateSimilarity.d.ts.map +1 -0
- package/dist/cli/duplicateSimilarity.js +20 -0
- package/dist/cli/duplicateSimilarity.js.map +1 -0
- package/dist/cli/duplicates.d.ts +15 -0
- package/dist/cli/duplicates.d.ts.map +1 -0
- package/dist/cli/duplicates.js +400 -0
- package/dist/cli/duplicates.js.map +1 -0
- package/dist/cli/explain.d.ts +4 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +47 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/explore.d.ts +4 -0
- package/dist/cli/explore.d.ts.map +1 -0
- package/dist/cli/explore.js +28 -0
- package/dist/cli/explore.js.map +1 -0
- package/dist/cli/file.d.ts +4 -0
- package/dist/cli/file.d.ts.map +1 -0
- package/dist/cli/file.js +53 -0
- package/dist/cli/file.js.map +1 -0
- package/dist/cli/graph.d.ts +90 -0
- package/dist/cli/graph.d.ts.map +1 -0
- package/dist/cli/graph.js +379 -0
- package/dist/cli/graph.js.map +1 -0
- package/dist/cli/graphDelta.d.ts +24 -0
- package/dist/cli/graphDelta.d.ts.map +1 -0
- package/dist/cli/graphDelta.js +75 -0
- package/dist/cli/graphDelta.js.map +1 -0
- package/dist/cli/graphQueries.d.ts +23 -0
- package/dist/cli/graphQueries.d.ts.map +1 -0
- package/dist/cli/graphQueries.js +257 -0
- package/dist/cli/graphQueries.js.map +1 -0
- package/dist/cli/grep.d.ts +10 -0
- package/dist/cli/grep.d.ts.map +1 -0
- package/dist/cli/grep.js +61 -0
- package/dist/cli/grep.js.map +1 -0
- package/dist/cli/help.d.ts +52 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +749 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/impact.d.ts +24 -0
- package/dist/cli/impact.d.ts.map +1 -0
- package/dist/cli/impact.js +481 -0
- package/dist/cli/impact.js.map +1 -0
- package/dist/cli/index.d.ts +43 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +112 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/indexPolicy.d.ts +36 -0
- package/dist/cli/indexPolicy.d.ts.map +1 -0
- package/dist/cli/indexPolicy.js +168 -0
- package/dist/cli/indexPolicy.js.map +1 -0
- package/dist/cli/inspect.d.ts +30 -0
- package/dist/cli/inspect.d.ts.map +1 -0
- package/dist/cli/inspect.js +323 -0
- package/dist/cli/inspect.js.map +1 -0
- package/dist/cli/install.d.ts +14 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +273 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/invocationContext.d.ts +77 -0
- package/dist/cli/invocationContext.d.ts.map +1 -0
- package/dist/cli/invocationContext.js +357 -0
- package/dist/cli/invocationContext.js.map +1 -0
- package/dist/cli/lifecycle.d.ts +11 -0
- package/dist/cli/lifecycle.d.ts.map +1 -0
- package/dist/cli/lifecycle.js +81 -0
- package/dist/cli/lifecycle.js.map +1 -0
- package/dist/cli/links.d.ts +11 -0
- package/dist/cli/links.d.ts.map +1 -0
- package/dist/cli/links.js +53 -0
- package/dist/cli/links.js.map +1 -0
- package/dist/cli/location.d.ts +5 -0
- package/dist/cli/location.d.ts.map +1 -0
- package/dist/cli/location.js +11 -0
- package/dist/cli/location.js.map +1 -0
- package/dist/cli/mcp.d.ts +7 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +60 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/navigation.d.ts +23 -0
- package/dist/cli/navigation.d.ts.map +1 -0
- package/dist/cli/navigation.js +367 -0
- package/dist/cli/navigation.js.map +1 -0
- package/dist/cli/options.d.ts +21 -0
- package/dist/cli/options.d.ts.map +1 -0
- package/dist/cli/options.js +694 -0
- package/dist/cli/options.js.map +1 -0
- package/dist/cli/orient.d.ts +6 -0
- package/dist/cli/orient.d.ts.map +1 -0
- package/dist/cli/orient.js +72 -0
- package/dist/cli/orient.js.map +1 -0
- package/dist/cli/packet.d.ts +4 -0
- package/dist/cli/packet.d.ts.map +1 -0
- package/dist/cli/packet.js +53 -0
- package/dist/cli/packet.js.map +1 -0
- package/dist/cli/pretty.d.ts +9 -0
- package/dist/cli/pretty.d.ts.map +1 -0
- package/dist/cli/pretty.js +91 -0
- package/dist/cli/pretty.js.map +1 -0
- package/dist/cli/progress.d.ts +20 -0
- package/dist/cli/progress.d.ts.map +1 -0
- package/dist/cli/progress.js +156 -0
- package/dist/cli/progress.js.map +1 -0
- package/dist/cli/projectFile.d.ts +13 -0
- package/dist/cli/projectFile.d.ts.map +1 -0
- package/dist/cli/projectFile.js +23 -0
- package/dist/cli/projectFile.js.map +1 -0
- package/dist/cli/refactorPlan.d.ts +6 -0
- package/dist/cli/refactorPlan.d.ts.map +1 -0
- package/dist/cli/refactorPlan.js +84 -0
- package/dist/cli/refactorPlan.js.map +1 -0
- package/dist/cli/renamePreview.d.ts +4 -0
- package/dist/cli/renamePreview.d.ts.map +1 -0
- package/dist/cli/renamePreview.js +86 -0
- package/dist/cli/renamePreview.js.map +1 -0
- package/dist/cli/review.d.ts +36 -0
- package/dist/cli/review.d.ts.map +1 -0
- package/dist/cli/review.js +302 -0
- package/dist/cli/review.js.map +1 -0
- package/dist/cli/rootPolicy.d.ts +53 -0
- package/dist/cli/rootPolicy.d.ts.map +1 -0
- package/dist/cli/rootPolicy.js +190 -0
- package/dist/cli/rootPolicy.js.map +1 -0
- package/dist/cli/search.d.ts +8 -0
- package/dist/cli/search.d.ts.map +1 -0
- package/dist/cli/search.js +49 -0
- package/dist/cli/search.js.map +1 -0
- package/dist/cli/skill.d.ts +13 -0
- package/dist/cli/skill.d.ts.map +1 -0
- package/dist/cli/skill.js +227 -0
- package/dist/cli/skill.js.map +1 -0
- package/dist/cli/sql.d.ts +6 -0
- package/dist/cli/sql.d.ts.map +1 -0
- package/dist/cli/sql.js +37 -0
- package/dist/cli/sql.js.map +1 -0
- package/dist/cli/symbols.d.ts +4 -0
- package/dist/cli/symbols.d.ts.map +1 -0
- package/dist/cli/symbols.js +59 -0
- package/dist/cli/symbols.js.map +1 -0
- package/dist/cli/typeHierarchy.d.ts +6 -0
- package/dist/cli/typeHierarchy.d.ts.map +1 -0
- package/dist/cli/typeHierarchy.js +81 -0
- package/dist/cli/typeHierarchy.js.map +1 -0
- package/dist/cli/viewer.d.ts +27 -0
- package/dist/cli/viewer.d.ts.map +1 -0
- package/dist/cli/viewer.js +313 -0
- package/dist/cli/viewer.js.map +1 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +185 -0
- package/dist/cli.js.map +1 -0
- package/dist/cliBootstrap.d.ts +3 -0
- package/dist/cliBootstrap.d.ts.map +1 -0
- package/dist/cliBootstrap.js +10 -0
- package/dist/cliBootstrap.js.map +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +141 -0
- package/dist/config.js.map +1 -0
- package/dist/documentLinks/asciidoc.d.ts +3 -0
- package/dist/documentLinks/asciidoc.d.ts.map +1 -0
- package/dist/documentLinks/asciidoc.js +115 -0
- package/dist/documentLinks/asciidoc.js.map +1 -0
- package/dist/documentLinks/check.d.ts +31 -0
- package/dist/documentLinks/check.d.ts.map +1 -0
- package/dist/documentLinks/check.js +272 -0
- package/dist/documentLinks/check.js.map +1 -0
- package/dist/documentLinks/html.d.ts +5 -0
- package/dist/documentLinks/html.d.ts.map +1 -0
- package/dist/documentLinks/html.js +324 -0
- package/dist/documentLinks/html.js.map +1 -0
- package/dist/documentLinks/markdown.d.ts +15 -0
- package/dist/documentLinks/markdown.d.ts.map +1 -0
- package/dist/documentLinks/markdown.js +538 -0
- package/dist/documentLinks/markdown.js.map +1 -0
- package/dist/documentLinks/rst.d.ts +3 -0
- package/dist/documentLinks/rst.d.ts.map +1 -0
- package/dist/documentLinks/rst.js +179 -0
- package/dist/documentLinks/rst.js.map +1 -0
- package/dist/documentLinks/sfc.d.ts +4 -0
- package/dist/documentLinks/sfc.d.ts.map +1 -0
- package/dist/documentLinks/sfc.js +30 -0
- package/dist/documentLinks/sfc.js.map +1 -0
- package/dist/documentLinks/shared.d.ts +11 -0
- package/dist/documentLinks/shared.d.ts.map +1 -0
- package/dist/documentLinks/shared.js +147 -0
- package/dist/documentLinks/shared.js.map +1 -0
- package/dist/documentLinks.d.ts +12 -0
- package/dist/documentLinks.d.ts.map +1 -0
- package/dist/documentLinks.js +50 -0
- package/dist/documentLinks.js.map +1 -0
- package/dist/drift/artifact.d.ts +3 -0
- package/dist/drift/artifact.d.ts.map +1 -0
- package/dist/drift/artifact.js +170 -0
- package/dist/drift/artifact.js.map +1 -0
- package/dist/drift/compare.d.ts +5 -0
- package/dist/drift/compare.d.ts.map +1 -0
- package/dist/drift/compare.js +355 -0
- package/dist/drift/compare.js.map +1 -0
- package/dist/drift/git.d.ts +3 -0
- package/dist/drift/git.d.ts.map +1 -0
- package/dist/drift/git.js +128 -0
- package/dist/drift/git.js.map +1 -0
- package/dist/drift/index.d.ts +8 -0
- package/dist/drift/index.d.ts.map +1 -0
- package/dist/drift/index.js +7 -0
- package/dist/drift/index.js.map +1 -0
- package/dist/drift/languages.d.ts +2 -0
- package/dist/drift/languages.d.ts.map +1 -0
- package/dist/drift/languages.js +18 -0
- package/dist/drift/languages.js.map +1 -0
- package/dist/drift/report.d.ts +6 -0
- package/dist/drift/report.d.ts.map +1 -0
- package/dist/drift/report.js +75 -0
- package/dist/drift/report.js.map +1 -0
- package/dist/drift/snapshot.d.ts +3 -0
- package/dist/drift/snapshot.d.ts.map +1 -0
- package/dist/drift/snapshot.js +164 -0
- package/dist/drift/snapshot.js.map +1 -0
- package/dist/drift/types.d.ts +142 -0
- package/dist/drift/types.d.ts.map +1 -0
- package/dist/drift/types.js +2 -0
- package/dist/drift/types.js.map +1 -0
- package/dist/duplicate-keywords.d.ts +3 -0
- package/dist/duplicate-keywords.d.ts.map +1 -0
- package/dist/duplicate-keywords.js +155 -0
- package/dist/duplicate-keywords.js.map +1 -0
- package/dist/duplicate-token-normalization.d.ts +6 -0
- package/dist/duplicate-token-normalization.d.ts.map +1 -0
- package/dist/duplicate-token-normalization.js +53 -0
- package/dist/duplicate-token-normalization.js.map +1 -0
- package/dist/duplicates/scoring.d.ts +121 -0
- package/dist/duplicates/scoring.d.ts.map +1 -0
- package/dist/duplicates/scoring.js +1245 -0
- package/dist/duplicates/scoring.js.map +1 -0
- package/dist/duplicates/types.d.ts +216 -0
- package/dist/duplicates/types.d.ts.map +1 -0
- package/dist/duplicates/types.js +2 -0
- package/dist/duplicates/types.js.map +1 -0
- package/dist/duplicates/unitCache.d.ts +40 -0
- package/dist/duplicates/unitCache.d.ts.map +1 -0
- package/dist/duplicates/unitCache.js +352 -0
- package/dist/duplicates/unitCache.js.map +1 -0
- package/dist/duplicates/units.d.ts +60 -0
- package/dist/duplicates/units.d.ts.map +1 -0
- package/dist/duplicates/units.js +447 -0
- package/dist/duplicates/units.js.map +1 -0
- package/dist/duplicates.d.ts +14 -0
- package/dist/duplicates.d.ts.map +1 -0
- package/dist/duplicates.js +400 -0
- package/dist/duplicates.js.map +1 -0
- package/dist/duplicatesLeads.d.ts +39 -0
- package/dist/duplicatesLeads.d.ts.map +1 -0
- package/dist/duplicatesLeads.js +112 -0
- package/dist/duplicatesLeads.js.map +1 -0
- package/dist/frameworks/angularjs.d.ts +18 -0
- package/dist/frameworks/angularjs.d.ts.map +1 -0
- package/dist/frameworks/angularjs.js +427 -0
- package/dist/frameworks/angularjs.js.map +1 -0
- package/dist/graph-builder.d.ts +35 -0
- package/dist/graph-builder.d.ts.map +1 -0
- package/dist/graph-builder.js +132 -0
- package/dist/graph-builder.js.map +1 -0
- package/dist/graph-edge-collector.d.ts +57 -0
- package/dist/graph-edge-collector.d.ts.map +1 -0
- package/dist/graph-edge-collector.js +199 -0
- package/dist/graph-edge-collector.js.map +1 -0
- package/dist/graphs/adjacency.d.ts +10 -0
- package/dist/graphs/adjacency.d.ts.map +1 -0
- package/dist/graphs/adjacency.js +38 -0
- package/dist/graphs/adjacency.js.map +1 -0
- package/dist/graphs/angularjs.d.ts +5 -0
- package/dist/graphs/angularjs.d.ts.map +1 -0
- package/dist/graphs/angularjs.js +88 -0
- package/dist/graphs/angularjs.js.map +1 -0
- package/dist/graphs/cycles.d.ts +24 -0
- package/dist/graphs/cycles.d.ts.map +1 -0
- package/dist/graphs/cycles.js +159 -0
- package/dist/graphs/cycles.js.map +1 -0
- package/dist/graphs/edgeResolution.d.ts +25 -0
- package/dist/graphs/edgeResolution.d.ts.map +1 -0
- package/dist/graphs/edgeResolution.js +97 -0
- package/dist/graphs/edgeResolution.js.map +1 -0
- package/dist/graphs/external/cache.d.ts +6 -0
- package/dist/graphs/external/cache.d.ts.map +1 -0
- package/dist/graphs/external/cache.js +21 -0
- package/dist/graphs/external/cache.js.map +1 -0
- package/dist/graphs/external/context.d.ts +9 -0
- package/dist/graphs/external/context.d.ts.map +1 -0
- package/dist/graphs/external/context.js +93 -0
- package/dist/graphs/external/context.js.map +1 -0
- package/dist/graphs/external/manifests.d.ts +8 -0
- package/dist/graphs/external/manifests.d.ts.map +1 -0
- package/dist/graphs/external/manifests.js +429 -0
- package/dist/graphs/external/manifests.js.map +1 -0
- package/dist/graphs/external/stdlib.d.ts +3 -0
- package/dist/graphs/external/stdlib.d.ts.map +1 -0
- package/dist/graphs/external/stdlib.js +166 -0
- package/dist/graphs/external/stdlib.js.map +1 -0
- package/dist/graphs/external-classifier.d.ts +16 -0
- package/dist/graphs/external-classifier.d.ts.map +1 -0
- package/dist/graphs/external-classifier.js +46 -0
- package/dist/graphs/external-classifier.js.map +1 -0
- package/dist/graphs/grep.d.ts +66 -0
- package/dist/graphs/grep.d.ts.map +1 -0
- package/dist/graphs/grep.js +131 -0
- package/dist/graphs/grep.js.map +1 -0
- package/dist/graphs/hotspots.d.ts +13 -0
- package/dist/graphs/hotspots.d.ts.map +1 -0
- package/dist/graphs/hotspots.js +88 -0
- package/dist/graphs/hotspots.js.map +1 -0
- package/dist/graphs/limits.d.ts +2 -0
- package/dist/graphs/limits.d.ts.map +1 -0
- package/dist/graphs/limits.js +7 -0
- package/dist/graphs/limits.js.map +1 -0
- package/dist/graphs/queries.d.ts +4 -0
- package/dist/graphs/queries.d.ts.map +1 -0
- package/dist/graphs/queries.js +4 -0
- package/dist/graphs/queries.js.map +1 -0
- package/dist/graphs/render.d.ts +6 -0
- package/dist/graphs/render.d.ts.map +1 -0
- package/dist/graphs/render.js +85 -0
- package/dist/graphs/render.js.map +1 -0
- package/dist/graphs/specifiers.d.ts +24 -0
- package/dist/graphs/specifiers.d.ts.map +1 -0
- package/dist/graphs/specifiers.js +434 -0
- package/dist/graphs/specifiers.js.map +1 -0
- package/dist/graphs/symbol-graph-detailed/ast.d.ts +25 -0
- package/dist/graphs/symbol-graph-detailed/ast.d.ts.map +1 -0
- package/dist/graphs/symbol-graph-detailed/ast.js +167 -0
- package/dist/graphs/symbol-graph-detailed/ast.js.map +1 -0
- package/dist/graphs/symbol-graph-detailed/edgePasses.d.ts +30 -0
- package/dist/graphs/symbol-graph-detailed/edgePasses.d.ts.map +1 -0
- package/dist/graphs/symbol-graph-detailed/edgePasses.js +484 -0
- package/dist/graphs/symbol-graph-detailed/edgePasses.js.map +1 -0
- package/dist/graphs/symbol-graph-detailed/importAliases.d.ts +10 -0
- package/dist/graphs/symbol-graph-detailed/importAliases.d.ts.map +1 -0
- package/dist/graphs/symbol-graph-detailed/importAliases.js +44 -0
- package/dist/graphs/symbol-graph-detailed/importAliases.js.map +1 -0
- package/dist/graphs/symbol-graph-detailed/memberChains.d.ts +17 -0
- package/dist/graphs/symbol-graph-detailed/memberChains.d.ts.map +1 -0
- package/dist/graphs/symbol-graph-detailed/memberChains.js +30 -0
- package/dist/graphs/symbol-graph-detailed/memberChains.js.map +1 -0
- package/dist/graphs/symbol-graph-detailed.d.ts +14 -0
- package/dist/graphs/symbol-graph-detailed.d.ts.map +1 -0
- package/dist/graphs/symbol-graph-detailed.js +180 -0
- package/dist/graphs/symbol-graph-detailed.js.map +1 -0
- package/dist/graphs/symbol-graph.d.ts +56 -0
- package/dist/graphs/symbol-graph.d.ts.map +1 -0
- package/dist/graphs/symbol-graph.js +180 -0
- package/dist/graphs/symbol-graph.js.map +1 -0
- package/dist/graphs/symbol-render.d.ts +22 -0
- package/dist/graphs/symbol-render.d.ts.map +1 -0
- package/dist/graphs/symbol-render.js +184 -0
- package/dist/graphs/symbol-render.js.map +1 -0
- package/dist/graphs/traversal.d.ts +20 -0
- package/dist/graphs/traversal.d.ts.map +1 -0
- package/dist/graphs/traversal.js +75 -0
- package/dist/graphs/traversal.js.map +1 -0
- package/dist/graphs/types.d.ts +18 -0
- package/dist/graphs/types.d.ts.map +1 -0
- package/dist/graphs/types.js +2 -0
- package/dist/graphs/types.js.map +1 -0
- package/dist/graphs/unresolved.d.ts +13 -0
- package/dist/graphs/unresolved.d.ts.map +1 -0
- package/dist/graphs/unresolved.js +47 -0
- package/dist/graphs/unresolved.js.map +1 -0
- package/dist/graphs.d.ts +17 -0
- package/dist/graphs.d.ts.map +1 -0
- package/dist/graphs.js +11 -0
- package/dist/graphs.js.map +1 -0
- package/dist/impact/analyzer.d.ts +8 -0
- package/dist/impact/analyzer.d.ts.map +1 -0
- package/dist/impact/analyzer.js +156 -0
- package/dist/impact/analyzer.js.map +1 -0
- package/dist/impact/budgets.d.ts +36 -0
- package/dist/impact/budgets.d.ts.map +1 -0
- package/dist/impact/budgets.js +178 -0
- package/dist/impact/budgets.js.map +1 -0
- package/dist/impact/call-compatibility/providers/index.d.ts +14 -0
- package/dist/impact/call-compatibility/providers/index.d.ts.map +1 -0
- package/dist/impact/call-compatibility/providers/index.js +58 -0
- package/dist/impact/call-compatibility/providers/index.js.map +1 -0
- package/dist/impact/call-compatibility/providers/types.d.ts +26 -0
- package/dist/impact/call-compatibility/providers/types.d.ts.map +1 -0
- package/dist/impact/call-compatibility/providers/types.js +2 -0
- package/dist/impact/call-compatibility/providers/types.js.map +1 -0
- package/dist/impact/call-compatibility/types.d.ts +24 -0
- package/dist/impact/call-compatibility/types.d.ts.map +1 -0
- package/dist/impact/call-compatibility/types.js +2 -0
- package/dist/impact/call-compatibility/types.js.map +1 -0
- package/dist/impact/callCompatibility.d.ts +17 -0
- package/dist/impact/callCompatibility.d.ts.map +1 -0
- package/dist/impact/callCompatibility.js +1546 -0
- package/dist/impact/callCompatibility.js.map +1 -0
- package/dist/impact/collect.d.ts +27 -0
- package/dist/impact/collect.d.ts.map +1 -0
- package/dist/impact/collect.js +97 -0
- package/dist/impact/collect.js.map +1 -0
- package/dist/impact/context.d.ts +42 -0
- package/dist/impact/context.d.ts.map +1 -0
- package/dist/impact/context.js +286 -0
- package/dist/impact/context.js.map +1 -0
- package/dist/impact/direct.d.ts +26 -0
- package/dist/impact/direct.d.ts.map +1 -0
- package/dist/impact/direct.js +187 -0
- package/dist/impact/direct.js.map +1 -0
- package/dist/impact/hunks.d.ts +14 -0
- package/dist/impact/hunks.d.ts.map +1 -0
- package/dist/impact/hunks.js +87 -0
- package/dist/impact/hunks.js.map +1 -0
- package/dist/impact/index.d.ts +22 -0
- package/dist/impact/index.d.ts.map +1 -0
- package/dist/impact/index.js +27 -0
- package/dist/impact/index.js.map +1 -0
- package/dist/impact/map.d.ts +12 -0
- package/dist/impact/map.d.ts.map +1 -0
- package/dist/impact/map.js +753 -0
- package/dist/impact/map.js.map +1 -0
- package/dist/impact/memberResolutionCoverage.d.ts +14 -0
- package/dist/impact/memberResolutionCoverage.d.ts.map +1 -0
- package/dist/impact/memberResolutionCoverage.js +38 -0
- package/dist/impact/memberResolutionCoverage.js.map +1 -0
- package/dist/impact/parse.d.ts +5 -0
- package/dist/impact/parse.d.ts.map +1 -0
- package/dist/impact/parse.js +239 -0
- package/dist/impact/parse.js.map +1 -0
- package/dist/impact/path.d.ts +14 -0
- package/dist/impact/path.d.ts.map +1 -0
- package/dist/impact/path.js +103 -0
- package/dist/impact/path.js.map +1 -0
- package/dist/impact/providers/base.d.ts +10 -0
- package/dist/impact/providers/base.d.ts.map +1 -0
- package/dist/impact/providers/base.js +239 -0
- package/dist/impact/providers/base.js.map +1 -0
- package/dist/impact/referenceCache.d.ts +12 -0
- package/dist/impact/referenceCache.d.ts.map +1 -0
- package/dist/impact/referenceCache.js +101 -0
- package/dist/impact/referenceCache.js.map +1 -0
- package/dist/impact/report-suggestions.d.ts +4 -0
- package/dist/impact/report-suggestions.d.ts.map +1 -0
- package/dist/impact/report-suggestions.js +886 -0
- package/dist/impact/report-suggestions.js.map +1 -0
- package/dist/impact/report.d.ts +8 -0
- package/dist/impact/report.d.ts.map +1 -0
- package/dist/impact/report.js +405 -0
- package/dist/impact/report.js.map +1 -0
- package/dist/impact/reportCompact.d.ts +8 -0
- package/dist/impact/reportCompact.d.ts.map +1 -0
- package/dist/impact/reportCompact.js +145 -0
- package/dist/impact/reportCompact.js.map +1 -0
- package/dist/impact/reportFull.d.ts +10 -0
- package/dist/impact/reportFull.d.ts.map +1 -0
- package/dist/impact/reportFull.js +66 -0
- package/dist/impact/reportFull.js.map +1 -0
- package/dist/impact/reportParts.d.ts +42 -0
- package/dist/impact/reportParts.d.ts.map +1 -0
- package/dist/impact/reportParts.js +2 -0
- package/dist/impact/reportParts.js.map +1 -0
- package/dist/impact/reportShared.d.ts +76 -0
- package/dist/impact/reportShared.d.ts.map +1 -0
- package/dist/impact/reportShared.js +130 -0
- package/dist/impact/reportShared.js.map +1 -0
- package/dist/impact/severity.d.ts +29 -0
- package/dist/impact/severity.d.ts.map +1 -0
- package/dist/impact/severity.js +178 -0
- package/dist/impact/severity.js.map +1 -0
- package/dist/impact/signature-node-utils.d.ts +5 -0
- package/dist/impact/signature-node-utils.d.ts.map +1 -0
- package/dist/impact/signature-node-utils.js +29 -0
- package/dist/impact/signature-node-utils.js.map +1 -0
- package/dist/impact/streaming.d.ts +60 -0
- package/dist/impact/streaming.d.ts.map +1 -0
- package/dist/impact/streaming.js +285 -0
- package/dist/impact/streaming.js.map +1 -0
- package/dist/impact/suggestions.d.ts +4 -0
- package/dist/impact/suggestions.d.ts.map +1 -0
- package/dist/impact/suggestions.js +317 -0
- package/dist/impact/suggestions.js.map +1 -0
- package/dist/impact/testPatterns.d.ts +6 -0
- package/dist/impact/testPatterns.d.ts.map +1 -0
- package/dist/impact/testPatterns.js +65 -0
- package/dist/impact/testPatterns.js.map +1 -0
- package/dist/impact/transitive.d.ts +12 -0
- package/dist/impact/transitive.d.ts.map +1 -0
- package/dist/impact/transitive.js +188 -0
- package/dist/impact/transitive.js.map +1 -0
- package/dist/impact/types.d.ts +556 -0
- package/dist/impact/types.d.ts.map +1 -0
- package/dist/impact/types.js +17 -0
- package/dist/impact/types.js.map +1 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer/build-cache/manifest.d.ts +48 -0
- package/dist/indexer/build-cache/manifest.d.ts.map +1 -0
- package/dist/indexer/build-cache/manifest.js +228 -0
- package/dist/indexer/build-cache/manifest.js.map +1 -0
- package/dist/indexer/build-cache/module-cache.d.ts +20 -0
- package/dist/indexer/build-cache/module-cache.d.ts.map +1 -0
- package/dist/indexer/build-cache/module-cache.js +339 -0
- package/dist/indexer/build-cache/module-cache.js.map +1 -0
- package/dist/indexer/build-cache/options.d.ts +50 -0
- package/dist/indexer/build-cache/options.d.ts.map +1 -0
- package/dist/indexer/build-cache/options.js +276 -0
- package/dist/indexer/build-cache/options.js.map +1 -0
- package/dist/indexer/build-cache/project-snapshot.d.ts +30 -0
- package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -0
- package/dist/indexer/build-cache/project-snapshot.js +928 -0
- package/dist/indexer/build-cache/project-snapshot.js.map +1 -0
- package/dist/indexer/build-cache/reports.d.ts +13 -0
- package/dist/indexer/build-cache/reports.d.ts.map +1 -0
- package/dist/indexer/build-cache/reports.js +134 -0
- package/dist/indexer/build-cache/reports.js.map +1 -0
- package/dist/indexer/build-cache.d.ts +6 -0
- package/dist/indexer/build-cache.d.ts.map +1 -0
- package/dist/indexer/build-cache.js +6 -0
- package/dist/indexer/build-cache.js.map +1 -0
- package/dist/indexer/build-index.d.ts +28 -0
- package/dist/indexer/build-index.d.ts.map +1 -0
- package/dist/indexer/build-index.js +1579 -0
- package/dist/indexer/build-index.js.map +1 -0
- package/dist/indexer/build-manifest.d.ts +16 -0
- package/dist/indexer/build-manifest.d.ts.map +1 -0
- package/dist/indexer/build-manifest.js +43 -0
- package/dist/indexer/build-manifest.js.map +1 -0
- package/dist/indexer/build-workers.d.ts +27 -0
- package/dist/indexer/build-workers.d.ts.map +1 -0
- package/dist/indexer/build-workers.js +209 -0
- package/dist/indexer/build-workers.js.map +1 -0
- package/dist/indexer/call-hierarchy.d.ts +33 -0
- package/dist/indexer/call-hierarchy.d.ts.map +1 -0
- package/dist/indexer/call-hierarchy.js +192 -0
- package/dist/indexer/call-hierarchy.js.map +1 -0
- package/dist/indexer/declarations.d.ts +15 -0
- package/dist/indexer/declarations.d.ts.map +1 -0
- package/dist/indexer/declarations.js +95 -0
- package/dist/indexer/declarations.js.map +1 -0
- package/dist/indexer/finalize.d.ts +20 -0
- package/dist/indexer/finalize.d.ts.map +1 -0
- package/dist/indexer/finalize.js +34 -0
- package/dist/indexer/finalize.js.map +1 -0
- package/dist/indexer/import-types.d.ts +48 -0
- package/dist/indexer/import-types.d.ts.map +1 -0
- package/dist/indexer/import-types.js +2 -0
- package/dist/indexer/import-types.js.map +1 -0
- package/dist/indexer/imports/context.d.ts +7 -0
- package/dist/indexer/imports/context.d.ts.map +1 -0
- package/dist/indexer/imports/context.js +2 -0
- package/dist/indexer/imports/context.js.map +1 -0
- package/dist/indexer/imports/graphOnly.d.ts +13 -0
- package/dist/indexer/imports/graphOnly.d.ts.map +1 -0
- package/dist/indexer/imports/graphOnly.js +40 -0
- package/dist/indexer/imports/graphOnly.js.map +1 -0
- package/dist/indexer/imports/jsTextImports.d.ts +9 -0
- package/dist/indexer/imports/jsTextImports.d.ts.map +1 -0
- package/dist/indexer/imports/jsTextImports.js +173 -0
- package/dist/indexer/imports/jsTextImports.js.map +1 -0
- package/dist/indexer/imports/languageSpecific.d.ts +26 -0
- package/dist/indexer/imports/languageSpecific.d.ts.map +1 -0
- package/dist/indexer/imports/languageSpecific.js +444 -0
- package/dist/indexer/imports/languageSpecific.js.map +1 -0
- package/dist/indexer/imports/nativeCaptures.d.ts +16 -0
- package/dist/indexer/imports/nativeCaptures.d.ts.map +1 -0
- package/dist/indexer/imports/nativeCaptures.js +139 -0
- package/dist/indexer/imports/nativeCaptures.js.map +1 -0
- package/dist/indexer/imports/python.d.ts +8 -0
- package/dist/indexer/imports/python.d.ts.map +1 -0
- package/dist/indexer/imports/python.js +116 -0
- package/dist/indexer/imports/python.js.map +1 -0
- package/dist/indexer/imports.d.ts +21 -0
- package/dist/indexer/imports.d.ts.map +1 -0
- package/dist/indexer/imports.js +188 -0
- package/dist/indexer/imports.js.map +1 -0
- package/dist/indexer/incremental-plan.d.ts +71 -0
- package/dist/indexer/incremental-plan.d.ts.map +1 -0
- package/dist/indexer/incremental-plan.js +212 -0
- package/dist/indexer/incremental-plan.js.map +1 -0
- package/dist/indexer/load-current-index.d.ts +51 -0
- package/dist/indexer/load-current-index.d.ts.map +1 -0
- package/dist/indexer/load-current-index.js +53 -0
- package/dist/indexer/load-current-index.js.map +1 -0
- package/dist/indexer/locals-and-exports.d.ts +12 -0
- package/dist/indexer/locals-and-exports.d.ts.map +1 -0
- package/dist/indexer/locals-and-exports.js +872 -0
- package/dist/indexer/locals-and-exports.js.map +1 -0
- package/dist/indexer/navigation-goto.d.ts +13 -0
- package/dist/indexer/navigation-goto.d.ts.map +1 -0
- package/dist/indexer/navigation-goto.js +548 -0
- package/dist/indexer/navigation-goto.js.map +1 -0
- package/dist/indexer/navigation-local.d.ts +13 -0
- package/dist/indexer/navigation-local.d.ts.map +1 -0
- package/dist/indexer/navigation-local.js +173 -0
- package/dist/indexer/navigation-local.js.map +1 -0
- package/dist/indexer/navigation-php.d.ts +7 -0
- package/dist/indexer/navigation-php.d.ts.map +1 -0
- package/dist/indexer/navigation-php.js +90 -0
- package/dist/indexer/navigation-php.js.map +1 -0
- package/dist/indexer/navigation-provenance.d.ts +14 -0
- package/dist/indexer/navigation-provenance.d.ts.map +1 -0
- package/dist/indexer/navigation-provenance.js +26 -0
- package/dist/indexer/navigation-provenance.js.map +1 -0
- package/dist/indexer/navigation-references.d.ts +30 -0
- package/dist/indexer/navigation-references.d.ts.map +1 -0
- package/dist/indexer/navigation-references.js +299 -0
- package/dist/indexer/navigation-references.js.map +1 -0
- package/dist/indexer/navigation-resolve.d.ts +12 -0
- package/dist/indexer/navigation-resolve.d.ts.map +1 -0
- package/dist/indexer/navigation-resolve.js +389 -0
- package/dist/indexer/navigation-resolve.js.map +1 -0
- package/dist/indexer/navigation.d.ts +19 -0
- package/dist/indexer/navigation.d.ts.map +1 -0
- package/dist/indexer/navigation.js +468 -0
- package/dist/indexer/navigation.js.map +1 -0
- package/dist/indexer/parse-context.d.ts +47 -0
- package/dist/indexer/parse-context.d.ts.map +1 -0
- package/dist/indexer/parse-context.js +127 -0
- package/dist/indexer/parse-context.js.map +1 -0
- package/dist/indexer/parsed-cache.d.ts +6 -0
- package/dist/indexer/parsed-cache.d.ts.map +1 -0
- package/dist/indexer/parsed-cache.js +32 -0
- package/dist/indexer/parsed-cache.js.map +1 -0
- package/dist/indexer/reference-candidate-types.d.ts +5 -0
- package/dist/indexer/reference-candidate-types.d.ts.map +1 -0
- package/dist/indexer/reference-candidate-types.js +2 -0
- package/dist/indexer/reference-candidate-types.js.map +1 -0
- package/dist/indexer/reference-candidates.d.ts +6 -0
- package/dist/indexer/reference-candidates.d.ts.map +1 -0
- package/dist/indexer/reference-candidates.js +28 -0
- package/dist/indexer/reference-candidates.js.map +1 -0
- package/dist/indexer/reference-context.d.ts +13 -0
- package/dist/indexer/reference-context.d.ts.map +1 -0
- package/dist/indexer/reference-context.js +103 -0
- package/dist/indexer/reference-context.js.map +1 -0
- package/dist/indexer/scope-types.d.ts +25 -0
- package/dist/indexer/scope-types.d.ts.map +1 -0
- package/dist/indexer/scope-types.js +2 -0
- package/dist/indexer/scope-types.js.map +1 -0
- package/dist/indexer/scope.d.ts +11 -0
- package/dist/indexer/scope.d.ts.map +1 -0
- package/dist/indexer/scope.js +424 -0
- package/dist/indexer/scope.js.map +1 -0
- package/dist/indexer/shared.d.ts +4 -0
- package/dist/indexer/shared.d.ts.map +1 -0
- package/dist/indexer/shared.js +9 -0
- package/dist/indexer/shared.js.map +1 -0
- package/dist/indexer/symbols.d.ts +60 -0
- package/dist/indexer/symbols.d.ts.map +1 -0
- package/dist/indexer/symbols.js +272 -0
- package/dist/indexer/symbols.js.map +1 -0
- package/dist/indexer/type-hierarchy.d.ts +52 -0
- package/dist/indexer/type-hierarchy.d.ts.map +1 -0
- package/dist/indexer/type-hierarchy.js +296 -0
- package/dist/indexer/type-hierarchy.js.map +1 -0
- package/dist/indexer/types.d.ts +376 -0
- package/dist/indexer/types.d.ts.map +1 -0
- package/dist/indexer/types.js +15 -0
- package/dist/indexer/types.js.map +1 -0
- package/dist/indexer/workspace-symbols.d.ts +35 -0
- package/dist/indexer/workspace-symbols.d.ts.map +1 -0
- package/dist/indexer/workspace-symbols.js +226 -0
- package/dist/indexer/workspace-symbols.js.map +1 -0
- package/dist/indexer.d.ts +44 -0
- package/dist/indexer.d.ts.map +1 -0
- package/dist/indexer.js +35 -0
- package/dist/indexer.js.map +1 -0
- package/dist/installer/registry.d.ts +68 -0
- package/dist/installer/registry.d.ts.map +1 -0
- package/dist/installer/registry.js +1208 -0
- package/dist/installer/registry.js.map +1 -0
- package/dist/languages/all.d.ts +28 -0
- package/dist/languages/all.d.ts.map +1 -0
- package/dist/languages/all.js +28 -0
- package/dist/languages/all.js.map +1 -0
- package/dist/languages/definitions/adoc.d.ts +2 -0
- package/dist/languages/definitions/adoc.d.ts.map +1 -0
- package/dist/languages/definitions/adoc.js +5 -0
- package/dist/languages/definitions/adoc.js.map +1 -0
- package/dist/languages/definitions/astro.d.ts +2 -0
- package/dist/languages/definitions/astro.d.ts.map +1 -0
- package/dist/languages/definitions/astro.js +5 -0
- package/dist/languages/definitions/astro.js.map +1 -0
- package/dist/languages/definitions/c.d.ts +2 -0
- package/dist/languages/definitions/c.d.ts.map +1 -0
- package/dist/languages/definitions/c.js +78 -0
- package/dist/languages/definitions/c.js.map +1 -0
- package/dist/languages/definitions/cFamily.d.ts +35 -0
- package/dist/languages/definitions/cFamily.d.ts.map +1 -0
- package/dist/languages/definitions/cFamily.js +179 -0
- package/dist/languages/definitions/cFamily.js.map +1 -0
- package/dist/languages/definitions/cpp.d.ts +2 -0
- package/dist/languages/definitions/cpp.d.ts.map +1 -0
- package/dist/languages/definitions/cpp.js +88 -0
- package/dist/languages/definitions/cpp.js.map +1 -0
- package/dist/languages/definitions/csharp.d.ts +3 -0
- package/dist/languages/definitions/csharp.d.ts.map +1 -0
- package/dist/languages/definitions/csharp.js +126 -0
- package/dist/languages/definitions/csharp.js.map +1 -0
- package/dist/languages/definitions/css.d.ts +3 -0
- package/dist/languages/definitions/css.d.ts.map +1 -0
- package/dist/languages/definitions/css.js +13 -0
- package/dist/languages/definitions/css.js.map +1 -0
- package/dist/languages/definitions/cssLike.d.ts +5 -0
- package/dist/languages/definitions/cssLike.d.ts.map +1 -0
- package/dist/languages/definitions/cssLike.js +32 -0
- package/dist/languages/definitions/cssLike.js.map +1 -0
- package/dist/languages/definitions/go.d.ts +3 -0
- package/dist/languages/definitions/go.d.ts.map +1 -0
- package/dist/languages/definitions/go.js +113 -0
- package/dist/languages/definitions/go.js.map +1 -0
- package/dist/languages/definitions/hbs.d.ts +2 -0
- package/dist/languages/definitions/hbs.d.ts.map +1 -0
- package/dist/languages/definitions/hbs.js +5 -0
- package/dist/languages/definitions/hbs.js.map +1 -0
- package/dist/languages/definitions/html.d.ts +3 -0
- package/dist/languages/definitions/html.d.ts.map +1 -0
- package/dist/languages/definitions/html.js +45 -0
- package/dist/languages/definitions/html.js.map +1 -0
- package/dist/languages/definitions/htmlStub.d.ts +18 -0
- package/dist/languages/definitions/htmlStub.d.ts.map +1 -0
- package/dist/languages/definitions/htmlStub.js +38 -0
- package/dist/languages/definitions/htmlStub.js.map +1 -0
- package/dist/languages/definitions/java.d.ts +3 -0
- package/dist/languages/definitions/java.d.ts.map +1 -0
- package/dist/languages/definitions/java.js +124 -0
- package/dist/languages/definitions/java.js.map +1 -0
- package/dist/languages/definitions/javascript.d.ts +3 -0
- package/dist/languages/definitions/javascript.d.ts.map +1 -0
- package/dist/languages/definitions/javascript.js +172 -0
- package/dist/languages/definitions/javascript.js.map +1 -0
- package/dist/languages/definitions/jsFamily.d.ts +5 -0
- package/dist/languages/definitions/jsFamily.d.ts.map +1 -0
- package/dist/languages/definitions/jsFamily.js +75 -0
- package/dist/languages/definitions/jsFamily.js.map +1 -0
- package/dist/languages/definitions/kotlin.d.ts +3 -0
- package/dist/languages/definitions/kotlin.d.ts.map +1 -0
- package/dist/languages/definitions/kotlin.js +152 -0
- package/dist/languages/definitions/kotlin.js.map +1 -0
- package/dist/languages/definitions/less.d.ts +3 -0
- package/dist/languages/definitions/less.d.ts.map +1 -0
- package/dist/languages/definitions/less.js +13 -0
- package/dist/languages/definitions/less.js.map +1 -0
- package/dist/languages/definitions/loadLanguage.d.ts +2 -0
- package/dist/languages/definitions/loadLanguage.d.ts.map +1 -0
- package/dist/languages/definitions/loadLanguage.js +2 -0
- package/dist/languages/definitions/loadLanguage.js.map +1 -0
- package/dist/languages/definitions/markdown.d.ts +2 -0
- package/dist/languages/definitions/markdown.d.ts.map +1 -0
- package/dist/languages/definitions/markdown.js +5 -0
- package/dist/languages/definitions/markdown.js.map +1 -0
- package/dist/languages/definitions/mdx.d.ts +2 -0
- package/dist/languages/definitions/mdx.d.ts.map +1 -0
- package/dist/languages/definitions/mdx.js +5 -0
- package/dist/languages/definitions/mdx.js.map +1 -0
- package/dist/languages/definitions/php.d.ts +3 -0
- package/dist/languages/definitions/php.d.ts.map +1 -0
- package/dist/languages/definitions/php.js +157 -0
- package/dist/languages/definitions/php.js.map +1 -0
- package/dist/languages/definitions/python.d.ts +3 -0
- package/dist/languages/definitions/python.d.ts.map +1 -0
- package/dist/languages/definitions/python.js +137 -0
- package/dist/languages/definitions/python.js.map +1 -0
- package/dist/languages/definitions/rst.d.ts +2 -0
- package/dist/languages/definitions/rst.d.ts.map +1 -0
- package/dist/languages/definitions/rst.js +5 -0
- package/dist/languages/definitions/rst.js.map +1 -0
- package/dist/languages/definitions/ruby.d.ts +3 -0
- package/dist/languages/definitions/ruby.d.ts.map +1 -0
- package/dist/languages/definitions/ruby.js +92 -0
- package/dist/languages/definitions/ruby.js.map +1 -0
- package/dist/languages/definitions/rust.d.ts +3 -0
- package/dist/languages/definitions/rust.d.ts.map +1 -0
- package/dist/languages/definitions/rust.js +146 -0
- package/dist/languages/definitions/rust.js.map +1 -0
- package/dist/languages/definitions/scss.d.ts +3 -0
- package/dist/languages/definitions/scss.d.ts.map +1 -0
- package/dist/languages/definitions/scss.js +58 -0
- package/dist/languages/definitions/scss.js.map +1 -0
- package/dist/languages/definitions/sql.d.ts +3 -0
- package/dist/languages/definitions/sql.d.ts.map +1 -0
- package/dist/languages/definitions/sql.js +36 -0
- package/dist/languages/definitions/sql.js.map +1 -0
- package/dist/languages/definitions/svelte.d.ts +3 -0
- package/dist/languages/definitions/svelte.d.ts.map +1 -0
- package/dist/languages/definitions/svelte.js +31 -0
- package/dist/languages/definitions/svelte.js.map +1 -0
- package/dist/languages/definitions/swift.d.ts +3 -0
- package/dist/languages/definitions/swift.d.ts.map +1 -0
- package/dist/languages/definitions/swift.js +188 -0
- package/dist/languages/definitions/swift.js.map +1 -0
- package/dist/languages/definitions/typescript.d.ts +4 -0
- package/dist/languages/definitions/typescript.d.ts.map +1 -0
- package/dist/languages/definitions/typescript.js +212 -0
- package/dist/languages/definitions/typescript.js.map +1 -0
- package/dist/languages/definitions/vue.d.ts +3 -0
- package/dist/languages/definitions/vue.d.ts.map +1 -0
- package/dist/languages/definitions/vue.js +31 -0
- package/dist/languages/definitions/vue.js.map +1 -0
- package/dist/languages/definitions/zig.d.ts +3 -0
- package/dist/languages/definitions/zig.d.ts.map +1 -0
- package/dist/languages/definitions/zig.js +75 -0
- package/dist/languages/definitions/zig.js.map +1 -0
- package/dist/languages/filePrep.d.ts +33 -0
- package/dist/languages/filePrep.d.ts.map +1 -0
- package/dist/languages/filePrep.js +77 -0
- package/dist/languages/filePrep.js.map +1 -0
- package/dist/languages/importStatementParsers.d.ts +55 -0
- package/dist/languages/importStatementParsers.d.ts.map +1 -0
- package/dist/languages/importStatementParsers.js +369 -0
- package/dist/languages/importStatementParsers.js.map +1 -0
- package/dist/languages/js-family.d.ts +2 -0
- package/dist/languages/js-family.d.ts.map +1 -0
- package/dist/languages/js-family.js +9 -0
- package/dist/languages/js-family.js.map +1 -0
- package/dist/languages/queryGenerator.d.ts +6 -0
- package/dist/languages/queryGenerator.d.ts.map +1 -0
- package/dist/languages/queryGenerator.js +46 -0
- package/dist/languages/queryGenerator.js.map +1 -0
- package/dist/languages/registry.d.ts +5 -0
- package/dist/languages/registry.d.ts.map +1 -0
- package/dist/languages/registry.js +11 -0
- package/dist/languages/registry.js.map +1 -0
- package/dist/languages/sfc.d.ts +30 -0
- package/dist/languages/sfc.d.ts.map +1 -0
- package/dist/languages/sfc.js +402 -0
- package/dist/languages/sfc.js.map +1 -0
- package/dist/languages/types.d.ts +110 -0
- package/dist/languages/types.d.ts.map +1 -0
- package/dist/languages/types.js +2 -0
- package/dist/languages/types.js.map +1 -0
- package/dist/languages.d.ts +63 -0
- package/dist/languages.d.ts.map +1 -0
- package/dist/languages.js +118 -0
- package/dist/languages.js.map +1 -0
- package/dist/lifecycle/errors.d.ts +4 -0
- package/dist/lifecycle/errors.d.ts.map +1 -0
- package/dist/lifecycle/errors.js +4 -0
- package/dist/lifecycle/errors.js.map +1 -0
- package/dist/lifecycle/gitignore.d.ts +10 -0
- package/dist/lifecycle/gitignore.d.ts.map +1 -0
- package/dist/lifecycle/gitignore.js +83 -0
- package/dist/lifecycle/gitignore.js.map +1 -0
- package/dist/lifecycle/manifest.d.ts +73 -0
- package/dist/lifecycle/manifest.d.ts.map +1 -0
- package/dist/lifecycle/manifest.js +352 -0
- package/dist/lifecycle/manifest.js.map +1 -0
- package/dist/logging.d.ts +5 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +35 -0
- package/dist/logging.js.map +1 -0
- package/dist/mcp/http.d.ts +29 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/http.js +179 -0
- package/dist/mcp/http.js.map +1 -0
- package/dist/mcp/security.d.ts +3 -0
- package/dist/mcp/security.d.ts.map +1 -0
- package/dist/mcp/security.js +23 -0
- package/dist/mcp/security.js.map +1 -0
- package/dist/mcp/server.d.ts +267 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +1345 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/sqliteGuard.d.ts +3 -0
- package/dist/mcp/sqliteGuard.d.ts.map +1 -0
- package/dist/mcp/sqliteGuard.js +35 -0
- package/dist/mcp/sqliteGuard.js.map +1 -0
- package/dist/mcp/stdioLifecycle.d.ts +23 -0
- package/dist/mcp/stdioLifecycle.d.ts.map +1 -0
- package/dist/mcp/stdioLifecycle.js +83 -0
- package/dist/mcp/stdioLifecycle.js.map +1 -0
- package/dist/mcp/tools.d.ts +15 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +299 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp.d.ts +9 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +8 -0
- package/dist/mcp.js.map +1 -0
- package/dist/native/bindingLoader.d.ts +24 -0
- package/dist/native/bindingLoader.d.ts.map +1 -0
- package/dist/native/bindingLoader.js +206 -0
- package/dist/native/bindingLoader.js.map +1 -0
- package/dist/native/contracts.d.ts +122 -0
- package/dist/native/contracts.d.ts.map +1 -0
- package/dist/native/contracts.js +2 -0
- package/dist/native/contracts.js.map +1 -0
- package/dist/native/execution.d.ts +16 -0
- package/dist/native/execution.d.ts.map +1 -0
- package/dist/native/execution.js +184 -0
- package/dist/native/execution.js.map +1 -0
- package/dist/native/jsBridge.d.ts +7 -0
- package/dist/native/jsBridge.d.ts.map +1 -0
- package/dist/native/jsBridge.js +25 -0
- package/dist/native/jsBridge.js.map +1 -0
- package/dist/native/nativeBackendReport.d.ts +22 -0
- package/dist/native/nativeBackendReport.d.ts.map +1 -0
- package/dist/native/nativeBackendReport.js +102 -0
- package/dist/native/nativeBackendReport.js.map +1 -0
- package/dist/native/projectedTree.d.ts +37 -0
- package/dist/native/projectedTree.d.ts.map +1 -0
- package/dist/native/projectedTree.js +172 -0
- package/dist/native/projectedTree.js.map +1 -0
- package/dist/native/queries.d.ts +22 -0
- package/dist/native/queries.d.ts.map +1 -0
- package/dist/native/queries.js +67 -0
- package/dist/native/queries.js.map +1 -0
- package/dist/native/queryResults.d.ts +6 -0
- package/dist/native/queryResults.d.ts.map +1 -0
- package/dist/native/queryResults.js +26 -0
- package/dist/native/queryResults.js.map +1 -0
- package/dist/native/runtime.d.ts +17 -0
- package/dist/native/runtime.d.ts.map +1 -0
- package/dist/native/runtime.js +152 -0
- package/dist/native/runtime.js.map +1 -0
- package/dist/native/runtimeCache.d.ts +36 -0
- package/dist/native/runtimeCache.d.ts.map +1 -0
- package/dist/native/runtimeCache.js +237 -0
- package/dist/native/runtimeCache.js.map +1 -0
- package/dist/native/treeSitterNative.d.ts +6 -0
- package/dist/native/treeSitterNative.d.ts.map +1 -0
- package/dist/native/treeSitterNative.js +5 -0
- package/dist/native/treeSitterNative.js.map +1 -0
- package/dist/parserBackend.d.ts +57 -0
- package/dist/parserBackend.d.ts.map +1 -0
- package/dist/parserBackend.js +33 -0
- package/dist/parserBackend.js.map +1 -0
- package/dist/presentation/bounds.d.ts +34 -0
- package/dist/presentation/bounds.d.ts.map +1 -0
- package/dist/presentation/bounds.js +43 -0
- package/dist/presentation/bounds.js.map +1 -0
- package/dist/presets.d.ts +32 -0
- package/dist/presets.d.ts.map +1 -0
- package/dist/presets.js +127 -0
- package/dist/presets.js.map +1 -0
- package/dist/query/parser.d.ts +33 -0
- package/dist/query/parser.d.ts.map +1 -0
- package/dist/query/parser.js +104 -0
- package/dist/query/parser.js.map +1 -0
- package/dist/query/symbols.d.ts +15 -0
- package/dist/query/symbols.d.ts.map +1 -0
- package/dist/query/symbols.js +78 -0
- package/dist/query/symbols.js.map +1 -0
- package/dist/query.d.ts +3 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +3 -0
- package/dist/query.js.map +1 -0
- package/dist/review/candidates.d.ts +13 -0
- package/dist/review/candidates.d.ts.map +1 -0
- package/dist/review/candidates.js +65 -0
- package/dist/review/candidates.js.map +1 -0
- package/dist/review/changes.d.ts +11 -0
- package/dist/review/changes.d.ts.map +1 -0
- package/dist/review/changes.js +94 -0
- package/dist/review/changes.js.map +1 -0
- package/dist/review/deleted.d.ts +23 -0
- package/dist/review/deleted.d.ts.map +1 -0
- package/dist/review/deleted.js +398 -0
- package/dist/review/deleted.js.map +1 -0
- package/dist/review/report.d.ts +37 -0
- package/dist/review/report.d.ts.map +1 -0
- package/dist/review/report.js +76 -0
- package/dist/review/report.js.map +1 -0
- package/dist/review/risk.d.ts +19 -0
- package/dist/review/risk.d.ts.map +1 -0
- package/dist/review/risk.js +105 -0
- package/dist/review/risk.js.map +1 -0
- package/dist/review/summaries.d.ts +24 -0
- package/dist/review/summaries.d.ts.map +1 -0
- package/dist/review/summaries.js +581 -0
- package/dist/review/summaries.js.map +1 -0
- package/dist/review/types.d.ts +146 -0
- package/dist/review/types.d.ts.map +1 -0
- package/dist/review/types.js +43 -0
- package/dist/review/types.js.map +1 -0
- package/dist/review.d.ts +19 -0
- package/dist/review.d.ts.map +1 -0
- package/dist/review.js +442 -0
- package/dist/review.js.map +1 -0
- package/dist/runtimeIdentity.d.ts +27 -0
- package/dist/runtimeIdentity.d.ts.map +1 -0
- package/dist/runtimeIdentity.js +75 -0
- package/dist/runtimeIdentity.js.map +1 -0
- package/dist/session.d.ts +246 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +858 -0
- package/dist/session.js.map +1 -0
- package/dist/sql/classifySqlFile.d.ts +3 -0
- package/dist/sql/classifySqlFile.d.ts.map +1 -0
- package/dist/sql/classifySqlFile.js +42 -0
- package/dist/sql/classifySqlFile.js.map +1 -0
- package/dist/sql/extractFacts.d.ts +4 -0
- package/dist/sql/extractFacts.d.ts.map +1 -0
- package/dist/sql/extractFacts.js +511 -0
- package/dist/sql/extractFacts.js.map +1 -0
- package/dist/sql/graph.d.ts +33 -0
- package/dist/sql/graph.d.ts.map +1 -0
- package/dist/sql/graph.js +167 -0
- package/dist/sql/graph.js.map +1 -0
- package/dist/sql/index.d.ts +8 -0
- package/dist/sql/index.d.ts.map +1 -0
- package/dist/sql/index.js +5 -0
- package/dist/sql/index.js.map +1 -0
- package/dist/sql/lex.d.ts +12 -0
- package/dist/sql/lex.d.ts.map +1 -0
- package/dist/sql/lex.js +180 -0
- package/dist/sql/lex.js.map +1 -0
- package/dist/sql/lookup.d.ts +3 -0
- package/dist/sql/lookup.d.ts.map +1 -0
- package/dist/sql/lookup.js +11 -0
- package/dist/sql/lookup.js.map +1 -0
- package/dist/sql/navigation.d.ts +4 -0
- package/dist/sql/navigation.d.ts.map +1 -0
- package/dist/sql/navigation.js +399 -0
- package/dist/sql/navigation.js.map +1 -0
- package/dist/sql/review.d.ts +15 -0
- package/dist/sql/review.d.ts.map +1 -0
- package/dist/sql/review.js +197 -0
- package/dist/sql/review.js.map +1 -0
- package/dist/sql/sourceGraph.d.ts +19 -0
- package/dist/sql/sourceGraph.d.ts.map +1 -0
- package/dist/sql/sourceGraph.js +195 -0
- package/dist/sql/sourceGraph.js.map +1 -0
- package/dist/sql/types.d.ts +21 -0
- package/dist/sql/types.d.ts.map +1 -0
- package/dist/sql/types.js +2 -0
- package/dist/sql/types.js.map +1 -0
- package/dist/sqlite/canned-query.d.ts +3 -0
- package/dist/sqlite/canned-query.d.ts.map +1 -0
- package/dist/sqlite/canned-query.js +192 -0
- package/dist/sqlite/canned-query.js.map +1 -0
- package/dist/sqlite/common.d.ts +6 -0
- package/dist/sqlite/common.d.ts.map +1 -0
- package/dist/sqlite/common.js +42 -0
- package/dist/sqlite/common.js.map +1 -0
- package/dist/sqlite/database.d.ts +5 -0
- package/dist/sqlite/database.d.ts.map +1 -0
- package/dist/sqlite/database.js +40 -0
- package/dist/sqlite/database.js.map +1 -0
- package/dist/sqlite/query.d.ts +9 -0
- package/dist/sqlite/query.d.ts.map +1 -0
- package/dist/sqlite/query.js +32 -0
- package/dist/sqlite/query.js.map +1 -0
- package/dist/sqlite/rowBounds.d.ts +24 -0
- package/dist/sqlite/rowBounds.d.ts.map +1 -0
- package/dist/sqlite/rowBounds.js +95 -0
- package/dist/sqlite/rowBounds.js.map +1 -0
- package/dist/sqlite/schema.d.ts +5 -0
- package/dist/sqlite/schema.d.ts.map +1 -0
- package/dist/sqlite/schema.js +243 -0
- package/dist/sqlite/schema.js.map +1 -0
- package/dist/sqlite/types.d.ts +77 -0
- package/dist/sqlite/types.d.ts.map +1 -0
- package/dist/sqlite/types.js +2 -0
- package/dist/sqlite/types.js.map +1 -0
- package/dist/sqlite/write.d.ts +5 -0
- package/dist/sqlite/write.d.ts.map +1 -0
- package/dist/sqlite/write.js +306 -0
- package/dist/sqlite/write.js.map +1 -0
- package/dist/sqlite-driver.d.ts +41 -0
- package/dist/sqlite-driver.d.ts.map +1 -0
- package/dist/sqlite-driver.js +144 -0
- package/dist/sqlite-driver.js.map +1 -0
- package/dist/sqlite.d.ts +4 -0
- package/dist/sqlite.d.ts.map +1 -0
- package/dist/sqlite.js +3 -0
- package/dist/sqlite.js.map +1 -0
- package/dist/triples.d.ts +27 -0
- package/dist/triples.d.ts.map +1 -0
- package/dist/triples.js +46 -0
- package/dist/triples.js.map +1 -0
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/util/ast.d.ts +20 -0
- package/dist/util/ast.d.ts.map +1 -0
- package/dist/util/ast.js +62 -0
- package/dist/util/ast.js.map +1 -0
- package/dist/util/bloomFilter.d.ts +99 -0
- package/dist/util/bloomFilter.d.ts.map +1 -0
- package/dist/util/bloomFilter.js +205 -0
- package/dist/util/bloomFilter.js.map +1 -0
- package/dist/util/collections.d.ts +3 -0
- package/dist/util/collections.d.ts.map +1 -0
- package/dist/util/collections.js +21 -0
- package/dist/util/collections.js.map +1 -0
- package/dist/util/comments.d.ts +10 -0
- package/dist/util/comments.d.ts.map +1 -0
- package/dist/util/comments.js +398 -0
- package/dist/util/comments.js.map +1 -0
- package/dist/util/concurrency.d.ts +26 -0
- package/dist/util/concurrency.d.ts.map +1 -0
- package/dist/util/concurrency.js +121 -0
- package/dist/util/concurrency.js.map +1 -0
- package/dist/util/confinedFile.d.ts +8 -0
- package/dist/util/confinedFile.d.ts.map +1 -0
- package/dist/util/confinedFile.js +53 -0
- package/dist/util/confinedFile.js.map +1 -0
- package/dist/util/discoveryPath.d.ts +3 -0
- package/dist/util/discoveryPath.d.ts.map +1 -0
- package/dist/util/discoveryPath.js +19 -0
- package/dist/util/discoveryPath.js.map +1 -0
- package/dist/util/errors.d.ts +3 -0
- package/dist/util/errors.d.ts.map +1 -0
- package/dist/util/errors.js +7 -0
- package/dist/util/errors.js.map +1 -0
- package/dist/util/git.d.ts +79 -0
- package/dist/util/git.d.ts.map +1 -0
- package/dist/util/git.js +403 -0
- package/dist/util/git.js.map +1 -0
- package/dist/util/graphEdges.d.ts +5 -0
- package/dist/util/graphEdges.d.ts.map +1 -0
- package/dist/util/graphEdges.js +42 -0
- package/dist/util/graphEdges.js.map +1 -0
- package/dist/util/graphOnlyExtensions.d.ts +5 -0
- package/dist/util/graphOnlyExtensions.d.ts.map +1 -0
- package/dist/util/graphOnlyExtensions.js +12 -0
- package/dist/util/graphOnlyExtensions.js.map +1 -0
- package/dist/util/guards.d.ts +2 -0
- package/dist/util/guards.d.ts.map +1 -0
- package/dist/util/guards.js +4 -0
- package/dist/util/guards.js.map +1 -0
- package/dist/util/includeRoots.d.ts +6 -0
- package/dist/util/includeRoots.d.ts.map +1 -0
- package/dist/util/includeRoots.js +53 -0
- package/dist/util/includeRoots.js.map +1 -0
- package/dist/util/lazySymbols.d.ts +166 -0
- package/dist/util/lazySymbols.d.ts.map +1 -0
- package/dist/util/lazySymbols.js +365 -0
- package/dist/util/lazySymbols.js.map +1 -0
- package/dist/util/lines.d.ts +2 -0
- package/dist/util/lines.d.ts.map +1 -0
- package/dist/util/lines.js +9 -0
- package/dist/util/lines.js.map +1 -0
- package/dist/util/lruMap.d.ts +3 -0
- package/dist/util/lruMap.d.ts.map +1 -0
- package/dist/util/lruMap.js +22 -0
- package/dist/util/lruMap.js.map +1 -0
- package/dist/util/memberAccess.d.ts +26 -0
- package/dist/util/memberAccess.d.ts.map +1 -0
- package/dist/util/memberAccess.js +175 -0
- package/dist/util/memberAccess.js.map +1 -0
- package/dist/util/packageExports.d.ts +25 -0
- package/dist/util/packageExports.d.ts.map +1 -0
- package/dist/util/packageExports.js +79 -0
- package/dist/util/packageExports.js.map +1 -0
- package/dist/util/packageInfo.d.ts +12 -0
- package/dist/util/packageInfo.d.ts.map +1 -0
- package/dist/util/packageInfo.js +57 -0
- package/dist/util/packageInfo.js.map +1 -0
- package/dist/util/partialResults.d.ts +81 -0
- package/dist/util/partialResults.d.ts.map +1 -0
- package/dist/util/partialResults.js +290 -0
- package/dist/util/partialResults.js.map +1 -0
- package/dist/util/paths.d.ts +51 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +245 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/projectFiles/definitions.d.ts +21 -0
- package/dist/util/projectFiles/definitions.d.ts.map +1 -0
- package/dist/util/projectFiles/definitions.js +112 -0
- package/dist/util/projectFiles/definitions.js.map +1 -0
- package/dist/util/projectFiles/parsers.d.ts +13 -0
- package/dist/util/projectFiles/parsers.d.ts.map +1 -0
- package/dist/util/projectFiles/parsers.js +122 -0
- package/dist/util/projectFiles/parsers.js.map +1 -0
- package/dist/util/projectFiles.d.ts +43 -0
- package/dist/util/projectFiles.d.ts.map +1 -0
- package/dist/util/projectFiles.js +572 -0
- package/dist/util/projectFiles.js.map +1 -0
- package/dist/util/resolution/files.d.ts +3 -0
- package/dist/util/resolution/files.d.ts.map +1 -0
- package/dist/util/resolution/files.js +29 -0
- package/dist/util/resolution/files.js.map +1 -0
- package/dist/util/resolution/findFirstExisting.d.ts +2 -0
- package/dist/util/resolution/findFirstExisting.d.ts.map +1 -0
- package/dist/util/resolution/findFirstExisting.js +13 -0
- package/dist/util/resolution/findFirstExisting.js.map +1 -0
- package/dist/util/resolution/go.d.ts +2 -0
- package/dist/util/resolution/go.d.ts.map +1 -0
- package/dist/util/resolution/go.js +171 -0
- package/dist/util/resolution/go.js.map +1 -0
- package/dist/util/resolution/jvm.d.ts +5 -0
- package/dist/util/resolution/jvm.d.ts.map +1 -0
- package/dist/util/resolution/jvm.js +124 -0
- package/dist/util/resolution/jvm.js.map +1 -0
- package/dist/util/resolution/node.d.ts +3 -0
- package/dist/util/resolution/node.d.ts.map +1 -0
- package/dist/util/resolution/node.js +60 -0
- package/dist/util/resolution/node.js.map +1 -0
- package/dist/util/resolution/php.d.ts +4 -0
- package/dist/util/resolution/php.d.ts.map +1 -0
- package/dist/util/resolution/php.js +498 -0
- package/dist/util/resolution/php.js.map +1 -0
- package/dist/util/resolution/phpComposer.d.ts +17 -0
- package/dist/util/resolution/phpComposer.d.ts.map +1 -0
- package/dist/util/resolution/phpComposer.js +269 -0
- package/dist/util/resolution/phpComposer.js.map +1 -0
- package/dist/util/resolution/projectSymbols.d.ts +14 -0
- package/dist/util/resolution/projectSymbols.d.ts.map +1 -0
- package/dist/util/resolution/projectSymbols.js +70 -0
- package/dist/util/resolution/projectSymbols.js.map +1 -0
- package/dist/util/resolution/python.d.ts +7 -0
- package/dist/util/resolution/python.d.ts.map +1 -0
- package/dist/util/resolution/python.js +129 -0
- package/dist/util/resolution/python.js.map +1 -0
- package/dist/util/resolution/rust.d.ts +2 -0
- package/dist/util/resolution/rust.d.ts.map +1 -0
- package/dist/util/resolution/rust.js +87 -0
- package/dist/util/resolution/rust.js.map +1 -0
- package/dist/util/resolution/tsconfig.d.ts +8 -0
- package/dist/util/resolution/tsconfig.d.ts.map +1 -0
- package/dist/util/resolution/tsconfig.js +131 -0
- package/dist/util/resolution/tsconfig.js.map +1 -0
- package/dist/util/resolution.d.ts +37 -0
- package/dist/util/resolution.d.ts.map +1 -0
- package/dist/util/resolution.js +276 -0
- package/dist/util/resolution.js.map +1 -0
- package/dist/util/resolutionCandidates.d.ts +5 -0
- package/dist/util/resolutionCandidates.d.ts.map +1 -0
- package/dist/util/resolutionCandidates.js +70 -0
- package/dist/util/resolutionCandidates.js.map +1 -0
- package/dist/util/rustTestModules.d.ts +3 -0
- package/dist/util/rustTestModules.d.ts.map +1 -0
- package/dist/util/rustTestModules.js +69 -0
- package/dist/util/rustTestModules.js.map +1 -0
- package/dist/util/semaphore.d.ts +2 -0
- package/dist/util/semaphore.d.ts.map +1 -0
- package/dist/util/semaphore.js +2 -0
- package/dist/util/semaphore.js.map +1 -0
- package/dist/util/sourceLocation.d.ts +8 -0
- package/dist/util/sourceLocation.d.ts.map +1 -0
- package/dist/util/sourceLocation.js +19 -0
- package/dist/util/sourceLocation.js.map +1 -0
- package/dist/util/specifiers.d.ts +17 -0
- package/dist/util/specifiers.d.ts.map +1 -0
- package/dist/util/specifiers.js +263 -0
- package/dist/util/specifiers.js.map +1 -0
- package/dist/util/sqliteSchema.d.ts +28 -0
- package/dist/util/sqliteSchema.d.ts.map +1 -0
- package/dist/util/sqliteSchema.js +66 -0
- package/dist/util/sqliteSchema.js.map +1 -0
- package/dist/util/symbolHash.d.ts +59 -0
- package/dist/util/symbolHash.d.ts.map +1 -0
- package/dist/util/symbolHash.js +84 -0
- package/dist/util/symbolHash.js.map +1 -0
- package/dist/util/workerThreads.d.ts +12 -0
- package/dist/util/workerThreads.d.ts.map +1 -0
- package/dist/util/workerThreads.js +16 -0
- package/dist/util/workerThreads.js.map +1 -0
- package/dist/util/workspace.d.ts +32 -0
- package/dist/util/workspace.d.ts.map +1 -0
- package/dist/util/workspace.js +288 -0
- package/dist/util/workspace.js.map +1 -0
- package/dist/util.d.ts +14 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +10 -0
- package/dist/util.js.map +1 -0
- package/dist/worker/nativeExtractWorker.d.ts +61 -0
- package/dist/worker/nativeExtractWorker.d.ts.map +1 -0
- package/dist/worker/nativeExtractWorker.js +196 -0
- package/dist/worker/nativeExtractWorker.js.map +1 -0
- package/dist/worker/nativeWorkerPool.d.ts +10 -0
- package/dist/worker/nativeWorkerPool.d.ts.map +1 -0
- package/dist/worker/nativeWorkerPool.js +35 -0
- package/dist/worker/nativeWorkerPool.js.map +1 -0
- package/docs/graph-visualization/app.js +900 -0
- package/docs/graph-visualization/file-tree-filters.js +50 -0
- package/docs/graph-visualization/file-tree-model.js +186 -0
- package/docs/graph-visualization/graph-builder.js +303 -0
- package/docs/graph-visualization/index.html +65 -0
- package/docs/graph-visualization/styles.css +513 -0
- package/docs/graph-visualization/vendor/LICENSE.graphology-layout-forceatlas2.txt +21 -0
- package/docs/graph-visualization/vendor/LICENSE.graphology.txt +21 -0
- package/docs/graph-visualization/vendor/LICENSE.sigma.txt +12 -0
- package/docs/graph-visualization/vendor/graphology-layout-forceatlas2.js +789 -0
- package/docs/graph-visualization/vendor/graphology.js +4204 -0
- package/docs/graph-visualization/vendor/sigma.js +5643 -0
- package/docs/graph-visualization/viewer-selected-node.webp +0 -0
- package/docs/mcp.md +373 -0
- package/package.json +104 -0
|
@@ -0,0 +1,1345 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import { createServer } from "node:http";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { createMcpHandler, isInitializeRequest, isLegacyRequest, Server, } from "@modelcontextprotocol/server";
|
|
6
|
+
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
7
|
+
import { NodeStreamableHTTPServerTransport, originValidation, toNodeHandler, toWebRequest, } from "@modelcontextprotocol/node";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { buildCodegraphArtifactWithSession } from "../agent/artifact.js";
|
|
10
|
+
import { explainCodegraphTargetWithSession } from "../agent/explain.js";
|
|
11
|
+
import { getCodegraphFileViewWithSession, MAX_FILE_VIEW_BYTES, MAX_FILE_VIEW_LINES, } from "../agent/fileView.js";
|
|
12
|
+
import { exploreCodegraphWithSession } from "../agent/explore.js";
|
|
13
|
+
import { orientCodegraphWithSession } from "../agent/orient.js";
|
|
14
|
+
import { getCodegraphPacketWithSession } from "../agent/packet.js";
|
|
15
|
+
import { searchCodegraphWithSession } from "../agent/search.js";
|
|
16
|
+
import { workspaceSymbolsWithSession } from "../agent/workspaceSymbols.js";
|
|
17
|
+
import { findImplementationsWithSession, findSubtypesWithSession, findSupertypesWithSession, } from "../agent/typeHierarchy.js";
|
|
18
|
+
import { findCalleesWithSession, findCallersWithSession } from "../agent/callHierarchy.js";
|
|
19
|
+
import { previewRenameWithSession } from "../agent/renamePreview.js";
|
|
20
|
+
import { buildRefactorPlanWithSession } from "../agent/refactorPlan.js";
|
|
21
|
+
import { parseAgentSymbolHandle } from "../agent/handles.js";
|
|
22
|
+
import { requireSemanticSymbol, resolveSemanticSymbol } from "../agent/semanticSymbols.js";
|
|
23
|
+
import { getDependencies, getReverseDependencies, getShortestPath } from "../graphs/queries.js";
|
|
24
|
+
import { findReferences, goToDefinition } from "../indexer/navigation.js";
|
|
25
|
+
import { parseQualifiedSymbolPath } from "../indexer/symbols.js";
|
|
26
|
+
import { analyzeImpactFromDiff } from "../impact/index.js";
|
|
27
|
+
import { DEFAULT_BOUNDED_IMPACT_BUDGETS } from "../impact/budgets.js";
|
|
28
|
+
import { buildReviewReport } from "../review.js";
|
|
29
|
+
import { boundReviewReportForTransport } from "../review/types.js";
|
|
30
|
+
import { SQLITE_ARTIFACT_FILE_SIGNATURES_METADATA_KEY, queryGraphSqliteRaw } from "../sqlite.js";
|
|
31
|
+
import { isPlainRecord } from "../util/guards.js";
|
|
32
|
+
import { toProjectDisplayPath } from "../util/paths.js";
|
|
33
|
+
import { errorMessage } from "../util/errors.js";
|
|
34
|
+
import { createAgentSession, listAgentSessionFiles } from "../agent/session.js";
|
|
35
|
+
import { mapLimit } from "../util/concurrency.js";
|
|
36
|
+
import { assertRealPathCandidateWithinRoot, resolveProjectFile } from "../util/confinedFile.js";
|
|
37
|
+
import { SymbolKind } from "../indexer/types.js";
|
|
38
|
+
import { DEFAULT_WORKSPACE_SYMBOL_LIMIT, MAX_WORKSPACE_SYMBOL_LIMIT } from "../indexer/workspace-symbols.js";
|
|
39
|
+
import { assertMcpSqliteQueryResourceBounded, boundRawSqlResult, DEFAULT_SQLITE_BYTE_LIMIT, normalizeSqliteRowLimit, } from "./sqliteGuard.js";
|
|
40
|
+
import { DEFAULT_CALL_HIERARCHY_LIMIT, MAX_CALL_HIERARCHY_LIMIT, DEFAULT_MCP_COLLECTION_LIMIT, DEFAULT_TYPE_HIERARCHY_LIMIT, listCodegraphMcpTools, MAX_TYPE_HIERARCHY_LIMIT, MAX_MCP_COLLECTION_LIMIT, MAX_RENAME_PREVIEW_EDITS, MCP_TOOLS, MAX_REFACTOR_PLAN_LIMIT, } from "./tools.js";
|
|
41
|
+
import { buildAllowedHostHeaders, buildAllowedOriginHostnames, closeHttpServer, emptyAllowedHostHeaderRules, formatHostForUrl, getHeaderValue, getHttpServerPort, getRequestPath, isAllowedHostHeader, listenOnHttpServer, readJsonRequestBody, waitForHttpServerClose, writeJsonResponse, writeJsonRpcError, } from "./http.js";
|
|
42
|
+
import { getCurrentNativeBindingOrigin } from "../native/runtime.js";
|
|
43
|
+
import { captureCodegraphRuntimeIdentity, createInstalledVersionChecker, } from "../runtimeIdentity.js";
|
|
44
|
+
export { listCodegraphMcpTools } from "./tools.js";
|
|
45
|
+
import { assertWritableDirectoryRealPathWithinRoot, resolveArtifactSqlitePathCandidate } from "./security.js";
|
|
46
|
+
import { awaitStdioMcpLifecycle, DEFAULT_MCP_STDIO_IDLE_TIMEOUT_MS } from "./stdioLifecycle.js";
|
|
47
|
+
export const DEFAULT_MCP_HTTP_SESSION_IDLE_MS = 30 * 60 * 1000;
|
|
48
|
+
export const DEFAULT_MCP_HTTP_SESSION_MAX_COUNT = 32;
|
|
49
|
+
export const DEFAULT_MCP_HTTP_SESSION_EVICTION_INTERVAL_MS = 60_000;
|
|
50
|
+
const MAX_MCP_FRESHNESS_CHANGED_FILES = 25;
|
|
51
|
+
const SQLITE_ARTIFACT_STAT_CONCURRENCY = 64;
|
|
52
|
+
function assertMcpSessionOptions(options) {
|
|
53
|
+
if (options.session !== undefined && options.buildOptions !== undefined) {
|
|
54
|
+
throw new Error("MCP server options cannot combine a prebuilt session with buildOptions.");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function createCodegraphMcpSession(options, root) {
|
|
58
|
+
assertMcpSessionOptions(options);
|
|
59
|
+
return (options.session ??
|
|
60
|
+
createAgentSession({
|
|
61
|
+
root,
|
|
62
|
+
...(options.buildOptions ? { buildOptions: options.buildOptions } : {}),
|
|
63
|
+
freshness: { policy: "auto" },
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
function startCodegraphMcpWarmup(session, warmup) {
|
|
67
|
+
if (warmup === "base") {
|
|
68
|
+
return session.loadProject({ symbolGraph: "skip" });
|
|
69
|
+
}
|
|
70
|
+
if (warmup === "symbols") {
|
|
71
|
+
return session.loadProject();
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
async function createWarmedCodegraphMcpHandlers(options) {
|
|
76
|
+
const root = path.resolve(options.root);
|
|
77
|
+
const session = createCodegraphMcpSession(options, root);
|
|
78
|
+
await startCodegraphMcpWarmup(session, options.warmup);
|
|
79
|
+
const { warmup, host, port, onHttpListen, ...handlerOptions } = options;
|
|
80
|
+
void warmup;
|
|
81
|
+
void host;
|
|
82
|
+
void port;
|
|
83
|
+
void onHttpListen;
|
|
84
|
+
return createCodegraphMcpHandlersForSession({ ...handlerOptions, root }, session);
|
|
85
|
+
}
|
|
86
|
+
const MCP_HTTP_PATH = "/mcp";
|
|
87
|
+
const MAX_MCP_HTTP_BODY_BYTES = 1_000_000;
|
|
88
|
+
export function createCodegraphMcpHandlers(options) {
|
|
89
|
+
const root = path.resolve(options.root);
|
|
90
|
+
const session = createCodegraphMcpSession(options, root);
|
|
91
|
+
return createCodegraphMcpHandlersForSession(options, session);
|
|
92
|
+
}
|
|
93
|
+
function createCodegraphMcpHandlersForSession(options, session) {
|
|
94
|
+
const root = path.resolve(options.root);
|
|
95
|
+
const readOnly = options.readOnly ?? true;
|
|
96
|
+
const realRoot = fs.realpath(root);
|
|
97
|
+
const configuredSqlitePath = options.artifactPath
|
|
98
|
+
? resolveArtifactSqlitePathCandidate(root, options.artifactPath)
|
|
99
|
+
: undefined;
|
|
100
|
+
const configuredSqliteOutDir = configuredSqlitePath ? path.dirname(configuredSqlitePath) : undefined;
|
|
101
|
+
const configuredSqliteCanRefresh = options.artifactPath ? !/\.(sqlite|db)$/i.test(options.artifactPath) : false;
|
|
102
|
+
let sqlitePath = configuredSqlitePath;
|
|
103
|
+
let sqliteOutDir = configuredSqliteOutDir;
|
|
104
|
+
let sqliteCanRefresh = configuredSqliteCanRefresh;
|
|
105
|
+
const relative = (file) => toProjectDisplayPath(root, file);
|
|
106
|
+
const boundedLimit = (limit, fallback, max) => {
|
|
107
|
+
if (typeof limit !== "number" || !Number.isFinite(limit))
|
|
108
|
+
return fallback;
|
|
109
|
+
return Math.min(max, Math.max(0, Math.floor(limit)));
|
|
110
|
+
};
|
|
111
|
+
const staleFreshness = (files, reason) => {
|
|
112
|
+
const changedFiles = [...files].sort();
|
|
113
|
+
const boundedChangedFiles = changedFiles.slice(0, MAX_MCP_FRESHNESS_CHANGED_FILES);
|
|
114
|
+
return {
|
|
115
|
+
state: "stale",
|
|
116
|
+
changedFiles: boundedChangedFiles,
|
|
117
|
+
changedFileCount: changedFiles.length,
|
|
118
|
+
omittedChangedFileCount: Math.max(0, changedFiles.length - boundedChangedFiles.length),
|
|
119
|
+
reason,
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const checkMcpFreshness = async () => {
|
|
123
|
+
if (session.checkFreshness)
|
|
124
|
+
return await session.checkFreshness();
|
|
125
|
+
return { state: "fresh" };
|
|
126
|
+
};
|
|
127
|
+
const withFreshness = async (run) => {
|
|
128
|
+
const freshness = await checkMcpFreshness();
|
|
129
|
+
const result = await run();
|
|
130
|
+
return { ...result, freshness };
|
|
131
|
+
};
|
|
132
|
+
const formatSqliteFreshnessError = (freshness) => {
|
|
133
|
+
if (freshness.state === "fresh")
|
|
134
|
+
return "SQLite artifact freshness check unexpectedly failed.";
|
|
135
|
+
const reason = freshness.state === "stale" ? freshness.reason : "workspace changed after artifact build";
|
|
136
|
+
const changed = freshness.changedFiles.length ? ` Changed files: ${freshness.changedFiles.join(", ")}.` : "";
|
|
137
|
+
const omitted = freshness.state === "stale" && freshness.omittedChangedFileCount
|
|
138
|
+
? ` Omitted changed files: ${freshness.omittedChangedFileCount}.`
|
|
139
|
+
: "";
|
|
140
|
+
let action = "run artifact_build";
|
|
141
|
+
if (readOnly) {
|
|
142
|
+
action = "rebuild the artifact with write access enabled";
|
|
143
|
+
}
|
|
144
|
+
if (freshness.state === "stale") {
|
|
145
|
+
action = `run refresh_index, then ${action}`;
|
|
146
|
+
}
|
|
147
|
+
return `SQLite artifact is stale; ${action} before query_sqlite. ${reason}.${changed}${omitted}`;
|
|
148
|
+
};
|
|
149
|
+
const canRefreshSqliteArtifact = () => {
|
|
150
|
+
if (!sqlitePath || !sqliteOutDir || readOnly || !sqliteCanRefresh)
|
|
151
|
+
return false;
|
|
152
|
+
return path.basename(sqlitePath) === "codegraph.sqlite";
|
|
153
|
+
};
|
|
154
|
+
const rebuildSqliteArtifactForQuery = async () => {
|
|
155
|
+
if (!sqliteOutDir)
|
|
156
|
+
throw new Error("SQLite artifact output directory is unavailable.");
|
|
157
|
+
const outDir = await assertWritableDirectoryRealPathWithinRoot(await realRoot, root, sqliteOutDir, "Artifact output directory");
|
|
158
|
+
const result = await buildCodegraphArtifactWithSession(session, {
|
|
159
|
+
root,
|
|
160
|
+
outDir,
|
|
161
|
+
filterOutDir: outDir,
|
|
162
|
+
sqlite: true,
|
|
163
|
+
force: true,
|
|
164
|
+
});
|
|
165
|
+
const sqliteArtifact = result.artifacts.sqlite;
|
|
166
|
+
if (!sqliteArtifact)
|
|
167
|
+
throw new Error("SQLite artifact refresh did not produce a SQLite file.");
|
|
168
|
+
sqlitePath = path.join(result.outDir, sqliteArtifact);
|
|
169
|
+
sqliteOutDir = result.outDir;
|
|
170
|
+
};
|
|
171
|
+
const refreshSqliteArtifactForQuery = async (freshness, refreshOptions) => {
|
|
172
|
+
if (freshness.state === "fresh")
|
|
173
|
+
return freshness;
|
|
174
|
+
if (freshness.state === "stale" && !refreshOptions?.allowStaleRebuild) {
|
|
175
|
+
throw new Error(formatSqliteFreshnessError(freshness));
|
|
176
|
+
}
|
|
177
|
+
if (!canRefreshSqliteArtifact())
|
|
178
|
+
throw new Error(formatSqliteFreshnessError(freshness));
|
|
179
|
+
await rebuildSqliteArtifactForQuery();
|
|
180
|
+
return { state: "refreshed", changedFiles: freshness.changedFiles };
|
|
181
|
+
};
|
|
182
|
+
const readSqliteArtifactSignatures = async (realSqlitePath) => {
|
|
183
|
+
const result = await queryGraphSqliteRaw(realSqlitePath, "SELECT value FROM graph_metadata WHERE key = ?;", [SQLITE_ARTIFACT_FILE_SIGNATURES_METADATA_KEY], { maxRows: 1 });
|
|
184
|
+
const rawValue = result.rows[0]?.[0];
|
|
185
|
+
if (typeof rawValue !== "string")
|
|
186
|
+
return null;
|
|
187
|
+
let parsed;
|
|
188
|
+
try {
|
|
189
|
+
parsed = JSON.parse(rawValue);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
if (!Array.isArray(parsed))
|
|
195
|
+
return null;
|
|
196
|
+
const signatures = [];
|
|
197
|
+
for (const value of parsed) {
|
|
198
|
+
if (!isPlainRecord(value))
|
|
199
|
+
continue;
|
|
200
|
+
if (typeof value.path !== "string")
|
|
201
|
+
continue;
|
|
202
|
+
if (typeof value.size !== "number" || typeof value.mtimeMs !== "number")
|
|
203
|
+
continue;
|
|
204
|
+
signatures.push({ path: value.path, size: value.size, mtimeMs: value.mtimeMs });
|
|
205
|
+
}
|
|
206
|
+
return signatures;
|
|
207
|
+
};
|
|
208
|
+
const isFileInsideDirectory = (file, directory) => {
|
|
209
|
+
const relativeFile = path.relative(directory, file);
|
|
210
|
+
if (!relativeFile)
|
|
211
|
+
return true;
|
|
212
|
+
return !relativeFile.startsWith("..") && !path.isAbsolute(relativeFile);
|
|
213
|
+
};
|
|
214
|
+
const collectCurrentSqliteArtifactSignatures = async () => {
|
|
215
|
+
const outputDirectories = [];
|
|
216
|
+
if (sqliteOutDir) {
|
|
217
|
+
outputDirectories.push(sqliteOutDir);
|
|
218
|
+
const lexicalOutDir = path.resolve(root, path.relative(await realRoot, sqliteOutDir));
|
|
219
|
+
outputDirectories.push(lexicalOutDir);
|
|
220
|
+
}
|
|
221
|
+
let discoveredFiles;
|
|
222
|
+
if (session.discoverFiles) {
|
|
223
|
+
discoveredFiles = await session.discoverFiles();
|
|
224
|
+
}
|
|
225
|
+
else if (options.session) {
|
|
226
|
+
throw new Error("MCP session does not expose live file discovery for SQLite freshness.");
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
discoveredFiles = await listAgentSessionFiles({
|
|
230
|
+
root,
|
|
231
|
+
...(options.buildOptions ? { buildOptions: options.buildOptions } : {}),
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const currentFiles = discoveredFiles.filter((file) => !outputDirectories.some((directory) => isFileInsideDirectory(file, directory)));
|
|
235
|
+
const signatures = new Map();
|
|
236
|
+
await mapLimit(currentFiles, SQLITE_ARTIFACT_STAT_CONCURRENCY, async (file) => {
|
|
237
|
+
try {
|
|
238
|
+
const stat = await fs.stat(file);
|
|
239
|
+
if (!stat.isFile())
|
|
240
|
+
return;
|
|
241
|
+
signatures.set(relative(file), { path: file, size: stat.size, mtimeMs: stat.mtimeMs });
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR")) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
throw error;
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
return signatures;
|
|
251
|
+
};
|
|
252
|
+
const checkSqliteArtifactFreshness = async (realSqlitePath) => {
|
|
253
|
+
const storedSignatures = await readSqliteArtifactSignatures(realSqlitePath);
|
|
254
|
+
if (!storedSignatures)
|
|
255
|
+
return staleFreshness([], "SQLite artifact has no freshness baseline");
|
|
256
|
+
const storedByFile = new Map();
|
|
257
|
+
for (const signature of storedSignatures) {
|
|
258
|
+
storedByFile.set(relative(signature.path), signature);
|
|
259
|
+
}
|
|
260
|
+
const currentByFile = await collectCurrentSqliteArtifactSignatures();
|
|
261
|
+
const changedFiles = [];
|
|
262
|
+
for (const [file, currentSignature] of currentByFile.entries()) {
|
|
263
|
+
const storedSignature = storedByFile.get(file);
|
|
264
|
+
if (!storedSignature) {
|
|
265
|
+
changedFiles.push(file);
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (storedSignature.size !== currentSignature.size || storedSignature.mtimeMs !== currentSignature.mtimeMs) {
|
|
269
|
+
changedFiles.push(file);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
for (const file of storedByFile.keys()) {
|
|
273
|
+
if (currentByFile.has(file))
|
|
274
|
+
continue;
|
|
275
|
+
changedFiles.push(file);
|
|
276
|
+
}
|
|
277
|
+
if (!changedFiles.length)
|
|
278
|
+
return { state: "fresh" };
|
|
279
|
+
return staleFreshness(changedFiles, "SQLite artifact is older than files on disk");
|
|
280
|
+
};
|
|
281
|
+
const collectMcpDependencyEntries = async (request, collectEntries) => {
|
|
282
|
+
const snapshot = await session.loadProject({ symbolGraph: "skip" });
|
|
283
|
+
const limit = boundedLimit(request.limit, DEFAULT_MCP_COLLECTION_LIMIT, MAX_MCP_COLLECTION_LIMIT);
|
|
284
|
+
const queryOptions = {
|
|
285
|
+
...(request.depth !== undefined ? { depth: request.depth } : {}),
|
|
286
|
+
// Probe one entry past the display limit so `truncated` is exact
|
|
287
|
+
// rather than a `results.length === limit` heuristic (which cannot
|
|
288
|
+
// tell "exactly limit reachable files" apart from "more exist"),
|
|
289
|
+
// without re-walking the whole reachable graph for an exact total —
|
|
290
|
+
// see finding #44.
|
|
291
|
+
limit: limit + 1,
|
|
292
|
+
};
|
|
293
|
+
const resolvedSymbol = resolveSemanticSymbol(snapshot, request.file);
|
|
294
|
+
let targetFile;
|
|
295
|
+
if (resolvedSymbol) {
|
|
296
|
+
targetFile = resolvedSymbol.def.file;
|
|
297
|
+
}
|
|
298
|
+
else if (parseAgentSymbolHandle(request.file) || parseQualifiedSymbolPath(request.file)) {
|
|
299
|
+
targetFile = requireSemanticSymbol(snapshot, request.file).def.file;
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
targetFile = await resolveProjectFile(await realRoot, root, request.file);
|
|
303
|
+
}
|
|
304
|
+
const collected = collectEntries(snapshot.fileGraph, targetFile, queryOptions);
|
|
305
|
+
const totalSeen = collected.length;
|
|
306
|
+
const truncated = totalSeen > limit;
|
|
307
|
+
const entries = collected.slice(0, limit).map((dependency) => ({
|
|
308
|
+
file: relative(dependency.file),
|
|
309
|
+
depth: dependency.depth,
|
|
310
|
+
}));
|
|
311
|
+
return { entries, limit, totalSeen, truncated, omitted: truncated ? totalSeen - limit : 0 };
|
|
312
|
+
};
|
|
313
|
+
const calls = async (request) => {
|
|
314
|
+
const findCalls = request.direction === "callers" ? findCallersWithSession : findCalleesWithSession;
|
|
315
|
+
return await findCalls(session, {
|
|
316
|
+
root,
|
|
317
|
+
handle: request.handle,
|
|
318
|
+
...(request.depth !== undefined ? { depth: request.depth } : {}),
|
|
319
|
+
limit: boundedLimit(request.limit, DEFAULT_CALL_HIERARCHY_LIMIT, MAX_CALL_HIERARCHY_LIMIT),
|
|
320
|
+
...(request.includeHeuristic !== undefined ? { includeHeuristic: request.includeHeuristic } : {}),
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
const typeHierarchy = async (request) => {
|
|
324
|
+
const findTypes = request.direction === "supertypes" ? findSupertypesWithSession : findSubtypesWithSession;
|
|
325
|
+
return await findTypes(session, {
|
|
326
|
+
root,
|
|
327
|
+
handle: request.handle,
|
|
328
|
+
...(request.depth !== undefined ? { depth: request.depth } : {}),
|
|
329
|
+
limit: boundedLimit(request.limit, DEFAULT_TYPE_HIERARCHY_LIMIT, MAX_TYPE_HIERARCHY_LIMIT),
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
const boundedReferencesFromResult = (result, limit) => {
|
|
333
|
+
if (result.status !== "ok") {
|
|
334
|
+
return { references: [], limit, totalSeen: 0, truncated: false, omitted: 0 };
|
|
335
|
+
}
|
|
336
|
+
const totalSeen = result.references.length;
|
|
337
|
+
const truncated = totalSeen > limit;
|
|
338
|
+
const references = result.references
|
|
339
|
+
.slice(0, limit)
|
|
340
|
+
.map((reference) => ({ file: relative(reference.file), range: reference.range }));
|
|
341
|
+
return { references, limit, totalSeen, truncated, omitted: truncated ? totalSeen - limit : 0 };
|
|
342
|
+
};
|
|
343
|
+
const fileDeps = async (request) => await withFreshness(async () => {
|
|
344
|
+
const { entries, ...meta } = await collectMcpDependencyEntries(request, request.direction === "deps" ? getDependencies : getReverseDependencies);
|
|
345
|
+
return request.direction === "deps"
|
|
346
|
+
? { dependencies: entries, ...meta }
|
|
347
|
+
: { reverseDependencies: entries, ...meta };
|
|
348
|
+
});
|
|
349
|
+
return {
|
|
350
|
+
search: async (request) => await withFreshness(async () => await searchCodegraphWithSession(session, {
|
|
351
|
+
root,
|
|
352
|
+
query: request.query,
|
|
353
|
+
...(request.mode !== undefined ? { mode: request.mode } : {}),
|
|
354
|
+
...(request.from !== undefined ? { from: request.from } : {}),
|
|
355
|
+
...(request.depth !== undefined ? { depth: request.depth } : {}),
|
|
356
|
+
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
357
|
+
})),
|
|
358
|
+
workspace_symbols: async (request) => await workspaceSymbolsWithSession(session, {
|
|
359
|
+
root,
|
|
360
|
+
query: request.query,
|
|
361
|
+
...(request.kinds !== undefined ? { kinds: request.kinds } : {}),
|
|
362
|
+
...(request.exportedOnly !== undefined ? { exportedOnly: request.exportedOnly } : {}),
|
|
363
|
+
...(request.includeImports !== undefined ? { includeImports: request.includeImports } : {}),
|
|
364
|
+
...(request.fileGlob !== undefined ? { fileGlob: request.fileGlob } : {}),
|
|
365
|
+
limit: boundedLimit(request.limit, DEFAULT_WORKSPACE_SYMBOL_LIMIT, MAX_WORKSPACE_SYMBOL_LIMIT),
|
|
366
|
+
}),
|
|
367
|
+
rename_preview: async (request) => await previewRenameWithSession(session, {
|
|
368
|
+
root,
|
|
369
|
+
handle: request.handle,
|
|
370
|
+
newName: request.newName,
|
|
371
|
+
...(request.includeComments !== undefined ? { includeComments: request.includeComments } : {}),
|
|
372
|
+
...(request.includeStrings !== undefined ? { includeStrings: request.includeStrings } : {}),
|
|
373
|
+
...(request.includeFilenames !== undefined ? { includeFilenames: request.includeFilenames } : {}),
|
|
374
|
+
...(request.maxEdits !== undefined ? { maxEdits: request.maxEdits } : {}),
|
|
375
|
+
}),
|
|
376
|
+
refactor_plan: async (request) => await buildRefactorPlanWithSession(session, {
|
|
377
|
+
root,
|
|
378
|
+
handle: request.handle,
|
|
379
|
+
...(request.renameTo !== undefined ? { renameTo: request.renameTo } : {}),
|
|
380
|
+
...(request.maxReferences !== undefined ? { maxReferences: request.maxReferences } : {}),
|
|
381
|
+
...(request.maxCallers !== undefined ? { maxCallers: request.maxCallers } : {}),
|
|
382
|
+
...(request.maxHierarchy !== undefined ? { maxHierarchy: request.maxHierarchy } : {}),
|
|
383
|
+
...(request.includeSource !== undefined ? { includeSource: request.includeSource } : {}),
|
|
384
|
+
}),
|
|
385
|
+
calls,
|
|
386
|
+
type_hierarchy: typeHierarchy,
|
|
387
|
+
file_deps: fileDeps,
|
|
388
|
+
callers: async (request) => await calls({ direction: "callers", ...request }),
|
|
389
|
+
callees: async (request) => await calls({ direction: "callees", ...request }),
|
|
390
|
+
supertypes: async (request) => await typeHierarchy({ direction: "supertypes", ...request }),
|
|
391
|
+
subtypes: async (request) => await typeHierarchy({ direction: "subtypes", ...request }),
|
|
392
|
+
implementations: async (request) => await findImplementationsWithSession(session, {
|
|
393
|
+
root,
|
|
394
|
+
handle: request.handle,
|
|
395
|
+
limit: boundedLimit(request.limit, DEFAULT_TYPE_HIERARCHY_LIMIT, MAX_TYPE_HIERARCHY_LIMIT),
|
|
396
|
+
}),
|
|
397
|
+
explore: async (request) => await withFreshness(async () => await exploreCodegraphWithSession(session, {
|
|
398
|
+
root,
|
|
399
|
+
query: request.query,
|
|
400
|
+
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
401
|
+
...(request.maxPackets !== undefined ? { maxPackets: request.maxPackets } : {}),
|
|
402
|
+
...(request.maxPaths !== undefined ? { maxPaths: request.maxPaths } : {}),
|
|
403
|
+
...(request.includeSource !== undefined ? { includeSource: request.includeSource } : {}),
|
|
404
|
+
})),
|
|
405
|
+
orient: async (request) => await withFreshness(async () => await orientCodegraphWithSession(session, {
|
|
406
|
+
root,
|
|
407
|
+
...(request.includeRoots !== undefined ? { includeRoots: request.includeRoots } : {}),
|
|
408
|
+
...(request.budget !== undefined ? { budget: request.budget } : {}),
|
|
409
|
+
})),
|
|
410
|
+
packet_get: async (request) => await withFreshness(async () => await getCodegraphPacketWithSession(session, {
|
|
411
|
+
root,
|
|
412
|
+
target: request.target,
|
|
413
|
+
...(request.maxSymbols !== undefined ? { maxSymbols: request.maxSymbols } : {}),
|
|
414
|
+
...(request.maxSnippets !== undefined ? { maxSnippets: request.maxSnippets } : {}),
|
|
415
|
+
...(request.maxDuplicates !== undefined ? { maxDuplicates: request.maxDuplicates } : {}),
|
|
416
|
+
})),
|
|
417
|
+
get_file: async (request) => await getCodegraphFileViewWithSession(session, {
|
|
418
|
+
root,
|
|
419
|
+
file: request.file,
|
|
420
|
+
...(request.offset !== undefined ? { offset: request.offset } : {}),
|
|
421
|
+
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
422
|
+
...(request.maxBytes !== undefined ? { maxBytes: request.maxBytes } : {}),
|
|
423
|
+
...(request.includeGraphContext !== undefined ? { includeGraphContext: request.includeGraphContext } : {}),
|
|
424
|
+
...(request.allowSensitive !== undefined ? { allowSensitive: request.allowSensitive } : {}),
|
|
425
|
+
...(options.buildOptions ? { buildOptions: options.buildOptions } : {}),
|
|
426
|
+
}),
|
|
427
|
+
get_symbol: async (request) => await withFreshness(async () => {
|
|
428
|
+
const explanation = await explainCodegraphTargetWithSession(session, { root, target: request.handle });
|
|
429
|
+
return explanation.target;
|
|
430
|
+
}),
|
|
431
|
+
goto: async (request) => await withFreshness(async () => {
|
|
432
|
+
const snapshot = await session.loadProject({ symbolGraph: "skip" });
|
|
433
|
+
if ("handle" in request) {
|
|
434
|
+
const resolved = requireSemanticSymbol(snapshot, request.handle);
|
|
435
|
+
return { status: "ok", definition: resolved.def };
|
|
436
|
+
}
|
|
437
|
+
return await goToDefinition(snapshot.index, {
|
|
438
|
+
file: await resolveProjectFile(await realRoot, root, request.file),
|
|
439
|
+
line: request.line,
|
|
440
|
+
column: request.column,
|
|
441
|
+
});
|
|
442
|
+
}),
|
|
443
|
+
refs: async (request) => await withFreshness(async () => {
|
|
444
|
+
const handle = "handle" in request ? request.handle : undefined;
|
|
445
|
+
const file = "file" in request ? request.file : undefined;
|
|
446
|
+
const line = "line" in request ? request.line : undefined;
|
|
447
|
+
const column = "column" in request ? request.column : undefined;
|
|
448
|
+
const hasAnyPosition = file !== undefined || line !== undefined || column !== undefined;
|
|
449
|
+
const hasCompletePosition = file !== undefined && line !== undefined && column !== undefined;
|
|
450
|
+
if (handle !== undefined && hasAnyPosition) {
|
|
451
|
+
throw new Error("refs requires either handle or file, line, and column.");
|
|
452
|
+
}
|
|
453
|
+
if (handle === undefined && !hasCompletePosition) {
|
|
454
|
+
throw new Error("refs requires either handle or file, line, and column.");
|
|
455
|
+
}
|
|
456
|
+
const limit = boundedLimit(request.limit, DEFAULT_MCP_COLLECTION_LIMIT, MAX_MCP_COLLECTION_LIMIT);
|
|
457
|
+
if (handle !== undefined) {
|
|
458
|
+
if (parseQualifiedSymbolPath(handle)) {
|
|
459
|
+
const snapshot = await session.loadProject({ symbolGraph: "skip" });
|
|
460
|
+
const resolved = requireSemanticSymbol(snapshot, handle);
|
|
461
|
+
// Probe one reference past the display limit so `truncated` is exact — see
|
|
462
|
+
// `collectMcpDependencyEntries` for the rationale (finding #44).
|
|
463
|
+
const result = await findReferences(snapshot.index, { def: resolved.def }, { maxReferences: limit + 1 });
|
|
464
|
+
return boundedReferencesFromResult(result, limit);
|
|
465
|
+
}
|
|
466
|
+
const explanation = await explainCodegraphTargetWithSession(session, {
|
|
467
|
+
root,
|
|
468
|
+
target: handle,
|
|
469
|
+
maxReferences: limit,
|
|
470
|
+
});
|
|
471
|
+
return {
|
|
472
|
+
references: explanation.references,
|
|
473
|
+
limit: explanation.limits.references,
|
|
474
|
+
totalSeen: explanation.references.length + explanation.omittedCounts.references,
|
|
475
|
+
truncated: explanation.omittedCounts.references > 0,
|
|
476
|
+
omitted: explanation.omittedCounts.references,
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
if (file === undefined || line === undefined || column === undefined) {
|
|
480
|
+
throw new Error("refs requires either handle or file, line, and column.");
|
|
481
|
+
}
|
|
482
|
+
const snapshot = await session.loadProject({ symbolGraph: "skip" });
|
|
483
|
+
const result = await findReferences(snapshot.index, {
|
|
484
|
+
file: await resolveProjectFile(await realRoot, root, file),
|
|
485
|
+
line,
|
|
486
|
+
column,
|
|
487
|
+
}, { maxReferences: limit + 1 });
|
|
488
|
+
return boundedReferencesFromResult(result, limit);
|
|
489
|
+
}),
|
|
490
|
+
deps: async (request) => await withFreshness(async () => {
|
|
491
|
+
const { entries, ...meta } = await collectMcpDependencyEntries(request, getDependencies);
|
|
492
|
+
return { dependencies: entries, ...meta };
|
|
493
|
+
}),
|
|
494
|
+
rdeps: async (request) => await withFreshness(async () => {
|
|
495
|
+
const { entries, ...meta } = await collectMcpDependencyEntries(request, getReverseDependencies);
|
|
496
|
+
return { reverseDependencies: entries, ...meta };
|
|
497
|
+
}),
|
|
498
|
+
path: async (request) => await withFreshness(async () => {
|
|
499
|
+
const snapshot = await session.loadProject({ symbolGraph: "skip" });
|
|
500
|
+
const result = getShortestPath(snapshot.fileGraph, await resolveProjectFile(await realRoot, root, request.from), await resolveProjectFile(await realRoot, root, request.to));
|
|
501
|
+
return {
|
|
502
|
+
path: result ? result.map(relative) : null,
|
|
503
|
+
};
|
|
504
|
+
}),
|
|
505
|
+
impact: async (request) => await withFreshness(async () => {
|
|
506
|
+
const snapshot = await session.loadProject({ symbolGraph: "skip" });
|
|
507
|
+
return (await analyzeImpactFromDiff(root, snapshot.index, {
|
|
508
|
+
...options.buildOptions,
|
|
509
|
+
provider: "git",
|
|
510
|
+
base: request.base,
|
|
511
|
+
head: request.head,
|
|
512
|
+
cwd: root,
|
|
513
|
+
compact: true,
|
|
514
|
+
depth: 2,
|
|
515
|
+
maxRefs: 200,
|
|
516
|
+
...DEFAULT_BOUNDED_IMPACT_BUDGETS,
|
|
517
|
+
}));
|
|
518
|
+
}),
|
|
519
|
+
review: async (request) => await withFreshness(async () => {
|
|
520
|
+
const report = await buildReviewReport(root, {
|
|
521
|
+
...options.buildOptions,
|
|
522
|
+
gitBase: request.base,
|
|
523
|
+
gitHead: request.head,
|
|
524
|
+
...(request.reviewDepth !== undefined ? { reviewDepth: request.reviewDepth } : {}),
|
|
525
|
+
}, {
|
|
526
|
+
...(session.loadProject
|
|
527
|
+
? {
|
|
528
|
+
loadIndex: async () => (await session.loadProject({ symbolGraph: "skip" })).index,
|
|
529
|
+
}
|
|
530
|
+
: {}),
|
|
531
|
+
...(session.loadDuplicateAnalysis ? { loadDuplicateAnalysis: session.loadDuplicateAnalysis } : {}),
|
|
532
|
+
});
|
|
533
|
+
// MCP is a bounded transport (finding #45); library callers that need the
|
|
534
|
+
// complete, unbounded report should call `buildReviewReport` directly.
|
|
535
|
+
return boundReviewReportForTransport(report);
|
|
536
|
+
}),
|
|
537
|
+
query_sqlite: async (request) => {
|
|
538
|
+
if (!sqlitePath) {
|
|
539
|
+
throw new Error("No SQLite artifact is available. Run artifact_build first or pass artifactPath.");
|
|
540
|
+
}
|
|
541
|
+
assertMcpSqliteQueryResourceBounded(request.query);
|
|
542
|
+
// The artifact's own baseline decides whether the query can be served; session freshness
|
|
543
|
+
// only decides whether an automatic rebuild is safe. A fresh artifact is served even when
|
|
544
|
+
// the in-memory session snapshot is stale, and an unsafe session refresh burst blocks the
|
|
545
|
+
// automatic rebuild instead of silently rebuilding from stale in-memory state.
|
|
546
|
+
let realSqlitePath = await assertRealPathCandidateWithinRoot(await realRoot, sqlitePath, "SQLite artifact");
|
|
547
|
+
let artifactFreshness = await checkSqliteArtifactFreshness(realSqlitePath);
|
|
548
|
+
if (artifactFreshness.state !== "fresh") {
|
|
549
|
+
const sessionFreshness = await checkMcpFreshness();
|
|
550
|
+
if (sessionFreshness.state === "stale") {
|
|
551
|
+
throw new Error(formatSqliteFreshnessError(sessionFreshness));
|
|
552
|
+
}
|
|
553
|
+
artifactFreshness = await refreshSqliteArtifactForQuery(artifactFreshness, { allowStaleRebuild: true });
|
|
554
|
+
realSqlitePath = await assertRealPathCandidateWithinRoot(await realRoot, sqlitePath, "SQLite artifact");
|
|
555
|
+
}
|
|
556
|
+
const result = await queryGraphSqliteRaw(realSqlitePath, request.query, request.params ?? [], {
|
|
557
|
+
maxRows: normalizeSqliteRowLimit(request.limit),
|
|
558
|
+
});
|
|
559
|
+
return { ...boundRawSqlResult(result, DEFAULT_SQLITE_BYTE_LIMIT), freshness: artifactFreshness };
|
|
560
|
+
},
|
|
561
|
+
refresh_index: async (request) => {
|
|
562
|
+
const warmup = request.warmup ?? "off";
|
|
563
|
+
session.invalidate();
|
|
564
|
+
sqlitePath = configuredSqlitePath;
|
|
565
|
+
sqliteOutDir = configuredSqliteOutDir;
|
|
566
|
+
sqliteCanRefresh = configuredSqliteCanRefresh;
|
|
567
|
+
await startCodegraphMcpWarmup(session, warmup);
|
|
568
|
+
return { refreshed: true, warmup };
|
|
569
|
+
},
|
|
570
|
+
artifact_build: async (request) => {
|
|
571
|
+
if (readOnly) {
|
|
572
|
+
throw new Error("artifact_build is disabled in read-only MCP mode.");
|
|
573
|
+
}
|
|
574
|
+
const freshness = await checkMcpFreshness();
|
|
575
|
+
if (freshness.state === "stale") {
|
|
576
|
+
const changed = freshness.changedFiles.length ? ` Changed files: ${freshness.changedFiles.join(", ")}.` : "";
|
|
577
|
+
const omitted = freshness.omittedChangedFileCount
|
|
578
|
+
? ` Omitted changed files: ${freshness.omittedChangedFileCount}.`
|
|
579
|
+
: "";
|
|
580
|
+
throw new Error(`Cannot build artifacts from a stale MCP index; run refresh_index first. ${freshness.reason}.${changed}${omitted}`);
|
|
581
|
+
}
|
|
582
|
+
const outDir = request.outDir !== undefined
|
|
583
|
+
? await assertWritableDirectoryRealPathWithinRoot(await realRoot, root, request.outDir, "Artifact output directory")
|
|
584
|
+
: undefined;
|
|
585
|
+
const result = await buildCodegraphArtifactWithSession(session, {
|
|
586
|
+
root,
|
|
587
|
+
...(outDir !== undefined ? { outDir } : {}),
|
|
588
|
+
...(request.outDir !== undefined ? { filterOutDir: request.outDir } : {}),
|
|
589
|
+
...(request.sqlite !== undefined ? { sqlite: request.sqlite } : {}),
|
|
590
|
+
...(request.graphJson !== undefined ? { graphJson: request.graphJson } : {}),
|
|
591
|
+
...(request.report !== undefined ? { report: request.report } : {}),
|
|
592
|
+
...(request.questions !== undefined ? { questions: request.questions } : {}),
|
|
593
|
+
...(request.force !== undefined ? { force: request.force } : {}),
|
|
594
|
+
});
|
|
595
|
+
const sqliteArtifact = result.artifacts.sqlite;
|
|
596
|
+
if (sqliteArtifact) {
|
|
597
|
+
sqlitePath = path.join(result.outDir, sqliteArtifact);
|
|
598
|
+
sqliteOutDir = result.outDir;
|
|
599
|
+
sqliteCanRefresh = true;
|
|
600
|
+
}
|
|
601
|
+
return { ...result, freshness };
|
|
602
|
+
},
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
export function createCodegraphMcpProtocolServer(handlers, runtimeIdentity = captureCodegraphRuntimeIdentity(getCurrentNativeBindingOrigin()), installedVersion = createInstalledVersionChecker(runtimeIdentity), toolCallState = { firstToolCallPending: true }) {
|
|
606
|
+
const server = new Server({
|
|
607
|
+
name: "codegraph",
|
|
608
|
+
version: runtimeIdentity.runningVersion,
|
|
609
|
+
}, {
|
|
610
|
+
capabilities: { tools: {}, logging: {} },
|
|
611
|
+
});
|
|
612
|
+
server.setRequestHandler("tools/list", () => ({ tools: MCP_TOOLS }));
|
|
613
|
+
server.setRequestHandler("tools/call", async (request, ctx) => {
|
|
614
|
+
const isFirstToolCall = toolCallState.firstToolCallPending;
|
|
615
|
+
toolCallState.firstToolCallPending = false;
|
|
616
|
+
const progressToken = isFirstToolCall ? getToolCallProgressToken(request.params) : undefined;
|
|
617
|
+
const emitFirstToolCallVisibility = async (level, progress, message) => {
|
|
618
|
+
if (!isFirstToolCall)
|
|
619
|
+
return;
|
|
620
|
+
try {
|
|
621
|
+
await ctx.mcpReq.log(level, message, "codegraph");
|
|
622
|
+
if (progressToken !== undefined) {
|
|
623
|
+
await ctx.mcpReq.notify({
|
|
624
|
+
method: "notifications/progress",
|
|
625
|
+
params: {
|
|
626
|
+
progressToken,
|
|
627
|
+
progress,
|
|
628
|
+
total: 1,
|
|
629
|
+
message,
|
|
630
|
+
},
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
catch (error) {
|
|
635
|
+
console.error(`[codegraph] MCP cold-start visibility failed: ${errorMessage(error)}`);
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
await emitFirstToolCallVisibility("info", 0, `Codegraph is warming the first tool call for '${request.params.name}'.`);
|
|
639
|
+
try {
|
|
640
|
+
installedVersion.check();
|
|
641
|
+
}
|
|
642
|
+
catch (error) {
|
|
643
|
+
console.error(`[codegraph] installed-version check failed: ${errorMessage(error)}`);
|
|
644
|
+
}
|
|
645
|
+
try {
|
|
646
|
+
const result = await callMcpTool(handlers, request.params.name, request.params.arguments ?? {});
|
|
647
|
+
await emitFirstToolCallVisibility("info", 1, `Codegraph finished warming the first tool call for '${request.params.name}'.`);
|
|
648
|
+
return toToolResult(result);
|
|
649
|
+
}
|
|
650
|
+
catch (error) {
|
|
651
|
+
await emitFirstToolCallVisibility("error", 1, `Codegraph failed while warming the first tool call for '${request.params.name}'.`);
|
|
652
|
+
throw error;
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
return server;
|
|
656
|
+
}
|
|
657
|
+
function createCodegraphMcpProtocolFactory(handlers, runtimeIdentity) {
|
|
658
|
+
const installedVersion = createInstalledVersionChecker(runtimeIdentity);
|
|
659
|
+
const toolCallState = { firstToolCallPending: true };
|
|
660
|
+
return () => createCodegraphMcpProtocolServer(handlers, runtimeIdentity, installedVersion, toolCallState);
|
|
661
|
+
}
|
|
662
|
+
export async function serveCodegraphMcp(options) {
|
|
663
|
+
const port = options.port;
|
|
664
|
+
if (port !== undefined) {
|
|
665
|
+
const started = await startCodegraphMcpHttpServer({ ...options, port });
|
|
666
|
+
options.onHttpListen?.({
|
|
667
|
+
host: started.host,
|
|
668
|
+
port: started.port,
|
|
669
|
+
url: started.url,
|
|
670
|
+
});
|
|
671
|
+
await waitForHttpServerClose(started.server);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
const handlers = await createWarmedCodegraphMcpHandlers(options);
|
|
675
|
+
const runtimeIdentity = options.runtimeIdentity ?? captureCodegraphRuntimeIdentity(getCurrentNativeBindingOrigin());
|
|
676
|
+
const createProtocolServer = createCodegraphMcpProtocolFactory(handlers, runtimeIdentity);
|
|
677
|
+
const handle = serveStdio(createProtocolServer, {
|
|
678
|
+
legacy: "serve",
|
|
679
|
+
onerror: (error) => {
|
|
680
|
+
console.error(`[codegraph] MCP stdio error: ${error.message}`);
|
|
681
|
+
},
|
|
682
|
+
});
|
|
683
|
+
const idleTimeoutMs = options.idleTimeoutMs ?? DEFAULT_MCP_STDIO_IDLE_TIMEOUT_MS;
|
|
684
|
+
await awaitStdioMcpLifecycle(handle, {
|
|
685
|
+
idleTimeoutMs,
|
|
686
|
+
onShutdown: (shutdownReason) => {
|
|
687
|
+
console.error(`[codegraph] MCP stdio shutting down (${shutdownReason})`);
|
|
688
|
+
},
|
|
689
|
+
});
|
|
690
|
+
// Ensure orphaned stdio servers do not linger after the client is gone.
|
|
691
|
+
process.exitCode = 0;
|
|
692
|
+
}
|
|
693
|
+
export async function startCodegraphMcpHttpServer(options) {
|
|
694
|
+
const host = options.host ?? "127.0.0.1";
|
|
695
|
+
const handlers = await createWarmedCodegraphMcpHandlers(options);
|
|
696
|
+
const runtimeIdentity = options.runtimeIdentity ?? captureCodegraphRuntimeIdentity(getCurrentNativeBindingOrigin());
|
|
697
|
+
const createProtocolServer = createCodegraphMcpProtocolFactory(handlers, runtimeIdentity);
|
|
698
|
+
const sessionStore = createLegacyMcpSessionStore({
|
|
699
|
+
idleMs: options.httpSessionIdleMs ?? DEFAULT_MCP_HTTP_SESSION_IDLE_MS,
|
|
700
|
+
maxCount: options.httpSessionMaxCount ?? DEFAULT_MCP_HTTP_SESSION_MAX_COUNT,
|
|
701
|
+
evictionIntervalMs: options.httpSessionEvictionIntervalMs ?? DEFAULT_MCP_HTTP_SESSION_EVICTION_INTERVAL_MS,
|
|
702
|
+
});
|
|
703
|
+
const modernHandler = createMcpHandler(createProtocolServer, {
|
|
704
|
+
legacy: "reject",
|
|
705
|
+
onerror: (error) => {
|
|
706
|
+
console.error(`[codegraph] MCP HTTP error: ${error.message}`);
|
|
707
|
+
},
|
|
708
|
+
});
|
|
709
|
+
const modernNodeHandler = toNodeHandler(modernHandler, {
|
|
710
|
+
onerror: (error) => {
|
|
711
|
+
console.error(`[codegraph] MCP HTTP adapter error: ${error.message}`);
|
|
712
|
+
},
|
|
713
|
+
});
|
|
714
|
+
const validateOrigin = originValidation(buildAllowedOriginHostnames(host));
|
|
715
|
+
let allowedHostHeaders = emptyAllowedHostHeaderRules();
|
|
716
|
+
let closeResourcesPromise;
|
|
717
|
+
const closeResources = () => {
|
|
718
|
+
closeResourcesPromise ??= (async () => {
|
|
719
|
+
sessionStore.stop();
|
|
720
|
+
await closeMcpResources(sessionStore.sessions, modernHandler.close);
|
|
721
|
+
})();
|
|
722
|
+
return closeResourcesPromise;
|
|
723
|
+
};
|
|
724
|
+
const server = createServer((request, response) => {
|
|
725
|
+
void handleMcpHttpRequest(request, response, sessionStore, () => allowedHostHeaders, validateOrigin, modernNodeHandler, createProtocolServer);
|
|
726
|
+
});
|
|
727
|
+
server.on("close", () => {
|
|
728
|
+
void closeResources();
|
|
729
|
+
});
|
|
730
|
+
await listenOnHttpServer(server, options.port, host);
|
|
731
|
+
const address = server.address();
|
|
732
|
+
const actualPort = getHttpServerPort(address);
|
|
733
|
+
const urlHost = formatHostForUrl(host);
|
|
734
|
+
const url = `http://${urlHost}:${actualPort}${MCP_HTTP_PATH}`;
|
|
735
|
+
allowedHostHeaders = buildAllowedHostHeaders(host, actualPort);
|
|
736
|
+
return {
|
|
737
|
+
server,
|
|
738
|
+
host,
|
|
739
|
+
port: actualPort,
|
|
740
|
+
url,
|
|
741
|
+
close: async () => {
|
|
742
|
+
const requestsDrained = closeHttpServer(server);
|
|
743
|
+
await closeResources();
|
|
744
|
+
await requestsDrained;
|
|
745
|
+
// An initialize accepted before closeHttpServer() can register after closeResources() snapshots the session map.
|
|
746
|
+
await closeLegacyMcpSessions(sessionStore.sessions);
|
|
747
|
+
},
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
async function handleMcpHttpRequest(request, response, sessionStore, getAllowedHostHeaders, validateOrigin, modernNodeHandler, createProtocolServer) {
|
|
751
|
+
const requestPath = getRequestPath(request);
|
|
752
|
+
if (requestPath !== MCP_HTTP_PATH) {
|
|
753
|
+
writeJsonResponse(response, 404, { error: "Not found" });
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
if (!isAllowedHostHeader(request, getAllowedHostHeaders())) {
|
|
757
|
+
writeJsonRpcError(response, 403, "Forbidden host header");
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
if (!validateOrigin(request, response))
|
|
761
|
+
return;
|
|
762
|
+
try {
|
|
763
|
+
if (request.method === "POST") {
|
|
764
|
+
const parsedBody = await readJsonRequestBody(request, MAX_MCP_HTTP_BODY_BYTES);
|
|
765
|
+
if (parsedBody.status === "too_large") {
|
|
766
|
+
writeJsonRpcError(response, 413, "MCP request body is too large");
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
if (parsedBody.status === "invalid_json") {
|
|
770
|
+
writeJsonRpcError(response, 400, "Invalid JSON request body");
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
if (!isMcpNodeRequest(request)) {
|
|
774
|
+
writeJsonRpcError(response, 400, "Invalid MCP request target");
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
const mcpRequest = request;
|
|
778
|
+
const webRequest = await toWebRequest(mcpRequest, parsedBody.body);
|
|
779
|
+
if (await isLegacyRequest(webRequest, parsedBody.body)) {
|
|
780
|
+
await handleLegacyMcpHttpPost(request, response, parsedBody.body, sessionStore, createProtocolServer);
|
|
781
|
+
}
|
|
782
|
+
else {
|
|
783
|
+
await modernNodeHandler(mcpRequest, response, parsedBody.body);
|
|
784
|
+
}
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
if (request.method === "GET" || request.method === "DELETE") {
|
|
788
|
+
await handleExistingMcpSessionRequest(request, response, sessionStore);
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
writeJsonRpcError(response, 405, "Method not allowed");
|
|
792
|
+
}
|
|
793
|
+
catch {
|
|
794
|
+
if (!response.headersSent) {
|
|
795
|
+
writeJsonRpcError(response, 500, "Internal server error", -32603);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
async function handleLegacyMcpHttpPost(request, response, body, sessionStore, createProtocolServer) {
|
|
800
|
+
const sessionId = getHeaderValue(request.headers["mcp-session-id"]);
|
|
801
|
+
if (sessionId !== undefined) {
|
|
802
|
+
const session = sessionStore.get(sessionId);
|
|
803
|
+
if (!session) {
|
|
804
|
+
writeJsonRpcError(response, 400, "Bad Request: No valid session ID provided");
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
sessionStore.touch(sessionId);
|
|
808
|
+
try {
|
|
809
|
+
await handleLegacyMcpSessionRequest(session, request, response, body);
|
|
810
|
+
}
|
|
811
|
+
catch (error) {
|
|
812
|
+
await sessionStore.delete(sessionId);
|
|
813
|
+
throw error;
|
|
814
|
+
}
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
if (!isInitializeRequest(body)) {
|
|
818
|
+
writeJsonRpcError(response, 400, "Bad Request: No valid session ID provided");
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
const hasCapacity = await sessionStore.ensureCapacityForNewSession();
|
|
822
|
+
if (!hasCapacity) {
|
|
823
|
+
writeJsonRpcError(response, 503, "MCP session capacity reached: all configured sessions are active; close an existing session and retry.");
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
let capacityReservationHeld = true;
|
|
827
|
+
const releaseCapacityReservation = () => {
|
|
828
|
+
if (!capacityReservationHeld)
|
|
829
|
+
return;
|
|
830
|
+
capacityReservationHeld = false;
|
|
831
|
+
sessionStore.releaseCapacityReservation();
|
|
832
|
+
};
|
|
833
|
+
const protocolServer = createProtocolServer();
|
|
834
|
+
let initializedSessionId;
|
|
835
|
+
// The transport callbacks close over the session, but the session needs the
|
|
836
|
+
// transport, so the binding is resolved through a ref rather than a mutable let.
|
|
837
|
+
const sessionRef = { current: undefined };
|
|
838
|
+
const transport = new NodeStreamableHTTPServerTransport({
|
|
839
|
+
enableJsonResponse: true,
|
|
840
|
+
sessionIdGenerator: () => randomUUID(),
|
|
841
|
+
onsessioninitialized: (newSessionId) => {
|
|
842
|
+
initializedSessionId = newSessionId;
|
|
843
|
+
const initialized = sessionRef.current;
|
|
844
|
+
if (initialized === undefined) {
|
|
845
|
+
throw new Error("MCP session state was not initialized before the transport session.");
|
|
846
|
+
}
|
|
847
|
+
sessionStore.set(newSessionId, initialized);
|
|
848
|
+
releaseCapacityReservation();
|
|
849
|
+
},
|
|
850
|
+
onsessionclosed: (closedSessionId) => {
|
|
851
|
+
void sessionStore.delete(closedSessionId);
|
|
852
|
+
},
|
|
853
|
+
});
|
|
854
|
+
const session = {
|
|
855
|
+
server: protocolServer,
|
|
856
|
+
transport,
|
|
857
|
+
lastActivityAt: Date.now(),
|
|
858
|
+
inFlightRequests: 0,
|
|
859
|
+
openSseStreams: 0,
|
|
860
|
+
};
|
|
861
|
+
sessionRef.current = session;
|
|
862
|
+
transport.onerror = (error) => {
|
|
863
|
+
console.error(`[codegraph] MCP HTTP session transport error: ${error.message}`);
|
|
864
|
+
if (initializedSessionId !== undefined)
|
|
865
|
+
void sessionStore.delete(initializedSessionId);
|
|
866
|
+
};
|
|
867
|
+
transport.onclose = () => {
|
|
868
|
+
if (initializedSessionId !== undefined)
|
|
869
|
+
void sessionStore.delete(initializedSessionId);
|
|
870
|
+
};
|
|
871
|
+
try {
|
|
872
|
+
await protocolServer.connect(transport);
|
|
873
|
+
await handleLegacyMcpSessionRequest(session, request, response, body);
|
|
874
|
+
}
|
|
875
|
+
catch (error) {
|
|
876
|
+
if (initializedSessionId !== undefined) {
|
|
877
|
+
await sessionStore.delete(initializedSessionId);
|
|
878
|
+
}
|
|
879
|
+
else {
|
|
880
|
+
await closeMcpSession(session);
|
|
881
|
+
}
|
|
882
|
+
releaseCapacityReservation();
|
|
883
|
+
throw error;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
async function handleExistingMcpSessionRequest(request, response, sessionStore) {
|
|
887
|
+
const sessionId = getHeaderValue(request.headers["mcp-session-id"]);
|
|
888
|
+
if (sessionId === undefined) {
|
|
889
|
+
writeJsonRpcError(response, 400, "Invalid or missing session ID");
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
const session = sessionStore.get(sessionId);
|
|
893
|
+
if (!session) {
|
|
894
|
+
writeJsonRpcError(response, 400, "Invalid or missing session ID");
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
sessionStore.touch(sessionId);
|
|
898
|
+
try {
|
|
899
|
+
await handleLegacyMcpSessionRequest(session, request, response);
|
|
900
|
+
}
|
|
901
|
+
catch (error) {
|
|
902
|
+
await sessionStore.delete(sessionId);
|
|
903
|
+
throw error;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
async function handleLegacyMcpSessionRequest(session, request, response, body) {
|
|
907
|
+
const tracksSseStream = isLegacySseRequest(request);
|
|
908
|
+
session.inFlightRequests += 1;
|
|
909
|
+
if (tracksSseStream)
|
|
910
|
+
session.openSseStreams += 1;
|
|
911
|
+
try {
|
|
912
|
+
await session.transport.handleRequest(request, response, body);
|
|
913
|
+
}
|
|
914
|
+
finally {
|
|
915
|
+
session.inFlightRequests -= 1;
|
|
916
|
+
if (tracksSseStream)
|
|
917
|
+
session.openSseStreams -= 1;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
function isLegacySseRequest(request) {
|
|
921
|
+
if (request.method !== "GET")
|
|
922
|
+
return false;
|
|
923
|
+
return getHeaderValue(request.headers.accept)?.includes("text/event-stream") ?? false;
|
|
924
|
+
}
|
|
925
|
+
function createLegacyMcpSessionStore(options) {
|
|
926
|
+
const sessions = new Map();
|
|
927
|
+
let stopped = false;
|
|
928
|
+
let evictionTimer;
|
|
929
|
+
let pendingInitializations = 0;
|
|
930
|
+
const store = {
|
|
931
|
+
sessions,
|
|
932
|
+
get(sessionId) {
|
|
933
|
+
return sessions.get(sessionId);
|
|
934
|
+
},
|
|
935
|
+
set(sessionId, session) {
|
|
936
|
+
sessions.set(sessionId, session);
|
|
937
|
+
},
|
|
938
|
+
touch(sessionId) {
|
|
939
|
+
const session = sessions.get(sessionId);
|
|
940
|
+
if (!session)
|
|
941
|
+
return;
|
|
942
|
+
session.lastActivityAt = Date.now();
|
|
943
|
+
},
|
|
944
|
+
async delete(sessionId) {
|
|
945
|
+
const session = sessions.get(sessionId);
|
|
946
|
+
if (!session)
|
|
947
|
+
return;
|
|
948
|
+
sessions.delete(sessionId);
|
|
949
|
+
await closeMcpSession(session);
|
|
950
|
+
},
|
|
951
|
+
async ensureCapacityForNewSession() {
|
|
952
|
+
await evictIdleLegacyMcpSessions(store, options.idleMs);
|
|
953
|
+
if (sessions.size + pendingInitializations < options.maxCount) {
|
|
954
|
+
pendingInitializations += 1;
|
|
955
|
+
return true;
|
|
956
|
+
}
|
|
957
|
+
const oldest = [...sessions.entries()]
|
|
958
|
+
.filter(([, session]) => !session.inFlightRequests && !session.openSseStreams)
|
|
959
|
+
.sort((left, right) => left[1].lastActivityAt - right[1].lastActivityAt);
|
|
960
|
+
while (sessions.size + pendingInitializations >= options.maxCount && oldest.length) {
|
|
961
|
+
const oldestSession = oldest.shift();
|
|
962
|
+
if (oldestSession === undefined)
|
|
963
|
+
break;
|
|
964
|
+
const [sessionId, session] = oldestSession;
|
|
965
|
+
if (session.inFlightRequests || session.openSseStreams)
|
|
966
|
+
continue;
|
|
967
|
+
await store.delete(sessionId);
|
|
968
|
+
}
|
|
969
|
+
if (sessions.size + pendingInitializations >= options.maxCount)
|
|
970
|
+
return false;
|
|
971
|
+
pendingInitializations += 1;
|
|
972
|
+
return true;
|
|
973
|
+
},
|
|
974
|
+
releaseCapacityReservation() {
|
|
975
|
+
if (pendingInitializations)
|
|
976
|
+
pendingInitializations -= 1;
|
|
977
|
+
},
|
|
978
|
+
stop() {
|
|
979
|
+
stopped = true;
|
|
980
|
+
if (evictionTimer !== undefined) {
|
|
981
|
+
clearInterval(evictionTimer);
|
|
982
|
+
evictionTimer = undefined;
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
};
|
|
986
|
+
if (options.idleMs > 0 && options.evictionIntervalMs > 0) {
|
|
987
|
+
evictionTimer = setInterval(() => {
|
|
988
|
+
if (stopped)
|
|
989
|
+
return;
|
|
990
|
+
void evictIdleLegacyMcpSessions(store, options.idleMs).catch((error) => {
|
|
991
|
+
console.error(`[codegraph] MCP HTTP session eviction failed: ${errorMessage(error)}`);
|
|
992
|
+
});
|
|
993
|
+
}, options.evictionIntervalMs);
|
|
994
|
+
evictionTimer.unref?.();
|
|
995
|
+
}
|
|
996
|
+
return store;
|
|
997
|
+
}
|
|
998
|
+
async function evictIdleLegacyMcpSessions(store, idleMs) {
|
|
999
|
+
if (idleMs <= 0)
|
|
1000
|
+
return;
|
|
1001
|
+
const cutoff = Date.now() - idleMs;
|
|
1002
|
+
for (const [sessionId, session] of store.sessions) {
|
|
1003
|
+
if (session.lastActivityAt > cutoff || session.inFlightRequests || session.openSseStreams)
|
|
1004
|
+
continue;
|
|
1005
|
+
await store.delete(sessionId);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
async function closeMcpSession(session) {
|
|
1009
|
+
await Promise.allSettled([session.transport.close(), session.server.close()]);
|
|
1010
|
+
}
|
|
1011
|
+
async function closeLegacyMcpSessions(sessions) {
|
|
1012
|
+
const legacySessions = [...sessions.values()];
|
|
1013
|
+
sessions.clear();
|
|
1014
|
+
await Promise.allSettled(legacySessions.map((session) => closeMcpSession(session)));
|
|
1015
|
+
}
|
|
1016
|
+
async function closeMcpResources(sessions, closeModernHandler) {
|
|
1017
|
+
await Promise.allSettled([closeLegacyMcpSessions(sessions), closeModernHandler()]);
|
|
1018
|
+
}
|
|
1019
|
+
function isMcpNodeRequest(request) {
|
|
1020
|
+
return request.method !== undefined && request.url !== undefined;
|
|
1021
|
+
}
|
|
1022
|
+
async function callMcpTool(handlers, name, input) {
|
|
1023
|
+
switch (name) {
|
|
1024
|
+
case "search":
|
|
1025
|
+
return await handlers.search(parseMcpToolInput(searchSchema, input, "search"));
|
|
1026
|
+
case "workspace_symbols":
|
|
1027
|
+
return await handlers.workspace_symbols(parseMcpToolInput(workspaceSymbolsSchema, input, "workspace_symbols"));
|
|
1028
|
+
case "rename_preview":
|
|
1029
|
+
return await handlers.rename_preview(parseMcpToolInput(renamePreviewSchema, input, "rename_preview"));
|
|
1030
|
+
case "refactor_plan":
|
|
1031
|
+
return await handlers.refactor_plan(parseMcpToolInput(refactorPlanSchema, input, "refactor_plan"));
|
|
1032
|
+
case "calls":
|
|
1033
|
+
return await handlers.calls(parseMcpToolInput(callsSchema, input, "calls"));
|
|
1034
|
+
case "callers":
|
|
1035
|
+
return await handlers.calls({ ...parseMcpToolInput(callHierarchySchema, input, name), direction: "callers" });
|
|
1036
|
+
case "callees":
|
|
1037
|
+
return await handlers.calls({ ...parseMcpToolInput(callHierarchySchema, input, name), direction: "callees" });
|
|
1038
|
+
case "type_hierarchy":
|
|
1039
|
+
return await handlers.type_hierarchy(parseMcpToolInput(typeHierarchyUnifiedSchema, input, "type_hierarchy"));
|
|
1040
|
+
case "supertypes":
|
|
1041
|
+
return await handlers.type_hierarchy({
|
|
1042
|
+
...parseMcpToolInput(typeHierarchySchema, input, name),
|
|
1043
|
+
direction: "supertypes",
|
|
1044
|
+
});
|
|
1045
|
+
case "subtypes":
|
|
1046
|
+
return await handlers.type_hierarchy({
|
|
1047
|
+
...parseMcpToolInput(typeHierarchySchema, input, name),
|
|
1048
|
+
direction: "subtypes",
|
|
1049
|
+
});
|
|
1050
|
+
case "implementations":
|
|
1051
|
+
return await handlers.implementations(parseMcpToolInput(implementationsSchema, input, "implementations"));
|
|
1052
|
+
case "explore":
|
|
1053
|
+
return await handlers.explore(parseMcpToolInput(exploreSchema, input, "explore"));
|
|
1054
|
+
case "orient":
|
|
1055
|
+
return await handlers.orient(parseMcpToolInput(orientSchema, input, "orient"));
|
|
1056
|
+
case "packet_get":
|
|
1057
|
+
return await handlers.packet_get(parseMcpToolInput(packetGetSchema, input, "packet_get"));
|
|
1058
|
+
case "get_file":
|
|
1059
|
+
return await handlers.get_file(parseMcpToolInput(getFileSchema, input, "get_file"));
|
|
1060
|
+
case "get_symbol":
|
|
1061
|
+
return await handlers.get_symbol(parseMcpToolInput(handleSchema, input, "get_symbol"));
|
|
1062
|
+
case "goto":
|
|
1063
|
+
return await callGotoTool(handlers, input);
|
|
1064
|
+
case "refs":
|
|
1065
|
+
return await callRefsTool(handlers, input);
|
|
1066
|
+
case "file_deps":
|
|
1067
|
+
return await handlers.file_deps(parseMcpToolInput(fileDepsUnifiedSchema, input, "file_deps"));
|
|
1068
|
+
case "deps":
|
|
1069
|
+
return await handlers.file_deps({ ...parseMcpToolInput(fileGraphSchema, input, name), direction: "deps" });
|
|
1070
|
+
case "rdeps":
|
|
1071
|
+
return await handlers.file_deps({ ...parseMcpToolInput(fileGraphSchema, input, name), direction: "rdeps" });
|
|
1072
|
+
case "path":
|
|
1073
|
+
return await handlers.path(parseMcpToolInput(pathSchema, input, "path"));
|
|
1074
|
+
case "impact":
|
|
1075
|
+
return await handlers.impact(parseMcpToolInput(gitRangeSchema, input, name));
|
|
1076
|
+
case "review":
|
|
1077
|
+
return await handlers.review(parseMcpToolInput(reviewSchema, input, "review"));
|
|
1078
|
+
case "query_sqlite":
|
|
1079
|
+
return await handlers.query_sqlite(parseMcpToolInput(querySqliteSchema, input, "query_sqlite"));
|
|
1080
|
+
case "refresh_index":
|
|
1081
|
+
return await handlers.refresh_index(parseMcpToolInput(refreshIndexSchema, input, "refresh_index"));
|
|
1082
|
+
case "artifact_build":
|
|
1083
|
+
return await handlers.artifact_build(parseMcpToolInput(artifactBuildSchema, input, "artifact_build"));
|
|
1084
|
+
default:
|
|
1085
|
+
throw new Error(`Unknown MCP tool: ${name}`);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
async function callGotoTool(handlers, input) {
|
|
1089
|
+
const request = parseMcpToolInput(navigationSchema, input, "goto");
|
|
1090
|
+
if (request.handle !== undefined)
|
|
1091
|
+
return await handlers.goto({ handle: request.handle });
|
|
1092
|
+
if (request.file === undefined || request.line === undefined || request.column === undefined) {
|
|
1093
|
+
throw new Error("goto requires either handle or file, line, and column.");
|
|
1094
|
+
}
|
|
1095
|
+
return await handlers.goto({ file: request.file, line: request.line, column: request.column });
|
|
1096
|
+
}
|
|
1097
|
+
async function callRefsTool(handlers, input) {
|
|
1098
|
+
const request = parseMcpToolInput(refsSchema, input, "refs");
|
|
1099
|
+
if (request.handle !== undefined) {
|
|
1100
|
+
return await handlers.refs({
|
|
1101
|
+
handle: request.handle,
|
|
1102
|
+
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
if (request.file === undefined || request.line === undefined || request.column === undefined) {
|
|
1106
|
+
throw new Error("refs requires either handle or file, line, and column.");
|
|
1107
|
+
}
|
|
1108
|
+
return await handlers.refs({
|
|
1109
|
+
file: request.file,
|
|
1110
|
+
line: request.line,
|
|
1111
|
+
column: request.column,
|
|
1112
|
+
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
function toToolResult(value) {
|
|
1116
|
+
return {
|
|
1117
|
+
content: [
|
|
1118
|
+
{
|
|
1119
|
+
type: "text",
|
|
1120
|
+
text: JSON.stringify(value, null, 2),
|
|
1121
|
+
},
|
|
1122
|
+
],
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
const mcpProgressTokenSchema = z.union([z.string(), z.number()]);
|
|
1126
|
+
const toolCallMetaSchema = z
|
|
1127
|
+
.object({
|
|
1128
|
+
_meta: z.object({ progressToken: mcpProgressTokenSchema.optional() }).passthrough().optional(),
|
|
1129
|
+
progressToken: mcpProgressTokenSchema.optional(),
|
|
1130
|
+
})
|
|
1131
|
+
.passthrough();
|
|
1132
|
+
function getToolCallProgressToken(params) {
|
|
1133
|
+
const parsed = toolCallMetaSchema.safeParse(params);
|
|
1134
|
+
if (!parsed.success)
|
|
1135
|
+
return undefined;
|
|
1136
|
+
return parsed.data._meta?.progressToken ?? parsed.data.progressToken;
|
|
1137
|
+
}
|
|
1138
|
+
function formatMcpInvalidParams(toolName, error) {
|
|
1139
|
+
const details = error.issues
|
|
1140
|
+
.map((issue) => {
|
|
1141
|
+
const path = issue.path.length ? issue.path.join(".") : "(root)";
|
|
1142
|
+
return `${path}: ${issue.message}`;
|
|
1143
|
+
})
|
|
1144
|
+
.join("; ");
|
|
1145
|
+
return `Invalid parameters for ${toolName}: ${details}`;
|
|
1146
|
+
}
|
|
1147
|
+
function parseMcpToolInput(schema, input, toolName) {
|
|
1148
|
+
const parsed = schema.safeParse(input);
|
|
1149
|
+
if (parsed.success)
|
|
1150
|
+
return parsed.data;
|
|
1151
|
+
throw new Error(formatMcpInvalidParams(toolName, parsed.error));
|
|
1152
|
+
}
|
|
1153
|
+
const searchSchema = z
|
|
1154
|
+
.object({
|
|
1155
|
+
query: z.string(),
|
|
1156
|
+
mode: z.enum(["hybrid", "symbol", "path", "text", "graph", "sql"]).optional(),
|
|
1157
|
+
from: z.string().optional(),
|
|
1158
|
+
depth: z.number().int().nonnegative().optional(),
|
|
1159
|
+
limit: z.number().int().nonnegative().optional(),
|
|
1160
|
+
})
|
|
1161
|
+
.strict();
|
|
1162
|
+
const workspaceSymbolsSchema = z
|
|
1163
|
+
.object({
|
|
1164
|
+
query: z.string(),
|
|
1165
|
+
kinds: z.array(z.nativeEnum(SymbolKind)).optional(),
|
|
1166
|
+
exportedOnly: z.boolean().optional(),
|
|
1167
|
+
includeImports: z.boolean().optional(),
|
|
1168
|
+
fileGlob: z.string().optional(),
|
|
1169
|
+
limit: z.number().int().nonnegative().max(MAX_WORKSPACE_SYMBOL_LIMIT).optional(),
|
|
1170
|
+
})
|
|
1171
|
+
.strict();
|
|
1172
|
+
const renamePreviewSchema = z
|
|
1173
|
+
.object({
|
|
1174
|
+
handle: z.string(),
|
|
1175
|
+
newName: z.string(),
|
|
1176
|
+
includeComments: z.boolean().optional(),
|
|
1177
|
+
includeStrings: z.boolean().optional(),
|
|
1178
|
+
includeFilenames: z.boolean().optional(),
|
|
1179
|
+
maxEdits: z.number().int().min(1).max(MAX_RENAME_PREVIEW_EDITS).optional(),
|
|
1180
|
+
})
|
|
1181
|
+
.strict();
|
|
1182
|
+
const refactorPlanSchema = z
|
|
1183
|
+
.object({
|
|
1184
|
+
handle: z.string(),
|
|
1185
|
+
renameTo: z.string().optional(),
|
|
1186
|
+
maxReferences: z.number().int().nonnegative().max(MAX_REFACTOR_PLAN_LIMIT).optional(),
|
|
1187
|
+
maxCallers: z.number().int().nonnegative().max(MAX_REFACTOR_PLAN_LIMIT).optional(),
|
|
1188
|
+
maxHierarchy: z.number().int().nonnegative().max(MAX_REFACTOR_PLAN_LIMIT).optional(),
|
|
1189
|
+
includeSource: z.boolean().optional(),
|
|
1190
|
+
})
|
|
1191
|
+
.strict();
|
|
1192
|
+
const callHierarchySchema = z
|
|
1193
|
+
.object({
|
|
1194
|
+
handle: z.string(),
|
|
1195
|
+
depth: z.number().int().min(1).max(5).optional(),
|
|
1196
|
+
limit: z.number().int().nonnegative().max(500).optional(),
|
|
1197
|
+
includeHeuristic: z.boolean().optional(),
|
|
1198
|
+
})
|
|
1199
|
+
.strict();
|
|
1200
|
+
const callsSchema = callHierarchySchema
|
|
1201
|
+
.extend({
|
|
1202
|
+
direction: z.enum(["callers", "callees"]),
|
|
1203
|
+
})
|
|
1204
|
+
.strict();
|
|
1205
|
+
const typeHierarchySchema = z
|
|
1206
|
+
.object({
|
|
1207
|
+
handle: z.string(),
|
|
1208
|
+
depth: z.number().int().min(1).max(10).optional(),
|
|
1209
|
+
limit: z.number().int().nonnegative().max(500).optional(),
|
|
1210
|
+
})
|
|
1211
|
+
.strict();
|
|
1212
|
+
const typeHierarchyUnifiedSchema = typeHierarchySchema
|
|
1213
|
+
.extend({
|
|
1214
|
+
direction: z.enum(["supertypes", "subtypes"]),
|
|
1215
|
+
})
|
|
1216
|
+
.strict();
|
|
1217
|
+
const implementationsSchema = z
|
|
1218
|
+
.object({
|
|
1219
|
+
handle: z.string(),
|
|
1220
|
+
limit: z.number().int().nonnegative().max(500).optional(),
|
|
1221
|
+
})
|
|
1222
|
+
.strict();
|
|
1223
|
+
const exploreSchema = z
|
|
1224
|
+
.object({
|
|
1225
|
+
query: z.string(),
|
|
1226
|
+
limit: z.number().int().nonnegative().max(50).optional(),
|
|
1227
|
+
maxPackets: z.number().int().nonnegative().max(10).optional(),
|
|
1228
|
+
maxPaths: z.number().int().nonnegative().max(10).optional(),
|
|
1229
|
+
includeSource: z.boolean().optional(),
|
|
1230
|
+
})
|
|
1231
|
+
.strict();
|
|
1232
|
+
const orientSchema = z
|
|
1233
|
+
.object({
|
|
1234
|
+
includeRoots: z.array(z.string()).optional(),
|
|
1235
|
+
budget: z.enum(["small", "medium", "large"]).optional(),
|
|
1236
|
+
})
|
|
1237
|
+
.strict();
|
|
1238
|
+
const packetGetSchema = z
|
|
1239
|
+
.object({
|
|
1240
|
+
target: z.string(),
|
|
1241
|
+
maxSymbols: z.number().int().positive().max(200).optional(),
|
|
1242
|
+
maxSnippets: z.number().int().positive().max(50).optional(),
|
|
1243
|
+
maxDuplicates: z.number().int().positive().max(20).optional(),
|
|
1244
|
+
})
|
|
1245
|
+
.strict();
|
|
1246
|
+
const getFileSchema = z
|
|
1247
|
+
.object({
|
|
1248
|
+
file: z.string(),
|
|
1249
|
+
offset: z.number().int().positive().optional(),
|
|
1250
|
+
limit: z.number().int().positive().max(MAX_FILE_VIEW_LINES).optional(),
|
|
1251
|
+
maxBytes: z.number().int().positive().max(MAX_FILE_VIEW_BYTES).optional(),
|
|
1252
|
+
includeGraphContext: z.boolean().optional(),
|
|
1253
|
+
allowSensitive: z.boolean().optional(),
|
|
1254
|
+
})
|
|
1255
|
+
.strict();
|
|
1256
|
+
const handleSchema = z
|
|
1257
|
+
.object({
|
|
1258
|
+
handle: z.string(),
|
|
1259
|
+
})
|
|
1260
|
+
.strict();
|
|
1261
|
+
const navigationSchema = z
|
|
1262
|
+
.object({
|
|
1263
|
+
handle: z.string().optional(),
|
|
1264
|
+
file: z.string().optional(),
|
|
1265
|
+
line: z.number().int().positive().optional(),
|
|
1266
|
+
column: z.number().int().nonnegative().optional(),
|
|
1267
|
+
})
|
|
1268
|
+
.strict()
|
|
1269
|
+
.refine((request) => {
|
|
1270
|
+
const hasHandle = request.handle !== undefined;
|
|
1271
|
+
const hasAnyPosition = request.file !== undefined || request.line !== undefined || request.column !== undefined;
|
|
1272
|
+
const hasCompletePosition = request.file !== undefined && request.line !== undefined && request.column !== undefined;
|
|
1273
|
+
return hasHandle ? !hasAnyPosition : hasCompletePosition;
|
|
1274
|
+
}, { message: "goto requires either handle or file, line, and column." });
|
|
1275
|
+
const refsSchema = z
|
|
1276
|
+
.object({
|
|
1277
|
+
handle: z.string().optional(),
|
|
1278
|
+
file: z.string().optional(),
|
|
1279
|
+
line: z.number().int().positive().optional(),
|
|
1280
|
+
column: z.number().int().nonnegative().optional(),
|
|
1281
|
+
limit: z.number().int().nonnegative().optional(),
|
|
1282
|
+
})
|
|
1283
|
+
.strict()
|
|
1284
|
+
.refine((request) => {
|
|
1285
|
+
const hasHandle = request.handle !== undefined;
|
|
1286
|
+
const hasAnyPosition = request.file !== undefined || request.line !== undefined || request.column !== undefined;
|
|
1287
|
+
const hasCompletePosition = request.file !== undefined && request.line !== undefined && request.column !== undefined;
|
|
1288
|
+
return hasHandle ? !hasAnyPosition : hasCompletePosition;
|
|
1289
|
+
}, {
|
|
1290
|
+
message: "refs requires either handle or file, line, and column.",
|
|
1291
|
+
});
|
|
1292
|
+
const fileGraphSchema = z
|
|
1293
|
+
.object({
|
|
1294
|
+
file: z.string(),
|
|
1295
|
+
depth: z.number().int().nonnegative().optional(),
|
|
1296
|
+
limit: z.number().int().nonnegative().optional(),
|
|
1297
|
+
})
|
|
1298
|
+
.strict();
|
|
1299
|
+
const fileDepsUnifiedSchema = fileGraphSchema
|
|
1300
|
+
.extend({
|
|
1301
|
+
direction: z.enum(["deps", "rdeps"]),
|
|
1302
|
+
})
|
|
1303
|
+
.strict();
|
|
1304
|
+
const pathSchema = z
|
|
1305
|
+
.object({
|
|
1306
|
+
from: z.string(),
|
|
1307
|
+
to: z.string(),
|
|
1308
|
+
})
|
|
1309
|
+
.strict();
|
|
1310
|
+
const gitRangeSchema = z
|
|
1311
|
+
.object({
|
|
1312
|
+
base: z.string(),
|
|
1313
|
+
head: z.string(),
|
|
1314
|
+
})
|
|
1315
|
+
.strict();
|
|
1316
|
+
const reviewSchema = z
|
|
1317
|
+
.object({
|
|
1318
|
+
base: z.string(),
|
|
1319
|
+
head: z.string(),
|
|
1320
|
+
reviewDepth: z.enum(["minimal", "standard", "deep"]).optional(),
|
|
1321
|
+
})
|
|
1322
|
+
.strict();
|
|
1323
|
+
const querySqliteSchema = z
|
|
1324
|
+
.object({
|
|
1325
|
+
query: z.string(),
|
|
1326
|
+
params: z.array(z.union([z.string(), z.number(), z.null()])).optional(),
|
|
1327
|
+
limit: z.number().int().nonnegative().optional(),
|
|
1328
|
+
})
|
|
1329
|
+
.strict();
|
|
1330
|
+
const refreshIndexSchema = z
|
|
1331
|
+
.object({
|
|
1332
|
+
warmup: z.enum(["off", "base", "symbols"]).optional(),
|
|
1333
|
+
})
|
|
1334
|
+
.strict();
|
|
1335
|
+
const artifactBuildSchema = z
|
|
1336
|
+
.object({
|
|
1337
|
+
outDir: z.string().optional(),
|
|
1338
|
+
sqlite: z.boolean().optional(),
|
|
1339
|
+
graphJson: z.boolean().optional(),
|
|
1340
|
+
report: z.boolean().optional(),
|
|
1341
|
+
questions: z.boolean().optional(),
|
|
1342
|
+
force: z.boolean().optional(),
|
|
1343
|
+
})
|
|
1344
|
+
.strict();
|
|
1345
|
+
//# sourceMappingURL=server.js.map
|