scip-query 0.23.0 → 0.26.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 (650) hide show
  1. package/CHANGELOG.md +491 -2
  2. package/README.md +111 -122
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-PRVFAGTQ.js +2 -0
  5. package/dist/call-graph-DVPAQV2F.js +2 -0
  6. package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
  7. package/dist/chunk-2FSBGL5P.js +2 -0
  8. package/dist/chunk-2HLAFUCY.js +2 -0
  9. package/dist/chunk-2IWUT6CJ.js +3 -0
  10. package/dist/chunk-2KNN7GTQ.js +2 -0
  11. package/dist/chunk-2LHXRE2B.js +8 -0
  12. package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
  13. package/dist/chunk-36SGVCGX.js +2 -0
  14. package/dist/chunk-3ABBFPTP.js +2 -0
  15. package/dist/chunk-3IVFU4FD.js +3 -0
  16. package/dist/chunk-3JIQS44J.js +7 -0
  17. package/dist/chunk-3ZRB6DNK.js +7 -0
  18. package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
  19. package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
  20. package/dist/chunk-4BP3UBDG.js +2 -0
  21. package/dist/chunk-4D6RO7G4.js +2 -0
  22. package/dist/chunk-4FEWQ6RH.js +2 -0
  23. package/dist/chunk-4IGEOBG7.js +2 -0
  24. package/dist/chunk-4QZXBUKC.js +2 -0
  25. package/dist/chunk-4WBDEVX2.js +4 -0
  26. package/dist/chunk-4WCUBZU3.js +8 -0
  27. package/dist/chunk-4WTUBQ36.js +40 -0
  28. package/dist/chunk-4XQ4O6IM.js +3 -0
  29. package/dist/chunk-55UQAMZO.js +4 -0
  30. package/dist/chunk-5D2LVK7O.js +125 -0
  31. package/dist/chunk-5IYJ56TT.js +2 -0
  32. package/dist/chunk-5PLMJC7Q.js +2 -0
  33. package/dist/chunk-5TNQJUR2.js +5 -0
  34. package/dist/chunk-62BDNPMI.js +2 -0
  35. package/dist/chunk-64DZ5TXR.js +7 -0
  36. package/dist/chunk-65245JCM.js +2 -0
  37. package/dist/chunk-6FFVZZL4.js +2 -0
  38. package/dist/chunk-6KO5JHAR.js +2 -0
  39. package/dist/chunk-6LRXOOSX.js +2 -0
  40. package/dist/chunk-6LSEIIF7.js +2 -0
  41. package/dist/chunk-6YMNWD3H.js +6 -0
  42. package/dist/chunk-72AD6ZRR.js +5 -0
  43. package/dist/chunk-73AAKPUC.js +4 -0
  44. package/dist/chunk-76CZ77DF.js +2 -0
  45. package/dist/chunk-7VPEEAAG.js +2 -0
  46. package/dist/chunk-7WTPQ4NX.js +14 -0
  47. package/dist/chunk-7Y5T6XDP.js +2 -0
  48. package/dist/chunk-A2IIGFMJ.js +5 -0
  49. package/dist/chunk-AB5KCTEV.js +2 -0
  50. package/dist/chunk-AC566WBP.js +6 -0
  51. package/dist/chunk-AGWFSTXC.js +3 -0
  52. package/dist/chunk-AOSIYPTA.js +2 -0
  53. package/dist/chunk-AUVEWPIF.js +2 -0
  54. package/dist/chunk-B56T42J3.js +25 -0
  55. package/dist/chunk-BIQEF5NE.js +2 -0
  56. package/dist/chunk-BL6XJKTA.js +3 -0
  57. package/dist/chunk-BMKOQJRI.js +2 -0
  58. package/dist/chunk-BOZ4EXBB.js +3 -0
  59. package/dist/chunk-BUTWYEPH.js +2 -0
  60. package/dist/chunk-BZB4QPIP.js +2 -0
  61. package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
  62. package/dist/chunk-CFN45HFP.js +2 -0
  63. package/dist/chunk-CFYMZFXT.js +368 -0
  64. package/dist/chunk-CN5EH7O3.js +2 -0
  65. package/dist/chunk-D254DNNQ.js +4 -0
  66. package/dist/chunk-D3FDISIC.js +2 -0
  67. package/dist/chunk-D3NX5XIE.js +3 -0
  68. package/dist/chunk-DA7RPPDF.js +3 -0
  69. package/dist/chunk-DDMC3FON.js +3 -0
  70. package/dist/chunk-DIO3FUSG.js +2 -0
  71. package/dist/chunk-DJ2NNSUK.js +3 -0
  72. package/dist/chunk-DKYQIM3C.js +18 -0
  73. package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
  74. package/dist/chunk-DVFP6PZI.js +2 -0
  75. package/dist/chunk-E3FDPXZK.js +2 -0
  76. package/dist/chunk-E7YNJLCB.js +2 -0
  77. package/dist/chunk-EFGW5JPH.js +2 -0
  78. package/dist/chunk-EJVTR244.js +13 -0
  79. package/dist/chunk-EOV7RTRZ.js +2 -0
  80. package/dist/chunk-ETOIKRHO.js +2 -0
  81. package/dist/chunk-EYK3ZAO2.js +3 -0
  82. package/dist/chunk-F2V2LPET.js +52 -0
  83. package/dist/chunk-F4LUHJTF.js +2 -0
  84. package/dist/chunk-F4PUT6IT.js +2 -0
  85. package/dist/chunk-F56GCXXS.js +5 -0
  86. package/dist/chunk-FC2EVQRM.js +2 -0
  87. package/dist/chunk-FL7NBMHP.js +3 -0
  88. package/dist/chunk-FMRN2TRL.js +3 -0
  89. package/dist/chunk-FVULPZDF.js +20 -0
  90. package/dist/chunk-GCKCF5FL.js +43 -0
  91. package/dist/chunk-GH2PYF46.js +2 -0
  92. package/dist/chunk-GHJAGXIP.js +2 -0
  93. package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
  94. package/dist/chunk-GS6KDO4R.js +2 -0
  95. package/dist/chunk-GUUBXNN7.js +2 -0
  96. package/dist/chunk-GVWX5T43.js +80 -0
  97. package/dist/chunk-GZKFETP5.js +2 -0
  98. package/dist/chunk-H4EQHO6J.js +9 -0
  99. package/dist/chunk-H73WY2RM.js +2 -0
  100. package/dist/chunk-H75GSPRV.js +60 -0
  101. package/dist/chunk-HDR3AHSV.js +61 -0
  102. package/dist/chunk-HQBSL74Y.js +2 -0
  103. package/dist/chunk-HRRFKWPZ.js +2 -0
  104. package/dist/chunk-HXENDJC6.js +2 -0
  105. package/dist/chunk-IIBAZNSW.js +21 -0
  106. package/dist/chunk-INLMWEUU.js +12 -0
  107. package/dist/chunk-IWQPAF4F.js +2 -0
  108. package/dist/chunk-IZJ6YUKP.js +35 -0
  109. package/dist/chunk-J2TMAIN5.js +60 -0
  110. package/dist/chunk-J5FJMODQ.js +142 -0
  111. package/dist/chunk-J7HZPIO3.js +2 -0
  112. package/dist/chunk-JEVRKFRL.js +2 -0
  113. package/dist/chunk-JFXSGAEB.js +30 -0
  114. package/dist/chunk-JVRTHGFS.js +3 -0
  115. package/dist/chunk-JYWEX7RR.js +360 -0
  116. package/dist/chunk-K3YL22N6.js +2 -0
  117. package/dist/chunk-K4CN7GXK.js +12 -0
  118. package/dist/chunk-K5TBVXU4.js +30 -0
  119. package/dist/chunk-KDDIE2DP.js +9 -0
  120. package/dist/chunk-KHWRRPV4.js +2 -0
  121. package/dist/chunk-KI6NBKDY.js +14 -0
  122. package/dist/chunk-KU3QRSTH.js +2 -0
  123. package/dist/chunk-KZBJWZJB.js +2 -0
  124. package/dist/chunk-L7GFM3NP.js +3 -0
  125. package/dist/chunk-LMO6PK3V.js +35 -0
  126. package/dist/chunk-LN4YXJJU.js +2 -0
  127. package/dist/chunk-LOVIZBJ4.js +43 -0
  128. package/dist/chunk-LPCRK4A2.js +11 -0
  129. package/dist/chunk-MMHZKBFA.js +2 -0
  130. package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
  131. package/dist/chunk-N2WN6I3L.js +2 -0
  132. package/dist/chunk-N3ORQT7L.js +2 -0
  133. package/dist/chunk-NAZ3RAIW.js +2 -0
  134. package/dist/chunk-NDUNO5JQ.js +2 -0
  135. package/dist/chunk-NEIWRNAZ.js +4 -0
  136. package/dist/chunk-NJJMVD65.js +2 -0
  137. package/dist/chunk-NLOQOBXI.js +20 -0
  138. package/dist/chunk-NOLZOVCU.js +2 -0
  139. package/dist/chunk-NOWINRRN.js +2 -0
  140. package/dist/chunk-NZAXKGRL.js +16 -0
  141. package/dist/chunk-O2C4UILI.js +2 -0
  142. package/dist/chunk-O3RHA6ZT.js +3 -0
  143. package/dist/chunk-O4UZSPPI.js +3 -0
  144. package/dist/chunk-OGFV2BUX.js +2 -0
  145. package/dist/chunk-OZCJXZK6.js +499 -0
  146. package/dist/chunk-P6ODM7BY.js +2 -0
  147. package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
  148. package/dist/chunk-PH52RA7D.js +2 -0
  149. package/dist/chunk-PKN354TH.js +3 -0
  150. package/dist/chunk-PWOASWEG.js +11 -0
  151. package/dist/chunk-QIWXRW72.js +2 -0
  152. package/dist/chunk-QJRMOK5N.js +2 -0
  153. package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
  154. package/dist/chunk-QXEUDXBT.js +3 -0
  155. package/dist/chunk-QYUVVBMR.js +6 -0
  156. package/dist/chunk-QZ7KQZRN.js +2 -0
  157. package/dist/chunk-R6LQBUDH.js +2 -0
  158. package/dist/chunk-RBS42E55.js +20 -0
  159. package/dist/chunk-RSJKPCFX.js +26 -0
  160. package/dist/chunk-S6CZA3MV.js +2 -0
  161. package/dist/chunk-STMVAHJP.js +2 -0
  162. package/dist/chunk-SYVPTTVW.js +2 -0
  163. package/dist/chunk-T3I6NHBH.js +2 -0
  164. package/dist/chunk-T6DK3ZP7.js +2 -0
  165. package/dist/chunk-TKD34PHN.js +4 -0
  166. package/dist/chunk-TNNQFH7W.js +2 -0
  167. package/dist/chunk-TNV7SSUF.js +2 -0
  168. package/dist/chunk-TO7ZR3EH.js +8 -0
  169. package/dist/chunk-TOU3CHK4.js +2 -0
  170. package/dist/chunk-TRBI4UKT.js +2 -0
  171. package/dist/chunk-TZCVNCAN.js +4 -0
  172. package/dist/chunk-U4LZA5LL.js +3 -0
  173. package/dist/chunk-U5RIG3JP.js +3 -0
  174. package/dist/chunk-UP5KXN2I.js +2 -0
  175. package/dist/chunk-UQFR3NDH.js +5 -0
  176. package/dist/chunk-UXYXF7GV.js +2 -0
  177. package/dist/chunk-VB3GOKOS.js +2 -0
  178. package/dist/chunk-VF5JZICY.js +2 -0
  179. package/dist/chunk-VTY3VK6E.js +2 -0
  180. package/dist/chunk-VX2O4RIS.js +2 -0
  181. package/dist/chunk-WKPV2TDZ.js +2 -0
  182. package/dist/chunk-WOFQ5DTB.js +2 -0
  183. package/dist/chunk-WS4C6TCK.js +2 -0
  184. package/dist/chunk-WXU3DGPU.js +2 -0
  185. package/dist/chunk-X6RMKHJQ.js +81 -0
  186. package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
  187. package/dist/chunk-XHTVFLWW.js +2 -0
  188. package/dist/chunk-XKIDJCIK.js +2 -0
  189. package/dist/chunk-XTYTYZPT.js +2 -0
  190. package/dist/chunk-Y2JHHTTA.js +2 -0
  191. package/dist/chunk-YGVRMGYN.js +4 -0
  192. package/dist/chunk-YNQCGEQE.js +2 -0
  193. package/dist/chunk-YOQVEXVE.js +14 -0
  194. package/dist/chunk-YRT2WLYY.js +2 -0
  195. package/dist/chunk-YTAP5Y2G.js +2 -0
  196. package/dist/chunk-YTYWI7VB.js +2 -0
  197. package/dist/chunk-YULZRALL.js +2 -0
  198. package/dist/chunk-Z33WQG4Q.js +2 -0
  199. package/dist/chunk-ZGTYGDMF.js +16 -0
  200. package/dist/chunk-ZHMRSZFD.js +43 -0
  201. package/dist/chunk-ZHSP366W.js +10 -0
  202. package/dist/chunk-ZIBYCYKK.js +7 -0
  203. package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
  204. package/dist/chunk-ZO4YXUT6.js +4 -0
  205. package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
  206. package/dist/cli-main.js +6 -6
  207. package/dist/cli.js +1 -1
  208. package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
  209. package/dist/code-IL5WH3NZ.js +2 -0
  210. package/dist/code-result-json-ANTBEDFP.js +4 -0
  211. package/dist/command-descriptors-HEEMDHTU.js +222 -0
  212. package/dist/deps-EOWFC6FD.js +2 -0
  213. package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
  214. package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
  215. package/dist/files-K4AI3JUM.js +2 -0
  216. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  217. package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
  218. package/dist/hierarchy-6W5NDIFI.js +2 -0
  219. package/dist/imports-WH365QY4.js +2 -0
  220. package/dist/index.d.ts +13 -1
  221. package/dist/index.js +1 -1
  222. package/dist/members-K3PHMF5S.js +2 -0
  223. package/dist/methods-E7KVMBX4.js +2 -0
  224. package/dist/output-continuation-command-BJSY67SN.js +3 -0
  225. package/dist/output-pagination-UZJ5ACIX.js +24 -0
  226. package/dist/postinstall.js +1 -1
  227. package/dist/project-reindex-EP24WT4X.js +3 -0
  228. package/dist/queries/affected.js +1 -1
  229. package/dist/queries/architecture.d.ts +15 -4
  230. package/dist/queries/architecture.js +1 -1
  231. package/dist/queries/bottlenecks.js +1 -1
  232. package/dist/queries/by-kind.js +1 -1
  233. package/dist/queries/call-graph.d.ts +3 -1
  234. package/dist/queries/call-graph.js +1 -1
  235. package/dist/queries/change-surface.d.ts +1 -0
  236. package/dist/queries/change-surface.js +1 -1
  237. package/dist/queries/cleanup-plan.d.ts +3 -3
  238. package/dist/queries/cleanup-plan.js +1 -1
  239. package/dist/queries/co-change.d.ts +20 -2
  240. package/dist/queries/co-change.js +1 -1
  241. package/dist/queries/code.d.ts +1 -1
  242. package/dist/queries/code.js +1 -1
  243. package/dist/queries/complexity.d.ts +6 -3
  244. package/dist/queries/complexity.js +1 -1
  245. package/dist/queries/context.d.ts +1 -7
  246. package/dist/queries/context.js +1 -1
  247. package/dist/queries/coupling.js +1 -1
  248. package/dist/queries/cycles.js +1 -1
  249. package/dist/queries/dead.d.ts +2 -0
  250. package/dist/queries/dead.js +1 -1
  251. package/dist/queries/decorative-checkers.js +1 -1
  252. package/dist/queries/dependence-slice.d.ts +46 -22
  253. package/dist/queries/dependence-slice.js +1 -1
  254. package/dist/queries/dependency-depth.d.ts +1 -7
  255. package/dist/queries/dependency-depth.js +1 -1
  256. package/dist/queries/deps.js +1 -1
  257. package/dist/queries/diff-impact.d.ts +3 -1
  258. package/dist/queries/diff-impact.js +1 -1
  259. package/dist/queries/doc-drift.js +1 -1
  260. package/dist/queries/drift.d.ts +1 -1
  261. package/dist/queries/drift.js +1 -1
  262. package/dist/queries/duplicate-bodies.d.ts +29 -2
  263. package/dist/queries/duplicate-bodies.js +1 -1
  264. package/dist/queries/entry-map.d.ts +2 -4
  265. package/dist/queries/entry-map.js +1 -1
  266. package/dist/queries/evidence.d.ts +121 -61
  267. package/dist/queries/evidence.js +1 -1
  268. package/dist/queries/fan.js +1 -1
  269. package/dist/queries/files.js +1 -1
  270. package/dist/queries/health.d.ts +1 -1
  271. package/dist/queries/health.js +1 -1
  272. package/dist/queries/hierarchy.d.ts +2 -2
  273. package/dist/queries/hierarchy.js +1 -1
  274. package/dist/queries/hotspots.d.ts +1 -1
  275. package/dist/queries/hotspots.js +1 -1
  276. package/dist/queries/imports.d.ts +1 -0
  277. package/dist/queries/imports.js +1 -1
  278. package/dist/queries/incomplete-migration.d.ts +3 -3
  279. package/dist/queries/incomplete-migration.js +1 -1
  280. package/dist/queries/index.d.ts +17 -65
  281. package/dist/queries/index.js +1 -1
  282. package/dist/queries/locality-candidates.d.ts +4 -4
  283. package/dist/queries/locality-candidates.js +1 -1
  284. package/dist/queries/members.d.ts +2 -2
  285. package/dist/queries/members.js +1 -1
  286. package/dist/queries/methods.js +1 -1
  287. package/dist/queries/not-implemented.d.ts +2 -6
  288. package/dist/queries/not-implemented.js +1 -1
  289. package/dist/queries/outline.js +1 -1
  290. package/dist/queries/passthrough-candidates.d.ts +9 -1
  291. package/dist/queries/passthrough-candidates.js +1 -1
  292. package/dist/queries/react-component-duplicates.d.ts +19 -3
  293. package/dist/queries/react-component-duplicates.js +1 -1
  294. package/dist/queries/react-hook-candidates.d.ts +22 -3
  295. package/dist/queries/react-hook-candidates.js +1 -1
  296. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  297. package/dist/queries/react-large-component-pressure.js +1 -1
  298. package/dist/queries/recent-duplicates.js +1 -1
  299. package/dist/queries/redundant-reexports.d.ts +4 -14
  300. package/dist/queries/redundant-reexports.js +1 -1
  301. package/dist/queries/refs.d.ts +4 -1
  302. package/dist/queries/refs.js +1 -1
  303. package/dist/queries/review.d.ts +188 -0
  304. package/dist/queries/review.js +2 -0
  305. package/dist/queries/similar-files.d.ts +7 -10
  306. package/dist/queries/similar-files.js +1 -1
  307. package/dist/queries/similar-signatures.js +1 -1
  308. package/dist/queries/similar.d.ts +19 -1
  309. package/dist/queries/similar.js +1 -1
  310. package/dist/queries/slice-cohesion.d.ts +205 -0
  311. package/dist/queries/slice-cohesion.js +2 -0
  312. package/dist/queries/source-inspection.d.ts +6 -202
  313. package/dist/queries/source-inspection.js +1 -1
  314. package/dist/queries/source-search.d.ts +2 -3
  315. package/dist/queries/source-search.js +1 -1
  316. package/dist/queries/stats.d.ts +1 -0
  317. package/dist/queries/stats.js +1 -1
  318. package/dist/queries/surface.js +1 -1
  319. package/dist/queries/symbols.js +1 -1
  320. package/dist/queries/system.d.ts +4 -2
  321. package/dist/queries/system.js +1 -1
  322. package/dist/queries/test-quality.d.ts +1 -1
  323. package/dist/queries/test-quality.js +1 -1
  324. package/dist/queries/twin-drift.d.ts +23 -7
  325. package/dist/queries/twin-drift.js +1 -1
  326. package/dist/queries/unused-imports.js +1 -1
  327. package/dist/queries/unused-params.d.ts +3 -15
  328. package/dist/queries/unused-params.js +1 -1
  329. package/dist/queries/vue-component-duplicates.js +1 -1
  330. package/dist/queries/vue-composable-candidates.js +1 -1
  331. package/dist/queries/vue-large-view-pressure.js +1 -1
  332. package/dist/query-service-fastpath.js +5 -5
  333. package/dist/query-service-server.js +4 -4
  334. package/dist/refs-CCBJG7WK.js +2 -0
  335. package/dist/refs-pagination-DRNLVU4S.js +2 -0
  336. package/dist/reindex-worker.js +79 -29
  337. package/dist/reindex.js +45 -45
  338. package/dist/repository-cache-worker.js +2 -0
  339. package/dist/runtime.d.ts +8 -8
  340. package/dist/runtime.js +3 -4
  341. package/dist/rust-semantic-session-server.js +1 -1
  342. package/dist/rust-semantic-session-worker.js +1 -1
  343. package/dist/rust-semantic-worker.js +1 -1
  344. package/dist/service-queries-2WAJI7R6.js +6 -0
  345. package/dist/source-inspection-91U9zdO3.d.ts +341 -0
  346. package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
  347. package/dist/stats-G7DIV6VU.js +2 -0
  348. package/dist/surface-IO55UALI.js +2 -0
  349. package/dist/system-ZBMSHJXU.js +2 -0
  350. package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
  351. package/dist/typescript-indexer.js +2 -0
  352. package/dist/typescript-mailbox-worker.js +1 -1
  353. package/dist/watch-server.js +3 -3
  354. package/docs/AGENT_GUIDE.md +19 -128
  355. package/docs/CLI_JSON_OUTPUT.md +21 -17
  356. package/docs/COMMAND_REFERENCE.md +34 -49
  357. package/docs/CURRENT_COMMANDS.md +123 -0
  358. package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
  359. package/docs/DETECTOR_GUIDE.md +55 -12
  360. package/docs/PRODUCT_VISION.md +135 -0
  361. package/docs/PROPERTY_TESTING.md +73 -0
  362. package/docs/REVIEW.md +76 -0
  363. package/docs/SKILLS.md +51 -0
  364. package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
  365. package/docs/accuracy-audit-checklist.md +70 -13
  366. package/docs/analyzer-inventory.md +2 -2
  367. package/docs/locality-analyzer-design.md +9 -9
  368. package/package.json +18 -80
  369. package/scripts/evidence-product-contract.mjs +7 -3
  370. package/scripts/record-review-coverage.mjs +118 -0
  371. package/scripts/scip-windows-provenance.mjs +29 -19
  372. package/skills/scip-architecture-review/SKILL.md +57 -0
  373. package/skills/scip-architecture-review/agents/openai.yaml +4 -0
  374. package/skills/scip-architecture-review/references/design-checks.md +17 -0
  375. package/skills/scip-explore/SKILL.md +15 -59
  376. package/skills/scip-explore/agents/openai.yaml +3 -3
  377. package/skills/scip-explore/references/external-evidence.md +2 -2
  378. package/skills/scip-explore/references/information-model.md +26 -29
  379. package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
  380. package/skills/scip-integrity-audit/SKILL.md +53 -181
  381. package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
  382. package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
  383. package/skills/scip-plan/SKILL.md +39 -65
  384. package/skills/scip-plan/agents/openai.yaml +2 -2
  385. package/skills/scip-query/SKILL.md +28 -81
  386. package/skills/scip-query/agents/openai.yaml +2 -2
  387. package/skills/scip-query/references/command-guide.md +169 -0
  388. package/skills/scip-setup/SKILL.md +4 -2
  389. package/skills/scip-setup/agents/openai.yaml +3 -3
  390. package/dist/by-kind-XI2CSWEY.js +0 -2
  391. package/dist/call-graph-UONR6JR5.js +0 -2
  392. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  393. package/dist/chunk-26CT72HM.js +0 -2
  394. package/dist/chunk-2E7CX53V.js +0 -2
  395. package/dist/chunk-2GRUZAQF.js +0 -43
  396. package/dist/chunk-2LDBDR6J.js +0 -29
  397. package/dist/chunk-2OOY75BW.js +0 -2
  398. package/dist/chunk-2R3V3PSD.js +0 -4
  399. package/dist/chunk-2WC2OEDO.js +0 -4
  400. package/dist/chunk-35NLDRZC.js +0 -2
  401. package/dist/chunk-3AF4TUFK.js +0 -3
  402. package/dist/chunk-3D3QG236.js +0 -2
  403. package/dist/chunk-3FHOF22C.js +0 -21
  404. package/dist/chunk-3JKSW6LJ.js +0 -2
  405. package/dist/chunk-3L2ZBPEX.js +0 -133
  406. package/dist/chunk-3PJABJSU.js +0 -2
  407. package/dist/chunk-3SVF22I5.js +0 -2
  408. package/dist/chunk-3WR4E3A3.js +0 -3
  409. package/dist/chunk-4FTZ4P5G.js +0 -2
  410. package/dist/chunk-4UX2F3JX.js +0 -2
  411. package/dist/chunk-4WNW27SX.js +0 -2
  412. package/dist/chunk-5ENOG4VP.js +0 -61
  413. package/dist/chunk-64BFSI5I.js +0 -2
  414. package/dist/chunk-66DVSJQG.js +0 -455
  415. package/dist/chunk-6HFCYNYE.js +0 -9
  416. package/dist/chunk-6PQNKL3G.js +0 -3
  417. package/dist/chunk-6V5CNXL6.js +0 -2
  418. package/dist/chunk-6VVV4WRR.js +0 -4
  419. package/dist/chunk-7BWFZPPZ.js +0 -2
  420. package/dist/chunk-7CYG22FH.js +0 -2
  421. package/dist/chunk-7F45LJKI.js +0 -2
  422. package/dist/chunk-7IWV2EG3.js +0 -3
  423. package/dist/chunk-7KCZELVM.js +0 -2
  424. package/dist/chunk-AFHTBORT.js +0 -2
  425. package/dist/chunk-AVRYW5OZ.js +0 -2
  426. package/dist/chunk-B3X6KU75.js +0 -2
  427. package/dist/chunk-B5D7QPBE.js +0 -4
  428. package/dist/chunk-BBCIS4DX.js +0 -16
  429. package/dist/chunk-BDUVI7TO.js +0 -3
  430. package/dist/chunk-BE7ZZTMC.js +0 -2
  431. package/dist/chunk-BHVUJOCQ.js +0 -3
  432. package/dist/chunk-BJT7LSPK.js +0 -3
  433. package/dist/chunk-BKVWUP7Y.js +0 -2
  434. package/dist/chunk-BQGB4HBD.js +0 -2
  435. package/dist/chunk-BRV7PIFF.js +0 -2
  436. package/dist/chunk-CEEZJXEF.js +0 -2
  437. package/dist/chunk-CIYLO6SI.js +0 -7
  438. package/dist/chunk-CJZXN4NU.js +0 -2
  439. package/dist/chunk-CNO7TOKL.js +0 -2
  440. package/dist/chunk-COF23M5F.js +0 -2
  441. package/dist/chunk-CWFP7GM5.js +0 -2
  442. package/dist/chunk-D2DHWI3D.js +0 -2
  443. package/dist/chunk-D4N5SQ2M.js +0 -4
  444. package/dist/chunk-DBRSYFXR.js +0 -2
  445. package/dist/chunk-DHUIOLDT.js +0 -2
  446. package/dist/chunk-DIRJWYBM.js +0 -6
  447. package/dist/chunk-DIUFNHRJ.js +0 -35
  448. package/dist/chunk-DRENNWRG.js +0 -2
  449. package/dist/chunk-DTZCKZEU.js +0 -4
  450. package/dist/chunk-DULC3QFP.js +0 -5
  451. package/dist/chunk-DYGHBZ2N.js +0 -16
  452. package/dist/chunk-E5R6AQ73.js +0 -40
  453. package/dist/chunk-E73UNJTF.js +0 -38
  454. package/dist/chunk-EKV5HX33.js +0 -2
  455. package/dist/chunk-EQHFIL6T.js +0 -3
  456. package/dist/chunk-ESIQ66Z7.js +0 -2
  457. package/dist/chunk-EVFUMY4R.js +0 -3
  458. package/dist/chunk-F7DY272B.js +0 -2
  459. package/dist/chunk-FBN2FGXG.js +0 -2
  460. package/dist/chunk-FDLOBR6P.js +0 -4
  461. package/dist/chunk-FESCRNVV.js +0 -5
  462. package/dist/chunk-FFRKR4EQ.js +0 -2
  463. package/dist/chunk-FGA2U4OR.js +0 -8
  464. package/dist/chunk-FIQRSHVM.js +0 -2
  465. package/dist/chunk-FPYLNQPT.js +0 -2
  466. package/dist/chunk-FRUSVINH.js +0 -2
  467. package/dist/chunk-GSP44ENC.js +0 -2
  468. package/dist/chunk-GUFSG5TX.js +0 -2
  469. package/dist/chunk-GYIZ4NXB.js +0 -2
  470. package/dist/chunk-GZIUDL6G.js +0 -2
  471. package/dist/chunk-H5EXS3HM.js +0 -2
  472. package/dist/chunk-HCXEQRFF.js +0 -18
  473. package/dist/chunk-HEHOQQKH.js +0 -2
  474. package/dist/chunk-HKGFPJ4T.js +0 -4
  475. package/dist/chunk-HLZTEXRA.js +0 -2
  476. package/dist/chunk-HOENASQM.js +0 -3
  477. package/dist/chunk-HVF5VBG6.js +0 -2
  478. package/dist/chunk-I55I7XXP.js +0 -2
  479. package/dist/chunk-IDFEUFKS.js +0 -2
  480. package/dist/chunk-IHGQTTVW.js +0 -2
  481. package/dist/chunk-IICPE7B2.js +0 -20
  482. package/dist/chunk-IL676XCC.js +0 -18
  483. package/dist/chunk-IW5XQG5G.js +0 -2
  484. package/dist/chunk-IZDPJ2QI.js +0 -2
  485. package/dist/chunk-J66VOFW6.js +0 -5
  486. package/dist/chunk-JFMEXGFE.js +0 -2
  487. package/dist/chunk-JGKUET5J.js +0 -3
  488. package/dist/chunk-JS4PGXMV.js +0 -3
  489. package/dist/chunk-JWTGMPIT.js +0 -80
  490. package/dist/chunk-JYR66JN5.js +0 -5
  491. package/dist/chunk-KFOYCQAJ.js +0 -9
  492. package/dist/chunk-KLFEXGQA.js +0 -2
  493. package/dist/chunk-KMVGRIO2.js +0 -2
  494. package/dist/chunk-KYSDI3GE.js +0 -5
  495. package/dist/chunk-L6PJPETJ.js +0 -29
  496. package/dist/chunk-LDVT66YM.js +0 -2
  497. package/dist/chunk-LEECKFCJ.js +0 -2
  498. package/dist/chunk-LMZ5PRUV.js +0 -2
  499. package/dist/chunk-LQRQN2XA.js +0 -2
  500. package/dist/chunk-LXABEJX3.js +0 -2
  501. package/dist/chunk-MNV5FSBW.js +0 -3
  502. package/dist/chunk-MPQ4OTBM.js +0 -2
  503. package/dist/chunk-MTDBHTSF.js +0 -2
  504. package/dist/chunk-MV3CDXPI.js +0 -38
  505. package/dist/chunk-MWN53KRN.js +0 -60
  506. package/dist/chunk-MXNGIEPU.js +0 -3
  507. package/dist/chunk-N2ZSIIGR.js +0 -117
  508. package/dist/chunk-N5B2NILC.js +0 -5
  509. package/dist/chunk-NJITK2GP.js +0 -2
  510. package/dist/chunk-NOGJXYFO.js +0 -2
  511. package/dist/chunk-NOYBFVJA.js +0 -554
  512. package/dist/chunk-NWQXSFFU.js +0 -3
  513. package/dist/chunk-ODDUPDP7.js +0 -13
  514. package/dist/chunk-OLIWTZI3.js +0 -3
  515. package/dist/chunk-OLNV6I6U.js +0 -2
  516. package/dist/chunk-OR2E3AGZ.js +0 -2
  517. package/dist/chunk-OSR2GEHQ.js +0 -2
  518. package/dist/chunk-OSSESPDX.js +0 -3
  519. package/dist/chunk-OWOOWNJ5.js +0 -7
  520. package/dist/chunk-P42EIXTA.js +0 -2
  521. package/dist/chunk-PJFGPYTU.js +0 -2
  522. package/dist/chunk-PP7KNN7L.js +0 -2
  523. package/dist/chunk-PU7T5QYQ.js +0 -2
  524. package/dist/chunk-PWWAJSKV.js +0 -74
  525. package/dist/chunk-PZL5T7SU.js +0 -73
  526. package/dist/chunk-QBE3YX64.js +0 -23
  527. package/dist/chunk-QGVTFRY2.js +0 -7
  528. package/dist/chunk-QOJONDS7.js +0 -2
  529. package/dist/chunk-QU5XRYB5.js +0 -4
  530. package/dist/chunk-QUU5OBVK.js +0 -11
  531. package/dist/chunk-RBLQNW26.js +0 -20
  532. package/dist/chunk-RTQ7NEKG.js +0 -81
  533. package/dist/chunk-SQXRS7BG.js +0 -4
  534. package/dist/chunk-SSK6LDPC.js +0 -2
  535. package/dist/chunk-SZHGTCPP.js +0 -7
  536. package/dist/chunk-T4N4P2K5.js +0 -16
  537. package/dist/chunk-TA3QKLLU.js +0 -2
  538. package/dist/chunk-TEBQMNVI.js +0 -43
  539. package/dist/chunk-TPFHAQ2G.js +0 -2
  540. package/dist/chunk-TQPCBMWT.js +0 -5
  541. package/dist/chunk-TQZV7KV4.js +0 -2
  542. package/dist/chunk-TRNAEQ6P.js +0 -3
  543. package/dist/chunk-TY7CRN3Z.js +0 -2
  544. package/dist/chunk-UHFYCMZO.js +0 -35
  545. package/dist/chunk-UICY4GTQ.js +0 -7
  546. package/dist/chunk-UVGEWT4Y.js +0 -26
  547. package/dist/chunk-UXW33INU.js +0 -29
  548. package/dist/chunk-VMPRET3I.js +0 -5
  549. package/dist/chunk-VNLGKHS6.js +0 -6
  550. package/dist/chunk-VQILFTEH.js +0 -2
  551. package/dist/chunk-VUPHCS7Y.js +0 -57
  552. package/dist/chunk-VVZSBTSU.js +0 -23
  553. package/dist/chunk-VZRNID6A.js +0 -2
  554. package/dist/chunk-W5OXRYGE.js +0 -7
  555. package/dist/chunk-W6STWDQI.js +0 -57
  556. package/dist/chunk-W7CXK74K.js +0 -2
  557. package/dist/chunk-WB3WYIRE.js +0 -4
  558. package/dist/chunk-WDNVY4E7.js +0 -20
  559. package/dist/chunk-WK46TNUM.js +0 -3
  560. package/dist/chunk-WNTFFKAX.js +0 -12
  561. package/dist/chunk-WOIKCX6A.js +0 -2
  562. package/dist/chunk-WUN6KBHV.js +0 -2
  563. package/dist/chunk-WYCTJDVR.js +0 -2
  564. package/dist/chunk-WYPL7GF7.js +0 -2
  565. package/dist/chunk-XDAUYDFT.js +0 -2
  566. package/dist/chunk-XDQMU3BT.js +0 -2
  567. package/dist/chunk-XFA4SSO3.js +0 -3
  568. package/dist/chunk-XGZEP6GR.js +0 -8
  569. package/dist/chunk-XPDPNWTQ.js +0 -368
  570. package/dist/chunk-XRYABF57.js +0 -8
  571. package/dist/chunk-YBGKCQIS.js +0 -2
  572. package/dist/chunk-YEN6CYC7.js +0 -16
  573. package/dist/chunk-YF5IB2LF.js +0 -2
  574. package/dist/chunk-YI2AWIHC.js +0 -3
  575. package/dist/chunk-YPWBKGFU.js +0 -2
  576. package/dist/chunk-YPWHBBIS.js +0 -2
  577. package/dist/chunk-YSH6U3L4.js +0 -3
  578. package/dist/chunk-YU5DZUZI.js +0 -10
  579. package/dist/chunk-YWO5DDRC.js +0 -16
  580. package/dist/chunk-Z4CDXYNQ.js +0 -2
  581. package/dist/chunk-ZF5KHH7C.js +0 -2
  582. package/dist/chunk-ZOHS7AQV.js +0 -21
  583. package/dist/chunk-ZTI4SBFV.js +0 -3
  584. package/dist/code-MI6F2TTU.js +0 -2
  585. package/dist/code-result-json-FXALY4HE.js +0 -2
  586. package/dist/command-descriptors-P34VABY5.js +0 -343
  587. package/dist/dataflow-4KEMJPC6.js +0 -2
  588. package/dist/dependence-slice-R7FPWD5M.js +0 -2
  589. package/dist/deps-7EMQUYUT.js +0 -2
  590. package/dist/direct-navigation-6YO234F2.js +0 -3
  591. package/dist/entry-map-KOOLR26E.js +0 -2
  592. package/dist/files-OPIPJIGZ.js +0 -2
  593. package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
  594. package/dist/hierarchy-QPD2CAER.js +0 -2
  595. package/dist/imports-M6HUXRXC.js +0 -2
  596. package/dist/members-I5MEFOCT.js +0 -2
  597. package/dist/methods-5JYGGHXA.js +0 -2
  598. package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
  599. package/dist/output-continuation-command-UPQAAKBP.js +0 -3
  600. package/dist/output-pagination-3OFL2MJV.js +0 -19
  601. package/dist/project-reindex-UKKQ5PLS.js +0 -3
  602. package/dist/queries/anchors.d.ts +0 -123
  603. package/dist/queries/anchors.js +0 -2
  604. package/dist/queries/complexity-hotspots.d.ts +0 -40
  605. package/dist/queries/complexity-hotspots.js +0 -2
  606. package/dist/queries/convergence.d.ts +0 -33
  607. package/dist/queries/convergence.js +0 -2
  608. package/dist/queries/dataflow.d.ts +0 -77
  609. package/dist/queries/dataflow.js +0 -2
  610. package/dist/queries/deep-chains.d.ts +0 -5
  611. package/dist/queries/deep-chains.js +0 -2
  612. package/dist/queries/extract-candidates.d.ts +0 -52
  613. package/dist/queries/extract-candidates.js +0 -2
  614. package/dist/queries/isolated.d.ts +0 -24
  615. package/dist/queries/isolated.js +0 -2
  616. package/dist/queries/plan-context.d.ts +0 -33
  617. package/dist/queries/plan-context.js +0 -2
  618. package/dist/queries/reference-neighborhood.d.ts +0 -4
  619. package/dist/queries/reference-neighborhood.js +0 -2
  620. package/dist/queries/reference-reachability.d.ts +0 -48
  621. package/dist/queries/reference-reachability.js +0 -2
  622. package/dist/queries/self-audit.d.ts +0 -63
  623. package/dist/queries/self-audit.js +0 -2
  624. package/dist/queries/similar-chains.d.ts +0 -48
  625. package/dist/queries/similar-chains.js +0 -2
  626. package/dist/queries/slice.d.ts +0 -4
  627. package/dist/queries/slice.js +0 -2
  628. package/dist/queries/stale-abstractions.d.ts +0 -72
  629. package/dist/queries/stale-abstractions.js +0 -2
  630. package/dist/queries/system-map.d.ts +0 -449
  631. package/dist/queries/system-map.js +0 -2
  632. package/dist/queries/trace.js +0 -2
  633. package/dist/queries/twin-ab.d.ts +0 -66
  634. package/dist/queries/twin-ab.js +0 -2
  635. package/dist/queries/value-flow.d.ts +0 -43
  636. package/dist/queries/value-flow.js +0 -2
  637. package/dist/queries/wrapper-candidates.d.ts +0 -34
  638. package/dist/queries/wrapper-candidates.js +0 -2
  639. package/dist/refs-PSU4JZZW.js +0 -2
  640. package/dist/refs-pagination-JG6CJMRC.js +0 -2
  641. package/dist/slice-HYRATV64.js +0 -2
  642. package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
  643. package/dist/stats-OOJ74B32.js +0 -2
  644. package/dist/surface-VTGDYWF5.js +0 -2
  645. package/dist/symbol-resolution-WD5EU5JE.js +0 -2
  646. package/dist/system-LRQNFOR2.js +0 -2
  647. package/dist/trace-F4B6OLL4.js +0 -2
  648. package/dist/value-flow-VRPZY72V.js +0 -2
  649. package/skills/concrete-plan/SKILL.md +0 -8
  650. package/skills/concrete-plan/agents/openai.yaml +0 -4
@@ -0,0 +1,2 @@
1
+ import{d as f}from"./chunk-TZCVNCAN.js";import{b,d as y}from"./chunk-QXEUDXBT.js";import{H as d,s as m}from"./chunk-J5FJMODQ.js";import{c as u,d as s,f as c,k as h}from"./chunk-YULZRALL.js";import{basename as p}from"path";function L(t,n){let o=n.className,e=b(t,o);return e.match?e.total>1?{kind:"ambiguous",query:o,total:e.total,candidates:[g(e.match),...e.candidates]}:{kind:"matched",query:o,owner:S(e.match),methods:M(t,e.match)}:{kind:"missing",query:o,suggestions:y(t,o,5)}}function C(t,n){let o=L(t,{className:n});if(o.kind==="missing")throw new Error(`No class definition matched '${n}'.`);if(o.kind==="ambiguous"){let e=o.candidates.map(r=>`${r.relativePath}:${r.startLine+1}`).join(", ");throw new Error(`Class '${n}' is ambiguous across ${o.total} definitions (${e}). Qualify it with a path or exact SCIP symbol identity.`)}return o.methods}function M(t,n){let o=s(n.symbol),r=new f(t).definitionsForFile(n.relativePath).filter(i=>c(i.symbol)),a=r.filter(i=>i.enclosingSymbol===n.symbol||h(n.symbol,i.symbol)),l=(a.length>0?a:w(p(n.relativePath))===o?r.filter(i=>i.symbol.includes("<invalid-global-code>")):[]).map(i=>({startLine:i.startLine,endLine:i.endLine,name:s(i.symbol)}));return m(n.relativePath)!=="clojure"?l:v(l,R(t,n))}function g(t){return{symbol:t.symbol,shortName:u(t.symbol),relativePath:t.relativePath,startLine:t.startLine}}function S(t){return{...g(t),endLine:t.endLine}}function w(t){return t.replace(/\.[^.]+$/,"")}function R(t,n){let o=s(n.symbol);return o?(d(t,n.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===o).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function v(t,n){let o=new Map;for(let e of[...t,...n])o.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...o.values()].sort((e,r)=>e.startLine-r.startLine||e.endLine-r.endLine)}export{L as a,C as b};
2
+ //# sourceMappingURL=chunk-P6ODM7BY.js.map
@@ -1,3 +1,3 @@
1
- import{l as s,n as o}from"./chunk-3L2ZBPEX.js";import{d as i}from"./chunk-DRENNWRG.js";function u(r,e){let t=s(r,e.relativePath);if(t.length===0)return!1;let n=i(e.symbol);if(!n)return!1;let c=t.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
1
+ import{n as s,q as o}from"./chunk-J5FJMODQ.js";import{d as i}from"./chunk-YULZRALL.js";function u(r,e){let t=s(r,e.relativePath);if(t.length===0)return!1;let n=i(e.symbol);if(!n)return!1;let c=t.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
2
  `),a=o(n);return new RegExp(`^\\s*export\\s+(?:default\\s+)?(?:(?:async\\s+)?function\\s+${a}\\b|(?:abstract\\s+)?class\\s+${a}\\b|(?:interface|type|enum|namespace|module)\\s+${a}\\b|(?:const|let|var)\\s+${a}\\b)`,"m").test(c)?!0:p(t,n)}function p(r,e){if(!e)return!1;let t=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${o(e)}\\b`);return r.some(n=>t.test(n))}export{u as a};
3
- //# sourceMappingURL=chunk-XBGWL66K.js.map
3
+ //# sourceMappingURL=chunk-PAVGPRHJ.js.map
@@ -0,0 +1,2 @@
1
+ var t=null,l=null,o=null;function g(e,i){v(e),o?.source(e,i)}function R(e){v(e),o?.unavailable(e)}function b(e,i){l?.(e,i)}function v(e){t?.(e)}function p(e,i,d,s){let a=t,u=l,c=o;o=s?{source(r,n){c?.source(r,n),s.source(r,n)},unavailable(r){c?.unavailable(r),s.unavailable(r)}}:c,t=a?r=>{a(r),e(r)}:e,l=d?(r,n)=>{u?.(r,n),d(r,n)}:u;try{return i()}finally{t=a,l=u,o=c}}export{g as a,R as b,b as c,v as d,p as e};
2
+ //# sourceMappingURL=chunk-PH52RA7D.js.map
@@ -0,0 +1,3 @@
1
+ import{a as P,b,c as L,d as g,e as w,i as Q}from"./chunk-DA7RPPDF.js";import{m as N,o as T}from"./chunk-T6DK3ZP7.js";import{A as C,B as v,v as l,z as _}from"./chunk-5TNQJUR2.js";function S(e,t){return e.reason instanceof Error?e.reason:new Error(t)}function $(e,t){if(e?.aborted)throw S(e,t)}import{randomUUID as ae}from"crypto";import{closeSync as ce,fsyncSync as de,linkSync as le,mkdirSync as ue,openSync as fe,statSync as ye,unlinkSync as me,writeSync as pe}from"fs";import{dirname as E}from"path";var A="scip-query-process-lock",h=1,I=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:g,readProcessIdentity:L,randomToken:()=>ae(),makeDirectory:e=>ue(e,{recursive:!0}),openFile:(e,t,r)=>fe(e,t,r),writeFile:(e,t,r,n)=>pe(e,t,r,n),syncFile:e=>de(e),closeFile:e=>ce(e),linkFile:(e,t)=>le(e,t),readFile:e=>l(e,"process lock record"),statFile:e=>{let t=ye(e);return{dev:t.dev,ino:t.ino,size:t.size,mtimeMs:t.mtimeMs}},removeFile:e=>me(e)}),z=e=>{if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.pid;return typeof t=="number"&&Number.isSafeInteger(t)&&t>0?{pid:t}:null};function j(e,t){let r=t.runtime??I;r.makeDirectory(E(e));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:B(e,t,r),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=y(e,{parseLegacy:t.parseLegacy,runtime:r});if(i===0&&ge(e,s,{creationGraceMs:t.creationGraceMs,parseLegacy:t.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:y(e,{parseLegacy:t.parseLegacy,runtime:r})}}function y(e,t={}){let r=t.runtime??I,n,i;try{n=r.statFile(e),i=r.readFile(e)}catch(d){return d.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=be(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:Re(s),parsed:o};let a=t.parseLegacy?.(o)??null;return a?{state:"legacy",raw:i,identity:n,owner:a,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function be(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(!Pe(t)||!Le(t))return null;let r=ke(t);if(!r)return null;let{processIdentity:n}=r;return{protocol:A,version:h,kind:t.kind,pid:t.pid,token:t.token,...n?{processIdentity:n}:{},startedAt:t.startedAt,...t.detail?{detail:t.detail}:{}}}function ke(e){let t=e.processIdentity===void 0?null:P(e.processIdentity);return e.processIdentity!==void 0&&(!t||t.pid!==e.pid)?null:{processIdentity:t}}function Pe(e){return e.protocol===A&&e.version===h&&typeof e.kind=="string"&&e.kind.trim()!==""&&typeof e.pid=="number"&&Number.isSafeInteger(e.pid)&&e.pid>0&&typeof e.token=="string"&&e.token.trim()!==""}function Le(e){return typeof e.startedAt=="string"&&Number.isFinite(Date.parse(e.startedAt))&&(e.detail===void 0||typeof e.detail=="object"&&e.detail!==null&&!Array.isArray(e.detail))}function ge(e,t,r={}){let n=r.runtime??I;if(!G(t,n))return!1;let i=Ie(`${e}.reclaim`,n);if(!i)return!1;try{let o=y(e,{parseLegacy:r.parseLegacy,runtime:n});return!K(t,o)||!G(o,n)?!1:x(e,n)}finally{i.release()}}function B(e,t,r){let n=t.directoryDurability??"durable",i=t.pid??process.pid,o=r.randomToken(),s=t.processIdentity===void 0?r.readProcessIdentity(i):t.processIdentity,a={protocol:A,version:h,kind:t.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(r.wallNow()).toISOString(),...t.detail?{detail:t.detail}:{}},d=`${e}.${o}.candidate`;Fe(d,a,r);try{r.linkFile(d,e)}catch(f){throw q(d,r),f}if(q(d,r),n==="durable")try{V(E(e),r)}catch(f){throw Se(e,a,r),f}let u=!1;return{path:e,record:a,release:()=>u?!1:(u=!0,J(e,a,r,n))}}function Se(e,t,r=I){return J(e,t,r,"durable")}function J(e,t,r,n){let i=y(e,{runtime:r});return i.state!=="valid"||!i.record||i.record.pid!==t.pid||i.record.token!==t.token||t.processIdentity&&(!i.record.processIdentity||!b(t.processIdentity,i.record.processIdentity))?!1:x(e,r,n)}function Ie(e,t){for(let r=0;r<2;r+=1)try{return B(e,{kind:"reclaim-guard",runtime:t},t)}catch(n){if(n.code!=="EEXIST"||!we(e,t,r))return null}return null}function G(e,t){if(e.state==="missing")return!1;if(e.owner){if(!t.isProcessAlive(e.owner.pid))return!0;if(!e.owner.processIdentity)return!1;let r=t.readProcessIdentity(e.owner.pid);return r!==null&&!b(e.owner.processIdentity,r)}return!1}function K(e,t){return e.state===t.state&&e.raw===t.raw&&e.identity!==void 0&&t.identity!==void 0&&e.identity.dev===t.identity.dev&&e.identity.ino===t.identity.ino&&e.identity.size===t.identity.size&&e.identity.mtimeMs===t.identity.mtimeMs}function Re(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function V(e,t){let r;try{r=t.openFile(e,"r")}catch(n){if(v(n,process.platform))return;throw n}try{t.syncFile(r)}catch(n){if(!v(n,process.platform))throw n}finally{t.closeFile(r)}}function x(e,t,r="durable"){try{return t.removeFile(e),r==="durable"&&V(E(e),t),!0}catch{return!1}}function q(e,t){try{t.removeFile(e)}catch{}}function Fe(e,t,r){let n=r.openFile(e,"wx",384),i;try{C(n,Buffer.from(`${JSON.stringify(t)}
2
+ `),r,"process lock"),r.syncFile(n)}catch(o){i=o}try{r.closeFile(n)}catch(o){i??=o}if(i!==void 0)throw q(e,r),i}function we(e,t,r){let n=y(e,{runtime:t});if(r>0||!G(n,t))return!1;let i=y(e,{runtime:t});return K(n,i)?x(e,t):!1}import{join as ve}from"path";function Pt(e,t={}){return O(ve(e,"gc.lock"),t)}function O(e,t={}){let r=t.waitMs??0,n=t.pollMs??10,i=t.now??w,o=i()+r;do{let s=H(e,t.directoryDurability);if(s)return U(s);let a=o-i();if(a<=0)return null;Ge(Math.min(n,a))}while(i()<=o);return null}async function Lt(e,t={}){let r=t.waitMs??0,n=t.pollMs??10,i=t.now??w,o=i()+r;do{$(t.signal,"Lock acquisition was aborted.");let s=H(e,t.directoryDurability);if(s)return U(s);let a=o-i();if(a<=0)return null;await qe(Math.min(n,a),t.signal)}while(i()<=o);return null}function H(e,t){let r=j(e,{kind:"generic",parseLegacy:z,...t?{directoryDurability:t}:{}});return r.kind==="acquired"?r.lock:null}function U(e){return{release:()=>{e.release()}}}function Ge(e){let t=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(t,0,0,e)}function qe(e,t){return t?.aborted?Promise.reject(S(t,"Lock acquisition was aborted.")):new Promise((r,n)=>{let i=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e),o=()=>{clearTimeout(i),t?.removeEventListener("abort",o),n(t?S(t,"Lock acquisition was aborted."):new Error("Lock acquisition was aborted."))};t?.addEventListener("abort",o,{once:!0})})}import{createHash as Ee,randomUUID as Ae}from"crypto";import{existsSync as m,mkdirSync as he,readdirSync as xe,rmSync as Y,statSync as Z}from"fs";import{basename as Oe,dirname as R,join as c}from"path";var De=1,Me=1,Ne=".scipquery-generations",Te="manifest.json",ee="readers",_e="gc.lock",Ce=128,k=new Map,te={pid:process.pid,now:()=>new Date,randomToken:()=>Ae(),isProcessAlive:g,readProcessIdentity:L};function p(e){return c(R(e),Ne)}function Qe(e){return c(p(e),_e)}function ht(e,t=te){let r=O(Qe(e.dbPath),{waitMs:5e3,directoryDurability:"recoverable"});if(!r)throw new Error("SQLite generation retention is busy; retry opening the index.");let n;try{let i=Ve(e);if(i.source!=="immutable")return{generation:i,release(){}};let o=t.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(o))throw new Error("SQLite generation reader token is unsafe.");let s=c(p(e.dbPath),ee);he(s,{recursive:!0}),n=c(s,`${t.pid}-${o}.json`);let a=t.readProcessIdentity(t.pid);Q(n,{version:1,token:o,generationIdentity:i.identity,pid:t.pid,...a?{processIdentity:a}:{},acquiredAt:t.now().toISOString()},{spacing:2,trailingNewline:!0});let d=!1;return{generation:i,release(){d||!n||(d=!0,Y(n,{force:!0}))}}}finally{r.release()}}function xt(e,t,r=te,n={}){let i=c(p(e),ee);if(!m(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,s=0,a=0,d=0;for(let u of xe(i,{withFileTypes:!0})){if(!u.isFile()||!u.name.endsWith(".json"))continue;let f=c(i,u.name),F=it(f);if(!F){d+=1;for(let se of t)o.add(se);continue}if(!Be(F,r)){n.removeStale!==!1&&(Y(f,{force:!0}),a+=1);continue}s+=1,o.add(F.generationIdentity)}return{protectedGenerations:o,activeLeases:s,staleLeasesRemoved:a,malformedLeases:d}}function $e(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e,r=t.processIdentity===void 0?null:P(t.processIdentity);return!ze(t)||!je(t,r)?null:{version:1,token:t.token,generationIdentity:t.generationIdentity,pid:t.pid,...r?{processIdentity:r}:{},acquiredAt:t.acquiredAt}}function ze(e){return e.version===1&&typeof e.token=="string"&&e.token.trim()!==""&&typeof e.generationIdentity=="string"&&/^[a-f0-9]{64}$/.test(e.generationIdentity)}function je(e,t){return typeof e.pid=="number"&&Number.isSafeInteger(e.pid)&&e.pid>0&&typeof e.acquiredAt=="string"&&Number.isFinite(Date.parse(e.acquiredAt))&&(e.processIdentity===void 0||!!(t&&t.pid===e.pid))}function Be(e,t){if(!t.isProcessAlive(e.pid))return!1;if(!e.processIdentity)return!0;let r=t.readProcessIdentity(e.pid);return r===null||b(e.processIdentity,r)}function re(e){try{let t=JSON.parse(l(c(p(e),"state.json"),"SQLite generation state"));return Ye(t)?t:null}catch{return null}}function Je(e,t){return Ke(p(e),t)}function Ke(e,t){try{let r=JSON.parse(l(c(e,t,Te),"SQLite generation manifest"));return Xe(r,t)?r:null}catch{return null}}function Ve(e){let t=re(e.dbPath);if(t){let r=Ue(e,t.currentGeneration);if(r)return r;if(t.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${t.currentGeneration} is missing or invalid.`)}if(m(c(R(e.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return We(e,t?.currentGeneration)}function Ot(e){let t=re(e);if(t)return t.currentGeneration;try{let r=c(R(e),"meta.json"),n=m(r)?l(r,"reindex metadata"):void 0;return ne(e,n)}catch{return null}}function He(e){return T(N(e))??e}function Ue(e,t){try{let r=c(p(e.dbPath),t),n=Je(e.dbPath,t);if(!n)return null;let i=D(r,n.database),o=n.index?D(r,n.index):void 0,s=n.metadata?D(r,n.metadata):void 0;return!oe(i,n.database)||!X(o,n.index)||!X(s,n.metadata)?null:{identity:t,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:l(s,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function We(e,t){let r=ie(e.dbPath),n=c(R(e.dbPath),"meta.json"),i=m(n)?l(n,"reindex metadata"):void 0,o=m(e.indexPath)?e.indexPath:void 0;return{identity:t??ne(e.dbPath,i),databasePath:e.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:n,metadataRaw:i},source:"legacy",databaseFileIdentity:r}}function ne(e,t){let r=Ee("sha256").update("sqlite-generation-legacy-v1\0");return t!==void 0&&r.update(He(t)),r.update(`\0${ie(e)}`),r.digest("hex")}function ie(e){let t=Z(e);return`${t.dev}:${t.ino}:${t.size}:${t.mtimeMs}`}function D(e,t){if(Oe(t.file)!==t.file||t.file==="."||t.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return c(e,t.file)}function oe(e,t){if(!m(e))return!1;let r=W(e);if(!r||r.size!==t.size)return!1;let n=`${e}\0${t.sha256}\0${r.identity}`;if(k.has(n))return!0;let i=_(e,{inputKind:"immutable SQLite generation artifact",maxBytes:t.size}),o=W(e);if(!o||o.identity!==r.identity||i!==t.sha256)return!1;for(k.set(n,!0);k.size>Ce;){let s=k.keys().next().value;if(s===void 0)break;k.delete(s)}return!0}function W(e){let t=Z(e,{bigint:!0});return t.isFile()?{identity:`${t.dev}:${t.ino}:${t.size}:${t.mtimeNs}:${t.ctimeNs}`,size:Number(t.size)}:null}function Xe(e,t){return e.version===Me&&e.identity===t&&M(e.database)&&(e.index===void 0||M(e.index))&&(e.metadata===void 0||M(e.metadata))}function M(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.file=="string"&&!!t.file&&Number.isSafeInteger(t.size)&&(t.size??-1)>=0&&typeof t.sha256=="string"&&/^[a-f0-9]{64}$/.test(t.sha256)}function Ye(e){return e.version===De&&typeof e.currentGeneration=="string"&&!!e.currentGeneration&&typeof e.publishedAt=="string"&&Number.isFinite(Date.parse(e.publishedAt))&&(e.artifactSet===void 0||e.artifactSet==="immutable-v1")&&Ze(e.stableMirrors)&&et(e.previousGeneration)&&tt(e.publication)}function Ze(e){if(e===void 0)return!0;if(!e||typeof e!="object")return!1;let t=e;return typeof t.databaseFileIdentity=="string"&&!!t.databaseFileIdentity&&(t.indexFileIdentity===void 0||typeof t.indexFileIdentity=="string"&&!!t.indexFileIdentity)}function et(e){if(e===void 0)return!0;if(!e||typeof e!="object")return!1;let t=e;return typeof t.generationIdentity=="string"&&!!t.generationIdentity&&typeof t.databasePath=="string"&&!!t.databasePath&&(t.metadataPath===void 0||typeof t.metadataPath=="string"&&!!t.metadataPath)}function tt(e){if(e===void 0)return!0;if(!e||typeof e!="object")return!1;let t=e,r=[t.converterDurationMs,t.affectedDocumentCount,t.changedDocumentCount,t.producerDurationMs,t.materializationDurationMs,t.patchDurationMs].filter(n=>n!==void 0);return rt(t,r)&&nt(t)&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")}function rt(e,t){return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&t.every(r=>typeof r=="number"&&Number.isFinite(r)&&r>=0)}function nt(e){return(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)}function X(e,t){return!t||!!(e&&oe(e,t))}function it(e){let t;try{t=$e(JSON.parse(l(e,"SQLite generation reader lease")))}catch{t=null}return t}export{S as a,$ as b,z as c,j as d,y as e,ge as f,Pt as g,O as h,Lt as i,De as j,Me as k,Ne as l,Te as m,p as n,Qe as o,ht as p,xt as q,re as r,Je as s,Ke as t,Ve as u,Ot as v,He as w,ie as x};
3
+ //# sourceMappingURL=chunk-PKN354TH.js.map
@@ -0,0 +1,11 @@
1
+ import{a as x}from"./chunk-AOSIYPTA.js";import{b}from"./chunk-6LSEIIF7.js";import{i as S}from"./chunk-AGWFSTXC.js";import{a as k,b as C,i as y}from"./chunk-4WCUBZU3.js";import{c as v}from"./chunk-E3FDPXZK.js";import{d as R}from"./chunk-5D2LVK7O.js";import{c as u,qa as f,ra as h}from"./chunk-5TNQJUR2.js";function F(e,n){let a=u(n),t=[],o="complete";M(e,a,t);let i=!1;try{i=k(e,a),i&&s(t,"published-api","package manifest export");for(let r of C(e,a))s(t,"operational-root",r)}catch(r){o="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${_(r)}`)}try{let r=f(e.config.projectRoot,a,{maxBytes:8388608,inputKind:"change-surface source"});I(r)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(r){o="partial",s(t,"metadata-unavailable",h(r)?"indexed source file is unavailable on disk":`source metadata unavailable: ${_(r)}`)}return{operationalRoot:t.some(r=>r.kind==="operational-root"),publishedApi:i,coverage:o,reasons:t}}function D(e,n){let a=e.config.entryRoots;return a?a.files?.some(t=>u(t)===n)?!0:a.pathPrefixes?.some(t=>n.startsWith(u(t)))??!1:!1}function I(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,n,a){e.some(t=>t.kind===n&&t.detail===a)||e.push({kind:n,detail:a})}function _(e){return e instanceof Error?e.message:String(e)}function M(e,n,a){let t=v(n);t==="entry"&&s(a,"operational-root","structural entrypoint path"),t==="worker"&&s(a,"operational-root","worker launch convention"),y(n)&&s(a,"operational-root","framework-discovered entrypoint"),D(e,n)&&s(a,"operational-root","configured entry root")}function Q(e,n,a={}){let t=x(e,n);if(!t)return null;let o=N(e,t);if(!o||e.isIgnored(o.relative_path))return null;let i=[],r=new Set,p=P(e,o.relative_path),m=F(e,o.relative_path),E=a.semantic===!1?new Map:S(e,p);for(let l of p){let d=j(e,o,l,E.get(l.symbolId)??new Set);for(let w of d)r.add(w);let c=d.size,g=O(c),L=[...m.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];i.push({symbol:l.symbol,shortName:R(l.symbol),startLine:l.startLine,endLine:l.endLine,externalConsumers:c,externalConsumerRiskLevel:g,riskLevel:T(g,m),riskReasons:L})}return{file:o.relative_path,symbols:i,totalExternalConsumers:r.size,fileRisk:m}}function N(e,n){return e.get(`SELECT id, relative_path FROM documents
2
+ WHERE relative_path = ?
3
+ ${e.pathExclusionsFor("documents")}
4
+ LIMIT 1`,n)??null}function P(e,n){return new b(e).definitionsForFile(n).sort((a,t)=>a.startLine-t.startLine||a.endLine-t.endLine)}function j(e,n,a,t){let o=e.all(`SELECT DISTINCT consumer_d.relative_path
5
+ FROM mentions m
6
+ JOIN chunks c ON m.chunk_id = c.id
7
+ JOIN documents consumer_d ON consumer_d.id = c.document_id
8
+ WHERE m.symbol_id = ?
9
+ AND m.role != 1
10
+ AND c.document_id != ?`,a.symbolId,n.id);return new Set([...o.map(i=>i.relative_path).filter(i=>!e.isIgnored(i)),...[...t].filter(i=>i!==n.relative_path&&!e.isIgnored(i))])}function O(e){return e>10?"high":e>0?"medium":"low"}function T(e,n){return e==="high"?"high":e==="medium"||n.operationalRoot||n.publishedApi||n.coverage==="partial"?"medium":"low"}export{Q as a};
11
+ //# sourceMappingURL=chunk-PWOASWEG.js.map
@@ -0,0 +1,2 @@
1
+ import{a as j,b as R}from"./chunk-PH52RA7D.js";import{d as D}from"./chunk-JEVRKFRL.js";import{e as h}from"./chunk-GZKFETP5.js";import{o as x,r as m,s as E,t as L,v as S,x as I}from"./chunk-TKD34PHN.js";import{o as k}from"./chunk-U5RIG3JP.js";import{createHash as H}from"crypto";import{isUtf8 as w}from"buffer";import{TextDecoder as X}from"util";var O=new X("utf-8",{fatal:!0}),V=h("repository-text-indexed-documents",{clearGroups:[]}),W=h("repository-text-indexed-fingerprints",{clearGroups:[]});function $(e){return I(e.config.projectRoot)}function oe(e,t){let o=k(t),s;try{s=m(e.config.projectRoot,o,{inputKind:"repository text file"})}catch(a){if(R(o),S(a)||a instanceof x)return null;throw a}j(o,s.toString("utf8"));let r=Q(s);return r===null?(w(s)||R(o),null):P(o,s,r,U(e),M(e))}function ae(e,t,o){let s=$(e).filter(n=>!t.scope||n.includes(t.scope)),r=U(e),a=M(e),l=[],B=[],F=[],p=0,g=0,y={aligned:0,stale:0,unavailable:0},u=q(t.literalBytes),T=u.length>0?Buffer.allocUnsafe(1024*1024):void 0,N=(n,c,i)=>{p+=c,g+=1;let f=b(n,i,r,a);y[f.state]+=1},C=(n,c)=>{let i=u.length===1?E(e.config.projectRoot,n,u[0],{inputKind:"repository text file",computeSha256:c,scratchBuffer:T}):L(e.config.projectRoot,n,u,{inputKind:"repository text file",computeSha256:c,scratchBuffer:T});if(!i.isUtf8Text)return l.push(n),null;let f=i.sha256;N(n,i.byteLength,f);let d="matchedLiteralIndexes"in i?i.matchedLiteralIndexes:i.includesLiteral?[0]:[];return d.length===0||!i.bytes?null:{bytes:i.bytes,knownSha256:f,matchedLiteralIndexes:d}},K=n=>{try{return u.length>0?C(n,a.has(n)):{bytes:m(e.config.projectRoot,n,{inputKind:"repository text file"}),knownSha256:void 0,matchedLiteralIndexes:[]}}catch(c){return c instanceof x?(F.push(n),null):(S(c)||B.push(n),null)}};for(let n of s){let c=K(n);if(!c)continue;let{bytes:i,matchedLiteralIndexes:f}=c,d=c.knownSha256;if(u.length===0&&!_(i)){l.push(n);continue}if(u.length===0){p+=i.byteLength,g+=1,d=a.has(n)?A(i):void 0;let G=b(n,d,r,a);y[G.state]+=1}if(t.includeBytes&&!t.includeBytes(n,i))continue;let z=O.decode(i);o(P(n,i,z,r,a,d),f)}return{candidateFiles:s.length,scannedTextFiles:g,semanticFiles:y,scannedBytes:p,skippedBinaryPaths:l,skippedUnreadablePaths:B,skippedOversizedPaths:F}}function q(e){return e?Buffer.isBuffer(e)?[e]:[...e]:[]}function P(e,t,o,s,r,a){let l=a??A(t);return{relativePath:e,text:o,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:l},semantic:b(e,l,s,r)}}}function b(e,t,o,s){if(!s.has(e))return{state:"unavailable",basis:"no-compiler-document"};let r=o.get(e);return!r||!t?{state:"unavailable",basis:"fingerprint-unavailable"}:{state:r===t?"aligned":"stale",basis:"indexed-input-fingerprint"}}function M(e){return V.get(e,()=>new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path)))}function U(e){return W.get(e,()=>J(e.generation.metadataRaw))}function J(e){let t=new Map;if(!e)return t;let o=D(e);if(o.kind!=="legacy"&&o.kind!=="supported")return t;let s=o.metadata.fingerprint;if(!v(s)||!Array.isArray(s.files))return t;for(let r of s.files)!v(r)||typeof r.path!="string"||typeof r.hash!="string"||t.set(r.path,r.hash);return t}function Q(e){return _(e)?O.decode(e):null}function _(e){return!e.includes(0)&&w(e)}function A(e){return H("sha256").update(e).digest("hex")}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{$ as a,oe as b,ae as c,U as d};
2
+ //# sourceMappingURL=chunk-QIWXRW72.js.map
@@ -0,0 +1,2 @@
1
+ import{a as m,b as g,c}from"./chunk-DVFP6PZI.js";import{Z as p}from"./chunk-J5FJMODQ.js";import{a as f,c as b,e as a}from"./chunk-YULZRALL.js";import{SymbolInformation_Kind as o}from"@c4312/scip";function _(n){let t=n.trim().toLowerCase();if(!t)return null;if(/^\d+$/.test(t)){let i=Number(t);return m.has(i)?i:null}let r=g.get(t);if(r!==void 0)return r;let e=[...m].filter(([,i])=>i.toLowerCase().includes(t));return e.length===1?e[0][0]:null}function L(n,t,r={}){let{scope:e,limit:i=100}=r,u=_(t);if(u===null)throw new Error(`Unknown or ambiguous symbol kind: ${JSON.stringify(t)}. Use an exact SCIP kind name or number.`);return y(n,e).map(s=>({row:s,resolvedKind:k(s)})).filter(s=>s.resolvedKind===u).slice(0,i).map(({row:s,resolvedKind:d})=>({symbol:s.symbol,shortName:b(s.symbol),kind:d,kindName:c(d),relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line}))}function v(n,t={}){let r=new Map;for(let e of y(n,t.scope)){let i=k(e);i===null||i===0||r.set(i,(r.get(i)??0)+1)}return[...r.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:c(e),count:i}))}function y(n,t){return p(n,{scope:t}).map(h)}function h(n){return{symbol:n.symbol,kind:n.kind,documentation:n.documentation,enclosing_symbol:n.enclosingSymbol,relative_path:n.relativePath,start_line:n.startLine,end_line:n.endLine}}function k(n){return n.kind!==null&&n.kind!==0?K(n.kind,n.symbol,n.documentation):x(n.symbol,n.documentation,n.enclosing_symbol)}function K(n,t,r){let e=(r??"").toLowerCase();if(a(t)==="type"){if(e.includes("type "))return o.TypeAlias;if(e.includes("interface "))return o.Interface;if(e.includes("struct "))return o.Struct;if(e.includes("trait "))return o.Trait;if(e.includes("class "))return o.Class}return n}function x(n,t,r){let e=f(n);if("kind"in e)return null;let i=e.descriptors,u=i[i.length-2]??null,l=a(n),s=(t??"").toLowerCase();return l==="type"?K(o.Class,n,t):l==="method"?u?.suffix==="type"?o.Method:o.Function:l==="namespace"?o.Module:l!=="term"?null:N(s,r,u?.suffix??null)}function N(n,t,r){return n.includes("async def ")||n.includes("def ")?o.Function:(t?a(t):r)==="type"?o.Field:o.Variable}export{L as a,v as b};
2
+ //# sourceMappingURL=chunk-QJRMOK5N.js.map
@@ -1,4 +1,4 @@
1
- import{c as d}from"./chunk-IW5XQG5G.js";import{basename as u}from"path";var f=d("indexed-document-paths",{clearGroups:["whole-project"]});function x(t,e={}){let r=g(e);return[...f.get(t,r,()=>{let s=e.scope?"AND relative_path LIKE ?":"",i=e.like?"AND relative_path LIKE ?":"",l=[...e.scope?[`%${e.scope}%`]:[],...e.like?[e.like]:[]],c=t.all(`SELECT relative_path
1
+ import{c as d}from"./chunk-GZKFETP5.js";import{basename as u}from"path";var f=d("indexed-document-paths",{clearGroups:["whole-project"]});function x(t,e={}){let r=g(e);return[...f.get(t,r,()=>{let s=e.scope?"AND relative_path LIKE ?":"",i=e.like?"AND relative_path LIKE ?":"",l=[...e.scope?[`%${e.scope}%`]:[],...e.like?[e.like]:[]],c=t.all(`SELECT relative_path
2
2
  FROM documents
3
3
  WHERE 1 = 1
4
4
  ${t.pathExclusionsFor("documents")}
@@ -8,4 +8,4 @@ import{c as d}from"./chunk-IW5XQG5G.js";import{basename as u}from"path";var f=d(
8
8
  FROM documents
9
9
  WHERE relative_path = ?
10
10
  ${t.pathExclusionsFor("documents")}`,o).filter(n=>!t.isIgnored(n.relative_path)).map(n=>({relativePath:n.relative_path,score:h(n.relative_path,o)}));if(s.length>0)return s;let i=x(t,{includeIgnored:!1}).map(n=>({relativePath:n,score:h(n,o)})).filter(n=>n.score>0).sort((n,a)=>a.score-n.score||n.relativePath.localeCompare(a.relativePath)),l=i.filter(n=>n.score>=1100);if(l.length>0)return r.allowMultiple?l:[l[0]];if(r.requirePathMatch)return[];let c=i.filter(n=>n.score>=800);return c.length>0?r.allowMultiple?c:[c[0]]:r.allowMultiple?i:i.slice(0,1)}function h(t,e){let r=p(t),o=u(r),s=u(e),i=0;return r===e&&(i+=1200),r.endsWith(`/${e}`)&&(i+=1100),o===s&&(i+=900),r.startsWith(`${e}/`)&&(i+=850),r.includes(e)&&(i+=250),i}function p(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{x as a,E as b};
11
- //# sourceMappingURL=chunk-YXPUP5G2.js.map
11
+ //# sourceMappingURL=chunk-QOIXNWQR.js.map
@@ -0,0 +1,3 @@
1
+ import{U as u,V as p,X as d,fa as C}from"./chunk-J5FJMODQ.js";import{b as M}from"./chunk-QOIXNWQR.js";import{c as D}from"./chunk-GZKFETP5.js";import{b as _,c as y,d as f,f as R,g as L,h as N}from"./chunk-YULZRALL.js";var A=D("symbol-resolution",{clearGroups:[]});function ce(e,r){return E(e,r).match}function E(e,r){return A.get(e,r,()=>{let t=H(e,r.trim()).filter(i=>!e.isIgnored(i.relative_path));if(t.length>0)return h(e,t);let n=T(e,r);if(n&&!e.isIgnored(n.relative_path))return h(e,[n]);let o=O(e,r);if(o.length>0)return h(e,o);let s=z(e,r);return s.length>0?h(e,s):K(e,r)})}function O(e,r){let t=r.trim().replace(/\(\)$/u,""),n=t.lastIndexOf(":");if(n<=0||n===t.length-1||t.startsWith("local:"))return[];let o=t.slice(n+1);if(!/^[\p{L}_$][\p{L}\p{N}_$]*$/u.test(o))return[];let s=[`/${o}().`,`/${o}.`,`/${o}#`,`#${o}().`,`#${o}.`,`/${o}/`],i=`gs.display_name = ? OR ${s.map(()=>"instr(gs.symbol, ?) > 0").join(" OR ")}`,a=[o,...s],l=u(e,{where:i,params:a,orderBy:"d.relative_path, der.start_line",limit:200}),m=l.length>0?[]:p(e,{where:i,params:a,orderBy:"d.relative_path, start_line",limit:200}),S=d(l,m).filter(c=>!e.isIgnored(c.relative_path)).filter(c=>y(c.symbol).replace(/\(\)$/u,"")===t);return[...new Map(S.map(c=>[`${c.symbol}\0${c.relative_path}`,c])).values()]}function z(e,r){let t=g(r),n=v(t);if(!n)return[];let o=`%${n.path}%`,s=n.leaf;return B(e,o,s,t)}function B(e,r,t,n){let o=d([],[...F(e,r,t),...q(e,r,t)]).filter(s=>!e.isIgnored(s.relative_path)).filter(s=>b(s,n)>1);return o.sort((s,i)=>b(i,n)-b(s,n)||s.end_line-s.start_line-(i.end_line-i.start_line)||s.start_line-i.start_line||s.symbol.localeCompare(i.symbol)),o}function F(e,r,t){return u(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[r,t,`%/${t}.%`]})}function q(e,r,t){return p(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[r,t,`%/${t}.%`]})}function K(e,r){let t=g(r),n=ee(r),o=X(e,n),s=te(o,r,t).filter(a=>!e.isIgnored(a.relative_path));if(s.length>0)return h(e,s);let i=[];for(let a of o){if(e.isIgnored(a.relative_path))continue;let l=P(a,r,t,n);l<=0||i.push({row:a,score:l})}return i.sort((a,l)=>l.score-a.score||a.row.end_line-a.row.start_line-(l.row.end_line-l.row.start_line)||a.row.relative_path.localeCompare(l.row.relative_path)||a.row.symbol.localeCompare(l.row.symbol)),h(e,i.map(a=>a.row))}function h(e,r){let t=r.map(o=>C(e,o)),n=t[0]??null;return{match:n,candidates:n?j(t,n):[],total:t.length}}function j(e,r){let t=new Set([`${r.symbolId}:${r.relativePath}:${r.startLine}`]),n=[];for(let o of e){let s=`${o.symbolId}:${o.relativePath}:${o.startLine}`;if(!t.has(s)&&(t.add(s),n.push({symbol:o.symbol,shortName:y(o.symbol),relativePath:o.relativePath,startLine:o.startLine}),n.length>=5))break}return n}function T(e,r){let t=r.match(/^(.+):(\d+)(?:-(\d+))?$/);if(!t)return;let[,n,o,s]=t,i=M(e,n,{allowMultiple:!1,requirePathMatch:!0})[0]?.relativePath;if(!i)return;let a=Math.max(0,parseInt(o,10)-1),l=s?Math.max(a,parseInt(s,10)-1):a;return W(e,i,a,l)??G(e,i,a,l)}function W(e,r,t,n){return u(e,{where:"d.relative_path = ? AND der.start_line <= ? AND der.end_line >= ?",params:[r,t,n],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function G(e,r,t,n){return p(e,{where:"d.relative_path = ? AND c.start_line <= ? AND c.end_line >= ?",params:[r,t,n],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function H(e,r){let t=u(e,{where:"gs.symbol = ?",params:[r],orderBy:"d.relative_path, der.start_line"}),n=t.length>0?[]:p(e,{where:"gs.symbol = ?",params:[r],orderBy:"d.relative_path, start_line"});return d(t,n)}function ue(e,r){if("symbol"in r&&"relativePath"in r)return r;let t=U(e,r.symbolId)[0];return t?C(e,t):null}function U(e,r){let t=u(e,{where:"gs.id = ?",params:[r],orderBy:"der.start_line, der.end_line"}),n=p(e,{where:"gs.id = ?",params:[r],orderBy:"start_line, end_line"});return d(t,n)}function X(e,r){let t=r.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),n=r.flatMap(a=>{let l=`%${a}%`;return[l,l,l]}),o=t.join(`
2
+ AND `),s=u(e,{where:o,params:n,limit:200}),i=p(e,{where:o,params:n,limit:200});return d(s,i)}function k(e){return e.reduce((r,[t,n,o])=>r+(n.includes(t)?o:0),0)}function Y(e,r,t){let n=t.replace(/\(\)$/,"");return k([[e.raw,[r,t],1150],[e.short,[r,t],1100],[e.display,[n],1180],[e.leaf,[n],1160],[`${e.leaf}()`,[r,t],955]])}function Z(e,r,t){let n=t.replace(/\(\)$/,""),o=k([[e.raw,[r,t],1e3],[e.short,[r,t],950],[e.path,[r,t],925],[e.display,[n],850],[e.leaf,[n],825],[`${e.leaf}()`,[r,t],820]]),s=[t,r].some(a=>e.path.endsWith(`/${a}`)),i=[t,n,`${n}()`].some(a=>e.short.endsWith(`:${a}`));return o+(s?875:0)+(i?800:0)}function J(e,r,t){let n=[[e.raw,120],[e.short,140],[e.path,140],[e.display,110]],o=n.reduce((i,[a,l])=>i+(a.includes(r)?l:0),0),s=t.every(i=>n.some(([a])=>a.includes(i.toLowerCase())));return o+(s?100+t.length*15:0)}function V(e,r,t){let n=v(t);if(!n||!e.path.includes(n.path.toLowerCase()))return 0;let o=n.leaf.toLowerCase();return 360+(o&&(e.leaf===o||`${e.leaf}()`===o||`${e.leaf}()`==`${o}()`)?700:0)+(R(r)?180:0)}function P(e,r,t,n){let o={raw:e.symbol,short:y(e.symbol),leaf:f(e.symbol),display:e.display_name??"",path:e.relative_path},s={raw:o.raw.toLowerCase(),short:o.short.toLowerCase(),leaf:o.leaf.toLowerCase(),display:o.display.toLowerCase(),path:o.path.toLowerCase()},i=t.toLowerCase(),a=Y(o,r.trim(),t)+Z(s,r.toLowerCase(),i)+J(s,i,n)+V(s,e.symbol,t);return L(e.symbol)&&s.leaf===i.replace(/\(\)$/,"")&&(a+=60),!/[/:.]/.test(t)&&N(e.symbol)&&(a-=160),a-Math.min(50,Math.max(0,e.end_line-e.start_line))}function v(e){let r=e.trim().replace(/\\/g,"/"),t=r.lastIndexOf("/");if(t<=0||t===r.length-1)return null;let n=r.slice(t+1).replace(/\(\)$/,"");return!n||n.includes(".")?null:{path:r.slice(0,t),leaf:n}}function g(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function ee(e){let r=g(e),t=r.split(/[^A-Za-z0-9_]+/).map(n=>n.trim()).filter(n=>n.length>0);return t.length>0?[...new Set(t)]:[r]}function te(e,r,t){let n=r.trim(),o=e.filter(a=>{let l=y(a.symbol),m=f(a.symbol),S=(a.display_name??"").trim();return a.symbol===n||l===n||l===t||I(m,n,t)||I(S,n,t)||b(a,t)>1||a.relative_path===n});if(o.length===0)return[];let s=t.replace(/\(\)$/u,""),i=o.filter(a=>f(a.symbol)===s);if(i.length>0){i.sort((l,m)=>Q(l,m,t));let a=i.filter(l=>L(l.symbol));return a.length>0?a:i}return o.sort((a,l)=>Q(a,l,t)),o}function Q(e,r,t){return b(r,t)-b(e,t)||e.end_line-e.start_line-(r.end_line-r.start_line)||e.relative_path.localeCompare(r.relative_path)||e.symbol.localeCompare(r.symbol)}function b(e,r){let t=v(r);if(!t)return 0;let n=e.relative_path.toLowerCase(),o=f(e.symbol).toLowerCase(),s=t.path.toLowerCase(),i=t.leaf.toLowerCase();return n.includes(s)?o!==i?1:R(e.symbol)?_(e.symbol)===null?5:4:_(e.symbol)===null?3:2:0}function me(e,r,t=5){let n=x(r);if(!n)return[];let o=u(e,{where:"1 = 1",orderBy:"d.relative_path, der.start_line",limit:5e3}),s=new Map;for(let i of o){if(e.isIgnored(i.relative_path))continue;let a=y(i.symbol),l=f(i.symbol),m=i.display_name??l,S=[a,l,m].filter(w=>w.trim().length>0),c=Math.min(...S.map(w=>re(x(w),n))),$=s.get(a);(!$||c<$.distance)&&s.set(a,{shortName:a,distance:c})}return[...s.values()].sort((i,a)=>i.distance-a.distance||i.shortName.localeCompare(a.shortName)).slice(0,t).map(i=>i.shortName)}function x(e){return g(e).toLowerCase().replace(/[^a-z0-9_]+/g,"")}function re(e,r){if(e===r)return 0;if(e.length===0)return r.length;if(r.length===0)return e.length;let t=Array.from({length:r.length+1},(n,o)=>o);for(let n=0;n<e.length;n++){let o=[n+1];for(let s=0;s<r.length;s++){let i=e[n]===r[s]?0:1;o[s+1]=Math.min(o[s]+1,t[s+1]+1,t[s]+i)}t=o}return t[r.length]}function I(e,r,t){return e===r||e===t||`${e}()`===r}export{ce as a,E as b,ue as c,me as d};
3
+ //# sourceMappingURL=chunk-QXEUDXBT.js.map
@@ -0,0 +1,6 @@
1
+ import{closeSync as _,fstatSync as O,openSync as v,readSync as N}from"fs";import{createHash as pr}from"crypto";var C=8*1024*1024,se=64*1024*1024,ce=512*1024*1024,le=256*1024*1024,d=class extends Error{constructor(t,n,i,o,s){let c=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${t} ${JSON.stringify(n)} ${c}`);this.inputKind=t;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function B(e,r){L(r.maxBytes);let t=String(e),n=v(e,"r");try{let i=O(n);de(i,r,t);let o=ae(n,i.size);return ue(i,O(n),o.byteLength,r,t),o}finally{_(n)}}function ae(e,r){L(r);let t=Buffer.allocUnsafe(r),n=0;for(;n<t.length;){let i=N(e,t,n,t.length-n,n);if(i===0)break;n+=i}return t.subarray(0,n)}function M(e,r,t="utf8"){return B(e,r).toString(t)}function S(e,r){return M(e,{maxBytes:C,inputKind:r})}function U(e,r){L(r.maxBytes);let t=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=N(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>r.maxBytes)throw new d(r.inputKind,`file descriptor ${e}`,"too-large",i,r.maxBytes);t.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(t,i)}function W(e,r){let t=v(e,"r");try{return U(t,r)}finally{_(t)}}function x(e,r,t="utf8"){return W(e,r).toString(t)}function ue(e,r,t,n,i){if(r.dev!==e.dev||r.ino!==e.ino||r.size!==e.size||r.mtimeMs!==e.mtimeMs||t!==e.size)throw new d(n.inputKind,i,"changed-during-read",r.size,n.maxBytes)}function de(e,r,t){if(!e.isFile())throw new d(r.inputKind,t,"not-regular",Number(e.size),r.maxBytes);if(e.size>r.maxBytes)throw new d(r.inputKind,t,"too-large",Number(e.size),r.maxBytes)}function L(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}var fe=new Map([[8,"\u2408"],[9,"\u2409"],[10,"\u2424"],[13,"\u240D"]]),gr=6500,Fr=8e3,kr=6500,Pr=3500;function ye(e,r={}){let t=r.allowNewlines??!0,n=r.allowTabs??!0,i="";for(let o=0;o<e.length;){let s=e.charCodeAt(o);if(s===27){o=be(e,o);continue}if(s===155){o=q(e,o+1);continue}if(me(s)){o=z(e,o+1);continue}if(ke(s)){i+=pe(s,t,n),o+=1;continue}if(Pe(s)){i+="\uFFFD",o+=1;continue}i+=e[o],o+=1}return i}function me(e){return e===144||e===152||e===157||e===158||e===159}function pe(e,r,t){return e===10&&r?`
2
+ `:e===9&&t?" ":fe.get(e)??"\uFFFD"}function Sr(e){return ye(e,{allowNewlines:!1,allowTabs:!1})}function xr(e,r=t=>process.stdout.write(t)){r(`${e}
3
+ `)}function be(e,r){let t=e.charCodeAt(r+1);if(Number.isNaN(t))return e.length;if(t===91)return q(e,r+2);if(Se.has(t))return z(e,r+2);let n=r+1;for(;n<e.length&&ge(e.charCodeAt(n));)n+=1;return n<e.length&&Fe(e.charCodeAt(n))?n+1:r+1}function q(e,r){let t=r;for(;t<e.length;){let n=e.charCodeAt(t);if(t+=1,n>=64&&n<=126)return t}return e.length}function z(e,r){let t=r;for(;t<e.length;){let n=e.charCodeAt(t);if(n===7||n===156)return t+1;if(n===27&&e.charCodeAt(t+1)===92)return t+2;t+=1}return e.length}function ge(e){return e>=32&&e<=47}function Fe(e){return e>=48&&e<=126}function ke(e){return e<=31||e>=127&&e<=159}function Pe(e){return e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297}var Se=new Set([80,88,93,94,95]);function xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Dr(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Le(e){return typeof e=="string"&&e.length>0}function Or(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function _r(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var we=/^[a-f0-9]{64}$/u;function vr(e){return typeof e=="string"&&we.test(e)}function Nr(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function Cr(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}function Br(e){return xe(e)&&e.name==="scip-query"&&Le(e.version)}var Re=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function w(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e;return r.version!==1||!he(r)||typeof r.platform!="string"||!Re.has(r.platform)||typeof r.startToken!="string"||r.startToken.trim()===""?null:{version:1,pid:r.pid,platform:r.platform,startToken:r.startToken}}function g(e,r){return e.version===r.version&&e.pid===r.pid&&e.platform===r.platform&&e.startToken===r.startToken}function he(e){return typeof e.pid=="number"&&Number.isSafeInteger(e.pid)&&e.pid>0}import{execFileSync as Te}from"child_process";import{platform as Ie}from"os";var Ee=1e3,J=16*1024,R;function j(e,r=Y){if(!Number.isSafeInteger(e)||e<=0)return null;let t=e===process.pid&&r===Y;if(t&&R)return{...R};try{let n=Ae(e,r);if(!n)return null;let i={version:1,pid:e,platform:r.platform,startToken:n};return t&&(R=i),{...i}}catch{return null}}function Ae(e,r){if(r.platform==="linux"||r.platform==="android")return De(r.readFile(`/proc/${e}/stat`));if(r.platform==="win32"){let t=`([DateTimeOffset](Get-Process -Id ${e} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return $(r.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",t]))}return r.platform==="darwin"||r.platform==="freebsd"||r.platform==="openbsd"||r.platform==="netbsd"?$(r.run("ps",["-p",String(e),"-o","lstart="])):null}function De(e){let r=e.lastIndexOf(")");if(r<0)return null;let n=e.slice(r+1).trim().split(/\s+/)[19];return n&&/^\d+$/.test(n)?n:null}function $(e){let r=e.trim();return r===""?null:r}var Y={platform:Ie(),readFile(e){return x(e,{maxBytes:J,inputKind:"process identity pseudo-file"})},run(e,r){return Te(e,[...r],{encoding:"utf8",timeout:Ee,maxBuffer:J,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function G(e){try{return process.kill(e,0),!0}catch(r){return typeof r=="object"&&r!==null&&"code"in r&&r.code==="EPERM"}}import{randomUUID as Oe}from"crypto";import{closeSync as _e,fsyncSync as ve,linkSync as Ne,mkdirSync as Ce,openSync as Be,statSync as Me,unlinkSync as Ue,writeSync as We}from"fs";import{dirname as I}from"path";function p(e,r,t,n){let i=0;for(;i<r.length;){let o=t.writeFile(e,r,i,r.length-i);if(!Number.isSafeInteger(o)||o<=0||o>r.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function f(e,r){if(r!=="win32")return!1;let t=e.code;return t==="EACCES"||t==="EBADF"||t==="EINVAL"||t==="EISDIR"||t==="EPERM"}var E="scip-query-process-lock",A=1,F=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:G,readProcessIdentity:j,randomToken:()=>Oe(),makeDirectory:e=>Ce(e,{recursive:!0}),openFile:(e,r,t)=>Be(e,r,t),writeFile:(e,r,t,n)=>We(e,r,t,n),syncFile:e=>ve(e),closeFile:e=>_e(e),linkFile:(e,r)=>Ne(e,r),readFile:e=>S(e,"process lock record"),statFile:e=>{let r=Me(e);return{dev:r.dev,ino:r.ino,size:r.size,mtimeMs:r.mtimeMs}},removeFile:e=>Ue(e)}),et=e=>{if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e.pid;return typeof r=="number"&&Number.isSafeInteger(r)&&r>0?{pid:r}:null};function rt(e,r){let t=r.runtime??F;t.makeDirectory(I(e));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:X(e,r,t),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=y(e,{parseLegacy:r.parseLegacy,runtime:t});if(i===0&&Ye(e,s,{creationGraceMs:r.creationGraceMs,parseLegacy:r.parseLegacy,runtime:t})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:y(e,{parseLegacy:r.parseLegacy,runtime:t})}}function y(e,r={}){let t=r.runtime??F,n,i;try{n=t.statFile(e),i=t.readFile(e)}catch(u){return u.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=qe(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:Xe(s),parsed:o};let c=r.parseLegacy?.(o)??null;return c?{state:"legacy",raw:i,identity:n,owner:c,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function qe(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e;if(!Je(r)||!$e(r))return null;let t=ze(r);if(!t)return null;let{processIdentity:n}=t;return{protocol:E,version:A,kind:r.kind,pid:r.pid,token:r.token,...n?{processIdentity:n}:{},startedAt:r.startedAt,...r.detail?{detail:r.detail}:{}}}function ze(e){let r=e.processIdentity===void 0?null:w(e.processIdentity);return e.processIdentity!==void 0&&(!r||r.pid!==e.pid)?null:{processIdentity:r}}function Je(e){return e.protocol===E&&e.version===A&&typeof e.kind=="string"&&e.kind.trim()!==""&&typeof e.pid=="number"&&Number.isSafeInteger(e.pid)&&e.pid>0&&typeof e.token=="string"&&e.token.trim()!==""}function $e(e){return typeof e.startedAt=="string"&&Number.isFinite(Date.parse(e.startedAt))&&(e.detail===void 0||typeof e.detail=="object"&&e.detail!==null&&!Array.isArray(e.detail))}function Ye(e,r,t={}){let n=t.runtime??F;if(!h(r,n))return!1;let i=Ge(`${e}.reclaim`,n);if(!i)return!1;try{let o=y(e,{parseLegacy:t.parseLegacy,runtime:n});return!H(r,o)||!h(o,n)?!1:D(e,n)}finally{i.release()}}function X(e,r,t){let n=r.directoryDurability??"durable",i=r.pid??process.pid,o=t.randomToken(),s=r.processIdentity===void 0?t.readProcessIdentity(i):r.processIdentity,c={protocol:E,version:A,kind:r.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(t.wallNow()).toISOString(),...r.detail?{detail:r.detail}:{}},u=`${e}.${o}.candidate`;Ke(u,c,t);try{t.linkFile(u,e)}catch(a){throw T(u,t),a}if(T(u,t),n==="durable")try{V(I(e),t)}catch(a){throw je(e,c,t),a}let l=!1;return{path:e,record:c,release:()=>l?!1:(l=!0,K(e,c,t,n))}}function je(e,r,t=F){return K(e,r,t,"durable")}function K(e,r,t,n){let i=y(e,{runtime:t});return i.state!=="valid"||!i.record||i.record.pid!==r.pid||i.record.token!==r.token||r.processIdentity&&(!i.record.processIdentity||!g(r.processIdentity,i.record.processIdentity))?!1:D(e,t,n)}function Ge(e,r){for(let t=0;t<2;t+=1)try{return X(e,{kind:"reclaim-guard",runtime:r},r)}catch(n){if(n.code!=="EEXIST"||!He(e,r,t))return null}return null}function h(e,r){if(e.state==="missing")return!1;if(e.owner){if(!r.isProcessAlive(e.owner.pid))return!0;if(!e.owner.processIdentity)return!1;let t=r.readProcessIdentity(e.owner.pid);return t!==null&&!g(e.owner.processIdentity,t)}return!1}function H(e,r){return e.state===r.state&&e.raw===r.raw&&e.identity!==void 0&&r.identity!==void 0&&e.identity.dev===r.identity.dev&&e.identity.ino===r.identity.ino&&e.identity.size===r.identity.size&&e.identity.mtimeMs===r.identity.mtimeMs}function Xe(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function V(e,r){let t;try{t=r.openFile(e,"r")}catch(n){if(f(n,process.platform))return;throw n}try{r.syncFile(t)}catch(n){if(!f(n,process.platform))throw n}finally{r.closeFile(t)}}function D(e,r,t="durable"){try{return r.removeFile(e),t==="durable"&&V(I(e),r),!0}catch{return!1}}function T(e,r){try{r.removeFile(e)}catch{}}function Ke(e,r,t){let n=t.openFile(e,"wx",384),i;try{p(n,Buffer.from(`${JSON.stringify(r)}
4
+ `),t,"process lock"),t.syncFile(n)}catch(o){i=o}try{t.closeFile(n)}catch(o){i??=o}if(i!==void 0)throw T(e,t),i}function He(e,r,t){let n=y(e,{runtime:r});if(t>0||!h(n,r))return!1;let i=y(e,{runtime:r});return H(n,i)?D(e,r):!1}import{randomUUID as tr}from"crypto";import{closeSync as nr,existsSync as ir,fsyncSync as or,linkSync as sr,mkdirSync as cr,openSync as lr,renameSync as ar,unlinkSync as ur,writeSync as dr}from"fs";import{dirname as ee}from"path";import{closeSync as Ve,existsSync as Qe,fsyncSync as Ze,mkdirSync as er,openSync as rr}from"fs";import{dirname as Q}from"path";var Z=Object.freeze({platform:process.platform,pathExists:e=>Qe(e),makeDirectory:e=>er(e,{recursive:!0}),openFile:(e,r,t)=>rr(e,r,t),syncFile:e=>Ze(e),closeFile:e=>Ve(e)});function k(e,r=Z){let t=[],n=e;for(;!r.pathExists(n);){t.push(n);let o=Q(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of t.reverse())r.makeDirectory(o),i=b(i,m(Q(o),r));return i}function m(e,r=Z){let t;try{t=r.openFile(e,"r")}catch(n){if(f(n,r.platform))return"unsupported";throw n}try{r.syncFile(t)}catch(n){try{r.closeFile(t)}catch{}if(f(n,r.platform))return"unsupported";throw n}return r.closeFile(t),"synced"}function b(...e){return e.every(r=>r==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}var re=Object.freeze({platform:process.platform,randomToken:()=>tr(),pathExists:e=>ir(e),makeDirectory:e=>cr(e,{recursive:!0}),openFile:(e,r,t)=>lr(e,r,t),writeFile:(e,r,t,n)=>dr(e,r,t,n),syncFile:e=>or(e),closeFile:e=>nr(e),renameFile:(e,r)=>ar(e,r),linkFile:(e,r)=>sr(e,r),removeFile:e=>ur(e)});function te(e,r,t={}){let n=t.durability??"visibility",i=t.runtime??re,o=ee(e),s=n==="durable"?k(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,u=typeof r=="string"?Buffer.from(r):r,l,a=!1;try{l=i.openFile(c,"wx",t.mode??384),a=!0,p(l,u,i,"atomic file"),n==="durable"&&i.syncFile(l),i.closeFile(l),l=void 0,i.renameFile(c,e),a=!1;let P=n==="durable"?b(s,m(o,i)):"not-requested";return ne(n,P)}finally{ie(i,l,c,a)}}function ft(e,r,t={}){let n=t.durability??"visibility",i=t.runtime??re;if(!i.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=ee(e),s=n==="durable"?k(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,u=typeof r=="string"?Buffer.from(r):r,l,a=!1;try{l=i.openFile(c,"wx",t.mode??384),a=!0,p(l,u,i,"exclusive atomic file"),n==="durable"&&i.syncFile(l),i.closeFile(l),l=void 0,i.linkFile(c,e);let P=n==="durable"?m(o,i):"not-requested";i.removeFile(c),a=!1;let oe=n==="durable"?b(s,P,m(o,i)):"not-requested";return ne(n,oe)}finally{ie(i,l,c,a)}}function ne(e,r){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":r==="synced"?"directory-durable":"file-flushed",directorySync:r}}function ie(e,r,t,n){if(r!==void 0)try{e.closeFile(r)}catch{}if(n)try{e.removeFile(t)}catch{}}function bt(e,r,t={}){te(e,fr(r,t),{durability:"visibility",runtime:t.runtime})}function fr(e,r){let t=JSON.stringify(e,null,r.spacing);return r.trailingNewline?`${t}
5
+ `:t}export{C as a,d as b,B as c,M as d,S as e,gr as f,Fr as g,kr as h,Pr as i,Sr as j,xr as k,p as l,Z as m,k as n,m as o,b as p,xe as q,Dr as r,Or as s,_r as t,vr as u,Nr as v,Cr as w,Br as x,w as y,g as z,j as A,G as B,et as C,rt as D,y as E,ft as F,bt as G};
6
+ //# sourceMappingURL=chunk-QYUVVBMR.js.map
@@ -0,0 +1,2 @@
1
+ import{j as i}from"./chunk-62BDNPMI.js";var f=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function d(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=n;return t.version!==1||!P(t)||typeof t.platform!="string"||!f.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function p(n,t){return n.version===t.version&&n.pid===t.pid&&n.platform===t.platform&&n.startToken===t.startToken}function P(n){return typeof n.pid=="number"&&Number.isSafeInteger(n.pid)&&n.pid>0}import{execFileSync as y}from"child_process";import{platform as I}from"os";var b=1e3,a=16*1024,s;function k(n,t=l){if(!Number.isSafeInteger(n)||n<=0)return null;let e=n===process.pid&&t===l;if(e&&s)return{...s};try{let r=T(n,t);if(!r)return null;let o={version:1,pid:n,platform:t.platform,startToken:r};return e&&(s=o),{...o}}catch{return null}}function T(n,t){if(t.platform==="linux"||t.platform==="android")return x(t.readFile(`/proc/${n}/stat`));if(t.platform==="win32"){let e=`([DateTimeOffset](Get-Process -Id ${n} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return u(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",e]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?u(t.run("ps",["-p",String(n),"-o","lstart="])):null}function x(n){let t=n.lastIndexOf(")");if(t<0)return null;let r=n.slice(t+1).trim().split(/\s+/)[19];return r&&/^\d+$/.test(r)?r:null}function u(n){let t=n.trim();return t===""?null:t}var l={platform:I(),readFile(n){return i(n,{maxBytes:a,inputKind:"process identity pseudo-file"})},run(n,t){return y(n,[...t],{encoding:"utf8",timeout:b,maxBuffer:a,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function _(){return performance.now()}function w(n,t,e,r,o,m){if(n>0)return e;let c=Math.max(0,Math.min(m,t-1));return Math.min(o,r*2**c)}export{d as a,p as b,k as c,_ as d,w as e};
2
+ //# sourceMappingURL=chunk-QZ7KQZRN.js.map
@@ -0,0 +1,2 @@
1
+ import{a as d}from"./chunk-36SGVCGX.js";import{p as u}from"./chunk-NZAXKGRL.js";import{a as m}from"./chunk-FMRN2TRL.js";import{j as a,u as f}from"./chunk-5D2LVK7O.js";function x(n,r,t={}){let e=m(n,r);if(!e)return[];let l=!a(e.symbol)&&!n.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine,evidence:"indexed-definition"}]:[],p=u(n,e,{semantic:t.semantic,semanticEvidence:d}).map(i=>S(n,e.symbol,i.file,i.line)),o=new Set,c=[];for(let i of[...l,...p]){let s=`${i.relativePath}:${i.line}`;o.has(s)||(o.add(s),c.push(i))}return c}function S(n,r,t,e){return{relativePath:t,line:e,evidence:f(n,t,r)?.includes(e)?"indexed-occurrence":"source-or-chunk-candidate"}}export{x as a,S as b};
2
+ //# sourceMappingURL=chunk-R6LQBUDH.js.map
@@ -0,0 +1,20 @@
1
+ import{e as u,g as p,i as h}from"./chunk-BIQEF5NE.js";import{b as i,c as s}from"./chunk-J5FJMODQ.js";import{o as d}from"./chunk-U5RIG3JP.js";import g from"better-sqlite3";var f=["busy_timeout = 5000","query_only = ON","temp_store = MEMORY","cache_size = -64000","mmap_size = 268435456"],c=class{constructor(a,e){this.connection=a;this.releaseGenerationReader=e}connection;releaseGenerationReader;active=!0;initialize(a){try{for(let e of f)this.connection.pragma(e);a(this.connection)}catch(e){try{this.close()}catch(t){throw new AggregateError([e,t],"SQLite initialization and rollback both failed.",{cause:t})}throw e}}close(){if(!this.active)return;this.active=!1;let a,e;try{this.connection.close()}catch(t){a=t}try{this.releaseGenerationReader()}catch(t){e=t}if(a!==void 0&&e!==void 0)throw new AggregateError([a,e],"SQLite connection close and generation-reader release both failed.");if(a!==void 0)throw a;if(e!==void 0)throw e}},S=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],m=class{db;config;generation;pathFilter;connection;connectionOwnership;statementCache=new Map;constructor(a,e){this.config=a,this.pathFilter=e??null;let t=E(a),o=new c(t.db,t.release);try{o.initialize(P),this.generation=t.generation,this.connection=t.db,this.connectionOwnership=o,this.db=y(t.db)}catch(n){try{o.close()}catch(l){throw new AggregateError([n,l],"SQLite construction and rollback both failed.",{cause:l})}throw n}}isIgnored(a){return this.pathFilter?.isIgnored(a)??!1}get localSymbolPredicate(){return`(
2
+ EXISTS (
3
+ SELECT 1
4
+ FROM defn_enclosing_ranges local_der
5
+ JOIN documents local_d ON local_der.document_id = local_d.id
6
+ WHERE local_der.symbol_id = gs.id
7
+ ${this.pathExclusionsFor("local_d").trimStart()}
8
+ )
9
+ OR EXISTS (
10
+ SELECT 1
11
+ FROM mentions local_m
12
+ JOIN chunks local_c ON local_m.chunk_id = local_c.id
13
+ JOIN documents local_d ON local_c.document_id = local_d.id
14
+ WHERE local_m.symbol_id = gs.id
15
+ AND local_m.role = 1
16
+ ${this.pathExclusionsFor("local_d").trimStart()}
17
+ )
18
+ )`}get pathExclusions(){return this.pathExclusionsFor("d")}get symbolNoise(){return this.symbolNoiseFor("gs")}pathExclusionsFor(...a){return a.flatMap(e=>S.flatMap(t=>[`AND ${e}.relative_path NOT LIKE '${t}/%'`,`AND ${e}.relative_path NOT LIKE '%/${t}/%'`])).join(`
19
+ `)}symbolNoiseFor(a){return`AND ${a}.symbol NOT LIKE '%().(%' AND ${a}.symbol NOT LIKE '%typeLiteral%'`}all(a,...e){return this.statement(a).all(...e)}get(a,...e){return this.statement(a).get(...e)}close(){this.statementCache.clear(),this.connectionOwnership.close()}statement(a){let e=this.statementCache.get(a);return e||(e=b(this.connection,this.db,a),this.statementCache.set(a,e)),e}};function y(r){let a={prepare(e){return b(r,a,e)}};return Object.freeze(a)}function b(r,a,e){try{let t=r.prepare(e);if(!t.readonly||!t.reader)throw new Error("ScipDatabase.db only permits read-only statements that return rows.");return w(t,a)}catch(t){throw i(),t}}function w(r,a){let e=r.readonly&&r.reader,t=()=>{e=!1,i()},o={get:(...n)=>s({owner:a,sql:r.source,method:"get",parameters:n,supported:e},()=>r.get(...n)),all:(...n)=>s({owner:a,sql:r.source,method:"all",parameters:n,supported:e},()=>r.all(...n)),iterate:(...n)=>(i(),r.iterate(...n)),pluck(n){return t(),n===void 0?r.pluck():r.pluck(n),o},expand(n){return t(),n===void 0?r.expand():r.expand(n),o},raw(n){return t(),n===void 0?r.raw():r.raw(n),o},bind(...n){return t(),r.bind(...n),o},columns:()=>(i(),r.columns()),safeIntegers(n){return t(),n===void 0?r.safeIntegers():r.safeIntegers(n),o}};return Object.freeze(o)}function P(r){if(!r.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'documents'").get())return;let e=r.prepare("SELECT relative_path FROM documents").iterate();for(let t of e)d(t.relative_path)}function E(r){for(let a=0;a<4;a+=1){let e=u(r),t=e.generation,o;try{o=new g(t.databasePath,{readonly:!0,fileMustExist:!0})}catch(n){throw e.release(),n}if(t.source==="immutable")return{db:o,generation:t,release:e.release};try{let n=p(r);if(t.databaseFileIdentity===h(t.databasePath)&&n.source==="legacy"&&n.identity===t.identity&&n.databaseFileIdentity===t.databaseFileIdentity&&n.metadataRaw===t.metadataRaw)return{db:o,generation:t,release:e.release}}catch(n){throw o.close(),e.release(),n}o.close(),e.release()}throw new Error("SQLite index publication changed repeatedly while opening a coherent generation.")}export{m as a};
20
+ //# sourceMappingURL=chunk-RBS42E55.js.map
@@ -0,0 +1,26 @@
1
+ import{a as d}from"./chunk-36SGVCGX.js";import{z as l}from"./chunk-4WTUBQ36.js";import{d as r,y as m}from"./chunk-5D2LVK7O.js";function u(t,o={}){let{limit:i=30,scope:e}=o,n=e?"AND instr(def_d.relative_path, ?) > 0":"",f=e?[e]:[],c=t.all(`SELECT
2
+ gs.symbol,
3
+ COUNT(DISTINCT m.chunk_id) AS ref_count,
4
+ COUNT(DISTINCT ref_d.id) AS file_count,
5
+ def_d.relative_path AS defined_in
6
+ FROM mentions m
7
+ JOIN chunks c ON m.chunk_id = c.id
8
+ JOIN documents ref_d ON c.document_id = ref_d.id
9
+ JOIN global_symbols gs ON m.symbol_id = gs.id
10
+ JOIN (
11
+ SELECT m2.symbol_id, c2.document_id
12
+ FROM mentions m2
13
+ JOIN chunks c2 ON m2.chunk_id = c2.id
14
+ WHERE m2.role = 1
15
+ GROUP BY m2.symbol_id
16
+ ) sym_def ON sym_def.symbol_id = gs.id
17
+ JOIN documents def_d ON sym_def.document_id = def_d.id
18
+ WHERE m.role != 1
19
+ AND def_d.id != ref_d.id
20
+ ${t.pathExclusionsFor("def_d")}
21
+ ${t.symbolNoiseFor("gs")}
22
+ ${n}
23
+ GROUP BY gs.id
24
+ ORDER BY ref_count DESC, gs.symbol
25
+ LIMIT ?`,...f,i).filter(s=>!t.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in,basis:"scip-cross-file-mentions",countUnit:"referencing-chunks"}));return c.length>0?c:a(t,e,i)}function h(t,o={}){return u(t,o)}function a(t,o,i){return m(t,{scope:o}).filter(e=>!t.isIgnored(e.relativePath)).map(e=>p(t,e)).filter(e=>e.refCount>0).sort((e,n)=>n.refCount-e.refCount||n.fileCount-e.fileCount).slice(0,i)}function p(t,o){let e=l(t,o,{semanticEvidence:d}).filter(n=>n.file!==o.relativePath);return{symbol:o.symbol,shortName:r(o.symbol),refCount:e.length,fileCount:new Set(e.map(n=>n.file)).size,definedIn:o.relativePath,basis:"source-backed-incoming-evidence",countUnit:"distinct-incoming-evidence-rows"}}export{u as a,h as b};
26
+ //# sourceMappingURL=chunk-RSJKPCFX.js.map
@@ -0,0 +1,2 @@
1
+ import{a as pe,c as Qe,d as Xe}from"./chunk-65245JCM.js";import{d as ln,e as Se}from"./chunk-NJJMVD65.js";import{a as rn}from"./chunk-WRQXLNYE.js";import{a as fn,b as pn,c as dn,d as ge,i as Y,j as Z,k as Sn,l as V,n as gn}from"./chunk-TRBI4UKT.js";import{j as un}from"./chunk-WKPV2TDZ.js";import{h as mn}from"./chunk-ZLADLUE6.js";import{b as yn}from"./chunk-4XQ4O6IM.js";import{a as Q,b as Rn}from"./chunk-BZB4QPIP.js";import{b as Ve}from"./chunk-CN5EH7O3.js";import{C as Je,H as K,N as Ye,P as Ze,Y as tn,Z as J,e as ue,f as me,g as H,q as fe,s as Ke}from"./chunk-J5FJMODQ.js";import{c as ce,e as $,o as Be,q as je}from"./chunk-X6RMKHJQ.js";import{a as Ne,e as oe}from"./chunk-GZKFETP5.js";import{c as sn,g as an,h as on,i as cn}from"./chunk-3JIQS44J.js";import{a as $e}from"./chunk-B3PYOSCX.js";import{d as en,g as nn,i as de}from"./chunk-YULZRALL.js";import{a as le,c as Ge,e as P}from"./chunk-HGFDYOVB.js";import{b as ze,c as qe,d as G}from"./chunk-QZ7KQZRN.js";import{u as He,v as We}from"./chunk-TKD34PHN.js";import{A as Oe}from"./chunk-U5RIG3JP.js";import{c as ke,f as Ue,h as Le}from"./chunk-62BDNPMI.js";import{randomUUID as Yn}from"crypto";import{existsSync as Zn}from"fs";import{dirname as Vn}from"path";function Kn(e){return(e.tsconfigPath===void 0||typeof e.tsconfigPath=="string")&&(e.tsconfigPaths===void 0||Array.isArray(e.tsconfigPaths)&&e.tsconfigPaths.every(n=>typeof n=="string"))}function Jn(e){return typeof e.available=="boolean"&&(e.dependencyAvailable===void 0||typeof e.dependencyAvailable=="boolean")&&Kn(e)&&(e.resolvedBinary===void 0||typeof e.resolvedBinary=="string")&&(e.note===void 0||typeof e.note=="string")}function bn(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=e;if(!Jn(n))return null;if(n.available===!0){if(n.reason!==void 0)return null}else if(typeof n.reason!="string"||n.reason.length===0)return null;return n}var Qn=12e4,Xn=5;function Dn(e,n,t={}){let r=t.requester??new Re(e,t),i=null,s=null,a=process.env.SCIP_QUERY_SKIP_WATCH_SERVICE==="1",o=null,c=()=>(i??=yn(e,n),i),l=(m,S,D)=>(a=!0,it(e)?S():(o=m instanceof Error?m.message:String(m),console.error(`TypeScript semantic service request failed (${o}); semantic enrichment is disabled for the rest of this run because the index is too large for an in-process compiler.`),D())),u=(m,S,D,C=D)=>{if(o!==null)return C();if(a)return D();try{return S(r.request(m))}catch(h){return vn(h)?C():l(h,D,C)}},f=(m,S,D,C)=>{if(o!==null)return new Map;if(a)return C();let h=I=>{try{return D(r.request(S(I)))}catch(A){if(!et(A))throw A;let R=nt(I);if(!R)throw A;return new Map([...h(R[0]),...h(R[1])])}};try{return h(m)}catch(I){return vn(I)?new Map:l(I,C,()=>new Map)}},g=(m,S)=>f(m,D=>({kind:"references",definitions:[...D],...S?.exact?{exact:!0}:{}}),D=>ye(D),()=>c().referencesForDefinitions?.(m,S)??new Map(m.map(D=>[D.symbolId,c().referencesFor(D)]))),b=m=>f(m,S=>({kind:"callees",definitions:[...S]}),S=>ye(S),()=>c().calleesForDefinitions?.(m)??new Map(m.map(S=>[S.symbolId,c().calleesFor(S)])));return{language:"typescript",availability:()=>(s??=u({kind:"availability"},ct,()=>c().availability(),()=>({available:!1,reason:`TypeScript semantic service declined: ${o??"unknown"}`})),s),importUsage:m=>u({kind:"import-usage",file:m},S=>S,()=>c().importUsage(m),()=>[]),referencesFor:m=>g([m]).get(m.symbolId)??[],referencesForDefinitions:g,referenceFragmentsForFiles:m=>u({kind:"reference-fragments",files:[...m]},S=>ot(S),()=>c().referenceFragmentsForFiles?.(m)??new Map,()=>new Map),calleesFor:m=>b([m]).get(m.symbolId)??[],calleesForDefinitions:b,calleeCoverageForDefinitions:m=>f(m,S=>({kind:"callee-coverage",definitions:[...S]}),S=>ye(S),()=>c().calleeCoverageForDefinitions?.(m)??new Map),signatureFor:m=>u({kind:"signature",definition:m},lt,()=>c().signatureFor(m),()=>null),dispose:()=>i?.dispose?.()}}function et(e){let n=e instanceof Error?e.message:String(e);return/memory limit|heap out of memory|worker terminated|worker failed/iu.test(n)}function nt(e){let n=[...new Set(e.map(r=>r.relativePath))].sort();if(n.length<2)return null;let t=new Set(n.slice(0,Math.ceil(n.length/2)));return[e.filter(r=>t.has(r.relativePath)),e.filter(r=>!t.has(r.relativePath))]}function vn(e){let n=e instanceof Error?e.message:String(e);return n.includes("invalid mailbox request")||n.includes("Unhandled TypeScript semantic request")||n.includes("compiler project is file-scoped")}var tt=2500,rt=25e3,hn=new WeakMap;function it(e){let n=hn.get(e);if(n!==void 0)return n;let t=st(e);return hn.set(e,t),t}function st(e){try{let n=e.get("SELECT (SELECT count(*) FROM documents) AS documents, (SELECT count(*) FROM global_symbols) AS symbols");return!n||n.documents<tt&&n.symbols<rt}catch{return!0}}var Re=class{constructor(n,t={}){this.db=n;this.runtime=t.runtime??mt,this.timeoutMs=t.timeoutMs??ut(),this.mailboxLimits=t.mailboxLimits??{},this.cacheDir=Vn(n.config.dbPath),this.projectRoot=Oe(n.config.projectRoot)}db;runtime;timeoutMs;cacheDir;projectRoot;mailboxLimits;request(n){let t=ln(this.cacheDir),r=Rn(this.cacheDir),i=Se(t.statePath);if(!In(i,this.projectRoot,this.runtime))throw new Error("Compatible TypeScript semantic service is not running.");let s=this.db.generation.identity;if(!s)throw new Error("Published TypeScript generation identity is unavailable.");let a=this.runtime.now(),o=a+this.timeoutMs,c=(this.runtime.monotonicNow??G)()+this.timeoutMs,l=Ge(),u=an("typescript-semantic-v3",{generation:s,profileEnvironment:l,request:n}),f=on(u),g=cn(r,{mailboxVersion:sn,operationKey:u,clientId:this.runtime.randomId(),enqueuedAtMs:a,deadlineAtMs:o,protocolVersion:Q,id:f,generation:s,profileEnvironment:l,request:n},{nowMs:a,limits:this.mailboxLimits});for(;(this.runtime.monotonicNow??G)()<=c;){if(Zn(g.responsePath))return at(Le(g.responsePath,{maxBytes:this.mailboxLimits.maxItemBytes??64*1024*1024,inputKind:"TypeScript semantic mailbox response"}),f,s,u);let b=Se(t.statePath);if(!In(b,this.projectRoot,this.runtime))throw new Error("TypeScript semantic service stopped while processing a request.");this.runtime.sleep(Xn)}throw new Error(`TypeScript semantic service timed out after ${this.timeoutMs}ms.`)}};function In(e,n,t){let r=e?.processIdentity?t.readProcessIdentity?.(e.pid):null;return e!==null&&e.projectRoot===n&&e.typescriptSemantic?.protocolVersion===Q&&t.isProcessAlive(e.pid)&&(!e.processIdentity||r!=null&&ze(e.processIdentity,r))}function at(e,n,t,r){let i=JSON.parse(e);if(i.protocolVersion!==Q||i.id!==n||i.operationKey!==r||i.ok===!0&&i.generation!==t)throw new Error("TypeScript semantic service wrote an incompatible response.");if(i.ok===!0)return i.response;throw new Error(typeof i.error=="string"?i.error:"TypeScript semantic service request failed.")}function ye(e){if(!Array.isArray(e))throw new Error("TypeScript semantic service wrote an invalid numeric map.");return new Map(e)}function ot(e){if(!Array.isArray(e))throw new Error("TypeScript semantic service wrote an invalid string map.");return new Map(e)}function ct(e){let n=bn(e);if(!n)throw new Error("TypeScript semantic service wrote invalid availability.");return n}function lt(e){if(e!==null&&typeof e!="string")throw new Error("TypeScript semantic service wrote an invalid signature.");return e}function ut(){let e=Number(process.env.SCIP_TYPESCRIPT_SEMANTIC_TIMEOUT_MS);return Number.isInteger(e)&&e>0?e:Qn}var mt={now:Date.now,monotonicNow:G,randomId:Yn,sleep(e){let n=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(n,0,0,e)},isProcessAlive:$e,readProcessIdentity:qe};function Cn(e){let n=new Map,t=pt(e),r=new Map;return i=>{let s=ft(i),a=r.get(s);if(a!==void 0)return a;if(!t.has(i.file))return r.set(s,i.symbol),i.symbol;let o=n.get(i.file);o||(o=dt(tn(e,i.file)),n.set(i.file,o));let c=St(o,i);return r.set(s,c),c}}function ft(e){return`${e.file}\0${e.symbol}\0${e.line}`}function pt(e){return new Set(e.all("SELECT relative_path FROM documents").map(n=>n.relative_path))}function dt(e){let n=new Map,t=new Map;for(let r of e){let i=n.get(r.leaf);i?i.push(r):n.set(r.leaf,[r]);let s=t.get(r.startLine);s?s.push(r):t.set(r.startLine,[r])}return{definitions:e,byLeaf:n,byStartLine:t}}function St(e,n){if(e.definitions.length===0)return n.symbol;let t=Rt(n.symbol),r=gt(e.byLeaf,t),i=yt(r,n.line);if(i)return i.symbol;let s=e.byStartLine.get(n.line)??[];return s.length===1?s[0].symbol:n.symbol}function gt(e,n){let t=[],r=new Set;for(let i of n)for(let s of e.get(i)??[])r.has(s.symbolId)||(r.add(s.symbolId),t.push(s));return t}function yt(e,n){let t=null;for(let r of e)if(!(r.startLine>n||r.endLine<n)){if(r.startLine===n)return r;(!t||r.endLine-r.startLine<t.endLine-t.startLine)&&(t=r)}return t}function Rt(e){let n=new Set([e]),r=e.split(/::|\.|#/).filter(Boolean).at(-1);return r&&n.add(r),n}function Mn(e,n){let r=Ze(e,n).map(i=>vt(n,i));return{usage:r,positions:ht(e,n,r)}}function xn(e,n){return{importUsage(t){let r=e.importUsageFacts(t);if(!n||r.positions.length===0)return r.usage;let i=n.importDefinitionsForFile(t,r.positions);return i.available?bt(r.usage,i.sourcePaths):r.usage}}}function bt(e,n){return e.map((t,r)=>{let i=n.get(String(r));return i?{...t,sourcePath:i}:t})}function vt(e,n){let t=n.isTypeOnly===!0,r=n.kind==="side-effect"||t||n.used;return{importer:e,sourcePath:n.sourcePath,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:t,isUsed:r,isTypeUsed:t,isValueUsed:n.kind==="side-effect"||!t&&n.used,references:[]}}function ht(e,n,t){let r=Je(e,n);if(!r)return[];let i=It(r.rootNode),s=new Map;for(let o of i){let c=s.get(be(o.importedName,o.localName));c?c.push(o.position):s.set(be(o.importedName,o.localName),[o.position])}let a=[];return t.forEach((o,c)=>{let l=s.get(be(o.importedName,o.localName??o.importedName))?.shift();l&&a.push({...l,id:String(c),file:n})}),a}function It(e){let n=[];for(let t of e.descendantsOfType("use_declaration")){let r=t.namedChildren.find(i=>i.type!=="visibility_modifier");r&&n.push(...X(r,""))}return n.filter(t=>t.importedName!=="*")}function X(e,n){switch(e.type){case"identifier":case"super":case"self":case"crate":return[{importedName:e.text,localName:e.text,position:ve(e,e.text)}];case"scoped_identifier":return Dt(e);case"scoped_use_list":return Ct(e,n);case"use_list":return e.namedChildren.flatMap(t=>X(t,n));case"use_as_clause":return Mt(e,n);case"use_wildcard":return xt(e);default:return[]}}function Dt(e){let n=e.text.split("::").pop()??e.text;return[{importedName:n,localName:n,position:ve(e,n)}]}function Ct(e,n){let t=e.namedChild(0),r=e.namedChild(1);if(!t||!r)return[];let i=Ye(n,t.text);return r.namedChildren.flatMap(s=>X(s,i))}function Mt(e,n){let t=e.namedChild(0),r=e.namedChild(1);return!t||!r?[]:X(t,n).map(i=>({...i,localName:r.text}))}function xt(e){let n=e.namedChild(0),t="*";return[{importedName:t,localName:t,position:ve(n??e,t)}]}function ve(e,n){let t=Math.max(0,e.text.lastIndexOf(n));return{id:"",file:"",line:e.startPosition.row,column:e.startPosition.column+t+Pt(n)}}function Pt(e){return Math.max(0,Math.min(e.length-1,1))}function be(e,n){return`${e}\0${n}`}import{spawnSync as he}from"child_process";import{existsSync as Ie}from"fs";import{fileURLToPath as wt}from"url";var De=15e3,Ce=8;function Tn(e,n={}){let t=n.status??dn,r=Et(e,t),i=Ft(e,t),s=_t(e,t),a=Nt(e,n,t,r,i,s),o=n.referenceResolver??a??r,c=n.calleeResolver??a??i,l=n.signatureResolver??a??s,u=Bt(n,a),f=n.calleeSymbolResolver,g=n.sourceZeroCalleeOracle,b=n.scipOccurrenceCalleeOracle,m=new Map,S=new Map,D=null,C=null,h=()=>(D??=t(e),D),I=()=>{let p=h();return p.dependencyAvailable?C??p:p},A=p=>{if(p.length===0)return new Map;let y=z(p);try{let d=o.referencesForDefinitions(y),M=h();return C=ee(M,d),d.available?new Map(d.references):Y(y,d.references)}catch(d){let M=h();return C=W(M,d),U(y)}},R=p=>{if(p.length===0)return new Map;let y=z(p),d=y.filter(Pn);if(d.length===0)return L(y);let M=new Map,_=wn(d,b),w=Ht(d,S,_,g,M);if(w.length===0)return N(y,M,void 0);try{let O=c.calleesForDefinitions(w),k=h();C=ee(k,O);let E=N(w,O.callees,f);for(let[j,ie]of E)M.set(j,ie);return N(y,M,void 0)}catch(O){let k=h();return C=W(k,O),L(y)}},x=(p,y)=>{let d=z(p),M=z(y),_=M.filter(Pn),w=new Map,O=wn(_,b),k=Wt(_,O,g,w);if(d.length===0&&k.length===0)return{references:U(d),callees:N(M,w,void 0)};try{let E=a?a.referencesAndCalleesForDefinitions(d,k):Ot(o,c,{referenceDefinitions:d,calleeDefinitions:k}),j=h();C=ee(j,E);let ie=E.available?new Map(E.references):Y(d,E.references);for(let[se,ae]of E.callees)w.set(se,ae);let _e=N(M,w,f);for(let[se,ae]of _e)S.set(se,ae);return{references:ie,callees:_e}}catch(E){let j=h();return C=W(j,E),{references:U(d),callees:L(M)}}},v=p=>{if(p.length===0)return new Map;let y=z(p);try{let d=l.signaturesForDefinitions(y),M=h();return C=ee(M,d),En(y,d.signatures)}catch(d){let M=h();return C=W(M,d),ne(y)}};return{language:"rust",availability:I,dispose:()=>{a?.dispose()},importUsage:p=>{let y=m.get(p);if(y)return y;try{let d=u.importUsage(p);return m.set(p,d),d}catch(d){let M=h();return C=W(M,d),[]}},referencesFor:p=>A([p]).get(p.symbolId)??[],referencesForDefinitions:A,referencesAndCalleesForDefinitions:x,calleesFor:p=>R([p]).get(p.symbolId)??[],calleesForDefinitions:R,signatureFor:p=>v([p]).get(p.symbolId)??null}}function ee(e,n){let t={dependencyAvailable:e.dependencyAvailable,resolvedBinary:n.resolvedBinary??e.resolvedBinary,...e.note?{note:e.note}:{}};return n.available?{available:!0,...t}:{available:!1,reason:n.reason,...t}}function W(e,n){return{available:!1,dependencyAvailable:e.dependencyAvailable,resolvedBinary:e.resolvedBinary,...e.note?{note:e.note}:{},reason:n instanceof Error?n.message:String(n)}}function Tt(e){if(e.usePersistentSession!==void 0)return e.usePersistentSession;let n=process.env.SCIP_RUST_SEMANTIC_SESSION;return n!=="0"&&n!=="false"}function At(){return{importUsageFacts:()=>({usage:[],positions:[]})}}function z(e){return e.map(n=>{let t=n;return{...n,leaf:typeof t.leaf=="string"?t.leaf:en(n.symbol),parentTypeName:t.parentTypeName??null,isFunctionLike:typeof t.isFunctionLike=="boolean"?t.isFunctionLike:nn(n.symbol),isTypeLike:t.isTypeLike??!1,kind:t.kind??null,documentation:t.documentation??null,enclosingSymbol:t.enclosingSymbol??null}})}function Pn(e){return e.isFunctionLike}function An(e,n){if(!n)return!1;try{return n(e)}catch{return!1}}function wn(e,n){if(!n||e.length===0)return new Map;try{return n(e)}catch{return new Map}}function Et(e,n){return{referencesForDefinitions:t=>kt(e,n,t)}}function Ft(e,n){return{calleesForDefinitions:t=>Ut(e,n,t)}}function _t(e,n){return{signaturesForDefinitions:t=>Lt(e,n,t)}}function kt(e,n,t){let r=n(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Pe(r),references:U(t)};let i=Me();if(!Ie(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,references:U(t)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,De),a=te(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),o=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,Ce),c=te(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=V(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,includeReferences:!0}),u={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...t],requestTimeoutMs:s,...a>0?{referenceRetryTimeoutMs:a}:{},diagnosticsTimeoutMs:c,settleDelayMs:l,concurrency:o},f=he(process.execPath,[i],{cwd:e,input:JSON.stringify(u),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(t.length,gn(s,u.referenceRetryTimeoutMs),o)}),g=we(f.stdout);if(g)return{...xe(g),resolvedBinary:r.resolvedBinary,references:Y(t,new Map(g.references),new Set(g.incompleteReferenceSymbolIds??[]))};let b=f.error instanceof Error?f.error.message:f.stderr.trim()||`Rust semantic worker exited with status ${f.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:b,references:U(t)}}function Ut(e,n,t){let r=n(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Pe(r),callees:L(t)};let i=Me();if(!Ie(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,callees:L(t)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,De),a=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,Ce),o=te(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),c=V(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,includeReferences:!1,includeCallees:!0}),l={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...t],requestTimeoutMs:s,diagnosticsTimeoutMs:o,settleDelayMs:c,concurrency:a,includeReferences:!1,includeCallees:!0},u=he(process.execPath,[i],{cwd:e,input:JSON.stringify(l),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(t.length,s,a)}),f=we(u.stdout);if(f)return{...xe(f),resolvedBinary:r.resolvedBinary,callees:N(t,new Map(f.callees??[]),void 0)};let g=u.error instanceof Error?u.error.message:u.stderr.trim()||`Rust semantic worker exited with status ${u.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:g,callees:L(t)}}function Lt(e,n,t){let r=n(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Pe(r),signatures:ne(t)};let i=Me();if(!Ie(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,signatures:ne(t)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,De),a=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,Ce),o=te(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),c=V(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,includeReferences:!1,includeCallees:!1,includeSignatures:!0}),l={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...t],requestTimeoutMs:s,diagnosticsTimeoutMs:o,settleDelayMs:c,concurrency:a,includeReferences:!1,includeCallees:!1,includeSignatures:!0},u=he(process.execPath,[i],{cwd:e,input:JSON.stringify(l),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(t.length,s,a)}),f=we(u.stdout);if(f)return{...xe(f),resolvedBinary:r.resolvedBinary,signatures:En(t,new Map(f.signatures??[]))};let g=u.error instanceof Error?u.error.message:u.stderr.trim()||`Rust semantic worker exited with status ${u.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:g,signatures:ne(t)}}function Ot(e,n,t){let r=t.referenceDefinitions.length>0?e.referencesForDefinitions(t.referenceDefinitions):{available:!0,references:U(t.referenceDefinitions)},i=t.calleeDefinitions.length>0?n.calleesForDefinitions(t.calleeDefinitions):{available:!0,callees:L(t.calleeDefinitions)},s={resolvedBinary:r.resolvedBinary??i.resolvedBinary,references:r.references,callees:i.callees};return r.available&&i.available?{available:!0,...s}:{available:!1,reason:(r.available?void 0:r.reason)??(i.available?void 0:i.reason)??"Rust semantic resolution was unavailable.",...s}}function U(e){return new Map(e.map(n=>[n.symbolId,[]]))}function L(e){return new Map(e.map(n=>[n.symbolId,[]]))}function ne(e){return new Map(e.map(n=>[n.symbolId,null]))}function N(e,n,t){let r=0,i=0;return P("rust.semantic.callees.complete-map",()=>{let s=new Map;for(let a of e){let o=n.get(a.symbolId)??[];o.length>0&&(r+=1),i+=o.length,s.set(a.symbolId,o.map(c=>({...c,symbol:t?t(c):c.symbol})))}return s},()=>({definitions:e.length,rows:r,callees:i,resolveSymbols:!!t}))}function En(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??null]))}function Me(){return wt(new URL("./rust-semantic-worker.js",import.meta.url))}function xe(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function Pe(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function we(e){try{let n=JSON.parse(e);if(!n||typeof n!="object")return null;let t=n;if(typeof t.available!="boolean"||!Array.isArray(t.references)||!zt(t))return null;let r=jt(t,t.references);return t.available===!0?{available:!0,...r}:{available:!1,reason:String(t.reason),...r}}catch{return null}}function B(e,n){return un(e)??n}function te(e,n){if(!e)return n;let t=Number(e);return Number.isInteger(t)&&t>=0?t:n}function Nt(e,n,t,r,i,s){return n.referenceResolver||n.calleeResolver||n.signatureResolver||!Tt(n)?null:Sn(e,t,{fallbackReferenceResolver:r,fallbackCalleeResolver:i,fallbackSignatureResolver:s})}function Bt(e,n){return e.importUsageResolver??xn(e.sourceImportUsageResolver??At(),e.importDefinitionResolver??n)}function jt(e,n){return{references:n,incompleteReferenceSymbolIds:Array.isArray(e.incompleteReferenceSymbolIds)?e.incompleteReferenceSymbolIds.filter(r=>typeof r=="number"):void 0,callees:Array.isArray(e.callees)?e.callees:void 0,signatures:Array.isArray(e.signatures)?e.signatures:void 0}}function Ht(e,n,t,r,i){let s=[];for(let a of e)n.has(a.symbolId)?i.set(a.symbolId,n.get(a.symbolId)??[]):t.has(a.symbolId)?i.set(a.symbolId,t.get(a.symbolId)??[]):An(a,r)?i.set(a.symbolId,[]):s.push(a);return s}function Wt(e,n,t,r){let i=[];for(let s of e)n.has(s.symbolId)?r.set(s.symbolId,n.get(s.symbolId)??[]):An(s,t)?r.set(s.symbolId,[]):i.push(s);return i}function zt(e){return!(e.available===!1&&typeof e.reason!="string"||e.available===!0&&e.reason!==void 0)}import{existsSync as qt}from"fs";import{deserializeSCIP as $t,SymbolRole as Gt}from"@c4312/scip";var Te=new WeakMap;function _n(e,n){let t=n.filter(Kt);if(t.length===0)return new Map;let r=!1,i=0,s=0;return P("rust.scip-occurrence.callees",()=>{let a=Zt(e);if(r=!!a,!a)return new Map;let o=new Map;for(let c of t){let l=Jt(e,a,c);l!==null&&(o.set(c.symbolId,l),i+=1,s+=l.length)}return o},()=>({definitions:n.length,candidates:t.length,indexAvailable:r,resolvedDefinitions:i,resolvedCallees:s}))}function Kt(e){return!(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||!e.isFunctionLike||e.leaf==="main"||de(e.symbol))}function Jt(e,n,t){let r=K(e,t.relativePath);if(!r||r.language!=="rust")return null;let i=r.callables.find(l=>l.startLine!==t.startLine||l.endLine!==t.endLine?!1:l.name===t.leaf||t.leaf.endsWith(l.name)||l.name.endsWith(t.leaf));if(!i)return null;let s=r.callSites.filter(l=>l.line>=i.startLine&&l.line<=i.endLine);if(s.length===0)return null;let a=(n.occurrencesByFile.get(t.relativePath)??[]).filter(l=>l.line>=i.startLine&&l.line<=i.endLine&&l.callee.symbol!==t.symbol);if(a.some(l=>l.traitImplMember)||!Yt(s,a))return null;let o=[],c=new Set;for(let l of a){let u=`${l.callee.symbol}\0${l.callee.file}\0${l.callee.line}`;c.has(u)||(c.add(u),o.push(l.callee))}return o}function Yt(e,n){let t=Fn(e),r=Fn(n);if(t.size!==r.size)return!1;for(let[i,s]of t)if(r.get(i)!==s)return!1;return!0}function Fn(e){let n=new Map;for(let t of e){let r=t.calleeLeaf??t.leaf;if(!r)continue;let i=`${t.line}\0${r}`;n.set(i,(n.get(i)??0)+1)}return n}function Zt(e){if(Te.has(e))return Te.get(e)??null;let n=Vt(e);return Te.set(e,n),n}function Vt(e){if(!e.generation.indexPath||!qt(e.generation.indexPath))return null;try{let n=J(e).filter(s=>s.symbol.startsWith("rust-analyzer ")&&s.relativePath.endsWith(".rs")&&s.isFunctionLike),t=new Map(n.map(s=>[s.symbol,s])),r=$t(Ue(e.generation.indexPath,{inputKind:"SCIP occurrence-callee index",maxBytes:ke})),i=new Map;for(let s of r.documents??[]){let a=s.relativePath;if(!a||!a.endsWith(".rs")||e.isIgnored(a))continue;let o=Qt(s,t);i.set(a,o)}return{occurrencesByFile:i}}catch{return null}}function Qt(e,n){let t=[];for(let r of e.occurrences??[]){if(!r.symbol||(r.symbolRoles&Gt.Definition)!==0)continue;let i=n.get(r.symbol);if(!i)continue;let s=r.range?.[0];Number.isInteger(s)&&t.push({line:s,leaf:i.leaf,traitImplMember:de(i.symbol),callee:{symbol:i.symbol,file:i.relativePath,line:i.startLine,callsiteLine:s}})}return t}var re=class{sessions=new WeakMap;getOrCreate(n,t,r){let i=Xt(n,t),s=this.sessions.get(n);s||(s=new Map,this.sessions.set(n,s));let a=s.get(i);if(a)return a.hits+=1,a.lastUsedAtMs=Date.now(),a.provider;let o=Date.now(),c=r();return s.set(i,{key:i,language:t,projectRoot:n.config.projectRoot,provider:c,createdAtMs:o,lastUsedAtMs:o,hits:1}),c}sessionsFor(n){return[...this.sessions.get(n)?.values()??[]]}clear(n){let t=this.sessions.get(n);if(t)for(let r of t.values())r.provider.dispose?.();this.sessions.delete(n)}};function Xt(e,n){return`${e.config.projectRoot}:${n}-workspace`}var kn=new re;Ne({name:"semantic-provider",groups:["semantic-provider"],clearAll:e=>kn.clear(e)});function q(e,n){let t=T(n)??"typescript";return kn.getOrCreate(e,t,()=>t==="rust"?Tn(e.config.projectRoot,{sourceImportUsageResolver:{importUsageFacts:r=>Mn(e,r)},calleeSymbolResolver:Cn(e),sourceZeroCalleeOracle:r=>er(e,r),scipOccurrenceCalleeOracle:r=>_n(e,r)}):Dn(e,n))}function T(e){return e?Ke(e)==="rust"?"rust":Ve(e)?"typescript":null:"typescript"}function er(e,n){let t=K(e,n.relativePath);if(!t||t.language!=="rust")return!1;let r=t.callables.find(i=>i.startLine===n.startLine&&i.endLine===n.endLine&&i.name===n.leaf)??t.callables.find(i=>i.startLine===n.startLine&&i.endLine===n.endLine);return r?!t.callSites.some(i=>i.line>=r.startLine&&i.line<=r.endLine):!1}var nr=/^[A-Za-z_][A-Za-z0-9_]*$/,Un=/\bDefault::default\b/g,tr=/^\.\.\s*Default::default\b/;function Ln(e,n){let t=new Map,r=new Map;for(let i of n){let s=Ae(e,i,r);s!==null&&t.set(i.symbolId,s)}return t}function Ae(e,n,t=new Map){let r=lr(n.symbol);if(!r)return null;let i=rn(e,[n.symbolId]);if(i.length===0)return null;let s=new RegExp(`(^|[^A-Za-z0-9_])${fe(r)}::default\\b`,"g"),a=new RegExp(`(^|[^A-Za-z0-9_])${fe(r)}\\s*$`),o=cr(e,n.symbolId),c={owner:r,ownerDefaultCall:s,ownerLiteralBeforeBrace:a,canUseStructUpdateDefault:o},l=[];for(let u of i){let f=ur(e,u.relative_path,t);if(f===null)return null;let g=rr(u,f,c);if(g===null)return null;for(let b of g)l.push(b)}return mn(l)}function rr(e,n,t){let r=n.split(/\r?\n/),i={braceDepth:0,ownerLiteralDepths:[]},s=[];for(let a=e.chunk_start;a<=e.chunk_end&&a<r.length;a+=1){let o=r[a]??"";for(let u of ir(e.relative_path,a,o,t))s.push(u);let c=sr(e.relative_path,a,o,t,i);for(let u of c)s.push(u);let l=new Set(c.map(u=>u.column));if(or(o,l))return null}return s.length===0?null:s}function ir(e,n,t,{owner:r,ownerDefaultCall:i}){let s=[];i.lastIndex=0;let a;for(;a=i.exec(t);)s.push({file:e,line:n,column:a.index+a[1].length+r.length+2});return s}function sr(e,n,t,r,i){let s=[];for(let a=0;a<t.length;a+=1){let o=tr.exec(t.slice(a));if(o){r.canUseStructUpdateDefault&&i.ownerLiteralDepths.includes(i.braceDepth)&&s.push({file:e,line:n,column:a+o[0].lastIndexOf("default")}),a+=o[0].length-1;continue}ar(t,a,r.ownerLiteralBeforeBrace,i)}return s}function ar(e,n,t,r){let i=e[n];if(i==="{"){let s=t.test(e.slice(0,n));r.braceDepth+=1,s&&r.ownerLiteralDepths.push(r.braceDepth);return}if(i==="}")for(r.braceDepth=Math.max(0,r.braceDepth-1);r.ownerLiteralDepths.length>0&&r.ownerLiteralDepths[r.ownerLiteralDepths.length-1]>r.braceDepth;)r.ownerLiteralDepths.pop()}function or(e,n){Un.lastIndex=0;let t;for(;t=Un.exec(e);)if(!n.has(t.index+9))return!0;return!1}function cr(e,n){return e.get("SELECT 1 AS present FROM mentions WHERE symbol_id = ? AND role = 1 LIMIT 1",n)?.present===1}function lr(e){let n=/impl#\[([^\]]+)\]\[Default\]default\(\)\./.exec(e)?.[1]??null;return!n||!nr.test(n)?null:n}function ur(e,n,t){if(t.has(n))return t.get(n)??null;let r=e.get("SELECT text FROM documents WHERE relative_path = ?",n),i=typeof r?.text=="string"?r.text:mr(e,n);return t.set(n,i),i}function mr(e,n){try{return He(e.config.projectRoot,n,{inputKind:"indexed Rust source file"})}catch(t){if(!We(t))throw t;return null}}function On(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath)??[];r.push(t),n.set(t.relativePath,r)}return n}var fr="typescript-import-usage-v1",pr="typescript-signatures-v2",Ee=oe("semantic-prefetched-callees",{clearGroups:["whole-project","source-file","semantic-provider"]}),Nn=me({kind:"semantic-import-usage",invalidation:H("semantic-import-usage"),serialize:e=>JSON.stringify(e),deserialize:$n}),Bn=me({kind:"semantic-signatures",invalidation:H("semantic-signatures"),serialize:e=>JSON.stringify(e),deserialize:_r}),jn=ue({kind:"typescript-import-usage",invalidation:H("typescript-import-usage"),serialize:e=>JSON.stringify(e),deserialize:$n}),Hn=ue({kind:"typescript-signatures",invalidation:H("typescript-signatures"),serialize:e=>JSON.stringify(e),deserialize:kr});var dr=oe("typescript-reference-map",{clearGroups:["whole-project"]});function Sr(e){return dr.get(e,()=>{let n=$(e);if(!n)return null;let t=J(e).filter(i=>T(i.relativePath)==="typescript"),r=Xe(e,t,i=>q(e,i));return r?{projectFingerprint:n,references:r.references,files:r.files,cacheHits:r.cacheHits,cacheMisses:r.cacheMisses,computedFiles:r.computedFiles}:null})}function Fe(e){let n=new Map,t=new Set;return{capability:(r,i)=>Gn(e,r,i),importUsage:r=>yr(e,r),references:r=>Rr(e,r),materializeReferences:(r,i)=>Wn(e,r,n,t,i),callerMap:r=>br(e,r,n,t),calleeMap:r=>wr(e,r),signature:r=>Er(e,r)}}function gr(e,n){if(n.size===0)return;let t=Ee.get(e,()=>new Map);for(let[r,i]of n)t.set(r,[...i])}function rs(e,n){if(!Ee.has(e))return{hits:[],misses:[...n]};let t=Ee.get(e,()=>new Map),r=[],i=[];for(let s of n)t.has(s.symbolId)?r.push({definition:s,callees:t.get(s.symbolId)??[]}):i.push(s);return{hits:r,misses:i}}function is(e,n){return Fe(e).importUsage(n)}function yr(e,n){if(T(n)==="typescript"){let s="fallback",a=0,o=0,c=0,l=0;return P("typescript.import-usage.materialize",()=>{let u=pe(e,n,fr);if(u?.key){a=1;let g=jn.read(e,n,u.key);if(g)return s="hit",o=1,g;c=1;let b=F(e,n);if(!b)return s="unavailable",[];let m=b.importUsage(n);return jn.write(e,n,u.key,m),s="computed",m}l=1;let f=F(e,n);return f?(s="direct-fallback",f.importUsage(n)):(s="unavailable",[])},()=>({state:s,eligible:a,cacheHits:o,cacheMisses:c,fallbacks:l}))}let t=qn(e,"semantic-import-usage",n);if(t){let s=Nn.read(e,n,t);if(s)return s}let r=F(e,n);if(!r)return[];let i=r.importUsage(n);return t&&Nn.write(e,n,t,i),i}function ss(e,n){return Fe(e).references(n)}function Rr(e,n){let t=Ae(e,n);if(t)return t;let r=pn(e,n);if(r)return r;let i=F(e,n.relativePath);return i?i.referencesFor(n):[]}function br(e,n,t=new Map,r=new Set){let i=new Map,s=Wn(e,n,t,r),a=0;return P("semantic.callers.from-references",()=>{for(let o of n)a+=xr(e,i,o,t.get(o.symbolId)??[])},()=>({definitions:n.length,materialized:s.definitions,inMemoryHits:s.inMemoryHits,incompleteInMemoryHits:s.incompleteInMemoryHits,resultRows:i.size,callerFiles:a})),i}function vr(e,n){let t=[];for(let r of e)n.materializedReferences.has(r.symbolId)?n.inMemoryHits+=1:n.incompleteReferences.has(r.symbolId)?n.incompleteInMemoryHits+=1:t.push(r);return t}function hr(e,n,t,r,i){let s=vr(r,i);if(s.length===0){i.fullyInMemoryFiles+=1;return}let a=Dr(e,n,t);if(!a){for(let c of s)T(c.relativePath)||(i.skippedUnsupportedLanguage+=1),i.unkeyed.push(c);return}i.cacheReadFiles+=1;let o=Be(e,t,a);for(let c of s)Ir(c,o.get(c.symbol)??null,a,i)}function Ir(e,n,t,r){if(n!==null){let i=Pr(n);if(i){r.cacheHits+=1,r.materializedReferences.set(e.symbolId,i);return}r.parseFailures+=1}r.misses.push({definition:e,cacheFingerprint:t})}function Wn(e,n,t,r,i={}){let s=$(e),a=[],o=[],c=[],l={skippedUnsupportedLanguage:0,inMemoryHits:0,cacheHits:0,parseFailures:0,cacheReadFiles:0,fullyInMemoryFiles:0,incompleteInMemoryHits:0,materializedReferences:t,incompleteReferences:r,misses:o,unkeyed:c},u=0,f=0,g=0,b=0,m=0,S=[],D=new Map,C=n.filter(I=>T(I.relativePath)==="typescript"&&!t.has(I.symbolId)&&!r.has(I.symbolId)),h=C.length>0?Sr(e):null;if(h){f=C.length,g=h.cacheHits,b=h.cacheMisses,m=h.computedFiles;for(let I of C)t.set(I.symbolId,h.references.get(I.symbolId)??[])}return P("semantic.references.cache-scan",()=>{for(let[I,A]of On(n))hr(e,s,I,A,l)},()=>({definitions:n.length,skippedUnsupportedLanguage:l.skippedUnsupportedLanguage,cacheHits:l.cacheHits,parseFailures:l.parseFailures,misses:o.length,unkeyed:c.length,inMemoryHits:l.inMemoryHits,incompleteInMemoryHits:l.incompleteInMemoryHits,fullyInMemoryFiles:l.fullyInMemoryFiles,cacheReadFiles:l.cacheReadFiles})),(o.length>0||c.length>0)&&(S=[...c,...o.map(I=>I.definition)],D=P("semantic.references.compute-misses",()=>{let I=Cr(e,S,i);return u=I.size,I},()=>({definitions:S.length,misses:o.length,unkeyed:c.length,rows:u})),Ur(e,S,D,t,r,o,a)),a.length>0&&P("semantic.references.cache-write",()=>je(e,a),()=>({entries:a.length})),D.size>0&&Qe(e,S,D,I=>q(e,I)),{definitions:n.length,inMemoryHits:l.inMemoryHits,incompleteInMemoryHits:l.incompleteInMemoryHits,cacheHits:l.cacheHits,misses:o.length,unkeyed:c.length,skippedUnsupportedLanguage:l.skippedUnsupportedLanguage,parseFailures:l.parseFailures,computed:u,incomplete:r.size,cacheWrites:a.length,fragmentDefinitions:f,fragmentCacheHits:g,fragmentCacheMisses:b,fragmentComputedFiles:m}}function Dr(e,n,t){if(!n)return null;let r=T(t);return r==="typescript"?n:r==="rust"?ce(JSON.stringify({kind:"semantic-references",language:r,engine:ge(e.config.projectRoot),projectFingerprint:n})):null}function Cr(e,n,t={}){let r=le(),i=new Map,s=0,a=0,o=0,c=0,l=0,u=0,f=0,g=0,b=0,m=(R,x)=>{Mr(i,R,x,r,v=>{f+=1,g+=v})},S=(R,x)=>{for(let v of x)R.has(v.symbolId)&&m(v.symbolId,R.get(v.symbolId)??[])},D=(R,x,v)=>{let p=R.get(x);p?p.push(v):R.set(x,[v])},C=(R,x,v)=>{x?.referencesAndCalleesForDefinitions&&(D(R,x,v),b+=1)},h=(R,x,v)=>{let p=x.get(R.symbolId);if(p)return o+=1,c+=p.length,m(R.symbolId,p),!0;let y=v.get(R.symbolId);return y?(l+=1,u+=y.length,m(R.symbolId,y),!0):!1},I=(R,x)=>{let v=new Map,p=t.prefetchCallees?new Map:null,y=[];for(let d of n){let M,_=()=>(M??=F(e,d.relativePath),M);if(p&&C(p,_(),d),h(d,R,x))continue;let w=_();if(!w){r&&(a+=1);continue}r&&(s+=1),Nr(w,d,v,y)}return{bulkGroups:v,prefetchCalleeGroups:p,scalarDefinitions:y}},A=R=>{let x=new Set;if(!R.prefetchCalleeGroups)return x;for(let[v,p]of R.prefetchCalleeGroups){if(!v.referencesAndCalleesForDefinitions)continue;let y=R.bulkGroups.get(v)??[],d=v.referencesAndCalleesForDefinitions(y,p);x.add(v),gr(e,d.callees),S(d.references,y)}return x};return P("semantic.references.provider-loop",()=>{let R=Ln(e,n),x=fn(e,n),v=I(R,x),p=A(v);for(let[y,d]of v.bulkGroups)p.has(y)||S(y.referencesForDefinitions(d),d);for(let{provider:y,definition:d}of v.scalarDefinitions)m(d.symbolId,y.referencesFor(d));return i},()=>({definitions:n.length,providerHits:s,providerMisses:a,rustDefaultFastPathRows:o,rustDefaultFastPathReferences:c,rustScipOccurrenceFastPathRows:l,rustScipOccurrenceFastPathReferences:u,prefetchCalleeDefinitions:b,definitionsWithReferences:f,referenceCount:g,rows:i.size}))}function Mr(e,n,t,r,i){e.set(n,t),r&&t.length>0&&i(t.length)}function xr(e,n,t,r){let i=0;for(let s of r){if(s.file===t.relativePath||e.isIgnored(s.file))continue;let a=n.get(t.symbolId);a||(a=new Set,n.set(t.symbolId,a));let o=a.size;a.add(s.file),a.size!==o&&(i+=1)}return i}function Pr(e){try{return JSON.parse(e)}catch{return null}}function as(e,n){return Fe(e).calleeMap(n)}function wr(e,n){let t=le(),r=new Map,i=0,s=0,a=0,o=0;return P("semantic.callees.provider-loop",()=>{let c=new Map,l=[];for(let u of n){let f=F(e,u.relativePath);if(!f){t&&(s+=1);continue}t&&(i+=1);let g=u;f.calleesForDefinitions?Or(c,f,g):l.push({provider:f,definition:g})}Lr(c,r,t,u=>{a+=1,o+=u});for(let{provider:u,definition:f}of l){let g=u.calleesFor(f);zn(r,f.symbolId,g,t,b=>{a+=1,o+=b})}return r},()=>({definitions:n.length,providerHits:i,providerMisses:s,definitionsWithCallees:a,calleeCount:o,rows:r.size}))}var Tr=256;function Ar(e){let n=new Map;for(let i of e){let s=n.get(i.relativePath);s?s.push(i):n.set(i.relativePath,[i])}let t=[],r=[];for(let i of n.values())r.length>0&&r.length+i.length>Tr&&(t.push(r),r=[]),r.push(...i);return r.length>0&&t.push(r),t}function zn(e,n,t,r,i){t.length>0&&(e.set(n,t),r&&i(t.length))}function Er(e,n){if(T(n.relativePath)==="typescript"){let a="fallback",o=0,c=0,l=0,u=0;return P("typescript.signature.materialize",()=>{let f=pe(e,n.relativePath,pr);if(f?.key){o=1;let b=Hn.read(e,n.relativePath,f.key)??{};if(Object.prototype.hasOwnProperty.call(b,n.symbol))return a="hit",c=1,b[n.symbol]??null;l=1;let m=F(e,n.relativePath);if(!m)return a="unavailable",null;let S=m.signatureFor(n);return Hn.write(e,n.relativePath,f.key,{...b,[n.symbol]:S}),a="computed",S}u=1;let g=F(e,n.relativePath);return g?(a="direct-fallback",g.signatureFor(n)):(a="unavailable",null)},()=>({state:a,eligible:o,cacheHits:c,cacheMisses:l,fallbacks:u}))}let t=qn(e,"semantic-signatures",n.relativePath),r=Fr(n);if(t){let a=Bn.read(e,r,t);if(a)return a.signature}let i=F(e,n.relativePath);if(!i)return null;let s=i.signatureFor(n);return t&&Bn.write(e,r,t,{signature:s}),s}function qn(e,n,t){let r=$(e);if(!r)return null;let i=T(t);return i!=="rust"?null:ce(JSON.stringify({kind:n,language:i,engine:ge(e.config.projectRoot),projectFingerprint:r}))}function Fr(e){return`${e.relativePath}\0${e.symbol}`}function $n(e){try{let n=JSON.parse(e);return Array.isArray(n)?n:null}catch{return null}}function _r(e){try{let n=JSON.parse(e);if(!n||typeof n!="object")return null;let t=n.signature;return t!==null&&typeof t!="string"?null:{signature:t}}catch{return null}}function kr(e){try{let n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))return null;for(let t of Object.values(n))if(t!==null&&typeof t!="string")return null;return n}catch{return null}}function Gn(e,n,t){let r=T(t);if(!r)return{slot:n,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript or Rust files"};try{return{slot:n,language:r,...q(e,t).availability()}}catch(i){return{slot:n,language:r,available:!1,reason:i instanceof Error?i.message:String(i)}}}function F(e,n){if(!T(n))return null;let t=q(e,n);return t.availability().available?t:null}function Ur(e,n,t,r,i,s,a){for(let o of n)t.has(o.symbolId)?(r.set(o.symbolId,t.get(o.symbolId)??[]),i.delete(o.symbolId)):i.add(o.symbolId);for(let{definition:o,cacheFingerprint:c}of s)t.has(o.symbolId)&&Gn(e,"semantic-references",o.relativePath).available&&a.push({relativePath:o.relativePath,symbol:o.symbol,projectFingerprint:c,payload:JSON.stringify(t.get(o.symbolId)??[])})}function Lr(e,n,t,r){for(let[i,s]of e)for(let a of Ar(s)){let o=i.calleesForDefinitions(a);for(let c of a){let l=o.get(c.symbolId)??[];zn(n,c.symbolId,l,t,u=>{r(u)})}}}function Or(e,n,t){let r=e.get(n);r?r.push(t):e.set(n,[t])}function Nr(e,n,t,r){if(e.referencesForDefinitions){let i=t.get(e);i?i.push(n):t.set(e,[n])}else r.push({provider:e,definition:n})}export{On as a,q as b,T as c,Fe as d,rs as e,is as f,ss as g,Cr as h,as as i};
2
+ //# sourceMappingURL=chunk-S6CZA3MV.js.map
@@ -0,0 +1,2 @@
1
+ import{d as Z,e as D,f as k}from"./chunk-NJJMVD65.js";import{a as O,b as B,c as x,d as M,e as X}from"./chunk-BL6XJKTA.js";import{c as Y,d as w}from"./chunk-O4UZSPPI.js";import{a as _}from"./chunk-B3PYOSCX.js";import{b as S}from"./chunk-HRRFKWPZ.js";import{a as z,b as v,c as T,d as y}from"./chunk-QZ7KQZRN.js";import{b as C,c as f,d as Q}from"./chunk-TKD34PHN.js";import{A as q,w as J}from"./chunk-U5RIG3JP.js";import{i as I}from"./chunk-62BDNPMI.js";import{spawn as Oe}from"child_process";import{existsSync as N,rmSync as ue}from"fs";import{dirname as at,resolve as W}from"path";import{fileURLToPath as ut}from"url";import{createHash as ge,randomUUID as L}from"crypto";import{existsSync as Re,linkSync as We,readdirSync as Ie,rmSync as m}from"fs";import{basename as we,dirname as ke,join as u}from"path";var p=1,Ee=10*6e4,be=10080*6e4,b="requests",g="claims",E="completions",te="staging";function ze(e,t,r={}){let i=r.now?.()??new Date,n=qe(r.ttlMs),s=Ce(r.idempotencyKey),o=s?`key-${ge("sha256").update(s).digest("hex")}`:`request-${(r.randomId??L)()}`,a={version:p,requestId:o,...s?{idempotencyKey:s}:{},createdAt:i.toISOString(),deadlineAt:new Date(i.getTime()+n).toISOString(),detail:t.trim().slice(0,2048)||"stale index observed by a command"},c=ce(e,o),d=j(e,c,a,r.onStage);if(d.published)return{disposition:"accepted",request:a,achievedDurability:d.achievedDurability,directorySync:d.directorySync};let l=$(c);if(!l)throw new Error(`Watch refresh request identity ${o} exists but is malformed.`);return{disposition:"duplicate",request:l}}function Be(e,t={}){let r=t.now?.()??new Date,i=`claim-${(t.randomId??L)()}`,n=Math.max(1,Math.floor(t.limit??64)),s=ne(e).sort(Te),o=[];for(let a of s){if(o.length>=n)break;if(ee(e,a.requestId))continue;if(Date.parse(a.deadlineAt)<=r.getTime()){ie(e,{version:p,requestId:a.requestId,outcome:"expired",completedAt:r.toISOString()});continue}let c={version:p,requestId:a.requestId,claimId:i,claimedAt:r.toISOString()};if(j(e,ae(e,a.requestId),c).published){if(ee(e,a.requestId)){se(e,a.requestId,i);continue}o.push(a)}}return{claimId:i,requests:o}}function Xe(e,t,r=()=>new Date,i){let n=r().toISOString();for(let s of t.requests)ie(e,{version:p,requestId:s.requestId,claimId:t.claimId,outcome:"completed",completedAt:n});i?.("after-completion"),Ae(e,t),i?.("after-claim-release")}function Ae(e,t){for(let r of t.requests)se(e,r.requestId,t.claimId)}function Ze(e){let t=0;for(let r of h(u(e,g)))m(r,{force:!0}),t++;return t>0&&f(u(e,g)),oe(e),t}function et(e){let t=ne(e),r=new Map,i=Pe(u(e,b),$);for(let c of h(u(e,E))){let d=A(c);if(!d){i++;continue}r.set(d.requestId,d)}let n=new Set;for(let c of h(u(e,g))){let d=re(c);if(!d){i++;continue}n.add(d.requestId)}let s=t.filter(c=>!r.has(c.requestId)&&!n.has(c.requestId)),o=[...r.values()].filter(c=>c.outcome==="completed").length,a=[...r.values()].filter(c=>c.outcome==="expired").length;return{pending:s.length,claimed:t.filter(c=>!r.has(c.requestId)&&n.has(c.requestId)).length,completed:o,expired:a,invalid:i,...s.length>0?{oldestPendingAt:s.map(c=>c.createdAt).reduce((c,d)=>_e(c,d))}:{}}}function tt(e,t={}){let r=(t.now?.()??new Date).getTime(),i=Math.max(0,t.retentionMs??be),n=0;for(let s of h(u(e,E))){let o=A(s);!o||r-Date.parse(o.completedAt)<i||(m(s,{force:!0}),m(ce(e,o.requestId),{force:!0}),n++)}return n>0&&(f(u(e,E)),f(u(e,b))),oe(e),n}function $(e){return F(e,t=>{let r=t;return r.version===p&&R(r.requestId)&&(r.idempotencyKey===void 0||typeof r.idempotencyKey=="string")&&S(r.createdAt)&&S(r.deadlineAt)&&Date.parse(r.deadlineAt)>=Date.parse(r.createdAt)&&typeof r.detail=="string"&&r.detail.length>0})}function re(e){return F(e,t=>{let r=t;return r.version===p&&R(r.requestId)&&R(r.claimId)&&S(r.claimedAt)})}function A(e){return F(e,t=>{let r=t;return r.version===p&&R(r.requestId)&&(r.claimId===void 0||R(r.claimId))&&(r.outcome==="completed"||r.outcome==="expired")&&S(r.completedAt)})}function ie(e,t){let r=de(e,t.requestId);if(j(e,r,t).published)return;let i=A(r);if(!i||i.requestId!==t.requestId||i.outcome!==t.outcome)throw new Error(`Watch refresh completion ${t.requestId} conflicts with an existing record.`)}function j(e,t,r,i){let n=u(e,te),s=ke(t),o=C(n),a=C(s),c=u(n,`${we(t)}.${process.pid}.${L()}.tmp`);try{let d=w(c,r,{spacing:2,trailingNewline:!0});i?.("after-staged");try{We(c,t)}catch(G){if(G.code==="EEXIST")return{published:!1};throw G}let l=Q(o,a,d.directorySync,f(s));return i?.("after-published"),{published:!0,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}finally{m(c,{force:!0})}}function ne(e){let t=[];for(let r of h(u(e,b))){let i=$(r);i&&t.push(i)}return t}function se(e,t,r){let i=ae(e,t),n=re(i);!n||n.claimId!==r||(m(i,{force:!0}),f(u(e,g)))}function oe(e){for(let t of h(u(e,te),".tmp"))m(t,{force:!0})}function Pe(e,t){return h(e).filter(r=>!t(r)).length}function h(e,t=".json"){return Re(e)?Ie(e,{withFileTypes:!0}).filter(r=>r.isFile()&&r.name.endsWith(t)).map(r=>u(e,r.name)).sort():[]}function F(e,t){try{let r=JSON.parse(I(e,"watch refresh request record"));return t(r)?r:null}catch{return null}}function ce(e,t){return u(e,b,`${t}.json`)}function ae(e,t){return u(e,g,`${t}.json`)}function de(e,t){return u(e,E,`${t}.json`)}function ee(e,t){return A(de(e,t))!==null}function qe(e){if(e===void 0)return Ee;if(!Number.isFinite(e)||e<=0)throw new Error("Watch refresh request ttlMs must be positive.");return Math.floor(e)}function Ce(e){let t=e?.trim();return t?t.slice(0,512):void 0}function R(e){return typeof e=="string"&&/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)}function Te(e,t){return Date.parse(e.createdAt)-Date.parse(t.createdAt)||e.requestId.localeCompare(t.requestId)}function _e(e,t){return Date.parse(t)<Date.parse(e)?t:e}var xe=5e3,Me=6e3,De=1e3,U=10;function gt(e,t,r){let i=q(W(e));if(r&&q(r.projectRoot)===i)return{projectRoot:i,worktreeKind:"git",worktreeId:r.worktreeId,cliVersion:t};let n=J(i);if(n.kind==="error")throw new Error(`Could not establish Git worktree identity for ${i}: ${n.message}`);return n.kind==="non-git"?{projectRoot:i,worktreeKind:"non-git",cliVersion:t}:{projectRoot:i,worktreeKind:"git",worktreeId:n.identity.worktreeId,cliVersion:t}}function Rt(e){let t=e.runtime??ye,r=Z(e.cacheDir),i=D(r.statePath),n=i?V(i,t)?{kind:"live",state:i}:{kind:"stale",state:i,reason:"dead-process"}:{kind:"stopped"},s=Le("stop",n);if(s.kind==="signal-stop")return le(s.state,e,t),H(r,s.state,t),{disposition:"stopped",pid:s.state.pid};if(s.kind==="clean-stale")return H(r,s.state,t),{disposition:"stopped",pid:s.state.pid};let o=fe(r.lockPath);return s.kind==="already-stopped"&&o?(V(o,t)&&le(o,e,t),H(r,o,t),{disposition:"stopped",pid:o.pid}):{disposition:"already-stopped"}}function Wt(e,t,r={}){let{durability:i="durable",...n}=r;i==="durable"?w(e,t,n):Y(e,t,n)}function It(e){try{let t=JSON.parse(I(e,"watch activity record"));return t.version!==1||!k(t.at)||t.refreshRequestedAt!==void 0&&!k(t.refreshRequestedAt)||t.refreshDetail!==void 0&&typeof t.refreshDetail!="string"?null:{atMs:Date.parse(t.at),...t.refreshRequestedAt===void 0?{}:{refreshRequestedAtMs:Date.parse(t.refreshRequestedAt)},...t.refreshDetail===void 0?{}:{refreshDetail:t.refreshDetail}}}catch{return null}}function wt(e,t,r={}){let i=r.pid??process.pid,n=r.isProcessAlive??_,s=()=>{},o=r.readProcessIdentity??T,a=r.now??(()=>new Date),c={...O,wallNow:()=>a().getTime(),isProcessAlive:n,readProcessIdentity:o},d=ve(e,()=>x(e,{kind:"watch",pid:i,processIdentity:o(i),detail:{projectRoot:W(t)},parseLegacy:P,runtime:c}));if(d.kind==="contended"){let l=me(d.observation);return{acquired:!1,lockPath:e,message:$e(e,t,l),release:s}}return{acquired:!0,lockPath:e,message:"",release:()=>{d.lock.release()}}}function fe(e){return me(M(e,{parseLegacy:P}))}var P=e=>{let t=Se(e);return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function me(e){if(e.state==="valid"&&e.record?.kind==="watch"){let t=e.record.detail?.projectRoot;return typeof t!="string"?null:{version:1,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},projectRoot:t,startedAt:e.record.startedAt}}return Se(e.parsed)}function Se(e){try{let t=B(e),r=e;if(!t||Object.hasOwn(r,"protocol")||r.version!==1||typeof r.projectRoot!="string"||!k(r.startedAt))return null;let i=r.processIdentity===void 0?null:z(r.processIdentity);return Ne(r.processIdentity,i,t.pid)?null:{version:1,pid:t.pid,...i?{processIdentity:i}:{},projectRoot:r.projectRoot,startedAt:r.startedAt}}catch{return null}}function Le(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":return je(t);case"stop":return Fe(t);default:return K(e)}}function kt(e){return e.idleTimeoutMs===0||e.watcher.state!=="idle"?!1:e.nowMs-e.lastActivityAtMs>=e.idleTimeoutMs}function le(e,t,r){let{pid:i}=e;if(!r.isProcessAlive(i))return;he(e,r),r.signalProcess(i);let n=t.stopTimeoutMs??Me,s=r.monotonicNow??y,o=s()+n;for(;s()<=o;){if(!r.isProcessAlive(i))return;r.sleep(U)}if(!r.forceSignalProcess)throw new Error(`scip-query watch service pid ${i} did not stop within ${n}ms and forced termination is unavailable.`);he(e,r),r.forceSignalProcess(i);let a=t.forceStopTimeoutMs??De;if(!He(e,r,s,a))throw new Error(`scip-query watch service pid ${i} remained alive ${a}ms after forced termination.`)}function ve(e,t){let r=y()+xe;for(;;){let i=x(`${e}.transition`,{kind:"watch-transition"});if(i.kind==="acquired")try{return t()}finally{i.lock.release()}if(y()>=r)throw new Error(`Timed out waiting for watch ownership transition: ${e}`);ye.sleep(U)}}function pe(e,t,r){return e.pid!==t.pid||W(e.projectRoot)!==W(t.projectRoot)?!1:!e.processIdentity||!t.processIdentity?!r.isProcessAlive(e.pid):!!e.processIdentity&&!!t.processIdentity&&v(e.processIdentity,t.processIdentity)}function H(e,t,r){ve(e.lockPath,()=>{let i=fe(e.lockPath),n=D(e.statePath);if(N(e.lockPath)&&(!i||!pe(i,t,r))||N(e.statePath)&&(!n||!pe(n,t,r))||V(t,r)||(ue(e.statePath,{force:!0}),ue(e.activityPath,{force:!0}),!i))return;let s={...O,wallNow:r.now,isProcessAlive:r.isProcessAlive,readProcessIdentity:r.readProcessIdentity},o=M(e.lockPath,{parseLegacy:P,runtime:s});X(e.lockPath,o,{parseLegacy:P,runtime:s})})}function V(e,t){if(!t.isProcessAlive(e.pid))return!1;if(!e.processIdentity)return!0;let r=t.readProcessIdentity(e.pid);return r===null||v(e.processIdentity,r)}function $e(e,t,r){return`error: scip-query watch is already running for ${W(t)}${r?` (pid ${r.pid}, started ${r.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}var ye={now:Date.now,monotonicNow:y,isProcessAlive:_,readProcessIdentity:T,spawnServer(e,t,r,i){if(!N(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);Oe(process.execPath,[e,t,r,JSON.stringify(i)],{detached:!0,stdio:"ignore",env:{...process.env,SCIP_QUERY_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},forceSignalProcess(e){process.kill(e,"SIGKILL")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function he(e,t){if(!e.processIdentity)throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its ownership record has no process identity.`);let r=t.readProcessIdentity(e.pid);if(!r)throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its process identity is unavailable.`);if(!v(e.processIdentity,r))throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its process identity does not match the ownership record.`)}function K(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}function je(e){switch(e.kind){case"stopped":return{kind:"start"};case"stale":return e.reason==="old-heartbeat"?{kind:"refuse-replace",state:e.state,reason:"old-heartbeat"}:{kind:"start"};case"live":return{kind:"reuse",state:e.state};case"incompatible":return{kind:"replace",state:e.state};default:return K(e)}}function Fe(e){switch(e.kind){case"stopped":return{kind:"already-stopped"};case"stale":return e.reason==="old-heartbeat"?{kind:"signal-stop",state:e.state}:{kind:"clean-stale",state:e.state};case"live":case"incompatible":return{kind:"signal-stop",state:e.state};default:return K(e)}}function He(e,t,r,i){let{pid:n}=e,s=r()+i;for(;r()<=s;){if(!t.isProcessAlive(n))return!0;let o=t.readProcessIdentity(n);if(e.processIdentity&&o&&!v(e.processIdentity,o))return!0;t.sleep(U)}return!1}function Ne(e,t,r){return e!==void 0&&(!t||t.pid!==r)}export{ze as a,Be as b,Xe as c,Ae as d,Ze as e,et as f,tt as g,gt as h,Rt as i,Wt as j,It as k,wt as l,kt as m};
2
+ //# sourceMappingURL=chunk-STMVAHJP.js.map
@@ -0,0 +1,2 @@
1
+ import{b as f}from"./chunk-6LSEIIF7.js";import{b,e as y}from"./chunk-FMRN2TRL.js";import{d as u,e as s,i as c,n as h}from"./chunk-5D2LVK7O.js";import{g as d}from"./chunk-7WTPQ4NX.js";import{A as m}from"./chunk-FVULPZDF.js";import{basename as p}from"path";function L(t,n){let o=n.className,e=b(t,o);return e.match?e.total>1?{kind:"ambiguous",query:o,total:e.total,candidates:[g(e.match),...e.candidates]}:{kind:"matched",query:o,owner:S(e.match),methods:M(t,e.match)}:{kind:"missing",query:o,suggestions:y(t,o,5)}}function C(t,n){let o=L(t,{className:n});if(o.kind==="missing")throw new Error(`No class definition matched '${n}'.`);if(o.kind==="ambiguous"){let e=o.candidates.map(r=>`${r.relativePath}:${r.startLine+1}`).join(", ");throw new Error(`Class '${n}' is ambiguous across ${o.total} definitions (${e}). Qualify it with a path or exact SCIP symbol identity.`)}return o.methods}function M(t,n){let o=s(n.symbol),r=new f(t).definitionsForFile(n.relativePath).filter(i=>c(i.symbol)),a=r.filter(i=>i.enclosingSymbol===n.symbol||h(n.symbol,i.symbol)),l=(a.length>0?a:w(p(n.relativePath))===o?r.filter(i=>i.symbol.includes("<invalid-global-code>")):[]).map(i=>({startLine:i.startLine,endLine:i.endLine,name:s(i.symbol)}));return m(n.relativePath)!=="clojure"?l:v(l,R(t,n))}function g(t){return{symbol:t.symbol,shortName:u(t.symbol),relativePath:t.relativePath,startLine:t.startLine}}function S(t){return{...g(t),endLine:t.endLine}}function w(t){return t.replace(/\.[^.]+$/,"")}function R(t,n){let o=s(n.symbol);return o?(d(t,n.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===o).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function v(t,n){let o=new Map;for(let e of[...t,...n])o.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...o.values()].sort((e,r)=>e.startLine-r.startLine||e.endLine-r.endLine)}export{L as a,C as b};
2
+ //# sourceMappingURL=chunk-SYVPTTVW.js.map
@@ -0,0 +1,2 @@
1
+ import{getHeapStatistics as r}from"v8";var o=2560,n=1.25;function _(t){let e=t/1048576;return Math.max(0,Math.floor((e-o)/n))}function p(){return _(r().heap_size_limit)}export{o as a,n as b,p as c};
2
+ //# sourceMappingURL=chunk-T3I6NHBH.js.map
@@ -0,0 +1,2 @@
1
+ import{m as d}from"./chunk-5TNQJUR2.js";function r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function c(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function f(e){return typeof e=="string"&&e.length>0}function E(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function A(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var m=/^[a-f0-9]{64}$/u;function P(e){return typeof e=="string"&&m.test(e)}function L(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function j(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}function v(e){return r(e)&&e.name==="scip-query"&&f(e.version)}var g=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"],N=["entry-surface","generated-code","compatibility-shim","reflection-or-registration","test-fixture","intentional-twin","historical-coupling-ended","detector-counterexample"];var p=2,s=3;var u=new Set(g);function _(e){let n=e;if(typeof e=="string")try{n=JSON.parse(e)}catch(l){return{kind:"malformed",reason:`invalid JSON: ${M(l)}`}}if(!r(n))return{kind:"malformed",reason:"metadata must be a JSON object"};let t=n.version;if(!Number.isInteger(t))return{kind:"malformed",reason:"version must be an integer"};if(t!==p&&t!==s)return{kind:"unsupported",version:t,direction:t<p?"older":"future"};let a=b(n,t);if(a)return{kind:"malformed",reason:a};let i=n,o={metadata:i,capabilities:y(i)};return t===p?{kind:"legacy",...o,metadata:i}:{kind:"supported",...o,metadata:i}}function T(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function q(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let n=e.metadata;return JSON.stringify({version:n.version,status:n.status,updatedAt:n.updatedAt,fingerprint:n.fingerprint,indexedLanguages:n.indexedLanguages,scipCompanion:n.scipCompanion,sqliteLayoutVersion:n.version===s?n.sqliteLayoutVersion:void 0})}function y(e){let n=e.fingerprint!==void 0,t=r(e.fingerprint),a=e.indexedLanguages!==void 0,i=e.status==="complete",o=e.version===s?e:null;return{usableForQuery:a,usableForEvidenceCache:n,publishableGeneration:i&&t&&a,stableGenerationIdentity:i&&n&&typeof e.updatedAt=="string",languageShardReuse:!!o?.languageFingerprints,typescriptProjectShardReuse:!!o?.typescriptProjectShards}}function b(e,n){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!c(e.updatedAt))return"updatedAt must be a valid timestamp";let t=x(e);return t||(n===s?S(e):null)}function x(e){for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!R(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!C(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":null}function S(e){return e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":e.languageFingerprints!==void 0&&!h(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":e.typescriptProjectShards!==void 0&&!k(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function B(e){return e.version===s&&e.sqliteLayoutVersion===1}function R(e){return!Array.isArray(e)||!e.every(n=>typeof n=="string"&&u.has(n))?!1:new Set(e).size===e.length}function C(e){return Array.isArray(e)&&e.every(n=>r(n)&&typeof n.language=="string"&&u.has(n.language)&&typeof n.reason=="string")}function h(e){return r(e)&&Object.entries(e).every(([n,t])=>u.has(n)&&r(t))}function k(e){return r(e)&&Object.values(e).every(n=>r(n)&&Array.isArray(n.files)&&n.files.every(d))}function M(e){return e instanceof Error?e.message:String(e)}export{r as a,c as b,f as c,E as d,A as e,P as f,L as g,j as h,v as i,g as j,N as k,s as l,_ as m,T as n,q as o,y as p,B as q};
2
+ //# sourceMappingURL=chunk-T6DK3ZP7.js.map
@@ -0,0 +1,4 @@
1
+ import{a as z,b as K}from"./chunk-2HLAFUCY.js";import{B as N,C as I,D as Re,E as Oe,F as Te,G as Be,H as ke,J as De,K as Le,O as _e,a as q,b as Pe,i as be,j as h,n as x,o as P,p as Ce,q as Ee,r as Ie}from"./chunk-U5RIG3JP.js";import{f as je,g as Fe,i as xe,k as we,m as v}from"./chunk-62BDNPMI.js";import{createHash as Ae,randomUUID as yt}from"crypto";import{chmodSync as He,existsSync as w,linkSync as mt,lstatSync as $,readdirSync as G,realpathSync as y,unlinkSync as St,writeSync as Pt}from"fs";import{homedir as bt}from"os";import{basename as jt,dirname as J,isAbsolute as ze,join as g,resolve as U}from"path";import{closeSync as ft,existsSync as lt,fsyncSync as dt,mkdirSync as gt,openSync as ht}from"fs";import{dirname as ve}from"path";var R=Object.freeze({platform:process.platform,pathExists:e=>lt(e),makeDirectory:e=>gt(e,{recursive:!0}),openFile:(e,t,n)=>ht(e,t,n),syncFile:e=>dt(e),closeFile:e=>ft(e)});function Ne(e,t=R){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=ve(r);if(o===r)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);r=o}let i="synced";for(let o of n.reverse())t.makeDirectory(o),i=A(i,M(ve(o),t));return i}function M(e,t=R){let n;try{n=t.openFile(e,"r")}catch(r){if(K(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(K(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function A(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}var $e=1,T=".scip-query-cache-owner.json",Ft=16*1024,Je=Object.freeze({...R,randomToken:()=>yt(),linkFile:(e,t)=>mt(e,t),removeFile:e=>St(e),writeFile:(e,t,n,r)=>Pt(e,t,n,r)});function H(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"SCIP_QUERY_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function S(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"SCIP_QUERY_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function xt(e,t){let n=y(e);return Ct(n,Q(n,t))}function Q(e,t){let n=y(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?U(r):t?.dbPath?It(n,t.dbPath):wt(n)}function Ue(){let e=process.env.XDG_CACHE_HOME;return g(e||g(bt(),".cache"),"scip-query")}function wt(e){let t=U(e);try{t=y(t)}catch{}let n=Ae("sha256").update(t).digest("hex").slice(0,12);return g(Ue(),"projects",n)}function sr(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=g(Ue(),"repositories",e);return qe(t),y(t)}function cr(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function ar(e,t){let n=xt(e,t);return{cacheDir:n,dbPath:g(n,"index.db"),indexPath:g(n,"index.scip"),metaPath:g(n,"meta.json")}}function Ct(e,t,n=Je){return Et(e,t,n).cacheDir}function Et(e,t,n=Je){let r=y(e),i=w(t)?"synced":qe(t,n),o=y(t),s=g(o,T);if(w(s))return Y(r,o),X(s),O(o),{kind:"existing",cacheDir:o};Me(o),kt(o),Me(o);let a=`${JSON.stringify({schemaVersion:$e,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:_e},null,2)}
2
+ `;try{let u=Dt(s,a,n),p=A(i,u);return{kind:"published",cacheDir:o,achievedDurability:p==="synced"?"directory-durable":"file-flushed",directorySync:p}}catch(u){if(_t(u))return Y(r,o),{kind:"existing",cacheDir:o};throw u}}function Y(e,t){let n=y(e),r=y(t);return Ot(r,n,r)}function ur(e,t){return w(g(t,T))?(Y(e,t),We(t),!0):!1}function It(e,t){let n;try{n=P(t)}catch(s){throw s instanceof h?H(t,s.reason):s}let r=U(e,...n.split("/"));if(r===e||!x(e,r))throw H(t,"outside-project");let i=Rt(r),o=y(i);if(!x(e,o)&&o!==e)throw H(t,"symlink-escape");return r}function Rt(e){let t=e;for(;!w(t);){let n=J(t);if(n===t)throw H(e,"no-existing-ancestor");t=n}return t}function Ot(e,t,n){let r=g(e,T);if(!w(r)||$(r).isSymbolicLink())throw S(e,"missing regular ownership record");let i=$(r);if(!i.isFile()||i.size>Ft)throw S(e,"invalid ownership record file");let o=xe(r,"cache ownership record"),s=Tt(o,e);if(t!==void 0&&s.canonicalProjectRoot!==t)throw S(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==n)throw S(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Ae("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Tt(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==$e||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!ze(n.canonicalProjectRoot)||!ze(n.canonicalCacheDir))throw new Error("invalid fields");return n}catch(n){throw S(t,`malformed ownership record: ${n instanceof Error?n.message:String(n)}`)}}function Me(e){let t=G(e).filter(n=>n!==T&&!Bt(n));if(t.length>0)throw S(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function Bt(e){return e.startsWith(`${T}.tmp-`)||e.startsWith("git-worktree-context.json.tmp-")||[".scipquery-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","git-worktree-context.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","typescript-shard-costs.json","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function kt(e){for(let t of G(e)){let n=g(e,t);try{let r=$(n);if(r.isSymbolicLink())throw S(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())O(n);else if(r.isFile())X(n);else throw S(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(Ve(r))continue;throw r}}O(e)}function We(e,t=!1){try{let n=$(e);if(n.isSymbolicLink())throw S(e,"managed cache tree contains a symlink");if(n.isFile()){X(e);return}if(!n.isDirectory())throw S(e,"managed cache tree contains a special file");O(e);for(let r of G(e))We(g(e,r),!0)}catch(n){if(t&&Ve(n))return;throw n}}function Ve(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function qe(e,t=R){let n=Ne(e,t);return O(e),n}function Dt(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,z(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=M(J(e),n);return n.removeFile(r),o=!1,A(s,M(J(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function O(e){process.platform!=="win32"&&He(e,448)}function X(e){process.platform!=="win32"&&He(e,384)}function Lt(e){if(w(e))return y(e);let t=y(J(e));return g(t,jt(e))}function pr(e){return Lt(U(e))}function _t(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{execFileSync as an}from"child_process";import{isUtf8 as it}from"buffer";import{createHash as le}from"crypto";import{closeSync as ot,fstatSync as k,lstatSync as de,openSync as st,readSync as ct,readlinkSync as un,realpathSync as D}from"fs";import{isAbsolute as pn,join as ge,relative as fn,resolve as ln,sep as dn}from"path";import{createHash as te}from"crypto";import{execFileSync as Ke}from"child_process";import{createRequire as vt}from"module";var Nt=vt(import.meta.url),zt=/\.(?:[cm]?[jt]sx?)$/iu,Mt=/\.[jt]sx$/iu,Ye=/(?:^|\/)package\.json$/iu,B,Z=new Map;function Ge(e,t){if(!ne(e))return;let n=At();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=Mt.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=te("sha256").update(`typescript-semantic-v1\0${i}\0`);return Ht(n,o,s),s.digest("hex")}catch{return}}function ne(e){return zt.test(e)}function re(e,t){if(Ye.test(e))try{let n=JSON.parse(typeof t=="string"?t:t.toString("utf8"));if(typeof n!="object"||n===null||Array.isArray(n))return;let{scripts:r,...i}=n;return te("sha256").update("typescript-package-json-v1\0").update(ee(i)).digest("hex")}catch{return}}function ie(e){return Ye.test(e)}function hr(e,t,n){if(!ie(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(Z.has(r))return Z.get(r);let i;try{let o=Ke("git",["-C",e,"log","--all","--format=%H","--max-count=64","--",t],{encoding:"utf8",maxBuffer:1048576,timeout:5e3}).split(/\r?\n/u).filter(Boolean);for(let s of o){let c=Ke("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(te("sha256").update(c).digest("hex")===n){i=re(t,c);break}}}catch{i=void 0}return Z.set(r,i),i}function At(){if(B!==void 0)return B;try{B=Nt("typescript")}catch{B=null}return B}function ee(e){return Array.isArray(e)?`[${e.map(ee).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${ee(n)}`).join(",")}}`:JSON.stringify(e)}function Ht(e,t,n){let r=!1,i=!1;for(;;){let o=t.scan();if(o===e.SyntaxKind.EndOfFileToken)break;if(o===e.SyntaxKind.WhitespaceTrivia)continue;if(o===e.SyntaxKind.NewLineTrivia){r&&(i=!0);continue}i&&n.update("line-break\0");let s=t.getTokenText();n.update(`${o}\0${Buffer.byteLength(s)}\0`).update(s).update("\0"),r=!0,i=!1}}import{closeSync as Qe,existsSync as se,openSync as $t,realpathSync as Jt,renameSync as Ut,unlinkSync as Xe,writeSync as Wt}from"fs";import{dirname as Vt,join as qt,resolve as Kt}from"path";import{AsyncLocalStorage as Yt}from"async_hooks";var Gt="fingerprint-stat-cache.json",Ze=1,Qt=8*1024*1024,oe=new Map,et=new Yt;function xr(e,t,n){return et.run({projectRoot:pe(e),cacheDir:Kt(t)},n)}function tt(e){let t=et.getStore();return t?.projectRoot===e?t.cacheDir:null}function Xt(e){let t=pe(e);return oe.get(t)?.get(tt(t))}function ce(e,t,n,r){let i=nt(e),o=i.files.get(t);if(!(!o||!rt(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function ae(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=nt(e),s={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size,...i.semanticHash===void 0?{}:{semanticHash:i.semanticHash}},c=o.files.get(t);c&&sn(c,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function ue(e){let t=Xt(e);if(!(!t?.dirty||!t.cachePath))try{let n=Vt(t.cachePath);if(!se(n))return;cn(t.cachePath,tn(t)),t.dirty=!1}catch{}}function nt(e){let t=pe(e),n=tt(t),r=oe.get(t)??new Map,i=r.get(n);if(i)return i;let o=Zt(t,n),s=en(o),c={cachePath:o,files:s,dirty:!1,hits:0,stores:0};return r.set(n,c),oe.set(t,r),c}function Zt(e,t){try{let n=t??Q(e);return se(n)?qt(n,Gt):null}catch{return null}}function en(e){let t=new Map;if(!e||!se(e))return t;try{let n=JSON.parse(je(e,{inputKind:"fingerprint stat cache",maxBytes:Qt}).toString("utf8"));if(!nn(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function tn(e){return{version:Ze,files:Object.fromEntries(e.files)}}function nn(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==Ze||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(rn)}function rn(e){if(typeof e!="object"||e===null)return!1;let t=e;return(t.kind==="file"||t.kind==="symlink")&&on(t)&&typeof t.hash=="string"&&t.hash!=="unreadable"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function on(e){return Number.isFinite(e.dev)&&Number.isFinite(e.ino)&&Number.isFinite(e.mtimeMs)&&Number.isFinite(e.ctimeMs)&&Number.isFinite(e.size)&&Number.isFinite(e.fingerprintSize)}function rt(e,t,n){return e.kind===t&&e.dev===n.dev&&e.ino===n.ino&&e.mtimeMs===n.mtimeMs&&e.ctimeMs===n.ctimeMs&&e.size===n.size}function sn(e,t){return rt(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function cn(e,t){let n=`${e}.${process.pid}.tmp`;try{Xe(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
3
+ `,"utf8"),i=$t(n,"wx",384);try{z(i,r,{writeFile:(o,s,c,a)=>Wt(o,s,c,a)},"fingerprint stat cache")}catch(o){throw Qe(i),Xe(n),o}Qe(i),Ut(n,e)}function pe(e){return Jt(e)}var _=64*1024*1024,gn=1024*1024,hn=1024,C=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function yn(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function he(e,t,n={}){let r=P(t),i=Ce(e,()=>D(e)),o=ln(i,...r.split("/"));if(!x(i,o)||o===i)throw new h(t,"outside-project");let s=D(o);if(!x(i,s)||s===i)throw new h(t,"outside-project");let c=de(s);if(!c.isFile())throw new h(t,"not-a-file");let a={projectRoot:i,relativePath:r,absolutePath:s,size:c.size,mtimeMs:c.mtimeMs,device:c.dev,inode:c.ino},u=n.maxBytes??_;if(v(u),a.size>u)throw new C(n.inputKind??"project file",a.relativePath,a.size,u);return a}function mn(e,t,n={}){let r=P(t),i=I(e,r);if(i)return $n(e,r,i,n);let o=he(e,t,n),s=n.maxBytes??_,c=st(o.absolutePath,"r");try{let a=k(c);if(L(a,o,t),a.size>s)throw new C(n.inputKind??"project file",o.relativePath,a.size,s);let u=Fe(c,a.size),p=k(c);if(L(p,o,t),u.byteLength!==a.size||p.mtimeMs!==a.mtimeMs)throw new h(t,"changed-during-read");return u}finally{ot(c)}}function Ar(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=Sn(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function Sn(e,t,n,r={}){if(n.length===0||n.some(a=>a.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=P(t),o=I(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});return Pn(e,i,n,r)}let s=he(e,t,r),c=st(s.absolutePath,"r");try{let a=k(c);L(a,s,t);let{hash:u,containsNul:p,validUtf8:m,includesLiterals:b}=bn(c,a.size,t,n,r);L(k(c),s,t);let j=!p&&m,F=j?b.flatMap((d,f)=>d?[f]:[]):[],l=null;return F.length>0&&(l=jn(c,s,t)),{byteLength:a.size,isUtf8Text:j,matchedLiteralIndexes:F,bytes:l,...u?{sha256:u.digest("hex")}:{}}}finally{ot(c)}}function Pn(e,t,n,r){let i=N(e,t);if(!i)throw new h(t,"changed-during-read");let o=r.maxBytes??_;if(v(o),i.size>o)throw new C(r.inputKind??"project file",t,i.size,o);let s=!i.content.includes(0)&&it(i.content),c=n.map(at),a=s?xn(i.content,n,c):[];return{byteLength:i.size,isUtf8Text:s,matchedLiteralIndexes:a,bytes:a.length>0?Buffer.from(i.content):null,...r.computeSha256?{sha256:i.sha256}:{}}}function bn(e,t,n,r,i){let o=i.computeSha256?le("sha256"):null,s=i.scratchBuffer??Buffer.allocUnsafe(gn);if(s.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let c=0,a=r.map(()=>!1),u=!1,p=!0,m=Buffer.alloc(0),b=r.map(()=>Buffer.alloc(0)),j=r.map(at),F=d=>{if(p){let f=m.byteLength>0?Buffer.concat([m,d]):d,E=Fn(f);p=it(f.subarray(0,E)),m=Buffer.from(f.subarray(E))}},l=d=>{for(let f=0;f<r.length;f+=1){if(a[f])continue;let E=r[f],Se=b[f];a[f]=wn(d,E,Se,j[f]),b[f]=Cn(d,E,Se)}};for(;c<t;){let d=ct(e,s,0,Math.min(s.byteLength,t-c),c);if(d<=0)throw new h(n,"changed-during-read");let f=s.subarray(0,d);o?.update(f),u||=f.includes(0),F(f),l(f),c+=d}return p&&=m.byteLength===0,{hash:o,containsNul:u,validUtf8:p,includesLiterals:a}}function jn(e,t,n){let r=Buffer.allocUnsafe(t.size),i=0;for(;i<r.byteLength;){let o=ct(e,r,i,r.byteLength-i,i);if(o<=0)throw new h(n,"changed-during-read");i+=o}return L(k(e),t,n),r}function Hr(e,t,n={}){return mn(e,t,n).toString("utf8")}function L(e,t,n){if(!e.isFile()||e.dev!==t.device||e.ino!==t.inode||e.size!==t.size)throw new h(n,"changed-during-read")}function Fn(e){if(e.byteLength===0)return 0;let t=e.byteLength-1,n=0;for(;t>=0&&n<3&&(e[t]&192)===128;)n+=1,t-=1;if(t<0)return e.byteLength;let r=e[t];return Jn(r)>e.byteLength-t?t:e.byteLength}function xn(e,t,n){return t.flatMap((r,i)=>fe(e,r,n[i])?[i]:[])}function wn(e,t,n,r){if(fe(e,t,r))return!0;if(n.byteLength===0||t.byteLength===1)return!1;let i=e.subarray(0,Math.min(e.byteLength,t.byteLength-1));return fe(Buffer.concat([n,i]),t,r)}function fe(e,t,n){if(n<0)return e.includes(t);let r=t[n],i=e.indexOf(r),o=0;for(;i>=0;){if(o+=1,o>hn)return e.includes(t);let s=i-n;if(s>=0&&s+t.byteLength<=e.byteLength&&e.compare(t,0,t.byteLength,s,s+t.byteLength)===0)return!0;i=e.indexOf(r,i+1)}return!1}function at(e){for(let n=1;n<e.byteLength;n+=1){let r=e[n];if(r>=65&&r<=90)return n}let t=e[0];return t>=65&&t<=90?0:-1}function Cn(e,t,n){let r=t.byteLength-1;if(r===0)return Buffer.alloc(0);if(e.byteLength>=r)return Buffer.from(e.subarray(e.byteLength-r));let i=Buffer.concat([n,e]);return Buffer.from(i.subarray(Math.max(0,i.byteLength-r)))}function ye(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function $r(e,t){try{return he(e,t),!0}catch(n){if(ye(n))return!1;throw n}}function En(e){let t=Oe(e);return t?t.filter(n=>n&&!V(n)).sort():(Mn(e)??An(e)).filter(n=>n&&!V(n)).sort()}function In(e,t={}){let n=(t.includePaths??[]).map(P),r=[...new Set([...En(e),...n])].filter(s=>!V(s)).filter(s=>!t.language||Pe(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,c)=>s.localeCompare(c)),i=D(e),o=r.flatMap(s=>ut(e,i,s));return ue(i),o}function ut(e,t,n){let r=Rn(e,n);if(r)return r;let i=ge(e,n);try{let o=de(i);return o.isSymbolicLink()?On(t,n,i,o):Tn(t,n,i,o)}catch(o){return ye(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function Rn(e,t){let n=Re(e,t);if(n)return[{path:t,size:n.fingerprintSize??n.size,hash:n.sha256}];if(I(e,t)==="present"){let r=N(e,t);if(r)return[{path:t,size:r.fingerprintSize??r.size,hash:r.sha256}]}return null}function On(e,t,n,r){let i=ce(e,t,"symlink",W(r));if(i)return[{path:t,size:i.size,hash:i.hash}];let o=D(n),s=fn(e,o);if(s===".."||s.startsWith(`..${dn}`)||pn(s))throw new Error("external symlink");let c=un(n),a=le("sha256").update("symlink\0").update(c).digest("hex"),u=Buffer.byteLength(c);return ae(e,t,"symlink",W(r),{hash:a,size:u}),[{path:t,size:u,hash:a}]}function Tn(e,t,n,r){let i=ne(t)||ie(t),o=ce(e,t,"file",W(r));if(o&&(!i||o.semanticHash!==void 0))return[{path:t,size:o.size,hash:o.hash,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}];let s=Bn(n,t,i);return ae(e,t,"file",W(r),s),[{path:t,...s}]}function Bn(e,t,n){let r=le("sha256"),i=n,o=[],s=we(e,{inputKind:"project fingerprint input",maxBytes:_},p=>{r.update(p),i&&o.push(Buffer.from(p))}),c=r.digest("hex"),a=i?Buffer.concat(o,s):void 0,u=a?Ge(t,a)??re(t,a):void 0;return{size:s,hash:c,...u===void 0?{}:{semanticHash:u}}}function W(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function pt(e,t,n){let r=me(t,n),i=[...r.typescriptProjects.filter(a=>Nn(e,a)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?Le(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?Te(e,r.typescriptProjects):["."]:[],c=Be(s);return{...r,files:In(e,{includePath:a=>{if(a===".scipquery.json")return!1;let u=q(a,t,i);return u==="other"||u==="config"&&ke(a)&&!c.has(a)?!1:u!=="source"||!vn(a)||!o?!0:o.has(a)},includePaths:i})}}function Jr(e,t){let n=new Set(t.files.map(o=>o.path)),r=pt(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...me(t.languages,t),files:[...t.files.flatMap(o=>{let s=i.get(o.path);return s?[s]:[]}),...r.files.filter(o=>!n.has(o.path))]}}function Ur(e,t,n,r,i,o){let s=l=>({mode:"full",fingerprint:pt(e,t,n),reason:l}),c=kn(r,i,o);if(!c.ready)return s(c.reason);let{previous:a,journal:u}=c,p=me(t,n);if(!_n(a,p))return s("project-input-configuration-changed");if(new Set(a.files.map(l=>l.path)).size!==a.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(u.entries.length===0)return{mode:"delta",fingerprint:{...p,files:[...a.files].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:[]};let m=new Map(a.files.map(l=>[l.path,l])),b=Dn(t,p,m,u);if(b)return s(b);let j=D(e),F=Ln(e,j,m,u);return F?s(F):(ue(j),{mode:"delta",fingerprint:{...p,files:[...m.values()].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:u.entries.map(l=>l.path).sort()})}function kn(e,t,n){return t?t.complete?n?t.baseGeneration!==n?{ready:!1,reason:"change-journal-base-mismatch"}:e?{ready:!0,previous:e,journal:t}:{ready:!1,reason:"prior-project-input-snapshot-unavailable"}:{ready:!1,reason:"accepted-generation-unavailable"}:{ready:!1,reason:`change-journal-incomplete:${t.incompleteReason??"unknown"}`}:{ready:!1,reason:"change-journal-unavailable"}}function Dn(e,t,n,r){let i=[...t.typescriptProjects,...t.clojureConfigPath?[t.clojureConfigPath]:[]];for(let o of r.entries){let s=Un(o,n,e,i);if(s!==null)return s}return null}function Ln(e,t,n,r){for(let i of r.entries){let o=ut(e,t,i.path);if(i.kind==="delete"){if(o.length!==0)return"deleted-source-is-still-readable";n.delete(i.path);continue}if(o.length!==1||o[0].hash==="unreadable"||o[0].size<0)return i.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable";n.set(i.path,o[0])}return null}function _n(e,t){return e.version===t.version&&e.typescriptSymbolIdentityVersion===t.typescriptSymbolIdentityVersion&&JSON.stringify([...e.languages].sort())===JSON.stringify(t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function vn(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function Nn(e,t){let n;try{n=P(t)}catch{return!1}let r=I(e,n);if(r)return r==="present";try{return de(ge(e,n)).isFile()}catch(i){if(ye(i))return!1;throw i}}function me(e,t){return{version:3,...e.includes("typescript")?{typescriptSymbolIdentityVersion:6}:{},languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:yn(t.typescriptProjects),clojureConfigPath:zn(t.clojureConfigPath)}}function zn(e){return e?.trim()||void 0}function Mn(e){try{let t=Ee(e,52428800,()=>an("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...Ie(t)]}catch{return null}}function An(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?ge(e,r):e,o=be(i);for(let s of o){let c=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){V(c)||n.push(c);continue}t.push(c)}}return t}function V(e){let t=e.split("/");return e==="meta.json"||De(e)||t[0]===".scipquery"&&Vn.has(t[1])||t.some(n=>Hn.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Hn=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);function $n(e,t,n,r){if(n==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(t)} does not exist.`),{code:"ENOENT"});let i=N(e,t);if(!i)throw new h(t,"changed-during-read");let o=r.maxBytes??_;if(v(o),i.size>o)throw new C(r.inputKind??"project file",t,i.size,o);return Buffer.from(i.content)}function Jn(e){return(e&128)===0?1:(e&224)===192?2:(e&240)===224?3:(e&248)===240?4:0}function Un(e,t,n,r){let i=t.get(e.path);return q(e.path,n,r)!=="source"?"non-source-project-input-changed":Wn(e,i)}function Wn(e,t){return e.kind==="add"&&t?"added-path-already-in-prior-project-input-snapshot":e.kind==="delete"&&!t?"deleted-path-not-in-prior-project-input-snapshot":e.kind==="change"&&!t?"changed-path-not-in-prior-project-input-snapshot":t&&(t.hash==="unreadable"||t.size<0)?"changed-path-was-unreadable":null}var Vn=new Set(["events","ledger","releases","suppressions"]);export{R as a,Ne as b,M as c,A as d,hr as e,Q as f,Ue as g,wt as h,sr as i,cr as j,ar as k,ur as l,pr as m,xr as n,C as o,yn as p,he as q,mn as r,Ar as s,Sn as t,Hr as u,ye as v,$r as w,En as x,In as y,pt as z,Jr as A,Ur as B,me as C};
4
+ //# sourceMappingURL=chunk-TKD34PHN.js.map
@@ -0,0 +1,2 @@
1
+ import{a as f}from"./chunk-4BP3UBDG.js";import{i as p}from"./chunk-4WCUBZU3.js";import{c as l}from"./chunk-E3FDPXZK.js";import{c}from"./chunk-5TNQJUR2.js";var R=new Set(["page","layout","template","loading","error","not-found","global-error","default","route"]),d=/\.(?:ts|tsx|js|jsx|mjs|cjs)$/,y=/^\((\.{1,3})\)(.*)$/,P=/^\(\.\.\)\(\.\.\)(.*)$/;function g(r){return u(r)!==null}function u(r){let t=c(r);if(!d.test(t))return null;let n=t.split("/"),e=n[n.length-1].replace(d,"");if(!R.has(e))return null;let o=n.findIndex((a,h)=>a==="app"&&h<n.length-1);if(o<0)return null;let i=[],s=!1;for(let a of n.slice(o+1,-1))s=k(i,a)||s;return{route:i,entry:e,intercepting:s}}function m(r,t){let n=u(r),e=u(t);return!n||!e||!n.intercepting&&!e.intercepting||n.entry!==e.entry?!1:n.route.join("/")===e.route.join("/")}function k(r,t){if(t.startsWith("@"))return!1;let n=P.exec(t);if(n)return r.splice(Math.max(0,r.length-2)),r.push(n[1]),!0;let e=y.exec(t);if(e){let o=e[1];return o===".."?r.splice(Math.max(0,r.length-1)):o==="..."&&r.splice(0),r.push(e[2]),!0}return t.startsWith("(")&&t.endsWith(")")||r.push(t),!1}function S(r){let t=new Map,n=e=>{let o=t.get(e);if(o)return o;let i=E(r,e);return t.set(e,i),i};return{roleOf:n,pairContext:(e,o)=>{let i=n(e),s=n(o);return i==="ui-kit"&&s==="ui-kit"?"ui-kit-pair":e!==o&&m(e,o)?"intercepting-route-pair":i==="framework-route"&&s==="framework-route"&&e!==o?"framework-route-pair":"product"}}}function E(r,t){return l(t)==="test"?"test":f(r,t)?"ui-kit":g(t)||p(t)?"framework-route":"product"}var x=class{counts=new Map;record(t,n,e=1){if(e<=0)return;let o=this.counts.get(t);if(o){o.count+=e;return}this.counts.set(t,{reason:t,detail:n,count:e})}list(){return[...this.counts.values()].sort((t,n)=>t.reason.localeCompare(n.reason))}},C={testFiles:"components defined in test files (fixture scaffolding, not product code)",uiKitPairs:"pairs where both components are vendored UI-kit primitives (similar by construction)",uiKitFiles:"components defined in vendored UI-kit directories",hookComponentPairs:"pairs that mix a hook with a component (a hook is already the extraction target)"};function T(r){switch(r){case"framework-route-pair":return"both files are framework route entries; route files share framework scaffolding by design";case"intercepting-route-pair":return"intercepting route and its target route are meant to render the same view";case"ui-kit-pair":return"both files are vendored UI-kit primitives";case"product":return null}}export{S as a,x as b,C as c,T as d};
2
+ //# sourceMappingURL=chunk-TNNQFH7W.js.map
@@ -0,0 +1,2 @@
1
+ import{b as l}from"./chunk-OGFV2BUX.js";import{a as n}from"./chunk-LOVIZBJ4.js";import{ca as i}from"./chunk-J5FJMODQ.js";function d(e,r){let s=l(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let o=s.filter(t=>!e.isIgnored(t)).sort(),m=i(e,o,{sort:!0}),a=n(e,"forward",s).filter(t=>!e.isIgnored(t)),p=n(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:o,symbols:m,dependsOn:a,dependedOnBy:p}}function u(e,r){return d(e,r)}export{d as a,u as b};
2
+ //# sourceMappingURL=chunk-TNV7SSUF.js.map
@@ -0,0 +1,8 @@
1
+ import{j as A,o as T}from"./chunk-UXYXF7GV.js";import{d as D}from"./chunk-NOLZOVCU.js";import{a as N,c as P,i as w,k as B}from"./chunk-LPCRK4A2.js";import{b as k}from"./chunk-6LSEIIF7.js";import{d as M}from"./chunk-72AD6ZRR.js";import{d as S,e as I}from"./chunk-5D2LVK7O.js";import{a as F}from"./chunk-7WTPQ4NX.js";function se(e,n={}){let{base:t="HEAD",minContainment:a=.7,minCallees:i=3,minSiteCoverage:r=.4,maxHelpers:s=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:m}=n,u=n.semantic!==!1,o=n.diffPlan??P(e,{base:t}),l={available:o.note!==N,base:t,changedFiles:o.changedFiles,helpersChecked:0,skipped:[],findings:[],...o.note?{note:o.note}:{}};if(!l.available||o.changedFiles.length===0)return l;let b=new k(e),d=new Set(o.changedFiles),C=new Map(o.renamedFiles.map(g=>[g.to,g.from])),f=O(e,n,o,t),p=K(b,d,C,f);if(p.unavailable)return l.available=!1,l.note=`Base content unavailable: ${p.unavailable.reason}`,l;if(p.definitions.length===0)return l;let x=p.definitions.slice(0,s);p.definitions.length>s&&(l.note=`helper scoring capped at ${s} of ${p.definitions.length} new symbols`);let E=b.calleeMap(x,{semantic:u}),H=x.map(g=>({def:g,callees:T((E.get(g.symbolId)??[]).map(h=>h.symbol))})),L=A(e),R,j={db:e,result:l,changed:d,minCallees:i,minContainment:a,minSiteCoverage:r,getCandidateIndex:()=>(R??=L.calleeIndex({minCallees:Math.min(3,i),scanLimit:m,semantic:u}),R)};for(let{def:g,callees:h}of H)$(g,h,j);return l.findings.sort((g,h)=>(h.leftovers[0]?.containment??0)-(g.leftovers[0]?.containment??0)||g.helperFile.localeCompare(h.helperFile)),l.findings=l.findings.slice(0,c),l}function O(e,n,t,a){if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");return n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Y(n.baseContentAt):w({projectRoot:e.config.projectRoot,base:a,preloadPaths:B(t)})}function $(e,n,t){let{db:a,result:i,changed:r,minCallees:s,minContainment:c,minSiteCoverage:m,getCandidateIndex:u}=t,o=S(e.symbol);if(n.size<s){i.skipped.push({helperShortName:o,helperFile:e.relativePath,reason:`fewer than ${s} meaningful callees \u2014 too small to score`});return}let l=u(),b=V(n,l);if(b===0){i.skipped.push({helperShortName:o,helperFile:e.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});return}let d=Z(a,e.symbolId);if(d.length===0){i.skipped.push({helperShortName:o,helperFile:e.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});return}i.helpersChecked+=1;let C=z({candidateIndex:l,changed:r,helperCallees:n,helperFile:e.relativePath,helperSymbol:e.symbol,minContainment:c,minSiteCoverage:m,migratedFiles:d});C.length!==0&&(C.sort((f,p)=>_(p.migrationScope)-_(f.migrationScope)||p.containment-f.containment||p.siteCoverage-f.siteCoverage||f.file.localeCompare(p.file)),i.findings.push({helperSymbol:e.symbol,helperShortName:o,helperFile:e.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:n.size,specificHelperCalleeCount:b,migratedFiles:d.sort(),leftovers:C}))}function z(e){let n=[],t=q(e.helperSymbol,e.helperFile,e.migratedFiles),a=Q(e.candidateIndex,e.helperCallees);for(let i of a){let r=e.candidateIndex.corpus[i];if(r.symbol===e.helperSymbol||e.changed.has(r.file)||r.callees.has(e.helperSymbol))continue;let s=D(e.helperCallees,r.callees);if(s<e.minContainment)continue;let c=[...e.helperCallees].filter(o=>r.callees.has(o)),m=r.callees.size===0?0:c.length/r.callees.size;if(m<e.minSiteCoverage||!c.some(o=>(e.candidateIndex.docFreq.get(o)??0)<=e.candidateIndex.ubiquityThreshold))continue;let u=G(t,r.symbol,r.file);n.push({symbol:r.symbol,shortName:S(r.symbol),file:r.file,...u,containment:s,siteCoverage:m,uniqueSiteCalleeCount:Math.max(0,r.callees.size-c.length),sharedCallees:c.map(S).sort()})}return n}function _(e){return e==="shared-vocabulary"?2:e==="unknown"?1:0}function q(e,n,t){let a=new Set([...v(n),...y(I(e))]);for(let i of t)for(let r of v(i))a.add(r);return a}function G(e,n,t){let a=new Set([...v(t),...y(I(n))]);if(e.size===0||a.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to compare vocabulary"]};let i=[...a].filter(r=>e.has(r)).sort();return i.length>0?{migrationScope:"shared-vocabulary",migrationScopeReasons:[`shares path/name token(s): ${i.join(", ")}`]}:{migrationScope:"distinct-vocabulary",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var J=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function v(e){return y(e.replace(/\.[^.]+$/,""))}function y(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!J.has(n))}function V(e,n){let t=0;for(let a of e)(n.docFreq.get(a)??0)<=n.ubiquityThreshold&&(t+=1);return t}function K(e,n,t,a){let i=[],r=new Map;for(let s of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(s.relativePath))continue;let c=t.get(s.relativePath)??s.relativePath,m=a(c);if(m.state==="unavailable")return{definitions:[],unavailable:m};if(m.state==="absent"){i.push(s);continue}let u=U(s.leaf,c,m.content,r);if("unavailable"in u)return{definitions:[],unavailable:u.unavailable};u.exists||i.push(s)}return{definitions:i}}function U(e,n,t,a){if(!/\.[cm]?[jt]sx?$/i.test(n))return{exists:new RegExp(`\\b${F(e)}\\b`).test(t)};let i=W(n,t,a);return"unavailable"in i?i:{exists:i.names.has(e)}}function W(e,n,t){let a=t.get(e);if(!a){let i=M(e,n);if(i.errors.length>0)return{unavailable:{state:"unavailable",reason:i.errors.join("; ")}};a=new Set(i.functions.map(r=>r.name.split(".").at(-1))),t.set(e,a)}return{names:a}}function Y(e){return n=>{let t=e(n);return t===null?{state:"absent"}:{state:"present",content:t}}}function Z(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents ref_d ON c.document_id = ref_d.id
5
+ WHERE m.symbol_id = ?
6
+ AND m.role != 1
7
+ ${e.pathExclusionsFor("ref_d")}`,n).map(a=>a.relative_path)}function Q(e,n){let t=new Set;for(let a of n)for(let i of e.candidateIndexesByCallee.get(a)??[])t.add(i);return t}export{se as a};
8
+ //# sourceMappingURL=chunk-TO7ZR3EH.js.map
@@ -0,0 +1,2 @@
1
+ import{a as y}from"./chunk-HXENDJC6.js";import{c as d}from"./chunk-4WCUBZU3.js";import{c as u}from"./chunk-E3FDPXZK.js";import{b as f}from"./chunk-GCKCF5FL.js";function P(t,e={}){return B(t,e).cycles}function B(t,e={}){return S(t,e)}function $(t,e={}){return S(t,e).cycles}function S(t,e={}){let{scope:n,maxDepth:c=10,edgeBasis:i="symbol-references"}=e,s=f(t,n,i==="imports"?{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}:void 0),{components:a}=y(s),l=a.filter(r=>b(s,r)).map(r=>{let o=[...r].sort(),{path:D,kind:p}=x(s,o);return{path:D,component:o,edgeBasis:i,witness:!0,classification:p==="real"?"dependency-cycle":"module-structure-candidate",kind:p}});return l.sort((r,o)=>r.kind!==o.kind?r.kind==="real"?-1:1:r.path.length-o.path.length),{cycles:l,truncated:!1,edgeBasis:i,maxDepth:c}}function x(t,e){let n=g(t,e),c=new Set(e.filter(r=>R(r)));if(c.size===0)return{path:n,kind:h(n)};let i=new Set(e),s=new Map;for(let r of e)c.has(r)||s.set(r,new Set([...t.get(r)??[]].filter(o=>i.has(o)&&!c.has(o))));let a=y(s).components.filter(r=>b(s,r)).map(r=>[...r].sort()).sort((r,o)=>r[0].localeCompare(o[0]))[0];if(!a)return{path:n,kind:"module-hierarchy"};let l=g(s,a);return{path:l,kind:h(l)}}function R(t){let e=u(t);return e==="test"||e==="barrel"||e==="entry"||d(t)}function b(t,e){if(e.length>1)return!0;let n=e[0];return n!==void 0&&t.get(n)?.has(n)===!0}function g(t,e){let n=e[0];if(!n)return[];let c=new Set(e);for(let i of[...t.get(n)??[]].filter(s=>c.has(s)).sort()){if(i===n)return[n,n];let s=k(t,i,n,c);if(s)return[n,...s]}throw new Error(`Cyclic component did not contain a witness path from ${n}.`)}function k(t,e,n,c){let i=[e],s=new Map([[e,null]]);for(let a=0;a<i.length;a+=1){let l=i[a];if(l===n){let r=[];for(let o=l;o!==null;o=s.get(o)??null)r.push(o);return r.reverse()}for(let r of[...t.get(l)??[]].filter(o=>c.has(o)).sort())s.has(r)||(s.set(r,l),i.push(r))}return null}function h(t){for(let c of t)if(w(c))return"module-hierarchy";if(t.length!==3)return"real";let[e,n]=t;return!e||!n?"real":F(e,n)}function w(t){let e=u(t);return e==="test"||e==="barrel"||e==="entry"}function F(t,e){return d(t)||d(e)||m(t,e)||m(e,t)||C(t,e)||C(e,t)||u(t)==="entry"||u(e)==="entry"?"module-hierarchy":"real"}function m(t,e){if(!t.endsWith(".rs")||!e.endsWith(".rs"))return!1;let n=e.replace(/\.rs$/,"/");return t.startsWith(n)?!t.slice(n.length).includes("/"):!1}function C(t,e){if(!t.endsWith(".rs")||!e.endsWith(".rs"))return!1;let n=t.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(n===c+"_tests"||n===c+"/tests")return!0;let i=t.split("/"),s=e.split("/");if(i.length===s.length&&i.includes("tests")&&s.includes("src")){let a=i[i.length-1],l=s[s.length-1];if(a&&a===l)return!0}return!1}export{P as a,B as b,$ as c,S as d};
2
+ //# sourceMappingURL=chunk-TOU3CHK4.js.map