@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,1245 @@
|
|
|
1
|
+
import { appendToArrayMap } from "../util/collections.js";
|
|
2
|
+
import { lineSpan, normalizeDetectionFile, shortHashText } from "./units.js";
|
|
3
|
+
export const DEFAULT_MIN_TOKENS = 40;
|
|
4
|
+
export const DEFAULT_MAX_TOKENS = 800;
|
|
5
|
+
export const DEFAULT_LIMIT = 50;
|
|
6
|
+
export const DEFAULT_MAX_BUCKET_SIZE = 200;
|
|
7
|
+
export const DEFAULT_GROUP_VARIANT_LIMIT = 5;
|
|
8
|
+
export const DEFAULT_SHINGLE_SIZE = 5;
|
|
9
|
+
export const DEFAULT_WINDOW_SIZE = 4;
|
|
10
|
+
export const GROUP_PRIMARY_LENGTH_RATIO_FLOOR = 0.7;
|
|
11
|
+
export const NEARBY_CHUNK_VARIANT_MAX_GAP = 2;
|
|
12
|
+
export const MIN_SIMILARITY_HINT_INDEX = 80;
|
|
13
|
+
export const confidenceRank = {
|
|
14
|
+
low: 1,
|
|
15
|
+
medium: 2,
|
|
16
|
+
high: 3,
|
|
17
|
+
};
|
|
18
|
+
export const cloneTypeRank = {
|
|
19
|
+
weak: 1,
|
|
20
|
+
near: 2,
|
|
21
|
+
renamed: 3,
|
|
22
|
+
exact: 4,
|
|
23
|
+
};
|
|
24
|
+
export function clampScore(score) {
|
|
25
|
+
return Math.max(0, Math.min(100, Math.round(score)));
|
|
26
|
+
}
|
|
27
|
+
export function lineOverlap(left, right) {
|
|
28
|
+
const startLine = Math.max(left.startLine, right.startLine);
|
|
29
|
+
const endLine = Math.min(left.endLine, right.endLine);
|
|
30
|
+
return Math.max(0, endLine - startLine + 1);
|
|
31
|
+
}
|
|
32
|
+
export function rangesSubstantiallyOverlap(left, right) {
|
|
33
|
+
if (left.file !== right.file || left.languageId !== right.languageId)
|
|
34
|
+
return false;
|
|
35
|
+
const overlap = lineOverlap(left, right);
|
|
36
|
+
if (!overlap)
|
|
37
|
+
return false;
|
|
38
|
+
return overlap / Math.min(lineSpan(left), lineSpan(right)) >= 0.8;
|
|
39
|
+
}
|
|
40
|
+
export function lineGap(left, right) {
|
|
41
|
+
if (left.endLine < right.startLine)
|
|
42
|
+
return right.startLine - left.endLine - 1;
|
|
43
|
+
if (right.endLine < left.startLine)
|
|
44
|
+
return left.startLine - right.endLine - 1;
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
export function rangesAreNearbyChunkVariants(left, right) {
|
|
48
|
+
if (left.file !== right.file || left.languageId !== right.languageId)
|
|
49
|
+
return false;
|
|
50
|
+
if (left.kind !== "chunk" || right.kind !== "chunk")
|
|
51
|
+
return false;
|
|
52
|
+
return lineGap(left, right) <= NEARBY_CHUNK_VARIANT_MAX_GAP;
|
|
53
|
+
}
|
|
54
|
+
export function ratio(left, right) {
|
|
55
|
+
if (!left || !right)
|
|
56
|
+
return 0;
|
|
57
|
+
return Math.min(left, right) / Math.max(left, right);
|
|
58
|
+
}
|
|
59
|
+
export function normalizeSimilarityIndex(value) {
|
|
60
|
+
if (!Number.isFinite(value))
|
|
61
|
+
return undefined;
|
|
62
|
+
const bounded = Math.max(0, Math.min(100, Math.round(value)));
|
|
63
|
+
if (bounded < MIN_SIMILARITY_HINT_INDEX)
|
|
64
|
+
return undefined;
|
|
65
|
+
return bounded;
|
|
66
|
+
}
|
|
67
|
+
/** Measures set similarity as intersection divided by union. */
|
|
68
|
+
export function jaccard(left, right) {
|
|
69
|
+
if (!left.size && !right.size)
|
|
70
|
+
return 1;
|
|
71
|
+
let intersection = 0;
|
|
72
|
+
for (const value of left) {
|
|
73
|
+
if (right.has(value))
|
|
74
|
+
intersection++;
|
|
75
|
+
}
|
|
76
|
+
const union = left.size + right.size - intersection;
|
|
77
|
+
if (!union)
|
|
78
|
+
return 0;
|
|
79
|
+
return intersection / union;
|
|
80
|
+
}
|
|
81
|
+
export function normalizeConfidence(value) {
|
|
82
|
+
return value ?? "medium";
|
|
83
|
+
}
|
|
84
|
+
export function normalizeIntegerOption(value, optionName, fallback, minValue, expectedDescription) {
|
|
85
|
+
const resolved = value ?? fallback;
|
|
86
|
+
if (!Number.isInteger(resolved) || resolved < minValue) {
|
|
87
|
+
throw new Error(`Invalid ${optionName} value "${String(resolved)}". Expected ${expectedDescription}.`);
|
|
88
|
+
}
|
|
89
|
+
return resolved;
|
|
90
|
+
}
|
|
91
|
+
export function normalizePositiveIntegerOption(value, optionName, fallback) {
|
|
92
|
+
return normalizeIntegerOption(value, optionName, fallback, 1, "a positive integer");
|
|
93
|
+
}
|
|
94
|
+
export function normalizeNonNegativeIntegerOption(value, optionName, fallback) {
|
|
95
|
+
return normalizeIntegerOption(value, optionName, fallback, 0, "a non-negative integer");
|
|
96
|
+
}
|
|
97
|
+
export function bestConfidence(left, right) {
|
|
98
|
+
if (confidenceRank[left] >= confidenceRank[right])
|
|
99
|
+
return left;
|
|
100
|
+
return right;
|
|
101
|
+
}
|
|
102
|
+
export function bestCloneType(left, right) {
|
|
103
|
+
if (cloneTypeRank[left] >= cloneTypeRank[right])
|
|
104
|
+
return left;
|
|
105
|
+
return right;
|
|
106
|
+
}
|
|
107
|
+
export function confidenceForScore(score) {
|
|
108
|
+
if (score >= 85)
|
|
109
|
+
return "high";
|
|
110
|
+
if (score >= 65)
|
|
111
|
+
return "medium";
|
|
112
|
+
return "low";
|
|
113
|
+
}
|
|
114
|
+
export function cloneTypeForPair(evidence, metrics) {
|
|
115
|
+
if (evidence.rawHash)
|
|
116
|
+
return "exact";
|
|
117
|
+
if ((evidence.astShape || evidence.normalizedHash) && metrics.tokenJaccard >= 0.75)
|
|
118
|
+
return "renamed";
|
|
119
|
+
if ((evidence.gitSimilarity ?? 0) >= 80)
|
|
120
|
+
return "near";
|
|
121
|
+
if (metrics.shingleOverlap >= 0.55 || metrics.tokenJaccard >= 0.72)
|
|
122
|
+
return "near";
|
|
123
|
+
return "weak";
|
|
124
|
+
}
|
|
125
|
+
export function shouldScoreSignatureEvidence(evidence, metrics) {
|
|
126
|
+
if (!evidence.signature)
|
|
127
|
+
return false;
|
|
128
|
+
if (evidence.rawHash || evidence.normalizedHash || evidence.astShape || evidence.gitSimilarity !== undefined) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
return metrics.shingleOverlap >= 0.55;
|
|
132
|
+
}
|
|
133
|
+
export function pairKey(left, right) {
|
|
134
|
+
if (left.id < right.id)
|
|
135
|
+
return `${left.id}\u0000${right.id}`;
|
|
136
|
+
return `${right.id}\u0000${left.id}`;
|
|
137
|
+
}
|
|
138
|
+
export function orderedPair(left, right) {
|
|
139
|
+
if (left.absoluteFile < right.absoluteFile)
|
|
140
|
+
return [left, right];
|
|
141
|
+
if (left.absoluteFile > right.absoluteFile)
|
|
142
|
+
return [right, left];
|
|
143
|
+
if (left.startLine <= right.startLine)
|
|
144
|
+
return [left, right];
|
|
145
|
+
return [right, left];
|
|
146
|
+
}
|
|
147
|
+
export function hasLineOverlap(left, right) {
|
|
148
|
+
if (left.absoluteFile !== right.absoluteFile)
|
|
149
|
+
return false;
|
|
150
|
+
return left.startLine <= right.endLine && right.startLine <= left.endLine;
|
|
151
|
+
}
|
|
152
|
+
export function addPairEvidence(pairs, evidenceKind, left, right) {
|
|
153
|
+
const key = pairKey(left, right);
|
|
154
|
+
const existing = pairs.get(key);
|
|
155
|
+
if (existing) {
|
|
156
|
+
if (evidenceKind === "signature") {
|
|
157
|
+
existing.signatureMatches++;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
existing[evidenceKind] = true;
|
|
161
|
+
}
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
pairs.set(key, {
|
|
165
|
+
left,
|
|
166
|
+
right,
|
|
167
|
+
rawHash: evidenceKind === "rawHash",
|
|
168
|
+
normalizedHash: evidenceKind === "normalizedHash",
|
|
169
|
+
astShape: evidenceKind === "astShape",
|
|
170
|
+
signature: false,
|
|
171
|
+
signatureMatches: evidenceKind === "signature" ? 1 : 0,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/** Visits every unique pair from one shared-evidence bucket. */
|
|
175
|
+
export function forEachBucketPair(bucket, pairFilter, unitFilter, visit) {
|
|
176
|
+
if (unitFilter) {
|
|
177
|
+
const targetUnits = bucket.filter(unitFilter);
|
|
178
|
+
const seenPairs = new Set();
|
|
179
|
+
for (const targetUnit of targetUnits) {
|
|
180
|
+
for (const otherUnit of bucket) {
|
|
181
|
+
if (targetUnit.id === otherUnit.id)
|
|
182
|
+
continue;
|
|
183
|
+
const [left, right] = orderedPair(targetUnit, otherUnit);
|
|
184
|
+
const key = pairKey(left, right);
|
|
185
|
+
if (seenPairs.has(key))
|
|
186
|
+
continue;
|
|
187
|
+
seenPairs.add(key);
|
|
188
|
+
if (pairFilter && !pairFilter(left, right))
|
|
189
|
+
continue;
|
|
190
|
+
visit(left, right);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
for (let i = 0; i < bucket.length; i++) {
|
|
196
|
+
for (let j = i + 1; j < bucket.length; j++) {
|
|
197
|
+
const [left, right] = orderedPair(bucket[i], bucket[j]);
|
|
198
|
+
if (pairFilter && !pairFilter(left, right))
|
|
199
|
+
continue;
|
|
200
|
+
visit(left, right);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** Adds every unique pair from one shared-evidence bucket. */
|
|
205
|
+
export function addBucketPairs(bucket, pairs, evidenceKind, pairFilter, unitFilter) {
|
|
206
|
+
forEachBucketPair(bucket, pairFilter, unitFilter, (left, right) => {
|
|
207
|
+
addPairEvidence(pairs, evidenceKind, left, right);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
export function bucketPairCountExceeds(bucket, limit, pairFilter, unitFilter) {
|
|
211
|
+
let count = 0;
|
|
212
|
+
const leftUnits = unitFilter ? bucket.filter(unitFilter) : bucket;
|
|
213
|
+
if (!leftUnits.length)
|
|
214
|
+
return false;
|
|
215
|
+
const seenPairs = new Set();
|
|
216
|
+
for (const leftUnit of leftUnits) {
|
|
217
|
+
for (const rightUnit of bucket) {
|
|
218
|
+
if (leftUnit.id === rightUnit.id)
|
|
219
|
+
continue;
|
|
220
|
+
const [left, right] = orderedPair(leftUnit, rightUnit);
|
|
221
|
+
const key = pairKey(left, right);
|
|
222
|
+
if (seenPairs.has(key))
|
|
223
|
+
continue;
|
|
224
|
+
seenPairs.add(key);
|
|
225
|
+
if (!pairFilter(left, right))
|
|
226
|
+
continue;
|
|
227
|
+
count++;
|
|
228
|
+
if (count > limit)
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
/** Adds bounded buckets and counts skipped high-fanout buckets. */
|
|
235
|
+
export function addBucketsToPairs(buckets, pairs, evidenceKind, maxBucketSize, pairFilter, unitFilter) {
|
|
236
|
+
let oversizedBuckets = 0;
|
|
237
|
+
for (const bucket of buckets.values()) {
|
|
238
|
+
if (bucket.length < 2)
|
|
239
|
+
continue;
|
|
240
|
+
if (unitFilter && !bucket.some(unitFilter))
|
|
241
|
+
continue;
|
|
242
|
+
if (bucket.length > maxBucketSize) {
|
|
243
|
+
if (!pairFilter || bucketPairCountExceeds(bucket, maxBucketSize, pairFilter, unitFilter)) {
|
|
244
|
+
oversizedBuckets++;
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
addBucketPairs(bucket, pairs, evidenceKind, pairFilter, unitFilter);
|
|
249
|
+
}
|
|
250
|
+
return oversizedBuckets;
|
|
251
|
+
}
|
|
252
|
+
export function addConsideredSignature(consideredSignaturesByUnit, unit, signature) {
|
|
253
|
+
const signatures = consideredSignaturesByUnit.get(unit.id);
|
|
254
|
+
if (signatures) {
|
|
255
|
+
signatures.add(signature);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
consideredSignaturesByUnit.set(unit.id, new Set([signature]));
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Two-pass signature prefilter: count shared fingerprints first, then allocate
|
|
262
|
+
* PairEvidence only for pairs that already have stronger evidence or meet the
|
|
263
|
+
* shared-fingerprint threshold (at least 2).
|
|
264
|
+
*/
|
|
265
|
+
export function addSignatureBucketsToPairs(buckets, pairs, consideredSignaturesByUnit, maxBucketSize, pairFilter, unitFilter) {
|
|
266
|
+
const signatureMatchCounts = new Map();
|
|
267
|
+
const signatureMatchUnits = new Map();
|
|
268
|
+
let oversizedBuckets = 0;
|
|
269
|
+
for (const [signature, bucket] of buckets) {
|
|
270
|
+
if (bucket.length < 2)
|
|
271
|
+
continue;
|
|
272
|
+
if (unitFilter && !bucket.some(unitFilter))
|
|
273
|
+
continue;
|
|
274
|
+
if (bucket.length > maxBucketSize) {
|
|
275
|
+
if (!pairFilter || bucketPairCountExceeds(bucket, maxBucketSize, pairFilter, unitFilter)) {
|
|
276
|
+
oversizedBuckets++;
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
for (const unit of bucket) {
|
|
281
|
+
addConsideredSignature(consideredSignaturesByUnit, unit, signature);
|
|
282
|
+
}
|
|
283
|
+
forEachBucketPair(bucket, pairFilter, unitFilter, (left, right) => {
|
|
284
|
+
const key = pairKey(left, right);
|
|
285
|
+
const next = (signatureMatchCounts.get(key) ?? 0) + 1;
|
|
286
|
+
signatureMatchCounts.set(key, next);
|
|
287
|
+
// Threshold floor is >= 2; keep unit refs only once a pair can qualify.
|
|
288
|
+
if (next === 2 && !pairs.has(key) && !signatureMatchUnits.has(key)) {
|
|
289
|
+
signatureMatchUnits.set(key, [left, right]);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
for (const [key, count] of signatureMatchCounts) {
|
|
294
|
+
const existing = pairs.get(key);
|
|
295
|
+
if (existing) {
|
|
296
|
+
existing.signatureMatches = count;
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (count < 2)
|
|
300
|
+
continue;
|
|
301
|
+
const units = signatureMatchUnits.get(key);
|
|
302
|
+
if (!units)
|
|
303
|
+
continue;
|
|
304
|
+
const [left, right] = units;
|
|
305
|
+
if (!hasEnoughSharedFingerprintsFor(count, left.id, right.id, consideredSignaturesByUnit)) {
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
pairs.set(key, {
|
|
309
|
+
left,
|
|
310
|
+
right,
|
|
311
|
+
rawHash: false,
|
|
312
|
+
normalizedHash: false,
|
|
313
|
+
astShape: false,
|
|
314
|
+
signature: false,
|
|
315
|
+
signatureMatches: count,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
return oversizedBuckets;
|
|
319
|
+
}
|
|
320
|
+
/** Combines exact, normalized, fingerprint, size, and complexity signals. */
|
|
321
|
+
export function scorePair(evidence, metrics) {
|
|
322
|
+
let score = 0;
|
|
323
|
+
const reasons = [];
|
|
324
|
+
if (evidence.rawHash) {
|
|
325
|
+
score += 68;
|
|
326
|
+
reasons.push("identical text");
|
|
327
|
+
}
|
|
328
|
+
if (evidence.normalizedHash) {
|
|
329
|
+
score += 48;
|
|
330
|
+
reasons.push("matching normalized token stream");
|
|
331
|
+
}
|
|
332
|
+
if (evidence.astShape) {
|
|
333
|
+
score += 40;
|
|
334
|
+
reasons.push("matching AST shape");
|
|
335
|
+
}
|
|
336
|
+
if (evidence.gitSimilarity !== undefined && evidence.gitSimilarity >= 80) {
|
|
337
|
+
score += 20;
|
|
338
|
+
reasons.push(`git similarity ${evidence.gitSimilarity}%`);
|
|
339
|
+
}
|
|
340
|
+
if (shouldScoreSignatureEvidence(evidence, metrics)) {
|
|
341
|
+
score += 14;
|
|
342
|
+
reasons.push("shared fingerprint bucket");
|
|
343
|
+
}
|
|
344
|
+
score += metrics.tokenJaccard * 24;
|
|
345
|
+
score += metrics.shingleOverlap * 26;
|
|
346
|
+
score += metrics.lengthRatio * 8;
|
|
347
|
+
score += metrics.lineSpanRatio * 5;
|
|
348
|
+
if (evidence.left.symbolKind !== undefined && evidence.left.symbolKind === evidence.right.symbolKind) {
|
|
349
|
+
score += 4;
|
|
350
|
+
reasons.push(`matching ${evidence.left.symbolKind} units`);
|
|
351
|
+
}
|
|
352
|
+
if (metrics.complexityDelta !== undefined && metrics.complexityDelta <= 2) {
|
|
353
|
+
score += 3;
|
|
354
|
+
reasons.push("similar complexity");
|
|
355
|
+
}
|
|
356
|
+
if (metrics.lengthRatio < 0.45)
|
|
357
|
+
score -= 18;
|
|
358
|
+
if (evidence.left.absoluteFile === evidence.right.absoluteFile)
|
|
359
|
+
score -= 8;
|
|
360
|
+
return { score: clampScore(score), reasons };
|
|
361
|
+
}
|
|
362
|
+
export function metricsForPair(evidence) {
|
|
363
|
+
const left = evidence.left;
|
|
364
|
+
const right = evidence.right;
|
|
365
|
+
const metrics = {
|
|
366
|
+
tokenJaccard: jaccard(left.tokenSet, right.tokenSet),
|
|
367
|
+
shingleOverlap: jaccard(left.signatures, right.signatures),
|
|
368
|
+
lengthRatio: ratio(left.tokenCount, right.tokenCount),
|
|
369
|
+
lineSpanRatio: ratio(lineSpan(left), lineSpan(right)),
|
|
370
|
+
...(evidence.astShape ? { astShapeEqual: true } : {}),
|
|
371
|
+
...(evidence.gitSimilarity !== undefined ? { gitSimilarity: evidence.gitSimilarity } : {}),
|
|
372
|
+
};
|
|
373
|
+
if (left.complexity !== undefined && right.complexity !== undefined) {
|
|
374
|
+
metrics.complexityDelta = Math.abs(left.complexity - right.complexity);
|
|
375
|
+
}
|
|
376
|
+
return metrics;
|
|
377
|
+
}
|
|
378
|
+
export function addToBucket(buckets, key, unit) {
|
|
379
|
+
appendToArrayMap(buckets, key, unit);
|
|
380
|
+
}
|
|
381
|
+
export function prepareDuplicateCandidateBuckets(units) {
|
|
382
|
+
const rawHashBuckets = new Map();
|
|
383
|
+
const normalizedHashBuckets = new Map();
|
|
384
|
+
const astShapeBuckets = new Map();
|
|
385
|
+
const signatureBuckets = new Map();
|
|
386
|
+
for (const unit of units) {
|
|
387
|
+
const languagePrefix = `${unit.languageId}:`;
|
|
388
|
+
addToBucket(rawHashBuckets, `${languagePrefix}${unit.rawHash}`, unit);
|
|
389
|
+
addToBucket(normalizedHashBuckets, `${languagePrefix}${unit.normalizedHash}`, unit);
|
|
390
|
+
if (unit.astShapeHash !== undefined) {
|
|
391
|
+
addToBucket(astShapeBuckets, `${languagePrefix}${unit.astShapeHash}`, unit);
|
|
392
|
+
}
|
|
393
|
+
for (const signature of unit.signatures) {
|
|
394
|
+
addToBucket(signatureBuckets, `${languagePrefix}${signature}`, unit);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return {
|
|
398
|
+
units,
|
|
399
|
+
rawHashBuckets,
|
|
400
|
+
normalizedHashBuckets,
|
|
401
|
+
astShapeBuckets,
|
|
402
|
+
signatureBuckets,
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
export function filterPreparedDuplicateBucketMap(buckets, unitFilter) {
|
|
406
|
+
const filteredBuckets = new Map();
|
|
407
|
+
for (const [key, bucket] of buckets) {
|
|
408
|
+
const filteredBucket = bucket.filter(unitFilter);
|
|
409
|
+
if (filteredBucket.length)
|
|
410
|
+
filteredBuckets.set(key, filteredBucket);
|
|
411
|
+
}
|
|
412
|
+
return filteredBuckets;
|
|
413
|
+
}
|
|
414
|
+
export function filterPreparedDuplicateBuckets(preparedBuckets, unitFilter) {
|
|
415
|
+
return {
|
|
416
|
+
units: preparedBuckets.units.filter(unitFilter),
|
|
417
|
+
rawHashBuckets: filterPreparedDuplicateBucketMap(preparedBuckets.rawHashBuckets, unitFilter),
|
|
418
|
+
normalizedHashBuckets: filterPreparedDuplicateBucketMap(preparedBuckets.normalizedHashBuckets, unitFilter),
|
|
419
|
+
astShapeBuckets: filterPreparedDuplicateBucketMap(preparedBuckets.astShapeBuckets, unitFilter),
|
|
420
|
+
signatureBuckets: filterPreparedDuplicateBucketMap(preparedBuckets.signatureBuckets, unitFilter),
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
/** Groups units by cheap fingerprints before expensive pair scoring. */
|
|
424
|
+
export function buildCandidatePairsFromPreparedBuckets(preparedBuckets, maxBucketSize, similarityHints, projectRoot, pairFilter, unitFilter) {
|
|
425
|
+
const pairs = new Map();
|
|
426
|
+
const consideredSignaturesByUnit = new Map();
|
|
427
|
+
let oversizedBuckets = 0;
|
|
428
|
+
oversizedBuckets += addBucketsToPairs(preparedBuckets.rawHashBuckets, pairs, "rawHash", maxBucketSize, pairFilter, unitFilter);
|
|
429
|
+
oversizedBuckets += addBucketsToPairs(preparedBuckets.normalizedHashBuckets, pairs, "normalizedHash", maxBucketSize, pairFilter, unitFilter);
|
|
430
|
+
oversizedBuckets += addBucketsToPairs(preparedBuckets.astShapeBuckets, pairs, "astShape", maxBucketSize, pairFilter, unitFilter);
|
|
431
|
+
oversizedBuckets += addSimilarityHintPairs(preparedBuckets.units, pairs, similarityHints, projectRoot, maxBucketSize, pairFilter);
|
|
432
|
+
oversizedBuckets += addSignatureBucketsToPairs(preparedBuckets.signatureBuckets, pairs, consideredSignaturesByUnit, maxBucketSize, pairFilter, unitFilter);
|
|
433
|
+
for (const [key, evidence] of pairs) {
|
|
434
|
+
if (hasEnoughSharedFingerprints(evidence, consideredSignaturesByUnit)) {
|
|
435
|
+
evidence.signature = true;
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
if (!evidence.rawHash && !evidence.normalizedHash && !evidence.astShape && evidence.gitSimilarity === undefined) {
|
|
439
|
+
pairs.delete(key);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return { pairs, oversizedBuckets };
|
|
443
|
+
}
|
|
444
|
+
export function buildCandidatePairs(units, maxBucketSize, similarityHints, projectRoot, pairFilter, unitFilter) {
|
|
445
|
+
return buildCandidatePairsFromPreparedBuckets(prepareDuplicateCandidateBuckets(units), maxBucketSize, similarityHints, projectRoot, pairFilter, unitFilter);
|
|
446
|
+
}
|
|
447
|
+
export function addSimilarityHintPairs(units, pairs, similarityHints, projectRoot, maxBucketSize, pairFilter) {
|
|
448
|
+
if (!similarityHints?.length)
|
|
449
|
+
return 0;
|
|
450
|
+
const unitsByFile = new Map();
|
|
451
|
+
for (const unit of units) {
|
|
452
|
+
const bucket = unitsByFile.get(unit.absoluteFile);
|
|
453
|
+
if (bucket) {
|
|
454
|
+
bucket.push(unit);
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
unitsByFile.set(unit.absoluteFile, [unit]);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
let oversizedHints = 0;
|
|
461
|
+
for (const hint of similarityHints) {
|
|
462
|
+
const similarityIndex = normalizeSimilarityIndex(hint.similarityIndex);
|
|
463
|
+
if (similarityIndex === undefined)
|
|
464
|
+
continue;
|
|
465
|
+
const leftFile = normalizeSimilarityHintFile(hint.leftFile, projectRoot);
|
|
466
|
+
const rightFile = normalizeSimilarityHintFile(hint.rightFile, projectRoot);
|
|
467
|
+
if (!leftFile || !rightFile || leftFile === rightFile)
|
|
468
|
+
continue;
|
|
469
|
+
const leftUnits = unitsByFile.get(leftFile);
|
|
470
|
+
const rightUnits = unitsByFile.get(rightFile);
|
|
471
|
+
if (!leftUnits?.length || !rightUnits?.length)
|
|
472
|
+
continue;
|
|
473
|
+
if (similarityHintPairCountExceeds(leftUnits, rightUnits, maxBucketSize, pairFilter)) {
|
|
474
|
+
oversizedHints++;
|
|
475
|
+
addAlignedSimilarityHintPairs(pairs, leftUnits, rightUnits, similarityIndex, maxBucketSize, pairFilter);
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
for (const leftUnit of leftUnits) {
|
|
479
|
+
for (const rightUnit of rightUnits) {
|
|
480
|
+
if (leftUnit.languageId !== rightUnit.languageId)
|
|
481
|
+
continue;
|
|
482
|
+
const [left, right] = orderedPair(leftUnit, rightUnit);
|
|
483
|
+
if (pairFilter && !pairFilter(left, right))
|
|
484
|
+
continue;
|
|
485
|
+
addSimilarityHintPair(pairs, left, right, similarityIndex);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
return oversizedHints;
|
|
490
|
+
}
|
|
491
|
+
export function similarityHintPairCountExceeds(leftUnits, rightUnits, limit, pairFilter) {
|
|
492
|
+
let count = 0;
|
|
493
|
+
for (const leftUnit of leftUnits) {
|
|
494
|
+
for (const rightUnit of rightUnits) {
|
|
495
|
+
if (leftUnit.languageId !== rightUnit.languageId)
|
|
496
|
+
continue;
|
|
497
|
+
const [left, right] = orderedPair(leftUnit, rightUnit);
|
|
498
|
+
if (pairFilter && !pairFilter(left, right))
|
|
499
|
+
continue;
|
|
500
|
+
count++;
|
|
501
|
+
if (count > limit)
|
|
502
|
+
return true;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
export function similarityAlignmentKey(unit) {
|
|
508
|
+
return [unit.languageId, unit.kind, unit.symbolKind ?? ""].join(":");
|
|
509
|
+
}
|
|
510
|
+
export function addAlignedSimilarityHintPairs(pairs, leftUnits, rightUnits, similarityIndex, maxPairs, pairFilter) {
|
|
511
|
+
const rightByKey = new Map();
|
|
512
|
+
for (const unit of rightUnits) {
|
|
513
|
+
const key = similarityAlignmentKey(unit);
|
|
514
|
+
const bucket = rightByKey.get(key);
|
|
515
|
+
if (bucket)
|
|
516
|
+
bucket.push(unit);
|
|
517
|
+
else
|
|
518
|
+
rightByKey.set(key, [unit]);
|
|
519
|
+
}
|
|
520
|
+
for (const bucket of rightByKey.values()) {
|
|
521
|
+
bucket.sort(compareUnitRefs);
|
|
522
|
+
}
|
|
523
|
+
const leftByKey = new Map();
|
|
524
|
+
for (const unit of leftUnits) {
|
|
525
|
+
const key = similarityAlignmentKey(unit);
|
|
526
|
+
const bucket = leftByKey.get(key);
|
|
527
|
+
if (bucket)
|
|
528
|
+
bucket.push(unit);
|
|
529
|
+
else
|
|
530
|
+
leftByKey.set(key, [unit]);
|
|
531
|
+
}
|
|
532
|
+
for (const bucket of leftByKey.values()) {
|
|
533
|
+
bucket.sort(compareUnitRefs);
|
|
534
|
+
}
|
|
535
|
+
const seenPairs = new Set();
|
|
536
|
+
let addedPairs = 0;
|
|
537
|
+
for (const [key, sortedLeftUnits] of Array.from(leftByKey.entries()).sort(([left], [right]) => left.localeCompare(right))) {
|
|
538
|
+
const sortedRightUnits = rightByKey.get(key);
|
|
539
|
+
if (!sortedRightUnits?.length)
|
|
540
|
+
continue;
|
|
541
|
+
const limit = Math.min(sortedLeftUnits.length, sortedRightUnits.length);
|
|
542
|
+
for (let index = 0; index < limit; index++) {
|
|
543
|
+
if (addedPairs >= maxPairs)
|
|
544
|
+
return;
|
|
545
|
+
const [left, right] = orderedPair(sortedLeftUnits[index], sortedRightUnits[index]);
|
|
546
|
+
const pairId = pairKey(left, right);
|
|
547
|
+
if (seenPairs.has(pairId))
|
|
548
|
+
continue;
|
|
549
|
+
seenPairs.add(pairId);
|
|
550
|
+
if (pairFilter && !pairFilter(left, right))
|
|
551
|
+
continue;
|
|
552
|
+
addSimilarityHintPair(pairs, left, right, similarityIndex);
|
|
553
|
+
addedPairs++;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
export function normalizeSimilarityHintFile(file, projectRoot) {
|
|
558
|
+
try {
|
|
559
|
+
return normalizeDetectionFile(file, projectRoot);
|
|
560
|
+
}
|
|
561
|
+
catch {
|
|
562
|
+
return undefined;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
export function addSimilarityHintPair(pairs, left, right, similarityIndex) {
|
|
566
|
+
const key = pairKey(left, right);
|
|
567
|
+
const existing = pairs.get(key);
|
|
568
|
+
if (existing) {
|
|
569
|
+
existing.gitSimilarity = Math.max(existing.gitSimilarity ?? 0, similarityIndex);
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
pairs.set(key, {
|
|
573
|
+
left,
|
|
574
|
+
right,
|
|
575
|
+
rawHash: false,
|
|
576
|
+
normalizedHash: false,
|
|
577
|
+
astShape: false,
|
|
578
|
+
gitSimilarity: similarityIndex,
|
|
579
|
+
signature: false,
|
|
580
|
+
signatureMatches: 0,
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
/** Requires enough shared fingerprints to avoid incidental syntax matches. */
|
|
584
|
+
export function hasEnoughSharedFingerprintsFor(signatureMatches, leftUnitId, rightUnitId, consideredSignaturesByUnit) {
|
|
585
|
+
if (!signatureMatches)
|
|
586
|
+
return false;
|
|
587
|
+
const leftConsideredSignatures = consideredSignaturesByUnit.get(leftUnitId)?.size ?? 0;
|
|
588
|
+
const rightConsideredSignatures = consideredSignaturesByUnit.get(rightUnitId)?.size ?? 0;
|
|
589
|
+
const smallerConsideredSignatureCount = Math.min(leftConsideredSignatures, rightConsideredSignatures);
|
|
590
|
+
if (!smallerConsideredSignatureCount)
|
|
591
|
+
return false;
|
|
592
|
+
const minimumShared = Math.max(2, Math.ceil(smallerConsideredSignatureCount * 0.25));
|
|
593
|
+
return signatureMatches >= minimumShared;
|
|
594
|
+
}
|
|
595
|
+
export function hasEnoughSharedFingerprints(evidence, consideredSignaturesByUnit) {
|
|
596
|
+
return hasEnoughSharedFingerprintsFor(evidence.signatureMatches, evidence.left.id, evidence.right.id, consideredSignaturesByUnit);
|
|
597
|
+
}
|
|
598
|
+
export function suggestionForPair(evidence) {
|
|
599
|
+
const metrics = metricsForPair(evidence);
|
|
600
|
+
const { score, reasons } = scorePair(evidence, metrics);
|
|
601
|
+
return {
|
|
602
|
+
score,
|
|
603
|
+
confidence: confidenceForScore(score),
|
|
604
|
+
cloneType: cloneTypeForPair(evidence, metrics),
|
|
605
|
+
left: unitRef(evidence.left),
|
|
606
|
+
right: unitRef(evidence.right),
|
|
607
|
+
metrics,
|
|
608
|
+
reasons,
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
export function unitRef(unit) {
|
|
612
|
+
return {
|
|
613
|
+
file: unit.file,
|
|
614
|
+
startLine: unit.startLine,
|
|
615
|
+
endLine: unit.endLine,
|
|
616
|
+
languageId: unit.languageId,
|
|
617
|
+
kind: unit.kind,
|
|
618
|
+
tokenCount: unit.tokenCount,
|
|
619
|
+
handle: unit.handle,
|
|
620
|
+
fileHandle: unit.fileHandle,
|
|
621
|
+
chunkHandle: unit.chunkHandle,
|
|
622
|
+
...(unit.sqlHandle !== undefined ? { sqlHandle: unit.sqlHandle } : {}),
|
|
623
|
+
...(unit.symbolHandle !== undefined ? { symbolHandle: unit.symbolHandle } : {}),
|
|
624
|
+
...(unit.name !== undefined ? { name: unit.name } : {}),
|
|
625
|
+
...(unit.symbolKind !== undefined ? { symbolKind: unit.symbolKind } : {}),
|
|
626
|
+
...(unit.complexity !== undefined ? { complexity: unit.complexity } : {}),
|
|
627
|
+
...(unit.looksLikeImportList ? { looksLikeImportList: true } : {}),
|
|
628
|
+
...(unit.looksLikeBarrel ? { looksLikeBarrel: true } : {}),
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
export function unitRefIdentity(ref) {
|
|
632
|
+
return [ref.file, ref.startLine, ref.endLine, ref.languageId, ref.kind, ref.name ?? "", ref.symbolKind ?? ""].join("\u0000");
|
|
633
|
+
}
|
|
634
|
+
export function unitRefRangeIdentity(ref) {
|
|
635
|
+
return [ref.file, ref.startLine, ref.endLine, ref.languageId].join("\u0000");
|
|
636
|
+
}
|
|
637
|
+
export function compareUnitRefs(left, right) {
|
|
638
|
+
const fileCompare = left.file.localeCompare(right.file);
|
|
639
|
+
if (fileCompare)
|
|
640
|
+
return fileCompare;
|
|
641
|
+
const startCompare = left.startLine - right.startLine;
|
|
642
|
+
if (startCompare)
|
|
643
|
+
return startCompare;
|
|
644
|
+
const endCompare = left.endLine - right.endLine;
|
|
645
|
+
if (endCompare)
|
|
646
|
+
return endCompare;
|
|
647
|
+
return (left.name ?? "").localeCompare(right.name ?? "");
|
|
648
|
+
}
|
|
649
|
+
export function unitPrimaryRank(ref) {
|
|
650
|
+
let rank = 0;
|
|
651
|
+
if (ref.kind === "symbol")
|
|
652
|
+
rank += 8;
|
|
653
|
+
if (ref.name)
|
|
654
|
+
rank += 4;
|
|
655
|
+
if (ref.symbolKind !== undefined)
|
|
656
|
+
rank += 2;
|
|
657
|
+
return rank;
|
|
658
|
+
}
|
|
659
|
+
export function comparePrimaryUnitRefs(left, right) {
|
|
660
|
+
const rankCompare = unitPrimaryRank(right) - unitPrimaryRank(left);
|
|
661
|
+
if (rankCompare)
|
|
662
|
+
return rankCompare;
|
|
663
|
+
const spanCompare = lineSpan(left) - lineSpan(right);
|
|
664
|
+
if (spanCompare)
|
|
665
|
+
return spanCompare;
|
|
666
|
+
return compareUnitRefs(left, right);
|
|
667
|
+
}
|
|
668
|
+
export function suggestionPrimaryRank(suggestion) {
|
|
669
|
+
let rank = 0;
|
|
670
|
+
if (suggestion.left.kind === "symbol")
|
|
671
|
+
rank += 8;
|
|
672
|
+
if (suggestion.right.kind === "symbol")
|
|
673
|
+
rank += 8;
|
|
674
|
+
if (suggestion.left.name)
|
|
675
|
+
rank += 2;
|
|
676
|
+
if (suggestion.right.name)
|
|
677
|
+
rank += 2;
|
|
678
|
+
return rank;
|
|
679
|
+
}
|
|
680
|
+
export function compareSuggestions(left, right) {
|
|
681
|
+
const scoreCompare = right.score - left.score;
|
|
682
|
+
if (scoreCompare)
|
|
683
|
+
return scoreCompare;
|
|
684
|
+
const confidenceCompare = confidenceRank[right.confidence] - confidenceRank[left.confidence];
|
|
685
|
+
if (confidenceCompare)
|
|
686
|
+
return confidenceCompare;
|
|
687
|
+
const cloneTypeCompare = cloneTypeRank[right.cloneType] - cloneTypeRank[left.cloneType];
|
|
688
|
+
if (cloneTypeCompare)
|
|
689
|
+
return cloneTypeCompare;
|
|
690
|
+
const leftFileCompare = left.left.file.localeCompare(right.left.file);
|
|
691
|
+
if (leftFileCompare)
|
|
692
|
+
return leftFileCompare;
|
|
693
|
+
const rightFileCompare = left.right.file.localeCompare(right.right.file);
|
|
694
|
+
if (rightFileCompare)
|
|
695
|
+
return rightFileCompare;
|
|
696
|
+
return left.left.startLine - right.left.startLine;
|
|
697
|
+
}
|
|
698
|
+
export function compareSuggestionsForPrimary(left, right) {
|
|
699
|
+
const rankCompare = suggestionPrimaryRank(right) - suggestionPrimaryRank(left);
|
|
700
|
+
if (rankCompare)
|
|
701
|
+
return rankCompare;
|
|
702
|
+
return compareSuggestions(left, right);
|
|
703
|
+
}
|
|
704
|
+
export function createUnitClusters(refs) {
|
|
705
|
+
const uniqueRefs = new Map();
|
|
706
|
+
for (const ref of refs)
|
|
707
|
+
uniqueRefs.set(unitRefIdentity(ref), ref);
|
|
708
|
+
const parent = new Map();
|
|
709
|
+
for (const key of uniqueRefs.keys())
|
|
710
|
+
parent.set(key, key);
|
|
711
|
+
const find = (key) => {
|
|
712
|
+
const current = parent.get(key);
|
|
713
|
+
if (current === undefined || current === key)
|
|
714
|
+
return key;
|
|
715
|
+
const root = find(current);
|
|
716
|
+
parent.set(key, root);
|
|
717
|
+
return root;
|
|
718
|
+
};
|
|
719
|
+
const union = (left, right) => {
|
|
720
|
+
const leftRoot = find(left);
|
|
721
|
+
const rightRoot = find(right);
|
|
722
|
+
if (leftRoot === rightRoot)
|
|
723
|
+
return;
|
|
724
|
+
if (leftRoot < rightRoot) {
|
|
725
|
+
parent.set(rightRoot, leftRoot);
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
parent.set(leftRoot, rightRoot);
|
|
729
|
+
};
|
|
730
|
+
const refsByFile = new Map();
|
|
731
|
+
for (const [key, ref] of uniqueRefs) {
|
|
732
|
+
const fileKey = `${ref.file}\u0000${ref.languageId}`;
|
|
733
|
+
const existing = refsByFile.get(fileKey);
|
|
734
|
+
if (existing)
|
|
735
|
+
existing.push({ key, ref });
|
|
736
|
+
else
|
|
737
|
+
refsByFile.set(fileKey, [{ key, ref }]);
|
|
738
|
+
}
|
|
739
|
+
for (const fileRefs of refsByFile.values()) {
|
|
740
|
+
fileRefs.sort((left, right) => compareUnitRefs(left.ref, right.ref));
|
|
741
|
+
for (let i = 0; i < fileRefs.length; i++) {
|
|
742
|
+
const left = fileRefs[i];
|
|
743
|
+
for (let j = i + 1; j < fileRefs.length; j++) {
|
|
744
|
+
const right = fileRefs[j];
|
|
745
|
+
if (right.ref.startLine > left.ref.endLine + NEARBY_CHUNK_VARIANT_MAX_GAP + 1)
|
|
746
|
+
break;
|
|
747
|
+
if (rangesSubstantiallyOverlap(left.ref, right.ref) || rangesAreNearbyChunkVariants(left.ref, right.ref)) {
|
|
748
|
+
union(left.key, right.key);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
const refsByRoot = new Map();
|
|
754
|
+
for (const [key, ref] of uniqueRefs) {
|
|
755
|
+
const root = find(key);
|
|
756
|
+
const existing = refsByRoot.get(root);
|
|
757
|
+
if (existing)
|
|
758
|
+
existing.push(ref);
|
|
759
|
+
else
|
|
760
|
+
refsByRoot.set(root, [ref]);
|
|
761
|
+
}
|
|
762
|
+
const clustersByRef = new Map();
|
|
763
|
+
for (const refsInCluster of refsByRoot.values()) {
|
|
764
|
+
refsInCluster.sort(comparePrimaryUnitRefs);
|
|
765
|
+
const primary = refsInCluster[0];
|
|
766
|
+
const cluster = { id: shortHashText(unitRefIdentity(primary)), refs: refsInCluster, primary };
|
|
767
|
+
for (const ref of refsInCluster)
|
|
768
|
+
clustersByRef.set(unitRefIdentity(ref), cluster);
|
|
769
|
+
}
|
|
770
|
+
return clustersByRef;
|
|
771
|
+
}
|
|
772
|
+
export function singletonUnitCluster(ref) {
|
|
773
|
+
return { id: shortHashText(unitRefIdentity(ref)), refs: [ref], primary: ref };
|
|
774
|
+
}
|
|
775
|
+
export function orderedGroupKey(left, right) {
|
|
776
|
+
if (left.id < right.id)
|
|
777
|
+
return `${left.id}\u0000${right.id}`;
|
|
778
|
+
return `${right.id}\u0000${left.id}`;
|
|
779
|
+
}
|
|
780
|
+
export function orderedUnitPairKey(left, right) {
|
|
781
|
+
const leftKey = unitRefIdentity(left);
|
|
782
|
+
const rightKey = unitRefIdentity(right);
|
|
783
|
+
if (leftKey < rightKey)
|
|
784
|
+
return `${leftKey}\u0000${rightKey}`;
|
|
785
|
+
return `${rightKey}\u0000${leftKey}`;
|
|
786
|
+
}
|
|
787
|
+
export function orderedUnitRangePairKey(left, right) {
|
|
788
|
+
const leftKey = unitRefRangeIdentity(left);
|
|
789
|
+
const rightKey = unitRefRangeIdentity(right);
|
|
790
|
+
if (leftKey < rightKey)
|
|
791
|
+
return `${leftKey}\u0000${rightKey}`;
|
|
792
|
+
return `${rightKey}\u0000${leftKey}`;
|
|
793
|
+
}
|
|
794
|
+
export function suggestionVariantKey(suggestion) {
|
|
795
|
+
return [
|
|
796
|
+
orderedUnitPairKey(suggestion.left, suggestion.right),
|
|
797
|
+
suggestion.score,
|
|
798
|
+
suggestion.confidence,
|
|
799
|
+
suggestion.cloneType,
|
|
800
|
+
].join("\u0000");
|
|
801
|
+
}
|
|
802
|
+
export function duplicateUnitLineSpan(unit) {
|
|
803
|
+
return Math.max(0, unit.endLine - unit.startLine + 1);
|
|
804
|
+
}
|
|
805
|
+
export function reducedLinesForPair(left, right) {
|
|
806
|
+
return Math.min(duplicateUnitLineSpan(left), duplicateUnitLineSpan(right));
|
|
807
|
+
}
|
|
808
|
+
export function estimatedLinesSavedForLocations(locations) {
|
|
809
|
+
if (locations.length < 2)
|
|
810
|
+
return 0;
|
|
811
|
+
const spansByFile = new Map();
|
|
812
|
+
for (const location of locations) {
|
|
813
|
+
appendToArrayMap(spansByFile, location.file, {
|
|
814
|
+
startLine: location.startLine,
|
|
815
|
+
endLine: location.endLine,
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
const mergedSpanLengths = Array.from(spansByFile.values()).flatMap((spans) => {
|
|
819
|
+
const sortedSpans = [...spans].sort((left, right) => left.startLine - right.startLine || left.endLine - right.endLine);
|
|
820
|
+
const lengths = [];
|
|
821
|
+
let currentStart = 0;
|
|
822
|
+
let currentEnd = 0;
|
|
823
|
+
let hasCurrent = false;
|
|
824
|
+
for (const span of sortedSpans) {
|
|
825
|
+
if (!hasCurrent) {
|
|
826
|
+
currentStart = span.startLine;
|
|
827
|
+
currentEnd = span.endLine;
|
|
828
|
+
hasCurrent = true;
|
|
829
|
+
continue;
|
|
830
|
+
}
|
|
831
|
+
if (span.startLine <= currentEnd) {
|
|
832
|
+
currentEnd = Math.max(currentEnd, span.endLine);
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
lengths.push(Math.max(0, currentEnd - currentStart + 1));
|
|
836
|
+
currentStart = span.startLine;
|
|
837
|
+
currentEnd = span.endLine;
|
|
838
|
+
}
|
|
839
|
+
if (hasCurrent) {
|
|
840
|
+
lengths.push(Math.max(0, currentEnd - currentStart + 1));
|
|
841
|
+
}
|
|
842
|
+
return lengths;
|
|
843
|
+
});
|
|
844
|
+
const total = mergedSpanLengths.reduce((sum, spanLength) => sum + spanLength, 0);
|
|
845
|
+
const max = mergedSpanLengths.reduce((best, spanLength) => Math.max(best, spanLength), 0);
|
|
846
|
+
return Math.max(0, total - max);
|
|
847
|
+
}
|
|
848
|
+
export function duplicateUnitRefQuality(unit) {
|
|
849
|
+
let score = 0;
|
|
850
|
+
if (unit.kind === "symbol")
|
|
851
|
+
score += 8;
|
|
852
|
+
if (unit.name)
|
|
853
|
+
score += 4;
|
|
854
|
+
if (unit.symbolKind !== undefined)
|
|
855
|
+
score += 2;
|
|
856
|
+
if (unit.symbolHandle !== undefined)
|
|
857
|
+
score += 1;
|
|
858
|
+
return score;
|
|
859
|
+
}
|
|
860
|
+
export function preferredDuplicateUnitRef(left, right) {
|
|
861
|
+
const qualityDiff = duplicateUnitRefQuality(left) - duplicateUnitRefQuality(right);
|
|
862
|
+
if (qualityDiff > 0)
|
|
863
|
+
return left;
|
|
864
|
+
if (qualityDiff < 0)
|
|
865
|
+
return right;
|
|
866
|
+
return compareUnitRefs(left, right) <= 0 ? left : right;
|
|
867
|
+
}
|
|
868
|
+
export function mergeLocations(locations) {
|
|
869
|
+
const locationsByKey = new Map();
|
|
870
|
+
for (const location of locations) {
|
|
871
|
+
const key = unitRefRangeIdentity(location);
|
|
872
|
+
const existing = locationsByKey.get(key);
|
|
873
|
+
locationsByKey.set(key, existing ? preferredDuplicateUnitRef(existing, location) : location);
|
|
874
|
+
}
|
|
875
|
+
const merged = [];
|
|
876
|
+
for (const location of Array.from(locationsByKey.values()).sort(comparePrimaryUnitRefs)) {
|
|
877
|
+
const overlappingIndex = merged.findIndex((existing) => rangesSubstantiallyOverlap(existing, location));
|
|
878
|
+
if (overlappingIndex === -1) {
|
|
879
|
+
merged.push(location);
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
merged[overlappingIndex] = preferredDuplicateUnitRef(merged[overlappingIndex], location);
|
|
883
|
+
}
|
|
884
|
+
return merged.sort(compareUnitRefs);
|
|
885
|
+
}
|
|
886
|
+
export function groupLocations(group) {
|
|
887
|
+
if (group.locations.length)
|
|
888
|
+
return [...group.locations].sort(compareUnitRefs);
|
|
889
|
+
return mergeLocations([
|
|
890
|
+
group.primaryLeft,
|
|
891
|
+
group.primaryRight,
|
|
892
|
+
...group.variants.flatMap((variant) => [variant.left, variant.right]),
|
|
893
|
+
]);
|
|
894
|
+
}
|
|
895
|
+
export function locationsForSuggestions(primaryLeft, primaryRight, suggestions) {
|
|
896
|
+
return mergeLocations([
|
|
897
|
+
primaryLeft,
|
|
898
|
+
primaryRight,
|
|
899
|
+
...suggestions.flatMap((suggestion) => [suggestion.left, suggestion.right]),
|
|
900
|
+
]);
|
|
901
|
+
}
|
|
902
|
+
export function commonLocationName(locations) {
|
|
903
|
+
let name;
|
|
904
|
+
for (const location of locations) {
|
|
905
|
+
if (!location.name)
|
|
906
|
+
return undefined;
|
|
907
|
+
if (name === undefined) {
|
|
908
|
+
name = location.name;
|
|
909
|
+
continue;
|
|
910
|
+
}
|
|
911
|
+
if (name !== location.name)
|
|
912
|
+
return undefined;
|
|
913
|
+
}
|
|
914
|
+
return name;
|
|
915
|
+
}
|
|
916
|
+
export function clusterFiles(locations) {
|
|
917
|
+
return Array.from(new Set(locations.map((location) => location.file))).sort();
|
|
918
|
+
}
|
|
919
|
+
export function isTestFile(file) {
|
|
920
|
+
return (file.startsWith("test/") ||
|
|
921
|
+
file.startsWith("tests/") ||
|
|
922
|
+
file.startsWith("spec/") ||
|
|
923
|
+
file.startsWith("specs/") ||
|
|
924
|
+
file.startsWith("__tests__/") ||
|
|
925
|
+
file.includes("/test/") ||
|
|
926
|
+
file.includes("/tests/") ||
|
|
927
|
+
file.includes("/spec/") ||
|
|
928
|
+
file.includes("/specs/") ||
|
|
929
|
+
file.includes("/__tests__/") ||
|
|
930
|
+
/\.test\.[^.]+$/u.test(file) ||
|
|
931
|
+
/\.spec\.[^.]+$/u.test(file));
|
|
932
|
+
}
|
|
933
|
+
export function isProductionFile(file) {
|
|
934
|
+
return !isTestFile(file) && (file.startsWith("src/") || file.includes("/src/"));
|
|
935
|
+
}
|
|
936
|
+
export function isTopLevelSourceBarrel(file) {
|
|
937
|
+
return /^src\/[^/]+\.ts$/.test(file);
|
|
938
|
+
}
|
|
939
|
+
export function isFixtureLikeFile(file) {
|
|
940
|
+
return (file.startsWith("fixtures/") ||
|
|
941
|
+
file.startsWith("samples/") ||
|
|
942
|
+
file.includes("/fixtures/") ||
|
|
943
|
+
file.includes("/samples/") ||
|
|
944
|
+
file.startsWith("tests/languages/") ||
|
|
945
|
+
file.includes("/tests/languages/"));
|
|
946
|
+
}
|
|
947
|
+
export function groupLooksLikeImportListNoise(locations) {
|
|
948
|
+
if (!locations.length)
|
|
949
|
+
return false;
|
|
950
|
+
return locations.every((location) => location.looksLikeImportList);
|
|
951
|
+
}
|
|
952
|
+
export function groupLooksLikeBarrelNoise(locations) {
|
|
953
|
+
if (!locations.length)
|
|
954
|
+
return false;
|
|
955
|
+
return locations.every((location) => location.looksLikeBarrel && isTopLevelSourceBarrel(location.file));
|
|
956
|
+
}
|
|
957
|
+
export function cleanupLabelsForGroup(group, locations) {
|
|
958
|
+
const labels = new Set();
|
|
959
|
+
const files = clusterFiles(locations);
|
|
960
|
+
const allTests = files.length > 0 && files.every(isTestFile);
|
|
961
|
+
const allProduction = files.length > 0 && files.every(isProductionFile);
|
|
962
|
+
const hasCommonName = commonLocationName(locations) !== undefined;
|
|
963
|
+
if (allTests && (hasCommonName || locations.length >= 3))
|
|
964
|
+
labels.add("test-helper-extraction");
|
|
965
|
+
if (allProduction && hasCommonName)
|
|
966
|
+
labels.add("production-helper-extraction");
|
|
967
|
+
if (files.some(isFixtureLikeFile))
|
|
968
|
+
labels.add("fixture-boilerplate");
|
|
969
|
+
if (groupLooksLikeImportListNoise(locations))
|
|
970
|
+
labels.add("import-list-noise");
|
|
971
|
+
if (groupLooksLikeBarrelNoise(locations))
|
|
972
|
+
labels.add("barrel-export-noise");
|
|
973
|
+
if (group.cloneType !== "exact" && group.metrics.astShapeEqual && group.metrics.tokenJaccard < 0.65) {
|
|
974
|
+
labels.add("type-shape-noise");
|
|
975
|
+
}
|
|
976
|
+
return Array.from(labels).sort();
|
|
977
|
+
}
|
|
978
|
+
export function isLocationClique(locations, coveredPairs) {
|
|
979
|
+
for (let index = 0; index < locations.length; index += 1) {
|
|
980
|
+
const left = locations[index];
|
|
981
|
+
for (let otherIndex = index + 1; otherIndex < locations.length; otherIndex += 1) {
|
|
982
|
+
const right = locations[otherIndex];
|
|
983
|
+
if (!coveredPairs.has(orderedUnitRangePairKey(left, right)))
|
|
984
|
+
return false;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
return true;
|
|
988
|
+
}
|
|
989
|
+
export function groupClusterSummary(locations, groupIds, coveredPairs) {
|
|
990
|
+
if (locations.length <= 2 && groupIds.length <= 1)
|
|
991
|
+
return undefined;
|
|
992
|
+
if (!isLocationClique(locations, coveredPairs))
|
|
993
|
+
return undefined;
|
|
994
|
+
const label = commonLocationName(locations);
|
|
995
|
+
return {
|
|
996
|
+
id: shortHashText(locations.map(unitRefRangeIdentity).join("\u0000")),
|
|
997
|
+
...(label !== undefined ? { label } : {}),
|
|
998
|
+
locationCount: locations.length,
|
|
999
|
+
locations: [...locations],
|
|
1000
|
+
files: clusterFiles(locations),
|
|
1001
|
+
estimatedLinesSaved: estimatedLinesSavedForLocations(locations),
|
|
1002
|
+
groupIds: [...groupIds].sort(),
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
export function enrichDuplicateGroups(groups) {
|
|
1006
|
+
const locationsByGroupId = new Map();
|
|
1007
|
+
const adjacency = new Map();
|
|
1008
|
+
const locationsByKey = new Map();
|
|
1009
|
+
const coveredPairs = new Set();
|
|
1010
|
+
const ensureNode = (location) => {
|
|
1011
|
+
const key = unitRefRangeIdentity(location);
|
|
1012
|
+
locationsByKey.set(key, location);
|
|
1013
|
+
if (!adjacency.has(key))
|
|
1014
|
+
adjacency.set(key, new Set());
|
|
1015
|
+
return key;
|
|
1016
|
+
};
|
|
1017
|
+
for (const group of groups) {
|
|
1018
|
+
const locations = groupLocations(group);
|
|
1019
|
+
locationsByGroupId.set(group.id, locations);
|
|
1020
|
+
const keys = locations.map(ensureNode);
|
|
1021
|
+
const firstKey = keys[0];
|
|
1022
|
+
if (!firstKey)
|
|
1023
|
+
continue;
|
|
1024
|
+
for (const key of keys.slice(1)) {
|
|
1025
|
+
adjacency.get(firstKey)?.add(key);
|
|
1026
|
+
adjacency.get(key)?.add(firstKey);
|
|
1027
|
+
}
|
|
1028
|
+
coveredPairs.add(orderedUnitRangePairKey(group.primaryLeft, group.primaryRight));
|
|
1029
|
+
for (const variant of group.variants) {
|
|
1030
|
+
coveredPairs.add(orderedUnitRangePairKey(variant.left, variant.right));
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
const componentByKey = new Map();
|
|
1034
|
+
const componentIdByKey = new Map();
|
|
1035
|
+
const groupIdsByComponentId = new Map();
|
|
1036
|
+
const visited = new Set();
|
|
1037
|
+
for (const key of Array.from(adjacency.keys()).sort()) {
|
|
1038
|
+
if (visited.has(key))
|
|
1039
|
+
continue;
|
|
1040
|
+
const stack = [key];
|
|
1041
|
+
const componentKeys = [];
|
|
1042
|
+
visited.add(key);
|
|
1043
|
+
while (stack.length) {
|
|
1044
|
+
const current = stack.pop();
|
|
1045
|
+
componentKeys.push(current);
|
|
1046
|
+
for (const next of adjacency.get(current) ?? []) {
|
|
1047
|
+
if (visited.has(next))
|
|
1048
|
+
continue;
|
|
1049
|
+
visited.add(next);
|
|
1050
|
+
stack.push(next);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
const locations = componentKeys
|
|
1054
|
+
.map((componentKey) => locationsByKey.get(componentKey))
|
|
1055
|
+
.filter((location) => location !== undefined)
|
|
1056
|
+
.sort(compareUnitRefs);
|
|
1057
|
+
const componentId = shortHashText(componentKeys.sort().join("\u0000"));
|
|
1058
|
+
for (const componentKey of componentKeys) {
|
|
1059
|
+
componentByKey.set(componentKey, locations);
|
|
1060
|
+
componentIdByKey.set(componentKey, componentId);
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
for (const group of groups) {
|
|
1064
|
+
const componentId = componentIdByKey.get(unitRefRangeIdentity(group.primaryLeft));
|
|
1065
|
+
if (!componentId)
|
|
1066
|
+
continue;
|
|
1067
|
+
appendToArrayMap(groupIdsByComponentId, componentId, group.id);
|
|
1068
|
+
}
|
|
1069
|
+
return groups.map((group) => {
|
|
1070
|
+
const localLocations = locationsByGroupId.get(group.id) ?? groupLocations(group);
|
|
1071
|
+
const primaryKey = unitRefRangeIdentity(group.primaryLeft);
|
|
1072
|
+
const componentLocations = componentByKey.get(primaryKey) ?? localLocations;
|
|
1073
|
+
const componentId = componentIdByKey.get(primaryKey);
|
|
1074
|
+
const groupIds = componentId
|
|
1075
|
+
? Array.from(new Set(groupIdsByComponentId.get(componentId) ?? [group.id])).sort()
|
|
1076
|
+
: [group.id];
|
|
1077
|
+
const cluster = groupClusterSummary(componentLocations, groupIds, coveredPairs);
|
|
1078
|
+
const cleanupLabels = cleanupLabelsForGroup(group, localLocations);
|
|
1079
|
+
if (!cleanupLabels.includes("test-helper-extraction") && cluster) {
|
|
1080
|
+
if (cluster.files.length && cluster.files.every(isTestFile) && cluster.locationCount >= 3) {
|
|
1081
|
+
cleanupLabels.push("test-helper-extraction");
|
|
1082
|
+
cleanupLabels.sort();
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
return {
|
|
1086
|
+
...group,
|
|
1087
|
+
locations: localLocations,
|
|
1088
|
+
reducedLines: reducedLinesForPair(group.primaryLeft, group.primaryRight),
|
|
1089
|
+
estimatedLinesSaved: estimatedLinesSavedForLocations(localLocations),
|
|
1090
|
+
cleanupLabels,
|
|
1091
|
+
...(cluster !== undefined ? { cluster } : {}),
|
|
1092
|
+
};
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
export function mergeReasonLists(reasonLists) {
|
|
1096
|
+
const reasons = new Set();
|
|
1097
|
+
for (const reasonList of reasonLists) {
|
|
1098
|
+
for (const reason of reasonList)
|
|
1099
|
+
reasons.add(reason);
|
|
1100
|
+
}
|
|
1101
|
+
return Array.from(reasons).sort();
|
|
1102
|
+
}
|
|
1103
|
+
export function mergeReasons(suggestions) {
|
|
1104
|
+
return mergeReasonLists(suggestions.map((suggestion) => suggestion.reasons));
|
|
1105
|
+
}
|
|
1106
|
+
export function mergeGroupReasons(groups) {
|
|
1107
|
+
return mergeReasonLists(groups.map((group) => group.reasons));
|
|
1108
|
+
}
|
|
1109
|
+
export function groupForSuggestions(key, suggestions, left, right, variantLimit) {
|
|
1110
|
+
suggestions.sort(compareSuggestionsForPrimary);
|
|
1111
|
+
const primary = suggestions[0];
|
|
1112
|
+
const variants = suggestions.slice(0, variantLimit);
|
|
1113
|
+
let score = primary.score;
|
|
1114
|
+
let confidence = primary.confidence;
|
|
1115
|
+
let cloneType = primary.cloneType;
|
|
1116
|
+
for (const suggestion of suggestions.slice(1)) {
|
|
1117
|
+
score = Math.max(score, suggestion.score);
|
|
1118
|
+
confidence = bestConfidence(confidence, suggestion.confidence);
|
|
1119
|
+
cloneType = bestCloneType(cloneType, suggestion.cloneType);
|
|
1120
|
+
}
|
|
1121
|
+
let reasons = mergeReasons(suggestions);
|
|
1122
|
+
const primaryLengthRatio = ratio(primary.left.tokenCount, primary.right.tokenCount);
|
|
1123
|
+
if (primaryLengthRatio < GROUP_PRIMARY_LENGTH_RATIO_FLOOR) {
|
|
1124
|
+
score = Math.min(score, 64);
|
|
1125
|
+
confidence = "low";
|
|
1126
|
+
reasons = Array.from(new Set([...reasons, "different-sized grouped units"])).sort();
|
|
1127
|
+
}
|
|
1128
|
+
return {
|
|
1129
|
+
id: shortHashText(key),
|
|
1130
|
+
score,
|
|
1131
|
+
confidence,
|
|
1132
|
+
cloneType,
|
|
1133
|
+
primaryLeft: primary.left,
|
|
1134
|
+
primaryRight: primary.right,
|
|
1135
|
+
locations: locationsForSuggestions(primary.left, primary.right, suggestions),
|
|
1136
|
+
reducedLines: reducedLinesForPair(primary.left, primary.right),
|
|
1137
|
+
estimatedLinesSaved: reducedLinesForPair(primary.left, primary.right),
|
|
1138
|
+
cleanupLabels: [],
|
|
1139
|
+
variants,
|
|
1140
|
+
variantCount: variants.length,
|
|
1141
|
+
rawPairCount: suggestions.length,
|
|
1142
|
+
omittedVariantCount: Math.max(0, suggestions.length - variants.length),
|
|
1143
|
+
metrics: primary.metrics,
|
|
1144
|
+
reasons,
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
export function compareGroups(left, right) {
|
|
1148
|
+
const scoreCompare = right.score - left.score;
|
|
1149
|
+
if (scoreCompare)
|
|
1150
|
+
return scoreCompare;
|
|
1151
|
+
const confidenceCompare = confidenceRank[right.confidence] - confidenceRank[left.confidence];
|
|
1152
|
+
if (confidenceCompare)
|
|
1153
|
+
return confidenceCompare;
|
|
1154
|
+
const cloneTypeCompare = cloneTypeRank[right.cloneType] - cloneTypeRank[left.cloneType];
|
|
1155
|
+
if (cloneTypeCompare)
|
|
1156
|
+
return cloneTypeCompare;
|
|
1157
|
+
const tokenCompare = right.primaryLeft.tokenCount +
|
|
1158
|
+
right.primaryRight.tokenCount -
|
|
1159
|
+
(left.primaryLeft.tokenCount + left.primaryRight.tokenCount);
|
|
1160
|
+
if (tokenCompare)
|
|
1161
|
+
return tokenCompare;
|
|
1162
|
+
const leftCompare = compareUnitRefs(left.primaryLeft, right.primaryLeft);
|
|
1163
|
+
if (leftCompare)
|
|
1164
|
+
return leftCompare;
|
|
1165
|
+
return compareUnitRefs(left.primaryRight, right.primaryRight);
|
|
1166
|
+
}
|
|
1167
|
+
export function coalesceDuplicateGroups(groups, variantLimit) {
|
|
1168
|
+
const groupsByPrimaryPair = new Map();
|
|
1169
|
+
for (const group of groups) {
|
|
1170
|
+
const key = orderedUnitRangePairKey(group.primaryLeft, group.primaryRight);
|
|
1171
|
+
const existing = groupsByPrimaryPair.get(key);
|
|
1172
|
+
if (existing)
|
|
1173
|
+
existing.push(group);
|
|
1174
|
+
else
|
|
1175
|
+
groupsByPrimaryPair.set(key, [group]);
|
|
1176
|
+
}
|
|
1177
|
+
const coalesced = [];
|
|
1178
|
+
for (const [key, grouped] of groupsByPrimaryPair) {
|
|
1179
|
+
if (grouped.length === 1) {
|
|
1180
|
+
coalesced.push(grouped[0]);
|
|
1181
|
+
continue;
|
|
1182
|
+
}
|
|
1183
|
+
grouped.sort(compareGroups);
|
|
1184
|
+
const primary = grouped[0];
|
|
1185
|
+
const variantsByKey = new Map();
|
|
1186
|
+
for (const group of grouped) {
|
|
1187
|
+
for (const variant of group.variants) {
|
|
1188
|
+
variantsByKey.set(suggestionVariantKey(variant), variant);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
const dedupedVariants = Array.from(variantsByKey.values()).sort(compareSuggestionsForPrimary);
|
|
1192
|
+
const variants = dedupedVariants.slice(0, variantLimit);
|
|
1193
|
+
const rawPairCount = grouped.reduce((count, group) => count + group.rawPairCount, 0);
|
|
1194
|
+
let score = primary.score;
|
|
1195
|
+
let confidence = primary.confidence;
|
|
1196
|
+
let cloneType = primary.cloneType;
|
|
1197
|
+
for (const group of grouped.slice(1)) {
|
|
1198
|
+
score = Math.max(score, group.score);
|
|
1199
|
+
confidence = bestConfidence(confidence, group.confidence);
|
|
1200
|
+
cloneType = bestCloneType(cloneType, group.cloneType);
|
|
1201
|
+
}
|
|
1202
|
+
coalesced.push({
|
|
1203
|
+
...primary,
|
|
1204
|
+
id: shortHashText(key),
|
|
1205
|
+
score,
|
|
1206
|
+
confidence,
|
|
1207
|
+
cloneType,
|
|
1208
|
+
locations: mergeLocations(grouped.flatMap((group) => group.locations)),
|
|
1209
|
+
variants,
|
|
1210
|
+
variantCount: variants.length,
|
|
1211
|
+
rawPairCount,
|
|
1212
|
+
omittedVariantCount: Math.max(0, dedupedVariants.length - variants.length),
|
|
1213
|
+
reasons: mergeGroupReasons(grouped),
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
coalesced.sort(compareGroups);
|
|
1217
|
+
return coalesced;
|
|
1218
|
+
}
|
|
1219
|
+
export function groupSuggestions(suggestions, includeRawPairs) {
|
|
1220
|
+
const refs = suggestions.flatMap((suggestion) => [suggestion.left, suggestion.right]);
|
|
1221
|
+
const clusters = createUnitClusters(refs);
|
|
1222
|
+
const variantLimit = includeRawPairs ? Number.POSITIVE_INFINITY : DEFAULT_GROUP_VARIANT_LIMIT;
|
|
1223
|
+
const suggestionsByGroup = new Map();
|
|
1224
|
+
for (const suggestion of suggestions) {
|
|
1225
|
+
let leftCluster = clusters.get(unitRefIdentity(suggestion.left));
|
|
1226
|
+
let rightCluster = clusters.get(unitRefIdentity(suggestion.right));
|
|
1227
|
+
if (!leftCluster || !rightCluster)
|
|
1228
|
+
continue;
|
|
1229
|
+
if (leftCluster.id === rightCluster.id) {
|
|
1230
|
+
if (rangesSubstantiallyOverlap(suggestion.left, suggestion.right))
|
|
1231
|
+
continue;
|
|
1232
|
+
leftCluster = singletonUnitCluster(suggestion.left);
|
|
1233
|
+
rightCluster = singletonUnitCluster(suggestion.right);
|
|
1234
|
+
}
|
|
1235
|
+
const key = orderedGroupKey(leftCluster, rightCluster);
|
|
1236
|
+
const existing = suggestionsByGroup.get(key);
|
|
1237
|
+
if (existing)
|
|
1238
|
+
existing.suggestions.push(suggestion);
|
|
1239
|
+
else
|
|
1240
|
+
suggestionsByGroup.set(key, { left: leftCluster, right: rightCluster, suggestions: [suggestion] });
|
|
1241
|
+
}
|
|
1242
|
+
const groups = Array.from(suggestionsByGroup, ([key, value]) => groupForSuggestions(key, value.suggestions, value.left, value.right, variantLimit));
|
|
1243
|
+
return enrichDuplicateGroups(coalesceDuplicateGroups(groups, variantLimit));
|
|
1244
|
+
}
|
|
1245
|
+
//# sourceMappingURL=scoring.js.map
|