@quolu/lattice 0.69.5 → 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/README.ja.md +5 -1
- 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/cli-help.mjs +4 -2
- package/src/sensor-adapter.mjs +5 -1
- package/src/todo-cli.mjs +88 -11
|
@@ -1,17 +1,65 @@
|
|
|
1
1
|
/** Lattice sensor project-state directory management. */
|
|
2
|
+
/**
|
|
3
|
+
* The per-project data directory, as upstream's name for it. Lattice has one
|
|
4
|
+
* fixed path (no `LATTICE_SENSOR_DIR` override, no per-host variant), so this is
|
|
5
|
+
* {@link latticeSensorRelativeDir} under the name upstream code imports.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_LATTICE_SENSOR_DIR: string;
|
|
8
|
+
/**
|
|
9
|
+
* Upstream's WSL-on-a-Windows-drive data directory (#995). Lattice does not
|
|
10
|
+
* place an index here — see {@link latticeSensorRelativeDirFor} — and the name is
|
|
11
|
+
* kept only so upstream's WSL diagnostics compile unchanged.
|
|
12
|
+
*/
|
|
13
|
+
export declare const WSL_LATTICE_SENSOR_DIR: string;
|
|
2
14
|
/** Stable repository-relative owner path. It deliberately has no legacy override. */
|
|
3
15
|
export declare function latticeSensorRelativeDir(): string;
|
|
4
16
|
/** Repository-relative sensor state path. */
|
|
5
17
|
export declare const LATTICE_SENSOR_DIR: string;
|
|
6
18
|
/** Lattice owns `.lattice`; source extraction and watching never descend into it. */
|
|
7
19
|
export declare function isLatticeStateDir(name: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The data directory for one project. Upstream picks a WSL-only sibling for a
|
|
22
|
+
* project on a Windows drive (#995); Lattice keeps the single fixed owner path
|
|
23
|
+
* on every host, because `.lattice/` is Lattice's state root and other Lattice
|
|
24
|
+
* components address the sensor index by that path. The WSL factory lane is
|
|
25
|
+
* retired, and a WSL user sharing a tree with Windows-native Lattice must run
|
|
26
|
+
* only one of them against it.
|
|
27
|
+
*/
|
|
28
|
+
export declare function latticeSensorRelativeDirFor(_projectRoot: string): string;
|
|
8
29
|
/** Absolute sensor state directory for a project. */
|
|
9
30
|
export declare function getLatticeSensorDir(projectRoot: string): string;
|
|
10
31
|
/**
|
|
11
|
-
* Check if a project has been initialized with LatticeSensor
|
|
12
|
-
*
|
|
32
|
+
* Check if a project has been initialized with LatticeSensor.
|
|
33
|
+
*
|
|
34
|
+
* Requires `.lattice/sensor/sensor.db` to exist AND to carry the lattice sensor
|
|
35
|
+
* schema. A file that merely exists — empty, or a SQLite database with no
|
|
36
|
+
* tables, as an interrupted `init` or a stray `touch` leaves behind — used to
|
|
37
|
+
* count as initialized, so one such file in an ANCESTOR directory (worst
|
|
38
|
+
* case: `$HOME`) captured the upward resolution of every project beneath it
|
|
39
|
+
* and made their real indexes unreachable (#1895).
|
|
40
|
+
*
|
|
41
|
+
* The probe is cheap and gated so hot callers (the prompt hook, MCP root
|
|
42
|
+
* resolution on every call) pay one `stat`: file size, then a read-only
|
|
43
|
+
* SQLite open with a single `sqlite_master` lookup — memoized per path +
|
|
44
|
+
* mtime + size so an unchanged db is never reopened. A database that cannot
|
|
45
|
+
* be inspected counts as initialized (see probeSchema) — only a proven-absent
|
|
46
|
+
* schema, or a file SQLite refuses as not a database, says no.
|
|
13
47
|
*/
|
|
14
48
|
export declare function isInitialized(projectRoot: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* `sensor.db` exists at `projectRoot` but does not carry the schema, and
|
|
51
|
+
* `init` can add it in place: an empty file, or a SQLite database without the
|
|
52
|
+
* lattice sensor tables (#1895). A file that is not SQLite at all is NOT this case —
|
|
53
|
+
* see {@link hasForeignDbFile}.
|
|
54
|
+
*/
|
|
55
|
+
export declare function hasSchemalessDb(projectRoot: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* `sensor.db` exists at `projectRoot` and is not a SQLite database (no
|
|
58
|
+
* header magic): SQLite refuses to open it, so `init` cannot rebuild it in
|
|
59
|
+
* place. The caller must say so rather than promise a repair; nothing here
|
|
60
|
+
* deletes the file.
|
|
61
|
+
*/
|
|
62
|
+
export declare function hasForeignDbFile(projectRoot: string): boolean;
|
|
15
63
|
/**
|
|
16
64
|
* Find the nearest parent directory containing .lattice/sensor/
|
|
17
65
|
*
|
|
@@ -36,6 +84,25 @@ export declare function isInitialized(projectRoot: string): boolean;
|
|
|
36
84
|
* The returned string is a human phrase that slots into "… looks like {reason}".
|
|
37
85
|
*/
|
|
38
86
|
export declare function unsafeIndexRootReason(projectRoot: string): string | null;
|
|
87
|
+
/**
|
|
88
|
+
* `dev:ino` for a path, or null if it can't be stat'd or the platform doesn't
|
|
89
|
+
* report a usable inode. Read as bigints: WSL DrvFs (`/mnt/c`) reports inodes
|
|
90
|
+
* above 2^53, where a plain number rounds nearby inodes onto one value. Windows
|
|
91
|
+
* st_ino is unreliable across handle reopens, so we deliberately return null
|
|
92
|
+
* there — the deleted-but-open-inode hazard this guards (#925) is a POSIX
|
|
93
|
+
* file-semantics issue that doesn't arise on Windows (an open file can't be
|
|
94
|
+
* unlinked).
|
|
95
|
+
*/
|
|
96
|
+
export declare function statInode(p: string): string | null;
|
|
97
|
+
/**
|
|
98
|
+
* Whether two resolved index roots are one index spelled two ways — a symlinked
|
|
99
|
+
* checkout, or a case-variant on a case-insensitive mount (macOS, NTFS, WSL
|
|
100
|
+
* DrvFs `/mnt/c`), where `realpathSync` keeps the caller's casing (#1057).
|
|
101
|
+
* Compares the identity of both data directories as they are NOW, so an inode
|
|
102
|
+
* reused after a delete can't match: the deleted root no longer stats. Windows
|
|
103
|
+
* has no usable inode, so it compares the on-disk-cased native realpaths.
|
|
104
|
+
*/
|
|
105
|
+
export declare function isSameIndexRoot(a: string, b: string): boolean;
|
|
39
106
|
export declare function findNearestLatticeSensorRoot(startPath: string): string | null;
|
|
40
107
|
/**
|
|
41
108
|
* Indexed sub-project roots beneath `root` (bounded breadth-first scan). For
|
|
@@ -49,6 +116,35 @@ export declare function findIndexedSubprojectRoots(root: string, opts?: {
|
|
|
49
116
|
maxDepth?: number;
|
|
50
117
|
max?: number;
|
|
51
118
|
}): string[];
|
|
119
|
+
/** Result of {@link resolveServerRoot}. */
|
|
120
|
+
export interface ServerRootResolution {
|
|
121
|
+
/** The project root to serve as the default, or null when none resolved. */
|
|
122
|
+
root: string | null;
|
|
123
|
+
/** True when `root` was adopted from the down-scan rather than the up-walk. */
|
|
124
|
+
viaSubScan: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Indexed sub-projects the down-scan saw when it ran but could NOT adopt
|
|
127
|
+
* (zero or several candidates). Empty when the up-walk resolved or the scan
|
|
128
|
+
* was skipped. Callers surface these so "no default project" errors can say
|
|
129
|
+
* what IS reachable (#1607).
|
|
130
|
+
*/
|
|
131
|
+
candidates: string[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Resolve the project root an MCP server should serve as its DEFAULT project
|
|
135
|
+
* (#1606). Up-walk first (`findNearestLatticeSensorRoot` — the common case, and
|
|
136
|
+
* cheap). When nothing is indexed at or above `searchFrom`, run the bounded
|
|
137
|
+
* sub-project down-scan `planFrontload` already uses, behind the workspace
|
|
138
|
+
* gate above: EXACTLY ONE indexed sub-project is unambiguous and is adopted
|
|
139
|
+
* as the root; zero or several yield no root, with the candidates carried so
|
|
140
|
+
* the caller can name them instead of failing silently (#1607).
|
|
141
|
+
*
|
|
142
|
+
* `opts.subprojectScan: false` skips the down-scan entirely (the per-tool-call
|
|
143
|
+
* retry path throttles it; the up-walk always runs).
|
|
144
|
+
*/
|
|
145
|
+
export declare function resolveServerRoot(searchFrom: string, opts?: {
|
|
146
|
+
subprojectScan?: boolean;
|
|
147
|
+
}): ServerRootResolution;
|
|
52
148
|
/**
|
|
53
149
|
* Does `prompt` contain an explicit structural keyword? A keyword is a strong,
|
|
54
150
|
* self-contained signal, so the front-load hook fires on it directly — no graph
|
|
@@ -85,6 +181,26 @@ export declare function extractCodeTokens(prompt: string): string[];
|
|
|
85
181
|
* non-candidate prompt ("fix this typo", in any language) stays a zero-cost no-op.
|
|
86
182
|
*/
|
|
87
183
|
export declare function isStructuralPrompt(prompt: string): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Claude Code persists `UserPromptSubmit` hook stdout above this many
|
|
186
|
+
* characters to a file and shows the model a ~2 KB preview instead (#1694).
|
|
187
|
+
* Measured on Claude Code 2.1.261; documented in the hooks reference as a
|
|
188
|
+
* 10,000-character cap on hook output strings.
|
|
189
|
+
*/
|
|
190
|
+
export declare const CLAUDE_CODE_INLINE_HOOK_OUTPUT_LIMIT = 10000;
|
|
191
|
+
/**
|
|
192
|
+
* Max characters of explore text injected by `lattice sensor prompt-hook` before
|
|
193
|
+
* truncation. Must stay under {@link CLAUDE_CODE_INLINE_HOOK_OUTPUT_LIMIT} so
|
|
194
|
+
* the host delivers the payload inline. 9,000 leaves ~1k for the
|
|
195
|
+
* `<lattice_sensor_context>` wrapper and the `projectPath` nudge lines appended
|
|
196
|
+
* after the cap is applied.
|
|
197
|
+
*/
|
|
198
|
+
export declare const PROMPT_HOOK_INJECTION_MAX = 9000;
|
|
199
|
+
/**
|
|
200
|
+
* Cap explore text for the prompt-hook injection, preserving the existing
|
|
201
|
+
* "call lattice_sensor_explore for the rest" notice when truncated.
|
|
202
|
+
*/
|
|
203
|
+
export declare function capPromptHookInjection(text: string, max?: number): string;
|
|
88
204
|
/**
|
|
89
205
|
* What the front-load hook should do for a prompt issued from a directory.
|
|
90
206
|
*/
|
|
@@ -144,4 +260,12 @@ export declare function validateDirectory(projectRoot: string): {
|
|
|
144
260
|
valid: boolean;
|
|
145
261
|
errors: string[];
|
|
146
262
|
};
|
|
263
|
+
/**
|
|
264
|
+
* Claude Code injects `<task-notification>…</task-notification>` blocks as
|
|
265
|
+
* `user` messages when a background agent finishes, and UserPromptSubmit
|
|
266
|
+
* hooks receive them exactly like typed prompts (#1832). The whole prompt
|
|
267
|
+
* must be that single envelope; a user question that merely mentions the
|
|
268
|
+
* marker is still a prompt.
|
|
269
|
+
*/
|
|
270
|
+
export declare function isTaskNotification(prompt: string): boolean;
|
|
147
271
|
//# sourceMappingURL=directory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA,yDAAyD;AASzD,qFAAqF;AACrF,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB,QAA6B,CAAC;AAE7D,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA,yDAAyD;AASzD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAiD,CAAC;AAEzF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAsC,CAAC;AAE1E,qFAAqF;AACrF,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB,QAA6B,CAAC;AAE7D,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAc1D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAM5D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAK7D;AAkDD;;;;;;;;GAQG;AACH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8BxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQlD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAW7D;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmB7E;AA2BD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,MAAM,EAAE,CAqBV;AAED,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAoBD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,oBAAoB,CAStB;AAsND;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAK5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,QAAS,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAA4B,GAAG,MAAM,CAI5F;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;yEAEqE;IACrE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;6EAEyE;IACzE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB;;oEAEgE;IAChE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAwCxE;AAyDD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAgBzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAuBzD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CA8BnE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA+B5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAYlF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG;IACtD,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CA6BA;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1D"}
|
package/sensor/dist/directory.js
CHANGED
|
@@ -34,17 +34,24 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.LATTICE_SENSOR_DIR = void 0;
|
|
37
|
+
exports.PROMPT_HOOK_INJECTION_MAX = exports.CLAUDE_CODE_INLINE_HOOK_OUTPUT_LIMIT = exports.LATTICE_SENSOR_DIR = exports.WSL_LATTICE_SENSOR_DIR = exports.DEFAULT_LATTICE_SENSOR_DIR = void 0;
|
|
38
38
|
exports.latticeSensorRelativeDir = latticeSensorRelativeDir;
|
|
39
39
|
exports.isLatticeStateDir = isLatticeStateDir;
|
|
40
|
+
exports.latticeSensorRelativeDirFor = latticeSensorRelativeDirFor;
|
|
40
41
|
exports.getLatticeSensorDir = getLatticeSensorDir;
|
|
41
42
|
exports.isInitialized = isInitialized;
|
|
43
|
+
exports.hasSchemalessDb = hasSchemalessDb;
|
|
44
|
+
exports.hasForeignDbFile = hasForeignDbFile;
|
|
42
45
|
exports.unsafeIndexRootReason = unsafeIndexRootReason;
|
|
46
|
+
exports.statInode = statInode;
|
|
47
|
+
exports.isSameIndexRoot = isSameIndexRoot;
|
|
43
48
|
exports.findNearestLatticeSensorRoot = findNearestLatticeSensorRoot;
|
|
44
49
|
exports.findIndexedSubprojectRoots = findIndexedSubprojectRoots;
|
|
50
|
+
exports.resolveServerRoot = resolveServerRoot;
|
|
45
51
|
exports.hasStructuralKeyword = hasStructuralKeyword;
|
|
46
52
|
exports.extractCodeTokens = extractCodeTokens;
|
|
47
53
|
exports.isStructuralPrompt = isStructuralPrompt;
|
|
54
|
+
exports.capPromptHookInjection = capPromptHookInjection;
|
|
48
55
|
exports.planFrontload = planFrontload;
|
|
49
56
|
exports.createDirectory = createDirectory;
|
|
50
57
|
exports.removeDirectory = removeDirectory;
|
|
@@ -52,11 +59,24 @@ exports.listDirectoryContents = listDirectoryContents;
|
|
|
52
59
|
exports.getDirectorySize = getDirectorySize;
|
|
53
60
|
exports.ensureSubdirectory = ensureSubdirectory;
|
|
54
61
|
exports.validateDirectory = validateDirectory;
|
|
62
|
+
exports.isTaskNotification = isTaskNotification;
|
|
55
63
|
const fs = __importStar(require("fs"));
|
|
56
64
|
const os = __importStar(require("os"));
|
|
57
65
|
const path = __importStar(require("path"));
|
|
58
66
|
const LATTICE_STATE_DIR = '.lattice';
|
|
59
67
|
const SENSOR_STATE_DIR = 'sensor';
|
|
68
|
+
/**
|
|
69
|
+
* The per-project data directory, as upstream's name for it. Lattice has one
|
|
70
|
+
* fixed path (no `LATTICE_SENSOR_DIR` override, no per-host variant), so this is
|
|
71
|
+
* {@link latticeSensorRelativeDir} under the name upstream code imports.
|
|
72
|
+
*/
|
|
73
|
+
exports.DEFAULT_LATTICE_SENSOR_DIR = path.join(LATTICE_STATE_DIR, SENSOR_STATE_DIR);
|
|
74
|
+
/**
|
|
75
|
+
* Upstream's WSL-on-a-Windows-drive data directory (#995). Lattice does not
|
|
76
|
+
* place an index here — see {@link latticeSensorRelativeDirFor} — and the name is
|
|
77
|
+
* kept only so upstream's WSL diagnostics compile unchanged.
|
|
78
|
+
*/
|
|
79
|
+
exports.WSL_LATTICE_SENSOR_DIR = `${exports.DEFAULT_LATTICE_SENSOR_DIR}-wsl`;
|
|
60
80
|
/** Stable repository-relative owner path. It deliberately has no legacy override. */
|
|
61
81
|
function latticeSensorRelativeDir() {
|
|
62
82
|
return path.join(LATTICE_STATE_DIR, SENSOR_STATE_DIR);
|
|
@@ -67,13 +87,37 @@ exports.LATTICE_SENSOR_DIR = latticeSensorRelativeDir();
|
|
|
67
87
|
function isLatticeStateDir(name) {
|
|
68
88
|
return name === LATTICE_STATE_DIR;
|
|
69
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The data directory for one project. Upstream picks a WSL-only sibling for a
|
|
92
|
+
* project on a Windows drive (#995); Lattice keeps the single fixed owner path
|
|
93
|
+
* on every host, because `.lattice/` is Lattice's state root and other Lattice
|
|
94
|
+
* components address the sensor index by that path. The WSL factory lane is
|
|
95
|
+
* retired, and a WSL user sharing a tree with Windows-native Lattice must run
|
|
96
|
+
* only one of them against it.
|
|
97
|
+
*/
|
|
98
|
+
function latticeSensorRelativeDirFor(_projectRoot) {
|
|
99
|
+
return latticeSensorRelativeDir();
|
|
100
|
+
}
|
|
70
101
|
/** Absolute sensor state directory for a project. */
|
|
71
102
|
function getLatticeSensorDir(projectRoot) {
|
|
72
103
|
return path.join(projectRoot, LATTICE_STATE_DIR, SENSOR_STATE_DIR);
|
|
73
104
|
}
|
|
74
105
|
/**
|
|
75
|
-
* Check if a project has been initialized with LatticeSensor
|
|
76
|
-
*
|
|
106
|
+
* Check if a project has been initialized with LatticeSensor.
|
|
107
|
+
*
|
|
108
|
+
* Requires `.lattice/sensor/sensor.db` to exist AND to carry the lattice sensor
|
|
109
|
+
* schema. A file that merely exists — empty, or a SQLite database with no
|
|
110
|
+
* tables, as an interrupted `init` or a stray `touch` leaves behind — used to
|
|
111
|
+
* count as initialized, so one such file in an ANCESTOR directory (worst
|
|
112
|
+
* case: `$HOME`) captured the upward resolution of every project beneath it
|
|
113
|
+
* and made their real indexes unreachable (#1895).
|
|
114
|
+
*
|
|
115
|
+
* The probe is cheap and gated so hot callers (the prompt hook, MCP root
|
|
116
|
+
* resolution on every call) pay one `stat`: file size, then a read-only
|
|
117
|
+
* SQLite open with a single `sqlite_master` lookup — memoized per path +
|
|
118
|
+
* mtime + size so an unchanged db is never reopened. A database that cannot
|
|
119
|
+
* be inspected counts as initialized (see probeSchema) — only a proven-absent
|
|
120
|
+
* schema, or a file SQLite refuses as not a database, says no.
|
|
77
121
|
*/
|
|
78
122
|
function isInitialized(projectRoot) {
|
|
79
123
|
const sensorDir = getLatticeSensorDir(projectRoot);
|
|
@@ -82,7 +126,102 @@ function isInitialized(projectRoot) {
|
|
|
82
126
|
}
|
|
83
127
|
// Must have sensor.db, not just .lattice/sensor folder
|
|
84
128
|
const dbPath = path.join(sensorDir, 'sensor.db');
|
|
85
|
-
|
|
129
|
+
let st;
|
|
130
|
+
try {
|
|
131
|
+
st = fs.statSync(dbPath);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
return hasLatticeSensorSchema(dbPath, st);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* `sensor.db` exists at `projectRoot` but does not carry the schema, and
|
|
140
|
+
* `init` can add it in place: an empty file, or a SQLite database without the
|
|
141
|
+
* lattice sensor tables (#1895). A file that is not SQLite at all is NOT this case —
|
|
142
|
+
* see {@link hasForeignDbFile}.
|
|
143
|
+
*/
|
|
144
|
+
function hasSchemalessDb(projectRoot) {
|
|
145
|
+
const dbPath = path.join(getLatticeSensorDir(projectRoot), 'sensor.db');
|
|
146
|
+
let st;
|
|
147
|
+
try {
|
|
148
|
+
st = fs.statSync(dbPath);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
if (!st.isFile() || isInitialized(projectRoot))
|
|
154
|
+
return false;
|
|
155
|
+
return st.size === 0 || probeSchema(dbPath) === 'no-schema';
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* `sensor.db` exists at `projectRoot` and is not a SQLite database (no
|
|
159
|
+
* header magic): SQLite refuses to open it, so `init` cannot rebuild it in
|
|
160
|
+
* place. The caller must say so rather than promise a repair; nothing here
|
|
161
|
+
* deletes the file.
|
|
162
|
+
*/
|
|
163
|
+
function hasForeignDbFile(projectRoot) {
|
|
164
|
+
const dbPath = path.join(getLatticeSensorDir(projectRoot), 'sensor.db');
|
|
165
|
+
let st;
|
|
166
|
+
try {
|
|
167
|
+
st = fs.statSync(dbPath);
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
return st.isFile() && st.size > 0 && probeSchema(dbPath) === 'not-sqlite';
|
|
173
|
+
}
|
|
174
|
+
/** A SQLite file header is 100 bytes; anything shorter cannot hold a schema. */
|
|
175
|
+
const SQLITE_HEADER_SIZE = 100;
|
|
176
|
+
/** SQLITE_NOTADB: SQLite read the file and it is not a database. */
|
|
177
|
+
const SQLITE_NOTADB = 26;
|
|
178
|
+
const schemaProbeCache = new Map();
|
|
179
|
+
function hasLatticeSensorSchema(dbPath, st) {
|
|
180
|
+
if (!st.isFile() || st.size < SQLITE_HEADER_SIZE)
|
|
181
|
+
return false;
|
|
182
|
+
const cached = schemaProbeCache.get(dbPath);
|
|
183
|
+
if (cached && cached.mtimeMs === st.mtimeMs && cached.size === st.size)
|
|
184
|
+
return cached.ok;
|
|
185
|
+
const probe = probeSchema(dbPath);
|
|
186
|
+
const ok = probe === 'schema' || probe === 'unknown';
|
|
187
|
+
schemaProbeCache.set(dbPath, { mtimeMs: st.mtimeMs, size: st.size, ok });
|
|
188
|
+
return ok;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* What `sensor.db` holds, asked of SQLite itself through a read-only
|
|
192
|
+
* connection: the lattice sensor schema, a database without it, not a database at
|
|
193
|
+
* all (SQLITE_NOTADB), or `unknown` — locked, busy, a WAL db in a directory we
|
|
194
|
+
* cannot create `-shm` in (read-only checkout, mount, another user's tree),
|
|
195
|
+
* disk I/O. Callers treat `unknown` as initialized: the pre-existing behaviour
|
|
196
|
+
* for a database we cannot inspect.
|
|
197
|
+
*
|
|
198
|
+
* The file is never read through a descriptor of our own, not even for its
|
|
199
|
+
* 16-byte header. Closing ANY descriptor on a database file drops every POSIX
|
|
200
|
+
* lock this process holds on it, including those of a connection it already
|
|
201
|
+
* has open (sqlite.org/howtocorrupt.html §2.2.1) — and the MCP server resolves
|
|
202
|
+
* projects through isInitialized on every call while it holds the index as
|
|
203
|
+
* its writer. SQLite's own connections share one lock table per file, so a
|
|
204
|
+
* second connection opened and closed here leaves the first one's locks alone.
|
|
205
|
+
*/
|
|
206
|
+
function probeSchema(dbPath) {
|
|
207
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
208
|
+
const { DatabaseSync } = require('node:sqlite');
|
|
209
|
+
let db = null;
|
|
210
|
+
try {
|
|
211
|
+
db = new DatabaseSync(dbPath, { readOnly: true });
|
|
212
|
+
const row = db.prepare("SELECT 1 AS ok FROM sqlite_master WHERE type = 'table' AND name = 'nodes'").get();
|
|
213
|
+
return row !== undefined ? 'schema' : 'no-schema';
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
return error?.errcode === SQLITE_NOTADB ? 'not-sqlite' : 'unknown';
|
|
217
|
+
}
|
|
218
|
+
finally {
|
|
219
|
+
// Never hold the handle: Windows file locking would block the owner.
|
|
220
|
+
try {
|
|
221
|
+
db?.close();
|
|
222
|
+
}
|
|
223
|
+
catch { /* already closed */ }
|
|
224
|
+
}
|
|
86
225
|
}
|
|
87
226
|
/**
|
|
88
227
|
* Find the nearest parent directory containing .lattice/sensor/
|
|
@@ -135,6 +274,48 @@ function unsafeIndexRootReason(projectRoot) {
|
|
|
135
274
|
}
|
|
136
275
|
return null;
|
|
137
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* `dev:ino` for a path, or null if it can't be stat'd or the platform doesn't
|
|
279
|
+
* report a usable inode. Read as bigints: WSL DrvFs (`/mnt/c`) reports inodes
|
|
280
|
+
* above 2^53, where a plain number rounds nearby inodes onto one value. Windows
|
|
281
|
+
* st_ino is unreliable across handle reopens, so we deliberately return null
|
|
282
|
+
* there — the deleted-but-open-inode hazard this guards (#925) is a POSIX
|
|
283
|
+
* file-semantics issue that doesn't arise on Windows (an open file can't be
|
|
284
|
+
* unlinked).
|
|
285
|
+
*/
|
|
286
|
+
function statInode(p) {
|
|
287
|
+
if (process.platform === 'win32')
|
|
288
|
+
return null;
|
|
289
|
+
try {
|
|
290
|
+
const s = fs.statSync(p, { bigint: true });
|
|
291
|
+
return `${s.dev}:${s.ino}`;
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Whether two resolved index roots are one index spelled two ways — a symlinked
|
|
299
|
+
* checkout, or a case-variant on a case-insensitive mount (macOS, NTFS, WSL
|
|
300
|
+
* DrvFs `/mnt/c`), where `realpathSync` keeps the caller's casing (#1057).
|
|
301
|
+
* Compares the identity of both data directories as they are NOW, so an inode
|
|
302
|
+
* reused after a delete can't match: the deleted root no longer stats. Windows
|
|
303
|
+
* has no usable inode, so it compares the on-disk-cased native realpaths.
|
|
304
|
+
*/
|
|
305
|
+
function isSameIndexRoot(a, b) {
|
|
306
|
+
if (a === b)
|
|
307
|
+
return true;
|
|
308
|
+
if (process.platform === 'win32') {
|
|
309
|
+
try {
|
|
310
|
+
return fs.realpathSync.native(getLatticeSensorDir(a)) === fs.realpathSync.native(getLatticeSensorDir(b));
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const id = statInode(getLatticeSensorDir(a));
|
|
317
|
+
return id !== null && id === statInode(getLatticeSensorDir(b));
|
|
318
|
+
}
|
|
138
319
|
function findNearestLatticeSensorRoot(startPath) {
|
|
139
320
|
let current = path.resolve(startPath);
|
|
140
321
|
const root = path.parse(current).root;
|
|
@@ -183,6 +364,9 @@ function escapeRegExp(s) {
|
|
|
183
364
|
* never turns into a full-tree crawl on a large repo.
|
|
184
365
|
*/
|
|
185
366
|
function findIndexedSubprojectRoots(root, opts = {}) {
|
|
367
|
+
// A stray workspace manifest must not enable scanning home or broader roots (#1454).
|
|
368
|
+
if (unsafeIndexRootReason(root) !== null)
|
|
369
|
+
return [];
|
|
186
370
|
const maxDepth = opts.maxDepth ?? 4;
|
|
187
371
|
const max = opts.max ?? 64;
|
|
188
372
|
const out = [];
|
|
@@ -214,6 +398,57 @@ function findIndexedSubprojectRoots(root, opts = {}) {
|
|
|
214
398
|
walk(root, 1);
|
|
215
399
|
return out;
|
|
216
400
|
}
|
|
401
|
+
/**
|
|
402
|
+
* Whether `base` is a plausible workspace root for the sub-project down-scan.
|
|
403
|
+
* Mirrors `planFrontload`'s manifest gate, widened to accept a bare `.git`
|
|
404
|
+
* entry — the #1606 shape is a workspace container holding only agent config
|
|
405
|
+
* and a `.git`, with every build manifest living in the indexed children. The
|
|
406
|
+
* user's home directory and the filesystem root are never eligible: a stray
|
|
407
|
+
* manifest there must not turn server startup into a scan that could adopt an
|
|
408
|
+
* unrelated project (#1454 documents that failure mode for the prompt-hook).
|
|
409
|
+
*/
|
|
410
|
+
function eligibleForSubprojectScan(base) {
|
|
411
|
+
if (base === path.parse(base).root)
|
|
412
|
+
return false;
|
|
413
|
+
let home = null;
|
|
414
|
+
try {
|
|
415
|
+
home = os.homedir();
|
|
416
|
+
}
|
|
417
|
+
catch {
|
|
418
|
+
home = null;
|
|
419
|
+
}
|
|
420
|
+
if (home && (base === home || base === path.resolve(home)))
|
|
421
|
+
return false;
|
|
422
|
+
if (looksLikeProjectRoot(base))
|
|
423
|
+
return true;
|
|
424
|
+
return fs.existsSync(path.join(base, '.git'));
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Resolve the project root an MCP server should serve as its DEFAULT project
|
|
428
|
+
* (#1606). Up-walk first (`findNearestLatticeSensorRoot` — the common case, and
|
|
429
|
+
* cheap). When nothing is indexed at or above `searchFrom`, run the bounded
|
|
430
|
+
* sub-project down-scan `planFrontload` already uses, behind the workspace
|
|
431
|
+
* gate above: EXACTLY ONE indexed sub-project is unambiguous and is adopted
|
|
432
|
+
* as the root; zero or several yield no root, with the candidates carried so
|
|
433
|
+
* the caller can name them instead of failing silently (#1607).
|
|
434
|
+
*
|
|
435
|
+
* `opts.subprojectScan: false` skips the down-scan entirely (the per-tool-call
|
|
436
|
+
* retry path throttles it; the up-walk always runs).
|
|
437
|
+
*/
|
|
438
|
+
function resolveServerRoot(searchFrom, opts = {}) {
|
|
439
|
+
const up = findNearestLatticeSensorRoot(searchFrom);
|
|
440
|
+
if (up)
|
|
441
|
+
return { root: up, viaSubScan: false, candidates: [] };
|
|
442
|
+
if (opts.subprojectScan === false)
|
|
443
|
+
return { root: null, viaSubScan: false, candidates: [] };
|
|
444
|
+
const base = path.resolve(searchFrom);
|
|
445
|
+
if (!eligibleForSubprojectScan(base))
|
|
446
|
+
return { root: null, viaSubScan: false, candidates: [] };
|
|
447
|
+
const subs = findIndexedSubprojectRoots(base);
|
|
448
|
+
if (subs.length === 1)
|
|
449
|
+
return { root: subs[0], viaSubScan: true, candidates: subs };
|
|
450
|
+
return { root: null, viaSubScan: false, candidates: subs };
|
|
451
|
+
}
|
|
217
452
|
/**
|
|
218
453
|
* Unicode-aware word-boundary emulation for the keyword lists below. JS's `\b`
|
|
219
454
|
* is ASCII-only — it fires only at `[A-Za-z0-9_]` edges — so it can never bound
|
|
@@ -229,8 +464,9 @@ const NOT_WORD_AFTER = /(?![\p{L}\p{N}_])/u.source;
|
|
|
229
464
|
* Structural keywords matched as EXACT words (boundary on both sides): short
|
|
230
465
|
* or ambiguous tokens where prefix matching would false-positive ("flow" in
|
|
231
466
|
* "flower", "path" in "pathological"). Grouped by language; a term appears once
|
|
232
|
-
* even when several languages share it
|
|
233
|
-
*
|
|
467
|
+
* even when several languages share it. Ambiguous everyday words like PT/ES
|
|
468
|
+
* "como" and DE "wie" are excluded: the hook instead requires another strong
|
|
469
|
+
* keyword, a verified code token, or indexed prose segments (#1654).
|
|
234
470
|
*/
|
|
235
471
|
const STRUCTURAL_WORDS = [
|
|
236
472
|
// English — the pre-#1126 list minus what moved to STRUCTURAL_STEMS: the
|
|
@@ -239,17 +475,16 @@ const STRUCTURAL_WORDS = [
|
|
|
239
475
|
'how', 'where', 'tracing', 'flows?', 'paths?', 'reach(?:es|ed)?', 'wired?', 'breaks?', 'why does',
|
|
240
476
|
// French (où=where, flux=flow, chemin=path, casse=breaks)
|
|
241
477
|
'comment', 'où', 'flux', 'chemins?', 'casse',
|
|
242
|
-
// Spanish (cómo
|
|
478
|
+
// Spanish (cómo=how, dónde/donde=where, flujo=flow, ruta/camino=path,
|
|
243
479
|
// rompe=breaks, llaman / quién llama = call(s) — bare "llama" is excluded:
|
|
244
480
|
// it's also the animal/model name in English prompts)
|
|
245
481
|
'cómo', 'dónde', 'donde', 'flujos?', 'rutas?', 'caminos?', 'rompe', 'llaman', 'quién llama', 'quien llama',
|
|
246
|
-
// Portuguese (
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
// German (wie=how, wo/woher/wohin=where, Pfad=path, Fluss/Ablauf=flow,
|
|
482
|
+
// Portuguese (onde=where, fluxo=flow, caminho=path)
|
|
483
|
+
'onde', 'fluxos?', 'caminhos?',
|
|
484
|
+
// German (wo/woher/wohin=where, Pfad=path, Fluss/Ablauf=flow,
|
|
250
485
|
// bricht/kaputt=breaks, ruft=calls, hängt=depends — "hängt … von X ab"
|
|
251
486
|
// splits the separable verb "abhängen", so the "abhäng" stem can't catch it)
|
|
252
|
-
'
|
|
487
|
+
'wo', 'woher', 'wohin', 'pfade?', 'fluss', 'ablauf', 'bricht', 'kaputt', 'ruft', 'hängt',
|
|
253
488
|
// Italian (dove=where, flusso=flow, percorso/i=path)
|
|
254
489
|
'dove', 'flusso', 'percors[oi]',
|
|
255
490
|
// Russian (как=how, где=where, путь/пути=path, работает=works)
|
|
@@ -485,6 +720,30 @@ function extractCodeTokens(prompt) {
|
|
|
485
720
|
function isStructuralPrompt(prompt) {
|
|
486
721
|
return hasStructuralKeyword(prompt) || extractCodeTokens(prompt).length > 0;
|
|
487
722
|
}
|
|
723
|
+
/**
|
|
724
|
+
* Claude Code persists `UserPromptSubmit` hook stdout above this many
|
|
725
|
+
* characters to a file and shows the model a ~2 KB preview instead (#1694).
|
|
726
|
+
* Measured on Claude Code 2.1.261; documented in the hooks reference as a
|
|
727
|
+
* 10,000-character cap on hook output strings.
|
|
728
|
+
*/
|
|
729
|
+
exports.CLAUDE_CODE_INLINE_HOOK_OUTPUT_LIMIT = 10_000;
|
|
730
|
+
/**
|
|
731
|
+
* Max characters of explore text injected by `lattice sensor prompt-hook` before
|
|
732
|
+
* truncation. Must stay under {@link CLAUDE_CODE_INLINE_HOOK_OUTPUT_LIMIT} so
|
|
733
|
+
* the host delivers the payload inline. 9,000 leaves ~1k for the
|
|
734
|
+
* `<lattice_sensor_context>` wrapper and the `projectPath` nudge lines appended
|
|
735
|
+
* after the cap is applied.
|
|
736
|
+
*/
|
|
737
|
+
exports.PROMPT_HOOK_INJECTION_MAX = 9_000;
|
|
738
|
+
/**
|
|
739
|
+
* Cap explore text for the prompt-hook injection, preserving the existing
|
|
740
|
+
* "call lattice_sensor_explore for the rest" notice when truncated.
|
|
741
|
+
*/
|
|
742
|
+
function capPromptHookInjection(text, max = exports.PROMPT_HOOK_INJECTION_MAX) {
|
|
743
|
+
return text.length > max
|
|
744
|
+
? `${text.slice(0, max)}\n…(truncated; call lattice_sensor_explore for the rest)`
|
|
745
|
+
: text;
|
|
746
|
+
}
|
|
488
747
|
/**
|
|
489
748
|
* Decide what the front-load hook injects for a `prompt` issued from `cwd`,
|
|
490
749
|
* shaped by where the `.lattice/sensor/` index(es) actually are:
|
|
@@ -604,10 +863,10 @@ function ensureGitignore(gitignorePath) {
|
|
|
604
863
|
*/
|
|
605
864
|
function createDirectory(projectRoot) {
|
|
606
865
|
const sensorDir = getLatticeSensorDir(projectRoot);
|
|
607
|
-
|
|
608
|
-
//
|
|
609
|
-
//
|
|
610
|
-
if (
|
|
866
|
+
// Only throw if LatticeSensor is actually initialized (db with a schema).
|
|
867
|
+
// .lattice/sensor/ folder alone — or a schema-less sensor.db left by an
|
|
868
|
+
// interrupted init (#1895) — is fine: initialize() adds the schema to it.
|
|
869
|
+
if (isInitialized(projectRoot)) {
|
|
611
870
|
throw new Error(`LatticeSensor already initialized in ${projectRoot}`);
|
|
612
871
|
}
|
|
613
872
|
// Create main directory (if it doesn't exist)
|
|
@@ -738,4 +997,14 @@ function validateDirectory(projectRoot) {
|
|
|
738
997
|
errors,
|
|
739
998
|
};
|
|
740
999
|
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Claude Code injects `<task-notification>…</task-notification>` blocks as
|
|
1002
|
+
* `user` messages when a background agent finishes, and UserPromptSubmit
|
|
1003
|
+
* hooks receive them exactly like typed prompts (#1832). The whole prompt
|
|
1004
|
+
* must be that single envelope; a user question that merely mentions the
|
|
1005
|
+
* marker is still a prompt.
|
|
1006
|
+
*/
|
|
1007
|
+
function isTaskNotification(prompt) {
|
|
1008
|
+
return /^\s*<task-notification>[\s\S]*<\/task-notification>\s*$/.test(prompt);
|
|
1009
|
+
}
|
|
741
1010
|
//# sourceMappingURL=directory.js.map
|