@lzehrung/codegraph 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -29
- package/codegraph-skill/codegraph/SKILL.md +27 -26
- package/dist/agent/artifact.d.ts.map +1 -1
- package/dist/agent/artifact.js +105 -14
- package/dist/agent/artifact.js.map +1 -1
- package/dist/agent/candidateTests.d.ts +12 -0
- package/dist/agent/candidateTests.d.ts.map +1 -0
- package/dist/agent/candidateTests.js +17 -0
- package/dist/agent/candidateTests.js.map +1 -0
- package/dist/agent/explain.d.ts +3 -0
- package/dist/agent/explain.d.ts.map +1 -1
- package/dist/agent/explain.js +8 -0
- package/dist/agent/explain.js.map +1 -1
- package/dist/agent/explore.d.ts.map +1 -1
- package/dist/agent/explore.js +11 -6
- package/dist/agent/explore.js.map +1 -1
- package/dist/agent/fileView.d.ts.map +1 -1
- package/dist/agent/fileView.js +113 -120
- package/dist/agent/fileView.js.map +1 -1
- package/dist/agent/orient.d.ts.map +1 -1
- package/dist/agent/orient.js +7 -4
- package/dist/agent/orient.js.map +1 -1
- package/dist/agent/packet.d.ts.map +1 -1
- package/dist/agent/packet.js +5 -12
- package/dist/agent/packet.js.map +1 -1
- package/dist/agent/query-index/candidates.d.ts +13 -2
- package/dist/agent/query-index/candidates.d.ts.map +1 -1
- package/dist/agent/query-index/candidates.js +28 -39
- package/dist/agent/query-index/candidates.js.map +1 -1
- package/dist/agent/query-index/content.d.ts +1 -1
- package/dist/agent/query-index/content.js +4 -4
- package/dist/agent/query-index/content.js.map +1 -1
- package/dist/agent/query-index/schema.d.ts.map +1 -1
- package/dist/agent/query-index/schema.js.map +1 -1
- package/dist/agent/query-index/sessionStore.d.ts.map +1 -1
- package/dist/agent/query-index/sessionStore.js +42 -26
- package/dist/agent/query-index/sessionStore.js.map +1 -1
- package/dist/agent/query-index/store.d.ts +10 -4
- package/dist/agent/query-index/store.d.ts.map +1 -1
- package/dist/agent/query-index/store.js +115 -10
- package/dist/agent/query-index/store.js.map +1 -1
- package/dist/agent/query-index/update.d.ts.map +1 -1
- package/dist/agent/query-index/update.js +24 -9
- package/dist/agent/query-index/update.js.map +1 -1
- package/dist/agent/refactorPlan.d.ts.map +1 -1
- package/dist/agent/refactorPlan.js +6 -14
- package/dist/agent/refactorPlan.js.map +1 -1
- package/dist/agent/renamePreview.d.ts +2 -5
- package/dist/agent/renamePreview.d.ts.map +1 -1
- package/dist/agent/renamePreview.js +133 -80
- package/dist/agent/renamePreview.js.map +1 -1
- package/dist/agent/search.d.ts +3 -1
- package/dist/agent/search.d.ts.map +1 -1
- package/dist/agent/search.js +103 -35
- package/dist/agent/search.js.map +1 -1
- package/dist/agent/semanticSymbols.d.ts.map +1 -1
- package/dist/agent/semanticSymbols.js +2 -1
- package/dist/agent/semanticSymbols.js.map +1 -1
- package/dist/agent/session.d.ts +4 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +20 -7
- package/dist/agent/session.js.map +1 -1
- package/dist/agent-tools.d.ts +1 -1
- package/dist/agent-tools.d.ts.map +1 -1
- package/dist/agent-tools.js +12 -21
- package/dist/agent-tools.js.map +1 -1
- package/dist/bin/cli.js +29242 -25373
- package/dist/bin/queryIndexWorker.js +131 -42
- package/dist/bin/rawQueryWorker.js +270 -0
- package/dist/chunking/chunkFile.d.ts +5 -0
- package/dist/chunking/chunkFile.d.ts.map +1 -1
- package/dist/chunking/chunkFile.js +14 -15
- package/dist/chunking/chunkFile.js.map +1 -1
- package/dist/cli/affected.d.ts.map +1 -1
- package/dist/cli/affected.js +17 -10
- package/dist/cli/affected.js.map +1 -1
- package/dist/cli/callHierarchy.d.ts.map +1 -1
- package/dist/cli/callHierarchy.js +9 -2
- package/dist/cli/callHierarchy.js.map +1 -1
- package/dist/cli/commandTable.d.ts.map +1 -1
- package/dist/cli/commandTable.js +16 -4
- package/dist/cli/commandTable.js.map +1 -1
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +166 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/graph.d.ts +2 -1
- package/dist/cli/graph.d.ts.map +1 -1
- package/dist/cli/graph.js +60 -16
- package/dist/cli/graph.js.map +1 -1
- package/dist/cli/graphDelta.d.ts +2 -1
- package/dist/cli/graphDelta.d.ts.map +1 -1
- package/dist/cli/graphDelta.js +5 -0
- package/dist/cli/graphDelta.js.map +1 -1
- package/dist/cli/grep.d.ts +1 -1
- package/dist/cli/grep.d.ts.map +1 -1
- package/dist/cli/grep.js +14 -4
- package/dist/cli/grep.js.map +1 -1
- package/dist/cli/help.d.ts +34 -34
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +17 -8
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/impact.d.ts +2 -1
- package/dist/cli/impact.d.ts.map +1 -1
- package/dist/cli/impact.js +5 -0
- package/dist/cli/impact.js.map +1 -1
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/indexPolicy.d.ts.map +1 -1
- package/dist/cli/indexPolicy.js.map +1 -1
- package/dist/cli/inspect.d.ts +2 -1
- package/dist/cli/inspect.d.ts.map +1 -1
- package/dist/cli/inspect.js +25 -13
- package/dist/cli/inspect.js.map +1 -1
- package/dist/cli/install.js +1 -1
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/invocationContext.d.ts.map +1 -1
- package/dist/cli/invocationContext.js +3 -0
- package/dist/cli/invocationContext.js.map +1 -1
- package/dist/cli/links.d.ts +2 -0
- package/dist/cli/links.d.ts.map +1 -1
- package/dist/cli/links.js +1 -1
- package/dist/cli/links.js.map +1 -1
- package/dist/cli/navigation.d.ts +41 -1
- package/dist/cli/navigation.d.ts.map +1 -1
- package/dist/cli/navigation.js +4 -1
- package/dist/cli/navigation.js.map +1 -1
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +32 -11
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/renamePreview.d.ts.map +1 -1
- package/dist/cli/renamePreview.js +7 -1
- package/dist/cli/renamePreview.js.map +1 -1
- package/dist/cli/review.d.ts +2 -1
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +5 -0
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/rootPolicy.d.ts.map +1 -1
- package/dist/cli/rootPolicy.js +36 -3
- package/dist/cli/rootPolicy.js.map +1 -1
- package/dist/cli/skill.js +2 -2
- package/dist/cli/skill.js.map +1 -1
- package/dist/cli/sql.js +1 -1
- package/dist/cli/symbols.d.ts.map +1 -1
- package/dist/cli/symbols.js +4 -2
- package/dist/cli/symbols.js.map +1 -1
- package/dist/cli/viewer.d.ts.map +1 -1
- package/dist/cli/viewer.js +46 -34
- package/dist/cli/viewer.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +36 -16
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +35 -3
- package/dist/config.js.map +1 -1
- package/dist/documentLinks/check.d.ts +2 -1
- package/dist/documentLinks/check.d.ts.map +1 -1
- package/dist/documentLinks/check.js +22 -11
- package/dist/documentLinks/check.js.map +1 -1
- package/dist/duplicate-token-normalization.d.ts.map +1 -1
- package/dist/duplicate-token-normalization.js +10 -2
- package/dist/duplicate-token-normalization.js.map +1 -1
- package/dist/duplicates/scoring.d.ts +0 -10
- package/dist/duplicates/scoring.d.ts.map +1 -1
- package/dist/duplicates/scoring.js +9 -9
- package/dist/duplicates/scoring.js.map +1 -1
- package/dist/duplicates/types.d.ts +2 -0
- package/dist/duplicates/types.d.ts.map +1 -1
- package/dist/duplicates/unitCache.d.ts +15 -9
- package/dist/duplicates/unitCache.d.ts.map +1 -1
- package/dist/duplicates/unitCache.js +184 -33
- package/dist/duplicates/unitCache.js.map +1 -1
- package/dist/duplicates/units.d.ts +6 -15
- package/dist/duplicates/units.d.ts.map +1 -1
- package/dist/duplicates/units.js +42 -20
- package/dist/duplicates/units.js.map +1 -1
- package/dist/duplicates.d.ts.map +1 -1
- package/dist/duplicates.js +59 -0
- package/dist/duplicates.js.map +1 -1
- package/dist/frameworks/angularjs.d.ts.map +1 -1
- package/dist/frameworks/angularjs.js +18 -12
- package/dist/frameworks/angularjs.js.map +1 -1
- package/dist/graph-builder.d.ts.map +1 -1
- package/dist/graph-builder.js +12 -9
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-edge-collector.d.ts +1 -0
- package/dist/graph-edge-collector.d.ts.map +1 -1
- package/dist/graph-edge-collector.js +1 -1
- package/dist/graph-edge-collector.js.map +1 -1
- package/dist/graphs/grep.d.ts.map +1 -1
- package/dist/graphs/grep.js +7 -2
- package/dist/graphs/grep.js.map +1 -1
- package/dist/graphs/specifiers.d.ts.map +1 -1
- package/dist/graphs/specifiers.js +8 -2
- package/dist/graphs/specifiers.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed.d.ts +10 -1
- package/dist/graphs/symbol-graph-detailed.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed.js +21 -5
- package/dist/graphs/symbol-graph-detailed.js.map +1 -1
- package/dist/impact/analyzer.d.ts.map +1 -1
- package/dist/impact/analyzer.js +19 -2
- package/dist/impact/analyzer.js.map +1 -1
- package/dist/impact/budgets.d.ts.map +1 -1
- package/dist/impact/budgets.js +5 -3
- package/dist/impact/budgets.js.map +1 -1
- package/dist/impact/call-compatibility/textScanner.d.ts +23 -0
- package/dist/impact/call-compatibility/textScanner.d.ts.map +1 -0
- package/dist/impact/call-compatibility/textScanner.js +615 -0
- package/dist/impact/call-compatibility/textScanner.js.map +1 -0
- package/dist/impact/callCompatibility.d.ts +8 -1
- package/dist/impact/callCompatibility.d.ts.map +1 -1
- package/dist/impact/callCompatibility.js +64 -587
- package/dist/impact/callCompatibility.js.map +1 -1
- package/dist/impact/context.d.ts.map +1 -1
- package/dist/impact/context.js +4 -1
- package/dist/impact/context.js.map +1 -1
- package/dist/impact/direct.d.ts +1 -1
- package/dist/impact/direct.d.ts.map +1 -1
- package/dist/impact/direct.js +7 -6
- package/dist/impact/direct.js.map +1 -1
- package/dist/impact/index.d.ts +6 -0
- package/dist/impact/index.d.ts.map +1 -1
- package/dist/impact/index.js +0 -8
- package/dist/impact/index.js.map +1 -1
- package/dist/impact/map.js +2 -2
- package/dist/impact/map.js.map +1 -1
- package/dist/impact/memberResolutionCoverage.d.ts.map +1 -1
- package/dist/impact/memberResolutionCoverage.js +5 -1
- package/dist/impact/memberResolutionCoverage.js.map +1 -1
- package/dist/impact/parse.d.ts.map +1 -1
- package/dist/impact/parse.js +108 -37
- package/dist/impact/parse.js.map +1 -1
- package/dist/impact/referenceCache.js +1 -1
- package/dist/impact/referenceCache.js.map +1 -1
- package/dist/impact/report-suggestions.d.ts.map +1 -1
- package/dist/impact/report-suggestions.js +347 -72
- package/dist/impact/report-suggestions.js.map +1 -1
- package/dist/impact/report.d.ts.map +1 -1
- package/dist/impact/report.js +13 -2
- package/dist/impact/report.js.map +1 -1
- package/dist/impact/reportCompact.d.ts.map +1 -1
- package/dist/impact/reportCompact.js +8 -0
- package/dist/impact/reportCompact.js.map +1 -1
- package/dist/impact/reportFull.d.ts.map +1 -1
- package/dist/impact/reportFull.js +1 -0
- package/dist/impact/reportFull.js.map +1 -1
- package/dist/impact/reportParts.d.ts +9 -0
- package/dist/impact/reportParts.d.ts.map +1 -1
- package/dist/impact/severity.d.ts +3 -2
- package/dist/impact/severity.d.ts.map +1 -1
- package/dist/impact/severity.js +16 -5
- package/dist/impact/severity.js.map +1 -1
- package/dist/impact/streaming.d.ts +32 -2
- package/dist/impact/streaming.d.ts.map +1 -1
- package/dist/impact/streaming.js +62 -3
- package/dist/impact/streaming.js.map +1 -1
- package/dist/impact/suggestions.d.ts.map +1 -1
- package/dist/impact/suggestions.js +1 -1
- package/dist/impact/suggestions.js.map +1 -1
- package/dist/impact/transitive.d.ts.map +1 -1
- package/dist/impact/transitive.js +13 -5
- package/dist/impact/transitive.js.map +1 -1
- package/dist/impact/types.d.ts +21 -20
- package/dist/impact/types.d.ts.map +1 -1
- package/dist/impact/types.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/indexer/build-cache/location.d.ts +19 -0
- package/dist/indexer/build-cache/location.d.ts.map +1 -0
- package/dist/indexer/build-cache/location.js +132 -0
- package/dist/indexer/build-cache/location.js.map +1 -0
- package/dist/indexer/build-cache/manifest.d.ts +14 -6
- package/dist/indexer/build-cache/manifest.d.ts.map +1 -1
- package/dist/indexer/build-cache/manifest.js +194 -30
- package/dist/indexer/build-cache/manifest.js.map +1 -1
- package/dist/indexer/build-cache/module-cache.d.ts +24 -2
- package/dist/indexer/build-cache/module-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache/module-cache.js +98 -32
- package/dist/indexer/build-cache/module-cache.js.map +1 -1
- package/dist/indexer/build-cache/options.d.ts +3 -1
- package/dist/indexer/build-cache/options.d.ts.map +1 -1
- package/dist/indexer/build-cache/options.js +10 -2
- package/dist/indexer/build-cache/options.js.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.d.ts +33 -13
- package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.js +472 -91
- package/dist/indexer/build-cache/project-snapshot.js.map +1 -1
- package/dist/indexer/build-cache/reports.d.ts.map +1 -1
- package/dist/indexer/build-cache/reports.js +10 -1
- package/dist/indexer/build-cache/reports.js.map +1 -1
- package/dist/indexer/build-cache/resolver-environment.d.ts +9 -0
- package/dist/indexer/build-cache/resolver-environment.d.ts.map +1 -0
- package/dist/indexer/build-cache/resolver-environment.js +160 -0
- package/dist/indexer/build-cache/resolver-environment.js.map +1 -0
- package/dist/indexer/build-cache.d.ts +4 -3
- package/dist/indexer/build-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache.js +4 -3
- package/dist/indexer/build-cache.js.map +1 -1
- package/dist/indexer/build-index.d.ts.map +1 -1
- package/dist/indexer/build-index.js +268 -96
- package/dist/indexer/build-index.js.map +1 -1
- package/dist/indexer/build-manifest.d.ts +1 -0
- package/dist/indexer/build-manifest.d.ts.map +1 -1
- package/dist/indexer/build-manifest.js +15 -5
- package/dist/indexer/build-manifest.js.map +1 -1
- package/dist/indexer/build-workers.d.ts +1 -1
- package/dist/indexer/build-workers.d.ts.map +1 -1
- package/dist/indexer/build-workers.js +57 -42
- package/dist/indexer/build-workers.js.map +1 -1
- package/dist/indexer/call-hierarchy.d.ts.map +1 -1
- package/dist/indexer/call-hierarchy.js.map +1 -1
- package/dist/indexer/finalize.d.ts.map +1 -1
- package/dist/indexer/finalize.js +7 -4
- package/dist/indexer/finalize.js.map +1 -1
- package/dist/indexer/import-types.d.ts +8 -0
- package/dist/indexer/import-types.d.ts.map +1 -1
- package/dist/indexer/imports/jsTextImports.d.ts.map +1 -1
- package/dist/indexer/imports/jsTextImports.js +14 -6
- package/dist/indexer/imports/jsTextImports.js.map +1 -1
- package/dist/indexer/imports/languageSpecific.d.ts.map +1 -1
- package/dist/indexer/imports/languageSpecific.js +10 -5
- package/dist/indexer/imports/languageSpecific.js.map +1 -1
- package/dist/indexer/imports/nativeCaptures.d.ts.map +1 -1
- package/dist/indexer/imports/nativeCaptures.js +4 -1
- package/dist/indexer/imports/nativeCaptures.js.map +1 -1
- package/dist/indexer/imports/python.d.ts.map +1 -1
- package/dist/indexer/imports/python.js +19 -9
- package/dist/indexer/imports/python.js.map +1 -1
- package/dist/indexer/incremental-plan.d.ts +2 -1
- package/dist/indexer/incremental-plan.d.ts.map +1 -1
- package/dist/indexer/incremental-plan.js +7 -4
- package/dist/indexer/incremental-plan.js.map +1 -1
- package/dist/indexer/load-current-index.d.ts.map +1 -1
- package/dist/indexer/load-current-index.js.map +1 -1
- package/dist/indexer/locals-and-exports.d.ts.map +1 -1
- package/dist/indexer/locals-and-exports.js +77 -22
- package/dist/indexer/locals-and-exports.js.map +1 -1
- package/dist/indexer/navigation-goto.d.ts.map +1 -1
- package/dist/indexer/navigation-goto.js +26 -16
- package/dist/indexer/navigation-goto.js.map +1 -1
- package/dist/indexer/navigation-local.d.ts.map +1 -1
- package/dist/indexer/navigation-local.js +7 -4
- package/dist/indexer/navigation-local.js.map +1 -1
- package/dist/indexer/navigation-references.d.ts +1 -1
- package/dist/indexer/navigation-references.d.ts.map +1 -1
- package/dist/indexer/navigation-references.js +34 -17
- package/dist/indexer/navigation-references.js.map +1 -1
- package/dist/indexer/navigation-resolve.d.ts.map +1 -1
- package/dist/indexer/navigation-resolve.js +116 -53
- package/dist/indexer/navigation-resolve.js.map +1 -1
- package/dist/indexer/navigation.d.ts +2 -1
- package/dist/indexer/navigation.d.ts.map +1 -1
- package/dist/indexer/navigation.js +34 -20
- package/dist/indexer/navigation.js.map +1 -1
- package/dist/indexer/parse-context.d.ts +2 -2
- package/dist/indexer/parse-context.d.ts.map +1 -1
- package/dist/indexer/parse-context.js +25 -4
- package/dist/indexer/parse-context.js.map +1 -1
- package/dist/indexer/reference-context.d.ts +2 -2
- package/dist/indexer/reference-context.d.ts.map +1 -1
- package/dist/indexer/reference-context.js +4 -2
- package/dist/indexer/reference-context.js.map +1 -1
- package/dist/indexer/scope-types.d.ts +3 -0
- package/dist/indexer/scope-types.d.ts.map +1 -1
- package/dist/indexer/scope.js +37 -38
- package/dist/indexer/scope.js.map +1 -1
- package/dist/indexer/shared.d.ts.map +1 -1
- package/dist/indexer/shared.js +3 -1
- package/dist/indexer/shared.js.map +1 -1
- package/dist/indexer/type-hierarchy.d.ts.map +1 -1
- package/dist/indexer/type-hierarchy.js +12 -8
- package/dist/indexer/type-hierarchy.js.map +1 -1
- package/dist/indexer/types.d.ts +27 -1
- package/dist/indexer/types.d.ts.map +1 -1
- package/dist/indexer/workspace-symbols.d.ts.map +1 -1
- package/dist/indexer/workspace-symbols.js +5 -3
- package/dist/indexer/workspace-symbols.js.map +1 -1
- package/dist/installer/locks.d.ts +10 -0
- package/dist/installer/locks.d.ts.map +1 -0
- package/dist/installer/locks.js +232 -0
- package/dist/installer/locks.js.map +1 -0
- package/dist/installer/registry.d.ts.map +1 -1
- package/dist/installer/registry.js +75 -235
- package/dist/installer/registry.js.map +1 -1
- package/dist/languages/definitions/csharp.d.ts.map +1 -1
- package/dist/languages/definitions/csharp.js +8 -0
- package/dist/languages/definitions/csharp.js.map +1 -1
- package/dist/languages/definitions/java.d.ts.map +1 -1
- package/dist/languages/definitions/java.js +3 -0
- package/dist/languages/definitions/java.js.map +1 -1
- package/dist/languages/definitions/python.d.ts.map +1 -1
- package/dist/languages/definitions/python.js +2 -0
- package/dist/languages/definitions/python.js.map +1 -1
- package/dist/languages/definitions/rust.d.ts.map +1 -1
- package/dist/languages/definitions/rust.js +2 -0
- package/dist/languages/definitions/rust.js.map +1 -1
- package/dist/languages/importStatementParsers.d.ts +2 -0
- package/dist/languages/importStatementParsers.d.ts.map +1 -1
- package/dist/languages/importStatementParsers.js +24 -10
- package/dist/languages/importStatementParsers.js.map +1 -1
- package/dist/mcp/http.d.ts +3 -1
- package/dist/mcp/http.d.ts.map +1 -1
- package/dist/mcp/http.js +69 -20
- package/dist/mcp/http.js.map +1 -1
- package/dist/mcp/server.d.ts +58 -16
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +447 -140
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts +51 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +129 -3
- package/dist/mcp/tools.js.map +1 -1
- package/dist/native/byteIndex.d.ts +26 -0
- package/dist/native/byteIndex.d.ts.map +1 -0
- package/dist/native/byteIndex.js +70 -0
- package/dist/native/byteIndex.js.map +1 -0
- package/dist/native/projectedTree.d.ts +3 -2
- package/dist/native/projectedTree.d.ts.map +1 -1
- package/dist/native/projectedTree.js +6 -50
- package/dist/native/projectedTree.js.map +1 -1
- package/dist/native/queryResults.d.ts +7 -1
- package/dist/native/queryResults.d.ts.map +1 -1
- package/dist/native/queryResults.js +13 -5
- package/dist/native/queryResults.js.map +1 -1
- package/dist/review/candidates.d.ts.map +1 -1
- package/dist/review/candidates.js +4 -1
- package/dist/review/candidates.js.map +1 -1
- package/dist/review/changes.d.ts +2 -0
- package/dist/review/changes.d.ts.map +1 -1
- package/dist/review/changes.js +10 -0
- package/dist/review/changes.js.map +1 -1
- package/dist/review/deleted.d.ts.map +1 -1
- package/dist/review/deleted.js +20 -2
- package/dist/review/deleted.js.map +1 -1
- package/dist/review/summaries.d.ts +5 -0
- package/dist/review/summaries.d.ts.map +1 -1
- package/dist/review/summaries.js +32 -21
- package/dist/review/summaries.js.map +1 -1
- package/dist/review/types.d.ts +3 -1
- package/dist/review/types.d.ts.map +1 -1
- package/dist/review/types.js +8 -1
- package/dist/review/types.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +14 -5
- package/dist/review.js.map +1 -1
- package/dist/session.d.ts +20 -4
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +76 -16
- package/dist/session.js.map +1 -1
- package/dist/sql/types.d.ts.map +1 -1
- package/dist/sqlite/query.d.ts +29 -0
- package/dist/sqlite/query.d.ts.map +1 -1
- package/dist/sqlite/query.js +98 -11
- package/dist/sqlite/query.js.map +1 -1
- package/dist/sqlite/rawQueryWorker.d.ts +22 -0
- package/dist/sqlite/rawQueryWorker.d.ts.map +1 -0
- package/dist/sqlite/rawQueryWorker.js +31 -0
- package/dist/sqlite/rawQueryWorker.js.map +1 -0
- package/dist/sqlite/rawQueryWorkerPool.d.ts +66 -0
- package/dist/sqlite/rawQueryWorkerPool.d.ts.map +1 -0
- package/dist/sqlite/rawQueryWorkerPool.js +142 -0
- package/dist/sqlite/rawQueryWorkerPool.js.map +1 -0
- package/dist/sqlite/schema.d.ts +2 -1
- package/dist/sqlite/schema.d.ts.map +1 -1
- package/dist/sqlite/schema.js +15 -1
- package/dist/sqlite/schema.js.map +1 -1
- package/dist/sqlite/write.d.ts.map +1 -1
- package/dist/sqlite/write.js +15 -0
- package/dist/sqlite/write.js.map +1 -1
- package/dist/sqlite-driver.d.ts +11 -0
- package/dist/sqlite-driver.d.ts.map +1 -1
- package/dist/sqlite-driver.js +28 -2
- package/dist/sqlite-driver.js.map +1 -1
- package/dist/sqlite.d.ts +1 -1
- package/dist/sqlite.d.ts.map +1 -1
- package/dist/sqlite.js +1 -1
- package/dist/sqlite.js.map +1 -1
- package/dist/util/bloomFilter.d.ts +3 -2
- package/dist/util/bloomFilter.d.ts.map +1 -1
- package/dist/util/bloomFilter.js +8 -8
- package/dist/util/bloomFilter.js.map +1 -1
- package/dist/util/concurrency.d.ts +1 -0
- package/dist/util/concurrency.d.ts.map +1 -1
- package/dist/util/concurrency.js +9 -2
- package/dist/util/concurrency.js.map +1 -1
- package/dist/util/confinedFile.d.ts +42 -2
- package/dist/util/confinedFile.d.ts.map +1 -1
- package/dist/util/confinedFile.js +114 -3
- package/dist/util/confinedFile.js.map +1 -1
- package/dist/util/errors.d.ts +2 -0
- package/dist/util/errors.d.ts.map +1 -1
- package/dist/util/errors.js +18 -0
- package/dist/util/errors.js.map +1 -1
- package/dist/util/git.d.ts +2 -0
- package/dist/util/git.d.ts.map +1 -1
- package/dist/util/git.js +174 -26
- package/dist/util/git.js.map +1 -1
- package/dist/util/identifiers.d.ts +75 -0
- package/dist/util/identifiers.d.ts.map +1 -0
- package/dist/util/identifiers.js +82 -0
- package/dist/util/identifiers.js.map +1 -0
- package/dist/util/paths.d.ts.map +1 -1
- package/dist/util/paths.js +45 -9
- package/dist/util/paths.js.map +1 -1
- package/dist/util/projectFiles.d.ts.map +1 -1
- package/dist/util/projectFiles.js +43 -14
- package/dist/util/projectFiles.js.map +1 -1
- package/dist/util/resolution/jvm.d.ts.map +1 -1
- package/dist/util/resolution/jvm.js +20 -9
- package/dist/util/resolution/jvm.js.map +1 -1
- package/dist/util/resolution/php.d.ts.map +1 -1
- package/dist/util/resolution/php.js +6 -5
- package/dist/util/resolution/php.js.map +1 -1
- package/dist/util/resolution/tsconfig.d.ts.map +1 -1
- package/dist/util/resolution/tsconfig.js +26 -12
- package/dist/util/resolution/tsconfig.js.map +1 -1
- package/dist/util/rustTestModules.d.ts.map +1 -1
- package/dist/util/rustTestModules.js +4 -2
- package/dist/util/rustTestModules.js.map +1 -1
- package/dist/util/specifiers.d.ts.map +1 -1
- package/dist/util/specifiers.js +10 -3
- package/dist/util/specifiers.js.map +1 -1
- package/dist/util/sqliteSchema.d.ts.map +1 -1
- package/dist/util/sqliteSchema.js +10 -1
- package/dist/util/sqliteSchema.js.map +1 -1
- package/dist/worker/nativeExtractWorker.d.ts +4 -2
- package/dist/worker/nativeExtractWorker.d.ts.map +1 -1
- package/dist/worker/nativeExtractWorker.js +12 -11
- package/dist/worker/nativeExtractWorker.js.map +1 -1
- package/docs/mcp.md +35 -14
- package/package.json +3 -3
|
@@ -3,7 +3,7 @@ const require = __codegraphCreateRequire(import.meta.url);
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
// dist/agent/query-index/content.js
|
|
6
|
-
import
|
|
6
|
+
import fs5 from "node:fs/promises";
|
|
7
7
|
import { brotliCompressSync, constants as zlibConstants } from "node:zlib";
|
|
8
8
|
|
|
9
9
|
// dist/languages/queryGenerator.js
|
|
@@ -528,6 +528,27 @@ var JAVASCRIPT_DEF = {
|
|
|
528
528
|
};
|
|
529
529
|
registerLanguage(JAVASCRIPT_DEF);
|
|
530
530
|
|
|
531
|
+
// dist/util/identifiers.js
|
|
532
|
+
function hasNonAsciiCodePoint(value, includeC0Controls = false) {
|
|
533
|
+
for (const character of value) {
|
|
534
|
+
const codePoint = character.codePointAt(0);
|
|
535
|
+
if (codePoint > 127 || includeC0Controls && codePoint <= 31)
|
|
536
|
+
return true;
|
|
537
|
+
}
|
|
538
|
+
return false;
|
|
539
|
+
}
|
|
540
|
+
var ECMASCRIPT_IDENTIFIER_SOURCE = String.raw`[$_\p{ID_Start}](?:[$_\p{ID_Continue}]|\u200c|\u200d)*`;
|
|
541
|
+
var DUPLICATE_TOKENIZER_IDENTIFIER_SOURCE = String.raw`[$_\p{XID_Start}\u1885\u1886\u2118\u212E\u309B\u309C](?:[$_\p{XID_Continue}\u00B7\u0387\u1369-\u1371\u19DA\u200C\u200D\u1885\u1886\u2118\u212E\u309B\u309C])*`;
|
|
542
|
+
var BLOOM_FILTER_IDENTIFIER_SOURCE = String.raw`[A-Za-z0-9_$\u0000-\u0008\u000E-\u001B\u007F-\u009F\u200C\u200D\u0080-\u{10FFFF}]+`;
|
|
543
|
+
var XID_IDENTIFIER_SOURCE = String.raw`[_\p{XID_Start}][_\p{XID_Continue}]*`;
|
|
544
|
+
var PHP_IDENTIFIER_SOURCE = String.raw`[A-Za-z_\u{80}-\u{10FFFF}][A-Za-z0-9_\u{80}-\u{10FFFF}]*`;
|
|
545
|
+
var JAVA_IDENTIFIER_IGNORABLE_SOURCE = String.raw`\p{Cf}\u0000-\u0008\u000E-\u001B\u007F-\u009F`;
|
|
546
|
+
var CSHARP_IDENTIFIER_FORMAT_SOURCE = String.raw`\p{Cf}`;
|
|
547
|
+
var JAVA_IDENTIFIER_SOURCE = String.raw`[\p{L}\p{Nl}\p{Sc}\p{Pc}][\p{L}\p{Nl}\p{Sc}\p{Pc}\p{Nd}\p{Mn}\p{Mc}${JAVA_IDENTIFIER_IGNORABLE_SOURCE}]*`;
|
|
548
|
+
var CSHARP_IDENTIFIER_SOURCE = String.raw`@?[\p{L}\p{Nl}_][\p{L}\p{Nl}_\p{Nd}\p{Pc}\p{Mn}\p{Mc}${CSHARP_IDENTIFIER_FORMAT_SOURCE}]*`;
|
|
549
|
+
var GO_IDENTIFIER_SOURCE = String.raw`[\p{L}_][\p{L}\p{Nd}_]*`;
|
|
550
|
+
var KOTLIN_IDENTIFIER_SOURCE = String.raw`[\p{L}_][\p{L}\p{Nd}_]*`;
|
|
551
|
+
|
|
531
552
|
// dist/languages/definitions/python.js
|
|
532
553
|
var PYTHON_DEF = {
|
|
533
554
|
id: "python",
|
|
@@ -654,7 +675,8 @@ var PYTHON_DEF = {
|
|
|
654
675
|
createsBlockScope: (n) => n.type === "module" || n.type === "block",
|
|
655
676
|
createsFunctionScope: (n) => n.type === "function_definition" || n.type === "lambda",
|
|
656
677
|
membersAreImplicitlyInScope: false,
|
|
657
|
-
supportsCrossModuleSymbols: true
|
|
678
|
+
supportsCrossModuleSymbols: true,
|
|
679
|
+
normalizeIdentifier: (name) => hasNonAsciiCodePoint(name) ? name.normalize("NFKC") : name
|
|
658
680
|
};
|
|
659
681
|
registerLanguage(PYTHON_DEF);
|
|
660
682
|
|
|
@@ -1272,6 +1294,7 @@ var GO_DEF = {
|
|
|
1272
1294
|
registerLanguage(GO_DEF);
|
|
1273
1295
|
|
|
1274
1296
|
// dist/languages/definitions/java.js
|
|
1297
|
+
var JAVA_IDENTIFIER_IGNORABLE_PATTERN = new RegExp(`[${JAVA_IDENTIFIER_IGNORABLE_SOURCE}]`, "gu");
|
|
1275
1298
|
var JAVA_DEF = {
|
|
1276
1299
|
id: "java",
|
|
1277
1300
|
extensions: [".java"],
|
|
@@ -1390,11 +1413,13 @@ var JAVA_DEF = {
|
|
|
1390
1413
|
if (p.type === "formal_parameter" && p.childForFieldName("name")?.id === node.id)
|
|
1391
1414
|
return true;
|
|
1392
1415
|
return false;
|
|
1393
|
-
}
|
|
1416
|
+
},
|
|
1417
|
+
normalizeIdentifier: (name) => hasNonAsciiCodePoint(name, true) ? name.replace(JAVA_IDENTIFIER_IGNORABLE_PATTERN, "") : name
|
|
1394
1418
|
};
|
|
1395
1419
|
registerLanguage(JAVA_DEF);
|
|
1396
1420
|
|
|
1397
1421
|
// dist/languages/definitions/csharp.js
|
|
1422
|
+
var CSHARP_IDENTIFIER_FORMAT_PATTERN = new RegExp(`[${CSHARP_IDENTIFIER_FORMAT_SOURCE}]`, "gu");
|
|
1398
1423
|
var CSHARP_DEF = {
|
|
1399
1424
|
id: "csharp",
|
|
1400
1425
|
extensions: [".cs"],
|
|
@@ -1515,6 +1540,10 @@ var CSHARP_DEF = {
|
|
|
1515
1540
|
if (p.type === "declaration_pattern" && p.childForFieldName("name")?.id === node.id)
|
|
1516
1541
|
return true;
|
|
1517
1542
|
return false;
|
|
1543
|
+
},
|
|
1544
|
+
normalizeIdentifier: (name) => {
|
|
1545
|
+
const withoutVerbatimPrefix = name.startsWith("@") ? name.slice(1) : name;
|
|
1546
|
+
return hasNonAsciiCodePoint(withoutVerbatimPrefix) ? withoutVerbatimPrefix.replace(CSHARP_IDENTIFIER_FORMAT_PATTERN, "") : withoutVerbatimPrefix;
|
|
1518
1547
|
}
|
|
1519
1548
|
};
|
|
1520
1549
|
registerLanguage(CSHARP_DEF);
|
|
@@ -1660,7 +1689,8 @@ var RUST_DEF = {
|
|
|
1660
1689
|
if (p.type === "parameter" && p.childForFieldName("pattern")?.id === node.id)
|
|
1661
1690
|
return true;
|
|
1662
1691
|
return false;
|
|
1663
|
-
}
|
|
1692
|
+
},
|
|
1693
|
+
normalizeIdentifier: (name) => hasNonAsciiCodePoint(name) ? name.normalize("NFC") : name
|
|
1664
1694
|
};
|
|
1665
1695
|
registerLanguage(RUST_DEF);
|
|
1666
1696
|
|
|
@@ -2648,10 +2678,11 @@ function stringifyUnknown(value) {
|
|
|
2648
2678
|
}
|
|
2649
2679
|
|
|
2650
2680
|
// dist/native/bindingLoader.js
|
|
2651
|
-
import
|
|
2681
|
+
import fs4 from "node:fs";
|
|
2652
2682
|
import path4 from "node:path";
|
|
2653
2683
|
|
|
2654
2684
|
// dist/util/paths.js
|
|
2685
|
+
import fs2, {} from "node:fs";
|
|
2655
2686
|
import fsp from "node:fs/promises";
|
|
2656
2687
|
import path2 from "node:path";
|
|
2657
2688
|
|
|
@@ -2659,6 +2690,19 @@ import path2 from "node:path";
|
|
|
2659
2690
|
function errorMessage(error) {
|
|
2660
2691
|
if (error instanceof Error)
|
|
2661
2692
|
return error.message;
|
|
2693
|
+
if (typeof error === "string")
|
|
2694
|
+
return error;
|
|
2695
|
+
if (error === null || error === void 0)
|
|
2696
|
+
return String(error);
|
|
2697
|
+
if (typeof error === "object") {
|
|
2698
|
+
try {
|
|
2699
|
+
const serialized = JSON.stringify(error);
|
|
2700
|
+
if (serialized)
|
|
2701
|
+
return serialized;
|
|
2702
|
+
} catch {
|
|
2703
|
+
return String(error);
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2662
2706
|
return String(error);
|
|
2663
2707
|
}
|
|
2664
2708
|
|
|
@@ -2735,7 +2779,9 @@ function isRelativeToRoot(normalizedRoot, normalizedFile) {
|
|
|
2735
2779
|
function isFilePathWithinRoot(projectRoot, filePath) {
|
|
2736
2780
|
const normalizedRoot = normalizePath(resolveComparableProjectRoot(projectRoot));
|
|
2737
2781
|
const normalizedFile = normalizePath(resolveFilePathFromRoot(normalizedRoot, filePath));
|
|
2738
|
-
|
|
2782
|
+
if (isRelativeToRoot(normalizedRoot, normalizedFile))
|
|
2783
|
+
return true;
|
|
2784
|
+
return windowsAliasRelativePath(normalizedRoot, normalizedFile) !== null;
|
|
2739
2785
|
}
|
|
2740
2786
|
function assertFilePathWithinRoot(projectRoot, filePath, label = "File") {
|
|
2741
2787
|
const normalizedRoot = normalizePath(resolveComparableProjectRoot(projectRoot));
|
|
@@ -2745,10 +2791,42 @@ function assertFilePathWithinRoot(projectRoot, filePath, label = "File") {
|
|
|
2745
2791
|
}
|
|
2746
2792
|
return normalizedFile;
|
|
2747
2793
|
}
|
|
2794
|
+
function windowsAliasRelativePath(normalizedRoot, normalizedFile) {
|
|
2795
|
+
if (process.platform !== "win32")
|
|
2796
|
+
return null;
|
|
2797
|
+
if (!isWindowsQualifiedAbsolutePath(normalizedRoot) || !isWindowsQualifiedAbsolutePath(normalizedFile)) {
|
|
2798
|
+
return null;
|
|
2799
|
+
}
|
|
2800
|
+
try {
|
|
2801
|
+
const realRoot = fs2.realpathSync.native(normalizedRoot);
|
|
2802
|
+
const realFile = fs2.realpathSync.native(normalizedFile);
|
|
2803
|
+
const directRelativePath = path2.win32.relative(realRoot, realFile);
|
|
2804
|
+
if (!directRelativePath.startsWith("..") && !path2.win32.isAbsolute(directRelativePath)) {
|
|
2805
|
+
return normalizePath(directRelativePath);
|
|
2806
|
+
}
|
|
2807
|
+
const rootStat = fs2.statSync(realRoot, { bigint: true });
|
|
2808
|
+
let ancestorPath = realFile;
|
|
2809
|
+
while (true) {
|
|
2810
|
+
const ancestorStat = fs2.statSync(ancestorPath, { bigint: true });
|
|
2811
|
+
if (sameWindowsDirectoryIdentity(rootStat, ancestorStat)) {
|
|
2812
|
+
return normalizePath(path2.win32.relative(ancestorPath, realFile));
|
|
2813
|
+
}
|
|
2814
|
+
const parentPath = path2.dirname(ancestorPath);
|
|
2815
|
+
if (parentPath === ancestorPath)
|
|
2816
|
+
return null;
|
|
2817
|
+
ancestorPath = parentPath;
|
|
2818
|
+
}
|
|
2819
|
+
} catch {
|
|
2820
|
+
return null;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
function sameWindowsDirectoryIdentity(left, right) {
|
|
2824
|
+
return left.ino !== 0n && left.dev === right.dev && left.ino === right.ino && left.birthtimeNs === right.birthtimeNs;
|
|
2825
|
+
}
|
|
2748
2826
|
|
|
2749
2827
|
// dist/native/runtimeCache.js
|
|
2750
2828
|
import { createHash, randomBytes } from "node:crypto";
|
|
2751
|
-
import
|
|
2829
|
+
import fs3 from "node:fs";
|
|
2752
2830
|
import path3 from "node:path";
|
|
2753
2831
|
var CACHE_SCHEMA_VERSION = 1;
|
|
2754
2832
|
var HASH_BUFFER_SIZE = 1024 * 1024;
|
|
@@ -2768,7 +2846,7 @@ function assertSafeCacheSegment(value, label) {
|
|
|
2768
2846
|
}
|
|
2769
2847
|
}
|
|
2770
2848
|
function assertSafePathComponent(componentPath) {
|
|
2771
|
-
const stats =
|
|
2849
|
+
const stats = fs3.lstatSync(componentPath);
|
|
2772
2850
|
if (!stats.isDirectory() || stats.isSymbolicLink()) {
|
|
2773
2851
|
throw new Error(`unsafe native cache path component: ${componentPath}`);
|
|
2774
2852
|
}
|
|
@@ -2788,7 +2866,7 @@ function prepareSafeDirectory(directoryPath) {
|
|
|
2788
2866
|
throw error;
|
|
2789
2867
|
}
|
|
2790
2868
|
try {
|
|
2791
|
-
|
|
2869
|
+
fs3.mkdirSync(current);
|
|
2792
2870
|
} catch (mkdirError) {
|
|
2793
2871
|
if (mkdirError.code !== "EEXIST")
|
|
2794
2872
|
throw mkdirError;
|
|
@@ -2796,7 +2874,7 @@ function prepareSafeDirectory(directoryPath) {
|
|
|
2796
2874
|
assertSafePathComponent(current);
|
|
2797
2875
|
}
|
|
2798
2876
|
}
|
|
2799
|
-
return
|
|
2877
|
+
return fs3.realpathSync.native(absolute);
|
|
2800
2878
|
}
|
|
2801
2879
|
function resolveProductionCacheRoot() {
|
|
2802
2880
|
const localAppData = process.env.LOCALAPPDATA;
|
|
@@ -2806,17 +2884,17 @@ function resolveProductionCacheRoot() {
|
|
|
2806
2884
|
return path3.join(localAppData, "codegraph", "native-cache", `v${CACHE_SCHEMA_VERSION}`);
|
|
2807
2885
|
}
|
|
2808
2886
|
function hashFileStreaming(filePath, onChunk) {
|
|
2809
|
-
const before =
|
|
2887
|
+
const before = fs3.statSync(filePath);
|
|
2810
2888
|
if (!before.isFile() || before.size <= 0) {
|
|
2811
2889
|
throw new Error(`native binary is not a non-empty regular file: ${filePath}`);
|
|
2812
2890
|
}
|
|
2813
2891
|
const hash = createHash("sha256");
|
|
2814
2892
|
const buffer = Buffer.allocUnsafe(HASH_BUFFER_SIZE);
|
|
2815
|
-
const descriptor =
|
|
2893
|
+
const descriptor = fs3.openSync(filePath, "r");
|
|
2816
2894
|
let size = 0;
|
|
2817
2895
|
try {
|
|
2818
2896
|
while (true) {
|
|
2819
|
-
const bytesRead =
|
|
2897
|
+
const bytesRead = fs3.readSync(descriptor, buffer, 0, buffer.length, null);
|
|
2820
2898
|
if (!bytesRead)
|
|
2821
2899
|
break;
|
|
2822
2900
|
hash.update(buffer.subarray(0, bytesRead));
|
|
@@ -2824,7 +2902,7 @@ function hashFileStreaming(filePath, onChunk) {
|
|
|
2824
2902
|
onChunk?.(bytesRead);
|
|
2825
2903
|
}
|
|
2826
2904
|
} finally {
|
|
2827
|
-
|
|
2905
|
+
fs3.closeSync(descriptor);
|
|
2828
2906
|
}
|
|
2829
2907
|
if (size !== before.size) {
|
|
2830
2908
|
throw new Error(`native binary changed while hashing: ${filePath}`);
|
|
@@ -2835,32 +2913,32 @@ function randomSuffix() {
|
|
|
2835
2913
|
return `${process.pid}.${randomBytes(8).toString("hex")}`;
|
|
2836
2914
|
}
|
|
2837
2915
|
function copyFileExclusive(sourcePath, destinationPath) {
|
|
2838
|
-
const source =
|
|
2916
|
+
const source = fs3.openSync(sourcePath, "r");
|
|
2839
2917
|
let destination;
|
|
2840
2918
|
const buffer = Buffer.allocUnsafe(HASH_BUFFER_SIZE);
|
|
2841
2919
|
try {
|
|
2842
|
-
destination =
|
|
2920
|
+
destination = fs3.openSync(destinationPath, "wx");
|
|
2843
2921
|
while (true) {
|
|
2844
|
-
const bytesRead =
|
|
2922
|
+
const bytesRead = fs3.readSync(source, buffer, 0, buffer.length, null);
|
|
2845
2923
|
if (!bytesRead)
|
|
2846
2924
|
break;
|
|
2847
2925
|
let written = 0;
|
|
2848
2926
|
while (written < bytesRead) {
|
|
2849
|
-
written +=
|
|
2927
|
+
written += fs3.writeSync(destination, buffer, written, bytesRead - written);
|
|
2850
2928
|
}
|
|
2851
2929
|
}
|
|
2852
|
-
|
|
2930
|
+
fs3.fsyncSync(destination);
|
|
2853
2931
|
} finally {
|
|
2854
2932
|
if (destination !== void 0)
|
|
2855
|
-
|
|
2856
|
-
|
|
2933
|
+
fs3.closeSync(destination);
|
|
2934
|
+
fs3.closeSync(source);
|
|
2857
2935
|
}
|
|
2858
2936
|
}
|
|
2859
2937
|
function removeRegularTemporaryFile(filePath) {
|
|
2860
2938
|
try {
|
|
2861
|
-
const stats =
|
|
2939
|
+
const stats = fs3.lstatSync(filePath);
|
|
2862
2940
|
if (stats.isFile() && !stats.isSymbolicLink())
|
|
2863
|
-
|
|
2941
|
+
fs3.unlinkSync(filePath);
|
|
2864
2942
|
} catch {
|
|
2865
2943
|
}
|
|
2866
2944
|
}
|
|
@@ -2874,7 +2952,7 @@ function verifyFile(filePath, expected) {
|
|
|
2874
2952
|
}
|
|
2875
2953
|
function publishExclusive(temporaryPath, finalPath) {
|
|
2876
2954
|
try {
|
|
2877
|
-
|
|
2955
|
+
fs3.linkSync(temporaryPath, finalPath);
|
|
2878
2956
|
return true;
|
|
2879
2957
|
} catch (error) {
|
|
2880
2958
|
if (error.code === "EEXIST")
|
|
@@ -2899,21 +2977,21 @@ function populateBinary(sourcePath, finalPath, expected) {
|
|
|
2899
2977
|
}
|
|
2900
2978
|
function recoverCorruptFinal(finalPath) {
|
|
2901
2979
|
const recoveryPath = `${finalPath}.corrupt.${randomSuffix()}`;
|
|
2902
|
-
|
|
2980
|
+
fs3.renameSync(finalPath, recoveryPath);
|
|
2903
2981
|
}
|
|
2904
2982
|
function writeManifest(entryPath, manifest) {
|
|
2905
2983
|
const finalPath = path3.join(entryPath, "manifest.json");
|
|
2906
|
-
if (
|
|
2984
|
+
if (fs3.existsSync(finalPath))
|
|
2907
2985
|
return;
|
|
2908
2986
|
const temporaryPath = `${finalPath}.${randomSuffix()}.tmp`;
|
|
2909
2987
|
try {
|
|
2910
|
-
const descriptor =
|
|
2988
|
+
const descriptor = fs3.openSync(temporaryPath, "wx");
|
|
2911
2989
|
try {
|
|
2912
|
-
|
|
2990
|
+
fs3.writeFileSync(descriptor, `${JSON.stringify(manifest, null, 2)}
|
|
2913
2991
|
`, "utf8");
|
|
2914
|
-
|
|
2992
|
+
fs3.fsyncSync(descriptor);
|
|
2915
2993
|
} finally {
|
|
2916
|
-
|
|
2994
|
+
fs3.closeSync(descriptor);
|
|
2917
2995
|
}
|
|
2918
2996
|
publishExclusive(temporaryPath, finalPath);
|
|
2919
2997
|
} catch (error) {
|
|
@@ -2926,7 +3004,7 @@ function prepareNativeRuntimeCache(request) {
|
|
|
2926
3004
|
try {
|
|
2927
3005
|
assertSafeCacheSegment(request.target, "target");
|
|
2928
3006
|
assertSafeCacheSegment(request.packageVersion, "package version");
|
|
2929
|
-
const sourceRealPath =
|
|
3007
|
+
const sourceRealPath = fs3.realpathSync.native(sourcePath);
|
|
2930
3008
|
const source = hashFileStreaming(sourceRealPath);
|
|
2931
3009
|
const cacheRoot = prepareSafeDirectory(request.cacheRoot ?? resolveProductionCacheRoot());
|
|
2932
3010
|
const targetPath = prepareSafeDirectory(path3.join(cacheRoot, request.target));
|
|
@@ -2941,7 +3019,7 @@ function prepareNativeRuntimeCache(request) {
|
|
|
2941
3019
|
const sourceFileName = path3.basename(sourceRealPath);
|
|
2942
3020
|
const finalPath = path3.join(entryPath, sourceFileName);
|
|
2943
3021
|
let status = "reused";
|
|
2944
|
-
const finalExists =
|
|
3022
|
+
const finalExists = fs3.existsSync(finalPath);
|
|
2945
3023
|
if (!finalExists || !verifyFile(finalPath, source)) {
|
|
2946
3024
|
if (finalExists)
|
|
2947
3025
|
recoverCorruptFinal(finalPath);
|
|
@@ -3024,7 +3102,7 @@ function findLocalNativeBinary(packageRoot) {
|
|
|
3024
3102
|
}
|
|
3025
3103
|
const expectedName = `index.${suffix}.node`;
|
|
3026
3104
|
try {
|
|
3027
|
-
const entries =
|
|
3105
|
+
const entries = fs4.readdirSync(packageRoot, { withFileTypes: true });
|
|
3028
3106
|
const binary = entries.find((entry) => entry.isFile() && entry.name === expectedName);
|
|
3029
3107
|
return binary ? path4.join(packageRoot, binary.name) : null;
|
|
3030
3108
|
} catch {
|
|
@@ -3038,13 +3116,13 @@ function readPlatformPackage(packageName, target, resolveFn) {
|
|
|
3038
3116
|
if (path4.basename(resolvedEntry) !== expectedFileName) {
|
|
3039
3117
|
throw new Error(`unexpected native platform entry for ${platformPackageName}: ${resolvedEntry}`);
|
|
3040
3118
|
}
|
|
3041
|
-
const sourcePath =
|
|
3042
|
-
const stats =
|
|
3119
|
+
const sourcePath = fs4.realpathSync.native(resolvedEntry);
|
|
3120
|
+
const stats = fs4.statSync(sourcePath);
|
|
3043
3121
|
if (!stats.isFile() || stats.size <= 0) {
|
|
3044
3122
|
throw new Error(`native platform entry is not a non-empty regular file: ${sourcePath}`);
|
|
3045
3123
|
}
|
|
3046
3124
|
const packageJsonPath = path4.join(path4.dirname(sourcePath), "package.json");
|
|
3047
|
-
const parsed = JSON.parse(
|
|
3125
|
+
const parsed = JSON.parse(fs4.readFileSync(packageJsonPath, "utf8"));
|
|
3048
3126
|
if (parsed.name !== platformPackageName || !parsed.version) {
|
|
3049
3127
|
throw new Error(`invalid native platform package metadata: ${packageJsonPath}`);
|
|
3050
3128
|
}
|
|
@@ -3653,7 +3731,7 @@ function countWhitespaceTokens(text) {
|
|
|
3653
3731
|
}
|
|
3654
3732
|
|
|
3655
3733
|
// dist/chunking/chunkFile.js
|
|
3656
|
-
function
|
|
3734
|
+
function chunkFileWithSymbols(opts) {
|
|
3657
3735
|
const { language, source, filePath, minTokens = 150, maxTokens = 400, tokenizer = countWhitespaceTokens } = opts;
|
|
3658
3736
|
const matches = getChunkMatches(language, source, filePath);
|
|
3659
3737
|
const newlineOffsets = collectNewlineOffsets(source);
|
|
@@ -3668,9 +3746,20 @@ function chunkFile(opts) {
|
|
|
3668
3746
|
appendBlockChunks(comment, [], source, tokenizer, maxTokens, preliminaryChunks, language.id, newlineOffsets, filePath);
|
|
3669
3747
|
}
|
|
3670
3748
|
preliminaryChunks.sort((left, right) => left.sourceStart - right.sourceStart || right.sourceEnd - left.sourceEnd);
|
|
3671
|
-
|
|
3749
|
+
if (minTokens <= 1) {
|
|
3750
|
+
const completeChunks2 = fillGapsWithMiscChunks(preliminaryChunks, source, language.id, filePath, tokenizer, 1, maxTokens, newlineOffsets);
|
|
3751
|
+
const chunks2 = withStableChunkIds(completeChunks2.map(({ sourceStart: _sourceStart, sourceEnd: _sourceEnd, ...chunk }) => chunk), language.id, filePath);
|
|
3752
|
+
return { chunks: chunks2, symbolChunks: chunks2 };
|
|
3753
|
+
}
|
|
3754
|
+
const completeSymbolChunks = fillGapsWithMiscChunks(preliminaryChunks, source, language.id, filePath, tokenizer, 1, maxTokens, newlineOffsets);
|
|
3755
|
+
const symbolChunks = withStableChunkIds(completeSymbolChunks.map(({ sourceStart: _sourceStart, sourceEnd: _sourceEnd, ...chunk }) => chunk), language.id, filePath);
|
|
3756
|
+
const mergedChunks = mergeSmallChunks([...preliminaryChunks], minTokens, maxTokens, tokenizer);
|
|
3672
3757
|
const completeChunks = fillGapsWithMiscChunks(mergedChunks, source, language.id, filePath, tokenizer, minTokens, maxTokens, newlineOffsets);
|
|
3673
|
-
|
|
3758
|
+
const chunks = withStableChunkIds(completeChunks.map(({ sourceStart: _sourceStart, sourceEnd: _sourceEnd, ...chunk }) => chunk), language.id, filePath);
|
|
3759
|
+
return { chunks, symbolChunks };
|
|
3760
|
+
}
|
|
3761
|
+
function chunkFile(opts) {
|
|
3762
|
+
return chunkFileWithSymbols(opts).chunks;
|
|
3674
3763
|
}
|
|
3675
3764
|
function appendBlockChunks(block, innerBlocks, source, tokenizer, maxTokens, out, languageId, newlineOffsets, filePath) {
|
|
3676
3765
|
const text = source.slice(block.startByte, block.endByte);
|
|
@@ -3800,7 +3889,7 @@ function compressQueryText(text) {
|
|
|
3800
3889
|
});
|
|
3801
3890
|
}
|
|
3802
3891
|
function normalizeQuerySearchText(input) {
|
|
3803
|
-
return input.replace(/([
|
|
3892
|
+
return input.replace(/([\p{Ll}\p{Nd}])(\p{Lu})/gu, "$1 $2").replace(/(\p{Lu}+)(\p{Lu}\p{Ll})/gu, "$1 $2").toLowerCase().replace(/[^\p{L}\p{N}\p{M}_]+/gu, " ").trim();
|
|
3804
3893
|
}
|
|
3805
3894
|
function detectQueryIndexSurface(relativePath) {
|
|
3806
3895
|
const lower = relativePath.toLowerCase();
|
|
@@ -3850,7 +3939,7 @@ function buildQueryTextChunks(file, text) {
|
|
|
3850
3939
|
}
|
|
3851
3940
|
async function prepareQueryIndexFile(input) {
|
|
3852
3941
|
try {
|
|
3853
|
-
const stat = await
|
|
3942
|
+
const stat = await fs5.stat(input.absolutePath);
|
|
3854
3943
|
const support = supportForFile(input.absolutePath);
|
|
3855
3944
|
if (stat.size > MAX_QUERY_INDEX_TEXT_BYTES) {
|
|
3856
3945
|
return {
|
|
@@ -3865,7 +3954,7 @@ async function prepareQueryIndexFile(input) {
|
|
|
3865
3954
|
sourceRead: false
|
|
3866
3955
|
};
|
|
3867
3956
|
}
|
|
3868
|
-
const text = await
|
|
3957
|
+
const text = await fs5.readFile(input.absolutePath, "utf8");
|
|
3869
3958
|
return {
|
|
3870
3959
|
path: input.path,
|
|
3871
3960
|
sourceIdentity: input.sourceIdentity,
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { createRequire as __codegraphCreateRequire } from 'node:module';
|
|
2
|
+
const require = __codegraphCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// dist/sqlite-driver.js
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
var requireNodeModule = createRequire(import.meta.url);
|
|
8
|
+
var sqliteModule;
|
|
9
|
+
var reportedReadonlyAuthorizerDegradation = false;
|
|
10
|
+
function reportReadonlyAuthorizerDegraded() {
|
|
11
|
+
if (reportedReadonlyAuthorizerDegradation)
|
|
12
|
+
return;
|
|
13
|
+
reportedReadonlyAuthorizerDegradation = true;
|
|
14
|
+
console.error("[codegraph] node:sqlite read-only authorizer is unavailable or incomplete; relying on connection readOnly enforcement.");
|
|
15
|
+
}
|
|
16
|
+
var sqliteLoadError;
|
|
17
|
+
function loadNodeSqlite() {
|
|
18
|
+
if (sqliteModule)
|
|
19
|
+
return sqliteModule;
|
|
20
|
+
if (sqliteLoadError)
|
|
21
|
+
throw sqliteLoadError;
|
|
22
|
+
try {
|
|
23
|
+
const loaded = requireNodeModule("node:sqlite");
|
|
24
|
+
sqliteModule = loaded;
|
|
25
|
+
return loaded;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
sqliteLoadError = error instanceof Error ? error : new Error(String(error));
|
|
28
|
+
throw sqliteLoadError;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var READONLY_AUTHORIZER_CONSTANTS = [
|
|
32
|
+
"SQLITE_DENY",
|
|
33
|
+
"SQLITE_FUNCTION",
|
|
34
|
+
"SQLITE_OK",
|
|
35
|
+
"SQLITE_PRAGMA",
|
|
36
|
+
"SQLITE_READ",
|
|
37
|
+
"SQLITE_RECURSIVE",
|
|
38
|
+
"SQLITE_SELECT",
|
|
39
|
+
"SQLITE_TRANSACTION"
|
|
40
|
+
];
|
|
41
|
+
function canInstallReadonlyAuthorizer(constants) {
|
|
42
|
+
return READONLY_AUTHORIZER_CONSTANTS.every((name) => typeof constants[name] === "number");
|
|
43
|
+
}
|
|
44
|
+
function isReadOnlyAllowedAction(actionCode, constants) {
|
|
45
|
+
return actionCode === constants.SQLITE_FUNCTION || actionCode === constants.SQLITE_PRAGMA || actionCode === constants.SQLITE_READ || actionCode === constants.SQLITE_SELECT || actionCode === constants.SQLITE_TRANSACTION || actionCode === constants.SQLITE_RECURSIVE;
|
|
46
|
+
}
|
|
47
|
+
var isSqliteValueArray = (value) => Array.isArray(value);
|
|
48
|
+
var normalizeParams = (params) => {
|
|
49
|
+
if (params.length === 1) {
|
|
50
|
+
const [only] = params;
|
|
51
|
+
if (only !== void 0 && isSqliteValueArray(only))
|
|
52
|
+
return [...only];
|
|
53
|
+
}
|
|
54
|
+
const normalized = [];
|
|
55
|
+
for (const param of params) {
|
|
56
|
+
if (isSqliteValueArray(param)) {
|
|
57
|
+
throw new Error("SQLite parameters must be passed as a single array or as positional values.");
|
|
58
|
+
}
|
|
59
|
+
normalized.push(param);
|
|
60
|
+
}
|
|
61
|
+
return normalized;
|
|
62
|
+
};
|
|
63
|
+
var SqliteStatement = class _SqliteStatement {
|
|
64
|
+
statement;
|
|
65
|
+
returnArrays;
|
|
66
|
+
constructor(statement, returnArrays = false) {
|
|
67
|
+
this.statement = statement;
|
|
68
|
+
this.returnArrays = returnArrays;
|
|
69
|
+
this.statement.setReturnArrays(returnArrays);
|
|
70
|
+
}
|
|
71
|
+
raw() {
|
|
72
|
+
return new _SqliteStatement(this.statement, true);
|
|
73
|
+
}
|
|
74
|
+
all(...params) {
|
|
75
|
+
return this.statement.all(...normalizeParams(params));
|
|
76
|
+
}
|
|
77
|
+
get(...params) {
|
|
78
|
+
return this.statement.get(...normalizeParams(params));
|
|
79
|
+
}
|
|
80
|
+
iterate(...params) {
|
|
81
|
+
return this.statement.iterate(...normalizeParams(params));
|
|
82
|
+
}
|
|
83
|
+
run(...params) {
|
|
84
|
+
return this.statement.run(...normalizeParams(params));
|
|
85
|
+
}
|
|
86
|
+
columns() {
|
|
87
|
+
return this.statement.columns();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var SqliteDatabase = class {
|
|
91
|
+
db;
|
|
92
|
+
statements = /* @__PURE__ */ new Map();
|
|
93
|
+
constructor(filePath, options) {
|
|
94
|
+
const sqlite = loadNodeSqlite();
|
|
95
|
+
this.db = new sqlite.DatabaseSync(filePath, {
|
|
96
|
+
readOnly: options?.readonly,
|
|
97
|
+
timeout: options?.timeout ?? 5e3
|
|
98
|
+
});
|
|
99
|
+
if (options?.readonly) {
|
|
100
|
+
const { constants } = sqlite;
|
|
101
|
+
if (this.db.setAuthorizer && canInstallReadonlyAuthorizer(constants)) {
|
|
102
|
+
this.db.setAuthorizer((actionCode) => isReadOnlyAllowedAction(actionCode, constants) ? constants.SQLITE_OK : constants.SQLITE_DENY);
|
|
103
|
+
} else {
|
|
104
|
+
reportReadonlyAuthorizerDegraded();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exec(sql) {
|
|
109
|
+
this.statements.clear();
|
|
110
|
+
this.db.exec(sql);
|
|
111
|
+
}
|
|
112
|
+
pragma(sql) {
|
|
113
|
+
this.exec(`PRAGMA ${sql};`);
|
|
114
|
+
}
|
|
115
|
+
prepare(sql) {
|
|
116
|
+
const cached = this.statements.get(sql);
|
|
117
|
+
if (cached)
|
|
118
|
+
return cached;
|
|
119
|
+
const statement = new SqliteStatement(this.db.prepare(sql));
|
|
120
|
+
this.statements.set(sql, statement);
|
|
121
|
+
return statement;
|
|
122
|
+
}
|
|
123
|
+
transaction(fn) {
|
|
124
|
+
return () => {
|
|
125
|
+
this.exec("BEGIN;");
|
|
126
|
+
try {
|
|
127
|
+
const result = fn();
|
|
128
|
+
this.exec("COMMIT;");
|
|
129
|
+
return result;
|
|
130
|
+
} catch (error) {
|
|
131
|
+
this.exec("ROLLBACK;");
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
close() {
|
|
137
|
+
this.statements.clear();
|
|
138
|
+
this.db.close();
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
function isReadOnlySqliteError(error) {
|
|
142
|
+
if (!(error instanceof Error))
|
|
143
|
+
return false;
|
|
144
|
+
const message = error.message.toLowerCase();
|
|
145
|
+
return message.includes("not authorized") || message.includes("read-only") || message.includes("readonly") || message.includes("attempt to write");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// dist/sqlite/database.js
|
|
149
|
+
import fs from "node:fs/promises";
|
|
150
|
+
import path from "node:path";
|
|
151
|
+
var readOrCreateDb = async (outputPath, options) => {
|
|
152
|
+
const readonly = options?.readonly ?? false;
|
|
153
|
+
const dir = path.dirname(outputPath);
|
|
154
|
+
if (dir && !readonly) {
|
|
155
|
+
await fs.mkdir(dir, { recursive: true });
|
|
156
|
+
}
|
|
157
|
+
const db = new SqliteDatabase(outputPath, {
|
|
158
|
+
readonly
|
|
159
|
+
});
|
|
160
|
+
return { db };
|
|
161
|
+
};
|
|
162
|
+
async function withReadOnlySqliteDatabase(outputPath, callback) {
|
|
163
|
+
const { db } = await readOrCreateDb(outputPath, { readonly: true });
|
|
164
|
+
try {
|
|
165
|
+
return await callback(db);
|
|
166
|
+
} finally {
|
|
167
|
+
db.close();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function assertReadOnlyQueryStatement(stmt) {
|
|
171
|
+
if (stmt.columns().length)
|
|
172
|
+
return;
|
|
173
|
+
throw new Error("Raw SQLite queries must be read-only result-producing statements such as SELECT or PRAGMA.");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// dist/sqlite/rowBounds.js
|
|
177
|
+
var MAX_SQLITE_CELL_BYTES = 8e3;
|
|
178
|
+
var SQLITE_TRUNCATED_MARKER = "...[truncated]";
|
|
179
|
+
function collectBoundedRawSqlRows(columns, rowIterator, options) {
|
|
180
|
+
const maxCellBytes = options.maxCellBytes ?? MAX_SQLITE_CELL_BYTES;
|
|
181
|
+
const maxRows = Math.max(0, Math.floor(options.maxRows));
|
|
182
|
+
const maxBytes = options.maxBytes;
|
|
183
|
+
const rows = [];
|
|
184
|
+
let bytes = Buffer.byteLength(JSON.stringify({ columns, rows: [] }), "utf8");
|
|
185
|
+
let truncated = false;
|
|
186
|
+
let sawExtraRow = false;
|
|
187
|
+
for (const rawRow of rowIterator) {
|
|
188
|
+
if (rows.length >= maxRows) {
|
|
189
|
+
sawExtraRow = true;
|
|
190
|
+
truncated = true;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
let cellTruncated = false;
|
|
194
|
+
const row = rawRow.map((value) => {
|
|
195
|
+
const normalized = normalizeSqliteValue(value, maxCellBytes);
|
|
196
|
+
if (normalized.truncated)
|
|
197
|
+
cellTruncated = true;
|
|
198
|
+
return normalized.value;
|
|
199
|
+
});
|
|
200
|
+
if (cellTruncated)
|
|
201
|
+
truncated = true;
|
|
202
|
+
const rowBytes = Buffer.byteLength(JSON.stringify(row), "utf8");
|
|
203
|
+
if (maxBytes !== void 0 && bytes + rowBytes > maxBytes) {
|
|
204
|
+
truncated = true;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
rows.push(row);
|
|
208
|
+
bytes += rowBytes;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
columns,
|
|
212
|
+
rows,
|
|
213
|
+
rowLimit: maxRows,
|
|
214
|
+
...maxBytes !== void 0 ? { byteLimit: maxBytes, bytes } : { bytes },
|
|
215
|
+
...truncated || sawExtraRow ? { truncated: true } : {}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function normalizeSqliteValue(value, maxCellBytes = MAX_SQLITE_CELL_BYTES) {
|
|
219
|
+
if (typeof value === "string") {
|
|
220
|
+
const truncated = Buffer.byteLength(value, "utf8") > maxCellBytes;
|
|
221
|
+
return { value: truncateUtf8(value, maxCellBytes), truncated };
|
|
222
|
+
}
|
|
223
|
+
if (typeof value === "bigint")
|
|
224
|
+
return { value: value.toString(), truncated: false };
|
|
225
|
+
if (value instanceof Uint8Array) {
|
|
226
|
+
return { value: `<${value.byteLength} bytes>`, truncated: true };
|
|
227
|
+
}
|
|
228
|
+
return { value, truncated: false };
|
|
229
|
+
}
|
|
230
|
+
function truncateUtf8(value, maxBytes) {
|
|
231
|
+
if (Buffer.byteLength(value, "utf8") <= maxBytes)
|
|
232
|
+
return value;
|
|
233
|
+
const marker = SQLITE_TRUNCATED_MARKER;
|
|
234
|
+
const markerBytes = Buffer.byteLength(marker, "utf8");
|
|
235
|
+
const budget = Math.max(0, maxBytes - markerBytes);
|
|
236
|
+
let output = "";
|
|
237
|
+
let bytes = 0;
|
|
238
|
+
for (const char of value) {
|
|
239
|
+
const charBytes = Buffer.byteLength(char, "utf8");
|
|
240
|
+
if (bytes + charBytes > budget)
|
|
241
|
+
break;
|
|
242
|
+
output += char;
|
|
243
|
+
bytes += charBytes;
|
|
244
|
+
}
|
|
245
|
+
return `${output}${marker}`;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// dist/sqlite/rawQueryWorker.js
|
|
249
|
+
async function runRawQueryWorkerTask(task) {
|
|
250
|
+
return await withReadOnlySqliteDatabase(task.outputPath, (db) => {
|
|
251
|
+
try {
|
|
252
|
+
const stmt = db.prepare(task.sql);
|
|
253
|
+
assertReadOnlyQueryStatement(stmt);
|
|
254
|
+
const columns = stmt.columns().map((col) => col.name);
|
|
255
|
+
return collectBoundedRawSqlRows(columns, stmt.raw().iterate(task.params), {
|
|
256
|
+
maxRows: task.maxRows,
|
|
257
|
+
maxBytes: task.maxBytes,
|
|
258
|
+
maxCellBytes: task.maxCellBytes
|
|
259
|
+
});
|
|
260
|
+
} catch (error) {
|
|
261
|
+
if (isReadOnlySqliteError(error)) {
|
|
262
|
+
throw new Error("Raw SQLite queries must be read-only result-producing statements such as SELECT or PRAGMA.");
|
|
263
|
+
}
|
|
264
|
+
throw error;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
export {
|
|
269
|
+
runRawQueryWorkerTask as default
|
|
270
|
+
};
|
|
@@ -30,5 +30,10 @@ export interface ChunkFileOptions {
|
|
|
30
30
|
* @param opts Chunking options
|
|
31
31
|
* @returns Array of semantic chunks
|
|
32
32
|
*/
|
|
33
|
+
export type ChunkFileWithSymbolsResult = {
|
|
34
|
+
chunks: Chunk[];
|
|
35
|
+
symbolChunks: Chunk[];
|
|
36
|
+
};
|
|
37
|
+
export declare function chunkFileWithSymbols(opts: ChunkFileOptions): ChunkFileWithSymbolsResult;
|
|
33
38
|
export declare function chunkFile(opts: ChunkFileOptions): Chunk[];
|
|
34
39
|
//# sourceMappingURL=chunkFile.d.ts.map
|