@quolu/lattice 0.70.0 → 0.71.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/package.json +1 -1
- package/sensor/dist/bin/lattice-sensor.js +746 -323
- package/sensor/dist/bin/viewer-gate.d.ts +17 -0
- package/sensor/dist/bin/viewer-gate.d.ts.map +1 -0
- package/sensor/dist/bin/viewer-gate.js +31 -0
- package/sensor/dist/bin/viewer-gate.js.map +1 -0
- package/sensor/dist/context/formatter.d.ts +7 -1
- package/sensor/dist/context/formatter.d.ts.map +1 -1
- package/sensor/dist/context/formatter.js +12 -6
- package/sensor/dist/context/formatter.js.map +1 -1
- package/sensor/dist/context/index.d.ts +12 -0
- package/sensor/dist/context/index.d.ts.map +1 -1
- package/sensor/dist/context/index.js +103 -16
- package/sensor/dist/context/index.js.map +1 -1
- package/sensor/dist/db/index.d.ts +23 -2
- package/sensor/dist/db/index.d.ts.map +1 -1
- package/sensor/dist/db/index.js +109 -31
- package/sensor/dist/db/index.js.map +1 -1
- package/sensor/dist/db/migrations.d.ts +1 -1
- package/sensor/dist/db/migrations.d.ts.map +1 -1
- package/sensor/dist/db/migrations.js +68 -1
- package/sensor/dist/db/migrations.js.map +1 -1
- package/sensor/dist/db/queries.d.ts +583 -6
- package/sensor/dist/db/queries.d.ts.map +1 -1
- package/sensor/dist/db/queries.js +1425 -57
- package/sensor/dist/db/queries.js.map +1 -1
- package/sensor/dist/db/schema.sql +27 -4
- package/sensor/dist/db/sqlite-adapter.d.ts +2 -0
- package/sensor/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/sensor/dist/db/sqlite-adapter.js +56 -7
- package/sensor/dist/db/sqlite-adapter.js.map +1 -1
- package/sensor/dist/db/synthesis-stage.d.ts +12 -0
- package/sensor/dist/db/synthesis-stage.d.ts.map +1 -0
- package/sensor/dist/db/synthesis-stage.js +93 -0
- package/sensor/dist/db/synthesis-stage.js.map +1 -0
- package/sensor/dist/db/wal-valve.d.ts +32 -12
- package/sensor/dist/db/wal-valve.d.ts.map +1 -1
- package/sensor/dist/db/wal-valve.js +65 -22
- package/sensor/dist/db/wal-valve.js.map +1 -1
- package/sensor/dist/db/wsl-shared-index.d.ts +53 -0
- package/sensor/dist/db/wsl-shared-index.d.ts.map +1 -0
- package/sensor/dist/db/wsl-shared-index.js +121 -0
- package/sensor/dist/db/wsl-shared-index.js.map +1 -0
- package/sensor/dist/directory.d.ts +126 -2
- package/sensor/dist/directory.d.ts.map +1 -1
- package/sensor/dist/directory.js +285 -16
- package/sensor/dist/directory.js.map +1 -1
- package/sensor/dist/errors.d.ts +14 -0
- package/sensor/dist/errors.d.ts.map +1 -1
- package/sensor/dist/errors.js +16 -1
- package/sensor/dist/errors.js.map +1 -1
- package/sensor/dist/extraction/cfml-extractor.d.ts +1 -0
- package/sensor/dist/extraction/cfml-extractor.d.ts.map +1 -1
- package/sensor/dist/extraction/cfml-extractor.js +15 -3
- package/sensor/dist/extraction/cfml-extractor.js.map +1 -1
- package/sensor/dist/extraction/dfm-extractor.d.ts.map +1 -1
- package/sensor/dist/extraction/dfm-extractor.js +14 -10
- package/sensor/dist/extraction/dfm-extractor.js.map +1 -1
- package/sensor/dist/extraction/extraction-version.d.ts +1 -1
- package/sensor/dist/extraction/extraction-version.d.ts.map +1 -1
- package/sensor/dist/extraction/extraction-version.js +3 -1
- package/sensor/dist/extraction/extraction-version.js.map +1 -1
- package/sensor/dist/extraction/function-ref.d.ts +6 -4
- package/sensor/dist/extraction/function-ref.d.ts.map +1 -1
- package/sensor/dist/extraction/function-ref.js +35 -14
- package/sensor/dist/extraction/function-ref.js.map +1 -1
- package/sensor/dist/extraction/generated-detection.d.ts +48 -12
- package/sensor/dist/extraction/generated-detection.d.ts.map +1 -1
- package/sensor/dist/extraction/generated-detection.js +176 -11
- package/sensor/dist/extraction/generated-detection.js.map +1 -1
- package/sensor/dist/extraction/grammars.d.ts +38 -0
- package/sensor/dist/extraction/grammars.d.ts.map +1 -1
- package/sensor/dist/extraction/grammars.js +115 -3
- package/sensor/dist/extraction/grammars.js.map +1 -1
- package/sensor/dist/extraction/index.d.ts +218 -14
- package/sensor/dist/extraction/index.d.ts.map +1 -1
- package/sensor/dist/extraction/index.js +887 -175
- package/sensor/dist/extraction/index.js.map +1 -1
- package/sensor/dist/extraction/languages/c-cpp.d.ts +58 -0
- package/sensor/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/c-cpp.js +310 -19
- package/sensor/dist/extraction/languages/c-cpp.js.map +1 -1
- package/sensor/dist/extraction/languages/dart.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/dart.js +8 -3
- package/sensor/dist/extraction/languages/dart.js.map +1 -1
- package/sensor/dist/extraction/languages/erlang.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/erlang.js +58 -22
- package/sensor/dist/extraction/languages/erlang.js.map +1 -1
- package/sensor/dist/extraction/languages/javascript.js +1 -1
- package/sensor/dist/extraction/languages/javascript.js.map +1 -1
- package/sensor/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/kotlin.js +169 -36
- package/sensor/dist/extraction/languages/kotlin.js.map +1 -1
- package/sensor/dist/extraction/languages/lua.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/lua.js +4 -1
- package/sensor/dist/extraction/languages/lua.js.map +1 -1
- package/sensor/dist/extraction/languages/objc.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/objc.js +4 -0
- package/sensor/dist/extraction/languages/objc.js.map +1 -1
- package/sensor/dist/extraction/languages/python.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/python.js +71 -0
- package/sensor/dist/extraction/languages/python.js.map +1 -1
- package/sensor/dist/extraction/languages/rust.d.ts +20 -0
- package/sensor/dist/extraction/languages/rust.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/rust.js +50 -20
- package/sensor/dist/extraction/languages/rust.js.map +1 -1
- package/sensor/dist/extraction/languages/scala.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/scala.js +18 -3
- package/sensor/dist/extraction/languages/scala.js.map +1 -1
- package/sensor/dist/extraction/languages/swift.d.ts +15 -0
- package/sensor/dist/extraction/languages/swift.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/swift.js +50 -0
- package/sensor/dist/extraction/languages/swift.js.map +1 -1
- package/sensor/dist/extraction/languages/typescript.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/typescript.js +9 -2
- package/sensor/dist/extraction/languages/typescript.js.map +1 -1
- package/sensor/dist/extraction/liquid-extractor.d.ts +18 -0
- package/sensor/dist/extraction/liquid-extractor.d.ts.map +1 -1
- package/sensor/dist/extraction/liquid-extractor.js +98 -22
- package/sensor/dist/extraction/liquid-extractor.js.map +1 -1
- package/sensor/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/sensor/dist/extraction/mybatis-extractor.js +6 -4
- package/sensor/dist/extraction/mybatis-extractor.js.map +1 -1
- package/sensor/dist/extraction/parse-pool.d.ts +7 -0
- package/sensor/dist/extraction/parse-pool.d.ts.map +1 -1
- package/sensor/dist/extraction/parse-pool.js +20 -1
- package/sensor/dist/extraction/parse-pool.js.map +1 -1
- package/sensor/dist/extraction/syntax-tokens.d.ts +103 -0
- package/sensor/dist/extraction/syntax-tokens.d.ts.map +1 -0
- package/sensor/dist/extraction/syntax-tokens.js +381 -0
- package/sensor/dist/extraction/syntax-tokens.js.map +1 -0
- package/sensor/dist/extraction/tree-sitter-helpers.d.ts +5 -0
- package/sensor/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/sensor/dist/extraction/tree-sitter-helpers.js +17 -0
- package/sensor/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/sensor/dist/extraction/tree-sitter-types.d.ts +31 -3
- package/sensor/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/sensor/dist/extraction/tree-sitter.d.ts +101 -18
- package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/sensor/dist/extraction/tree-sitter.js +928 -134
- package/sensor/dist/extraction/tree-sitter.js.map +1 -1
- package/sensor/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/sensor/dist/file-limits.d.ts +40 -0
- package/sensor/dist/file-limits.d.ts.map +1 -0
- package/sensor/dist/file-limits.js +147 -0
- package/sensor/dist/file-limits.js.map +1 -0
- package/sensor/dist/graph/branch-guards.d.ts +265 -0
- package/sensor/dist/graph/branch-guards.d.ts.map +1 -0
- package/sensor/dist/graph/branch-guards.js +2325 -0
- package/sensor/dist/graph/branch-guards.js.map +1 -0
- package/sensor/dist/graph/dead-code.d.ts +251 -0
- package/sensor/dist/graph/dead-code.d.ts.map +1 -0
- package/sensor/dist/graph/dead-code.js +776 -0
- package/sensor/dist/graph/dead-code.js.map +1 -0
- package/sensor/dist/graph/dynamic-boundary-report.d.ts +121 -0
- package/sensor/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
- package/sensor/dist/graph/dynamic-boundary-report.js +283 -0
- package/sensor/dist/graph/dynamic-boundary-report.js.map +1 -0
- package/sensor/dist/graph/index.d.ts +4 -0
- package/sensor/dist/graph/index.d.ts.map +1 -1
- package/sensor/dist/graph/index.js +16 -1
- package/sensor/dist/graph/index.js.map +1 -1
- package/sensor/dist/graph/named-symbol-flow.d.ts +125 -0
- package/sensor/dist/graph/named-symbol-flow.d.ts.map +1 -0
- package/sensor/dist/graph/named-symbol-flow.js +552 -0
- package/sensor/dist/graph/named-symbol-flow.js.map +1 -0
- package/sensor/dist/graph/queries.d.ts.map +1 -1
- package/sensor/dist/graph/queries.js +2 -0
- package/sensor/dist/graph/queries.js.map +1 -1
- package/sensor/dist/graph/symbol-lookup.d.ts +83 -0
- package/sensor/dist/graph/symbol-lookup.d.ts.map +1 -0
- package/sensor/dist/graph/symbol-lookup.js +181 -0
- package/sensor/dist/graph/symbol-lookup.js.map +1 -0
- package/sensor/dist/graph/traversal.d.ts +9 -0
- package/sensor/dist/graph/traversal.d.ts.map +1 -1
- package/sensor/dist/graph/traversal.js +62 -36
- package/sensor/dist/graph/traversal.js.map +1 -1
- package/sensor/dist/graph/type-hierarchy.d.ts +155 -0
- package/sensor/dist/graph/type-hierarchy.d.ts.map +1 -0
- package/sensor/dist/graph/type-hierarchy.js +382 -0
- package/sensor/dist/graph/type-hierarchy.js.map +1 -0
- package/sensor/dist/index.d.ts +272 -10
- package/sensor/dist/index.d.ts.map +1 -1
- package/sensor/dist/index.js +510 -34
- package/sensor/dist/index.js.map +1 -1
- package/sensor/dist/mcp/answer-freshness.d.ts +10 -0
- package/sensor/dist/mcp/answer-freshness.d.ts.map +1 -0
- package/sensor/dist/mcp/answer-freshness.js +68 -0
- package/sensor/dist/mcp/answer-freshness.js.map +1 -0
- package/sensor/dist/mcp/daemon-manager.d.ts +1 -1
- package/sensor/dist/mcp/daemon-manager.d.ts.map +1 -1
- package/sensor/dist/mcp/daemon-manager.js +17 -1
- package/sensor/dist/mcp/daemon-manager.js.map +1 -1
- package/sensor/dist/mcp/daemon-paths.d.ts +8 -0
- package/sensor/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/sensor/dist/mcp/daemon-paths.js +65 -2
- package/sensor/dist/mcp/daemon-paths.js.map +1 -1
- package/sensor/dist/mcp/daemon-registry.d.ts +17 -4
- package/sensor/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/sensor/dist/mcp/daemon-registry.js +133 -23
- package/sensor/dist/mcp/daemon-registry.js.map +1 -1
- package/sensor/dist/mcp/daemon.d.ts +26 -13
- package/sensor/dist/mcp/daemon.d.ts.map +1 -1
- package/sensor/dist/mcp/daemon.js +126 -32
- package/sensor/dist/mcp/daemon.js.map +1 -1
- package/sensor/dist/mcp/dynamic-boundaries.d.ts +1 -10
- package/sensor/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/sensor/dist/mcp/dynamic-boundaries.js +46 -42
- package/sensor/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/sensor/dist/mcp/engine.d.ts +31 -9
- package/sensor/dist/mcp/engine.d.ts.map +1 -1
- package/sensor/dist/mcp/engine.js +190 -79
- package/sensor/dist/mcp/engine.js.map +1 -1
- package/sensor/dist/mcp/explore-dedup.d.ts +140 -0
- package/sensor/dist/mcp/explore-dedup.d.ts.map +1 -0
- package/sensor/dist/mcp/explore-dedup.js +239 -0
- package/sensor/dist/mcp/explore-dedup.js.map +1 -0
- package/sensor/dist/mcp/explore-diagnostics.d.ts +289 -0
- package/sensor/dist/mcp/explore-diagnostics.d.ts.map +1 -0
- package/sensor/dist/mcp/explore-diagnostics.js +558 -0
- package/sensor/dist/mcp/explore-diagnostics.js.map +1 -0
- package/sensor/dist/mcp/explore-session-state.d.ts +217 -0
- package/sensor/dist/mcp/explore-session-state.d.ts.map +1 -0
- package/sensor/dist/mcp/explore-session-state.js +322 -0
- package/sensor/dist/mcp/explore-session-state.js.map +1 -0
- package/sensor/dist/mcp/index-freshness-worker.d.ts +2 -0
- package/sensor/dist/mcp/index-freshness-worker.d.ts.map +1 -0
- package/sensor/dist/mcp/index-freshness-worker.js +30 -0
- package/sensor/dist/mcp/index-freshness-worker.js.map +1 -0
- package/sensor/dist/mcp/index-freshness.d.ts +7 -0
- package/sensor/dist/mcp/index-freshness.d.ts.map +1 -0
- package/sensor/dist/mcp/index-freshness.js +94 -0
- package/sensor/dist/mcp/index-freshness.js.map +1 -0
- package/sensor/dist/mcp/index.d.ts +3 -1
- package/sensor/dist/mcp/index.d.ts.map +1 -1
- package/sensor/dist/mcp/index.js +109 -12
- package/sensor/dist/mcp/index.js.map +1 -1
- package/sensor/dist/mcp/liveness-watchdog.d.ts +4 -1
- package/sensor/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/sensor/dist/mcp/liveness-watchdog.js +11 -2
- package/sensor/dist/mcp/liveness-watchdog.js.map +1 -1
- package/sensor/dist/mcp/project-lifecycle.d.ts +9 -0
- package/sensor/dist/mcp/project-lifecycle.d.ts.map +1 -0
- package/sensor/dist/mcp/project-lifecycle.js +182 -0
- package/sensor/dist/mcp/project-lifecycle.js.map +1 -0
- package/sensor/dist/mcp/proxy.d.ts.map +1 -1
- package/sensor/dist/mcp/proxy.js +15 -1
- package/sensor/dist/mcp/proxy.js.map +1 -1
- package/sensor/dist/mcp/query-pool.d.ts +2 -2
- package/sensor/dist/mcp/query-pool.d.ts.map +1 -1
- package/sensor/dist/mcp/query-pool.js +9 -7
- package/sensor/dist/mcp/query-pool.js.map +1 -1
- package/sensor/dist/mcp/query-worker.js +2 -2
- package/sensor/dist/mcp/query-worker.js.map +1 -1
- package/sensor/dist/mcp/server-instructions.d.ts +2 -2
- package/sensor/dist/mcp/server-instructions.d.ts.map +1 -1
- package/sensor/dist/mcp/server-instructions.js +13 -6
- package/sensor/dist/mcp/server-instructions.js.map +1 -1
- package/sensor/dist/mcp/session.d.ts +16 -0
- package/sensor/dist/mcp/session.d.ts.map +1 -1
- package/sensor/dist/mcp/session.js +36 -13
- package/sensor/dist/mcp/session.js.map +1 -1
- package/sensor/dist/mcp/startup-handshake.d.ts +3 -1
- package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -1
- package/sensor/dist/mcp/startup-handshake.js +10 -2
- package/sensor/dist/mcp/startup-handshake.js.map +1 -1
- package/sensor/dist/mcp/tools.d.ts +496 -38
- package/sensor/dist/mcp/tools.d.ts.map +1 -1
- package/sensor/dist/mcp/tools.js +4021 -772
- package/sensor/dist/mcp/tools.js.map +1 -1
- package/sensor/dist/mcp/writer-lock.d.ts +61 -0
- package/sensor/dist/mcp/writer-lock.d.ts.map +1 -0
- package/sensor/dist/mcp/writer-lock.js +260 -0
- package/sensor/dist/mcp/writer-lock.js.map +1 -0
- package/sensor/dist/project-config.d.ts +23 -0
- package/sensor/dist/project-config.d.ts.map +1 -1
- package/sensor/dist/project-config.js +39 -2
- package/sensor/dist/project-config.js.map +1 -1
- package/sensor/dist/resolution/alias-binding.d.ts +56 -0
- package/sensor/dist/resolution/alias-binding.d.ts.map +1 -0
- package/sensor/dist/resolution/alias-binding.js +127 -0
- package/sensor/dist/resolution/alias-binding.js.map +1 -0
- package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/sensor/dist/resolution/c-fnptr-synthesizer.js +21 -19
- package/sensor/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/sensor/dist/resolution/callback-synthesizer.d.ts +23 -1
- package/sensor/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/sensor/dist/resolution/callback-synthesizer.js +356 -155
- package/sensor/dist/resolution/callback-synthesizer.js.map +1 -1
- package/sensor/dist/resolution/cpp-constructor.d.ts +4 -0
- package/sensor/dist/resolution/cpp-constructor.d.ts.map +1 -0
- package/sensor/dist/resolution/cpp-constructor.js +123 -0
- package/sensor/dist/resolution/cpp-constructor.js.map +1 -0
- package/sensor/dist/resolution/cpp-macro-visibility.d.ts +12 -0
- package/sensor/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
- package/sensor/dist/resolution/cpp-macro-visibility.js +342 -0
- package/sensor/dist/resolution/cpp-macro-visibility.js.map +1 -0
- package/sensor/dist/resolution/expo-router-synthesizer.d.ts +32 -0
- package/sensor/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/expo-router-synthesizer.js +189 -0
- package/sensor/dist/resolution/expo-router-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/frameworks/csharp.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/csharp.js +96 -2
- package/sensor/dist/resolution/frameworks/csharp.js.map +1 -1
- package/sensor/dist/resolution/frameworks/expo-router.d.ts +189 -0
- package/sensor/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/expo-router.js +785 -0
- package/sensor/dist/resolution/frameworks/expo-router.js.map +1 -0
- package/sensor/dist/resolution/frameworks/express.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/express.js +251 -16
- package/sensor/dist/resolution/frameworks/express.js.map +1 -1
- package/sensor/dist/resolution/frameworks/index.d.ts +5 -0
- package/sensor/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/index.js +29 -1
- package/sensor/dist/resolution/frameworks/index.js.map +1 -1
- package/sensor/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/java.js +79 -47
- package/sensor/dist/resolution/frameworks/java.js.map +1 -1
- package/sensor/dist/resolution/frameworks/laravel.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/laravel.js +294 -4
- package/sensor/dist/resolution/frameworks/laravel.js.map +1 -1
- package/sensor/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/nestjs.js +6 -14
- package/sensor/dist/resolution/frameworks/nestjs.js.map +1 -1
- package/sensor/dist/resolution/frameworks/nextjs.d.ts +76 -0
- package/sensor/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/nextjs.js +328 -0
- package/sensor/dist/resolution/frameworks/nextjs.js.map +1 -0
- package/sensor/dist/resolution/frameworks/object-literal.d.ts +32 -0
- package/sensor/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/object-literal.js +139 -0
- package/sensor/dist/resolution/frameworks/object-literal.js.map +1 -0
- package/sensor/dist/resolution/frameworks/package-deps.d.ts +14 -0
- package/sensor/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/package-deps.js +78 -0
- package/sensor/dist/resolution/frameworks/package-deps.js.map +1 -0
- package/sensor/dist/resolution/frameworks/python.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/python.js +166 -0
- package/sensor/dist/resolution/frameworks/python.js.map +1 -1
- package/sensor/dist/resolution/frameworks/react-native.d.ts +26 -0
- package/sensor/dist/resolution/frameworks/react-native.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/react-native.js +153 -14
- package/sensor/dist/resolution/frameworks/react-native.js.map +1 -1
- package/sensor/dist/resolution/frameworks/react-router.d.ts +46 -0
- package/sensor/dist/resolution/frameworks/react-router.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/react-router.js +187 -0
- package/sensor/dist/resolution/frameworks/react-router.js.map +1 -0
- package/sensor/dist/resolution/frameworks/react.d.ts +2 -1
- package/sensor/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/react.js +188 -139
- package/sensor/dist/resolution/frameworks/react.js.map +1 -1
- package/sensor/dist/resolution/frameworks/svelte.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/svelte.js +6 -1
- package/sensor/dist/resolution/frameworks/svelte.js.map +1 -1
- package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
- package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/sveltekit-router.js +156 -0
- package/sensor/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
- package/sensor/dist/resolution/frameworks/swift.d.ts.map +1 -1
- package/sensor/dist/resolution/frameworks/swift.js +140 -99
- package/sensor/dist/resolution/frameworks/swift.js.map +1 -1
- package/sensor/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
- package/sensor/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/tanstack-router.js +437 -0
- package/sensor/dist/resolution/frameworks/tanstack-router.js.map +1 -0
- package/sensor/dist/resolution/frameworks/vue-router.d.ts +82 -0
- package/sensor/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
- package/sensor/dist/resolution/frameworks/vue-router.js +377 -0
- package/sensor/dist/resolution/frameworks/vue-router.js.map +1 -0
- package/sensor/dist/resolution/import-resolver.d.ts +38 -0
- package/sensor/dist/resolution/import-resolver.d.ts.map +1 -1
- package/sensor/dist/resolution/import-resolver.js +394 -28
- package/sensor/dist/resolution/import-resolver.js.map +1 -1
- package/sensor/dist/resolution/index.d.ts +89 -25
- package/sensor/dist/resolution/index.d.ts.map +1 -1
- package/sensor/dist/resolution/index.js +573 -148
- package/sensor/dist/resolution/index.js.map +1 -1
- package/sensor/dist/resolution/js-builtins.d.ts +13 -0
- package/sensor/dist/resolution/js-builtins.d.ts.map +1 -0
- package/sensor/dist/resolution/js-builtins.js +46 -0
- package/sensor/dist/resolution/js-builtins.js.map +1 -0
- package/sensor/dist/resolution/name-matcher.d.ts +99 -22
- package/sensor/dist/resolution/name-matcher.d.ts.map +1 -1
- package/sensor/dist/resolution/name-matcher.js +2220 -86
- package/sensor/dist/resolution/name-matcher.js.map +1 -1
- package/sensor/dist/resolution/next-router-synthesizer.d.ts +27 -0
- package/sensor/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/next-router-synthesizer.js +113 -0
- package/sensor/dist/resolution/next-router-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/path-aliases.d.ts +6 -4
- package/sensor/dist/resolution/path-aliases.d.ts.map +1 -1
- package/sensor/dist/resolution/path-aliases.js +125 -17
- package/sensor/dist/resolution/path-aliases.js.map +1 -1
- package/sensor/dist/resolution/react-router-synthesizer.d.ts +33 -0
- package/sensor/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/react-router-synthesizer.js +126 -0
- package/sensor/dist/resolution/react-router-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/resolver-pool.d.ts +2 -0
- package/sensor/dist/resolution/resolver-pool.d.ts.map +1 -1
- package/sensor/dist/resolution/resolver-pool.js +4 -0
- package/sensor/dist/resolution/resolver-pool.js.map +1 -1
- package/sensor/dist/resolution/strip-comments.d.ts +6 -0
- package/sensor/dist/resolution/strip-comments.d.ts.map +1 -1
- package/sensor/dist/resolution/strip-comments.js +58 -0
- package/sensor/dist/resolution/strip-comments.js.map +1 -1
- package/sensor/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
- package/sensor/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/sveltekit-synthesizer.js +173 -0
- package/sensor/dist/resolution/sveltekit-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/swift-type-visibility.d.ts +52 -0
- package/sensor/dist/resolution/swift-type-visibility.d.ts.map +1 -0
- package/sensor/dist/resolution/swift-type-visibility.js +328 -0
- package/sensor/dist/resolution/swift-type-visibility.js.map +1 -0
- package/sensor/dist/resolution/synth-utils.d.ts +26 -0
- package/sensor/dist/resolution/synth-utils.d.ts.map +1 -0
- package/sensor/dist/resolution/synth-utils.js +75 -0
- package/sensor/dist/resolution/synth-utils.js.map +1 -0
- package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
- package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/tanstack-router-synthesizer.js +114 -0
- package/sensor/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/tier-synthesizer.d.ts +54 -0
- package/sensor/dist/resolution/tier-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/tier-synthesizer.js +1294 -0
- package/sensor/dist/resolution/tier-synthesizer.js.map +1 -0
- package/sensor/dist/resolution/types.d.ts +78 -2
- package/sensor/dist/resolution/types.d.ts.map +1 -1
- package/sensor/dist/resolution/types.js +64 -0
- package/sensor/dist/resolution/types.js.map +1 -1
- package/sensor/dist/resolution/vue-router-synthesizer.d.ts +30 -0
- package/sensor/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
- package/sensor/dist/resolution/vue-router-synthesizer.js +115 -0
- package/sensor/dist/resolution/vue-router-synthesizer.js.map +1 -0
- package/sensor/dist/search/identifier-segments.d.ts +10 -0
- package/sensor/dist/search/identifier-segments.d.ts.map +1 -1
- package/sensor/dist/search/identifier-segments.js +29 -0
- package/sensor/dist/search/identifier-segments.js.map +1 -1
- package/sensor/dist/search/query-paths.d.ts +106 -0
- package/sensor/dist/search/query-paths.d.ts.map +1 -0
- package/sensor/dist/search/query-paths.js +513 -0
- package/sensor/dist/search/query-paths.js.map +1 -0
- package/sensor/dist/search/query-utils.d.ts +22 -2
- package/sensor/dist/search/query-utils.d.ts.map +1 -1
- package/sensor/dist/search/query-utils.js +56 -16
- package/sensor/dist/search/query-utils.js.map +1 -1
- package/sensor/dist/sync/watch-policy.d.ts +14 -0
- package/sensor/dist/sync/watch-policy.d.ts.map +1 -1
- package/sensor/dist/sync/watch-policy.js +19 -0
- package/sensor/dist/sync/watch-policy.js.map +1 -1
- package/sensor/dist/sync/watcher.d.ts +74 -35
- package/sensor/dist/sync/watcher.d.ts.map +1 -1
- package/sensor/dist/sync/watcher.js +281 -99
- package/sensor/dist/sync/watcher.js.map +1 -1
- package/sensor/dist/telemetry/index.d.ts +4 -2
- package/sensor/dist/telemetry/index.d.ts.map +1 -1
- package/sensor/dist/telemetry/index.js +92 -41
- package/sensor/dist/telemetry/index.js.map +1 -1
- package/sensor/dist/types.d.ts +18 -2
- package/sensor/dist/types.d.ts.map +1 -1
- package/sensor/dist/types.js +2 -0
- package/sensor/dist/types.js.map +1 -1
- package/sensor/dist/ui-server/api/deadcode.d.ts +84 -0
- package/sensor/dist/ui-server/api/deadcode.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/deadcode.js +136 -0
- package/sensor/dist/ui-server/api/deadcode.js.map +1 -0
- package/sensor/dist/ui-server/api/effects.d.ts +94 -0
- package/sensor/dist/ui-server/api/effects.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/effects.js +527 -0
- package/sensor/dist/ui-server/api/effects.js.map +1 -0
- package/sensor/dist/ui-server/api/entrypoints.d.ts +92 -0
- package/sensor/dist/ui-server/api/entrypoints.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/entrypoints.js +361 -0
- package/sensor/dist/ui-server/api/entrypoints.js.map +1 -0
- package/sensor/dist/ui-server/api/events.d.ts +183 -0
- package/sensor/dist/ui-server/api/events.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/events.js +430 -0
- package/sensor/dist/ui-server/api/events.js.map +1 -0
- package/sensor/dist/ui-server/api/file.d.ts +66 -0
- package/sensor/dist/ui-server/api/file.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/file.js +235 -0
- package/sensor/dist/ui-server/api/file.js.map +1 -0
- package/sensor/dist/ui-server/api/filecode.d.ts +126 -0
- package/sensor/dist/ui-server/api/filecode.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/filecode.js +205 -0
- package/sensor/dist/ui-server/api/filecode.js.map +1 -0
- package/sensor/dist/ui-server/api/flow.d.ts +226 -0
- package/sensor/dist/ui-server/api/flow.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/flow.js +612 -0
- package/sensor/dist/ui-server/api/flow.js.map +1 -0
- package/sensor/dist/ui-server/api/hierarchy.d.ts +81 -0
- package/sensor/dist/ui-server/api/hierarchy.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/hierarchy.js +92 -0
- package/sensor/dist/ui-server/api/hierarchy.js.map +1 -0
- package/sensor/dist/ui-server/api/index.d.ts +90 -0
- package/sensor/dist/ui-server/api/index.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/index.js +332 -0
- package/sensor/dist/ui-server/api/index.js.map +1 -0
- package/sensor/dist/ui-server/api/map.d.ts +256 -0
- package/sensor/dist/ui-server/api/map.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/map.js +760 -0
- package/sensor/dist/ui-server/api/map.js.map +1 -0
- package/sensor/dist/ui-server/api/node.d.ts +81 -0
- package/sensor/dist/ui-server/api/node.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/node.js +388 -0
- package/sensor/dist/ui-server/api/node.js.map +1 -0
- package/sensor/dist/ui-server/api/nodes.d.ts +25 -0
- package/sensor/dist/ui-server/api/nodes.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/nodes.js +45 -0
- package/sensor/dist/ui-server/api/nodes.js.map +1 -0
- package/sensor/dist/ui-server/api/program.d.ts +139 -0
- package/sensor/dist/ui-server/api/program.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/program.js +315 -0
- package/sensor/dist/ui-server/api/program.js.map +1 -0
- package/sensor/dist/ui-server/api/respond.d.ts +76 -0
- package/sensor/dist/ui-server/api/respond.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/respond.js +186 -0
- package/sensor/dist/ui-server/api/respond.js.map +1 -0
- package/sensor/dist/ui-server/api/route-roots.d.ts +39 -0
- package/sensor/dist/ui-server/api/route-roots.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/route-roots.js +96 -0
- package/sensor/dist/ui-server/api/route-roots.js.map +1 -0
- package/sensor/dist/ui-server/api/routes.d.ts +59 -0
- package/sensor/dist/ui-server/api/routes.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/routes.js +108 -0
- package/sensor/dist/ui-server/api/routes.js.map +1 -0
- package/sensor/dist/ui-server/api/screens.d.ts +117 -0
- package/sensor/dist/ui-server/api/screens.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/screens.js +611 -0
- package/sensor/dist/ui-server/api/screens.js.map +1 -0
- package/sensor/dist/ui-server/api/search.d.ts +29 -0
- package/sensor/dist/ui-server/api/search.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/search.js +232 -0
- package/sensor/dist/ui-server/api/search.js.map +1 -0
- package/sensor/dist/ui-server/api/session.d.ts +52 -0
- package/sensor/dist/ui-server/api/session.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/session.js +196 -0
- package/sensor/dist/ui-server/api/session.js.map +1 -0
- package/sensor/dist/ui-server/api/source.d.ts +200 -0
- package/sensor/dist/ui-server/api/source.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/source.js +422 -0
- package/sensor/dist/ui-server/api/source.js.map +1 -0
- package/sensor/dist/ui-server/api/stats.d.ts +27 -0
- package/sensor/dist/ui-server/api/stats.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/stats.js +164 -0
- package/sensor/dist/ui-server/api/stats.js.map +1 -0
- package/sensor/dist/ui-server/api/steps.d.ts +274 -0
- package/sensor/dist/ui-server/api/steps.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/steps.js +1544 -0
- package/sensor/dist/ui-server/api/steps.js.map +1 -0
- package/sensor/dist/ui-server/api/trail-store.d.ts +142 -0
- package/sensor/dist/ui-server/api/trail-store.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/trail-store.js +325 -0
- package/sensor/dist/ui-server/api/trail-store.js.map +1 -0
- package/sensor/dist/ui-server/api/trails.d.ts +163 -0
- package/sensor/dist/ui-server/api/trails.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/trails.js +369 -0
- package/sensor/dist/ui-server/api/trails.js.map +1 -0
- package/sensor/dist/ui-server/api/when.d.ts +133 -0
- package/sensor/dist/ui-server/api/when.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/when.js +275 -0
- package/sensor/dist/ui-server/api/when.js.map +1 -0
- package/sensor/dist/ui-server/api/wire.d.ts +179 -0
- package/sensor/dist/ui-server/api/wire.d.ts.map +1 -0
- package/sensor/dist/ui-server/api/wire.js +231 -0
- package/sensor/dist/ui-server/api/wire.js.map +1 -0
- package/sensor/dist/ui-server/assets.d.ts +40 -0
- package/sensor/dist/ui-server/assets.d.ts.map +1 -0
- package/sensor/dist/ui-server/assets.js +110 -0
- package/sensor/dist/ui-server/assets.js.map +1 -0
- package/sensor/dist/ui-server/constants.d.ts +32 -0
- package/sensor/dist/ui-server/constants.d.ts.map +1 -0
- package/sensor/dist/ui-server/constants.js +35 -0
- package/sensor/dist/ui-server/constants.js.map +1 -0
- package/sensor/dist/ui-server/highlight/index.d.ts +113 -0
- package/sensor/dist/ui-server/highlight/index.d.ts.map +1 -0
- package/sensor/dist/ui-server/highlight/index.js +307 -0
- package/sensor/dist/ui-server/highlight/index.js.map +1 -0
- package/sensor/dist/ui-server/highlight/languages.d.ts +36 -0
- package/sensor/dist/ui-server/highlight/languages.d.ts.map +1 -0
- package/sensor/dist/ui-server/highlight/languages.js +50 -0
- package/sensor/dist/ui-server/highlight/languages.js.map +1 -0
- package/sensor/dist/ui-server/index.d.ts +92 -0
- package/sensor/dist/ui-server/index.d.ts.map +1 -0
- package/sensor/dist/ui-server/index.js +399 -0
- package/sensor/dist/ui-server/index.js.map +1 -0
- package/sensor/dist/ui-server/open-browser.d.ts +31 -0
- package/sensor/dist/ui-server/open-browser.d.ts.map +1 -0
- package/sensor/dist/ui-server/open-browser.js +79 -0
- package/sensor/dist/ui-server/open-browser.js.map +1 -0
- package/sensor/dist/ui-server/security.d.ts +127 -0
- package/sensor/dist/ui-server/security.d.ts.map +1 -0
- package/sensor/dist/ui-server/security.js +332 -0
- package/sensor/dist/ui-server/security.js.map +1 -0
- package/sensor/dist/ui-server/static.d.ts +45 -0
- package/sensor/dist/ui-server/static.d.ts.map +1 -0
- package/sensor/dist/ui-server/static.js +165 -0
- package/sensor/dist/ui-server/static.js.map +1 -0
- package/sensor/dist/utils.d.ts +14 -2
- package/sensor/dist/utils.d.ts.map +1 -1
- package/sensor/dist/utils.js +25 -10
- package/sensor/dist/utils.js.map +1 -1
- package/src/sensor-adapter.mjs +5 -1
|
@@ -5,18 +5,38 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { SqliteDatabase } from './sqlite-adapter';
|
|
7
7
|
import { Node, Edge, FileRecord, UnresolvedReference, NodeKind, EdgeKind, Language, GraphStats, SearchOptions, SearchResult } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* How much of the exact-name bonus a `deprioritize`d path keeps (#982). Damped
|
|
10
|
+
* rather than zeroed: a query that genuinely targets that tree must still rank
|
|
11
|
+
* it, the same "discount, don't erase" rule the path penalty follows.
|
|
12
|
+
*
|
|
13
|
+
* Derived rather than picked. `nameMatchBonus`'s prefix arm tops out below
|
|
14
|
+
* `10 + 30 = 40`, and a de-prioritized node also takes the -15 path penalty, so
|
|
15
|
+
* `80 * SCALE - 15 > 40` is what stops a damped WHOLE-QUERY exact match from
|
|
16
|
+
* losing to a mere prefix match. 0.75 clears it (45). Measured on a 62k-node
|
|
17
|
+
* django index: at 0.25 that invariant breaks in practice — `child`, `parent`
|
|
18
|
+
* and `method` lose rank 1 to `children`, `all_parents` and `method_decorator`
|
|
19
|
+
* — while crowd-out removal is almost flat between 0.75 and 0.5 (39 vs 40 of 88
|
|
20
|
+
* peripheral top-10 slots cleared), so a deeper discount buys little and costs
|
|
21
|
+
* the invariant. Pinned by a test.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEPRIORITIZED_NAME_BONUS_SCALE = 0.75;
|
|
8
24
|
/**
|
|
9
25
|
* Query builder for the knowledge graph database
|
|
10
26
|
*/
|
|
11
27
|
export declare class QueryBuilder {
|
|
12
28
|
private db;
|
|
13
29
|
private projectNameTokens;
|
|
30
|
+
private isDeprioritizedPath;
|
|
31
|
+
private _fts5Available;
|
|
14
32
|
private nodeCache;
|
|
15
33
|
private readonly maxCacheSize;
|
|
34
|
+
private dominantFileMemo;
|
|
16
35
|
private stmts;
|
|
17
36
|
private segmentedNames;
|
|
18
37
|
private static readonly MAX_SEGMENTED_NAMES;
|
|
19
38
|
private batchStmts;
|
|
39
|
+
private edgeKindStmts;
|
|
20
40
|
private static readonly BATCH_SIZES;
|
|
21
41
|
/**
|
|
22
42
|
* Run `rows` through a multi-row `INSERT` built as `head + (tuple,)*n`,
|
|
@@ -37,11 +57,21 @@ export declare class QueryBuilder {
|
|
|
37
57
|
* lazily on next use.
|
|
38
58
|
*/
|
|
39
59
|
rebind(db: SqliteDatabase): void;
|
|
60
|
+
private edgeKindStmt;
|
|
40
61
|
/** Set the normalized project-name tokens used to down-weight non-discriminative
|
|
41
62
|
* query words in path scoring (#720). Called once when the project opens. */
|
|
42
63
|
setProjectNameTokens(tokens: Set<string>): void;
|
|
43
64
|
/** The normalized project-name tokens (#720); empty if none were derived. */
|
|
44
65
|
getProjectNameTokens(): Set<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Set the predicate that marks a path as de-prioritized by the project's
|
|
68
|
+
* `lattice-sensor.json` `deprioritize` patterns (#982). Ranking-only: those paths
|
|
69
|
+
* stay indexed and findable, they just stop outranking first-party code.
|
|
70
|
+
* Called once when the project opens; undefined disables the lever.
|
|
71
|
+
*/
|
|
72
|
+
setDeprioritizedPathMatcher(matcher: ((filePath: string) => boolean) | undefined): void;
|
|
73
|
+
/** The `deprioritize` predicate (#982), so other rankers apply the same lever. */
|
|
74
|
+
getDeprioritizedPathMatcher(): ((filePath: string) => boolean) | undefined;
|
|
45
75
|
/**
|
|
46
76
|
* Insert a new node
|
|
47
77
|
*/
|
|
@@ -157,10 +187,24 @@ export declare class QueryBuilder {
|
|
|
157
187
|
* Clear the node cache
|
|
158
188
|
*/
|
|
159
189
|
clearCache(): void;
|
|
190
|
+
/**
|
|
191
|
+
* Whether any node in `filePath` is exported — `getNodesByFile(f).some((n) =>
|
|
192
|
+
* n.isExported)` as one indexed probe, without decoding the file's nodes.
|
|
193
|
+
*/
|
|
194
|
+
fileHasExportedNode(filePath: string): boolean;
|
|
195
|
+
/** The exported nodes of a file, in {@link getNodesByFile} order, decoding only those rows. */
|
|
196
|
+
getExportedNodesByFile(filePath: string): Node[];
|
|
197
|
+
/** The nodes of a file with one name, in {@link getNodesByFile} order, decoding only those rows. */
|
|
198
|
+
getNodesByFileAndName(filePath: string, name: string): Node[];
|
|
160
199
|
/**
|
|
161
200
|
* Get all nodes in a file
|
|
162
201
|
*/
|
|
163
202
|
getNodesByFile(filePath: string): Node[];
|
|
203
|
+
/**
|
|
204
|
+
* Get all nodes in several files at once — one chunked `IN` query rather than
|
|
205
|
+
* one {@link getNodesByFile} per file (#1975).
|
|
206
|
+
*/
|
|
207
|
+
getNodesByFiles(filePaths: readonly string[]): Node[];
|
|
164
208
|
/**
|
|
165
209
|
* Find the file that holds the densest concentration of the project's
|
|
166
210
|
* internal call graph — the "core" file. Used by context-builder to
|
|
@@ -178,12 +222,29 @@ export declare class QueryBuilder {
|
|
|
178
222
|
* Excludes test/spec files from candidacy via path-pattern. The agent's
|
|
179
223
|
* typical question is "how does X work", not "how is X tested", so
|
|
180
224
|
* boosting a test file's directory would be a misfire.
|
|
225
|
+
*
|
|
226
|
+
* The answer depends only on the graph, never on the query, and the
|
|
227
|
+
* aggregation behind it scans every edge — seconds on a large index, paid
|
|
228
|
+
* by every generic explore (#1864). So it is memoized per database change
|
|
229
|
+
* stamp: recomputed only after something wrote to the database.
|
|
181
230
|
*/
|
|
182
231
|
getDominantFile(): {
|
|
183
232
|
filePath: string;
|
|
184
233
|
edgeCount: number;
|
|
185
234
|
nextEdgeCount: number;
|
|
186
235
|
} | null;
|
|
236
|
+
/**
|
|
237
|
+
* A value that differs whenever the database content may have changed
|
|
238
|
+
* since the last call, whoever changed it: `total_changes()` counts the
|
|
239
|
+
* rows this connection inserted, updated or deleted, and
|
|
240
|
+
* `PRAGMA data_version` moves when any OTHER connection — another process's
|
|
241
|
+
* sync, a CLI `lattice sensor index` beside a running MCP server — commits. Both
|
|
242
|
+
* are O(1), so no write path has to remember to invalidate anything.
|
|
243
|
+
* Coarse on purpose: any write, not just one to nodes/edges, forces a
|
|
244
|
+
* recompute, which only costs time, never a stale answer.
|
|
245
|
+
*/
|
|
246
|
+
private getChangeStamp;
|
|
247
|
+
private computeDominantFile;
|
|
187
248
|
/**
|
|
188
249
|
* Find the file that holds the densest concentration of the project's
|
|
189
250
|
* `route` nodes (framework-emitted: Express/Gin/Flask/Rails/Drupal/etc.).
|
|
@@ -219,6 +280,10 @@ export declare class QueryBuilder {
|
|
|
219
280
|
handlerFile: string;
|
|
220
281
|
handlerLine: number;
|
|
221
282
|
handlerKind: string;
|
|
283
|
+
/** The route node itself: where the URL is REGISTERED, not where it is served. */
|
|
284
|
+
routeId: string;
|
|
285
|
+
routeFile: string;
|
|
286
|
+
routeLine: number;
|
|
222
287
|
}>;
|
|
223
288
|
topHandlerFile: string | null;
|
|
224
289
|
topHandlerFileCount: number;
|
|
@@ -236,6 +301,14 @@ export declare class QueryBuilder {
|
|
|
236
301
|
* memory O(1) in the node count rather than O(nodes) (#610).
|
|
237
302
|
*/
|
|
238
303
|
iterateNodesByKind(kind: NodeKind): IterableIterator<Node>;
|
|
304
|
+
/**
|
|
305
|
+
* iterateNodesByKind narrowed to some languages, in the same canonical
|
|
306
|
+
* order — the ORDER BY is total (`id` is unique), so this yields exactly the
|
|
307
|
+
* nodes a caller filtering iterateNodesByKind by language would keep, in the
|
|
308
|
+
* same sequence. A Go pass on a TypeScript monorepo otherwise materialized
|
|
309
|
+
* every method in the project to find a couple of Go ones.
|
|
310
|
+
*/
|
|
311
|
+
iterateNodesByKindIn(kind: NodeKind, languages: readonly string[]): IterableIterator<Node>;
|
|
239
312
|
/**
|
|
240
313
|
* Get all nodes in the database
|
|
241
314
|
*/
|
|
@@ -258,7 +331,22 @@ export declare class QueryBuilder {
|
|
|
258
331
|
*/
|
|
259
332
|
getDistinctFileLanguages(): Set<string>;
|
|
260
333
|
/**
|
|
261
|
-
* Get nodes by exact name match (uses idx_nodes_name index)
|
|
334
|
+
* Get nodes by exact name match (uses idx_nodes_name index).
|
|
335
|
+
*
|
|
336
|
+
* This is resolution's candidate list, and the ORDER BY is load-bearing for
|
|
337
|
+
* index correctness, not cosmetic (CG-33). When a reference names a symbol
|
|
338
|
+
* that several files define and nothing disambiguates them, resolution binds
|
|
339
|
+
* to the first candidate — so without an ORDER BY the winner was decided by
|
|
340
|
+
* rowid, i.e. by the order files happened to be WRITTEN. A full index writes
|
|
341
|
+
* them in scan order; an incremental sync appends each file as it changes, so
|
|
342
|
+
* the same tree resolved to different edges depending on how the index was
|
|
343
|
+
* built, and a long-lived synced index drifted away from a rebuild of itself
|
|
344
|
+
* (measured at 4.3% of distinct edges, mostly `calls`).
|
|
345
|
+
*
|
|
346
|
+
* `(file_path, start_line)` is a property of the CODE, so both paths now pick
|
|
347
|
+
* the same candidate. The sort is paid once per distinct name per resolution
|
|
348
|
+
* run — ReferenceResolver memoizes this in its nameCache — and the population
|
|
349
|
+
* is capped by AMBIGUOUS_NAME_CEILING (#999).
|
|
262
350
|
*/
|
|
263
351
|
getNodesByName(name: string): Node[];
|
|
264
352
|
/**
|
|
@@ -266,14 +354,27 @@ export declare class QueryBuilder {
|
|
|
266
354
|
* skip idx_nodes_name under SQLite's default case-insensitive LIKE).
|
|
267
355
|
*/
|
|
268
356
|
getNodesByNamePrefix(prefix: string, limit?: number): Node[];
|
|
357
|
+
/** File nodes whose basename starts with `prefix`, without a result cap. */
|
|
358
|
+
getFileNodesByNamePrefix(prefix: string): Node[];
|
|
269
359
|
/**
|
|
270
360
|
* Get nodes by exact qualified name match (uses idx_nodes_qualified_name index)
|
|
271
361
|
*/
|
|
272
362
|
getNodesByQualifiedNameExact(qualifiedName: string): Node[];
|
|
273
363
|
/**
|
|
274
|
-
* Get nodes by
|
|
364
|
+
* Get nodes by name, case-insensitively (seeks the idx_nodes_lower_name
|
|
365
|
+
* expression index).
|
|
366
|
+
*
|
|
367
|
+
* The parameter is lowered in SQL rather than trusted to arrive lowered, so
|
|
368
|
+
* the lookup means the same thing whatever casing a caller hands it. Written
|
|
369
|
+
* as a bare `lower(name) = ?` it silently returned nothing for any input
|
|
370
|
+
* carrying an uppercase letter, and — because SQLite's `lower()` folds ASCII
|
|
371
|
+
* only while JavaScript's `.toLowerCase()` folds Unicode — a caller that
|
|
372
|
+
* pre-lowered in JavaScript could not match a non-ASCII name at all.
|
|
373
|
+
*
|
|
374
|
+
* Note this hardens the query, not its one caller: `matchFuzzy` still lowers
|
|
375
|
+
* in JavaScript before calling, so the non-ASCII gap remains open there.
|
|
275
376
|
*/
|
|
276
|
-
getNodesByLowerName(
|
|
377
|
+
getNodesByLowerName(name: string): Node[];
|
|
277
378
|
/**
|
|
278
379
|
* Search nodes by name using FTS with fallback to LIKE for better matching
|
|
279
380
|
*
|
|
@@ -299,6 +400,13 @@ export declare class QueryBuilder {
|
|
|
299
400
|
* node count on any real codebase.
|
|
300
401
|
*/
|
|
301
402
|
private searchNodesFuzzy;
|
|
403
|
+
/** Bounded miss diagnostics, independent of relevance filters and ranking. */
|
|
404
|
+
getExploreMissDiagnostics(query: string): {
|
|
405
|
+
matched: string[];
|
|
406
|
+
unmatched: string[];
|
|
407
|
+
candidates: string[];
|
|
408
|
+
limited: boolean;
|
|
409
|
+
};
|
|
302
410
|
/**
|
|
303
411
|
* FTS5 search with prefix matching
|
|
304
412
|
*/
|
|
@@ -329,6 +437,10 @@ export declare class QueryBuilder {
|
|
|
329
437
|
findNodesByNameSubstring(substring: string, options?: SearchOptions & {
|
|
330
438
|
excludePrefix?: boolean;
|
|
331
439
|
}): SearchResult[];
|
|
440
|
+
/** Must run before file replacement/deletion cascades the endpoint edges. */
|
|
441
|
+
hasSynthesizedEdgesTouchingFile(filePath: string): boolean;
|
|
442
|
+
wasSynthesisInput(filePath: string): boolean;
|
|
443
|
+
replaceSynthesisInputs(files: string[]): void;
|
|
332
444
|
/**
|
|
333
445
|
* Insert a new edge
|
|
334
446
|
*/
|
|
@@ -342,13 +454,318 @@ export declare class QueryBuilder {
|
|
|
342
454
|
*/
|
|
343
455
|
deleteEdgesBySource(sourceId: string): void;
|
|
344
456
|
/**
|
|
345
|
-
* Get outgoing edges from a node
|
|
457
|
+
* Get outgoing edges from a node. Preserve the source/kind index order
|
|
458
|
+
* (calls before imports/references), then break ties deterministically.
|
|
346
459
|
*/
|
|
347
460
|
getOutgoingEdges(sourceId: string, kinds?: EdgeKind[], provenance?: string): Edge[];
|
|
348
461
|
/**
|
|
349
|
-
* Get incoming edges to a node
|
|
462
|
+
* Get incoming edges to a node. Kind must precede opaque source IDs:
|
|
463
|
+
* file IDs sort before function IDs, so source-first ordering lets imports
|
|
464
|
+
* displace actual calls in capped caller lists. Keep deterministic ties
|
|
465
|
+
* without changing the target/kind index's established kind precedence.
|
|
350
466
|
*/
|
|
351
467
|
getIncomingEdges(targetId: string, kinds?: EdgeKind[]): Edge[];
|
|
468
|
+
/**
|
|
469
|
+
* Outgoing edges for MANY source nodes in one query.
|
|
470
|
+
*
|
|
471
|
+
* The batch form of {@link getOutgoingEdges}. Building a nested outline needs
|
|
472
|
+
* the `contains` edges of every container in a file at once; doing that one
|
|
473
|
+
* source at a time is a query per symbol on files that have hundreds.
|
|
474
|
+
*/
|
|
475
|
+
getOutgoingEdgesFrom(sourceIds: readonly string[], kinds?: EdgeKind[]): Edge[];
|
|
476
|
+
/**
|
|
477
|
+
* Fan-in (total incoming edge count) for MANY nodes in one query.
|
|
478
|
+
*
|
|
479
|
+
* The per-node alternative — `getIncomingEdges(id).length` — is an indexed
|
|
480
|
+
* lookup each, but a symbol screen rendering a couple of hundred callees
|
|
481
|
+
* would issue a couple of hundred of them. Ids with no incoming edges are
|
|
482
|
+
* absent from the map rather than present as 0, so callers can tell "no
|
|
483
|
+
* edges" from "not asked about".
|
|
484
|
+
*/
|
|
485
|
+
countIncomingEdges(ids: readonly string[]): Map<string, number>;
|
|
486
|
+
/**
|
|
487
|
+
* Incoming edges for MANY target nodes in one query — the mirror of
|
|
488
|
+
* {@link getOutgoingEdgesFrom}. Needed wherever a whole file's inbound edges
|
|
489
|
+
* are wanted at once ("which files import anything in this one?").
|
|
490
|
+
*/
|
|
491
|
+
getIncomingEdgesTo(targetIds: readonly string[], kinds?: EdgeKind[]): Edge[];
|
|
492
|
+
/**
|
|
493
|
+
* Fan-out (total outgoing edge count) for MANY nodes in one query — the
|
|
494
|
+
* mirror of {@link countIncomingEdges}. Ids with no outgoing edges are absent
|
|
495
|
+
* from the map rather than present as 0.
|
|
496
|
+
*/
|
|
497
|
+
countOutgoingEdges(ids: readonly string[]): Map<string, number>;
|
|
498
|
+
/**
|
|
499
|
+
* Symbols nothing in the index points at — the candidate set behind the dead
|
|
500
|
+
* code list (`src/graph/dead-code.ts`).
|
|
501
|
+
*
|
|
502
|
+
* "Points at" is every edge kind EXCEPT `contains`: a class containing a
|
|
503
|
+
* method is structure, not use, and counting it would make every member look
|
|
504
|
+
* reached by its own container. A self-edge is excluded for the same reason
|
|
505
|
+
* a recursive function is not its own caller.
|
|
506
|
+
*
|
|
507
|
+
* One scan, one index probe per candidate. `NOT EXISTS` over
|
|
508
|
+
* `idx_edges_target_kind` is what keeps it that way — the alternative
|
|
509
|
+
* (`LEFT JOIN edges … GROUP BY`) builds a row per edge for the whole table
|
|
510
|
+
* before discarding all but the empty groups. Ordered by position so the
|
|
511
|
+
* answer is stable across runs and groups by file without a second sort.
|
|
512
|
+
*
|
|
513
|
+
* The result is deliberately NOT called dead code: an unreferenced symbol is
|
|
514
|
+
* a symbol with no STATIC reference, and the caller applies the exclusions
|
|
515
|
+
* (tests, generated files, overrides, unresolved names) that turn the
|
|
516
|
+
* candidate set into a claim worth making.
|
|
517
|
+
*/
|
|
518
|
+
getUnreferencedNodes(kinds: readonly string[], limit: number): Array<{
|
|
519
|
+
node: Node;
|
|
520
|
+
generated: boolean;
|
|
521
|
+
}>;
|
|
522
|
+
/**
|
|
523
|
+
* Which of `names` the index holds an UNRESOLVED reference to.
|
|
524
|
+
*
|
|
525
|
+
* The point is honesty about our own blind spots. A `failed` row in
|
|
526
|
+
* `unresolved_refs` records that some file referenced a name and the resolver
|
|
527
|
+
* could not decide what it meant — so a symbol with that name cannot be
|
|
528
|
+
* called unreferenced, whatever the edge table says. It is deliberately
|
|
529
|
+
* matched loosely, on the reference name AND on its tail (`util.greet` →
|
|
530
|
+
* `greet`), because the question being asked is "could this name be the one
|
|
531
|
+
* we failed to follow", and a maybe has to count as a yes.
|
|
532
|
+
*
|
|
533
|
+
* Bounded-lookup like {@link getGeneratedPathsAmong}: the caller holds a
|
|
534
|
+
* candidate list, so this is a chunked probe over `idx_unresolved_name`, not
|
|
535
|
+
* a scan of the table.
|
|
536
|
+
*/
|
|
537
|
+
getUnresolvedNamesAmong(names: Iterable<string>): Set<string>;
|
|
538
|
+
/**
|
|
539
|
+
* Which of `nodeIds` extend or implement a type the resolver could not follow.
|
|
540
|
+
* An ancestor outside the index (`React.Component`, `stream.Transform`, a
|
|
541
|
+
* framework interface) leaves no edge, only this `extends` / `implements`
|
|
542
|
+
* row, so it is the one record that such an ancestor exists (#1973).
|
|
543
|
+
* Chunked probe over `idx_unresolved_from_node`.
|
|
544
|
+
*/
|
|
545
|
+
getUnresolvedSupertypeSourcesAmong(nodeIds: Iterable<string>): Set<string>;
|
|
546
|
+
/**
|
|
547
|
+
* Which of `names` are carried by MORE THAN ONE symbol, at least one of which
|
|
548
|
+
* something points at.
|
|
549
|
+
*
|
|
550
|
+
* The false positive this exists to kill: `LatticeSensor.getTopRouteFile` calls
|
|
551
|
+
* `this.queries.getTopRouteFile()`, and the resolver — which prefers a
|
|
552
|
+
* same-name definition in the call site's own file — attaches that edge to
|
|
553
|
+
* the *calling* method. One of the two ends up with a self-edge and the other
|
|
554
|
+
* with nothing at all, and neither is unreferenced. From the edge table the
|
|
555
|
+
* mis-resolution and a genuinely unused twin are the same picture, so the
|
|
556
|
+
* claim is not made about either.
|
|
557
|
+
*
|
|
558
|
+
* Both halves of the condition are load-bearing. **More than one symbol**:
|
|
559
|
+
* a uniquely-named function that only calls itself is genuinely dead, and
|
|
560
|
+
* excluding every recursive function would gut the list. **Self-edges
|
|
561
|
+
* counted**: the self-edge IS the fingerprint of the mis-resolution above, so
|
|
562
|
+
* it has to count as evidence that this name resolves somewhere.
|
|
563
|
+
*
|
|
564
|
+
* Chunked probe over `idx_nodes_name`, bounded by the caller's candidate list.
|
|
565
|
+
*/
|
|
566
|
+
getAmbiguousReferencedNames(names: Iterable<string>): Set<string>;
|
|
567
|
+
/**
|
|
568
|
+
* Which of the given languages the index records an EXPORT marker for.
|
|
569
|
+
*
|
|
570
|
+
* A self-measurement, and the honest basis for a whole class of exclusion.
|
|
571
|
+
* The dead code report's strongest filter is "exported symbols may be reached
|
|
572
|
+
* from outside this repository" — and that filter silently does nothing for a
|
|
573
|
+
* language whose exports are not recorded, either because the extractor does
|
|
574
|
+
* not record them (Rust `pub`) or because the language has no such concept at
|
|
575
|
+
* all (Python, C, Ruby: the header or the module IS the surface). Rather than
|
|
576
|
+
* carry a table of which is which, ask the index: if nothing in this language
|
|
577
|
+
* is marked exported, the filter did not run, and no claim about outside
|
|
578
|
+
* reachability can be made for it.
|
|
579
|
+
*
|
|
580
|
+
* `idx_nodes_language` covers the grouping; the caller passes the handful of
|
|
581
|
+
* languages its candidates are actually in.
|
|
582
|
+
*/
|
|
583
|
+
getLanguagesWithExports(languages: Iterable<string>): Set<string>;
|
|
584
|
+
/**
|
|
585
|
+
* The nodes with the most DISTINCT dependents, most first.
|
|
586
|
+
*
|
|
587
|
+
* "Distinct" is the difference that matters: a helper called forty times from
|
|
588
|
+
* one function has a fan-in of 40 but exactly one dependent. This counts the
|
|
589
|
+
* second thing — the number a reader means by "N callers" — so the top of
|
|
590
|
+
* this list is the set of symbols a change actually radiates furthest from.
|
|
591
|
+
*
|
|
592
|
+
* `contains` is excluded because it is structure, not dependency: counting it
|
|
593
|
+
* would rank every file and class above the code they hold.
|
|
594
|
+
*/
|
|
595
|
+
getTopDependedOn(limit: number): Array<{
|
|
596
|
+
nodeId: string;
|
|
597
|
+
dependents: number;
|
|
598
|
+
}>;
|
|
599
|
+
/**
|
|
600
|
+
* The graph's executable roots — files that RUN something at module level,
|
|
601
|
+
* ranked by how much of the project they set in motion.
|
|
602
|
+
*
|
|
603
|
+
* The engine records a statement at the top level of a file as an edge from
|
|
604
|
+
* the *file* node, so `src/bin/lattice-sensor.ts` calling `program.parse()` at
|
|
605
|
+
* module scope is a `calls` edge out of a `file`. That set is what makes the
|
|
606
|
+
* roots of a dependency graph visible: a library module holds definitions and
|
|
607
|
+
* runs nothing until someone imports it, while a CLI, a worker entry or a
|
|
608
|
+
* build script does its work on the way down the file. `instantiates` counts
|
|
609
|
+
* the same way — `new Server(...)` at module scope is the same act.
|
|
610
|
+
*
|
|
611
|
+
* A call made while initializing a module-level `variable` / `constant` —
|
|
612
|
+
* `const service = new Service()`, `app = FastAPI()` — is attributed to the
|
|
613
|
+
* declared name (#693), not to the file, so the file's own edges alone would
|
|
614
|
+
* miss most of what a real entry point runs. Those names are the file's
|
|
615
|
+
* top-level code too, so `tops` counts them alongside the file node.
|
|
616
|
+
*
|
|
617
|
+
* Ranking multiplies the two things an entry point does: it runs (calls), and
|
|
618
|
+
* it wires the project together (distinct other files its symbols reach). One
|
|
619
|
+
* alone is misleading — a registration table makes hundreds of module-level
|
|
620
|
+
* calls into itself, and a barrel file imports everything and runs nothing.
|
|
621
|
+
* The product puts the file that does both at the top.
|
|
622
|
+
*/
|
|
623
|
+
getTopCallingFiles(limit: number): Array<{
|
|
624
|
+
nodeId: string;
|
|
625
|
+
filePath: string;
|
|
626
|
+
calls: number;
|
|
627
|
+
reaches: number;
|
|
628
|
+
score: number;
|
|
629
|
+
}>;
|
|
630
|
+
/**
|
|
631
|
+
* How many OTHER files depend on each of the given files.
|
|
632
|
+
*
|
|
633
|
+
* Counted through the symbols, not the file nodes: an `imports` edge points
|
|
634
|
+
* at the imported symbol, so a file node almost never receives one and
|
|
635
|
+
* counting edges into it would report every file as depended on by nobody.
|
|
636
|
+
* Same-file edges are excluded, which is what makes zero mean "nothing else
|
|
637
|
+
* in the index reaches into this file" — the honest reading of a root.
|
|
638
|
+
*/
|
|
639
|
+
getFileDependentCounts(filePaths: string[]): Array<{
|
|
640
|
+
filePath: string;
|
|
641
|
+
dependents: number;
|
|
642
|
+
}>;
|
|
643
|
+
/**
|
|
644
|
+
* How far each of the given files reaches OUT: distinct other files its
|
|
645
|
+
* symbols touch, and how many references that is.
|
|
646
|
+
*
|
|
647
|
+
* The mirror of {@link getFileDependentCounts}, and the same reasoning about
|
|
648
|
+
* `contains` and same-file edges applies. It is driven from `nodes` rather
|
|
649
|
+
* than from `edges` so the work is proportional to the files asked about —
|
|
650
|
+
* the entry-points endpoint asks it about every test file in the index, and
|
|
651
|
+
* an edge-first plan would scan the whole table to answer a question about a
|
|
652
|
+
* tenth of it.
|
|
653
|
+
*/
|
|
654
|
+
getFileReachCounts(filePaths: string[]): Array<{
|
|
655
|
+
filePath: string;
|
|
656
|
+
reaches: number;
|
|
657
|
+
refs: number;
|
|
658
|
+
}>;
|
|
659
|
+
/**
|
|
660
|
+
* The `file` nodes for the given paths, in one query.
|
|
661
|
+
*
|
|
662
|
+
* A file's own node is what makes a file row navigable, and looking it up
|
|
663
|
+
* with {@link getNodesInFile} means materialising every symbol in the file to
|
|
664
|
+
* throw all but one away.
|
|
665
|
+
*/
|
|
666
|
+
getFileNodes(filePaths: string[]): Node[];
|
|
667
|
+
/**
|
|
668
|
+
* Roll the whole edge table up to module granularity in one pass.
|
|
669
|
+
*
|
|
670
|
+
* The caller decides what a module IS — it hands in a file → module
|
|
671
|
+
* assignment and gets back the cross-module traffic. That split is
|
|
672
|
+
* deliberate: naming modules is a *policy* (top-level directories, a façade
|
|
673
|
+
* file kept separate, a monorepo root) that belongs where the reader lives,
|
|
674
|
+
* while grouping a million edges by it is *mechanics* that must happen in
|
|
675
|
+
* SQLite. Doing the fold in JavaScript instead means materialising every
|
|
676
|
+
* cross-file edge in memory; doing the naming in SQL means a tower of
|
|
677
|
+
* `instr`/`substr` no one can read.
|
|
678
|
+
*
|
|
679
|
+
* The assignment lands in a TEMP table with a primary key, so the join is
|
|
680
|
+
* indexed and the result set is bounded by modules², not by edges. Temp
|
|
681
|
+
* tables live in SQLite's own temp database, so this stays valid against a
|
|
682
|
+
* read-only main.
|
|
683
|
+
*
|
|
684
|
+
* Two result sets, because they need two different groupings over the same
|
|
685
|
+
* join: `links` counts edges per (module, module, kind), and `pairs` names
|
|
686
|
+
* the busiest symbol pairs behind each link (the map's tooltip). `pairs` is
|
|
687
|
+
* ranked and cut inside SQLite — the un-cut grouping is the one thing here
|
|
688
|
+
* that scales with distinct symbol names rather than with modules. Pairs are
|
|
689
|
+
* ranked by `declared` before raw count, so a link's tooltip names the
|
|
690
|
+
* symbols the source actually points at rather than whichever `has`/`get`
|
|
691
|
+
* happened to name-match most often.
|
|
692
|
+
*
|
|
693
|
+
* `declared` is the subset of a link's edges that came from something the
|
|
694
|
+
* source *writes down*: an import, a qualified name, an inheritance clause,
|
|
695
|
+
* or a call through a typed receiver. It exists because bare name matching
|
|
696
|
+
* (`resolvedBy: 'exact-match'`) is what invents cross-module links out of
|
|
697
|
+
* common method names — `run`, `push`, `finish` — and a map that lets those
|
|
698
|
+
* decide the layering puts the storage layer above the CLI.
|
|
699
|
+
*/
|
|
700
|
+
aggregateModuleGraph(assignments: ReadonlyArray<{
|
|
701
|
+
filePath: string;
|
|
702
|
+
module: string;
|
|
703
|
+
}>, options: {
|
|
704
|
+
kinds: readonly EdgeKind[];
|
|
705
|
+
minConfidence: number;
|
|
706
|
+
topPairsPerLink: number;
|
|
707
|
+
pairKinds: readonly EdgeKind[];
|
|
708
|
+
}): {
|
|
709
|
+
links: Array<{
|
|
710
|
+
source: string;
|
|
711
|
+
target: string;
|
|
712
|
+
kind: EdgeKind;
|
|
713
|
+
count: number;
|
|
714
|
+
declared: number;
|
|
715
|
+
uncertain: number;
|
|
716
|
+
}>;
|
|
717
|
+
pairs: Array<{
|
|
718
|
+
source: string;
|
|
719
|
+
target: string;
|
|
720
|
+
from: string;
|
|
721
|
+
to: string;
|
|
722
|
+
count: number;
|
|
723
|
+
declared: number;
|
|
724
|
+
}>;
|
|
725
|
+
};
|
|
726
|
+
/**
|
|
727
|
+
* Every ordered pair of files where one reaches into the other, once each.
|
|
728
|
+
*
|
|
729
|
+
* The input a cycle finder wants: file-level circular dependencies are the
|
|
730
|
+
* strongly connected components of this graph. One query instead of the
|
|
731
|
+
* dependency lookup per file that {@link GraphQueryManager.findCircularDependencies}
|
|
732
|
+
* does — which matters because a cycle report is only interesting on a large
|
|
733
|
+
* repo, and that is exactly where a query per file stops being affordable.
|
|
734
|
+
*
|
|
735
|
+
* `contains` is excluded (a file "contains" its own symbols, which is not a
|
|
736
|
+
* dependency), and so are same-file edges and low-confidence name matches:
|
|
737
|
+
* a cycle conjured by a common method name is a false alarm a reader cannot
|
|
738
|
+
* check.
|
|
739
|
+
*/
|
|
740
|
+
getCrossFileDependencyPairs(minConfidence: number): Array<{
|
|
741
|
+
source: string;
|
|
742
|
+
target: string;
|
|
743
|
+
}>;
|
|
744
|
+
/**
|
|
745
|
+
* Every unresolved reference recorded in one FILE, ordered by line.
|
|
746
|
+
*
|
|
747
|
+
* The per-symbol form above answers "what does this body reach that the
|
|
748
|
+
* index does not hold". A whole-file reader asks the same question of every
|
|
749
|
+
* line at once, and asking it one symbol at a time is a query per symbol —
|
|
750
|
+
* 153 of them on this repo's largest file. `unresolved_refs.file_path` is
|
|
751
|
+
* indexed, so this is one lookup whatever the file holds.
|
|
752
|
+
*
|
|
753
|
+
* `limit` bounds the answer rather than the work: the caller draws a marker
|
|
754
|
+
* per row, and a generated file with fifty thousand of them would ship
|
|
755
|
+
* megabytes to say something a count already says. Rows come back in line
|
|
756
|
+
* order, so a cap trims the END of the file, which is at least legible.
|
|
757
|
+
*/
|
|
758
|
+
getUnresolvedReferencesInFile(filePath: string, limit?: number): UnresolvedReference[];
|
|
759
|
+
/**
|
|
760
|
+
* References recorded against a symbol that never resolved to a node — the
|
|
761
|
+
* calls and type mentions that leave the index (a third-party package, a
|
|
762
|
+
* runtime builtin, a language construct extraction doesn't model).
|
|
763
|
+
*
|
|
764
|
+
* Read-only. It exists so a reader can say "N calls into symbols outside the
|
|
765
|
+
* index" instead of silently showing a callee list shorter than the body's
|
|
766
|
+
* call sites, which reads as "nothing else happens here".
|
|
767
|
+
*/
|
|
768
|
+
getUnresolvedReferencesFrom(fromNodeId: string): UnresolvedReference[];
|
|
352
769
|
/**
|
|
353
770
|
* Find all edges where both source and target are in the given node set.
|
|
354
771
|
* Useful for recovering inter-node connectivity after BFS.
|
|
@@ -422,6 +839,90 @@ export declare class QueryBuilder {
|
|
|
422
839
|
* wonder why the index never converges.
|
|
423
840
|
*/
|
|
424
841
|
getExtractionAheadFileCount(currentVersion: number): number;
|
|
842
|
+
/**
|
|
843
|
+
* Which of `filePaths` the index flagged as tool-generated (schema v9+).
|
|
844
|
+
*
|
|
845
|
+
* Bounded-lookup by design: every consumer already holds a short candidate
|
|
846
|
+
* list (a ranked file group, an FTS result page, a LIMIT-20 aggregate), so
|
|
847
|
+
* this stays a partial-index probe over a handful of paths — no whole-repo
|
|
848
|
+
* set to materialize, and no cache to invalidate, which means a ranking call
|
|
849
|
+
* can never serve a verdict the last sync already replaced.
|
|
850
|
+
*
|
|
851
|
+
* Returns ONLY the content/index signal; callers union it with
|
|
852
|
+
* {@link isGeneratedFile} so pre-v9 databases (column present, all zeros
|
|
853
|
+
* until a re-index) keep the path-only behavior rather than regressing.
|
|
854
|
+
*/
|
|
855
|
+
getGeneratedPathsAmong(filePaths: Iterable<string>): Set<string>;
|
|
856
|
+
/**
|
|
857
|
+
* A reusable `(path) => boolean` over a bounded candidate list, unioning the
|
|
858
|
+
* indexed flag with the path convention. This is the shape every ranking
|
|
859
|
+
* comparator wants: one query up front, then O(1) per comparison.
|
|
860
|
+
*/
|
|
861
|
+
generatedPredicateFor(filePaths: Iterable<string>): (filePath: string) => boolean;
|
|
862
|
+
/**
|
|
863
|
+
* Which of `filePaths` are AMBIENT DECLARATION files — they declare nothing
|
|
864
|
+
* but types, and nothing in the index depends on them (CG-28). A hand-written
|
|
865
|
+
* ambient `.d.ts` of global shims, a vendored typings file, module
|
|
866
|
+
* augmentation: reachable only by name, structurally attached to nothing.
|
|
867
|
+
*
|
|
868
|
+
* Structural, not extension-based, so a hand-written `types.ts` and a `.d.ts`
|
|
869
|
+
* are judged by the same rule and a `.d.ts` that does declare a class or a
|
|
870
|
+
* const is (correctly) not caught. Four conditions, all required:
|
|
871
|
+
*
|
|
872
|
+
* 1. it declares at least one symbol — an empty or unparsed file is not a
|
|
873
|
+
* declaration file, it is a file we know nothing about;
|
|
874
|
+
* 2. EVERY declared symbol is a type-level kind (interface / type alias /
|
|
875
|
+
* enum / namespace). The narrowness is deliberate and measured: a rule
|
|
876
|
+
* of "no callables" alone flags 1–18% of a repo, including Kotlin sealed
|
|
877
|
+
* classes, Rust `mod.rs` re-exports and django's locale constant tables —
|
|
878
|
+
* real source that must not be demoted. This rule flags 0–4%;
|
|
879
|
+
* 3. no symbol in it originates a `calls`/`instantiates` edge — the direct
|
|
880
|
+
* evidence that nothing here has a body;
|
|
881
|
+
* 4. NOTHING ELSE IN THE INDEX points at it. This is the condition that
|
|
882
|
+
* separates an ambient shim from a working type module, and it is why
|
|
883
|
+
* the flag is narrow enough to be safe: `displacement-ts`'s pipeline
|
|
884
|
+
* `types.ts` passes 1–3 identically but carries 13 inbound imports and
|
|
885
|
+
* 21 references, so the files that answer a query about the pipeline are
|
|
886
|
+
* typed BY it — it is part of that answer's structure. An ambient
|
|
887
|
+
* `declare global` shim has zero. Deliberately index-wide rather than
|
|
888
|
+
* restricted to the candidate list: the file that imports it is usually
|
|
889
|
+
* not itself a candidate.
|
|
890
|
+
*
|
|
891
|
+
* ### Interface MEMBERS are transparent to all four conditions
|
|
892
|
+
*
|
|
893
|
+
* A `method_signature` / `property_signature` inside an interface enters the
|
|
894
|
+
* graph as a `method` / `property` node (#1638). Read literally that would
|
|
895
|
+
* break every condition here at once: condition 2 sees non-type kinds and
|
|
896
|
+
* stops flagging, and — worse, because it is silent — condition 4 starts
|
|
897
|
+
* seeing inbound `calls` edges the moment a call site through the shim's API
|
|
898
|
+
* finally has a signature to land on. An ambient `.d.ts` would quietly lose
|
|
899
|
+
* its damping precisely BECAUSE the platform API it declares is widely used.
|
|
900
|
+
*
|
|
901
|
+
* So an interface-owned member is treated the way `parameter` already is: it
|
|
902
|
+
* neither qualifies, disqualifies, nor counts as inbound dependency. That is
|
|
903
|
+
* not a new judgement call, it is what keeps the rule measuring what it was
|
|
904
|
+
* measured on — before #1638 these nodes did not exist, so excluding them
|
|
905
|
+
* reproduces the 0–4% flag rate the thresholds above were tuned against. It
|
|
906
|
+
* is also the semantically right answer: a signature with no body is on the
|
|
907
|
+
* same side of the line as the interface that owns it, and a call edge
|
|
908
|
+
* landing on one is still not a file that can answer a flow question.
|
|
909
|
+
*
|
|
910
|
+
* The interface ITSELF is untouched: the `references` edges an importing
|
|
911
|
+
* module aims at `UploadStorage` still disqualify the file under (4), which
|
|
912
|
+
* is what keeps a depended-on `types.ts` out of the flag.
|
|
913
|
+
*
|
|
914
|
+
* Bounded-lookup like {@link getGeneratedPathsAmong}: callers hold a ranked
|
|
915
|
+
* candidate list, so this is a partial-index probe over a handful of paths.
|
|
916
|
+
*/
|
|
917
|
+
getAmbientDeclarationPathsAmong(filePaths: Iterable<string>): Set<string>;
|
|
918
|
+
/**
|
|
919
|
+
* A reusable `(path) => boolean` ambient-declaration test over a bounded
|
|
920
|
+
* candidate list — the shape a ranking comparator wants: one query up front,
|
|
921
|
+
* O(1) per comparison.
|
|
922
|
+
*/
|
|
923
|
+
ambientDeclarationPredicateFor(filePaths: Iterable<string>): (filePath: string) => boolean;
|
|
924
|
+
/** How many indexed files carry the generated flag. Surfaced by `status`. */
|
|
925
|
+
countGeneratedFiles(): number;
|
|
425
926
|
/**
|
|
426
927
|
* Delete a file record and its nodes
|
|
427
928
|
*/
|
|
@@ -439,6 +940,33 @@ export declare class QueryBuilder {
|
|
|
439
940
|
* null when nothing is indexed yet. One indexed aggregate, no per-row scan. (#329)
|
|
440
941
|
*/
|
|
441
942
|
getLastIndexedAt(): number | null;
|
|
943
|
+
/**
|
|
944
|
+
* The index's revision marker: how far the last sync got, and how many files
|
|
945
|
+
* it left behind — one query, both numbers.
|
|
946
|
+
*
|
|
947
|
+
* This is the cheapest honest answer to "has the index moved since I last
|
|
948
|
+
* looked". `MAX(indexed_at)` alone is not enough: a sync that only DELETES
|
|
949
|
+
* files (a branch checkout that removed a directory) advances nothing, and
|
|
950
|
+
* the graph the viewer is showing has still changed underneath it. The row
|
|
951
|
+
* count catches exactly that case.
|
|
952
|
+
*/
|
|
953
|
+
getIndexRevision(): {
|
|
954
|
+
lastIndexedAt: number | null;
|
|
955
|
+
fileCount: number;
|
|
956
|
+
};
|
|
957
|
+
/**
|
|
958
|
+
* Files re-indexed strictly after `since` (ms since epoch), newest first.
|
|
959
|
+
*
|
|
960
|
+
* `total` is the real count; `paths` is capped at `limit`. Used by the
|
|
961
|
+
* viewer's live channel to name what a sync just picked up. A file the same
|
|
962
|
+
* sync DELETED cannot appear here — it has no row left — which is why the
|
|
963
|
+
* caller compares {@link getIndexRevision} as well rather than treating an
|
|
964
|
+
* empty list as "nothing happened".
|
|
965
|
+
*/
|
|
966
|
+
getFilesIndexedSince(since: number, limit: number): {
|
|
967
|
+
paths: string[];
|
|
968
|
+
total: number;
|
|
969
|
+
};
|
|
442
970
|
/**
|
|
443
971
|
* Get files that need re-indexing (hash changed)
|
|
444
972
|
*/
|
|
@@ -486,7 +1014,7 @@ export declare class QueryBuilder {
|
|
|
486
1014
|
* (§7a.2) — while the seek is O(batch) forever. `id` is the rowid alias, so
|
|
487
1015
|
* the enumeration order is identical to the OFFSET reader's.
|
|
488
1016
|
*/
|
|
489
|
-
getUnresolvedReferencesBatchAfter(afterRowId: number, limit: number): UnresolvedReference[];
|
|
1017
|
+
getUnresolvedReferencesBatchAfter(afterRowId: number, limit: number, prerequisites?: boolean): UnresolvedReference[];
|
|
490
1018
|
/**
|
|
491
1019
|
* Get all tracked file paths (lightweight — no full FileRecord objects)
|
|
492
1020
|
*/
|
|
@@ -579,11 +1107,60 @@ export declare class QueryBuilder {
|
|
|
579
1107
|
* arbitrary subset would be both wasted work and incoherent coverage.
|
|
580
1108
|
*/
|
|
581
1109
|
getRetryableFailedReferences(names: string[], perNameCeiling?: number): UnresolvedReference[];
|
|
1110
|
+
/**
|
|
1111
|
+
* Resolution edges whose TARGET symbol is named one of `names` — the edges a
|
|
1112
|
+
* sync must re-resolve after `names` gained or lost a definition (CG-33).
|
|
1113
|
+
*
|
|
1114
|
+
* Resolution binds a reference to a node whose name matches the reference's
|
|
1115
|
+
* tail, and it picks among ALL same-named definitions project-wide. So adding
|
|
1116
|
+
* or removing one definition of `pct` changes the answer for every `pct(...)`
|
|
1117
|
+
* reference in the repo — including references in files this sync never
|
|
1118
|
+
* touches, whose edges nothing else revisits. Those edges' current target is,
|
|
1119
|
+
* by that same rule, a node named `pct`, which is why the target's name is a
|
|
1120
|
+
* sufficient (and index-backed, via idx_nodes_name) way to find them without
|
|
1121
|
+
* a schema change or a scan of edge metadata.
|
|
1122
|
+
*
|
|
1123
|
+
* Returns the source file/language alongside each edge so the caller can
|
|
1124
|
+
* resurrect it as its original reference. Excludes `provenance='heuristic'`
|
|
1125
|
+
* (synthesized dispatch edges are not resolution output and carry no refName
|
|
1126
|
+
* stamp to resurrect from — deleting one would be a permanent loss).
|
|
1127
|
+
*
|
|
1128
|
+
* Names matching more than `perNameCeiling` edges are skipped entirely, same
|
|
1129
|
+
* rationale and same default as {@link getRetryableFailedReferences}: at that
|
|
1130
|
+
* population the name is generic (`get`, `clear`, …), one definition changing
|
|
1131
|
+
* won't flip most of them, and rebinding an arbitrary subset is both wasted
|
|
1132
|
+
* work and incoherent coverage.
|
|
1133
|
+
*/
|
|
1134
|
+
getResolutionEdgesByTargetName(names: string[], perNameCeiling?: number): Array<Edge & {
|
|
1135
|
+
edgeId: number;
|
|
1136
|
+
sourceFilePath: string;
|
|
1137
|
+
sourceLanguage: Language;
|
|
1138
|
+
}>;
|
|
1139
|
+
/** Delete edges by primary key — the rebind pass's half of a re-resolution. */
|
|
1140
|
+
deleteEdgesByIds(edgeIds: number[]): number;
|
|
1141
|
+
/**
|
|
1142
|
+
* Replace resolution edges with their original unresolved references as one
|
|
1143
|
+
* transaction. If ref insertion fails, the edge deletion is rolled back.
|
|
1144
|
+
*/
|
|
1145
|
+
replaceResolutionEdgesWithUnresolvedRefs(edgeIds: number[], refs: UnresolvedReference[]): number;
|
|
582
1146
|
/**
|
|
583
1147
|
* Distinct node names present in the given files — the symbol names a sync
|
|
584
1148
|
* pass uses to look up retryable failed refs after those files changed.
|
|
585
1149
|
*/
|
|
586
1150
|
getNodeNamesByFiles(filePaths: string[]): string[];
|
|
1151
|
+
/**
|
|
1152
|
+
* Distinct `file\0name` pairs defined by the given files — the shape sync's
|
|
1153
|
+
* definition delta needs (CG-33).
|
|
1154
|
+
*
|
|
1155
|
+
* Deliberately NOT `getNodeNamesByFiles`: a bare name set is taken over the
|
|
1156
|
+
* WHOLE changed batch, so a name that moves between two files in one commit
|
|
1157
|
+
* (or exists in one changed file and is newly added to another) appears on
|
|
1158
|
+
* both sides and cancels out of the symmetric difference — even though a
|
|
1159
|
+
* definition genuinely appeared or vanished and every reference to that name
|
|
1160
|
+
* repo-wide may now bind elsewhere. Keying by file makes each definition its
|
|
1161
|
+
* own fact, so the move is seen as one removal plus one addition.
|
|
1162
|
+
*/
|
|
1163
|
+
getNodeNamePairsByFiles(filePaths: string[]): Set<string>;
|
|
587
1164
|
/**
|
|
588
1165
|
* Lightweight (nodes, edges) count snapshot. Used around an index/sync
|
|
589
1166
|
* run to compute true additions across extraction + resolution +
|