@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.
Files changed (605) hide show
  1. package/README.ja.md +5 -1
  2. package/package.json +1 -1
  3. package/sensor/dist/bin/lattice-sensor.js +746 -323
  4. package/sensor/dist/bin/viewer-gate.d.ts +17 -0
  5. package/sensor/dist/bin/viewer-gate.d.ts.map +1 -0
  6. package/sensor/dist/bin/viewer-gate.js +31 -0
  7. package/sensor/dist/bin/viewer-gate.js.map +1 -0
  8. package/sensor/dist/context/formatter.d.ts +7 -1
  9. package/sensor/dist/context/formatter.d.ts.map +1 -1
  10. package/sensor/dist/context/formatter.js +12 -6
  11. package/sensor/dist/context/formatter.js.map +1 -1
  12. package/sensor/dist/context/index.d.ts +12 -0
  13. package/sensor/dist/context/index.d.ts.map +1 -1
  14. package/sensor/dist/context/index.js +103 -16
  15. package/sensor/dist/context/index.js.map +1 -1
  16. package/sensor/dist/db/index.d.ts +23 -2
  17. package/sensor/dist/db/index.d.ts.map +1 -1
  18. package/sensor/dist/db/index.js +109 -31
  19. package/sensor/dist/db/index.js.map +1 -1
  20. package/sensor/dist/db/migrations.d.ts +1 -1
  21. package/sensor/dist/db/migrations.d.ts.map +1 -1
  22. package/sensor/dist/db/migrations.js +68 -1
  23. package/sensor/dist/db/migrations.js.map +1 -1
  24. package/sensor/dist/db/queries.d.ts +583 -6
  25. package/sensor/dist/db/queries.d.ts.map +1 -1
  26. package/sensor/dist/db/queries.js +1425 -57
  27. package/sensor/dist/db/queries.js.map +1 -1
  28. package/sensor/dist/db/schema.sql +27 -4
  29. package/sensor/dist/db/sqlite-adapter.d.ts +2 -0
  30. package/sensor/dist/db/sqlite-adapter.d.ts.map +1 -1
  31. package/sensor/dist/db/sqlite-adapter.js +56 -7
  32. package/sensor/dist/db/sqlite-adapter.js.map +1 -1
  33. package/sensor/dist/db/synthesis-stage.d.ts +12 -0
  34. package/sensor/dist/db/synthesis-stage.d.ts.map +1 -0
  35. package/sensor/dist/db/synthesis-stage.js +93 -0
  36. package/sensor/dist/db/synthesis-stage.js.map +1 -0
  37. package/sensor/dist/db/wal-valve.d.ts +32 -12
  38. package/sensor/dist/db/wal-valve.d.ts.map +1 -1
  39. package/sensor/dist/db/wal-valve.js +65 -22
  40. package/sensor/dist/db/wal-valve.js.map +1 -1
  41. package/sensor/dist/db/wsl-shared-index.d.ts +53 -0
  42. package/sensor/dist/db/wsl-shared-index.d.ts.map +1 -0
  43. package/sensor/dist/db/wsl-shared-index.js +121 -0
  44. package/sensor/dist/db/wsl-shared-index.js.map +1 -0
  45. package/sensor/dist/directory.d.ts +126 -2
  46. package/sensor/dist/directory.d.ts.map +1 -1
  47. package/sensor/dist/directory.js +285 -16
  48. package/sensor/dist/directory.js.map +1 -1
  49. package/sensor/dist/errors.d.ts +14 -0
  50. package/sensor/dist/errors.d.ts.map +1 -1
  51. package/sensor/dist/errors.js +16 -1
  52. package/sensor/dist/errors.js.map +1 -1
  53. package/sensor/dist/extraction/cfml-extractor.d.ts +1 -0
  54. package/sensor/dist/extraction/cfml-extractor.d.ts.map +1 -1
  55. package/sensor/dist/extraction/cfml-extractor.js +15 -3
  56. package/sensor/dist/extraction/cfml-extractor.js.map +1 -1
  57. package/sensor/dist/extraction/dfm-extractor.d.ts.map +1 -1
  58. package/sensor/dist/extraction/dfm-extractor.js +14 -10
  59. package/sensor/dist/extraction/dfm-extractor.js.map +1 -1
  60. package/sensor/dist/extraction/extraction-version.d.ts +1 -1
  61. package/sensor/dist/extraction/extraction-version.d.ts.map +1 -1
  62. package/sensor/dist/extraction/extraction-version.js +3 -1
  63. package/sensor/dist/extraction/extraction-version.js.map +1 -1
  64. package/sensor/dist/extraction/function-ref.d.ts +6 -4
  65. package/sensor/dist/extraction/function-ref.d.ts.map +1 -1
  66. package/sensor/dist/extraction/function-ref.js +35 -14
  67. package/sensor/dist/extraction/function-ref.js.map +1 -1
  68. package/sensor/dist/extraction/generated-detection.d.ts +48 -12
  69. package/sensor/dist/extraction/generated-detection.d.ts.map +1 -1
  70. package/sensor/dist/extraction/generated-detection.js +176 -11
  71. package/sensor/dist/extraction/generated-detection.js.map +1 -1
  72. package/sensor/dist/extraction/grammars.d.ts +38 -0
  73. package/sensor/dist/extraction/grammars.d.ts.map +1 -1
  74. package/sensor/dist/extraction/grammars.js +115 -3
  75. package/sensor/dist/extraction/grammars.js.map +1 -1
  76. package/sensor/dist/extraction/index.d.ts +218 -14
  77. package/sensor/dist/extraction/index.d.ts.map +1 -1
  78. package/sensor/dist/extraction/index.js +887 -175
  79. package/sensor/dist/extraction/index.js.map +1 -1
  80. package/sensor/dist/extraction/languages/c-cpp.d.ts +58 -0
  81. package/sensor/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  82. package/sensor/dist/extraction/languages/c-cpp.js +310 -19
  83. package/sensor/dist/extraction/languages/c-cpp.js.map +1 -1
  84. package/sensor/dist/extraction/languages/dart.d.ts.map +1 -1
  85. package/sensor/dist/extraction/languages/dart.js +8 -3
  86. package/sensor/dist/extraction/languages/dart.js.map +1 -1
  87. package/sensor/dist/extraction/languages/erlang.d.ts.map +1 -1
  88. package/sensor/dist/extraction/languages/erlang.js +58 -22
  89. package/sensor/dist/extraction/languages/erlang.js.map +1 -1
  90. package/sensor/dist/extraction/languages/javascript.js +1 -1
  91. package/sensor/dist/extraction/languages/javascript.js.map +1 -1
  92. package/sensor/dist/extraction/languages/kotlin.d.ts.map +1 -1
  93. package/sensor/dist/extraction/languages/kotlin.js +169 -36
  94. package/sensor/dist/extraction/languages/kotlin.js.map +1 -1
  95. package/sensor/dist/extraction/languages/lua.d.ts.map +1 -1
  96. package/sensor/dist/extraction/languages/lua.js +4 -1
  97. package/sensor/dist/extraction/languages/lua.js.map +1 -1
  98. package/sensor/dist/extraction/languages/objc.d.ts.map +1 -1
  99. package/sensor/dist/extraction/languages/objc.js +4 -0
  100. package/sensor/dist/extraction/languages/objc.js.map +1 -1
  101. package/sensor/dist/extraction/languages/python.d.ts.map +1 -1
  102. package/sensor/dist/extraction/languages/python.js +71 -0
  103. package/sensor/dist/extraction/languages/python.js.map +1 -1
  104. package/sensor/dist/extraction/languages/rust.d.ts +20 -0
  105. package/sensor/dist/extraction/languages/rust.d.ts.map +1 -1
  106. package/sensor/dist/extraction/languages/rust.js +50 -20
  107. package/sensor/dist/extraction/languages/rust.js.map +1 -1
  108. package/sensor/dist/extraction/languages/scala.d.ts.map +1 -1
  109. package/sensor/dist/extraction/languages/scala.js +18 -3
  110. package/sensor/dist/extraction/languages/scala.js.map +1 -1
  111. package/sensor/dist/extraction/languages/swift.d.ts +15 -0
  112. package/sensor/dist/extraction/languages/swift.d.ts.map +1 -1
  113. package/sensor/dist/extraction/languages/swift.js +50 -0
  114. package/sensor/dist/extraction/languages/swift.js.map +1 -1
  115. package/sensor/dist/extraction/languages/typescript.d.ts.map +1 -1
  116. package/sensor/dist/extraction/languages/typescript.js +9 -2
  117. package/sensor/dist/extraction/languages/typescript.js.map +1 -1
  118. package/sensor/dist/extraction/liquid-extractor.d.ts +18 -0
  119. package/sensor/dist/extraction/liquid-extractor.d.ts.map +1 -1
  120. package/sensor/dist/extraction/liquid-extractor.js +98 -22
  121. package/sensor/dist/extraction/liquid-extractor.js.map +1 -1
  122. package/sensor/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  123. package/sensor/dist/extraction/mybatis-extractor.js +6 -4
  124. package/sensor/dist/extraction/mybatis-extractor.js.map +1 -1
  125. package/sensor/dist/extraction/parse-pool.d.ts +7 -0
  126. package/sensor/dist/extraction/parse-pool.d.ts.map +1 -1
  127. package/sensor/dist/extraction/parse-pool.js +20 -1
  128. package/sensor/dist/extraction/parse-pool.js.map +1 -1
  129. package/sensor/dist/extraction/syntax-tokens.d.ts +103 -0
  130. package/sensor/dist/extraction/syntax-tokens.d.ts.map +1 -0
  131. package/sensor/dist/extraction/syntax-tokens.js +381 -0
  132. package/sensor/dist/extraction/syntax-tokens.js.map +1 -0
  133. package/sensor/dist/extraction/tree-sitter-helpers.d.ts +5 -0
  134. package/sensor/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  135. package/sensor/dist/extraction/tree-sitter-helpers.js +17 -0
  136. package/sensor/dist/extraction/tree-sitter-helpers.js.map +1 -1
  137. package/sensor/dist/extraction/tree-sitter-types.d.ts +31 -3
  138. package/sensor/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  139. package/sensor/dist/extraction/tree-sitter.d.ts +101 -18
  140. package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -1
  141. package/sensor/dist/extraction/tree-sitter.js +928 -134
  142. package/sensor/dist/extraction/tree-sitter.js.map +1 -1
  143. package/sensor/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  144. package/sensor/dist/file-limits.d.ts +40 -0
  145. package/sensor/dist/file-limits.d.ts.map +1 -0
  146. package/sensor/dist/file-limits.js +147 -0
  147. package/sensor/dist/file-limits.js.map +1 -0
  148. package/sensor/dist/graph/branch-guards.d.ts +265 -0
  149. package/sensor/dist/graph/branch-guards.d.ts.map +1 -0
  150. package/sensor/dist/graph/branch-guards.js +2325 -0
  151. package/sensor/dist/graph/branch-guards.js.map +1 -0
  152. package/sensor/dist/graph/dead-code.d.ts +251 -0
  153. package/sensor/dist/graph/dead-code.d.ts.map +1 -0
  154. package/sensor/dist/graph/dead-code.js +776 -0
  155. package/sensor/dist/graph/dead-code.js.map +1 -0
  156. package/sensor/dist/graph/dynamic-boundary-report.d.ts +121 -0
  157. package/sensor/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
  158. package/sensor/dist/graph/dynamic-boundary-report.js +283 -0
  159. package/sensor/dist/graph/dynamic-boundary-report.js.map +1 -0
  160. package/sensor/dist/graph/index.d.ts +4 -0
  161. package/sensor/dist/graph/index.d.ts.map +1 -1
  162. package/sensor/dist/graph/index.js +16 -1
  163. package/sensor/dist/graph/index.js.map +1 -1
  164. package/sensor/dist/graph/named-symbol-flow.d.ts +125 -0
  165. package/sensor/dist/graph/named-symbol-flow.d.ts.map +1 -0
  166. package/sensor/dist/graph/named-symbol-flow.js +552 -0
  167. package/sensor/dist/graph/named-symbol-flow.js.map +1 -0
  168. package/sensor/dist/graph/queries.d.ts.map +1 -1
  169. package/sensor/dist/graph/queries.js +2 -0
  170. package/sensor/dist/graph/queries.js.map +1 -1
  171. package/sensor/dist/graph/symbol-lookup.d.ts +83 -0
  172. package/sensor/dist/graph/symbol-lookup.d.ts.map +1 -0
  173. package/sensor/dist/graph/symbol-lookup.js +181 -0
  174. package/sensor/dist/graph/symbol-lookup.js.map +1 -0
  175. package/sensor/dist/graph/traversal.d.ts +9 -0
  176. package/sensor/dist/graph/traversal.d.ts.map +1 -1
  177. package/sensor/dist/graph/traversal.js +62 -36
  178. package/sensor/dist/graph/traversal.js.map +1 -1
  179. package/sensor/dist/graph/type-hierarchy.d.ts +155 -0
  180. package/sensor/dist/graph/type-hierarchy.d.ts.map +1 -0
  181. package/sensor/dist/graph/type-hierarchy.js +382 -0
  182. package/sensor/dist/graph/type-hierarchy.js.map +1 -0
  183. package/sensor/dist/index.d.ts +272 -10
  184. package/sensor/dist/index.d.ts.map +1 -1
  185. package/sensor/dist/index.js +510 -34
  186. package/sensor/dist/index.js.map +1 -1
  187. package/sensor/dist/mcp/answer-freshness.d.ts +10 -0
  188. package/sensor/dist/mcp/answer-freshness.d.ts.map +1 -0
  189. package/sensor/dist/mcp/answer-freshness.js +68 -0
  190. package/sensor/dist/mcp/answer-freshness.js.map +1 -0
  191. package/sensor/dist/mcp/daemon-manager.d.ts +1 -1
  192. package/sensor/dist/mcp/daemon-manager.d.ts.map +1 -1
  193. package/sensor/dist/mcp/daemon-manager.js +17 -1
  194. package/sensor/dist/mcp/daemon-manager.js.map +1 -1
  195. package/sensor/dist/mcp/daemon-paths.d.ts +8 -0
  196. package/sensor/dist/mcp/daemon-paths.d.ts.map +1 -1
  197. package/sensor/dist/mcp/daemon-paths.js +65 -2
  198. package/sensor/dist/mcp/daemon-paths.js.map +1 -1
  199. package/sensor/dist/mcp/daemon-registry.d.ts +17 -4
  200. package/sensor/dist/mcp/daemon-registry.d.ts.map +1 -1
  201. package/sensor/dist/mcp/daemon-registry.js +133 -23
  202. package/sensor/dist/mcp/daemon-registry.js.map +1 -1
  203. package/sensor/dist/mcp/daemon.d.ts +26 -13
  204. package/sensor/dist/mcp/daemon.d.ts.map +1 -1
  205. package/sensor/dist/mcp/daemon.js +126 -32
  206. package/sensor/dist/mcp/daemon.js.map +1 -1
  207. package/sensor/dist/mcp/dynamic-boundaries.d.ts +1 -10
  208. package/sensor/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  209. package/sensor/dist/mcp/dynamic-boundaries.js +46 -42
  210. package/sensor/dist/mcp/dynamic-boundaries.js.map +1 -1
  211. package/sensor/dist/mcp/engine.d.ts +31 -9
  212. package/sensor/dist/mcp/engine.d.ts.map +1 -1
  213. package/sensor/dist/mcp/engine.js +190 -79
  214. package/sensor/dist/mcp/engine.js.map +1 -1
  215. package/sensor/dist/mcp/explore-dedup.d.ts +140 -0
  216. package/sensor/dist/mcp/explore-dedup.d.ts.map +1 -0
  217. package/sensor/dist/mcp/explore-dedup.js +239 -0
  218. package/sensor/dist/mcp/explore-dedup.js.map +1 -0
  219. package/sensor/dist/mcp/explore-diagnostics.d.ts +289 -0
  220. package/sensor/dist/mcp/explore-diagnostics.d.ts.map +1 -0
  221. package/sensor/dist/mcp/explore-diagnostics.js +558 -0
  222. package/sensor/dist/mcp/explore-diagnostics.js.map +1 -0
  223. package/sensor/dist/mcp/explore-session-state.d.ts +217 -0
  224. package/sensor/dist/mcp/explore-session-state.d.ts.map +1 -0
  225. package/sensor/dist/mcp/explore-session-state.js +322 -0
  226. package/sensor/dist/mcp/explore-session-state.js.map +1 -0
  227. package/sensor/dist/mcp/index-freshness-worker.d.ts +2 -0
  228. package/sensor/dist/mcp/index-freshness-worker.d.ts.map +1 -0
  229. package/sensor/dist/mcp/index-freshness-worker.js +30 -0
  230. package/sensor/dist/mcp/index-freshness-worker.js.map +1 -0
  231. package/sensor/dist/mcp/index-freshness.d.ts +7 -0
  232. package/sensor/dist/mcp/index-freshness.d.ts.map +1 -0
  233. package/sensor/dist/mcp/index-freshness.js +94 -0
  234. package/sensor/dist/mcp/index-freshness.js.map +1 -0
  235. package/sensor/dist/mcp/index.d.ts +3 -1
  236. package/sensor/dist/mcp/index.d.ts.map +1 -1
  237. package/sensor/dist/mcp/index.js +109 -12
  238. package/sensor/dist/mcp/index.js.map +1 -1
  239. package/sensor/dist/mcp/liveness-watchdog.d.ts +4 -1
  240. package/sensor/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  241. package/sensor/dist/mcp/liveness-watchdog.js +11 -2
  242. package/sensor/dist/mcp/liveness-watchdog.js.map +1 -1
  243. package/sensor/dist/mcp/project-lifecycle.d.ts +9 -0
  244. package/sensor/dist/mcp/project-lifecycle.d.ts.map +1 -0
  245. package/sensor/dist/mcp/project-lifecycle.js +182 -0
  246. package/sensor/dist/mcp/project-lifecycle.js.map +1 -0
  247. package/sensor/dist/mcp/proxy.d.ts.map +1 -1
  248. package/sensor/dist/mcp/proxy.js +15 -1
  249. package/sensor/dist/mcp/proxy.js.map +1 -1
  250. package/sensor/dist/mcp/query-pool.d.ts +2 -2
  251. package/sensor/dist/mcp/query-pool.d.ts.map +1 -1
  252. package/sensor/dist/mcp/query-pool.js +9 -7
  253. package/sensor/dist/mcp/query-pool.js.map +1 -1
  254. package/sensor/dist/mcp/query-worker.js +2 -2
  255. package/sensor/dist/mcp/query-worker.js.map +1 -1
  256. package/sensor/dist/mcp/server-instructions.d.ts +2 -2
  257. package/sensor/dist/mcp/server-instructions.d.ts.map +1 -1
  258. package/sensor/dist/mcp/server-instructions.js +13 -6
  259. package/sensor/dist/mcp/server-instructions.js.map +1 -1
  260. package/sensor/dist/mcp/session.d.ts +16 -0
  261. package/sensor/dist/mcp/session.d.ts.map +1 -1
  262. package/sensor/dist/mcp/session.js +36 -13
  263. package/sensor/dist/mcp/session.js.map +1 -1
  264. package/sensor/dist/mcp/startup-handshake.d.ts +3 -1
  265. package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -1
  266. package/sensor/dist/mcp/startup-handshake.js +10 -2
  267. package/sensor/dist/mcp/startup-handshake.js.map +1 -1
  268. package/sensor/dist/mcp/tools.d.ts +496 -38
  269. package/sensor/dist/mcp/tools.d.ts.map +1 -1
  270. package/sensor/dist/mcp/tools.js +4021 -772
  271. package/sensor/dist/mcp/tools.js.map +1 -1
  272. package/sensor/dist/mcp/writer-lock.d.ts +61 -0
  273. package/sensor/dist/mcp/writer-lock.d.ts.map +1 -0
  274. package/sensor/dist/mcp/writer-lock.js +260 -0
  275. package/sensor/dist/mcp/writer-lock.js.map +1 -0
  276. package/sensor/dist/project-config.d.ts +23 -0
  277. package/sensor/dist/project-config.d.ts.map +1 -1
  278. package/sensor/dist/project-config.js +39 -2
  279. package/sensor/dist/project-config.js.map +1 -1
  280. package/sensor/dist/resolution/alias-binding.d.ts +56 -0
  281. package/sensor/dist/resolution/alias-binding.d.ts.map +1 -0
  282. package/sensor/dist/resolution/alias-binding.js +127 -0
  283. package/sensor/dist/resolution/alias-binding.js.map +1 -0
  284. package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  285. package/sensor/dist/resolution/c-fnptr-synthesizer.js +21 -19
  286. package/sensor/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  287. package/sensor/dist/resolution/callback-synthesizer.d.ts +23 -1
  288. package/sensor/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  289. package/sensor/dist/resolution/callback-synthesizer.js +356 -155
  290. package/sensor/dist/resolution/callback-synthesizer.js.map +1 -1
  291. package/sensor/dist/resolution/cpp-constructor.d.ts +4 -0
  292. package/sensor/dist/resolution/cpp-constructor.d.ts.map +1 -0
  293. package/sensor/dist/resolution/cpp-constructor.js +123 -0
  294. package/sensor/dist/resolution/cpp-constructor.js.map +1 -0
  295. package/sensor/dist/resolution/cpp-macro-visibility.d.ts +12 -0
  296. package/sensor/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
  297. package/sensor/dist/resolution/cpp-macro-visibility.js +342 -0
  298. package/sensor/dist/resolution/cpp-macro-visibility.js.map +1 -0
  299. package/sensor/dist/resolution/expo-router-synthesizer.d.ts +32 -0
  300. package/sensor/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
  301. package/sensor/dist/resolution/expo-router-synthesizer.js +189 -0
  302. package/sensor/dist/resolution/expo-router-synthesizer.js.map +1 -0
  303. package/sensor/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  304. package/sensor/dist/resolution/frameworks/csharp.js +96 -2
  305. package/sensor/dist/resolution/frameworks/csharp.js.map +1 -1
  306. package/sensor/dist/resolution/frameworks/expo-router.d.ts +189 -0
  307. package/sensor/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
  308. package/sensor/dist/resolution/frameworks/expo-router.js +785 -0
  309. package/sensor/dist/resolution/frameworks/expo-router.js.map +1 -0
  310. package/sensor/dist/resolution/frameworks/express.d.ts.map +1 -1
  311. package/sensor/dist/resolution/frameworks/express.js +251 -16
  312. package/sensor/dist/resolution/frameworks/express.js.map +1 -1
  313. package/sensor/dist/resolution/frameworks/index.d.ts +5 -0
  314. package/sensor/dist/resolution/frameworks/index.d.ts.map +1 -1
  315. package/sensor/dist/resolution/frameworks/index.js +29 -1
  316. package/sensor/dist/resolution/frameworks/index.js.map +1 -1
  317. package/sensor/dist/resolution/frameworks/java.d.ts.map +1 -1
  318. package/sensor/dist/resolution/frameworks/java.js +79 -47
  319. package/sensor/dist/resolution/frameworks/java.js.map +1 -1
  320. package/sensor/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  321. package/sensor/dist/resolution/frameworks/laravel.js +294 -4
  322. package/sensor/dist/resolution/frameworks/laravel.js.map +1 -1
  323. package/sensor/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  324. package/sensor/dist/resolution/frameworks/nestjs.js +6 -14
  325. package/sensor/dist/resolution/frameworks/nestjs.js.map +1 -1
  326. package/sensor/dist/resolution/frameworks/nextjs.d.ts +76 -0
  327. package/sensor/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
  328. package/sensor/dist/resolution/frameworks/nextjs.js +328 -0
  329. package/sensor/dist/resolution/frameworks/nextjs.js.map +1 -0
  330. package/sensor/dist/resolution/frameworks/object-literal.d.ts +32 -0
  331. package/sensor/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
  332. package/sensor/dist/resolution/frameworks/object-literal.js +139 -0
  333. package/sensor/dist/resolution/frameworks/object-literal.js.map +1 -0
  334. package/sensor/dist/resolution/frameworks/package-deps.d.ts +14 -0
  335. package/sensor/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
  336. package/sensor/dist/resolution/frameworks/package-deps.js +78 -0
  337. package/sensor/dist/resolution/frameworks/package-deps.js.map +1 -0
  338. package/sensor/dist/resolution/frameworks/python.d.ts.map +1 -1
  339. package/sensor/dist/resolution/frameworks/python.js +166 -0
  340. package/sensor/dist/resolution/frameworks/python.js.map +1 -1
  341. package/sensor/dist/resolution/frameworks/react-native.d.ts +26 -0
  342. package/sensor/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  343. package/sensor/dist/resolution/frameworks/react-native.js +153 -14
  344. package/sensor/dist/resolution/frameworks/react-native.js.map +1 -1
  345. package/sensor/dist/resolution/frameworks/react-router.d.ts +46 -0
  346. package/sensor/dist/resolution/frameworks/react-router.d.ts.map +1 -0
  347. package/sensor/dist/resolution/frameworks/react-router.js +187 -0
  348. package/sensor/dist/resolution/frameworks/react-router.js.map +1 -0
  349. package/sensor/dist/resolution/frameworks/react.d.ts +2 -1
  350. package/sensor/dist/resolution/frameworks/react.d.ts.map +1 -1
  351. package/sensor/dist/resolution/frameworks/react.js +188 -139
  352. package/sensor/dist/resolution/frameworks/react.js.map +1 -1
  353. package/sensor/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  354. package/sensor/dist/resolution/frameworks/svelte.js +6 -1
  355. package/sensor/dist/resolution/frameworks/svelte.js.map +1 -1
  356. package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
  357. package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
  358. package/sensor/dist/resolution/frameworks/sveltekit-router.js +156 -0
  359. package/sensor/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
  360. package/sensor/dist/resolution/frameworks/swift.d.ts.map +1 -1
  361. package/sensor/dist/resolution/frameworks/swift.js +140 -99
  362. package/sensor/dist/resolution/frameworks/swift.js.map +1 -1
  363. package/sensor/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
  364. package/sensor/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
  365. package/sensor/dist/resolution/frameworks/tanstack-router.js +437 -0
  366. package/sensor/dist/resolution/frameworks/tanstack-router.js.map +1 -0
  367. package/sensor/dist/resolution/frameworks/vue-router.d.ts +82 -0
  368. package/sensor/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
  369. package/sensor/dist/resolution/frameworks/vue-router.js +377 -0
  370. package/sensor/dist/resolution/frameworks/vue-router.js.map +1 -0
  371. package/sensor/dist/resolution/import-resolver.d.ts +38 -0
  372. package/sensor/dist/resolution/import-resolver.d.ts.map +1 -1
  373. package/sensor/dist/resolution/import-resolver.js +394 -28
  374. package/sensor/dist/resolution/import-resolver.js.map +1 -1
  375. package/sensor/dist/resolution/index.d.ts +89 -25
  376. package/sensor/dist/resolution/index.d.ts.map +1 -1
  377. package/sensor/dist/resolution/index.js +573 -148
  378. package/sensor/dist/resolution/index.js.map +1 -1
  379. package/sensor/dist/resolution/js-builtins.d.ts +13 -0
  380. package/sensor/dist/resolution/js-builtins.d.ts.map +1 -0
  381. package/sensor/dist/resolution/js-builtins.js +46 -0
  382. package/sensor/dist/resolution/js-builtins.js.map +1 -0
  383. package/sensor/dist/resolution/name-matcher.d.ts +99 -22
  384. package/sensor/dist/resolution/name-matcher.d.ts.map +1 -1
  385. package/sensor/dist/resolution/name-matcher.js +2220 -86
  386. package/sensor/dist/resolution/name-matcher.js.map +1 -1
  387. package/sensor/dist/resolution/next-router-synthesizer.d.ts +27 -0
  388. package/sensor/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
  389. package/sensor/dist/resolution/next-router-synthesizer.js +113 -0
  390. package/sensor/dist/resolution/next-router-synthesizer.js.map +1 -0
  391. package/sensor/dist/resolution/path-aliases.d.ts +6 -4
  392. package/sensor/dist/resolution/path-aliases.d.ts.map +1 -1
  393. package/sensor/dist/resolution/path-aliases.js +125 -17
  394. package/sensor/dist/resolution/path-aliases.js.map +1 -1
  395. package/sensor/dist/resolution/react-router-synthesizer.d.ts +33 -0
  396. package/sensor/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
  397. package/sensor/dist/resolution/react-router-synthesizer.js +126 -0
  398. package/sensor/dist/resolution/react-router-synthesizer.js.map +1 -0
  399. package/sensor/dist/resolution/resolver-pool.d.ts +2 -0
  400. package/sensor/dist/resolution/resolver-pool.d.ts.map +1 -1
  401. package/sensor/dist/resolution/resolver-pool.js +4 -0
  402. package/sensor/dist/resolution/resolver-pool.js.map +1 -1
  403. package/sensor/dist/resolution/strip-comments.d.ts +6 -0
  404. package/sensor/dist/resolution/strip-comments.d.ts.map +1 -1
  405. package/sensor/dist/resolution/strip-comments.js +58 -0
  406. package/sensor/dist/resolution/strip-comments.js.map +1 -1
  407. package/sensor/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
  408. package/sensor/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
  409. package/sensor/dist/resolution/sveltekit-synthesizer.js +173 -0
  410. package/sensor/dist/resolution/sveltekit-synthesizer.js.map +1 -0
  411. package/sensor/dist/resolution/swift-type-visibility.d.ts +52 -0
  412. package/sensor/dist/resolution/swift-type-visibility.d.ts.map +1 -0
  413. package/sensor/dist/resolution/swift-type-visibility.js +328 -0
  414. package/sensor/dist/resolution/swift-type-visibility.js.map +1 -0
  415. package/sensor/dist/resolution/synth-utils.d.ts +26 -0
  416. package/sensor/dist/resolution/synth-utils.d.ts.map +1 -0
  417. package/sensor/dist/resolution/synth-utils.js +75 -0
  418. package/sensor/dist/resolution/synth-utils.js.map +1 -0
  419. package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
  420. package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
  421. package/sensor/dist/resolution/tanstack-router-synthesizer.js +114 -0
  422. package/sensor/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
  423. package/sensor/dist/resolution/tier-synthesizer.d.ts +54 -0
  424. package/sensor/dist/resolution/tier-synthesizer.d.ts.map +1 -0
  425. package/sensor/dist/resolution/tier-synthesizer.js +1294 -0
  426. package/sensor/dist/resolution/tier-synthesizer.js.map +1 -0
  427. package/sensor/dist/resolution/types.d.ts +78 -2
  428. package/sensor/dist/resolution/types.d.ts.map +1 -1
  429. package/sensor/dist/resolution/types.js +64 -0
  430. package/sensor/dist/resolution/types.js.map +1 -1
  431. package/sensor/dist/resolution/vue-router-synthesizer.d.ts +30 -0
  432. package/sensor/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
  433. package/sensor/dist/resolution/vue-router-synthesizer.js +115 -0
  434. package/sensor/dist/resolution/vue-router-synthesizer.js.map +1 -0
  435. package/sensor/dist/search/identifier-segments.d.ts +10 -0
  436. package/sensor/dist/search/identifier-segments.d.ts.map +1 -1
  437. package/sensor/dist/search/identifier-segments.js +29 -0
  438. package/sensor/dist/search/identifier-segments.js.map +1 -1
  439. package/sensor/dist/search/query-paths.d.ts +106 -0
  440. package/sensor/dist/search/query-paths.d.ts.map +1 -0
  441. package/sensor/dist/search/query-paths.js +513 -0
  442. package/sensor/dist/search/query-paths.js.map +1 -0
  443. package/sensor/dist/search/query-utils.d.ts +22 -2
  444. package/sensor/dist/search/query-utils.d.ts.map +1 -1
  445. package/sensor/dist/search/query-utils.js +56 -16
  446. package/sensor/dist/search/query-utils.js.map +1 -1
  447. package/sensor/dist/sync/watch-policy.d.ts +14 -0
  448. package/sensor/dist/sync/watch-policy.d.ts.map +1 -1
  449. package/sensor/dist/sync/watch-policy.js +19 -0
  450. package/sensor/dist/sync/watch-policy.js.map +1 -1
  451. package/sensor/dist/sync/watcher.d.ts +74 -35
  452. package/sensor/dist/sync/watcher.d.ts.map +1 -1
  453. package/sensor/dist/sync/watcher.js +281 -99
  454. package/sensor/dist/sync/watcher.js.map +1 -1
  455. package/sensor/dist/telemetry/index.d.ts +4 -2
  456. package/sensor/dist/telemetry/index.d.ts.map +1 -1
  457. package/sensor/dist/telemetry/index.js +92 -41
  458. package/sensor/dist/telemetry/index.js.map +1 -1
  459. package/sensor/dist/types.d.ts +18 -2
  460. package/sensor/dist/types.d.ts.map +1 -1
  461. package/sensor/dist/types.js +2 -0
  462. package/sensor/dist/types.js.map +1 -1
  463. package/sensor/dist/ui-server/api/deadcode.d.ts +84 -0
  464. package/sensor/dist/ui-server/api/deadcode.d.ts.map +1 -0
  465. package/sensor/dist/ui-server/api/deadcode.js +136 -0
  466. package/sensor/dist/ui-server/api/deadcode.js.map +1 -0
  467. package/sensor/dist/ui-server/api/effects.d.ts +94 -0
  468. package/sensor/dist/ui-server/api/effects.d.ts.map +1 -0
  469. package/sensor/dist/ui-server/api/effects.js +527 -0
  470. package/sensor/dist/ui-server/api/effects.js.map +1 -0
  471. package/sensor/dist/ui-server/api/entrypoints.d.ts +92 -0
  472. package/sensor/dist/ui-server/api/entrypoints.d.ts.map +1 -0
  473. package/sensor/dist/ui-server/api/entrypoints.js +361 -0
  474. package/sensor/dist/ui-server/api/entrypoints.js.map +1 -0
  475. package/sensor/dist/ui-server/api/events.d.ts +183 -0
  476. package/sensor/dist/ui-server/api/events.d.ts.map +1 -0
  477. package/sensor/dist/ui-server/api/events.js +430 -0
  478. package/sensor/dist/ui-server/api/events.js.map +1 -0
  479. package/sensor/dist/ui-server/api/file.d.ts +66 -0
  480. package/sensor/dist/ui-server/api/file.d.ts.map +1 -0
  481. package/sensor/dist/ui-server/api/file.js +235 -0
  482. package/sensor/dist/ui-server/api/file.js.map +1 -0
  483. package/sensor/dist/ui-server/api/filecode.d.ts +126 -0
  484. package/sensor/dist/ui-server/api/filecode.d.ts.map +1 -0
  485. package/sensor/dist/ui-server/api/filecode.js +205 -0
  486. package/sensor/dist/ui-server/api/filecode.js.map +1 -0
  487. package/sensor/dist/ui-server/api/flow.d.ts +226 -0
  488. package/sensor/dist/ui-server/api/flow.d.ts.map +1 -0
  489. package/sensor/dist/ui-server/api/flow.js +612 -0
  490. package/sensor/dist/ui-server/api/flow.js.map +1 -0
  491. package/sensor/dist/ui-server/api/hierarchy.d.ts +81 -0
  492. package/sensor/dist/ui-server/api/hierarchy.d.ts.map +1 -0
  493. package/sensor/dist/ui-server/api/hierarchy.js +92 -0
  494. package/sensor/dist/ui-server/api/hierarchy.js.map +1 -0
  495. package/sensor/dist/ui-server/api/index.d.ts +90 -0
  496. package/sensor/dist/ui-server/api/index.d.ts.map +1 -0
  497. package/sensor/dist/ui-server/api/index.js +332 -0
  498. package/sensor/dist/ui-server/api/index.js.map +1 -0
  499. package/sensor/dist/ui-server/api/map.d.ts +256 -0
  500. package/sensor/dist/ui-server/api/map.d.ts.map +1 -0
  501. package/sensor/dist/ui-server/api/map.js +760 -0
  502. package/sensor/dist/ui-server/api/map.js.map +1 -0
  503. package/sensor/dist/ui-server/api/node.d.ts +81 -0
  504. package/sensor/dist/ui-server/api/node.d.ts.map +1 -0
  505. package/sensor/dist/ui-server/api/node.js +388 -0
  506. package/sensor/dist/ui-server/api/node.js.map +1 -0
  507. package/sensor/dist/ui-server/api/nodes.d.ts +25 -0
  508. package/sensor/dist/ui-server/api/nodes.d.ts.map +1 -0
  509. package/sensor/dist/ui-server/api/nodes.js +45 -0
  510. package/sensor/dist/ui-server/api/nodes.js.map +1 -0
  511. package/sensor/dist/ui-server/api/program.d.ts +139 -0
  512. package/sensor/dist/ui-server/api/program.d.ts.map +1 -0
  513. package/sensor/dist/ui-server/api/program.js +315 -0
  514. package/sensor/dist/ui-server/api/program.js.map +1 -0
  515. package/sensor/dist/ui-server/api/respond.d.ts +76 -0
  516. package/sensor/dist/ui-server/api/respond.d.ts.map +1 -0
  517. package/sensor/dist/ui-server/api/respond.js +186 -0
  518. package/sensor/dist/ui-server/api/respond.js.map +1 -0
  519. package/sensor/dist/ui-server/api/route-roots.d.ts +39 -0
  520. package/sensor/dist/ui-server/api/route-roots.d.ts.map +1 -0
  521. package/sensor/dist/ui-server/api/route-roots.js +96 -0
  522. package/sensor/dist/ui-server/api/route-roots.js.map +1 -0
  523. package/sensor/dist/ui-server/api/routes.d.ts +59 -0
  524. package/sensor/dist/ui-server/api/routes.d.ts.map +1 -0
  525. package/sensor/dist/ui-server/api/routes.js +108 -0
  526. package/sensor/dist/ui-server/api/routes.js.map +1 -0
  527. package/sensor/dist/ui-server/api/screens.d.ts +117 -0
  528. package/sensor/dist/ui-server/api/screens.d.ts.map +1 -0
  529. package/sensor/dist/ui-server/api/screens.js +611 -0
  530. package/sensor/dist/ui-server/api/screens.js.map +1 -0
  531. package/sensor/dist/ui-server/api/search.d.ts +29 -0
  532. package/sensor/dist/ui-server/api/search.d.ts.map +1 -0
  533. package/sensor/dist/ui-server/api/search.js +232 -0
  534. package/sensor/dist/ui-server/api/search.js.map +1 -0
  535. package/sensor/dist/ui-server/api/session.d.ts +52 -0
  536. package/sensor/dist/ui-server/api/session.d.ts.map +1 -0
  537. package/sensor/dist/ui-server/api/session.js +196 -0
  538. package/sensor/dist/ui-server/api/session.js.map +1 -0
  539. package/sensor/dist/ui-server/api/source.d.ts +200 -0
  540. package/sensor/dist/ui-server/api/source.d.ts.map +1 -0
  541. package/sensor/dist/ui-server/api/source.js +422 -0
  542. package/sensor/dist/ui-server/api/source.js.map +1 -0
  543. package/sensor/dist/ui-server/api/stats.d.ts +27 -0
  544. package/sensor/dist/ui-server/api/stats.d.ts.map +1 -0
  545. package/sensor/dist/ui-server/api/stats.js +164 -0
  546. package/sensor/dist/ui-server/api/stats.js.map +1 -0
  547. package/sensor/dist/ui-server/api/steps.d.ts +274 -0
  548. package/sensor/dist/ui-server/api/steps.d.ts.map +1 -0
  549. package/sensor/dist/ui-server/api/steps.js +1544 -0
  550. package/sensor/dist/ui-server/api/steps.js.map +1 -0
  551. package/sensor/dist/ui-server/api/trail-store.d.ts +142 -0
  552. package/sensor/dist/ui-server/api/trail-store.d.ts.map +1 -0
  553. package/sensor/dist/ui-server/api/trail-store.js +325 -0
  554. package/sensor/dist/ui-server/api/trail-store.js.map +1 -0
  555. package/sensor/dist/ui-server/api/trails.d.ts +163 -0
  556. package/sensor/dist/ui-server/api/trails.d.ts.map +1 -0
  557. package/sensor/dist/ui-server/api/trails.js +369 -0
  558. package/sensor/dist/ui-server/api/trails.js.map +1 -0
  559. package/sensor/dist/ui-server/api/when.d.ts +133 -0
  560. package/sensor/dist/ui-server/api/when.d.ts.map +1 -0
  561. package/sensor/dist/ui-server/api/when.js +275 -0
  562. package/sensor/dist/ui-server/api/when.js.map +1 -0
  563. package/sensor/dist/ui-server/api/wire.d.ts +179 -0
  564. package/sensor/dist/ui-server/api/wire.d.ts.map +1 -0
  565. package/sensor/dist/ui-server/api/wire.js +231 -0
  566. package/sensor/dist/ui-server/api/wire.js.map +1 -0
  567. package/sensor/dist/ui-server/assets.d.ts +40 -0
  568. package/sensor/dist/ui-server/assets.d.ts.map +1 -0
  569. package/sensor/dist/ui-server/assets.js +110 -0
  570. package/sensor/dist/ui-server/assets.js.map +1 -0
  571. package/sensor/dist/ui-server/constants.d.ts +32 -0
  572. package/sensor/dist/ui-server/constants.d.ts.map +1 -0
  573. package/sensor/dist/ui-server/constants.js +35 -0
  574. package/sensor/dist/ui-server/constants.js.map +1 -0
  575. package/sensor/dist/ui-server/highlight/index.d.ts +113 -0
  576. package/sensor/dist/ui-server/highlight/index.d.ts.map +1 -0
  577. package/sensor/dist/ui-server/highlight/index.js +307 -0
  578. package/sensor/dist/ui-server/highlight/index.js.map +1 -0
  579. package/sensor/dist/ui-server/highlight/languages.d.ts +36 -0
  580. package/sensor/dist/ui-server/highlight/languages.d.ts.map +1 -0
  581. package/sensor/dist/ui-server/highlight/languages.js +50 -0
  582. package/sensor/dist/ui-server/highlight/languages.js.map +1 -0
  583. package/sensor/dist/ui-server/index.d.ts +92 -0
  584. package/sensor/dist/ui-server/index.d.ts.map +1 -0
  585. package/sensor/dist/ui-server/index.js +399 -0
  586. package/sensor/dist/ui-server/index.js.map +1 -0
  587. package/sensor/dist/ui-server/open-browser.d.ts +31 -0
  588. package/sensor/dist/ui-server/open-browser.d.ts.map +1 -0
  589. package/sensor/dist/ui-server/open-browser.js +79 -0
  590. package/sensor/dist/ui-server/open-browser.js.map +1 -0
  591. package/sensor/dist/ui-server/security.d.ts +127 -0
  592. package/sensor/dist/ui-server/security.d.ts.map +1 -0
  593. package/sensor/dist/ui-server/security.js +332 -0
  594. package/sensor/dist/ui-server/security.js.map +1 -0
  595. package/sensor/dist/ui-server/static.d.ts +45 -0
  596. package/sensor/dist/ui-server/static.d.ts.map +1 -0
  597. package/sensor/dist/ui-server/static.js +165 -0
  598. package/sensor/dist/ui-server/static.js.map +1 -0
  599. package/sensor/dist/utils.d.ts +14 -2
  600. package/sensor/dist/utils.d.ts.map +1 -1
  601. package/sensor/dist/utils.js +25 -10
  602. package/sensor/dist/utils.js.map +1 -1
  603. package/src/cli-help.mjs +4 -2
  604. package/src/sensor-adapter.mjs +5 -1
  605. package/src/todo-cli.mjs +88 -11
@@ -5,8 +5,11 @@
5
5
  */
6
6
  import type LatticeSensor from '../index';
7
7
  import type { QueryPool } from './query-pool';
8
+ import { WslSharedIndexError } from '../db/wsl-shared-index';
8
9
  export declare function __setLoadLatticeSensorForTests(cls: typeof import('../index').default | null): void;
9
10
  import type { PendingFile } from '../sync';
11
+ import { type AnswerFile } from './answer-freshness';
12
+ import { ExploreSessionState, type ExploreEmission, type ExploreLineRange } from './explore-session-state';
10
13
  /**
11
14
  * An expected, recoverable "lattice sensor can't serve this" condition — most
12
15
  * importantly a project with no index. The dispatch catch converts these to
@@ -23,9 +26,12 @@ export declare class NotIndexedError extends Error {
23
26
  /**
24
27
  * A security refusal (sensitive system path). Stays `isError: true` WITHOUT
25
28
  * retry guidance — abandoning this path is the desired agent reaction.
29
+ *
30
+ * Defined in `../errors` so non-MCP read sinks (the `lattice sensor ui` server) can
31
+ * enforce the same refusal without importing this module; re-exported here
32
+ * because this is where every existing caller imports it from.
26
33
  */
27
- export declare class PathRefusalError extends Error {
28
- }
34
+ export { PathRefusalError } from '../errors';
29
35
  /**
30
36
  * ADR 0049 Decision 5②: a genuine malfunction opening the default project's
31
37
  * index — DB open failure, schema mismatch, integrity error, or lock
@@ -105,19 +111,368 @@ export interface ExploreOutputBudget {
105
111
  includeAdditionalFiles: boolean;
106
112
  /** Include the "Complete source code is included above…" reminder. */
107
113
  includeCompletenessSignal: boolean;
108
- /** Include the explore-budget reminder at the end. */
109
- includeBudgetNote: boolean;
110
114
  /**
111
- * Hard-drop test/spec/icon/i18n files from the relevant-file set unless
112
- * the query itself mentions tests. Today they're only deprioritized in
113
- * the sort, which on tiny repos still lets one slip into the top N (e.g.
114
- * cobra's `command_test.go` displaced `args.go` and contributed ~10KB of
115
- * pure noise to "How does cobra parse commands?"). Off by default; on
116
- * for the very-tiny tier where one slip dominates the budget.
115
+ * Include the advisory exploration-guidance note at the end. Purely
116
+ * advisory — the server NEVER rejects or rate-limits extra explore calls.
117
117
  */
118
- excludeLowValueFiles: boolean;
118
+ includeBudgetNote: boolean;
119
119
  }
120
120
  export declare function getExploreOutputBudget(fileCount: number): ExploreOutputBudget;
121
+ /**
122
+ * How strongly a match on a symbol of this kind corroborates that its FILE is
123
+ * what the query is about.
124
+ *
125
+ * 1.0 a callable or a type — the unit an architecture question is about
126
+ * ~0.5 a member of a type, or the file node itself (a path match, not a
127
+ * symbol match)
128
+ * ~0.3 a variable / constant — as often a name collision as a definition
129
+ * 0.15 a parameter — essentially never the subject of a question
130
+ *
131
+ * Unlisted kinds fall back to `DEFAULT_RELEVANCE_KIND_WEIGHT`, so a NodeKind
132
+ * added later is neither free nor fatal.
133
+ */
134
+ export declare const RELEVANCE_KIND_WEIGHT: Readonly<Record<string, number>>;
135
+ export declare const EXPLORE_ALLOCATION: {
136
+ /**
137
+ * A file whose weight is under this fraction of the top file's gets no source.
138
+ *
139
+ * Calibrated between the two shapes the fixtures pin: the #1500 generated CRUD
140
+ * lands at 10–11% of the top weight (penalised twice — once into the score by
141
+ * `rankPenalty`, once again here) and must cliff; a genuinely peripheral but
142
+ * hand-written flow file — `payslip_builder.go`, the direct callee of the
143
+ * workflow entry — lands at 25% and must NOT. Everything in between is a
144
+ * judgement call the agent can undo for ~0 cost, because a cliffed file is
145
+ * still NAMED in the response and one follow-up explore fetches it.
146
+ */
147
+ readonly CLIFF_FRACTION: 0.15;
148
+ /**
149
+ * Ceiling on the cliff, in the same units as `SCORE_FLOOR_MAX` — and for the
150
+ * same reason. A file whose weight clears a full-strength direct match is never
151
+ * incidental, so no amount of concentration elsewhere may zero it: one
152
+ * overwhelming top file (a 99-scoring god-file among score-10 peers) otherwise
153
+ * puts the cliff at 14.9 and silences every peer the score floor had just
154
+ * deliberately admitted. The cliff is a RELATIVE prune of weak evidence, not a
155
+ * second admission gate — the score floor already owns admission.
156
+ */
157
+ readonly CLIFF_MAX: 10;
158
+ /**
159
+ * Floor on a useful reservation — every admitted file gets this much before
160
+ * the proportional split divides the rest. Under it a slice can't hold one
161
+ * complete method, and a fragment is strictly worse than a pointer: it forces
162
+ * the Read this tool exists to prevent.
163
+ *
164
+ * It is a FLOOR, not a second cliff. Cliffing the starved file instead
165
+ * cascades: removing the smallest raises everyone else's share by so little
166
+ * that the next-smallest starves too, and a query with two dominant files ate
167
+ * six legitimately-ranked peers one at a time. Concentration is the relative
168
+ * cliff's job; this only keeps a served file's slice usable.
169
+ */
170
+ readonly MIN_CHARS: 700;
171
+ /**
172
+ * Safety valve, as a fraction of the envelope. Not the primary guard any more —
173
+ * the proportional split is — so this only has to stop a pathological
174
+ * single-file response.
175
+ *
176
+ * It does not apply to a file the query NAMED — one that defines a symbol the
177
+ * query spelled, or that the query named by path. The valve hedges against a
178
+ * mis-ranked dominant file, and a file the agent asked for by name is not
179
+ * one. It also never redistributed: a clamped file's excess was simply left
180
+ * unreserved, and the carry-forward only moves reservations, so nobody could
181
+ * spend it. On express, "response.js res.send res.json res.render …" admits
182
+ * one file, clamps it at 9,100 with 3,700 of the pool unreserved, and cuts
183
+ * the named `send` body at 55 of 97 lines in a 10.9K response to a 13K budget.
184
+ */
185
+ readonly MAX_SHARE: 0.7;
186
+ /**
187
+ * Markdown overhead charged per rendered file (header + fences + blank lines),
188
+ * matching the render loop's own `+ 200` accounting. Held out of the pool
189
+ * before the split so the reservations plus their overhead fit the envelope —
190
+ * without this the last file's reservation is always the one that doesn't fit.
191
+ */
192
+ readonly FILE_OVERHEAD: 200;
193
+ /**
194
+ * Flow-spine files are weighted up and are exempt from the cliff. Clipping the
195
+ * spine causes the Read fallback (it IS the answer to a flow question);
196
+ * clipping a peripheral file does not. This makes the existing advisory spine
197
+ * handling — `hasSpine`, `SPINE_CEILING` — strict at the allocation layer.
198
+ */
199
+ readonly SPINE_WEIGHT_BOOST: 2;
200
+ /**
201
+ * Slack allowed on the whole-file rule: a file a little over its reservation
202
+ * still ships WHOLE rather than as clusters, because slicing off that last
203
+ * sliver saves ~1% of the envelope and costs a Read — the trade the whole-file
204
+ * rule exists to refuse. Proportional (with an absolute ceiling) because a
205
+ * "sliver" is relative: a flat 800 is 15% of a 5K reservation but 31% of a 2.5K
206
+ * one, and at the small end that overshoot is exactly what the file below then
207
+ * loses.
208
+ */
209
+ readonly WHOLE_FILE_GRACE_FRACTION: 0.15;
210
+ readonly WHOLE_FILE_GRACE_MAX: 800;
211
+ /**
212
+ * A reservation that already covers this fraction of a file BUYS THE WHOLE
213
+ * FILE (CG-21), even though the file is bigger than the reservation.
214
+ *
215
+ * The grace above is calibrated as a *sliver* — it only rescues a file that
216
+ * essentially fits. Below it there is a hole the render loop cannot fill:
217
+ * express's `lib/utils.js` (5,293 B) was the TOP-ranked file, reserved 3,870,
218
+ * declined the whole-file render at a 4,450 grace bound, and then spent 583 on
219
+ * a three-symbol cluster render. The other 3,287 chars of its reservation were
220
+ * neither redistributed nor delivered — the envelope shrank by a third against
221
+ * an unchanged budget and the agent Read the file back four times.
222
+ *
223
+ * So the rule is not "does the file fit the reservation" but "has the
224
+ * reservation already bought most of the file": at 0.6 the loop pays at most
225
+ * two-thirds of a reservation extra to avoid losing the whole thing, and it
226
+ * spends bytes it was going to spend anyway on a file that already earned
227
+ * them. Below the fraction the shortfall is real — the file is several times
228
+ * its reservation, clustering is the right answer, and the carry-forward
229
+ * (`reservedSoFar`/`sourceSpent` in the render loop) hands whatever it cannot
230
+ * spend to the next file down.
231
+ */
232
+ readonly WHOLE_FILE_BUY_FRACTION: 0.6;
233
+ /**
234
+ * The buy rule's overshoot is funded from ONE pool for the whole response,
235
+ * sized as this fraction of the envelope — deliberately the same 15% as
236
+ * `WHOLE_FILE_GRACE_FRACTION`, one level up: the grace is a sliver of a
237
+ * FILE's reservation, this is a sliver of the RESPONSE's envelope.
238
+ *
239
+ * Per-file funding is the version that fails, and it fails the same way the
240
+ * bug being fixed does. The merit test is a RATIO, so wherever several files
241
+ * sit near it they all qualify, and N independent overshoots inflate the
242
+ * response until the render ceiling drops whatever is last. Measured on the
243
+ * #1500 payroll fixture: three files bought whole and `payslip_builder.go` —
244
+ * the file that computes the payslip the question asks about, rank #6 — was
245
+ * dropped entirely so three higher-ranked files could each ship their final
246
+ * sliver. A dropped section is strictly worse than a clustered one, so one
247
+ * shared pool, spent in rank order, is the bound that matters.
248
+ */
249
+ readonly WHOLE_FILE_BUY_OVERSHOOT_FRACTION: 0.15;
250
+ };
251
+ /** One candidate file's allocation inputs, in final rank order. */
252
+ export interface ExploreAllocationCandidate {
253
+ path: string;
254
+ /** Post-`rankPenalty` relevance score from the ranking pass. */
255
+ score: number;
256
+ /**
257
+ * How much this file's BYTES are worth, independent of how well it matched.
258
+ * Ranking answers "is this file about the query"; allocation answers "will
259
+ * these bytes teach the agent anything". Generated CRUD can legitimately rank
260
+ * (it name-collides on every domain word) while its bytes stay mechanical
261
+ * boilerplate the agent gains nothing from reading — so `rankPenalty` is
262
+ * applied a SECOND time here. That is what finally sinks the #1500 generated
263
+ * layer below the cliff: it survived CG-10's single penalty because the sort's
264
+ * leading keys (entry-point, graph mass) are structural, and a big densely
265
+ * self-referential generated file scores well on both.
266
+ */
267
+ worth: number;
268
+ /**
269
+ * Carries a symbol on the rendered flow spine — or an exact target (a
270
+ * qualified name, a line anchor), which is the answer by the same argument.
271
+ */
272
+ spine: boolean;
273
+ /**
274
+ * The query named this file by PATH (see query-paths.ts). Pinned files are
275
+ * never cliffed or trimmed, and weigh at least as much as the strongest
276
+ * candidate — the agent asked for the file itself, so starving it on text/
277
+ * graph scores (which a pure-path query doesn't produce) defeats the ask.
278
+ */
279
+ pinned?: boolean;
280
+ /**
281
+ * The query named a symbol this file defines (the named-first sort tier). Like
282
+ * a pinned file, it is exempt from the `MAX_SHARE` valve: its proportional
283
+ * share stands, bounded only by the pool.
284
+ */
285
+ named?: boolean;
286
+ }
287
+ export interface ExploreAllocation {
288
+ /** path → chars of source it may render. Only holds admitted files. */
289
+ allowances: Map<string, number>;
290
+ /** Files the cliff zeroed, in rank order — pointers, not bytes. */
291
+ cliffed: string[];
292
+ /** The weight threshold the cliff fired at (0 when nothing was cliffed). */
293
+ cliffAt: number;
294
+ /** Chars actually split among the admitted files. */
295
+ pool: number;
296
+ }
297
+ /**
298
+ * Split `budget.maxOutputChars` across ranked candidates in proportion to
299
+ * relevance, with a hard relative cliff.
300
+ *
301
+ * `candidates` must arrive in FINAL RANK ORDER — `maxFiles` is applied to the
302
+ * survivors of the cliff, in that order, so cliffing genuinely hands a slot to
303
+ * the next file down rather than leaving it unused.
304
+ *
305
+ * Tier invariant (`getExploreOutputBudget`): a larger tier must never allow less
306
+ * per file than a smaller one. It holds here by construction — every bound is a
307
+ * fraction of `maxOutputChars` or of `maxCharsPerFile`, both monotonic across
308
+ * tiers — except `MIN_CHARS`, which is an absolute floor and so identical at
309
+ * every tier.
310
+ */
311
+ export declare function allocateExploreBudget(candidates: readonly ExploreAllocationCandidate[], budget: ExploreOutputBudget, maxFiles: number): ExploreAllocation;
312
+ type ElidedSymbolRef = {
313
+ name: string;
314
+ kind: string;
315
+ startLine: number;
316
+ };
317
+ /**
318
+ * Indexed symbols whose definition starts strictly between two rendered
319
+ * spans. The hole is what a trim dropped; naming them is what lets the agent
320
+ * follow up by name instead of guessing (#1711).
321
+ */
322
+ export declare function symbolsBetweenRanges(nodes: ReadonlyArray<{
323
+ name: string;
324
+ kind: string;
325
+ startLine: number;
326
+ endLine: number;
327
+ }>, fromEnd: number, toStart: number): ElidedSymbolRef[];
328
+ /**
329
+ * Symbols in `candidates` whose start line is not covered by any emitted range.
330
+ * Used to bias the per-file header toward what the trim dropped (#1711).
331
+ */
332
+ export declare function symbolsNotInRanges(candidates: ReadonlyArray<ElidedSymbolRef>, ranges: ReadonlyArray<ExploreLineRange>): ElidedSymbolRef[];
333
+ /**
334
+ * Gap marker between two non-contiguous slices of one file.
335
+ *
336
+ * Bare `... (gap) ...` told the agent something was missing but not WHAT —
337
+ * and the footer then asked it to re-explore "with its exact name", which is
338
+ * circular when the missing names *are* the question (#1711). When the hole
339
+ * holds indexed symbols, list them as `name (file:line)` (same shape the
340
+ * flow / blast-radius lines already use).
341
+ */
342
+ export declare function formatGapMarker(filePath: string, elided: ReadonlyArray<ElidedSymbolRef>): string;
343
+ /**
344
+ * Join rendered parts with gap markers that name whatever the trim skipped.
345
+ *
346
+ * `spareChars` is what naming may cost beyond bare markers. Cluster selection
347
+ * prices every join between clusters as a bare marker, and on a long path each
348
+ * named gap runs to several hundred chars, so unbounded naming overran the
349
+ * file's reservation and the ceiling trim then dropped SOURCE to pay for the
350
+ * names: vscode's `rpcProtocol.ts` went from ~5,200 chars of the RPCProtocol
351
+ * body to a 222-char stub. A gap the spare can't cover stays bare; the file
352
+ * header still lists the symbols the trim dropped.
353
+ */
354
+ export declare function joinPartsWithNamedGaps(filePath: string, parts: ReadonlyArray<{
355
+ range: ExploreLineRange;
356
+ text: string;
357
+ }>, nodes: ReadonlyArray<{
358
+ name: string;
359
+ kind: string;
360
+ startLine: number;
361
+ endLine: number;
362
+ }>, spareChars?: number): string;
363
+ /**
364
+ * Prefer symbols the trim dropped when filling the per-file header's named
365
+ * slots, so `+N more` is less likely to hide the answer (#1711). Frequency
366
+ * still breaks ties among the preferred / remaining groups.
367
+ */
368
+ export declare function biasHeaderSymbols(symbols: readonly string[], elided: ReadonlyArray<ElidedSymbolRef>, cap: number): {
369
+ shown: string[];
370
+ omitted: number;
371
+ };
372
+ /**
373
+ * The notes that stand in for the epilogue, or close a truncated response, in
374
+ * two wordings each. `complete` says the source above is complete; `trimmed` is
375
+ * used when a section it vouches for was trimmed (see `elidedWantedSpans`) and
376
+ * drops that claim, keeping the guarantee that is still true. Each trimmed
377
+ * wording is no longer than its complete one: the epilogue floor (`lost`) and
378
+ * the cut note's fit test (`cut`) are sized before the render knows which of the
379
+ * two it will need.
380
+ */
381
+ export declare const EXPLORE_FALLBACK_NOTES: {
382
+ readonly lost: {
383
+ readonly complete: "> (Trailing pointer list omitted for size. The source above is complete and verbatim — treat it as already Read. For anything this call did not cover, run another lattice_sensor_explore with the specific names rather than reading those files.)";
384
+ readonly trimmed: "> (Trailing pointer list omitted for size. The source above is verbatim — treat it as already Read. For symbols its gap markers name, and anything else not covered, run another lattice_sensor_explore with those names rather than reading.)";
385
+ };
386
+ readonly cut: {
387
+ readonly complete: "\n\n> (Trailing notes omitted for size. The source above is complete and verbatim — treat it as already Read. For anything this call did not cover, run another lattice_sensor_explore with the specific names rather than reading those files.)";
388
+ readonly trimmed: "\n\n> (Trailing notes omitted for size. The source above is verbatim — treat it as already Read. For symbols its gap markers name, and anything else not covered, run another lattice_sensor_explore with those names rather than reading.)";
389
+ };
390
+ readonly truncated: {
391
+ readonly complete: "\n\n... (output truncated to budget; the source above is complete and verbatim — treat it as already Read. For any area not covered, run another lattice_sensor_explore with the specific names — do NOT Read these files.)";
392
+ readonly trimmed: "\n\n... (output truncated to budget; the source above is verbatim — treat it as already Read. For names its gap markers list, or any area not covered, run another lattice_sensor_explore — do NOT Read these files.)";
393
+ };
394
+ };
395
+ /**
396
+ * One symbol a file section set out to deliver: a cluster member, or a symbol
397
+ * of the per-symbol (focused/skeleton) view. Completeness is judged against
398
+ * these, not against the file — explore never promises whole files, only the
399
+ * symbols it selected for each one.
400
+ */
401
+ export type ExploreWantedSpan = {
402
+ name: string;
403
+ kind: string;
404
+ start: number;
405
+ end: number;
406
+ importance: number;
407
+ spine: boolean;
408
+ /** The indexed qualified name (`SQLCompiler::as_sql`), when the span is a node. */
409
+ qualifiedName?: string;
410
+ };
411
+ /**
412
+ * The wanted spans a section did NOT deliver in full: some line of the span is
413
+ * in neither what this call sent nor what an earlier call already sent (a
414
+ * back-referenced span counts — the agent holds that copy).
415
+ *
416
+ * Derived from the emitted ranges rather than from a flag each trim site has to
417
+ * remember to set. The oversize-spine window set none until #2068, which is how
418
+ * a 62-line slice of vscode's 968-line `rpcProtocol.ts` went out under "Complete
419
+ * source … do NOT re-read them". Whatever elides source — a member shrink, a
420
+ * ceiling window, a dropped cluster, the per-symbol view, a path added later —
421
+ * shows up here.
422
+ *
423
+ * Most relevant first (spine, then importance), then source order.
424
+ */
425
+ export declare function elidedWantedSpans(wanted: ReadonlyArray<ExploreWantedSpan>, delivered: ReadonlyArray<ExploreLineRange>): ExploreWantedSpan[];
426
+ /** A rendered file whose section is missing some of what it set out to deliver. */
427
+ export type ExplorePartialFile = {
428
+ filePath: string;
429
+ elided: ReadonlyArray<ExploreWantedSpan>;
430
+ };
431
+ /**
432
+ * The shortest trailing slice of each path that no other path in `paths`
433
+ * ends with: `extHostExtensionService.ts` alone when it is the only one,
434
+ * `node/extHostExtensionService.ts` beside `common/extHostExtensionService.ts`.
435
+ */
436
+ export declare function shortestUniqueSuffixes(paths: ReadonlyArray<string>): Map<string, string>;
437
+ /**
438
+ * The large tiers' completeness note (`includeCompletenessSignal`), as
439
+ * candidates from most to least specific. The epilogue fit keeps the first
440
+ * one that fits the room left (CG-26).
441
+ *
442
+ * "Complete" is claimed only when no section elided anything it set out to
443
+ * deliver. Otherwise the note keeps the guarantee that is still true (every
444
+ * block shown is verbatim; treat it as already Read), names the trimmed files
445
+ * and the most relevant elided symbols as room allows, and sends the agent to
446
+ * another lattice_sensor_explore for them. It never offers Read: explore output must
447
+ * not tell the agent to Read (AGENTS.md).
448
+ */
449
+ export declare function exploreCompletenessNotes(filesIncluded: number, trimmed: ReadonlyArray<ExplorePartialFile>,
450
+ /** Every path the response can name (sections and pointer list); labels are unique among them. */
451
+ knownPaths: ReadonlyArray<string>): string[];
452
+ /**
453
+ * Fit the completeness note and the pointer list into the room the response has
454
+ * left (CG-26). Returns the note (a candidate block, or none), the pointer
455
+ * block, and the room that remains.
456
+ *
457
+ * The note is one of `noteCandidates`, most specific first. A complete-source
458
+ * note keeps the precedence it always had and goes first. A note that YIELDS (a
459
+ * trimmed one) gives way to the pointer list, which names files the response
460
+ * does not show at all, while what a trimmed section elided is already named in
461
+ * its own gap markers and header. It leaves the list's header and first entry
462
+ * when that much could fit, and its optional detail never costs an entry the
463
+ * least specific candidate would have left.
464
+ */
465
+ export declare function fitExploreEpilogue(opts: {
466
+ room: number;
467
+ noteCandidates: ReadonlyArray<readonly string[]>;
468
+ noteYields: boolean;
469
+ pointerEntries: readonly string[];
470
+ pointerOmitted: number;
471
+ }): {
472
+ note: string[];
473
+ pointers: string[];
474
+ room: number;
475
+ };
121
476
  /**
122
477
  * Per-file staleness banner emitted at the top of a tool response when the
123
478
  * file watcher has pending events for files referenced by the response.
@@ -140,6 +495,8 @@ export declare function formatStaleFooter(stale: PendingFile[]): string;
140
495
  * already names the operator remedy (`lattice sensor sync . --json` / git hooks).
141
496
  */
142
497
  export declare function formatDegradedBanner(reason: string | null): string;
498
+ /** Re-armed watches are not proof of freshness until their full scan commits. */
499
+ export declare function formatRecoveringBanner(): string;
143
500
  /**
144
501
  * MCP Tool definition
145
502
  */
@@ -153,6 +510,12 @@ export interface ToolDefinition {
153
510
  };
154
511
  /** Behavioral hints for clients (see {@link ToolAnnotations}). */
155
512
  annotations?: ToolAnnotations;
513
+ /**
514
+ * MCP `_meta` on the tool definition. `anthropic/alwaysLoad: true` makes
515
+ * Claude Code load the tool at session start instead of deferring it behind
516
+ * its tool search (https://code.claude.com/docs/en/mcp#exempt-a-server-from-deferral).
517
+ */
518
+ _meta?: Record<string, unknown>;
156
519
  }
157
520
  /**
158
521
  * MCP ToolAnnotations — behavioral hints a client MAY use to decide how, or
@@ -194,6 +557,18 @@ export interface ToolResult {
194
557
  text: string;
195
558
  }>;
196
559
  isError?: boolean;
560
+ /**
561
+ * INTERNAL side-channel (CG-17): what a `lattice_sensor_explore` call actually put
562
+ * on the wire — files, line ranges, bytes. It rides the result because the
563
+ * call may have run on a query-pool worker, while the session state it feeds
564
+ * lives on the main thread. {@link ToolHandler.execute} records it and DELETES
565
+ * it, so nothing here ever reaches the client. Keyed by
566
+ * {@link EXPLORE_EMISSION_KEY}; the two must stay in sync.
567
+ */
568
+ _cgExploreEmission?: ExploreEmission;
569
+ /** Internal structured provenance, preserved by query workers and stripped by execute. */
570
+ _cgAnswerFiles?: AnswerFile[];
571
+ structuredContent?: Record<string, unknown>;
197
572
  }
198
573
  /**
199
574
  * All LatticeSensor MCP tools
@@ -212,6 +587,27 @@ export declare const tools: ToolDefinition[];
212
587
  * note in a description only adds once `cg` is loaded; the schemas are static).
213
588
  */
214
589
  export declare function getStaticTools(): ToolDefinition[];
590
+ /**
591
+ * How many explicit-`projectPath` projects a handler keeps open at once
592
+ * (#1835). Each cached project may hold a file watcher, a writer lock and a
593
+ * SQLite connection, so the cache is bounded LRU: opening one more than this
594
+ * closes the least recently used. Small on purpose — a session that queries
595
+ * many repositories still leaks nothing; it only pays a reopen + catch-up.
596
+ */
597
+ export declare const MAX_CACHED_PROJECTS = 8;
598
+ /**
599
+ * Engine-side lifecycle for a project the ToolHandler opened for an explicit
600
+ * `projectPath` (#1835). `activate` gives it the same treatment the default
601
+ * project gets — a file watcher while it stays open and a catch-up sync — and
602
+ * returns the catch-up promise, which the handler awaits (time-boxed) before
603
+ * calls against that project. `release` runs after active calls drain, so the
604
+ * engine can release shared ownership safely on LRU eviction or shutdown.
605
+ */
606
+ export interface ProjectLifecycle {
607
+ open(root: string, open: () => LatticeSensor): LatticeSensor;
608
+ activate(cg: LatticeSensor): Promise<void>;
609
+ release(cg: LatticeSensor): void | Promise<void>;
610
+ }
215
611
  /**
216
612
  * Tool handler that executes tools against a LatticeSensor instance
217
613
  *
@@ -221,25 +617,46 @@ export declare function getStaticTools(): ToolDefinition[];
221
617
  export declare class ToolHandler {
222
618
  private cg;
223
619
  private projectCache;
620
+ private projectLifecycle;
621
+ private projectGates;
622
+ private activeCalls;
623
+ private closing;
624
+ private pendingCloses;
625
+ private closeWaiters;
224
626
  private defaultProjectHint;
627
+ private knownSubprojects;
628
+ private knownSubprojectsBase;
629
+ private defaultOpenFailure;
225
630
  private worktreeMismatchCache;
226
631
  private catchUpGate;
632
+ private onDatabaseReopened;
227
633
  private queryPool;
228
634
  private openFailure;
229
635
  private executionMode;
230
636
  constructor(cg: LatticeSensor | null);
231
637
  /**
232
638
  * Engine-only: attach (or detach with null) the worker-thread query pool. The
233
- * shared daemon sets this once its default project is open; the workers each
639
+ * engine sets this after resolving its default project; the workers each
234
640
  * hold their own WAL read connection and run {@link executeReadTool}. A
235
641
  * worker's own ToolHandler never has a pool, so there is no nested off-loading.
236
642
  */
237
643
  setQueryPool(pool: QueryPool | null): void;
644
+ /**
645
+ * Engine-only: own the lifecycle (watcher, catch-up, writer lock) of every
646
+ * project this handler opens for an explicit `projectPath` (#1835).
647
+ */
648
+ setProjectLifecycle(lifecycle: ProjectLifecycle | null): void;
238
649
  /**
239
650
  * Update the default LatticeSensor instance (e.g. after lazy initialization).
240
651
  * A successful open supersedes any previously recorded open failure.
241
652
  */
242
653
  setDefaultLatticeSensor(cg: LatticeSensor): void;
654
+ /**
655
+ * Engine-only: record why the default project failed to open (#995), so a
656
+ * call that needs it answers with that fix rather than "no project loaded".
657
+ * `null` clears it.
658
+ */
659
+ setDefaultOpenFailure(err: WslSharedIndexError | null): void;
243
660
  /**
244
661
  * ADR 0049 Decision 5②: record that the DEFAULT project's index failed to
245
662
  * open for a reason OTHER than "no .lattice/sensor/ found" — the engine calls
@@ -269,6 +686,12 @@ export declare class ToolHandler {
269
686
  * stale data, which is what would have happened without the gate.
270
687
  */
271
688
  setCatchUpGate(p: Promise<void> | null): void;
689
+ /**
690
+ * Engine-only: called after a tool call's {@link freshen} reopened a database
691
+ * that was replaced on disk (#1902). The engine decides whether a catch-up
692
+ * sync is its to run (only for the instance it watches and writes).
693
+ */
694
+ setOnDatabaseReopened(fn: ((cg: LatticeSensor) => void) | null): void;
272
695
  /**
273
696
  * Await the catch-up gate, but no longer than the configured timeout (#905).
274
697
  * If the reconcile settles first, we got the fully-reconciled answer. If the
@@ -284,6 +707,14 @@ export declare class ToolHandler {
284
707
  * Used only to make the "no default project" error actionable.
285
708
  */
286
709
  setDefaultProjectHint(searchedPath: string): void;
710
+ /**
711
+ * Engine-only: record the indexed sub-projects the workspace down-scan saw
712
+ * when it could not adopt a default project (#1606/#1607). An empty list
713
+ * clears any previous note.
714
+ */
715
+ setKnownSubprojects(roots: string[], base: string): void;
716
+ /** One message line naming the indexed sub-projects, or '' when none known. */
717
+ private formatKnownSubprojects;
287
718
  /**
288
719
  * Whether a default LatticeSensor instance is available
289
720
  */
@@ -316,6 +747,9 @@ export declare class ToolHandler {
316
747
  * similar to how git finds .git/ directories.
317
748
  */
318
749
  private getLatticeSensor;
750
+ private awaitProjectGate;
751
+ /** Never evict a graph while a tool call or its timed-out reconcile uses it. */
752
+ private trimProjects;
319
753
  /**
320
754
  * Heal a long-lived connection whose `.lattice/sensor/` was removed and recreated
321
755
  * at the same path (a worktree recreated, or `rm -rf .lattice/sensor` + re-init)
@@ -330,7 +764,7 @@ export declare class ToolHandler {
330
764
  /**
331
765
  * Close all cached project connections
332
766
  */
333
- closeAll(): void;
767
+ closeAll(): Promise<void>;
334
768
  /**
335
769
  * Validate that a value is a non-empty string within length bounds.
336
770
  *
@@ -404,11 +838,40 @@ export declare class ToolHandler {
404
838
  * would needlessly push the agent back to Read.
405
839
  */
406
840
  private isFileStaleOnDisk;
841
+ private answerResult;
407
842
  private withStalenessNotice;
408
843
  /**
409
- * Execute a tool by name
844
+ * Execute a tool by name.
845
+ *
846
+ * `sessionState` is the CALLER's per-session explore history (CG-17). The
847
+ * daemon shares one ToolHandler across every connected session, so this state
848
+ * cannot live on the handler — each session owns one and hands it in, which is
849
+ * what keeps two sessions on one daemon from ever seeing each other's calls.
850
+ * Omit it (the CLI does) and explore behaves exactly as before, untracked.
851
+ */
852
+ execute(toolName: string, args: Record<string, unknown>, sessionState?: ExploreSessionState): Promise<ToolResult>;
853
+ /**
854
+ * Attach the caller's session view to an explore call's args (CG-17), on a
855
+ * COPY so the caller's object is never mutated. Nothing else sees it: a
856
+ * non-explore tool, or a caller with no session state, gets the args
857
+ * unchanged and pays nothing.
858
+ *
859
+ * A client that spells the internal key itself is stripped rather than
860
+ * trusted — the view decides what source a later call may withhold, so it has
861
+ * to come from the server's own record, never from the wire.
862
+ */
863
+ private withSessionView;
864
+ /**
865
+ * Record an explore call's emission into the caller's session state and strip
866
+ * it from the result (CG-17).
867
+ *
868
+ * Unconditional strip: the property is internal, so it comes off even when
869
+ * there is no session state to record it into (the CLI path) — that is what
870
+ * keeps the agent-facing response byte-identical. Recording is wrapped
871
+ * because a bookkeeping bug must never fail a tool call that already
872
+ * succeeded.
410
873
  */
411
- execute(toolName: string, args: Record<string, unknown>): Promise<ToolResult>;
874
+ private takeExploreEmission;
412
875
  /**
413
876
  * Run a single read tool to completion and return its raw {@link ToolResult},
414
877
  * classifying expected failures the same way {@link execute}'s catch does so
@@ -462,6 +925,12 @@ export declare class ToolHandler {
462
925
  * for ordinary static edges. Used by trace + the node trail so a synthesized
463
926
  * hop reads as "registered via onUpdate at App.tsx:3148", not a bare arrow.
464
927
  */
928
+ /**
929
+ * The branch conditions a flow hop's call site runs under, read from the
930
+ * caller's source now (`graph/branch-guards.ts`); '' when unconditional,
931
+ * unreadable, or the grammar for that language is not loaded.
932
+ */
933
+ private whenLabel;
465
934
  private synthEdgeNote;
466
935
  /**
467
936
  * Flow-from-named-symbols: an agent's lattice_sensor_explore query is a bag of
@@ -511,12 +980,13 @@ export declare class ToolHandler {
511
980
  */
512
981
  private buildPolymorphicBoundaries;
513
982
  /**
514
- * Shortlist candidate runtime targets for a dispatch key surfaced by
515
- * {@link buildDynamicBoundaries}. Exact conventional names first (`save` →
516
- * `onSave`/`handleSave`; `CreateCmd` → `CreateCmdHandler`), then FTS, with a
517
- * normalized-containment post-filter (FTS camel-splitting is fuzzier than a
518
- * candidate list should be). Symbols the agent already named sort first and
519
- * are marked — that's the "you were right, here's the wiring" case.
983
+ * Render the candidate shortlist for a dispatch site as one line.
984
+ *
985
+ * The shortlist itself is `shortlistBoundaryCandidates` in
986
+ * `../graph/dynamic-boundary-report` — shared with the viewer's end cap, so
987
+ * "candidates for key `save`" names the same symbols in both places. Symbols
988
+ * the agent already named are marked: that is the "you were right, here's the
989
+ * wiring" case.
520
990
  */
521
991
  private boundaryCandidates;
522
992
  /**
@@ -637,22 +1107,8 @@ export declare class ToolHandler {
637
1107
  * Returns the best match and a note about alternatives if any.
638
1108
  */
639
1109
  /**
640
- * Check if a node matches a symbol query.
641
- *
642
- * Accepts simple names (`run`) and three flavors of qualifier:
643
- * - dotted `Session.request` (TS/JS/Python)
644
- * - colon-pair `stage_apply::run` (Rust, C++, Ruby)
645
- * - slash `configurator/stage_apply` (path-ish)
646
- *
647
- * Multi-level qualifiers compose: `crate::configurator::stage_apply::run`
648
- * works. Rust path prefixes (`crate`, `super`, `self`) are stripped so
649
- * the canonical `crate::module::symbol` form resolves.
650
- *
651
- * Resolution order, last part must always equal `node.name`:
652
- * 1. Suffix-match against `qualifiedName` (handles class-scoped methods
653
- * where the extractor builds the qualified name from the AST stack)
654
- * 2. File-path containment (handles file-derived modules in Rust/
655
- * Python — `stage_apply::run` matches a `run` in `stage_apply.rs`)
1110
+ * Check if a node matches a symbol query — see `matchesSymbol` in
1111
+ * `../graph/symbol-lookup`, which owns the rules.
656
1112
  */
657
1113
  private matchesSymbol;
658
1114
  /**
@@ -667,6 +1123,9 @@ export declare class ToolHandler {
667
1123
  /**
668
1124
  * Find ALL symbols matching a name. Used by callers/callees/impact to aggregate
669
1125
  * results across all matching symbols (e.g., multiple classes with an `execute` method).
1126
+ *
1127
+ * The resolution itself lives in `../graph/named-symbol-flow`, so the Flow
1128
+ * strip and `lattice_sensor_explore` resolve a written name to the same nodes.
670
1129
  */
671
1130
  private findAllSymbols;
672
1131
  /**
@@ -695,5 +1154,4 @@ export declare class ToolHandler {
695
1154
  private textResult;
696
1155
  private errorResult;
697
1156
  }
698
- export {};
699
1157
  //# sourceMappingURL=tools.d.ts.map