@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,1579 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import fsp from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { performance } from "node:perf_hooks";
|
|
6
|
+
import { languageExtensionPatterns, supportForFile } from "../languages.js";
|
|
7
|
+
import { loadWorkspaceConfig, resolveWorkspacePackage } from "../util/workspace.js";
|
|
8
|
+
import { DEFAULT_PROJECT_PATTERNS, discoverProjectFiles, listProjectFiles, } from "../util/projectFiles.js";
|
|
9
|
+
import { getGitHead, isGitRepo, getGitBlobHashes, listChangedFiles } from "../util/git.js";
|
|
10
|
+
import { clearImportResolutionCaches, resolveSpecifier } from "../util/resolution.js";
|
|
11
|
+
import { assertFilePathWithinRoot, fileIdentityKey, initializeFileIdentityCaseSensitivity, normalizePath, } from "../util/paths.js";
|
|
12
|
+
import { mapLimit } from "../util/concurrency.js";
|
|
13
|
+
import { resolveWorkerThreadCount } from "../util/workerThreads.js";
|
|
14
|
+
import { logWithLevel } from "../logging.js";
|
|
15
|
+
import { collectGraph } from "../graph-builder.js";
|
|
16
|
+
import { collectEdgesForFile } from "../graph-edge-collector.js";
|
|
17
|
+
import { buildGraphAdjacency } from "../graphs/adjacency.js";
|
|
18
|
+
import { isGraphOnlyLanguage } from "../documentLinks.js";
|
|
19
|
+
import { attemptParsePreparedFileContext } from "./parse-context.js";
|
|
20
|
+
import { ProjectedSyntaxTree } from "../native/projectedTree.js";
|
|
21
|
+
import { collectImportsForFile } from "./imports.js";
|
|
22
|
+
import { collectLocalsAndExportsFromSource } from "./locals-and-exports.js";
|
|
23
|
+
import { compareEdges, edgeKey, toRelativeEdge } from "./shared.js";
|
|
24
|
+
import { buildBloomFilterFromSource } from "../util/bloomFilter.js";
|
|
25
|
+
import { initNativeBackendReport } from "../native/nativeBackendReport.js";
|
|
26
|
+
import { closeDuplicateUnitCacheDatabase } from "../duplicates.js";
|
|
27
|
+
import { isNativeRequiredUnavailableError } from "../native/treeSitterNative.js";
|
|
28
|
+
import { isNodeSqliteUnavailableError } from "../sqlite-driver.js";
|
|
29
|
+
import { buildBloomFilterForFile, cacheSignatureForFile, closeDiskCacheDatabase, collectWorkspaceManifestDependencyEdges, computeConfigHash, createFallbackImportExtractionHandler, diffBuildOptions, fileSignature, graphOptionsEqual, initFileReport, initManifestReport, loadManifest, normalizeGraphOptions, normalizeIndexedFileInputs, normalizeLanguageExtensions, projectSnapshotFilesSignature, recordConfigHashResult, recordFileFailure, sanitizeManifestEntriesForRoot, sanitizeManifestTransientFilesForRoot, tryLoadFromCache, tryLoadPersistedBloomFilters, tryLoadProjectIndexSnapshot, verifyManifestEntries, writeProjectIndexSnapshot, writeToCache, } from "./build-cache.js";
|
|
30
|
+
import { cacheRoot } from "./build-cache/module-cache.js";
|
|
31
|
+
import { SymbolKind, } from "./types.js";
|
|
32
|
+
import { isNonNativeParserUnavailableError, isParserSyntaxTree } from "../parserBackend.js";
|
|
33
|
+
import { isUnsupportedParserInputError } from "../languages/filePrep.js";
|
|
34
|
+
import { buildSqlFactCache, buildSqlModuleIndex, sqlCorpusSignature } from "../sql/sourceGraph.js";
|
|
35
|
+
import { finalizeProjectIndex } from "./finalize.js";
|
|
36
|
+
import { toManifestFileEntry, writeIndexManifestSnapshot } from "./build-manifest.js";
|
|
37
|
+
import { prepareFileContextForBuild, setupWorkerPool, teardownWorkerPool, } from "./build-workers.js";
|
|
38
|
+
import { buildIncrementalGitDiffOptions, canUseIncrementalDiscoveryFastPath, collectDeletedTrackedFileDependents, collectTrackedFileDependents, isMissingGitRevisionError, listUntrackedProjectFiles, partitionTrackedManifestFiles, probePathExistence, } from "./incremental-plan.js";
|
|
39
|
+
import { parsedCacheMaxEntries, setParsedCacheEntry } from "./parsed-cache.js";
|
|
40
|
+
function initParserBackendDegradationReport(report) {
|
|
41
|
+
if (!report)
|
|
42
|
+
return undefined;
|
|
43
|
+
initNativeBackendReport(report);
|
|
44
|
+
report.backend ??= {
|
|
45
|
+
native: {
|
|
46
|
+
available: false,
|
|
47
|
+
enabled: false,
|
|
48
|
+
supportedLanguageIds: [],
|
|
49
|
+
filesUsed: 0,
|
|
50
|
+
filesFellBack: 0,
|
|
51
|
+
fallbackReasons: {
|
|
52
|
+
unavailable: 0,
|
|
53
|
+
unsupportedLanguage: 0,
|
|
54
|
+
queryFailure: 0,
|
|
55
|
+
},
|
|
56
|
+
byLanguage: {},
|
|
57
|
+
errors: [],
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
report.backend.parser ??= {
|
|
61
|
+
total: 0,
|
|
62
|
+
byLanguage: {},
|
|
63
|
+
files: [],
|
|
64
|
+
};
|
|
65
|
+
return report.backend.parser;
|
|
66
|
+
}
|
|
67
|
+
function recordParserBackendDegradation(report, entry) {
|
|
68
|
+
const parserReport = initParserBackendDegradationReport(report);
|
|
69
|
+
if (!parserReport)
|
|
70
|
+
return;
|
|
71
|
+
parserReport.total += 1;
|
|
72
|
+
parserReport.byLanguage[entry.languageId] = (parserReport.byLanguage[entry.languageId] ?? 0) + 1;
|
|
73
|
+
if (parserReport.files.length >= 20)
|
|
74
|
+
return;
|
|
75
|
+
parserReport.files.push(entry);
|
|
76
|
+
}
|
|
77
|
+
function createEmptyModuleIndex(file) {
|
|
78
|
+
return { file, exports: [], imports: [], locals: [] };
|
|
79
|
+
}
|
|
80
|
+
async function resolveCrossModuleSymbolExports(file, mod, support, projectRoot, graphOptions, workspaceConfig, logLevel) {
|
|
81
|
+
if (!support.supportsCrossModuleSymbols)
|
|
82
|
+
return;
|
|
83
|
+
if (support.id !== "ts" && support.id !== "js")
|
|
84
|
+
return;
|
|
85
|
+
const { matchPath } = await import("../util/resolution.js").then((mod) => mod.loadNearestTsconfigFor(file, projectRoot, logLevel));
|
|
86
|
+
for (const entry of mod.exports) {
|
|
87
|
+
if (entry.type !== "reexport" && entry.type !== "exportStar" && entry.type !== "namespaceReexport") {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (entry.fromModule.startsWith(".")) {
|
|
91
|
+
const resolved = await resolveSpecifier(file, entry.fromModule, projectRoot, matchPath, workspaceConfig, {
|
|
92
|
+
resolveNodeModules: !!graphOptions.resolveNodeModules,
|
|
93
|
+
...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
|
|
94
|
+
});
|
|
95
|
+
if (typeof resolved === "string")
|
|
96
|
+
entry.fromModule = resolved;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const pkgResolved = await resolveWorkspacePackage(entry.fromModule, workspaceConfig);
|
|
100
|
+
if (pkgResolved)
|
|
101
|
+
entry.fromModule = pkgResolved;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function buildIndexedModuleForFile(args) {
|
|
105
|
+
const prepared = await prepareFileContextForBuild(args.file, args.support, args.opts, args.workerSetup, args.report);
|
|
106
|
+
const { source, sup, nativeQueries, embeddedBlocks } = prepared;
|
|
107
|
+
let resolvedLang = prepared.lang;
|
|
108
|
+
let tree;
|
|
109
|
+
const graphOnlyLanguage = isGraphOnlyLanguage(sup.id);
|
|
110
|
+
if (prepared.syntaxTree) {
|
|
111
|
+
tree = new ProjectedSyntaxTree(source, prepared.syntaxTree);
|
|
112
|
+
}
|
|
113
|
+
else if (!nativeQueries && !graphOnlyLanguage && sup.id !== "sql") {
|
|
114
|
+
const parseAttempt = attemptParsePreparedFileContext(prepared);
|
|
115
|
+
const parsed = parseAttempt.parsed;
|
|
116
|
+
if (parsed) {
|
|
117
|
+
tree = parsed.tree;
|
|
118
|
+
resolvedLang = parsed.lang;
|
|
119
|
+
setParsedCacheEntry(args.parsedMap, args.file, parsed, args.parsedCacheMaxEntries);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
recordParserBackendDegradation(args.report, {
|
|
123
|
+
file: args.file,
|
|
124
|
+
languageId: prepared.sup.id,
|
|
125
|
+
...(parseAttempt.nativeFallbackReason ? { nativeFallbackReason: parseAttempt.nativeFallbackReason } : {}),
|
|
126
|
+
...(parseAttempt.nativeError ? { nativeError: parseAttempt.nativeError } : {}),
|
|
127
|
+
...(parseAttempt.jsError ? { jsError: parseAttempt.jsError } : {}),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (nativeQueries && !graphOnlyLanguage && sup.id !== "sql") {
|
|
132
|
+
// Worker returned queries without a tree (older path/fallback): reconstruct once.
|
|
133
|
+
const parseAttempt = attemptParsePreparedFileContext(prepared);
|
|
134
|
+
const parsed = parseAttempt.parsed;
|
|
135
|
+
if (parsed) {
|
|
136
|
+
tree = parsed.tree;
|
|
137
|
+
resolvedLang = parsed.lang ?? resolvedLang;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const lacksParserContext = !nativeQueries && !tree;
|
|
141
|
+
if (args.bloomFilterCache) {
|
|
142
|
+
const filter = buildBloomFilterFromSource(source, sup.id);
|
|
143
|
+
args.bloomFilterCache.set(args.file, filter);
|
|
144
|
+
}
|
|
145
|
+
const imports = sup.id === "sql"
|
|
146
|
+
? []
|
|
147
|
+
: await collectImportsForFile(args.file, args.projectRoot, {
|
|
148
|
+
source,
|
|
149
|
+
...(tree && isParserSyntaxTree(tree) ? { tree } : {}),
|
|
150
|
+
sup,
|
|
151
|
+
...(resolvedLang ? { lang: resolvedLang } : {}),
|
|
152
|
+
...(nativeQueries !== undefined ? { nativeQueries } : {}),
|
|
153
|
+
graphOptions: args.graphOptions,
|
|
154
|
+
...(args.opts?.native ? { native: args.opts.native } : {}),
|
|
155
|
+
...(args.opts?.logLevel ? { logLevel: args.opts.logLevel } : {}),
|
|
156
|
+
...(args.opts?.languageExtensions ? { languageExtensions: args.opts.languageExtensions } : {}),
|
|
157
|
+
...(args.onFallbackImportExtraction ? { onFallbackImportExtraction: args.onFallbackImportExtraction } : {}),
|
|
158
|
+
});
|
|
159
|
+
for (const block of embeddedBlocks ?? []) {
|
|
160
|
+
imports.push(...(await collectImportsForFile(args.file, args.projectRoot, {
|
|
161
|
+
source: block.source,
|
|
162
|
+
sup: block.sup,
|
|
163
|
+
graphOptions: args.graphOptions,
|
|
164
|
+
...(args.opts?.native ? { native: args.opts.native } : {}),
|
|
165
|
+
...(args.opts?.logLevel ? { logLevel: args.opts.logLevel } : {}),
|
|
166
|
+
...(args.opts?.languageExtensions ? { languageExtensions: args.opts.languageExtensions } : {}),
|
|
167
|
+
...(args.onFallbackImportExtraction ? { onFallbackImportExtraction: args.onFallbackImportExtraction } : {}),
|
|
168
|
+
})));
|
|
169
|
+
}
|
|
170
|
+
collectJsonDependencies(imports, args.jsonDependencies);
|
|
171
|
+
let mod;
|
|
172
|
+
if (sup.id === "sql") {
|
|
173
|
+
mod = buildSqlModuleIndex(args.file, source);
|
|
174
|
+
}
|
|
175
|
+
else if (lacksParserContext) {
|
|
176
|
+
mod = { ...createEmptyModuleIndex(args.file), imports };
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
mod = collectLocalsAndExportsFromSource(args.file, source, sup, resolvedLang, imports, {
|
|
180
|
+
...(tree ? { tree } : {}),
|
|
181
|
+
...(nativeQueries !== undefined ? { nativeQueries } : {}),
|
|
182
|
+
...(args.opts?.native ? { nativeMode: args.opts.native } : {}),
|
|
183
|
+
...(args.opts?.logLevel ? { logLevel: args.opts.logLevel } : {}),
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
mod.imports = imports;
|
|
187
|
+
await resolveCrossModuleSymbolExports(args.file, mod, sup, args.projectRoot, args.graphOptions, args.workspaceConfig, args.opts?.logLevel);
|
|
188
|
+
const sigInfo = args.fileSignatures.get(args.file);
|
|
189
|
+
const cacheable = !prepared.nativeFallbackReason && !lacksParserContext;
|
|
190
|
+
if (sigInfo && cacheable) {
|
|
191
|
+
const cacheSig = args.cacheEnabled
|
|
192
|
+
? await moduleCacheSignatureForFile(args.file, sigInfo, args.opts)
|
|
193
|
+
: sigInfo.cacheSig;
|
|
194
|
+
writeToCache(args.projectRoot, args.file, cacheSig, mod, args.opts);
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
module: mod,
|
|
198
|
+
graphContext: {
|
|
199
|
+
source,
|
|
200
|
+
sup,
|
|
201
|
+
...(resolvedLang ? { lang: resolvedLang } : {}),
|
|
202
|
+
...(nativeQueries !== undefined ? { nativeQueries } : {}),
|
|
203
|
+
...(tree ? { tree } : {}),
|
|
204
|
+
...(embeddedBlocks ? { embeddedBlocks } : {}),
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function isJsonFile(filePath) {
|
|
209
|
+
return filePath.toLowerCase().endsWith(".json");
|
|
210
|
+
}
|
|
211
|
+
function collectJsonDependencies(imports, bucket) {
|
|
212
|
+
for (const imp of imports) {
|
|
213
|
+
const resolved = typeof imp.resolved === "string" ? normalizePath(imp.resolved) : null;
|
|
214
|
+
if (resolved && isJsonFile(resolved))
|
|
215
|
+
bucket.set(fileIdentityKey(resolved), resolved);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function ensureJsonModule(modules, filePath) {
|
|
219
|
+
const resolved = path.resolve(filePath);
|
|
220
|
+
const normalized = normalizePath(resolved);
|
|
221
|
+
const key = fileIdentityKey(normalized);
|
|
222
|
+
if (modules.has(key))
|
|
223
|
+
return;
|
|
224
|
+
if (!fs.existsSync(resolved))
|
|
225
|
+
return;
|
|
226
|
+
const pos = { line: 1, column: 1, index: 0 };
|
|
227
|
+
const symbol = {
|
|
228
|
+
file: normalized,
|
|
229
|
+
localName: "default",
|
|
230
|
+
kind: SymbolKind.Default,
|
|
231
|
+
range: { start: pos, end: pos },
|
|
232
|
+
};
|
|
233
|
+
modules.set(key, {
|
|
234
|
+
file: normalized,
|
|
235
|
+
exports: [{ type: "local", exportedAs: "default", target: symbol }],
|
|
236
|
+
imports: [],
|
|
237
|
+
locals: [symbol],
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function graphEdgeKey(edge) {
|
|
241
|
+
const from = fileIdentityKey(edge.from);
|
|
242
|
+
const target = edge.to.type === "file" ? `file:${fileIdentityKey(edge.to.path)}` : `external:${edge.to.name}`;
|
|
243
|
+
return `${from}::${target}::${edge.raw ?? ""}::${edge.typeOnly ? 1 : 0}`;
|
|
244
|
+
}
|
|
245
|
+
async function moduleCacheSignatureForFile(file, sigInfo, opts) {
|
|
246
|
+
const baseSignature = await cacheSignatureForFile(file, sigInfo, opts);
|
|
247
|
+
const normalizedExtensions = normalizeLanguageExtensions(opts?.languageExtensions);
|
|
248
|
+
if (!normalizedExtensions)
|
|
249
|
+
return baseSignature;
|
|
250
|
+
// Combine via a hash rather than raw concatenation: the disk cache stores this string in a
|
|
251
|
+
// SQLite TEXT column, and node:sqlite's DatabaseSync silently truncates TEXT bind parameters
|
|
252
|
+
// at embedded NUL bytes, so a raw separator character risks the stored and freshly-computed
|
|
253
|
+
// signatures never matching (permanent cache miss) if either baseSignature or the serialized
|
|
254
|
+
// extensions ever contained one.
|
|
255
|
+
const hash = crypto.createHash("sha1");
|
|
256
|
+
hash.update(baseSignature);
|
|
257
|
+
hash.update(JSON.stringify(Object.entries(normalizedExtensions)));
|
|
258
|
+
return hash.digest("hex");
|
|
259
|
+
}
|
|
260
|
+
function projectPatternsForLanguageExtensions(opts) {
|
|
261
|
+
const customPatterns = languageExtensionPatterns(opts?.languageExtensions);
|
|
262
|
+
if (!customPatterns.length)
|
|
263
|
+
return undefined;
|
|
264
|
+
return [...DEFAULT_PROJECT_PATTERNS, ...customPatterns];
|
|
265
|
+
}
|
|
266
|
+
function expandStarImports(modules, opts) {
|
|
267
|
+
const expandedImportKey = (binding) => {
|
|
268
|
+
const typeOnly = binding.typeOnly ?? false;
|
|
269
|
+
if (binding.kind === "named") {
|
|
270
|
+
return JSON.stringify(["named", binding.from, binding.resolved, typeOnly, binding.local, binding.imported]);
|
|
271
|
+
}
|
|
272
|
+
if (binding.kind === "namespace") {
|
|
273
|
+
return JSON.stringify(["namespace", binding.from, binding.resolved, typeOnly, binding.localNS]);
|
|
274
|
+
}
|
|
275
|
+
return null;
|
|
276
|
+
};
|
|
277
|
+
for (const mod of modules.values()) {
|
|
278
|
+
const expandedImportKeys = new Set();
|
|
279
|
+
for (const existing of mod.imports) {
|
|
280
|
+
const key = expandedImportKey(existing);
|
|
281
|
+
if (key)
|
|
282
|
+
expandedImportKeys.add(key);
|
|
283
|
+
}
|
|
284
|
+
for (const imp of [...mod.imports]) {
|
|
285
|
+
if (imp.kind !== "star" || typeof imp.resolved !== "string")
|
|
286
|
+
continue;
|
|
287
|
+
const target = modules.get(fileIdentityKey(imp.resolved));
|
|
288
|
+
if (!target)
|
|
289
|
+
continue;
|
|
290
|
+
const targetSupport = supportForFile(imp.resolved, opts?.languageExtensions);
|
|
291
|
+
const exportedSymbols = target.exports.filter((entry) => entry.type === "local").length
|
|
292
|
+
? target.exports
|
|
293
|
+
.filter((entry) => entry.type === "local")
|
|
294
|
+
.map((entry) => entry.target)
|
|
295
|
+
: target.locals.filter((local) => !local.localName.startsWith("_"));
|
|
296
|
+
const seen = new Set();
|
|
297
|
+
for (const symbol of exportedSymbols) {
|
|
298
|
+
if (!symbol.localName || seen.has(symbol.localName))
|
|
299
|
+
continue;
|
|
300
|
+
seen.add(symbol.localName);
|
|
301
|
+
const treatAsNamespace = targetSupport?.id === "ruby" && symbol.kind === SymbolKind.Class;
|
|
302
|
+
const expandedImport = treatAsNamespace
|
|
303
|
+
? {
|
|
304
|
+
kind: "namespace",
|
|
305
|
+
localNS: symbol.localName,
|
|
306
|
+
from: imp.from,
|
|
307
|
+
resolved: imp.resolved,
|
|
308
|
+
...(imp.typeOnly !== undefined ? { typeOnly: imp.typeOnly } : {}),
|
|
309
|
+
}
|
|
310
|
+
: {
|
|
311
|
+
kind: "named",
|
|
312
|
+
local: symbol.localName,
|
|
313
|
+
imported: symbol.localName,
|
|
314
|
+
from: imp.from,
|
|
315
|
+
resolved: imp.resolved,
|
|
316
|
+
...(imp.typeOnly !== undefined ? { typeOnly: imp.typeOnly } : {}),
|
|
317
|
+
};
|
|
318
|
+
const expandedImportKeyValue = expandedImportKey(expandedImport);
|
|
319
|
+
if (!expandedImportKeyValue || expandedImportKeys.has(expandedImportKeyValue))
|
|
320
|
+
continue;
|
|
321
|
+
expandedImportKeys.add(expandedImportKeyValue);
|
|
322
|
+
mod.imports.push(expandedImport);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function toProjectIndexManifestEntry(entry) {
|
|
328
|
+
return {
|
|
329
|
+
sig: entry.sig,
|
|
330
|
+
...(entry.gitSig ? { gitSig: entry.gitSig } : {}),
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function projectIndexManifestEntries(entries) {
|
|
334
|
+
return new Map(Array.from(entries, ([file, entry]) => [file, toProjectIndexManifestEntry(entry)]));
|
|
335
|
+
}
|
|
336
|
+
function createIndexBuildRunState(projectRoot, opts, graphOptions = normalizeGraphOptions(opts?.graph)) {
|
|
337
|
+
const report = opts?.report;
|
|
338
|
+
if (report)
|
|
339
|
+
initNativeBackendReport(report);
|
|
340
|
+
const cacheMode = opts?.cache ?? "off";
|
|
341
|
+
return {
|
|
342
|
+
normalizedProjectRoot: normalizePath(projectRoot),
|
|
343
|
+
report,
|
|
344
|
+
timings: report?.timings,
|
|
345
|
+
totalStart: performance.now(),
|
|
346
|
+
cacheMode,
|
|
347
|
+
cacheEnabled: cacheMode !== "off",
|
|
348
|
+
graphOptions,
|
|
349
|
+
onFallbackImportExtraction: createFallbackImportExtractionHandler(report, opts),
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
function emitIndexLifecycleProgress(opts, phase, mode, total, elapsedMs) {
|
|
353
|
+
let message = "Index ready";
|
|
354
|
+
if (phase === "start") {
|
|
355
|
+
const action = mode === "build" ? "Building" : "Updating";
|
|
356
|
+
message = `${action} project index`;
|
|
357
|
+
}
|
|
358
|
+
opts?.onProgress?.({
|
|
359
|
+
type: "progress",
|
|
360
|
+
phase,
|
|
361
|
+
mode,
|
|
362
|
+
message,
|
|
363
|
+
current: phase === "complete" ? total : 0,
|
|
364
|
+
total,
|
|
365
|
+
...(elapsedMs !== undefined ? { elapsedMs } : {}),
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function buildConcurrency(opts) {
|
|
369
|
+
return resolveWorkerThreadCount({ requested: Number(opts?.threads || 0), defaultCount: 8, max: 64 });
|
|
370
|
+
}
|
|
371
|
+
async function prepareFileSignatures(args) {
|
|
372
|
+
const entries = await mapLimit(args.files, args.concurrency, async (file) => {
|
|
373
|
+
const gitSig = args.gitSigMap.get(file);
|
|
374
|
+
const sigInfo = await fileSignature(file, args.opts?.cacheStrict, gitSig, {
|
|
375
|
+
forceContentHash: args.cacheEnabled && !gitSig,
|
|
376
|
+
});
|
|
377
|
+
return [file, sigInfo];
|
|
378
|
+
});
|
|
379
|
+
return new Map(entries);
|
|
380
|
+
}
|
|
381
|
+
async function buildProjectIndexFromExport(projectRoot, opts, helperOpts) {
|
|
382
|
+
return buildProjectIndexWithManifestOptions(projectRoot, opts, helperOpts);
|
|
383
|
+
}
|
|
384
|
+
async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperOpts) {
|
|
385
|
+
clearImportResolutionCaches();
|
|
386
|
+
await initializeFileIdentityCaseSensitivity(projectRoot);
|
|
387
|
+
const { normalizedProjectRoot, report, timings, totalStart, cacheMode, cacheEnabled, graphOptions, onFallbackImportExtraction, } = createIndexBuildRunState(projectRoot, opts);
|
|
388
|
+
const manifestMode = helperOpts?.manifestMode ?? "off";
|
|
389
|
+
const useManifest = manifestMode !== "off";
|
|
390
|
+
const shouldWriteManifest = manifestMode === "read-write";
|
|
391
|
+
const projectFiles = helperOpts?.projectFiles;
|
|
392
|
+
initManifestReport(report, useManifest, false);
|
|
393
|
+
const normalizedFiles = Array.from(new Set(normalizeIndexedFileInputs(projectRoot, rawFiles ?? [], "Index file")));
|
|
394
|
+
if (!normalizedFiles.length && helperOpts?.warnNoFilesMessage) {
|
|
395
|
+
logWithLevel(opts?.logLevel, "warn", helperOpts.warnNoFilesMessage);
|
|
396
|
+
}
|
|
397
|
+
const fileReport = initFileReport(report);
|
|
398
|
+
if (fileReport)
|
|
399
|
+
fileReport.total = normalizedFiles.length;
|
|
400
|
+
const manifestStart = performance.now();
|
|
401
|
+
const manifest = useManifest && !helperOpts?.ignoreExistingManifest ? await loadManifest(projectRoot, opts) : null;
|
|
402
|
+
const manifestFiles = sanitizeManifestEntriesForRoot(projectRoot, manifest?.files);
|
|
403
|
+
const manifestOptionDiffs = manifest ? diffBuildOptions(manifest.buildOptions, opts) : [];
|
|
404
|
+
const languageExtensionsChanged = manifestOptionDiffs.includes("languageExtensions");
|
|
405
|
+
const implementationChanged = manifestOptionDiffs.includes("implementation");
|
|
406
|
+
if (timings && useManifest) {
|
|
407
|
+
timings.manifestMs = Math.round(performance.now() - manifestStart);
|
|
408
|
+
}
|
|
409
|
+
const edgeProbeConcurrency = buildConcurrency(opts);
|
|
410
|
+
const staleCachedEdgeFiles = new Set();
|
|
411
|
+
if (manifest) {
|
|
412
|
+
const edgeTargetPaths = [];
|
|
413
|
+
for (const entry of Object.values(manifestFiles)) {
|
|
414
|
+
for (const edge of entry.edges) {
|
|
415
|
+
if (edge.to.type === "file")
|
|
416
|
+
edgeTargetPaths.push(edge.to.path);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
const edgeTargetExistence = await probePathExistence(edgeTargetPaths, edgeProbeConcurrency);
|
|
420
|
+
for (const [file, entry] of Object.entries(manifestFiles)) {
|
|
421
|
+
if (entry.edges.some((edge) => edge.to.type === "file" && !edgeTargetExistence.get(edge.to.path))) {
|
|
422
|
+
staleCachedEdgeFiles.add(file);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
const cachedGraphEntries = manifest &&
|
|
427
|
+
!languageExtensionsChanged &&
|
|
428
|
+
!implementationChanged &&
|
|
429
|
+
graphOptionsEqual(manifest.graphOptions, graphOptions)
|
|
430
|
+
? new Map(Object.entries(manifestFiles).filter(([file]) => !staleCachedEdgeFiles.has(file)))
|
|
431
|
+
: undefined;
|
|
432
|
+
if (report?.manifest) {
|
|
433
|
+
report.manifest.reused = !!cachedGraphEntries;
|
|
434
|
+
}
|
|
435
|
+
const manifestEntries = shouldWriteManifest ? new Map() : undefined;
|
|
436
|
+
const manifestEntriesForIndex = useManifest
|
|
437
|
+
? projectIndexManifestEntries(cachedGraphEntries ?? [])
|
|
438
|
+
: new Map();
|
|
439
|
+
const modules = new Map();
|
|
440
|
+
const gitAvailable = await isGitRepo(projectRoot);
|
|
441
|
+
const useGitSignatures = gitAvailable && (cacheMode !== "off" || opts?.cacheStrict);
|
|
442
|
+
const gitSigMap = useGitSignatures
|
|
443
|
+
? await getGitBlobHashes(projectRoot, normalizedFiles, {
|
|
444
|
+
gitAvailable,
|
|
445
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
446
|
+
})
|
|
447
|
+
: new Map();
|
|
448
|
+
const conc = edgeProbeConcurrency;
|
|
449
|
+
const languageExtensions = normalizeLanguageExtensions(opts?.languageExtensions);
|
|
450
|
+
const sqlFiles = normalizedFiles
|
|
451
|
+
.filter((file) => {
|
|
452
|
+
if (!languageExtensions)
|
|
453
|
+
return path.extname(file).toLowerCase() === ".sql";
|
|
454
|
+
return supportForFile(file, languageExtensions)?.id === "sql";
|
|
455
|
+
})
|
|
456
|
+
.sort((left, right) => left.localeCompare(right));
|
|
457
|
+
const fileSignatures = await prepareFileSignatures({
|
|
458
|
+
files: sqlFiles,
|
|
459
|
+
opts,
|
|
460
|
+
gitSigMap,
|
|
461
|
+
cacheEnabled,
|
|
462
|
+
concurrency: conc,
|
|
463
|
+
});
|
|
464
|
+
const sqlCorpusSig = sqlCorpusSignature(sqlFiles, fileSignatures);
|
|
465
|
+
let sqlFactCachePromise;
|
|
466
|
+
const getSqlFactCache = () => {
|
|
467
|
+
sqlFactCachePromise ??= buildSqlFactCache(normalizedFiles, opts?.languageExtensions);
|
|
468
|
+
return sqlFactCachePromise;
|
|
469
|
+
};
|
|
470
|
+
const shouldProvideSqlFactCache = (file, sigInfo, cachedEdgesEntry) => {
|
|
471
|
+
if (supportForFile(file, opts?.languageExtensions)?.id !== "sql")
|
|
472
|
+
return false;
|
|
473
|
+
if (!cachedEdgesEntry || !sqlCorpusSig || cachedEdgesEntry.sqlCorpusSig !== sqlCorpusSig)
|
|
474
|
+
return true;
|
|
475
|
+
const matchesGitSig = !!sigInfo.gitSig && !!cachedEdgesEntry.gitSig && cachedEdgesEntry.gitSig === sigInfo.gitSig;
|
|
476
|
+
return !(matchesGitSig || cachedEdgesEntry.sig === sigInfo.sig);
|
|
477
|
+
};
|
|
478
|
+
const jsonDependencies = new Map();
|
|
479
|
+
const workerSetup = await setupWorkerPool(opts, normalizedFiles.length);
|
|
480
|
+
try {
|
|
481
|
+
const useBloomFilters = opts?.useBloomFilters ?? true;
|
|
482
|
+
const bloomFilterCache = useBloomFilters
|
|
483
|
+
? new (await import("../util/bloomFilter.js")).BloomFilterCache()
|
|
484
|
+
: undefined;
|
|
485
|
+
const persistedBloomFilters = bloomFilterCache ? await tryLoadPersistedBloomFilters(projectRoot, opts) : null;
|
|
486
|
+
const parsedMap = new Map();
|
|
487
|
+
const workspaceConfig = await loadWorkspaceConfig(projectRoot);
|
|
488
|
+
const parseStart = performance.now();
|
|
489
|
+
const graph = { nodes: new Set(normalizedFiles), edges: [] };
|
|
490
|
+
const onFileEdges = manifestEntries
|
|
491
|
+
? (file, entry) => {
|
|
492
|
+
const manifestEntry = toManifestFileEntry(entry);
|
|
493
|
+
if (!manifestEntry)
|
|
494
|
+
return;
|
|
495
|
+
manifestEntries.set(file, manifestEntry);
|
|
496
|
+
}
|
|
497
|
+
: undefined;
|
|
498
|
+
let processedFiles = 0;
|
|
499
|
+
const totalFiles = normalizedFiles.length;
|
|
500
|
+
let buildStartedAt;
|
|
501
|
+
const ensureBuildProgressStarted = () => {
|
|
502
|
+
if (buildStartedAt !== undefined)
|
|
503
|
+
return;
|
|
504
|
+
buildStartedAt = performance.now();
|
|
505
|
+
emitIndexLifecycleProgress(opts, "start", "build", totalFiles);
|
|
506
|
+
};
|
|
507
|
+
const fileResults = await mapLimit(normalizedFiles, conc, async (file) => {
|
|
508
|
+
try {
|
|
509
|
+
let sigInfo = fileSignatures.get(file);
|
|
510
|
+
if (!sigInfo) {
|
|
511
|
+
const gitSig = gitSigMap.get(file);
|
|
512
|
+
sigInfo = await fileSignature(file, opts?.cacheStrict, gitSig, {
|
|
513
|
+
forceContentHash: cacheEnabled && !gitSig,
|
|
514
|
+
});
|
|
515
|
+
fileSignatures.set(file, sigInfo);
|
|
516
|
+
}
|
|
517
|
+
manifestEntriesForIndex.set(file, toProjectIndexManifestEntry(sigInfo));
|
|
518
|
+
if (manifestEntries) {
|
|
519
|
+
const initialManifestEntry = toManifestFileEntry({ ...sigInfo, edges: [] });
|
|
520
|
+
if (initialManifestEntry)
|
|
521
|
+
manifestEntries.set(file, initialManifestEntry);
|
|
522
|
+
}
|
|
523
|
+
const cacheSig = cacheEnabled ? await moduleCacheSignatureForFile(file, sigInfo, opts) : sigInfo.cacheSig;
|
|
524
|
+
let mod = cacheEnabled ? tryLoadFromCache(projectRoot, file, cacheSig, opts, report) : null;
|
|
525
|
+
if (mod && fileReport) {
|
|
526
|
+
fileReport.cached = (fileReport.cached ?? 0) + 1;
|
|
527
|
+
}
|
|
528
|
+
const cachedEdgesEntry = cachedGraphEntries?.get(file);
|
|
529
|
+
const edgesCached = !!cachedEdgesEntry &&
|
|
530
|
+
((cachedEdgesEntry.gitSig && cachedEdgesEntry.gitSig === sigInfo.gitSig) ||
|
|
531
|
+
cachedEdgesEntry.sig === sigInfo.sig);
|
|
532
|
+
const sqlFactCache = shouldProvideSqlFactCache(file, sigInfo, cachedEdgesEntry)
|
|
533
|
+
? await getSqlFactCache()
|
|
534
|
+
: undefined;
|
|
535
|
+
let edges = [];
|
|
536
|
+
if (mod && edgesCached) {
|
|
537
|
+
edges = await collectEdgesForFile(file, projectRoot, workspaceConfig, {
|
|
538
|
+
fast: !!graphOptions.fast,
|
|
539
|
+
...(graphOptions.fastRegexDisabledLanguages
|
|
540
|
+
? { fastRegexDisabledLanguages: graphOptions.fastRegexDisabledLanguages }
|
|
541
|
+
: {}),
|
|
542
|
+
resolveNodeModules: !!graphOptions.resolveNodeModules,
|
|
543
|
+
dynamicImportHeuristics: !!graphOptions.dynamicImportHeuristics,
|
|
544
|
+
...(opts?.native ? { native: opts.native } : {}),
|
|
545
|
+
...(opts?.languageExtensions ? { languageExtensions: opts.languageExtensions } : {}),
|
|
546
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
547
|
+
...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
|
|
548
|
+
fileSignature: sigInfo,
|
|
549
|
+
...(sqlCorpusSig ? { sqlCorpusSig } : {}),
|
|
550
|
+
...(cachedEdgesEntry ? { cachedFileEdges: cachedEdgesEntry } : {}),
|
|
551
|
+
...(manifest?.projectRoot ? { cachedFileEdgesProjectRoot: manifest.projectRoot } : {}),
|
|
552
|
+
...(onFileEdges ? { onFileEdges } : {}),
|
|
553
|
+
...(onFallbackImportExtraction ? { onFallbackImportExtraction } : {}),
|
|
554
|
+
allFiles: normalizedFiles,
|
|
555
|
+
...(sqlFactCache ? { sqlFactCache } : {}),
|
|
556
|
+
});
|
|
557
|
+
if (bloomFilterCache) {
|
|
558
|
+
const persistedFilter = persistedBloomFilters?.get(file);
|
|
559
|
+
if (persistedFilter) {
|
|
560
|
+
bloomFilterCache.set(file, persistedFilter);
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
const filter = await buildBloomFilterForFile(file, opts);
|
|
564
|
+
if (filter)
|
|
565
|
+
bloomFilterCache.set(file, filter);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return [file, mod, edges];
|
|
569
|
+
}
|
|
570
|
+
if (fileReport)
|
|
571
|
+
fileReport.parsed = (fileReport.parsed ?? 0) + 1;
|
|
572
|
+
const support = supportForFile(file, opts?.languageExtensions);
|
|
573
|
+
if (!support)
|
|
574
|
+
return [file, createEmptyModuleIndex(file), []];
|
|
575
|
+
ensureBuildProgressStarted();
|
|
576
|
+
let graphContext;
|
|
577
|
+
if (!mod) {
|
|
578
|
+
const built = await buildIndexedModuleForFile({
|
|
579
|
+
file,
|
|
580
|
+
support,
|
|
581
|
+
projectRoot,
|
|
582
|
+
opts,
|
|
583
|
+
report,
|
|
584
|
+
graphOptions,
|
|
585
|
+
workspaceConfig,
|
|
586
|
+
workerSetup,
|
|
587
|
+
parsedMap,
|
|
588
|
+
parsedCacheMaxEntries: parsedCacheMaxEntries(opts),
|
|
589
|
+
jsonDependencies,
|
|
590
|
+
bloomFilterCache,
|
|
591
|
+
onFallbackImportExtraction,
|
|
592
|
+
fileSignatures,
|
|
593
|
+
cacheEnabled,
|
|
594
|
+
});
|
|
595
|
+
mod = built.module;
|
|
596
|
+
graphContext = built.graphContext;
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
collectJsonDependencies(mod.imports, jsonDependencies);
|
|
600
|
+
}
|
|
601
|
+
edges = await collectEdgesForFile(file, projectRoot, workspaceConfig, {
|
|
602
|
+
...(graphContext ? { parsed: graphContext } : {}),
|
|
603
|
+
fast: !!graphOptions.fast,
|
|
604
|
+
...(graphOptions.fastRegexDisabledLanguages
|
|
605
|
+
? { fastRegexDisabledLanguages: graphOptions.fastRegexDisabledLanguages }
|
|
606
|
+
: {}),
|
|
607
|
+
resolveNodeModules: !!graphOptions.resolveNodeModules,
|
|
608
|
+
dynamicImportHeuristics: !!graphOptions.dynamicImportHeuristics,
|
|
609
|
+
...(opts?.native ? { native: opts.native } : {}),
|
|
610
|
+
...(opts?.languageExtensions ? { languageExtensions: opts.languageExtensions } : {}),
|
|
611
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
612
|
+
...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
|
|
613
|
+
fileSignature: sigInfo,
|
|
614
|
+
...(sqlCorpusSig ? { sqlCorpusSig } : {}),
|
|
615
|
+
...(cachedEdgesEntry ? { cachedFileEdges: cachedEdgesEntry } : {}),
|
|
616
|
+
...(manifest?.projectRoot ? { cachedFileEdgesProjectRoot: manifest.projectRoot } : {}),
|
|
617
|
+
...(onFileEdges ? { onFileEdges } : {}),
|
|
618
|
+
...(onFallbackImportExtraction ? { onFallbackImportExtraction } : {}),
|
|
619
|
+
allFiles: normalizedFiles,
|
|
620
|
+
...(sqlFactCache ? { sqlFactCache } : {}),
|
|
621
|
+
});
|
|
622
|
+
return [file, mod ?? createEmptyModuleIndex(file), edges];
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
if (isNativeRequiredUnavailableError(error) || isNodeSqliteUnavailableError(error))
|
|
626
|
+
throw error;
|
|
627
|
+
if (isUnsupportedParserInputError(error) || isNonNativeParserUnavailableError(error)) {
|
|
628
|
+
return [file, createEmptyModuleIndex(file), []];
|
|
629
|
+
}
|
|
630
|
+
recordFileFailure(report, file, error);
|
|
631
|
+
logWithLevel(opts?.logLevel, "warn", `Warning: Failed to process file ${file}:`, error);
|
|
632
|
+
return [file, createEmptyModuleIndex(file), []];
|
|
633
|
+
}
|
|
634
|
+
finally {
|
|
635
|
+
processedFiles += 1;
|
|
636
|
+
if (opts?.onProgress && buildStartedAt !== undefined) {
|
|
637
|
+
opts.onProgress({
|
|
638
|
+
type: "progress",
|
|
639
|
+
phase: "update",
|
|
640
|
+
mode: "build",
|
|
641
|
+
message: `Indexed ${file}`,
|
|
642
|
+
current: processedFiles,
|
|
643
|
+
total: totalFiles,
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
if (timings)
|
|
649
|
+
timings.parseMs = Math.round(performance.now() - parseStart);
|
|
650
|
+
const graphStart = performance.now();
|
|
651
|
+
const seenGraphEdges = new Set();
|
|
652
|
+
const appendUniqueGraphEdges = (edges) => {
|
|
653
|
+
if (!edges.length)
|
|
654
|
+
return;
|
|
655
|
+
for (const edge of edges) {
|
|
656
|
+
const key = graphEdgeKey(edge);
|
|
657
|
+
if (seenGraphEdges.has(key))
|
|
658
|
+
continue;
|
|
659
|
+
seenGraphEdges.add(key);
|
|
660
|
+
graph.edges.push(edge);
|
|
661
|
+
if (edge.to.type === "file")
|
|
662
|
+
graph.nodes.add(edge.to.path);
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
for (const [file, mod, edges] of fileResults) {
|
|
666
|
+
modules.set(fileIdentityKey(file), mod);
|
|
667
|
+
appendUniqueGraphEdges(edges);
|
|
668
|
+
}
|
|
669
|
+
const workspaceManifestEdges = await collectWorkspaceManifestDependencyEdges(projectRoot, opts?.discovery, new Set(normalizedFiles), opts?.logLevel);
|
|
670
|
+
appendUniqueGraphEdges(workspaceManifestEdges);
|
|
671
|
+
if (timings)
|
|
672
|
+
timings.graphMs = Math.round(performance.now() - graphStart);
|
|
673
|
+
for (const jsonPath of jsonDependencies.values()) {
|
|
674
|
+
ensureJsonModule(modules, jsonPath);
|
|
675
|
+
}
|
|
676
|
+
expandStarImports(modules, opts);
|
|
677
|
+
if (manifestEntries) {
|
|
678
|
+
await writeIndexManifestSnapshot({
|
|
679
|
+
projectRoot,
|
|
680
|
+
opts,
|
|
681
|
+
graphOptions,
|
|
682
|
+
files: manifestEntries,
|
|
683
|
+
timings,
|
|
684
|
+
manifestReport: report?.manifest,
|
|
685
|
+
...(helperOpts?.transientFiles !== undefined ? { transientFiles: helperOpts.transientFiles } : {}),
|
|
686
|
+
...(helperOpts?.symlinkDirectories !== undefined ? { symlinkDirectories: helperOpts.symlinkDirectories } : {}),
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
const index = await finalizeProjectIndex({
|
|
690
|
+
projectRoot,
|
|
691
|
+
normalizedProjectRoot,
|
|
692
|
+
opts,
|
|
693
|
+
timings,
|
|
694
|
+
totalStart,
|
|
695
|
+
graph,
|
|
696
|
+
modules,
|
|
697
|
+
parsedMap,
|
|
698
|
+
bloomFilterCache,
|
|
699
|
+
...(projectFiles !== undefined ? { projectFiles } : {}),
|
|
700
|
+
buildReport: report,
|
|
701
|
+
manifestEntries: manifestEntriesForIndex,
|
|
702
|
+
});
|
|
703
|
+
if (manifestEntries) {
|
|
704
|
+
await writeProjectIndexSnapshot(projectRoot, opts, index, projectSnapshotFilesSignature(manifestEntries));
|
|
705
|
+
}
|
|
706
|
+
if (buildStartedAt !== undefined) {
|
|
707
|
+
emitIndexLifecycleProgress(opts, "complete", "build", index.byFile.size, performance.now() - buildStartedAt);
|
|
708
|
+
}
|
|
709
|
+
return index;
|
|
710
|
+
}
|
|
711
|
+
finally {
|
|
712
|
+
await teardownWorkerPool(workerSetup, report);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
async function buildProjectIndexWithManifestOptions(projectRoot, opts, helperOpts) {
|
|
716
|
+
await initializeFileIdentityCaseSensitivity(projectRoot);
|
|
717
|
+
try {
|
|
718
|
+
const useDiskCache = (opts?.cache ?? "off") === "disk";
|
|
719
|
+
// With disk caching enabled, reuse the previous full scan's symlinked-directory
|
|
720
|
+
// list so the file-discovery and project-file walks below can skip their own
|
|
721
|
+
// full-tree symlink probe. Off and memory modes never read or write this disk
|
|
722
|
+
// manifest, keeping read-only builds from mutating the project root. A missing or
|
|
723
|
+
// unusable manifest falls back to probing once.
|
|
724
|
+
// A symlink hint never expires on its own: `knownSymlinkDirectories` disables probing entirely, so
|
|
725
|
+
// a directory symlinked in after the hint was recorded (e.g. `npm link`) would
|
|
726
|
+
// otherwise never be discovered. `--cache-strict`/`--cache-verify` are explicit asks
|
|
727
|
+
// for maximum correctness over speed, so both force a fresh probe here too.
|
|
728
|
+
const wantsMaxSymlinkCorrectness = !!opts?.cacheStrict || !!opts?.cacheVerify;
|
|
729
|
+
const symlinkHintManifest = helperOpts?.ignoreExistingManifest || wantsMaxSymlinkCorrectness || !useDiskCache
|
|
730
|
+
? null
|
|
731
|
+
: await loadManifest(projectRoot, opts);
|
|
732
|
+
const knownSymlinkDirectories = symlinkHintManifest?.symlinkDirectories;
|
|
733
|
+
let discoveredSymlinkDirectories = knownSymlinkDirectories;
|
|
734
|
+
const onSymlinkDirectoriesDiscovered = (directories) => {
|
|
735
|
+
discoveredSymlinkDirectories = Array.from(directories);
|
|
736
|
+
};
|
|
737
|
+
// When the hint is unknown, listProjectFiles() and discoverProjectFiles() must run
|
|
738
|
+
// sequentially rather than in Promise.all: both would otherwise start their own
|
|
739
|
+
// full-tree symlink probe concurrently, since the callback only reports back after
|
|
740
|
+
// listProjectFiles() resolves, too late to inform a probe discoverProjectFiles()
|
|
741
|
+
// already started on its own. Sequencing costs a little parallelism on that one
|
|
742
|
+
// cold-start case, but avoids paying for two full-tree walks instead of one. Once a
|
|
743
|
+
// hint is known (the common warm case), both calls skip probing entirely, so running
|
|
744
|
+
// them sequentially here costs no meaningful time either way.
|
|
745
|
+
const discoveredFiles = await listProjectFiles(projectRoot, projectPatternsForLanguageExtensions(opts), {
|
|
746
|
+
...opts?.discovery,
|
|
747
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
748
|
+
...(knownSymlinkDirectories !== undefined ? { knownSymlinkDirectories } : {}),
|
|
749
|
+
onSymlinkDirectoriesDiscovered,
|
|
750
|
+
});
|
|
751
|
+
const additionalFileCandidates = normalizeIndexedFileInputs(projectRoot, opts?.additionalFiles ?? [], "Additional index file");
|
|
752
|
+
const additionalFileExistence = await probePathExistence(additionalFileCandidates, buildConcurrency(opts));
|
|
753
|
+
const additionalFiles = additionalFileCandidates.filter((file) => additionalFileExistence.get(file));
|
|
754
|
+
const discoveredFileSet = new Set(discoveredFiles);
|
|
755
|
+
const files = Array.from(new Set([...discoveredFiles, ...additionalFiles]));
|
|
756
|
+
const transientFiles = additionalFiles.filter((file) => !discoveredFileSet.has(file));
|
|
757
|
+
const projectFiles = await discoverProjectFiles(projectRoot, {
|
|
758
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
759
|
+
...(discoveredSymlinkDirectories !== undefined ? { knownSymlinkDirectories: discoveredSymlinkDirectories } : {}),
|
|
760
|
+
});
|
|
761
|
+
return await buildIndexFromFileListShared(projectRoot, files, opts, {
|
|
762
|
+
manifestMode: useDiskCache ? "read-write" : "off",
|
|
763
|
+
warnNoFilesMessage: `Warning: No files found in project root: ${projectRoot}. Check codegraph.config.json globs and CLI --include-glob/--ignore-glob filters. Diagnostic: codegraph doctor`,
|
|
764
|
+
...(helperOpts?.ignoreExistingManifest ? { ignoreExistingManifest: true } : {}),
|
|
765
|
+
projectFiles,
|
|
766
|
+
transientFiles,
|
|
767
|
+
...(discoveredSymlinkDirectories !== undefined ? { symlinkDirectories: discoveredSymlinkDirectories } : {}),
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
finally {
|
|
771
|
+
if ((opts?.cache ?? "off") === "disk") {
|
|
772
|
+
closeDiskCacheDatabase(projectRoot, opts);
|
|
773
|
+
closeDuplicateUnitCacheDatabase(projectRoot, opts);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Build a complete project index for a repo root.
|
|
779
|
+
*
|
|
780
|
+
* The returned index contains the file dependency graph, per-file module indexes,
|
|
781
|
+
* symbol definitions, imports, exports, and project-file metadata. Build it once
|
|
782
|
+
* and pass it to navigation, review, impact, or agent-tool APIs when composing
|
|
783
|
+
* deterministic packets from the same repo snapshot.
|
|
784
|
+
*/
|
|
785
|
+
export async function buildProjectIndex(projectRoot, opts) {
|
|
786
|
+
return buildProjectIndexWithManifestOptions(projectRoot, opts);
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Build a project index from an explicit file list.
|
|
790
|
+
*
|
|
791
|
+
* Use this when a caller already has a scoped manifest, sparse checkout, or
|
|
792
|
+
* deterministic pack boundary and does not want Codegraph to discover every file
|
|
793
|
+
* under the project root.
|
|
794
|
+
*/
|
|
795
|
+
export async function buildProjectIndexFromFiles(projectRoot, inputFiles, opts) {
|
|
796
|
+
try {
|
|
797
|
+
const useDiskCache = (opts?.cache ?? "off") === "disk";
|
|
798
|
+
return await buildIndexFromFileListShared(projectRoot, inputFiles, opts, {
|
|
799
|
+
manifestMode: useDiskCache ? "read-only" : "off",
|
|
800
|
+
warnNoFilesMessage: `Warning: No files provided for indexing in ${projectRoot}. Check the explicit file list and include/ignore filters. Diagnostic: codegraph doctor`,
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
finally {
|
|
804
|
+
if ((opts?.cache ?? "off") === "disk") {
|
|
805
|
+
closeDiskCacheDatabase(projectRoot, opts);
|
|
806
|
+
closeDuplicateUnitCacheDatabase(projectRoot, opts);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Build exactly the file list a caller declared as the current project scope.
|
|
812
|
+
*
|
|
813
|
+
* Identical to {@link buildProjectIndexFromFiles} except that an empty list is a valid
|
|
814
|
+
* query result (a scope whose filters matched nothing), not the missing-file-list operator
|
|
815
|
+
* error that variant warns about. The manifest stays read-only either way, so a scoped
|
|
816
|
+
* build never rewrites project-wide state.
|
|
817
|
+
*/
|
|
818
|
+
async function buildDeclaredScopeIndex(projectRoot, scopeFiles, opts) {
|
|
819
|
+
try {
|
|
820
|
+
const useDiskCache = (opts?.cache ?? "off") === "disk";
|
|
821
|
+
return await buildIndexFromFileListShared(projectRoot, [...scopeFiles], opts, {
|
|
822
|
+
manifestMode: useDiskCache ? "read-only" : "off",
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
finally {
|
|
826
|
+
if ((opts?.cache ?? "off") === "disk") {
|
|
827
|
+
closeDiskCacheDatabase(projectRoot, opts);
|
|
828
|
+
closeDuplicateUnitCacheDatabase(projectRoot, opts);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Build or refresh a project index using the on-disk manifest when available.
|
|
834
|
+
*
|
|
835
|
+
* Incremental options can target explicit files, `changedSince`, or a
|
|
836
|
+
* `gitBase`/`gitHead` range. `gitHead` accepts `WORKTREE`, `STAGED`, and `INDEX`
|
|
837
|
+
* sentinels for review-agent workflows that analyze uncommitted changes.
|
|
838
|
+
*/
|
|
839
|
+
export async function buildProjectIndexIncremental(projectRoot, opts) {
|
|
840
|
+
await initializeFileIdentityCaseSensitivity(projectRoot);
|
|
841
|
+
clearImportResolutionCaches();
|
|
842
|
+
const graphOptions = normalizeGraphOptions(opts?.graph);
|
|
843
|
+
const strictIncremental = opts?.incrementalStrict ?? false;
|
|
844
|
+
if (strictIncremental && graphOptions.fast)
|
|
845
|
+
graphOptions.fast = false;
|
|
846
|
+
const { normalizedProjectRoot, report, timings, totalStart, cacheMode, cacheEnabled, onFallbackImportExtraction } = createIndexBuildRunState(projectRoot, opts, graphOptions);
|
|
847
|
+
let checkProgressActive = false;
|
|
848
|
+
const startCheckProgress = () => {
|
|
849
|
+
if (checkProgressActive)
|
|
850
|
+
return;
|
|
851
|
+
checkProgressActive = true;
|
|
852
|
+
opts?.onProgress?.({
|
|
853
|
+
type: "progress",
|
|
854
|
+
phase: "start",
|
|
855
|
+
mode: "check",
|
|
856
|
+
message: "Checking project index",
|
|
857
|
+
current: 0,
|
|
858
|
+
total: 0,
|
|
859
|
+
});
|
|
860
|
+
};
|
|
861
|
+
const completeCheckProgress = (total) => {
|
|
862
|
+
if (!checkProgressActive)
|
|
863
|
+
return;
|
|
864
|
+
checkProgressActive = false;
|
|
865
|
+
opts?.onProgress?.({
|
|
866
|
+
type: "progress",
|
|
867
|
+
phase: "complete",
|
|
868
|
+
mode: "check",
|
|
869
|
+
message: "Checked project index",
|
|
870
|
+
current: total,
|
|
871
|
+
total,
|
|
872
|
+
elapsedMs: performance.now() - totalStart,
|
|
873
|
+
});
|
|
874
|
+
};
|
|
875
|
+
try {
|
|
876
|
+
const declaredScope = opts?.filesAreProjectScope ? opts.files : undefined;
|
|
877
|
+
// A declared project scope is the whole truth for this build, including when it is
|
|
878
|
+
// empty: full discovery would silently widen a scoped query. Scoped builds go through
|
|
879
|
+
// the shared finalization path with a read-only manifest, so they never rewrite
|
|
880
|
+
// project-wide state.
|
|
881
|
+
if (declaredScope && !declaredScope.length) {
|
|
882
|
+
return await buildDeclaredScopeIndex(projectRoot, declaredScope, opts);
|
|
883
|
+
}
|
|
884
|
+
if (cacheMode !== "disk") {
|
|
885
|
+
if (declaredScope) {
|
|
886
|
+
return await buildDeclaredScopeIndex(projectRoot, declaredScope, opts);
|
|
887
|
+
}
|
|
888
|
+
return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
|
|
889
|
+
}
|
|
890
|
+
startCheckProgress();
|
|
891
|
+
const manifestStart = performance.now();
|
|
892
|
+
const manifest = await loadManifest(projectRoot, opts);
|
|
893
|
+
if (timings)
|
|
894
|
+
timings.manifestMs = Math.round(performance.now() - manifestStart);
|
|
895
|
+
const manifestUsed = !!manifest;
|
|
896
|
+
const manifestReport = initManifestReport(report, manifestUsed, false);
|
|
897
|
+
if (manifestReport && !manifestUsed)
|
|
898
|
+
manifestReport.reason = "missing";
|
|
899
|
+
const optionDiffs = diffBuildOptions(manifest?.buildOptions, opts);
|
|
900
|
+
const warningOptionDiffs = optionDiffs.filter((diff) => diff !== "cache");
|
|
901
|
+
if (manifest && warningOptionDiffs.length) {
|
|
902
|
+
logWithLevel(opts?.logLevel, "warn", `Warning: Manifest options differ from current build options: ${warningOptionDiffs.join(", ")}`);
|
|
903
|
+
}
|
|
904
|
+
if (manifestReport && optionDiffs.length) {
|
|
905
|
+
manifestReport.optionsMismatch = optionDiffs;
|
|
906
|
+
}
|
|
907
|
+
const currentConfigHashResult = await computeConfigHash(projectRoot, opts?.logLevel);
|
|
908
|
+
const currentConfigHash = recordConfigHashResult(manifestReport, currentConfigHashResult, opts?.logLevel);
|
|
909
|
+
const configChanged = !!currentConfigHashResult.error || !manifest?.configHash || currentConfigHash !== manifest.configHash;
|
|
910
|
+
const requiresFullRebuild = optionDiffs.some((diff) => diff === "discovery" || diff === "native" || diff === "implementation" || diff === "languageExtensions");
|
|
911
|
+
if (!manifest || !graphOptionsEqual(manifest.graphOptions, graphOptions) || configChanged || requiresFullRebuild) {
|
|
912
|
+
if (manifest && configChanged) {
|
|
913
|
+
logWithLevel(opts?.logLevel, "warn", "Configuration changed, rebuilding index...");
|
|
914
|
+
}
|
|
915
|
+
if (manifestReport && manifest) {
|
|
916
|
+
let reason = "graphOptionsMismatch";
|
|
917
|
+
if (requiresFullRebuild) {
|
|
918
|
+
reason = "buildOptionsMismatch";
|
|
919
|
+
}
|
|
920
|
+
else if (configChanged) {
|
|
921
|
+
reason = "configChanged";
|
|
922
|
+
}
|
|
923
|
+
manifestReport.reason = reason;
|
|
924
|
+
manifestReport.reused = false;
|
|
925
|
+
}
|
|
926
|
+
return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
|
|
927
|
+
}
|
|
928
|
+
const gitAvailable = await isGitRepo(projectRoot);
|
|
929
|
+
const hasExplicitGitRange = !!opts?.gitBase || !!opts?.gitHead;
|
|
930
|
+
// Diff against the working tree, not just the last-indexed commit: a file that was
|
|
931
|
+
// `git add`ed but never committed is neither a tracked manifest entry nor reported
|
|
932
|
+
// by `git ls-files --others` (it stops being "untracked" once staged), so comparing
|
|
933
|
+
// only committed history would miss it whenever HEAD has not moved. Diffing against
|
|
934
|
+
// WORKTREE captures staged and unstaged tracked-file changes together, and still
|
|
935
|
+
// covers ordinary new-commit history when the working tree is clean at the new HEAD.
|
|
936
|
+
const shouldDiffAgainstWorkingTree = !hasExplicitGitRange && gitAvailable && !!manifest.lastCommit;
|
|
937
|
+
const canReuseReconciliation = opts?.reconciledManifestUpdatedAt === manifest.updatedAt;
|
|
938
|
+
let manifestDiffFiles = [];
|
|
939
|
+
if (shouldDiffAgainstWorkingTree) {
|
|
940
|
+
try {
|
|
941
|
+
manifestDiffFiles =
|
|
942
|
+
(canReuseReconciliation ? opts?.reconciledWorkingTreeDiffFiles : undefined) ??
|
|
943
|
+
(await listChangedFiles(projectRoot, {
|
|
944
|
+
base: manifest.lastCommit,
|
|
945
|
+
head: "WORKTREE",
|
|
946
|
+
}));
|
|
947
|
+
}
|
|
948
|
+
catch (error) {
|
|
949
|
+
if (!isMissingGitRevisionError(error))
|
|
950
|
+
throw error;
|
|
951
|
+
if (manifestReport) {
|
|
952
|
+
manifestReport.reason = "staleGitCommit";
|
|
953
|
+
manifestReport.reused = false;
|
|
954
|
+
}
|
|
955
|
+
logWithLevel(opts?.logLevel, "warn", "Warning: Manifest commit is no longer available; rebuilding full index.");
|
|
956
|
+
const rebuiltIndex = await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
|
|
957
|
+
if (manifestReport) {
|
|
958
|
+
manifestReport.reason = "staleGitCommit";
|
|
959
|
+
manifestReport.reused = false;
|
|
960
|
+
}
|
|
961
|
+
return rebuiltIndex;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
if (manifestReport)
|
|
965
|
+
manifestReport.reused = true;
|
|
966
|
+
if (opts?.cacheVerify) {
|
|
967
|
+
const { mismatches, missing } = await verifyManifestEntries(projectRoot, manifest, opts, gitAvailable);
|
|
968
|
+
if (manifestReport) {
|
|
969
|
+
manifestReport.mismatches = mismatches;
|
|
970
|
+
manifestReport.missing = missing;
|
|
971
|
+
}
|
|
972
|
+
if (mismatches > 0 || missing > 0) {
|
|
973
|
+
logWithLevel(opts?.logLevel, "warn", `Warning: Manifest verification failed (mismatches: ${mismatches}, missing: ${missing}). Rebuilding full index.`);
|
|
974
|
+
return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
const trackedEntries = sanitizeManifestEntriesForRoot(projectRoot, manifest.files);
|
|
978
|
+
const manifestFileKeys = Object.keys(manifest.files);
|
|
979
|
+
const trackedEntryKeys = Object.keys(trackedEntries);
|
|
980
|
+
let manifestRequiresSanitization = manifestFileKeys.length !== trackedEntryKeys.length ||
|
|
981
|
+
manifestFileKeys.some((file) => !Object.hasOwn(trackedEntries, file));
|
|
982
|
+
const explicitFiles = normalizeIndexedFileInputs(projectRoot, opts?.files ?? [], "Incremental file");
|
|
983
|
+
const additionalFiles = normalizeIndexedFileInputs(projectRoot, opts?.additionalFiles ?? [], "Additional index file");
|
|
984
|
+
const previousTransientFiles = sanitizeManifestTransientFilesForRoot(projectRoot, manifest.transientFiles).filter((file) => Object.hasOwn(trackedEntries, file));
|
|
985
|
+
const previousTransientFileSet = new Set(previousTransientFiles);
|
|
986
|
+
const needsGitScan = !!opts?.gitBase || !!opts?.changedSince;
|
|
987
|
+
const gitFiles = needsGitScan ? await listChangedFiles(projectRoot, buildIncrementalGitDiffOptions(opts)) : [];
|
|
988
|
+
// New files that were never committed, staged, or passed explicitly have no tracked
|
|
989
|
+
// manifest entry and no working-tree-diff record, so they would otherwise stay
|
|
990
|
+
// invisible to an incremental build until the next full rebuild. Detecting them via
|
|
991
|
+
// `git ls-files --others` is far cheaper than a full recursive directory scan and
|
|
992
|
+
// keeps this path correct without requiring callers to pre-scan the project
|
|
993
|
+
// themselves. A failure here cannot be treated as "no untracked files": that would
|
|
994
|
+
// silently produce an incomplete index, so it falls back to a full rebuild instead,
|
|
995
|
+
// the same way a stale manifest commit does above.
|
|
996
|
+
let untrackedFiles = [];
|
|
997
|
+
// Without that cheap Git signal -- no repository at all, or `--cache-strict` asking for
|
|
998
|
+
// maximum certainty over speed -- the manifest file list cannot prove that no new file
|
|
999
|
+
// appeared, so rediscover the project instead of trusting it. Per-file signature checks
|
|
1000
|
+
// below still keep unchanged files cached, so this costs one directory walk, not a
|
|
1001
|
+
// full reparse. Callers that already resolved the complete scope (`filesAreProjectScope`)
|
|
1002
|
+
// need no rescan.
|
|
1003
|
+
let rediscoveredFiles = [];
|
|
1004
|
+
if (canUseIncrementalDiscoveryFastPath(gitAvailable, opts?.cacheStrict)) {
|
|
1005
|
+
try {
|
|
1006
|
+
untrackedFiles =
|
|
1007
|
+
(canReuseReconciliation ? opts?.reconciledUntrackedFiles : undefined) ??
|
|
1008
|
+
(await listUntrackedProjectFiles(projectRoot, opts?.discovery, gitAvailable));
|
|
1009
|
+
}
|
|
1010
|
+
catch (error) {
|
|
1011
|
+
if (manifestReport) {
|
|
1012
|
+
manifestReport.reason = "gitUntrackedScanFailed";
|
|
1013
|
+
manifestReport.reused = false;
|
|
1014
|
+
}
|
|
1015
|
+
logWithLevel(opts?.logLevel, "warn", "Warning: Failed to list untracked project files via Git; rebuilding full index.", error);
|
|
1016
|
+
return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
else if (!opts?.filesAreProjectScope) {
|
|
1020
|
+
rediscoveredFiles = await listProjectFiles(projectRoot, projectPatternsForLanguageExtensions(opts), {
|
|
1021
|
+
...opts?.discovery,
|
|
1022
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
1023
|
+
...(!opts?.cacheStrict && manifest.symlinkDirectories !== undefined
|
|
1024
|
+
? { knownSymlinkDirectories: manifest.symlinkDirectories }
|
|
1025
|
+
: {}),
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
const candidateFiles = [
|
|
1029
|
+
...explicitFiles,
|
|
1030
|
+
...additionalFiles,
|
|
1031
|
+
...manifestDiffFiles,
|
|
1032
|
+
...gitFiles,
|
|
1033
|
+
...untrackedFiles,
|
|
1034
|
+
...rediscoveredFiles,
|
|
1035
|
+
];
|
|
1036
|
+
const candidateExistence = await probePathExistence(candidateFiles, buildConcurrency(opts));
|
|
1037
|
+
const existsInCandidateSnapshot = (file) => candidateExistence.get(file) ?? false;
|
|
1038
|
+
const additionalFileSet = new Set(additionalFiles.filter(existsInCandidateSnapshot));
|
|
1039
|
+
const transientFiles = [...additionalFileSet].filter((file) => previousTransientFileSet.has(file) || !Object.hasOwn(trackedEntries, file));
|
|
1040
|
+
const retiredTransientFiles = previousTransientFiles.filter((file) => !additionalFileSet.has(file));
|
|
1041
|
+
const { trackedFiles, deletedTrackedFiles } = await partitionTrackedManifestFiles(trackedEntries);
|
|
1042
|
+
for (const file of retiredTransientFiles) {
|
|
1043
|
+
trackedFiles.delete(file);
|
|
1044
|
+
deletedTrackedFiles.add(file);
|
|
1045
|
+
delete trackedEntries[file];
|
|
1046
|
+
}
|
|
1047
|
+
if (retiredTransientFiles.length)
|
|
1048
|
+
manifestRequiresSanitization = true;
|
|
1049
|
+
const fileReport = initFileReport(report);
|
|
1050
|
+
if (fileReport)
|
|
1051
|
+
fileReport.total = trackedFiles.size;
|
|
1052
|
+
const allFiles = new Set([
|
|
1053
|
+
...trackedFiles,
|
|
1054
|
+
...explicitFiles.filter(existsInCandidateSnapshot),
|
|
1055
|
+
...additionalFiles.filter(existsInCandidateSnapshot),
|
|
1056
|
+
...manifestDiffFiles.filter(existsInCandidateSnapshot),
|
|
1057
|
+
...gitFiles.filter(existsInCandidateSnapshot),
|
|
1058
|
+
...untrackedFiles.filter(existsInCandidateSnapshot),
|
|
1059
|
+
...rediscoveredFiles.filter(existsInCandidateSnapshot),
|
|
1060
|
+
]);
|
|
1061
|
+
if (fileReport)
|
|
1062
|
+
fileReport.total = allFiles.size;
|
|
1063
|
+
const dependentFilesOfDeletedTracked = collectDeletedTrackedFileDependents(trackedEntries, deletedTrackedFiles);
|
|
1064
|
+
if (allFiles.size === 0) {
|
|
1065
|
+
completeCheckProgress(0);
|
|
1066
|
+
await writeIndexManifestSnapshot({
|
|
1067
|
+
projectRoot,
|
|
1068
|
+
opts,
|
|
1069
|
+
graphOptions,
|
|
1070
|
+
files: {},
|
|
1071
|
+
timings,
|
|
1072
|
+
manifestReport,
|
|
1073
|
+
allowEmpty: true,
|
|
1074
|
+
transientFiles,
|
|
1075
|
+
...(manifest.symlinkDirectories !== undefined ? { symlinkDirectories: manifest.symlinkDirectories } : {}),
|
|
1076
|
+
});
|
|
1077
|
+
return {
|
|
1078
|
+
graph: { nodes: new Set(), edges: [] },
|
|
1079
|
+
graphAdjacency: buildGraphAdjacency({ nodes: new Set(), edges: [] }),
|
|
1080
|
+
modules: new Map(),
|
|
1081
|
+
byFile: new Map(),
|
|
1082
|
+
projectRoot: normalizedProjectRoot,
|
|
1083
|
+
...(opts?.native ? { nativeMode: opts.native } : {}),
|
|
1084
|
+
exportCache: new Map(),
|
|
1085
|
+
scopeCache: new Map(),
|
|
1086
|
+
parsed: new Map(),
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
const changedFiles = new Set();
|
|
1090
|
+
const markAsChanged = (file) => {
|
|
1091
|
+
if (allFiles.has(file))
|
|
1092
|
+
changedFiles.add(file);
|
|
1093
|
+
};
|
|
1094
|
+
// Git working-tree diffs are change *candidates*, not proof the indexed bytes are
|
|
1095
|
+
// stale. `lastCommit...WORKTREE` stays dirty across warm runs after we index the
|
|
1096
|
+
// dirty tree, so force-marking these files caused perpetual "Updated N files"
|
|
1097
|
+
// reparses even when signatures already matched the on-disk content. Keep them in
|
|
1098
|
+
// `allFiles` above so signature validation can decide; only skip the early snapshot
|
|
1099
|
+
// fast-path while candidates exist.
|
|
1100
|
+
const gitChangeCandidates = new Set();
|
|
1101
|
+
for (const file of manifestDiffFiles) {
|
|
1102
|
+
if (existsInCandidateSnapshot(file))
|
|
1103
|
+
gitChangeCandidates.add(file);
|
|
1104
|
+
}
|
|
1105
|
+
for (const file of gitFiles) {
|
|
1106
|
+
if (existsInCandidateSnapshot(file))
|
|
1107
|
+
gitChangeCandidates.add(file);
|
|
1108
|
+
}
|
|
1109
|
+
const explicitFileSet = new Set(explicitFiles);
|
|
1110
|
+
const explicitFilesCoverAllFiles = explicitFileSet.size === allFiles.size && [...allFiles].every((file) => explicitFileSet.has(file));
|
|
1111
|
+
const explicitFilesAreChangeInputs = !opts?.filesAreProjectScope;
|
|
1112
|
+
if (explicitFileSet.size && explicitFilesAreChangeInputs && (!explicitFilesCoverAllFiles || report)) {
|
|
1113
|
+
explicitFileSet.forEach(markAsChanged);
|
|
1114
|
+
}
|
|
1115
|
+
dependentFilesOfDeletedTracked.forEach(markAsChanged);
|
|
1116
|
+
if (fileReport)
|
|
1117
|
+
fileReport.changed = changedFiles.size;
|
|
1118
|
+
const reuseUnchangedSnapshot = async () => {
|
|
1119
|
+
if (changedFiles.size || deletedTrackedFiles.size || manifestRequiresSanitization)
|
|
1120
|
+
return null;
|
|
1121
|
+
const manifestEntryMap = new Map(Object.entries(trackedEntries));
|
|
1122
|
+
const snapshotLoad = await tryLoadProjectIndexSnapshot(projectRoot, opts, manifestEntryMap);
|
|
1123
|
+
if (!snapshotLoad)
|
|
1124
|
+
return null;
|
|
1125
|
+
const snapshot = snapshotLoad.index;
|
|
1126
|
+
snapshot.projectFiles ??= await discoverProjectFiles(projectRoot, {
|
|
1127
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
1128
|
+
});
|
|
1129
|
+
if (opts?.cache) {
|
|
1130
|
+
snapshot.cacheMode = opts.cache;
|
|
1131
|
+
snapshot.cacheRootDir = cacheRoot(projectRoot, opts);
|
|
1132
|
+
}
|
|
1133
|
+
if (fileReport)
|
|
1134
|
+
fileReport.cached = allFiles.size;
|
|
1135
|
+
if (timings)
|
|
1136
|
+
timings.graphMs = 0;
|
|
1137
|
+
if (report) {
|
|
1138
|
+
if (snapshotLoad.analysisReport?.backend)
|
|
1139
|
+
report.backend = snapshotLoad.analysisReport.backend;
|
|
1140
|
+
if (snapshotLoad.analysisReport?.graph)
|
|
1141
|
+
report.graph = snapshotLoad.analysisReport.graph;
|
|
1142
|
+
if (!report.backend)
|
|
1143
|
+
initNativeBackendReport(report);
|
|
1144
|
+
snapshot.buildReport = report;
|
|
1145
|
+
}
|
|
1146
|
+
return snapshot;
|
|
1147
|
+
};
|
|
1148
|
+
// A file can only hide from the incremental scan by being genuinely unseen: absent from
|
|
1149
|
+
// both the manifest and any git diff signal. An untracked file that already has a
|
|
1150
|
+
// manifest entry (a build artifact or scratch file indexed once and never committed, for
|
|
1151
|
+
// example) is not automatically "unknown" -- but unlike a tracked file, git has no diff
|
|
1152
|
+
// history for it, so its manifest signature cannot be trusted without independent proof
|
|
1153
|
+
// it is still current. `entry.sig` always starts with `${mtimeMs}:${size}` (see
|
|
1154
|
+
// `fileStatSignature` in build-cache/module-cache.ts), so a single cheap `stat()` per
|
|
1155
|
+
// already-known untracked file proves freshness without reading its content. Unseen files
|
|
1156
|
+
// (no manifest entry) and files whose stat no longer matches both still block the fast
|
|
1157
|
+
// path, exactly as before; only "already indexed and provably unchanged" now qualifies.
|
|
1158
|
+
const hasStaleOrUnseenUntrackedFile = untrackedFiles.length
|
|
1159
|
+
? (await Promise.all(untrackedFiles.map(async (file) => {
|
|
1160
|
+
const entry = trackedEntries[file];
|
|
1161
|
+
if (!entry?.sig)
|
|
1162
|
+
return true;
|
|
1163
|
+
try {
|
|
1164
|
+
const stat = await fsp.stat(file);
|
|
1165
|
+
// Non-strict signatures are `${mtimeMs}:${size}`; strict ones append
|
|
1166
|
+
// `:${contentHash}`. Match either form so the fast path works when
|
|
1167
|
+
// `cacheStrict: false` (where this gate itself only runs).
|
|
1168
|
+
const prefix = `${stat.mtimeMs}:${stat.size}`;
|
|
1169
|
+
return !(entry.sig === prefix || entry.sig.startsWith(`${prefix}:`));
|
|
1170
|
+
}
|
|
1171
|
+
catch {
|
|
1172
|
+
return true;
|
|
1173
|
+
}
|
|
1174
|
+
}))).some(Boolean)
|
|
1175
|
+
: false;
|
|
1176
|
+
const canSkipFileValidation = gitAvailable &&
|
|
1177
|
+
!opts?.cacheStrict &&
|
|
1178
|
+
!hasStaleOrUnseenUntrackedFile &&
|
|
1179
|
+
!additionalFiles.length &&
|
|
1180
|
+
!gitChangeCandidates.size;
|
|
1181
|
+
if (canSkipFileValidation) {
|
|
1182
|
+
const snapshot = await reuseUnchangedSnapshot();
|
|
1183
|
+
if (snapshot) {
|
|
1184
|
+
if (timings)
|
|
1185
|
+
timings.totalMs = Math.round(performance.now() - totalStart);
|
|
1186
|
+
completeCheckProgress(allFiles.size);
|
|
1187
|
+
return snapshot;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
const workspaceConfig = await loadWorkspaceConfig(projectRoot);
|
|
1191
|
+
const conc = buildConcurrency(opts);
|
|
1192
|
+
const workerSetup = await setupWorkerPool(opts, allFiles.size);
|
|
1193
|
+
try {
|
|
1194
|
+
const useGitSignatures = gitAvailable;
|
|
1195
|
+
const gitSigMap = useGitSignatures
|
|
1196
|
+
? await getGitBlobHashes(projectRoot, Array.from(allFiles), {
|
|
1197
|
+
gitAvailable,
|
|
1198
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
1199
|
+
})
|
|
1200
|
+
: new Map();
|
|
1201
|
+
const fileSignatures = await prepareFileSignatures({
|
|
1202
|
+
files: Array.from(allFiles),
|
|
1203
|
+
opts,
|
|
1204
|
+
gitSigMap,
|
|
1205
|
+
cacheEnabled,
|
|
1206
|
+
concurrency: conc,
|
|
1207
|
+
});
|
|
1208
|
+
const modules = new Map();
|
|
1209
|
+
const parsedMap = new Map();
|
|
1210
|
+
const jsonDependencies = new Map();
|
|
1211
|
+
const useBloomFilters = opts?.useBloomFilters ?? true;
|
|
1212
|
+
const bloomFilterCache = useBloomFilters
|
|
1213
|
+
? new (await import("../util/bloomFilter.js")).BloomFilterCache()
|
|
1214
|
+
: undefined;
|
|
1215
|
+
for (const file of allFiles) {
|
|
1216
|
+
const sigInfo = fileSignatures.get(file);
|
|
1217
|
+
if (!sigInfo)
|
|
1218
|
+
continue;
|
|
1219
|
+
const entry = trackedEntries[file];
|
|
1220
|
+
const hasMatchingGitSig = !!entry?.gitSig && !!sigInfo.gitSig && entry.gitSig === sigInfo.gitSig;
|
|
1221
|
+
const hasMatchingSig = entry?.sig === sigInfo.sig;
|
|
1222
|
+
if (!entry || !(hasMatchingGitSig || hasMatchingSig)) {
|
|
1223
|
+
changedFiles.add(file);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
const invalidateCachedDependents = () => {
|
|
1227
|
+
const dependentFilesOfChanged = collectTrackedFileDependents(trackedEntries, changedFiles);
|
|
1228
|
+
for (const file of dependentFilesOfChanged) {
|
|
1229
|
+
const key = fileIdentityKey(file);
|
|
1230
|
+
if (modules.has(key)) {
|
|
1231
|
+
modules.delete(key);
|
|
1232
|
+
if (fileReport) {
|
|
1233
|
+
fileReport.cached = Math.max(0, (fileReport.cached ?? 0) - 1);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
markAsChanged(file);
|
|
1237
|
+
}
|
|
1238
|
+
};
|
|
1239
|
+
invalidateCachedDependents();
|
|
1240
|
+
if (fileReport)
|
|
1241
|
+
fileReport.changed = changedFiles.size;
|
|
1242
|
+
const unchangedSnapshot = await reuseUnchangedSnapshot();
|
|
1243
|
+
if (unchangedSnapshot) {
|
|
1244
|
+
unchangedSnapshot.manifestEntries = new Map(Array.from(fileSignatures, ([file, signature]) => [file, toProjectIndexManifestEntry(signature)]));
|
|
1245
|
+
unchangedSnapshot.manifestSignaturesFresh = true;
|
|
1246
|
+
if (timings)
|
|
1247
|
+
timings.totalMs = Math.round(performance.now() - totalStart);
|
|
1248
|
+
completeCheckProgress(allFiles.size);
|
|
1249
|
+
return unchangedSnapshot;
|
|
1250
|
+
}
|
|
1251
|
+
const persistedBloomFilters = bloomFilterCache ? await tryLoadPersistedBloomFilters(projectRoot, opts) : null;
|
|
1252
|
+
for (const file of allFiles) {
|
|
1253
|
+
if (changedFiles.has(file))
|
|
1254
|
+
continue;
|
|
1255
|
+
const sigInfo = fileSignatures.get(file);
|
|
1256
|
+
const cacheSig = cacheEnabled ? await moduleCacheSignatureForFile(file, sigInfo, opts) : sigInfo.cacheSig;
|
|
1257
|
+
const cached = cacheEnabled ? tryLoadFromCache(projectRoot, file, cacheSig, opts, report) : null;
|
|
1258
|
+
if (cached) {
|
|
1259
|
+
if (fileReport)
|
|
1260
|
+
fileReport.cached = (fileReport.cached ?? 0) + 1;
|
|
1261
|
+
modules.set(fileIdentityKey(file), cached);
|
|
1262
|
+
collectJsonDependencies(cached.imports, jsonDependencies);
|
|
1263
|
+
if (bloomFilterCache) {
|
|
1264
|
+
const persistedFilter = persistedBloomFilters?.get(file);
|
|
1265
|
+
if (persistedFilter) {
|
|
1266
|
+
bloomFilterCache.set(file, persistedFilter);
|
|
1267
|
+
}
|
|
1268
|
+
else {
|
|
1269
|
+
const filter = await buildBloomFilterForFile(file, opts);
|
|
1270
|
+
if (filter)
|
|
1271
|
+
bloomFilterCache.set(file, filter);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
else {
|
|
1276
|
+
changedFiles.add(file);
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
invalidateCachedDependents();
|
|
1280
|
+
const changedList = Array.from(changedFiles);
|
|
1281
|
+
let updateStartedAt;
|
|
1282
|
+
if (changedList.length || deletedTrackedFiles.size) {
|
|
1283
|
+
updateStartedAt = performance.now();
|
|
1284
|
+
emitIndexLifecycleProgress(opts, "start", "update", changedList.length);
|
|
1285
|
+
}
|
|
1286
|
+
if (fileReport)
|
|
1287
|
+
fileReport.changed = changedList.length;
|
|
1288
|
+
if (changedList.length) {
|
|
1289
|
+
const parseStart = performance.now();
|
|
1290
|
+
let processedFiles = 0;
|
|
1291
|
+
const totalFiles = changedList.length;
|
|
1292
|
+
const fileResults = await mapLimit(changedList, conc, async (file) => {
|
|
1293
|
+
try {
|
|
1294
|
+
if (fileReport)
|
|
1295
|
+
fileReport.parsed = (fileReport.parsed ?? 0) + 1;
|
|
1296
|
+
const support = supportForFile(file, opts?.languageExtensions);
|
|
1297
|
+
if (!support)
|
|
1298
|
+
return [file, createEmptyModuleIndex(file)];
|
|
1299
|
+
const built = await buildIndexedModuleForFile({
|
|
1300
|
+
file,
|
|
1301
|
+
support,
|
|
1302
|
+
projectRoot,
|
|
1303
|
+
opts,
|
|
1304
|
+
report,
|
|
1305
|
+
graphOptions,
|
|
1306
|
+
workspaceConfig,
|
|
1307
|
+
workerSetup,
|
|
1308
|
+
parsedMap,
|
|
1309
|
+
parsedCacheMaxEntries: parsedCacheMaxEntries(opts),
|
|
1310
|
+
jsonDependencies,
|
|
1311
|
+
bloomFilterCache,
|
|
1312
|
+
onFallbackImportExtraction,
|
|
1313
|
+
fileSignatures,
|
|
1314
|
+
cacheEnabled,
|
|
1315
|
+
});
|
|
1316
|
+
return [file, built.module];
|
|
1317
|
+
}
|
|
1318
|
+
catch (error) {
|
|
1319
|
+
if (isNativeRequiredUnavailableError(error) || isNodeSqliteUnavailableError(error))
|
|
1320
|
+
throw error;
|
|
1321
|
+
if (isUnsupportedParserInputError(error) || isNonNativeParserUnavailableError(error)) {
|
|
1322
|
+
return [file, createEmptyModuleIndex(file)];
|
|
1323
|
+
}
|
|
1324
|
+
recordFileFailure(report, file, error);
|
|
1325
|
+
logWithLevel(opts?.logLevel, "warn", `Warning: Failed to process file ${file}:`, error);
|
|
1326
|
+
return [file, createEmptyModuleIndex(file)];
|
|
1327
|
+
}
|
|
1328
|
+
finally {
|
|
1329
|
+
if (opts?.onProgress) {
|
|
1330
|
+
opts.onProgress({
|
|
1331
|
+
type: "progress",
|
|
1332
|
+
phase: "update",
|
|
1333
|
+
mode: "update",
|
|
1334
|
+
message: `Indexed ${file}`,
|
|
1335
|
+
current: ++processedFiles,
|
|
1336
|
+
total: totalFiles,
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
for (const [file, mod] of fileResults) {
|
|
1342
|
+
modules.set(fileIdentityKey(file), mod);
|
|
1343
|
+
}
|
|
1344
|
+
if (timings)
|
|
1345
|
+
timings.parseMs = Math.round(performance.now() - parseStart);
|
|
1346
|
+
}
|
|
1347
|
+
for (const jsonPath of jsonDependencies.values()) {
|
|
1348
|
+
ensureJsonModule(modules, jsonPath);
|
|
1349
|
+
}
|
|
1350
|
+
expandStarImports(modules, opts);
|
|
1351
|
+
const retainedTrackedEntries = Object.entries(trackedEntries).filter(([file]) => !deletedTrackedFiles.has(file));
|
|
1352
|
+
const cachedGraphEntries = new Map(retainedTrackedEntries);
|
|
1353
|
+
const manifestEntries = new Map(cachedGraphEntries);
|
|
1354
|
+
const baseGraph = cachedGraphEntries.size > 0 ? { nodes: new Set(), edges: [] } : undefined;
|
|
1355
|
+
if (baseGraph) {
|
|
1356
|
+
const baseGraphEdgeTargets = [];
|
|
1357
|
+
for (const entry of cachedGraphEntries.values()) {
|
|
1358
|
+
for (const edge of entry.edges) {
|
|
1359
|
+
if (edge.to.type === "file")
|
|
1360
|
+
baseGraphEdgeTargets.push(edge.to.path);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
const baseGraphEdgeExistence = await probePathExistence(baseGraphEdgeTargets, conc);
|
|
1364
|
+
for (const [file, entry] of cachedGraphEntries) {
|
|
1365
|
+
baseGraph.nodes.add(file);
|
|
1366
|
+
for (const edge of entry.edges) {
|
|
1367
|
+
baseGraph.edges.push(edge);
|
|
1368
|
+
if (edge.to.type === "file" && baseGraphEdgeExistence.get(edge.to.path)) {
|
|
1369
|
+
baseGraph.nodes.add(edge.to.path);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
const filesList = Array.from(changedFiles);
|
|
1375
|
+
const graphStart = performance.now();
|
|
1376
|
+
const graph = !filesList.length && baseGraph
|
|
1377
|
+
? { nodes: new Set(baseGraph.nodes), edges: [...baseGraph.edges] }
|
|
1378
|
+
: await collectGraph(projectRoot, filesList, {
|
|
1379
|
+
parsed: parsedMap,
|
|
1380
|
+
fast: !!graphOptions.fast,
|
|
1381
|
+
...(graphOptions.fastRegexDisabledLanguages
|
|
1382
|
+
? { fastRegexDisabledLanguages: graphOptions.fastRegexDisabledLanguages }
|
|
1383
|
+
: {}),
|
|
1384
|
+
resolveNodeModules: !!graphOptions.resolveNodeModules,
|
|
1385
|
+
dynamicImportHeuristics: !!graphOptions.dynamicImportHeuristics,
|
|
1386
|
+
...(opts?.native ? { native: opts.native } : {}),
|
|
1387
|
+
...(opts?.languageExtensions ? { languageExtensions: opts.languageExtensions } : {}),
|
|
1388
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
1389
|
+
...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
|
|
1390
|
+
allFiles: Array.from(allFiles),
|
|
1391
|
+
fileSignatures,
|
|
1392
|
+
cachedFileEdges: cachedGraphEntries,
|
|
1393
|
+
...(onFallbackImportExtraction ? { onFallbackImportExtraction } : {}),
|
|
1394
|
+
...(baseGraph ? { baseGraph } : {}),
|
|
1395
|
+
replaceFiles: new Set(changedFiles),
|
|
1396
|
+
onFileEdges: (file, entry) => {
|
|
1397
|
+
const manifestEntry = toManifestFileEntry(entry);
|
|
1398
|
+
if (!manifestEntry)
|
|
1399
|
+
return;
|
|
1400
|
+
manifestEntries.set(file, manifestEntry);
|
|
1401
|
+
},
|
|
1402
|
+
});
|
|
1403
|
+
if (timings)
|
|
1404
|
+
timings.graphMs = Math.round(performance.now() - graphStart);
|
|
1405
|
+
await writeIndexManifestSnapshot({
|
|
1406
|
+
projectRoot,
|
|
1407
|
+
opts,
|
|
1408
|
+
graphOptions,
|
|
1409
|
+
files: manifestEntries,
|
|
1410
|
+
timings,
|
|
1411
|
+
manifestReport,
|
|
1412
|
+
transientFiles,
|
|
1413
|
+
...(manifest.symlinkDirectories !== undefined ? { symlinkDirectories: manifest.symlinkDirectories } : {}),
|
|
1414
|
+
});
|
|
1415
|
+
const index = await finalizeProjectIndex({
|
|
1416
|
+
projectRoot,
|
|
1417
|
+
normalizedProjectRoot,
|
|
1418
|
+
opts,
|
|
1419
|
+
timings,
|
|
1420
|
+
totalStart,
|
|
1421
|
+
graph,
|
|
1422
|
+
modules,
|
|
1423
|
+
parsedMap,
|
|
1424
|
+
bloomFilterCache,
|
|
1425
|
+
manifestEntries: projectIndexManifestEntries(manifestEntries),
|
|
1426
|
+
buildReport: report,
|
|
1427
|
+
});
|
|
1428
|
+
await writeProjectIndexSnapshot(projectRoot, opts, index, projectSnapshotFilesSignature(manifestEntries));
|
|
1429
|
+
if (updateStartedAt !== undefined) {
|
|
1430
|
+
emitIndexLifecycleProgress(opts, "complete", "update", index.byFile.size, performance.now() - updateStartedAt);
|
|
1431
|
+
}
|
|
1432
|
+
else {
|
|
1433
|
+
completeCheckProgress(allFiles.size);
|
|
1434
|
+
}
|
|
1435
|
+
return index;
|
|
1436
|
+
}
|
|
1437
|
+
finally {
|
|
1438
|
+
await teardownWorkerPool(workerSetup, report);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
finally {
|
|
1442
|
+
if (cacheMode === "disk") {
|
|
1443
|
+
closeDiskCacheDatabase(projectRoot, opts);
|
|
1444
|
+
closeDuplicateUnitCacheDatabase(projectRoot, opts);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
export async function buildGraphDelta(projectRoot, opts) {
|
|
1449
|
+
const manifest = await loadManifest(projectRoot, opts);
|
|
1450
|
+
const trackedEntries = sanitizeManifestEntriesForRoot(projectRoot, manifest?.files);
|
|
1451
|
+
const graphOptions = normalizeGraphOptions(opts?.graph);
|
|
1452
|
+
const previousLanguageExtensions = normalizeLanguageExtensions(manifest?.buildOptions?.languageExtensions);
|
|
1453
|
+
const currentLanguageExtensions = normalizeLanguageExtensions(opts?.languageExtensions);
|
|
1454
|
+
const languageExtensionsChanged = manifest
|
|
1455
|
+
? diffBuildOptions(manifest.buildOptions, opts).includes("languageExtensions")
|
|
1456
|
+
: false;
|
|
1457
|
+
const languageSupportChangedForFile = (file) => supportForFile(file, previousLanguageExtensions)?.id !== supportForFile(file, currentLanguageExtensions)?.id;
|
|
1458
|
+
const strictIncremental = opts?.incrementalStrict ?? false;
|
|
1459
|
+
if (strictIncremental && graphOptions.fast)
|
|
1460
|
+
graphOptions.fast = false;
|
|
1461
|
+
const explicitFiles = normalizeIndexedFileInputs(projectRoot, opts?.files ?? [], "Graph delta file");
|
|
1462
|
+
const additionalFiles = normalizeIndexedFileInputs(projectRoot, opts?.additionalFiles ?? [], "Additional graph delta file");
|
|
1463
|
+
const needsGitScan = !!opts?.gitBase || !!opts?.changedSince;
|
|
1464
|
+
const gitFiles = needsGitScan ? await listChangedFiles(projectRoot, buildIncrementalGitDiffOptions(opts)) : [];
|
|
1465
|
+
const { trackedFiles } = await partitionTrackedManifestFiles(trackedEntries);
|
|
1466
|
+
const gitAvailable = await isGitRepo(projectRoot);
|
|
1467
|
+
const currentHead = gitAvailable ? await getGitHead(projectRoot) : null;
|
|
1468
|
+
const hasExplicitGitRange = !!opts?.gitBase || !!opts?.gitHead;
|
|
1469
|
+
const manifestCommitMismatch = !hasExplicitGitRange && !!manifest?.lastCommit && !!currentHead && manifest.lastCommit !== currentHead;
|
|
1470
|
+
let manifestDiffFiles = [];
|
|
1471
|
+
if (manifestCommitMismatch) {
|
|
1472
|
+
try {
|
|
1473
|
+
manifestDiffFiles = await listChangedFiles(projectRoot, {
|
|
1474
|
+
base: manifest?.lastCommit,
|
|
1475
|
+
head: currentHead,
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
catch (error) {
|
|
1479
|
+
if (!isMissingGitRevisionError(error))
|
|
1480
|
+
throw error;
|
|
1481
|
+
manifestDiffFiles = Object.keys(trackedEntries);
|
|
1482
|
+
logWithLevel(opts?.logLevel, "warn", "Warning: Manifest commit is no longer available; using tracked manifest files for graph delta.");
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
const candidateExistence = await probePathExistence([...explicitFiles, ...additionalFiles, ...manifestDiffFiles, ...gitFiles], buildConcurrency(opts));
|
|
1486
|
+
const existsInCandidateSnapshot = (file) => candidateExistence.get(file) ?? false;
|
|
1487
|
+
const existingExplicitFiles = explicitFiles.filter(existsInCandidateSnapshot);
|
|
1488
|
+
const existingAdditionalFiles = additionalFiles.filter(existsInCandidateSnapshot);
|
|
1489
|
+
const allFiles = new Set([
|
|
1490
|
+
...trackedFiles,
|
|
1491
|
+
...existingExplicitFiles,
|
|
1492
|
+
...existingAdditionalFiles,
|
|
1493
|
+
...manifestDiffFiles.filter(existsInCandidateSnapshot),
|
|
1494
|
+
...gitFiles.filter(existsInCandidateSnapshot),
|
|
1495
|
+
]);
|
|
1496
|
+
const changedFiles = new Set();
|
|
1497
|
+
const changedFileKeys = new Set();
|
|
1498
|
+
const addChangedFile = (file) => {
|
|
1499
|
+
const key = fileIdentityKey(file);
|
|
1500
|
+
if (changedFileKeys.has(key))
|
|
1501
|
+
return;
|
|
1502
|
+
changedFileKeys.add(key);
|
|
1503
|
+
changedFiles.add(file);
|
|
1504
|
+
};
|
|
1505
|
+
existingExplicitFiles.forEach(addChangedFile);
|
|
1506
|
+
manifestDiffFiles.forEach(addChangedFile);
|
|
1507
|
+
gitFiles.forEach(addChangedFile);
|
|
1508
|
+
if (languageExtensionsChanged) {
|
|
1509
|
+
for (const file of trackedFiles) {
|
|
1510
|
+
if (languageSupportChangedForFile(file))
|
|
1511
|
+
addChangedFile(file);
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
if (!languageExtensionsChanged && allFiles.size === 0 && changedFiles.size === 0) {
|
|
1515
|
+
return { changedFiles: [], added: [], removed: [] };
|
|
1516
|
+
}
|
|
1517
|
+
if (manifest && graphOptionsEqual(manifest.graphOptions, graphOptions)) {
|
|
1518
|
+
const gitSigMap = gitAvailable
|
|
1519
|
+
? await getGitBlobHashes(projectRoot, Array.from(allFiles), {
|
|
1520
|
+
gitAvailable,
|
|
1521
|
+
...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
|
|
1522
|
+
})
|
|
1523
|
+
: new Map();
|
|
1524
|
+
for (const file of allFiles) {
|
|
1525
|
+
const sigInfo = await fileSignature(file, opts?.cacheStrict, gitSigMap.get(file));
|
|
1526
|
+
const entry = trackedEntries[file];
|
|
1527
|
+
const hasMatchingGitSig = !!entry?.gitSig && !!sigInfo.gitSig && entry.gitSig === sigInfo.gitSig;
|
|
1528
|
+
const hasMatchingSig = entry?.sig === sigInfo.sig;
|
|
1529
|
+
if (!entry || !(hasMatchingGitSig || hasMatchingSig)) {
|
|
1530
|
+
addChangedFile(file);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
const beforeEdges = new Map();
|
|
1535
|
+
if (manifest) {
|
|
1536
|
+
for (const file of changedFiles) {
|
|
1537
|
+
const entry = trackedEntries[file];
|
|
1538
|
+
if (!entry?.edges)
|
|
1539
|
+
continue;
|
|
1540
|
+
for (const edge of entry.edges) {
|
|
1541
|
+
beforeEdges.set(edgeKey(edge), edge);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
const index = await buildProjectIndexIncremental(projectRoot, opts);
|
|
1546
|
+
if (languageExtensionsChanged) {
|
|
1547
|
+
for (const file of index.modules.keys()) {
|
|
1548
|
+
if (!languageSupportChangedForFile(file))
|
|
1549
|
+
continue;
|
|
1550
|
+
const displayFile = index.byFile.get(fileIdentityKey(file))?.file ?? file;
|
|
1551
|
+
addChangedFile(displayFile);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
const changedList = Array.from(changedFiles);
|
|
1555
|
+
const afterEdges = new Map();
|
|
1556
|
+
for (const edge of index.graph.edges) {
|
|
1557
|
+
if (changedFileKeys.has(fileIdentityKey(edge.from)))
|
|
1558
|
+
afterEdges.set(edgeKey(edge), edge);
|
|
1559
|
+
}
|
|
1560
|
+
const added = [];
|
|
1561
|
+
const removed = [];
|
|
1562
|
+
for (const [key, edge] of afterEdges) {
|
|
1563
|
+
if (!beforeEdges.has(key))
|
|
1564
|
+
added.push(edge);
|
|
1565
|
+
}
|
|
1566
|
+
for (const [key, edge] of beforeEdges) {
|
|
1567
|
+
if (!afterEdges.has(key))
|
|
1568
|
+
removed.push(edge);
|
|
1569
|
+
}
|
|
1570
|
+
const changedFilesRelative = changedList.map((file) => normalizePath(path.relative(projectRoot, file)));
|
|
1571
|
+
const addedRelative = added.map((edge) => toRelativeEdge(projectRoot, edge));
|
|
1572
|
+
const removedRelative = removed.map((edge) => toRelativeEdge(projectRoot, edge));
|
|
1573
|
+
return {
|
|
1574
|
+
changedFiles: changedFilesRelative.sort(),
|
|
1575
|
+
added: addedRelative.sort(compareEdges),
|
|
1576
|
+
removed: removedRelative.sort(compareEdges),
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
//# sourceMappingURL=build-index.js.map
|