@quolu/lattice 0.70.0 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (602) hide show
  1. package/package.json +1 -1
  2. package/sensor/dist/bin/lattice-sensor.js +746 -323
  3. package/sensor/dist/bin/viewer-gate.d.ts +17 -0
  4. package/sensor/dist/bin/viewer-gate.d.ts.map +1 -0
  5. package/sensor/dist/bin/viewer-gate.js +31 -0
  6. package/sensor/dist/bin/viewer-gate.js.map +1 -0
  7. package/sensor/dist/context/formatter.d.ts +7 -1
  8. package/sensor/dist/context/formatter.d.ts.map +1 -1
  9. package/sensor/dist/context/formatter.js +12 -6
  10. package/sensor/dist/context/formatter.js.map +1 -1
  11. package/sensor/dist/context/index.d.ts +12 -0
  12. package/sensor/dist/context/index.d.ts.map +1 -1
  13. package/sensor/dist/context/index.js +103 -16
  14. package/sensor/dist/context/index.js.map +1 -1
  15. package/sensor/dist/db/index.d.ts +23 -2
  16. package/sensor/dist/db/index.d.ts.map +1 -1
  17. package/sensor/dist/db/index.js +109 -31
  18. package/sensor/dist/db/index.js.map +1 -1
  19. package/sensor/dist/db/migrations.d.ts +1 -1
  20. package/sensor/dist/db/migrations.d.ts.map +1 -1
  21. package/sensor/dist/db/migrations.js +68 -1
  22. package/sensor/dist/db/migrations.js.map +1 -1
  23. package/sensor/dist/db/queries.d.ts +583 -6
  24. package/sensor/dist/db/queries.d.ts.map +1 -1
  25. package/sensor/dist/db/queries.js +1425 -57
  26. package/sensor/dist/db/queries.js.map +1 -1
  27. package/sensor/dist/db/schema.sql +27 -4
  28. package/sensor/dist/db/sqlite-adapter.d.ts +2 -0
  29. package/sensor/dist/db/sqlite-adapter.d.ts.map +1 -1
  30. package/sensor/dist/db/sqlite-adapter.js +56 -7
  31. package/sensor/dist/db/sqlite-adapter.js.map +1 -1
  32. package/sensor/dist/db/synthesis-stage.d.ts +12 -0
  33. package/sensor/dist/db/synthesis-stage.d.ts.map +1 -0
  34. package/sensor/dist/db/synthesis-stage.js +93 -0
  35. package/sensor/dist/db/synthesis-stage.js.map +1 -0
  36. package/sensor/dist/db/wal-valve.d.ts +32 -12
  37. package/sensor/dist/db/wal-valve.d.ts.map +1 -1
  38. package/sensor/dist/db/wal-valve.js +65 -22
  39. package/sensor/dist/db/wal-valve.js.map +1 -1
  40. package/sensor/dist/db/wsl-shared-index.d.ts +53 -0
  41. package/sensor/dist/db/wsl-shared-index.d.ts.map +1 -0
  42. package/sensor/dist/db/wsl-shared-index.js +121 -0
  43. package/sensor/dist/db/wsl-shared-index.js.map +1 -0
  44. package/sensor/dist/directory.d.ts +126 -2
  45. package/sensor/dist/directory.d.ts.map +1 -1
  46. package/sensor/dist/directory.js +285 -16
  47. package/sensor/dist/directory.js.map +1 -1
  48. package/sensor/dist/errors.d.ts +14 -0
  49. package/sensor/dist/errors.d.ts.map +1 -1
  50. package/sensor/dist/errors.js +16 -1
  51. package/sensor/dist/errors.js.map +1 -1
  52. package/sensor/dist/extraction/cfml-extractor.d.ts +1 -0
  53. package/sensor/dist/extraction/cfml-extractor.d.ts.map +1 -1
  54. package/sensor/dist/extraction/cfml-extractor.js +15 -3
  55. package/sensor/dist/extraction/cfml-extractor.js.map +1 -1
  56. package/sensor/dist/extraction/dfm-extractor.d.ts.map +1 -1
  57. package/sensor/dist/extraction/dfm-extractor.js +14 -10
  58. package/sensor/dist/extraction/dfm-extractor.js.map +1 -1
  59. package/sensor/dist/extraction/extraction-version.d.ts +1 -1
  60. package/sensor/dist/extraction/extraction-version.d.ts.map +1 -1
  61. package/sensor/dist/extraction/extraction-version.js +3 -1
  62. package/sensor/dist/extraction/extraction-version.js.map +1 -1
  63. package/sensor/dist/extraction/function-ref.d.ts +6 -4
  64. package/sensor/dist/extraction/function-ref.d.ts.map +1 -1
  65. package/sensor/dist/extraction/function-ref.js +35 -14
  66. package/sensor/dist/extraction/function-ref.js.map +1 -1
  67. package/sensor/dist/extraction/generated-detection.d.ts +48 -12
  68. package/sensor/dist/extraction/generated-detection.d.ts.map +1 -1
  69. package/sensor/dist/extraction/generated-detection.js +176 -11
  70. package/sensor/dist/extraction/generated-detection.js.map +1 -1
  71. package/sensor/dist/extraction/grammars.d.ts +38 -0
  72. package/sensor/dist/extraction/grammars.d.ts.map +1 -1
  73. package/sensor/dist/extraction/grammars.js +115 -3
  74. package/sensor/dist/extraction/grammars.js.map +1 -1
  75. package/sensor/dist/extraction/index.d.ts +218 -14
  76. package/sensor/dist/extraction/index.d.ts.map +1 -1
  77. package/sensor/dist/extraction/index.js +887 -175
  78. package/sensor/dist/extraction/index.js.map +1 -1
  79. package/sensor/dist/extraction/languages/c-cpp.d.ts +58 -0
  80. package/sensor/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  81. package/sensor/dist/extraction/languages/c-cpp.js +310 -19
  82. package/sensor/dist/extraction/languages/c-cpp.js.map +1 -1
  83. package/sensor/dist/extraction/languages/dart.d.ts.map +1 -1
  84. package/sensor/dist/extraction/languages/dart.js +8 -3
  85. package/sensor/dist/extraction/languages/dart.js.map +1 -1
  86. package/sensor/dist/extraction/languages/erlang.d.ts.map +1 -1
  87. package/sensor/dist/extraction/languages/erlang.js +58 -22
  88. package/sensor/dist/extraction/languages/erlang.js.map +1 -1
  89. package/sensor/dist/extraction/languages/javascript.js +1 -1
  90. package/sensor/dist/extraction/languages/javascript.js.map +1 -1
  91. package/sensor/dist/extraction/languages/kotlin.d.ts.map +1 -1
  92. package/sensor/dist/extraction/languages/kotlin.js +169 -36
  93. package/sensor/dist/extraction/languages/kotlin.js.map +1 -1
  94. package/sensor/dist/extraction/languages/lua.d.ts.map +1 -1
  95. package/sensor/dist/extraction/languages/lua.js +4 -1
  96. package/sensor/dist/extraction/languages/lua.js.map +1 -1
  97. package/sensor/dist/extraction/languages/objc.d.ts.map +1 -1
  98. package/sensor/dist/extraction/languages/objc.js +4 -0
  99. package/sensor/dist/extraction/languages/objc.js.map +1 -1
  100. package/sensor/dist/extraction/languages/python.d.ts.map +1 -1
  101. package/sensor/dist/extraction/languages/python.js +71 -0
  102. package/sensor/dist/extraction/languages/python.js.map +1 -1
  103. package/sensor/dist/extraction/languages/rust.d.ts +20 -0
  104. package/sensor/dist/extraction/languages/rust.d.ts.map +1 -1
  105. package/sensor/dist/extraction/languages/rust.js +50 -20
  106. package/sensor/dist/extraction/languages/rust.js.map +1 -1
  107. package/sensor/dist/extraction/languages/scala.d.ts.map +1 -1
  108. package/sensor/dist/extraction/languages/scala.js +18 -3
  109. package/sensor/dist/extraction/languages/scala.js.map +1 -1
  110. package/sensor/dist/extraction/languages/swift.d.ts +15 -0
  111. package/sensor/dist/extraction/languages/swift.d.ts.map +1 -1
  112. package/sensor/dist/extraction/languages/swift.js +50 -0
  113. package/sensor/dist/extraction/languages/swift.js.map +1 -1
  114. package/sensor/dist/extraction/languages/typescript.d.ts.map +1 -1
  115. package/sensor/dist/extraction/languages/typescript.js +9 -2
  116. package/sensor/dist/extraction/languages/typescript.js.map +1 -1
  117. package/sensor/dist/extraction/liquid-extractor.d.ts +18 -0
  118. package/sensor/dist/extraction/liquid-extractor.d.ts.map +1 -1
  119. package/sensor/dist/extraction/liquid-extractor.js +98 -22
  120. package/sensor/dist/extraction/liquid-extractor.js.map +1 -1
  121. package/sensor/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  122. package/sensor/dist/extraction/mybatis-extractor.js +6 -4
  123. package/sensor/dist/extraction/mybatis-extractor.js.map +1 -1
  124. package/sensor/dist/extraction/parse-pool.d.ts +7 -0
  125. package/sensor/dist/extraction/parse-pool.d.ts.map +1 -1
  126. package/sensor/dist/extraction/parse-pool.js +20 -1
  127. package/sensor/dist/extraction/parse-pool.js.map +1 -1
  128. package/sensor/dist/extraction/syntax-tokens.d.ts +103 -0
  129. package/sensor/dist/extraction/syntax-tokens.d.ts.map +1 -0
  130. package/sensor/dist/extraction/syntax-tokens.js +381 -0
  131. package/sensor/dist/extraction/syntax-tokens.js.map +1 -0
  132. package/sensor/dist/extraction/tree-sitter-helpers.d.ts +5 -0
  133. package/sensor/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  134. package/sensor/dist/extraction/tree-sitter-helpers.js +17 -0
  135. package/sensor/dist/extraction/tree-sitter-helpers.js.map +1 -1
  136. package/sensor/dist/extraction/tree-sitter-types.d.ts +31 -3
  137. package/sensor/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  138. package/sensor/dist/extraction/tree-sitter.d.ts +101 -18
  139. package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -1
  140. package/sensor/dist/extraction/tree-sitter.js +928 -134
  141. package/sensor/dist/extraction/tree-sitter.js.map +1 -1
  142. package/sensor/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  143. package/sensor/dist/file-limits.d.ts +40 -0
  144. package/sensor/dist/file-limits.d.ts.map +1 -0
  145. package/sensor/dist/file-limits.js +147 -0
  146. package/sensor/dist/file-limits.js.map +1 -0
  147. package/sensor/dist/graph/branch-guards.d.ts +265 -0
  148. package/sensor/dist/graph/branch-guards.d.ts.map +1 -0
  149. package/sensor/dist/graph/branch-guards.js +2325 -0
  150. package/sensor/dist/graph/branch-guards.js.map +1 -0
  151. package/sensor/dist/graph/dead-code.d.ts +251 -0
  152. package/sensor/dist/graph/dead-code.d.ts.map +1 -0
  153. package/sensor/dist/graph/dead-code.js +776 -0
  154. package/sensor/dist/graph/dead-code.js.map +1 -0
  155. package/sensor/dist/graph/dynamic-boundary-report.d.ts +121 -0
  156. package/sensor/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
  157. package/sensor/dist/graph/dynamic-boundary-report.js +283 -0
  158. package/sensor/dist/graph/dynamic-boundary-report.js.map +1 -0
  159. package/sensor/dist/graph/index.d.ts +4 -0
  160. package/sensor/dist/graph/index.d.ts.map +1 -1
  161. package/sensor/dist/graph/index.js +16 -1
  162. package/sensor/dist/graph/index.js.map +1 -1
  163. package/sensor/dist/graph/named-symbol-flow.d.ts +125 -0
  164. package/sensor/dist/graph/named-symbol-flow.d.ts.map +1 -0
  165. package/sensor/dist/graph/named-symbol-flow.js +552 -0
  166. package/sensor/dist/graph/named-symbol-flow.js.map +1 -0
  167. package/sensor/dist/graph/queries.d.ts.map +1 -1
  168. package/sensor/dist/graph/queries.js +2 -0
  169. package/sensor/dist/graph/queries.js.map +1 -1
  170. package/sensor/dist/graph/symbol-lookup.d.ts +83 -0
  171. package/sensor/dist/graph/symbol-lookup.d.ts.map +1 -0
  172. package/sensor/dist/graph/symbol-lookup.js +181 -0
  173. package/sensor/dist/graph/symbol-lookup.js.map +1 -0
  174. package/sensor/dist/graph/traversal.d.ts +9 -0
  175. package/sensor/dist/graph/traversal.d.ts.map +1 -1
  176. package/sensor/dist/graph/traversal.js +62 -36
  177. package/sensor/dist/graph/traversal.js.map +1 -1
  178. package/sensor/dist/graph/type-hierarchy.d.ts +155 -0
  179. package/sensor/dist/graph/type-hierarchy.d.ts.map +1 -0
  180. package/sensor/dist/graph/type-hierarchy.js +382 -0
  181. package/sensor/dist/graph/type-hierarchy.js.map +1 -0
  182. package/sensor/dist/index.d.ts +272 -10
  183. package/sensor/dist/index.d.ts.map +1 -1
  184. package/sensor/dist/index.js +510 -34
  185. package/sensor/dist/index.js.map +1 -1
  186. package/sensor/dist/mcp/answer-freshness.d.ts +10 -0
  187. package/sensor/dist/mcp/answer-freshness.d.ts.map +1 -0
  188. package/sensor/dist/mcp/answer-freshness.js +68 -0
  189. package/sensor/dist/mcp/answer-freshness.js.map +1 -0
  190. package/sensor/dist/mcp/daemon-manager.d.ts +1 -1
  191. package/sensor/dist/mcp/daemon-manager.d.ts.map +1 -1
  192. package/sensor/dist/mcp/daemon-manager.js +17 -1
  193. package/sensor/dist/mcp/daemon-manager.js.map +1 -1
  194. package/sensor/dist/mcp/daemon-paths.d.ts +8 -0
  195. package/sensor/dist/mcp/daemon-paths.d.ts.map +1 -1
  196. package/sensor/dist/mcp/daemon-paths.js +65 -2
  197. package/sensor/dist/mcp/daemon-paths.js.map +1 -1
  198. package/sensor/dist/mcp/daemon-registry.d.ts +17 -4
  199. package/sensor/dist/mcp/daemon-registry.d.ts.map +1 -1
  200. package/sensor/dist/mcp/daemon-registry.js +133 -23
  201. package/sensor/dist/mcp/daemon-registry.js.map +1 -1
  202. package/sensor/dist/mcp/daemon.d.ts +26 -13
  203. package/sensor/dist/mcp/daemon.d.ts.map +1 -1
  204. package/sensor/dist/mcp/daemon.js +126 -32
  205. package/sensor/dist/mcp/daemon.js.map +1 -1
  206. package/sensor/dist/mcp/dynamic-boundaries.d.ts +1 -10
  207. package/sensor/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  208. package/sensor/dist/mcp/dynamic-boundaries.js +46 -42
  209. package/sensor/dist/mcp/dynamic-boundaries.js.map +1 -1
  210. package/sensor/dist/mcp/engine.d.ts +31 -9
  211. package/sensor/dist/mcp/engine.d.ts.map +1 -1
  212. package/sensor/dist/mcp/engine.js +190 -79
  213. package/sensor/dist/mcp/engine.js.map +1 -1
  214. package/sensor/dist/mcp/explore-dedup.d.ts +140 -0
  215. package/sensor/dist/mcp/explore-dedup.d.ts.map +1 -0
  216. package/sensor/dist/mcp/explore-dedup.js +239 -0
  217. package/sensor/dist/mcp/explore-dedup.js.map +1 -0
  218. package/sensor/dist/mcp/explore-diagnostics.d.ts +289 -0
  219. package/sensor/dist/mcp/explore-diagnostics.d.ts.map +1 -0
  220. package/sensor/dist/mcp/explore-diagnostics.js +558 -0
  221. package/sensor/dist/mcp/explore-diagnostics.js.map +1 -0
  222. package/sensor/dist/mcp/explore-session-state.d.ts +217 -0
  223. package/sensor/dist/mcp/explore-session-state.d.ts.map +1 -0
  224. package/sensor/dist/mcp/explore-session-state.js +322 -0
  225. package/sensor/dist/mcp/explore-session-state.js.map +1 -0
  226. package/sensor/dist/mcp/index-freshness-worker.d.ts +2 -0
  227. package/sensor/dist/mcp/index-freshness-worker.d.ts.map +1 -0
  228. package/sensor/dist/mcp/index-freshness-worker.js +30 -0
  229. package/sensor/dist/mcp/index-freshness-worker.js.map +1 -0
  230. package/sensor/dist/mcp/index-freshness.d.ts +7 -0
  231. package/sensor/dist/mcp/index-freshness.d.ts.map +1 -0
  232. package/sensor/dist/mcp/index-freshness.js +94 -0
  233. package/sensor/dist/mcp/index-freshness.js.map +1 -0
  234. package/sensor/dist/mcp/index.d.ts +3 -1
  235. package/sensor/dist/mcp/index.d.ts.map +1 -1
  236. package/sensor/dist/mcp/index.js +109 -12
  237. package/sensor/dist/mcp/index.js.map +1 -1
  238. package/sensor/dist/mcp/liveness-watchdog.d.ts +4 -1
  239. package/sensor/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  240. package/sensor/dist/mcp/liveness-watchdog.js +11 -2
  241. package/sensor/dist/mcp/liveness-watchdog.js.map +1 -1
  242. package/sensor/dist/mcp/project-lifecycle.d.ts +9 -0
  243. package/sensor/dist/mcp/project-lifecycle.d.ts.map +1 -0
  244. package/sensor/dist/mcp/project-lifecycle.js +182 -0
  245. package/sensor/dist/mcp/project-lifecycle.js.map +1 -0
  246. package/sensor/dist/mcp/proxy.d.ts.map +1 -1
  247. package/sensor/dist/mcp/proxy.js +15 -1
  248. package/sensor/dist/mcp/proxy.js.map +1 -1
  249. package/sensor/dist/mcp/query-pool.d.ts +2 -2
  250. package/sensor/dist/mcp/query-pool.d.ts.map +1 -1
  251. package/sensor/dist/mcp/query-pool.js +9 -7
  252. package/sensor/dist/mcp/query-pool.js.map +1 -1
  253. package/sensor/dist/mcp/query-worker.js +2 -2
  254. package/sensor/dist/mcp/query-worker.js.map +1 -1
  255. package/sensor/dist/mcp/server-instructions.d.ts +2 -2
  256. package/sensor/dist/mcp/server-instructions.d.ts.map +1 -1
  257. package/sensor/dist/mcp/server-instructions.js +13 -6
  258. package/sensor/dist/mcp/server-instructions.js.map +1 -1
  259. package/sensor/dist/mcp/session.d.ts +16 -0
  260. package/sensor/dist/mcp/session.d.ts.map +1 -1
  261. package/sensor/dist/mcp/session.js +36 -13
  262. package/sensor/dist/mcp/session.js.map +1 -1
  263. package/sensor/dist/mcp/startup-handshake.d.ts +3 -1
  264. package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -1
  265. package/sensor/dist/mcp/startup-handshake.js +10 -2
  266. package/sensor/dist/mcp/startup-handshake.js.map +1 -1
  267. package/sensor/dist/mcp/tools.d.ts +496 -38
  268. package/sensor/dist/mcp/tools.d.ts.map +1 -1
  269. package/sensor/dist/mcp/tools.js +4021 -772
  270. package/sensor/dist/mcp/tools.js.map +1 -1
  271. package/sensor/dist/mcp/writer-lock.d.ts +61 -0
  272. package/sensor/dist/mcp/writer-lock.d.ts.map +1 -0
  273. package/sensor/dist/mcp/writer-lock.js +260 -0
  274. package/sensor/dist/mcp/writer-lock.js.map +1 -0
  275. package/sensor/dist/project-config.d.ts +23 -0
  276. package/sensor/dist/project-config.d.ts.map +1 -1
  277. package/sensor/dist/project-config.js +39 -2
  278. package/sensor/dist/project-config.js.map +1 -1
  279. package/sensor/dist/resolution/alias-binding.d.ts +56 -0
  280. package/sensor/dist/resolution/alias-binding.d.ts.map +1 -0
  281. package/sensor/dist/resolution/alias-binding.js +127 -0
  282. package/sensor/dist/resolution/alias-binding.js.map +1 -0
  283. package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  284. package/sensor/dist/resolution/c-fnptr-synthesizer.js +21 -19
  285. package/sensor/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  286. package/sensor/dist/resolution/callback-synthesizer.d.ts +23 -1
  287. package/sensor/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  288. package/sensor/dist/resolution/callback-synthesizer.js +356 -155
  289. package/sensor/dist/resolution/callback-synthesizer.js.map +1 -1
  290. package/sensor/dist/resolution/cpp-constructor.d.ts +4 -0
  291. package/sensor/dist/resolution/cpp-constructor.d.ts.map +1 -0
  292. package/sensor/dist/resolution/cpp-constructor.js +123 -0
  293. package/sensor/dist/resolution/cpp-constructor.js.map +1 -0
  294. package/sensor/dist/resolution/cpp-macro-visibility.d.ts +12 -0
  295. package/sensor/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
  296. package/sensor/dist/resolution/cpp-macro-visibility.js +342 -0
  297. package/sensor/dist/resolution/cpp-macro-visibility.js.map +1 -0
  298. package/sensor/dist/resolution/expo-router-synthesizer.d.ts +32 -0
  299. package/sensor/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
  300. package/sensor/dist/resolution/expo-router-synthesizer.js +189 -0
  301. package/sensor/dist/resolution/expo-router-synthesizer.js.map +1 -0
  302. package/sensor/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  303. package/sensor/dist/resolution/frameworks/csharp.js +96 -2
  304. package/sensor/dist/resolution/frameworks/csharp.js.map +1 -1
  305. package/sensor/dist/resolution/frameworks/expo-router.d.ts +189 -0
  306. package/sensor/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
  307. package/sensor/dist/resolution/frameworks/expo-router.js +785 -0
  308. package/sensor/dist/resolution/frameworks/expo-router.js.map +1 -0
  309. package/sensor/dist/resolution/frameworks/express.d.ts.map +1 -1
  310. package/sensor/dist/resolution/frameworks/express.js +251 -16
  311. package/sensor/dist/resolution/frameworks/express.js.map +1 -1
  312. package/sensor/dist/resolution/frameworks/index.d.ts +5 -0
  313. package/sensor/dist/resolution/frameworks/index.d.ts.map +1 -1
  314. package/sensor/dist/resolution/frameworks/index.js +29 -1
  315. package/sensor/dist/resolution/frameworks/index.js.map +1 -1
  316. package/sensor/dist/resolution/frameworks/java.d.ts.map +1 -1
  317. package/sensor/dist/resolution/frameworks/java.js +79 -47
  318. package/sensor/dist/resolution/frameworks/java.js.map +1 -1
  319. package/sensor/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  320. package/sensor/dist/resolution/frameworks/laravel.js +294 -4
  321. package/sensor/dist/resolution/frameworks/laravel.js.map +1 -1
  322. package/sensor/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  323. package/sensor/dist/resolution/frameworks/nestjs.js +6 -14
  324. package/sensor/dist/resolution/frameworks/nestjs.js.map +1 -1
  325. package/sensor/dist/resolution/frameworks/nextjs.d.ts +76 -0
  326. package/sensor/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
  327. package/sensor/dist/resolution/frameworks/nextjs.js +328 -0
  328. package/sensor/dist/resolution/frameworks/nextjs.js.map +1 -0
  329. package/sensor/dist/resolution/frameworks/object-literal.d.ts +32 -0
  330. package/sensor/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
  331. package/sensor/dist/resolution/frameworks/object-literal.js +139 -0
  332. package/sensor/dist/resolution/frameworks/object-literal.js.map +1 -0
  333. package/sensor/dist/resolution/frameworks/package-deps.d.ts +14 -0
  334. package/sensor/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
  335. package/sensor/dist/resolution/frameworks/package-deps.js +78 -0
  336. package/sensor/dist/resolution/frameworks/package-deps.js.map +1 -0
  337. package/sensor/dist/resolution/frameworks/python.d.ts.map +1 -1
  338. package/sensor/dist/resolution/frameworks/python.js +166 -0
  339. package/sensor/dist/resolution/frameworks/python.js.map +1 -1
  340. package/sensor/dist/resolution/frameworks/react-native.d.ts +26 -0
  341. package/sensor/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  342. package/sensor/dist/resolution/frameworks/react-native.js +153 -14
  343. package/sensor/dist/resolution/frameworks/react-native.js.map +1 -1
  344. package/sensor/dist/resolution/frameworks/react-router.d.ts +46 -0
  345. package/sensor/dist/resolution/frameworks/react-router.d.ts.map +1 -0
  346. package/sensor/dist/resolution/frameworks/react-router.js +187 -0
  347. package/sensor/dist/resolution/frameworks/react-router.js.map +1 -0
  348. package/sensor/dist/resolution/frameworks/react.d.ts +2 -1
  349. package/sensor/dist/resolution/frameworks/react.d.ts.map +1 -1
  350. package/sensor/dist/resolution/frameworks/react.js +188 -139
  351. package/sensor/dist/resolution/frameworks/react.js.map +1 -1
  352. package/sensor/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  353. package/sensor/dist/resolution/frameworks/svelte.js +6 -1
  354. package/sensor/dist/resolution/frameworks/svelte.js.map +1 -1
  355. package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
  356. package/sensor/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
  357. package/sensor/dist/resolution/frameworks/sveltekit-router.js +156 -0
  358. package/sensor/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
  359. package/sensor/dist/resolution/frameworks/swift.d.ts.map +1 -1
  360. package/sensor/dist/resolution/frameworks/swift.js +140 -99
  361. package/sensor/dist/resolution/frameworks/swift.js.map +1 -1
  362. package/sensor/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
  363. package/sensor/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
  364. package/sensor/dist/resolution/frameworks/tanstack-router.js +437 -0
  365. package/sensor/dist/resolution/frameworks/tanstack-router.js.map +1 -0
  366. package/sensor/dist/resolution/frameworks/vue-router.d.ts +82 -0
  367. package/sensor/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
  368. package/sensor/dist/resolution/frameworks/vue-router.js +377 -0
  369. package/sensor/dist/resolution/frameworks/vue-router.js.map +1 -0
  370. package/sensor/dist/resolution/import-resolver.d.ts +38 -0
  371. package/sensor/dist/resolution/import-resolver.d.ts.map +1 -1
  372. package/sensor/dist/resolution/import-resolver.js +394 -28
  373. package/sensor/dist/resolution/import-resolver.js.map +1 -1
  374. package/sensor/dist/resolution/index.d.ts +89 -25
  375. package/sensor/dist/resolution/index.d.ts.map +1 -1
  376. package/sensor/dist/resolution/index.js +573 -148
  377. package/sensor/dist/resolution/index.js.map +1 -1
  378. package/sensor/dist/resolution/js-builtins.d.ts +13 -0
  379. package/sensor/dist/resolution/js-builtins.d.ts.map +1 -0
  380. package/sensor/dist/resolution/js-builtins.js +46 -0
  381. package/sensor/dist/resolution/js-builtins.js.map +1 -0
  382. package/sensor/dist/resolution/name-matcher.d.ts +99 -22
  383. package/sensor/dist/resolution/name-matcher.d.ts.map +1 -1
  384. package/sensor/dist/resolution/name-matcher.js +2220 -86
  385. package/sensor/dist/resolution/name-matcher.js.map +1 -1
  386. package/sensor/dist/resolution/next-router-synthesizer.d.ts +27 -0
  387. package/sensor/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
  388. package/sensor/dist/resolution/next-router-synthesizer.js +113 -0
  389. package/sensor/dist/resolution/next-router-synthesizer.js.map +1 -0
  390. package/sensor/dist/resolution/path-aliases.d.ts +6 -4
  391. package/sensor/dist/resolution/path-aliases.d.ts.map +1 -1
  392. package/sensor/dist/resolution/path-aliases.js +125 -17
  393. package/sensor/dist/resolution/path-aliases.js.map +1 -1
  394. package/sensor/dist/resolution/react-router-synthesizer.d.ts +33 -0
  395. package/sensor/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
  396. package/sensor/dist/resolution/react-router-synthesizer.js +126 -0
  397. package/sensor/dist/resolution/react-router-synthesizer.js.map +1 -0
  398. package/sensor/dist/resolution/resolver-pool.d.ts +2 -0
  399. package/sensor/dist/resolution/resolver-pool.d.ts.map +1 -1
  400. package/sensor/dist/resolution/resolver-pool.js +4 -0
  401. package/sensor/dist/resolution/resolver-pool.js.map +1 -1
  402. package/sensor/dist/resolution/strip-comments.d.ts +6 -0
  403. package/sensor/dist/resolution/strip-comments.d.ts.map +1 -1
  404. package/sensor/dist/resolution/strip-comments.js +58 -0
  405. package/sensor/dist/resolution/strip-comments.js.map +1 -1
  406. package/sensor/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
  407. package/sensor/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
  408. package/sensor/dist/resolution/sveltekit-synthesizer.js +173 -0
  409. package/sensor/dist/resolution/sveltekit-synthesizer.js.map +1 -0
  410. package/sensor/dist/resolution/swift-type-visibility.d.ts +52 -0
  411. package/sensor/dist/resolution/swift-type-visibility.d.ts.map +1 -0
  412. package/sensor/dist/resolution/swift-type-visibility.js +328 -0
  413. package/sensor/dist/resolution/swift-type-visibility.js.map +1 -0
  414. package/sensor/dist/resolution/synth-utils.d.ts +26 -0
  415. package/sensor/dist/resolution/synth-utils.d.ts.map +1 -0
  416. package/sensor/dist/resolution/synth-utils.js +75 -0
  417. package/sensor/dist/resolution/synth-utils.js.map +1 -0
  418. package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
  419. package/sensor/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
  420. package/sensor/dist/resolution/tanstack-router-synthesizer.js +114 -0
  421. package/sensor/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
  422. package/sensor/dist/resolution/tier-synthesizer.d.ts +54 -0
  423. package/sensor/dist/resolution/tier-synthesizer.d.ts.map +1 -0
  424. package/sensor/dist/resolution/tier-synthesizer.js +1294 -0
  425. package/sensor/dist/resolution/tier-synthesizer.js.map +1 -0
  426. package/sensor/dist/resolution/types.d.ts +78 -2
  427. package/sensor/dist/resolution/types.d.ts.map +1 -1
  428. package/sensor/dist/resolution/types.js +64 -0
  429. package/sensor/dist/resolution/types.js.map +1 -1
  430. package/sensor/dist/resolution/vue-router-synthesizer.d.ts +30 -0
  431. package/sensor/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
  432. package/sensor/dist/resolution/vue-router-synthesizer.js +115 -0
  433. package/sensor/dist/resolution/vue-router-synthesizer.js.map +1 -0
  434. package/sensor/dist/search/identifier-segments.d.ts +10 -0
  435. package/sensor/dist/search/identifier-segments.d.ts.map +1 -1
  436. package/sensor/dist/search/identifier-segments.js +29 -0
  437. package/sensor/dist/search/identifier-segments.js.map +1 -1
  438. package/sensor/dist/search/query-paths.d.ts +106 -0
  439. package/sensor/dist/search/query-paths.d.ts.map +1 -0
  440. package/sensor/dist/search/query-paths.js +513 -0
  441. package/sensor/dist/search/query-paths.js.map +1 -0
  442. package/sensor/dist/search/query-utils.d.ts +22 -2
  443. package/sensor/dist/search/query-utils.d.ts.map +1 -1
  444. package/sensor/dist/search/query-utils.js +56 -16
  445. package/sensor/dist/search/query-utils.js.map +1 -1
  446. package/sensor/dist/sync/watch-policy.d.ts +14 -0
  447. package/sensor/dist/sync/watch-policy.d.ts.map +1 -1
  448. package/sensor/dist/sync/watch-policy.js +19 -0
  449. package/sensor/dist/sync/watch-policy.js.map +1 -1
  450. package/sensor/dist/sync/watcher.d.ts +74 -35
  451. package/sensor/dist/sync/watcher.d.ts.map +1 -1
  452. package/sensor/dist/sync/watcher.js +281 -99
  453. package/sensor/dist/sync/watcher.js.map +1 -1
  454. package/sensor/dist/telemetry/index.d.ts +4 -2
  455. package/sensor/dist/telemetry/index.d.ts.map +1 -1
  456. package/sensor/dist/telemetry/index.js +92 -41
  457. package/sensor/dist/telemetry/index.js.map +1 -1
  458. package/sensor/dist/types.d.ts +18 -2
  459. package/sensor/dist/types.d.ts.map +1 -1
  460. package/sensor/dist/types.js +2 -0
  461. package/sensor/dist/types.js.map +1 -1
  462. package/sensor/dist/ui-server/api/deadcode.d.ts +84 -0
  463. package/sensor/dist/ui-server/api/deadcode.d.ts.map +1 -0
  464. package/sensor/dist/ui-server/api/deadcode.js +136 -0
  465. package/sensor/dist/ui-server/api/deadcode.js.map +1 -0
  466. package/sensor/dist/ui-server/api/effects.d.ts +94 -0
  467. package/sensor/dist/ui-server/api/effects.d.ts.map +1 -0
  468. package/sensor/dist/ui-server/api/effects.js +527 -0
  469. package/sensor/dist/ui-server/api/effects.js.map +1 -0
  470. package/sensor/dist/ui-server/api/entrypoints.d.ts +92 -0
  471. package/sensor/dist/ui-server/api/entrypoints.d.ts.map +1 -0
  472. package/sensor/dist/ui-server/api/entrypoints.js +361 -0
  473. package/sensor/dist/ui-server/api/entrypoints.js.map +1 -0
  474. package/sensor/dist/ui-server/api/events.d.ts +183 -0
  475. package/sensor/dist/ui-server/api/events.d.ts.map +1 -0
  476. package/sensor/dist/ui-server/api/events.js +430 -0
  477. package/sensor/dist/ui-server/api/events.js.map +1 -0
  478. package/sensor/dist/ui-server/api/file.d.ts +66 -0
  479. package/sensor/dist/ui-server/api/file.d.ts.map +1 -0
  480. package/sensor/dist/ui-server/api/file.js +235 -0
  481. package/sensor/dist/ui-server/api/file.js.map +1 -0
  482. package/sensor/dist/ui-server/api/filecode.d.ts +126 -0
  483. package/sensor/dist/ui-server/api/filecode.d.ts.map +1 -0
  484. package/sensor/dist/ui-server/api/filecode.js +205 -0
  485. package/sensor/dist/ui-server/api/filecode.js.map +1 -0
  486. package/sensor/dist/ui-server/api/flow.d.ts +226 -0
  487. package/sensor/dist/ui-server/api/flow.d.ts.map +1 -0
  488. package/sensor/dist/ui-server/api/flow.js +612 -0
  489. package/sensor/dist/ui-server/api/flow.js.map +1 -0
  490. package/sensor/dist/ui-server/api/hierarchy.d.ts +81 -0
  491. package/sensor/dist/ui-server/api/hierarchy.d.ts.map +1 -0
  492. package/sensor/dist/ui-server/api/hierarchy.js +92 -0
  493. package/sensor/dist/ui-server/api/hierarchy.js.map +1 -0
  494. package/sensor/dist/ui-server/api/index.d.ts +90 -0
  495. package/sensor/dist/ui-server/api/index.d.ts.map +1 -0
  496. package/sensor/dist/ui-server/api/index.js +332 -0
  497. package/sensor/dist/ui-server/api/index.js.map +1 -0
  498. package/sensor/dist/ui-server/api/map.d.ts +256 -0
  499. package/sensor/dist/ui-server/api/map.d.ts.map +1 -0
  500. package/sensor/dist/ui-server/api/map.js +760 -0
  501. package/sensor/dist/ui-server/api/map.js.map +1 -0
  502. package/sensor/dist/ui-server/api/node.d.ts +81 -0
  503. package/sensor/dist/ui-server/api/node.d.ts.map +1 -0
  504. package/sensor/dist/ui-server/api/node.js +388 -0
  505. package/sensor/dist/ui-server/api/node.js.map +1 -0
  506. package/sensor/dist/ui-server/api/nodes.d.ts +25 -0
  507. package/sensor/dist/ui-server/api/nodes.d.ts.map +1 -0
  508. package/sensor/dist/ui-server/api/nodes.js +45 -0
  509. package/sensor/dist/ui-server/api/nodes.js.map +1 -0
  510. package/sensor/dist/ui-server/api/program.d.ts +139 -0
  511. package/sensor/dist/ui-server/api/program.d.ts.map +1 -0
  512. package/sensor/dist/ui-server/api/program.js +315 -0
  513. package/sensor/dist/ui-server/api/program.js.map +1 -0
  514. package/sensor/dist/ui-server/api/respond.d.ts +76 -0
  515. package/sensor/dist/ui-server/api/respond.d.ts.map +1 -0
  516. package/sensor/dist/ui-server/api/respond.js +186 -0
  517. package/sensor/dist/ui-server/api/respond.js.map +1 -0
  518. package/sensor/dist/ui-server/api/route-roots.d.ts +39 -0
  519. package/sensor/dist/ui-server/api/route-roots.d.ts.map +1 -0
  520. package/sensor/dist/ui-server/api/route-roots.js +96 -0
  521. package/sensor/dist/ui-server/api/route-roots.js.map +1 -0
  522. package/sensor/dist/ui-server/api/routes.d.ts +59 -0
  523. package/sensor/dist/ui-server/api/routes.d.ts.map +1 -0
  524. package/sensor/dist/ui-server/api/routes.js +108 -0
  525. package/sensor/dist/ui-server/api/routes.js.map +1 -0
  526. package/sensor/dist/ui-server/api/screens.d.ts +117 -0
  527. package/sensor/dist/ui-server/api/screens.d.ts.map +1 -0
  528. package/sensor/dist/ui-server/api/screens.js +611 -0
  529. package/sensor/dist/ui-server/api/screens.js.map +1 -0
  530. package/sensor/dist/ui-server/api/search.d.ts +29 -0
  531. package/sensor/dist/ui-server/api/search.d.ts.map +1 -0
  532. package/sensor/dist/ui-server/api/search.js +232 -0
  533. package/sensor/dist/ui-server/api/search.js.map +1 -0
  534. package/sensor/dist/ui-server/api/session.d.ts +52 -0
  535. package/sensor/dist/ui-server/api/session.d.ts.map +1 -0
  536. package/sensor/dist/ui-server/api/session.js +196 -0
  537. package/sensor/dist/ui-server/api/session.js.map +1 -0
  538. package/sensor/dist/ui-server/api/source.d.ts +200 -0
  539. package/sensor/dist/ui-server/api/source.d.ts.map +1 -0
  540. package/sensor/dist/ui-server/api/source.js +422 -0
  541. package/sensor/dist/ui-server/api/source.js.map +1 -0
  542. package/sensor/dist/ui-server/api/stats.d.ts +27 -0
  543. package/sensor/dist/ui-server/api/stats.d.ts.map +1 -0
  544. package/sensor/dist/ui-server/api/stats.js +164 -0
  545. package/sensor/dist/ui-server/api/stats.js.map +1 -0
  546. package/sensor/dist/ui-server/api/steps.d.ts +274 -0
  547. package/sensor/dist/ui-server/api/steps.d.ts.map +1 -0
  548. package/sensor/dist/ui-server/api/steps.js +1544 -0
  549. package/sensor/dist/ui-server/api/steps.js.map +1 -0
  550. package/sensor/dist/ui-server/api/trail-store.d.ts +142 -0
  551. package/sensor/dist/ui-server/api/trail-store.d.ts.map +1 -0
  552. package/sensor/dist/ui-server/api/trail-store.js +325 -0
  553. package/sensor/dist/ui-server/api/trail-store.js.map +1 -0
  554. package/sensor/dist/ui-server/api/trails.d.ts +163 -0
  555. package/sensor/dist/ui-server/api/trails.d.ts.map +1 -0
  556. package/sensor/dist/ui-server/api/trails.js +369 -0
  557. package/sensor/dist/ui-server/api/trails.js.map +1 -0
  558. package/sensor/dist/ui-server/api/when.d.ts +133 -0
  559. package/sensor/dist/ui-server/api/when.d.ts.map +1 -0
  560. package/sensor/dist/ui-server/api/when.js +275 -0
  561. package/sensor/dist/ui-server/api/when.js.map +1 -0
  562. package/sensor/dist/ui-server/api/wire.d.ts +179 -0
  563. package/sensor/dist/ui-server/api/wire.d.ts.map +1 -0
  564. package/sensor/dist/ui-server/api/wire.js +231 -0
  565. package/sensor/dist/ui-server/api/wire.js.map +1 -0
  566. package/sensor/dist/ui-server/assets.d.ts +40 -0
  567. package/sensor/dist/ui-server/assets.d.ts.map +1 -0
  568. package/sensor/dist/ui-server/assets.js +110 -0
  569. package/sensor/dist/ui-server/assets.js.map +1 -0
  570. package/sensor/dist/ui-server/constants.d.ts +32 -0
  571. package/sensor/dist/ui-server/constants.d.ts.map +1 -0
  572. package/sensor/dist/ui-server/constants.js +35 -0
  573. package/sensor/dist/ui-server/constants.js.map +1 -0
  574. package/sensor/dist/ui-server/highlight/index.d.ts +113 -0
  575. package/sensor/dist/ui-server/highlight/index.d.ts.map +1 -0
  576. package/sensor/dist/ui-server/highlight/index.js +307 -0
  577. package/sensor/dist/ui-server/highlight/index.js.map +1 -0
  578. package/sensor/dist/ui-server/highlight/languages.d.ts +36 -0
  579. package/sensor/dist/ui-server/highlight/languages.d.ts.map +1 -0
  580. package/sensor/dist/ui-server/highlight/languages.js +50 -0
  581. package/sensor/dist/ui-server/highlight/languages.js.map +1 -0
  582. package/sensor/dist/ui-server/index.d.ts +92 -0
  583. package/sensor/dist/ui-server/index.d.ts.map +1 -0
  584. package/sensor/dist/ui-server/index.js +399 -0
  585. package/sensor/dist/ui-server/index.js.map +1 -0
  586. package/sensor/dist/ui-server/open-browser.d.ts +31 -0
  587. package/sensor/dist/ui-server/open-browser.d.ts.map +1 -0
  588. package/sensor/dist/ui-server/open-browser.js +79 -0
  589. package/sensor/dist/ui-server/open-browser.js.map +1 -0
  590. package/sensor/dist/ui-server/security.d.ts +127 -0
  591. package/sensor/dist/ui-server/security.d.ts.map +1 -0
  592. package/sensor/dist/ui-server/security.js +332 -0
  593. package/sensor/dist/ui-server/security.js.map +1 -0
  594. package/sensor/dist/ui-server/static.d.ts +45 -0
  595. package/sensor/dist/ui-server/static.d.ts.map +1 -0
  596. package/sensor/dist/ui-server/static.js +165 -0
  597. package/sensor/dist/ui-server/static.js.map +1 -0
  598. package/sensor/dist/utils.d.ts +14 -2
  599. package/sensor/dist/utils.d.ts.map +1 -1
  600. package/sensor/dist/utils.js +25 -10
  601. package/sensor/dist/utils.js.map +1 -1
  602. package/src/sensor-adapter.mjs +5 -1
@@ -0,0 +1,106 @@
1
+ /**
2
+ * File-path recognition for explore queries.
3
+ *
4
+ * Agents routinely name files by path in a `lattice_sensor_explore` query —
5
+ * "the scroll logic in src/routes/m/projects/[id]/runs/[runId]/+page.svelte" —
6
+ * and until this module existed those spans were SHREDDED by the downstream
7
+ * tokenizers instead of being read as file references:
8
+ *
9
+ * - the named-symbol seeder splits on `[\s,()[\]]+`, so SvelteKit/Next
10
+ * bracketed segments (`[id]`, `[runId]`) and route groups (`(protected)`)
11
+ * exploded the path into fragments; the identifier-shaped survivors
12
+ * (`runId`, `scope`) then seeded as "symbols the agent named" and
13
+ * headlined the blast radius;
14
+ * - FTS saw the fragments (`page`, `chat`, `runs`) and admitted every
15
+ * sibling `+page.svelte` in the repo, which ate the output envelope and
16
+ * truncated the files the agent actually asked for.
17
+ *
18
+ * `extractQueryPaths` finds path-like spans — slashed paths, dotted basenames,
19
+ * and extension-less kebab basenames (`background-image-table`, the spelling
20
+ * import paths and prose actually use) — resolves them against the INDEXED
21
+ * file list (resolution IS the detector — `and/or`, `gen_server:call/2`,
22
+ * `non-blocking` and other path-shaped non-paths match nothing and are left
23
+ * alone), and returns the matches as pinned files plus the query with those
24
+ * spans removed.
25
+ * Callers treat pinned files as first-class: guaranteed admission, top rank,
26
+ * funded first. Pure string work — no DB, no fs — so it is trivially testable
27
+ * and safe inside the query-pool workers. The one question string shape cannot
28
+ * answer (is this dotless slashed span, `scripts/deploy`, a real file that is
29
+ * merely unindexed, or is it prose like `and/or`?) is delegated to an OPTIONAL
30
+ * `existsOnDisk` predicate the caller injects — the fs access stays at the call
31
+ * site, which owns the project root, and this module stays pure.
32
+ */
33
+ export interface QueryPathExtraction {
34
+ /** The query with resolved/clearly-path spans removed, whitespace-joined. */
35
+ strippedQuery: string;
36
+ /** Indexed file paths the query named, appearance-ordered, deduped. */
37
+ pinnedFiles: string[];
38
+ /**
39
+ * Spans that are unambiguously path-shaped but resolved to nothing (stale
40
+ * path, unindexed file) or to too many files (bare `+page.svelte`). Stripped
41
+ * from the query — their fragments could only mint junk matches — and
42
+ * surfaced to the agent so the miss is visible instead of silent.
43
+ */
44
+ unresolvedPathSpans: string[];
45
+ /**
46
+ * Line spans the query anchored to a pinned file, 1-based and inclusive:
47
+ * `compiler.py:776`, `foo.ts:12-40`, `foo.ts#L88-L120`, or prose next to a
48
+ * path (`compiler.py lines 900-1003`, `L900-L1003 of compiler.py`). An agent
49
+ * writes these when it wants THOSE lines — typically the body a previous
50
+ * response elided — so a pin that drops them answers a different question
51
+ * (the file's most relevant clusters) than the one asked. Only a span whose
52
+ * path resolved to exactly one file is kept: a line number means nothing
53
+ * across two candidate files.
54
+ */
55
+ lineAnchors: QueryLineAnchor[];
56
+ /**
57
+ * Files a span matched but did NOT pin: the span named several files, some
58
+ * of which define a symbol the query also names, and these define none.
59
+ * Surfaced so a set-aside file is visible, not silently dropped.
60
+ */
61
+ setAsideMatches: QuerySetAsideMatch[];
62
+ }
63
+ export interface QuerySetAsideMatch {
64
+ /** The span as the query wrote it, normalized (`editorOptions.ts`). */
65
+ span: string;
66
+ files: string[];
67
+ }
68
+ export interface QueryLineAnchor {
69
+ file: string;
70
+ start: number;
71
+ end: number;
72
+ }
73
+ /**
74
+ * Cheap pre-gate so callers only fetch the indexed file list when the query
75
+ * could possibly contain a path: a slash, a dot-extension-shaped tail
76
+ * (`chat-manager.ts`), or a hyphen-joined word (`background-image-table` —
77
+ * kebab files are named WITHOUT their extension more often than with, so the
78
+ * shape must open the gate on its own). Extensions cap at 8 chars, which
79
+ * keeps `Class.method` spans (`app.isPackaged`) from qualifying; the kebab
80
+ * alternative requires clean non-word boundaries, which keeps `--flags` and
81
+ * snake_case-with-a-dash hybrids from firing it.
82
+ */
83
+ export declare function queryMightContainPaths(query: string): boolean;
84
+ export declare function extractQueryPaths(query: string, indexedPaths: readonly string[], opts?: {
85
+ maxPins?: number;
86
+ maxMatchesPerSpan?: number;
87
+ /**
88
+ * Does this repo-relative span name a real FILE in the project? Optional,
89
+ * injected by the caller (see the module docstring): it is the only way to
90
+ * tell a dotless path the index simply doesn't hold (`scripts/deploy`)
91
+ * from slashed prose (`and/or`), and it must stay out of this module.
92
+ * Must not throw — the caller absorbs fs errors and returns false.
93
+ */
94
+ existsOnDisk?: (relPath: string) => boolean;
95
+ /**
96
+ * Which indexed files define a symbol spelled like this query token
97
+ * (`clampedInt`, `SQLCompiler.as_sql`)? Optional, injected by the caller
98
+ * for the same reason as `existsOnDisk`: the answer lives in the index,
99
+ * and this module stays DB-free. Consulted only when a span matches
100
+ * several files (a basename two directories share): the matches that
101
+ * define a symbol the query also names are pinned, the rest set aside.
102
+ * Must not throw — the caller absorbs lookup errors and returns nothing.
103
+ */
104
+ symbolFiles?: (symbol: string) => Iterable<string>;
105
+ }): QueryPathExtraction;
106
+ //# sourceMappingURL=query-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-paths.d.ts","sourceRoot":"","sources":["../../src/search/query-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,aAAa,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;OAKG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B;;;;;;;;;OASG;IACH,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B;;;;OAIG;IACH,eAAe,EAAE,kBAAkB,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI7D;AA2MD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,IAAI,GAAE;IACJ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC/C,GACL,mBAAmB,CA6NrB"}
@@ -0,0 +1,513 @@
1
+ "use strict";
2
+ /**
3
+ * File-path recognition for explore queries.
4
+ *
5
+ * Agents routinely name files by path in a `lattice_sensor_explore` query —
6
+ * "the scroll logic in src/routes/m/projects/[id]/runs/[runId]/+page.svelte" —
7
+ * and until this module existed those spans were SHREDDED by the downstream
8
+ * tokenizers instead of being read as file references:
9
+ *
10
+ * - the named-symbol seeder splits on `[\s,()[\]]+`, so SvelteKit/Next
11
+ * bracketed segments (`[id]`, `[runId]`) and route groups (`(protected)`)
12
+ * exploded the path into fragments; the identifier-shaped survivors
13
+ * (`runId`, `scope`) then seeded as "symbols the agent named" and
14
+ * headlined the blast radius;
15
+ * - FTS saw the fragments (`page`, `chat`, `runs`) and admitted every
16
+ * sibling `+page.svelte` in the repo, which ate the output envelope and
17
+ * truncated the files the agent actually asked for.
18
+ *
19
+ * `extractQueryPaths` finds path-like spans — slashed paths, dotted basenames,
20
+ * and extension-less kebab basenames (`background-image-table`, the spelling
21
+ * import paths and prose actually use) — resolves them against the INDEXED
22
+ * file list (resolution IS the detector — `and/or`, `gen_server:call/2`,
23
+ * `non-blocking` and other path-shaped non-paths match nothing and are left
24
+ * alone), and returns the matches as pinned files plus the query with those
25
+ * spans removed.
26
+ * Callers treat pinned files as first-class: guaranteed admission, top rank,
27
+ * funded first. Pure string work — no DB, no fs — so it is trivially testable
28
+ * and safe inside the query-pool workers. The one question string shape cannot
29
+ * answer (is this dotless slashed span, `scripts/deploy`, a real file that is
30
+ * merely unindexed, or is it prose like `and/or`?) is delegated to an OPTIONAL
31
+ * `existsOnDisk` predicate the caller injects — the fs access stays at the call
32
+ * site, which owns the project root, and this module stays pure.
33
+ */
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.queryMightContainPaths = queryMightContainPaths;
36
+ exports.extractQueryPaths = extractQueryPaths;
37
+ /**
38
+ * Cheap pre-gate so callers only fetch the indexed file list when the query
39
+ * could possibly contain a path: a slash, a dot-extension-shaped tail
40
+ * (`chat-manager.ts`), or a hyphen-joined word (`background-image-table` —
41
+ * kebab files are named WITHOUT their extension more often than with, so the
42
+ * shape must open the gate on its own). Extensions cap at 8 chars, which
43
+ * keeps `Class.method` spans (`app.isPackaged`) from qualifying; the kebab
44
+ * alternative requires clean non-word boundaries, which keeps `--flags` and
45
+ * snake_case-with-a-dash hybrids from firing it.
46
+ */
47
+ function queryMightContainPaths(query) {
48
+ return /[/\\]/.test(query)
49
+ || /\.[A-Za-z][A-Za-z0-9]{0,7}(?=[\s,;:)\]'"`]|$)/.test(query)
50
+ || /(?:^|[^-\w])[A-Za-z0-9]+(?:-[A-Za-z0-9]+)+(?=[^-\w]|$)/.test(query);
51
+ }
52
+ /**
53
+ * Longest span→suffix walk tried per span. 8 covers an absolute macOS path
54
+ * (`/Users/<user>/dev/<repo>/…`) over a deeply nested repo-relative file;
55
+ * deeper prefixes buy nothing.
56
+ */
57
+ const MAX_SUFFIX_TRIES = 8;
58
+ /** Spans examined per query — a prose sentence is not 50 paths. */
59
+ const MAX_CANDIDATE_SPANS = 8;
60
+ /** `name.ext` shape with a plausible source extension (no slash required). */
61
+ const DOTTED_BASENAME = /^[^\s/\\]+\.[A-Za-z][A-Za-z0-9]{0,7}$/;
62
+ /**
63
+ * Extension-less kebab basename (`background-image-table`). Hyphens are
64
+ * illegal in identifiers, so consuming these tokens can never steal one from
65
+ * the named-symbol seeder; ≥2 segments keeps single words out.
66
+ */
67
+ const KEBAB_BASENAME = /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)+$/;
68
+ /** A basename's last dot-extension, same shape DOTTED_BASENAME accepts. */
69
+ const LAST_EXTENSION = /\.[A-Za-z][A-Za-z0-9]{0,7}$/;
70
+ /**
71
+ * A query token that names a symbol, in the shape explore's named-symbol
72
+ * seeder reads: `clampedInt`, `SQLCompiler.as_sql`, `Engine::ServeHTTP`.
73
+ */
74
+ const SYMBOL_TOKEN = /^[A-Za-z_$][\w$]*(?:(?:::|\.)[\w$]+)*$/;
75
+ /** Symbol tokens consulted per query — the seeder's cap. */
76
+ const MAX_SYMBOL_TOKENS = 16;
77
+ /**
78
+ * The seeder's NL-stopword test: camelCase, PascalCase, snake_case, `$` and
79
+ * qualified tokens are unmistakably code. A bare lowercase word (`options`,
80
+ * `render`) is also English, and a file defining one proves nothing about
81
+ * which same-named file the agent meant.
82
+ */
83
+ function isPreciseSymbolToken(t) {
84
+ return /[._$]|::/.test(t) || /[a-z][A-Z]/.test(t) || /^[A-Z]/.test(t);
85
+ }
86
+ /**
87
+ * The precise symbol tokens a query names, excluding the files it names
88
+ * (`editorOptions.ts` is identifier-shaped too). Split on the same brackets
89
+ * the seeder splits on, so `clampedInt()` still counts.
90
+ */
91
+ function querySymbolTokens(tokens, indexedBasenames) {
92
+ const out = new Set();
93
+ for (const raw of tokens) {
94
+ for (const part of raw.split(/[,()[\]{}]+/)) {
95
+ const t = part.replace(/^['"`<]+/, '').replace(/['"`>.,;:!?]+$/, '');
96
+ if (t.length < 3 || !SYMBOL_TOKEN.test(t) || !isPreciseSymbolToken(t))
97
+ continue;
98
+ if (indexedBasenames.has(t.toLowerCase()))
99
+ continue;
100
+ out.add(t);
101
+ if (out.size >= MAX_SYMBOL_TOKENS)
102
+ return [...out];
103
+ }
104
+ }
105
+ return [...out];
106
+ }
107
+ /**
108
+ * Lowercased basename stems of the hyphen-named indexed files, stem → paths.
109
+ * A stem drops only the LAST extension (`a-b.module.scss` → `a-b.module`), so
110
+ * a bare kebab token can't accidentally pin a same-named stylesheet or
111
+ * `.d.ts` sibling of the source file it names; an extension-less basename
112
+ * (`pre-commit`) is its own stem. Hyphen-free basenames are skipped — a
113
+ * KEBAB_BASENAME token can never equal one, and the filter keeps the map
114
+ * near-empty in repos that don't name files this way.
115
+ */
116
+ function buildBasenameStems(indexedPaths) {
117
+ const stems = new Map();
118
+ for (const p of indexedPaths) {
119
+ const basename = p.slice(Math.max(p.lastIndexOf('/'), p.lastIndexOf('\\')) + 1);
120
+ if (!basename.includes('-'))
121
+ continue;
122
+ const stem = basename.replace(LAST_EXTENSION, '').toLowerCase();
123
+ if (!stem)
124
+ continue;
125
+ const existing = stems.get(stem);
126
+ if (existing)
127
+ existing.push(p);
128
+ else
129
+ stems.set(stem, [p]);
130
+ }
131
+ return stems;
132
+ }
133
+ /**
134
+ * Line references that ride along in agent-written paths: `foo.ts:123`,
135
+ * `foo.ts:12-40`, `foo.ts#L88`, `foo.ts#L88-L120`.
136
+ */
137
+ const LINE_REF_SUFFIX = /(?::(\d+)(?:-(\d+))?|#L(\d+)(?:-L?(\d+))?)$/;
138
+ /**
139
+ * A standalone line-number token: `900`, `900-1003`, `900–1003`, `900..1003`,
140
+ * `L900`, `L900-L1003`. The `L` form is unambiguous on its own; a bare number
141
+ * only counts after a `line`/`lines` word or directly after a path.
142
+ */
143
+ const LINE_NUMBER_TOKEN = /^(L?)(\d+)(?:(?:-|–|\.\.)L?(\d+))?$/;
144
+ const LINE_WORD = /^lines?$/i;
145
+ /** `lines 900 to 1003` — the connective between two bare numbers. */
146
+ const RANGE_CONNECTIVE = /^(?:to|through|thru)$/i;
147
+ /** Nothing real is this long; a larger number is a port, an id, a year typo. */
148
+ const MAX_LINE_NUMBER = 1_000_000;
149
+ function lineSpan(a, b) {
150
+ const start = Number(a);
151
+ const end = b === undefined ? start : Number(b);
152
+ if (!Number.isInteger(start) || !Number.isInteger(end) || start < 1 || end < 1)
153
+ return null;
154
+ if (start > MAX_LINE_NUMBER || end > MAX_LINE_NUMBER)
155
+ return null;
156
+ return start <= end ? { start, end } : { start: end, end: start };
157
+ }
158
+ /** Prose punctuation a line-number token can carry: "lines 900-1003," / "(L88)". */
159
+ function stripLineTokenPunctuation(token) {
160
+ return token.replace(/^[('"`[]+/, '').replace(/[)'"`\].,;:!?]+$/, '');
161
+ }
162
+ /**
163
+ * Strip prose punctuation wrapped around a token without eating punctuation
164
+ * that is PART of the path: quotes/backticks always strip; a trailing `)`/`]`
165
+ * strips only when the token has no matching opener (so `(protected)` and
166
+ * `[id]` segments survive, while "…(see src/foo.ts)" loses its parenthesis);
167
+ * a leading `(`/`[` mirrors that. Trailing sentence punctuation strips last,
168
+ * so "src/foo.ts." resolves. A trailing line reference is split off and
169
+ * returned separately — the file is what resolves, the lines are what the
170
+ * agent wants from it.
171
+ */
172
+ function stripWrapping(token) {
173
+ let s = token;
174
+ for (;;) {
175
+ const first = s[0];
176
+ if (!first)
177
+ break;
178
+ if ('\'"`<'.includes(first)) {
179
+ s = s.slice(1);
180
+ continue;
181
+ }
182
+ if (first === '(' && !s.includes(')')) {
183
+ s = s.slice(1);
184
+ continue;
185
+ }
186
+ if (first === '[' && !s.includes(']')) {
187
+ s = s.slice(1);
188
+ continue;
189
+ }
190
+ if (first === '{' && !s.includes('}')) {
191
+ s = s.slice(1);
192
+ continue;
193
+ }
194
+ break;
195
+ }
196
+ for (;;) {
197
+ const last = s[s.length - 1];
198
+ if (!last)
199
+ break;
200
+ if ('\'"`>.,;!?'.includes(last)) {
201
+ s = s.slice(0, -1);
202
+ continue;
203
+ }
204
+ if (last === ')' && !s.includes('(')) {
205
+ s = s.slice(0, -1);
206
+ continue;
207
+ }
208
+ if (last === ']' && !s.includes('[')) {
209
+ s = s.slice(0, -1);
210
+ continue;
211
+ }
212
+ if (last === '}' && !s.includes('{')) {
213
+ s = s.slice(0, -1);
214
+ continue;
215
+ }
216
+ break;
217
+ }
218
+ const ref = LINE_REF_SUFFIX.exec(s);
219
+ if (!ref)
220
+ return { path: s, lines: null };
221
+ return {
222
+ path: s.slice(0, ref.index),
223
+ lines: ref[1] !== undefined ? lineSpan(ref[1], ref[2]) : lineSpan(ref[3], ref[4]),
224
+ };
225
+ }
226
+ /** Normalize a span into the repo-relative shape the files table stores. */
227
+ function normalizeSpan(span) {
228
+ return span
229
+ .replace(/\\/g, '/')
230
+ .replace(/^(?:\.\/)+/, '')
231
+ .replace(/\/{2,}/g, '/')
232
+ .replace(/\/+$/, '');
233
+ }
234
+ /** Path-shaped beyond doubt: ≥2 segments and a dot-extension on the last. */
235
+ function isClearlyPathShaped(normalized) {
236
+ const slash = normalized.lastIndexOf('/');
237
+ if (slash <= 0)
238
+ return false;
239
+ return DOTTED_BASENAME.test(normalized.slice(slash + 1));
240
+ }
241
+ /**
242
+ * Resolve one normalized span against the indexed paths: exact match first,
243
+ * then segment-aligned suffix matches, dropping leading segments one at a
244
+ * time (so an absolute path, or one prefixed with the repo directory name,
245
+ * still lands on the indexed repo-relative file). Suffixes only get shorter —
246
+ * and therefore only match MORE — so the walk stops at the first suffix that
247
+ * matches anything: within budget it resolves, over budget it is ambiguous.
248
+ */
249
+ function resolveSpan(normalizedLower, lowerToOriginal, maxMatches) {
250
+ const exact = lowerToOriginal.get(normalizedLower);
251
+ if (exact)
252
+ return { matches: [exact], ambiguous: false };
253
+ const segments = normalizedLower.split('/').filter(Boolean);
254
+ const tries = Math.min(segments.length, MAX_SUFFIX_TRIES);
255
+ for (let drop = 0; drop < tries; drop++) {
256
+ const suffix = segments.slice(drop).join('/');
257
+ if (!suffix)
258
+ break;
259
+ const withSlash = '/' + suffix;
260
+ const matches = [];
261
+ for (const [lower, original] of lowerToOriginal) {
262
+ if (lower === suffix || lower.endsWith(withSlash)) {
263
+ matches.push(original);
264
+ if (matches.length > maxMatches)
265
+ return { matches: [], ambiguous: true };
266
+ }
267
+ }
268
+ if (matches.length > 0)
269
+ return { matches, ambiguous: false };
270
+ }
271
+ return { matches: [], ambiguous: false };
272
+ }
273
+ function extractQueryPaths(query, indexedPaths, opts = {}) {
274
+ const maxPins = Math.max(1, opts.maxPins ?? 8);
275
+ const maxMatchesPerSpan = Math.max(1, opts.maxMatchesPerSpan ?? 3);
276
+ const passthrough = {
277
+ strippedQuery: query,
278
+ pinnedFiles: [],
279
+ unresolvedPathSpans: [],
280
+ lineAnchors: [],
281
+ setAsideMatches: [],
282
+ };
283
+ if (!query.trim() || indexedPaths.length === 0)
284
+ return passthrough;
285
+ // Lowercase view of the index, built once per call. Last writer wins on a
286
+ // case-colliding pair, which is the existing file-view behavior too.
287
+ const lowerToOriginal = new Map();
288
+ for (const p of indexedPaths)
289
+ lowerToOriginal.set(p.toLowerCase(), p);
290
+ const tokens = query.split(/\s+/).filter(Boolean);
291
+ const consumed = new Set();
292
+ const pinned = [];
293
+ const pinnedSeen = new Set();
294
+ const unresolved = [];
295
+ const anchors = [];
296
+ const setAside = [];
297
+ /** Token index → the ONE file it pinned, for binding prose line ranges. */
298
+ const singleFileAt = new Map();
299
+ let candidatesExamined = 0;
300
+ // A bare basename two directories share (`editorOptions.ts` is both vscode's
301
+ // editor option registry and a workbench helper) used to pin EVERY match,
302
+ // and the matches split the pinned reservation — so a query that also named
303
+ // three functions in one of them got half the room for them it would have
304
+ // got without the path. When the query names symbols, the file it means is
305
+ // the one defining them: keep the matches that define at least one, set the
306
+ // rest aside. When no match defines one, or every match does, the symbols
307
+ // pick nothing out and the span resolves exactly as before.
308
+ //
309
+ // The same test lets a basename shared by more files than the ambiguity
310
+ // budget (django's 40 `models.py`) resolve after all — to the one defining
311
+ // the named class — so a span is collected past the budget only while
312
+ // narrowing is possible, and still reports as ambiguous if it doesn't
313
+ // narrow into the budget.
314
+ let symbolTokens = null;
315
+ const definersOf = new Map();
316
+ const narrowBySymbols = (matches) => {
317
+ if (!opts.symbolFiles || matches.length < 2)
318
+ return null;
319
+ if (symbolTokens === null) {
320
+ const basenames = new Set();
321
+ for (const p of indexedPaths) {
322
+ basenames.add(p.slice(Math.max(p.lastIndexOf('/'), p.lastIndexOf('\\')) + 1).toLowerCase());
323
+ }
324
+ symbolTokens = querySymbolTokens(tokens, basenames);
325
+ }
326
+ const candidates = new Set(matches);
327
+ const definers = new Set();
328
+ for (const t of symbolTokens) {
329
+ let files = definersOf.get(t);
330
+ if (!files) {
331
+ files = new Set(opts.symbolFiles(t));
332
+ definersOf.set(t, files);
333
+ }
334
+ for (const f of files)
335
+ if (candidates.has(f))
336
+ definers.add(f);
337
+ }
338
+ if (definers.size === 0 || definers.size === candidates.size)
339
+ return null;
340
+ return matches.filter((m) => definers.has(m));
341
+ };
342
+ /** Narrow a span's matches, recording what was set aside; null = over budget. */
343
+ const pinnableMatches = (span, matches) => {
344
+ const narrowed = matches.length > 1 ? narrowBySymbols(matches) : null;
345
+ if (narrowed && narrowed.length <= maxMatchesPerSpan) {
346
+ setAside.push({ span, files: matches.filter((m) => !narrowed.includes(m)) });
347
+ return narrowed;
348
+ }
349
+ return matches.length > maxMatchesPerSpan ? null : matches;
350
+ };
351
+ const collectLimit = opts.symbolFiles ? Number.POSITIVE_INFINITY : maxMatchesPerSpan;
352
+ for (let i = 0; i < tokens.length; i++) {
353
+ if (pinned.length >= maxPins)
354
+ break;
355
+ if (candidatesExamined >= MAX_CANDIDATE_SPANS)
356
+ break;
357
+ const { path: stripped, lines } = stripWrapping(tokens[i]);
358
+ if (stripped.length < 4)
359
+ continue;
360
+ const hasSlash = /[/\\]/.test(stripped);
361
+ if (!hasSlash && !DOTTED_BASENAME.test(stripped))
362
+ continue;
363
+ const normalized = normalizeSpan(stripped);
364
+ if (!normalized)
365
+ continue;
366
+ candidatesExamined++;
367
+ const resolved = resolveSpan(normalized.toLowerCase(), lowerToOriginal, collectLimit);
368
+ const pinnable = resolved.matches.length > 0 ? pinnableMatches(normalized, resolved.matches) : null;
369
+ const matches = pinnable ?? [];
370
+ const ambiguous = resolved.ambiguous || (resolved.matches.length > 0 && pinnable === null);
371
+ if (matches.length > 0) {
372
+ consumed.add(i);
373
+ for (const m of matches) {
374
+ if (pinnedSeen.has(m) || pinned.length >= maxPins)
375
+ continue;
376
+ pinnedSeen.add(m);
377
+ pinned.push(m);
378
+ }
379
+ if (matches.length === 1 && pinnedSeen.has(matches[0])) {
380
+ singleFileAt.set(i, matches[0]);
381
+ if (lines)
382
+ anchors.push({ file: matches[0], ...lines });
383
+ }
384
+ }
385
+ else if (ambiguous
386
+ || isClearlyPathShaped(normalized)
387
+ || (normalized.includes('/') && opts.existsOnDisk?.(normalized) === true)) {
388
+ // A real path that didn't resolve to a usable set. Keeping it in the
389
+ // query is strictly worse — its fragments are what minted the junk
390
+ // matches this module exists to stop — so strip it and say so.
391
+ // The third arm covers the DOTLESS slashed span (`scripts/deploy`,
392
+ // `bin/build`): shape alone cannot tell it from `and/or` or
393
+ // `input/output`, so the file's existence on disk decides. Loosening the
394
+ // SHAPE test instead would strip that prose out of every query and mint a
395
+ // false "no indexed file matches `and/or`" caveat.
396
+ consumed.add(i);
397
+ if (unresolved.length < 4)
398
+ unresolved.push(normalized);
399
+ }
400
+ // Anything else (`and/or`, `call/2`, `foo.Bar`) is not a path reference:
401
+ // leave the token for the normal matching pipeline.
402
+ }
403
+ // Second pass — extension-less kebab basenames. `background-image-table`
404
+ // opens no door above (no slash, no dotted tail), the hyphens disqualify it
405
+ // from the named-symbol seeder downstream, and FTS shreds it into the most
406
+ // common words in a kebab-cased repo (`background`, `image`, `table`) —
407
+ // which admit look-alike SIBLINGS that crowd out the named file. Resolution
408
+ // stays the detector: a token pins only when its whole lowercased form is
409
+ // the stem of an indexed basename. Two deliberate asymmetries vs the first
410
+ // pass: prose that resolves to nothing (`non-blocking`, `cross-call`) is
411
+ // LEFT IN the query — unlike a slashed span it may be legitimate wording,
412
+ // so it keeps feeding FTS and is not reported as an unresolved path — and a
413
+ // stem hotter than maxMatchesPerSpan is likewise left alone (pinning half a
414
+ // monorepo off one hot name trades precision the wrong way; a directory
415
+ // segment, which the first pass handles, disambiguates). Runs after the
416
+ // slashed/dotted pass so explicit paths win the shared maxPins budget, and
417
+ // examines every remaining token: lookups are O(1) map hits, so the
418
+ // scan-cost rationale behind MAX_CANDIDATE_SPANS doesn't apply.
419
+ let basenameStems = null;
420
+ for (let i = 0; i < tokens.length && pinned.length < maxPins; i++) {
421
+ if (consumed.has(i))
422
+ continue;
423
+ const { path: stripped, lines } = stripWrapping(tokens[i]);
424
+ if (stripped.length < 4 || !KEBAB_BASENAME.test(stripped))
425
+ continue;
426
+ basenameStems ??= buildBasenameStems(indexedPaths);
427
+ const stemMatches = basenameStems.get(stripped.toLowerCase());
428
+ const matches = stemMatches ? pinnableMatches(stripped, stemMatches) : null;
429
+ if (!matches)
430
+ continue;
431
+ consumed.add(i);
432
+ for (const m of matches) {
433
+ if (pinnedSeen.has(m) || pinned.length >= maxPins)
434
+ continue;
435
+ pinnedSeen.add(m);
436
+ pinned.push(m);
437
+ }
438
+ if (matches.length === 1 && pinnedSeen.has(matches[0])) {
439
+ singleFileAt.set(i, matches[0]);
440
+ if (lines)
441
+ anchors.push({ file: matches[0], ...lines });
442
+ }
443
+ }
444
+ // Third pass — prose line ranges (`lines 900-1003`, `line 42`, `L88-L120`,
445
+ // `lines 900 to 1003`) bound to the NEAREST single-file path token. These
446
+ // are what an agent writes when a previous response elided a body and it
447
+ // asks for the rest; left in the query, the numbers match nothing and
448
+ // `lines` feeds FTS a word every file contains. A range with no path to
449
+ // bind to says nothing about which file, so it is left alone.
450
+ if (singleFileAt.size > 0) {
451
+ const pathIdx = [...singleFileAt.keys()];
452
+ const nearestFile = (i) => {
453
+ let best = pathIdx[0];
454
+ for (const p of pathIdx)
455
+ if (Math.abs(p - i) < Math.abs(best - i))
456
+ best = p;
457
+ return singleFileAt.get(best);
458
+ };
459
+ for (let i = 0; i < tokens.length; i++) {
460
+ if (consumed.has(i))
461
+ continue;
462
+ const tok = stripLineTokenPunctuation(tokens[i]);
463
+ const afterWord = i > 0 && !consumed.has(i - 1) && LINE_WORD.test(stripLineTokenPunctuation(tokens[i - 1]));
464
+ const afterPath = singleFileAt.has(i - 1);
465
+ const m = LINE_NUMBER_TOKEN.exec(tok);
466
+ if (!m)
467
+ continue;
468
+ // A bare number is a line number only in a line context; `L900` is one
469
+ // on its own.
470
+ if (!m[1] && !afterWord && !afterPath)
471
+ continue;
472
+ let span = lineSpan(m[2], m[3]);
473
+ const used = [i];
474
+ // `lines 900 to 1003`
475
+ if (span && m[3] === undefined && i + 2 < tokens.length
476
+ && RANGE_CONNECTIVE.test(stripLineTokenPunctuation(tokens[i + 1]))) {
477
+ const tail = LINE_NUMBER_TOKEN.exec(stripLineTokenPunctuation(tokens[i + 2]));
478
+ if (tail && tail[3] === undefined) {
479
+ span = lineSpan(m[2], tail[2]);
480
+ used.push(i + 1, i + 2);
481
+ }
482
+ }
483
+ if (!span)
484
+ continue;
485
+ anchors.push({ file: nearestFile(i), ...span });
486
+ for (const u of used)
487
+ consumed.add(u);
488
+ if (afterWord)
489
+ consumed.add(i - 1);
490
+ }
491
+ }
492
+ if (consumed.size === 0)
493
+ return passthrough;
494
+ const seenAnchor = new Set();
495
+ return {
496
+ strippedQuery: tokens.filter((_, i) => !consumed.has(i)).join(' '),
497
+ pinnedFiles: pinned,
498
+ unresolvedPathSpans: unresolved,
499
+ lineAnchors: anchors.filter((a) => {
500
+ const key = `${a.file}:${a.start}-${a.end}`;
501
+ if (seenAnchor.has(key))
502
+ return false;
503
+ seenAnchor.add(key);
504
+ return true;
505
+ }),
506
+ // A file another span pinned outright (the agent also wrote its full path)
507
+ // was not set aside after all.
508
+ setAsideMatches: setAside
509
+ .map((s) => ({ span: s.span, files: s.files.filter((f) => !pinnedSeen.has(f)) }))
510
+ .filter((s) => s.files.length > 0),
511
+ };
512
+ }
513
+ //# sourceMappingURL=query-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-paths.js","sourceRoot":"","sources":["../../src/search/query-paths.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;AAuDH,wDAIC;AA2MD,8CAsPC;AA/cD;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAAC,KAAa;IAClD,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;WACrB,+CAA+C,CAAC,IAAI,CAAC,KAAK,CAAC;WAC3D,wDAAwD,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,mEAAmE;AACnE,MAAM,mBAAmB,GAA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