scip-query 0.22.0 → 0.24.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 (470) hide show
  1. package/CHANGELOG.md +500 -0
  2. package/README.md +13 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-H3P6BR5G.js +2 -0
  5. package/dist/call-graph-VTG2CUOQ.js +2 -0
  6. package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
  7. package/dist/chunk-2BMSSRBH.js +2 -0
  8. package/dist/{chunk-TAYD3AE7.js → chunk-2GJSD5GY.js} +2 -2
  9. package/dist/{chunk-TUQIPUDS.js → chunk-2M2LSIMY.js} +3 -3
  10. package/dist/{chunk-GIQ6CSL4.js → chunk-2N6WBNDC.js} +2 -2
  11. package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
  12. package/dist/{chunk-EELPBR7E.js → chunk-2USA3S3P.js} +2 -2
  13. package/dist/chunk-2VAHDDLM.js +133 -0
  14. package/dist/chunk-2XWIUW5Z.js +455 -0
  15. package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
  16. package/dist/chunk-3D4BOXW6.js +20 -0
  17. package/dist/{chunk-FFJQZG6J.js → chunk-3LO4FST5.js} +2 -2
  18. package/dist/{chunk-HXOU4XNH.js → chunk-3WTY4LP2.js} +2 -2
  19. package/dist/{chunk-DPWKKNKI.js → chunk-3Z5AMSK6.js} +2 -2
  20. package/dist/{chunk-F24G5NBE.js → chunk-44IETFOU.js} +2 -2
  21. package/dist/chunk-4FR6GQIT.js +2 -0
  22. package/dist/chunk-4KBTHJLP.js +2 -0
  23. package/dist/chunk-5BIKR67W.js +2 -0
  24. package/dist/{chunk-DJAO2OZJ.js → chunk-5PROPLHI.js} +2 -2
  25. package/dist/chunk-5V7EPTII.js +2 -0
  26. package/dist/{chunk-VZ7NXSHV.js → chunk-62LPZCBQ.js} +2 -2
  27. package/dist/{chunk-LXQUF2RP.js → chunk-64O2JHQA.js} +2 -2
  28. package/dist/chunk-6D4F5VWG.js +10 -0
  29. package/dist/{chunk-NEIQPFBI.js → chunk-6ERFBC3X.js} +2 -2
  30. package/dist/{chunk-4HE7MVWD.js → chunk-6ILKOOGH.js} +2 -2
  31. package/dist/chunk-6MFXCMZC.js +2 -0
  32. package/dist/chunk-6O7FACKB.js +2 -0
  33. package/dist/{chunk-R6M456QG.js → chunk-6TS3KOXR.js} +2 -2
  34. package/dist/{chunk-7U2YQSDE.js → chunk-76QOU4PK.js} +2 -2
  35. package/dist/{chunk-25GWKRUZ.js → chunk-7DUI77BN.js} +2 -2
  36. package/dist/chunk-7F45LJKI.js +2 -0
  37. package/dist/{chunk-DEAB5TGT.js → chunk-7F7T6DCR.js} +2 -2
  38. package/dist/chunk-7H6VHWWJ.js +2 -0
  39. package/dist/chunk-7HXT6YLU.js +5 -0
  40. package/dist/{chunk-KZYID5KV.js → chunk-7R4V5ES6.js} +4 -4
  41. package/dist/chunk-7RIRIADH.js +7 -0
  42. package/dist/chunk-7ZLWLOGT.js +2 -0
  43. package/dist/{chunk-WHADK6OS.js → chunk-A4WEAK35.js} +2 -2
  44. package/dist/chunk-AADQLOQ4.js +38 -0
  45. package/dist/{chunk-XFMVKFSF.js → chunk-AN76MGUE.js} +2 -2
  46. package/dist/chunk-ANLNLY66.js +2 -0
  47. package/dist/chunk-ATXPTSEI.js +81 -0
  48. package/dist/{chunk-EELG7D3Q.js → chunk-AX7IDVFT.js} +2 -2
  49. package/dist/chunk-B3PYOSCX.js +2 -0
  50. package/dist/chunk-B7MPDEAK.js +3 -0
  51. package/dist/chunk-BBB5FBX4.js +2 -0
  52. package/dist/{chunk-Y2VM4CJC.js → chunk-BHKK5RJY.js} +2 -2
  53. package/dist/chunk-BJWFVAA5.js +2 -0
  54. package/dist/chunk-BKVWUP7Y.js +2 -0
  55. package/dist/{chunk-7XA3OM44.js → chunk-BKZYTLGE.js} +2 -2
  56. package/dist/chunk-BL6DCHQP.js +2 -0
  57. package/dist/chunk-BOW7SSQH.js +43 -0
  58. package/dist/{chunk-KQHJEU6V.js → chunk-C4RHHCKL.js} +2 -2
  59. package/dist/chunk-C7C6AKAT.js +117 -0
  60. package/dist/chunk-CD6M6LS2.js +16 -0
  61. package/dist/chunk-CFE6PSG6.js +2 -0
  62. package/dist/{chunk-GPGRZJ3R.js → chunk-CFNIGQMT.js} +2 -2
  63. package/dist/{chunk-K3XFWJI2.js → chunk-CKBUBRYD.js} +2 -2
  64. package/dist/chunk-CZW5MZ5B.js +2 -0
  65. package/dist/chunk-DBBZ63ZX.js +2 -0
  66. package/dist/chunk-DBN7DMJB.js +18 -0
  67. package/dist/{chunk-CKRWA452.js → chunk-DUULLZHZ.js} +2 -2
  68. package/dist/{chunk-6HRZQLOI.js → chunk-DV5Y5NOS.js} +2 -2
  69. package/dist/chunk-DZOIKCTM.js +3 -0
  70. package/dist/chunk-E4PKTOL3.js +2 -0
  71. package/dist/{chunk-GVOMSPGL.js → chunk-E65ELFKU.js} +2 -2
  72. package/dist/{chunk-VXJJTQYE.js → chunk-E7QR35ST.js} +2 -2
  73. package/dist/{chunk-2RE5OCHZ.js → chunk-EFSXAINW.js} +2 -2
  74. package/dist/{chunk-GY7CCCEZ.js → chunk-EHVEIEQN.js} +2 -2
  75. package/dist/{chunk-BVFYEEBH.js → chunk-EHYDXE3Z.js} +2 -2
  76. package/dist/{chunk-HISEUIL2.js → chunk-EP63Y6LD.js} +2 -2
  77. package/dist/chunk-EPX6NQN6.js +4 -0
  78. package/dist/chunk-ETC674NS.js +5 -0
  79. package/dist/{chunk-5H5WTJSD.js → chunk-F5GSBHC6.js} +2 -2
  80. package/dist/chunk-FH3DGXC6.js +2 -0
  81. package/dist/{chunk-2XCGSDIT.js → chunk-FI7VGOR4.js} +2 -2
  82. package/dist/chunk-FJF6VO2P.js +2 -0
  83. package/dist/{chunk-FELGD32K.js → chunk-FLMTCX5R.js} +2 -2
  84. package/dist/chunk-FVFDOIM3.js +2 -0
  85. package/dist/{chunk-AQ2PORIO.js → chunk-G2HU5WRN.js} +2 -2
  86. package/dist/{chunk-7YQOCABQ.js → chunk-G4ALYS4J.js} +2 -2
  87. package/dist/{chunk-SWK4XPUS.js → chunk-G56I7K4W.js} +2 -2
  88. package/dist/{chunk-JFQBRL3J.js → chunk-GC4DG2V5.js} +2 -2
  89. package/dist/chunk-GG45PK4S.js +4 -0
  90. package/dist/{chunk-XN22RGSR.js → chunk-GHNPACNP.js} +2 -2
  91. package/dist/{chunk-XU75YQN4.js → chunk-GINH3YQU.js} +2 -2
  92. package/dist/chunk-GTZZVLKJ.js +2 -0
  93. package/dist/chunk-GXXW5ZHH.js +2 -0
  94. package/dist/{chunk-RNKPYYYE.js → chunk-HAXXKRTD.js} +2 -2
  95. package/dist/chunk-HEZWBAZY.js +2 -0
  96. package/dist/chunk-HMEWLMML.js +2 -0
  97. package/dist/{chunk-2KVU55CW.js → chunk-HOBOVYPO.js} +2 -2
  98. package/dist/{chunk-2YC7YNKT.js → chunk-HRFQ6GW5.js} +2 -2
  99. package/dist/{chunk-RYOYJMGF.js → chunk-HX4X7KG3.js} +2 -2
  100. package/dist/{chunk-AZS7YPCB.js → chunk-HYT2R7LX.js} +2 -2
  101. package/dist/chunk-IKQVBVQL.js +40 -0
  102. package/dist/chunk-J6GLBBRK.js +4 -0
  103. package/dist/{chunk-TNG2FYS5.js → chunk-J7A4PWFX.js} +2 -2
  104. package/dist/chunk-JCSAZ35V.js +2 -0
  105. package/dist/{chunk-EWWY2ZFL.js → chunk-JDU2IV3A.js} +2 -2
  106. package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
  107. package/dist/chunk-JFMI5SGB.js +4 -0
  108. package/dist/chunk-JJP37RGX.js +57 -0
  109. package/dist/chunk-JZ2A7LDM.js +5 -0
  110. package/dist/chunk-KNLQGXVH.js +80 -0
  111. package/dist/chunk-KVQCECPR.js +2 -0
  112. package/dist/{chunk-F24QUEQP.js → chunk-KXXORBZ2.js} +2 -2
  113. package/dist/{chunk-IKVNEGTW.js → chunk-L5KYH6U3.js} +2 -2
  114. package/dist/chunk-L6XHYJPZ.js +21 -0
  115. package/dist/chunk-L7KTFEAV.js +43 -0
  116. package/dist/{chunk-UAQ4T73O.js → chunk-LDXHR5EL.js} +2 -2
  117. package/dist/chunk-LEECKFCJ.js +2 -0
  118. package/dist/{chunk-LO5JSW2C.js → chunk-MHGDSBFX.js} +2 -2
  119. package/dist/{chunk-JUN5DOAK.js → chunk-MLQVVDG3.js} +2 -2
  120. package/dist/chunk-MOKUWRHO.js +3 -0
  121. package/dist/{chunk-44T4DUAA.js → chunk-MPYAPMNE.js} +2 -2
  122. package/dist/{chunk-ARVO6TTW.js → chunk-MV6SPXCR.js} +2 -2
  123. package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
  124. package/dist/{chunk-TH6IC56G.js → chunk-MZPXPSUJ.js} +2 -2
  125. package/dist/{chunk-FBCVASUG.js → chunk-N55KIE46.js} +2 -2
  126. package/dist/{chunk-VMWUV6WB.js → chunk-NB4D3BNM.js} +2 -2
  127. package/dist/{chunk-JAT6C3VX.js → chunk-NGKBOT6G.js} +2 -2
  128. package/dist/{chunk-Q6T2CAJL.js → chunk-NJGKXKQF.js} +2 -2
  129. package/dist/chunk-NJQISBL4.js +8 -0
  130. package/dist/chunk-NJT3ZEKY.js +16 -0
  131. package/dist/{chunk-KFVSJX25.js → chunk-NKMKZP6A.js} +2 -2
  132. package/dist/chunk-NODFZ6ED.js +2 -0
  133. package/dist/{chunk-ERCYGVAM.js → chunk-NSM5IEVW.js} +2 -2
  134. package/dist/{chunk-YAGYMBEX.js → chunk-NTGUVNR2.js} +2 -2
  135. package/dist/{chunk-N7FP5H5U.js → chunk-NU3KFF2O.js} +8 -8
  136. package/dist/chunk-NWLVNU66.js +557 -0
  137. package/dist/{chunk-Q55NF3ZG.js → chunk-NYKZMCRC.js} +2 -2
  138. package/dist/{chunk-I6UTXNHU.js → chunk-O6BUXZEH.js} +2 -2
  139. package/dist/chunk-ODPDP7A4.js +3 -0
  140. package/dist/{chunk-ZAZGGSM3.js → chunk-OHIV323X.js} +2 -2
  141. package/dist/chunk-OIAPEKMT.js +3 -0
  142. package/dist/chunk-OIOC5EHF.js +3 -0
  143. package/dist/{chunk-YIHNPKWD.js → chunk-ONPPQM4G.js} +2 -2
  144. package/dist/{chunk-RHHCLWQ6.js → chunk-OUHEZBYI.js} +2 -2
  145. package/dist/{chunk-MSR2QRUE.js → chunk-OVGYW7UD.js} +2 -2
  146. package/dist/{chunk-OPSAW5DT.js → chunk-OYKU4B3Y.js} +2 -2
  147. package/dist/{chunk-5YRQIE2B.js → chunk-POBJ6FR2.js} +2 -2
  148. package/dist/{chunk-ZGW4HLPD.js → chunk-PSZPMMWN.js} +2 -2
  149. package/dist/chunk-PXTRBKRK.js +3 -0
  150. package/dist/{chunk-U2N2KE7A.js → chunk-Q5JRIHT3.js} +2 -2
  151. package/dist/{chunk-GRX7JOXQ.js → chunk-Q7ATHARX.js} +2 -2
  152. package/dist/{chunk-5ZMBRQFC.js → chunk-Q7CSKIDM.js} +2 -2
  153. package/dist/{chunk-HG722PO7.js → chunk-QBQE7ZJ5.js} +2 -2
  154. package/dist/{chunk-Z2PZVKPR.js → chunk-QH22UIXP.js} +2 -2
  155. package/dist/chunk-QXCKQTKR.js +60 -0
  156. package/dist/chunk-RBAD4GJ2.js +13 -0
  157. package/dist/chunk-RMDPFPNW.js +2 -0
  158. package/dist/chunk-ROPJDEJZ.js +4 -0
  159. package/dist/{chunk-56NQAEPJ.js → chunk-RVZC6TJE.js} +2 -2
  160. package/dist/{chunk-XJX6LGHL.js → chunk-S4QZBKSR.js} +2 -2
  161. package/dist/chunk-SCPMZ73U.js +2 -0
  162. package/dist/{chunk-7IQXARSQ.js → chunk-SIAP5RGI.js} +2 -2
  163. package/dist/{chunk-4TQU4TX2.js → chunk-SIX4RFR3.js} +2 -2
  164. package/dist/{chunk-AYPDH2LU.js → chunk-SKKXTABJ.js} +2 -2
  165. package/dist/{chunk-ZYM4HOFA.js → chunk-SSRFUQBD.js} +2 -2
  166. package/dist/chunk-SYVJEEUJ.js +3 -0
  167. package/dist/chunk-T3CZAZSI.js +8 -0
  168. package/dist/chunk-T3I6NHBH.js +2 -0
  169. package/dist/{chunk-GDRJB3SB.js → chunk-T6DWDI5E.js} +2 -2
  170. package/dist/chunk-T6HRIROJ.js +7 -0
  171. package/dist/{chunk-OTSPRVNW.js → chunk-TAA7HXHE.js} +2 -2
  172. package/dist/{chunk-IJMD6BRI.js → chunk-TJ2JQYT3.js} +2 -2
  173. package/dist/chunk-TULNMD5T.js +368 -0
  174. package/dist/chunk-U2FPY5XA.js +3 -0
  175. package/dist/chunk-U3SXIMII.js +38 -0
  176. package/dist/{chunk-ENWQWA2R.js → chunk-U6KCHXJ4.js} +2 -2
  177. package/dist/chunk-UH3XSKS5.js +9 -0
  178. package/dist/{chunk-UDY7MIAW.js → chunk-UIFUZVCC.js} +2 -2
  179. package/dist/{chunk-BDGTPN27.js → chunk-UXKURIVI.js} +2 -2
  180. package/dist/{chunk-FGNCOQUX.js → chunk-V2RBODHL.js} +2 -2
  181. package/dist/chunk-VBKUWB6N.js +2 -0
  182. package/dist/{chunk-PIFTZEEM.js → chunk-VBV6ALJE.js} +2 -2
  183. package/dist/{chunk-2OXVP5U5.js → chunk-VDGFWCQV.js} +2 -2
  184. package/dist/chunk-VDSDOEWF.js +2 -0
  185. package/dist/{chunk-C76O5MDS.js → chunk-VZPWVCLN.js} +2 -2
  186. package/dist/chunk-WDSFQDPN.js +2 -0
  187. package/dist/{chunk-BTVKZGWT.js → chunk-WFA35BGR.js} +2 -2
  188. package/dist/{chunk-H7CG6LOE.js → chunk-WLMP3OCW.js} +2 -2
  189. package/dist/{chunk-WOOAY3PA.js → chunk-WSA52GOR.js} +2 -2
  190. package/dist/chunk-WYPL7GF7.js +2 -0
  191. package/dist/{chunk-RDULNRSJ.js → chunk-X3YVZAKZ.js} +2 -2
  192. package/dist/chunk-X6OGVFIT.js +2 -0
  193. package/dist/{chunk-ISWFRGJ6.js → chunk-XKXTR6ZI.js} +2 -2
  194. package/dist/chunk-Y5DFAW5W.js +4 -0
  195. package/dist/chunk-YSYPDRD5.js +3 -0
  196. package/dist/chunk-ZFVPWH62.js +5 -0
  197. package/dist/chunk-ZGIHTH27.js +2 -0
  198. package/dist/{chunk-QKT4UI2Y.js → chunk-ZGIQN2SX.js} +2 -2
  199. package/dist/chunk-ZHG4WAHR.js +12 -0
  200. package/dist/{chunk-CLG6DWVS.js → chunk-ZKB2XUEN.js} +2 -2
  201. package/dist/chunk-ZLMXIQLC.js +21 -0
  202. package/dist/chunk-ZMCQIHI4.js +2 -0
  203. package/dist/cli-main.js +2 -2
  204. package/dist/code-TAVIKWJI.js +2 -0
  205. package/dist/code-result-json-5FEFQCAQ.js +2 -0
  206. package/dist/command-descriptors-7BKH53Y3.js +343 -0
  207. package/dist/dataflow-GFBTVDH3.js +2 -0
  208. package/dist/dependence-slice-GWGQCODG.js +2 -0
  209. package/dist/deps-4QHVDPYA.js +2 -0
  210. package/dist/direct-navigation-4UBC6HNW.js +3 -0
  211. package/dist/entry-map-QCTF4RVY.js +2 -0
  212. package/dist/files-M2UBF5HJ.js +2 -0
  213. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  214. package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
  215. package/dist/hierarchy-2UIHRLW4.js +2 -0
  216. package/dist/imports-WIE3YZOB.js +2 -0
  217. package/dist/index.d.ts +1 -1
  218. package/dist/index.js +1 -1
  219. package/dist/members-YKD636DA.js +2 -0
  220. package/dist/methods-VDF4IMYG.js +2 -0
  221. package/dist/output-continuation-command-4UMDOOLO.js +3 -0
  222. package/dist/output-pagination-2GME6OPY.js +19 -0
  223. package/dist/postinstall.js +1 -1
  224. package/dist/project-reindex-XEQTRCV5.js +3 -0
  225. package/dist/queries/affected.js +1 -1
  226. package/dist/queries/anchors.d.ts +1 -1
  227. package/dist/queries/anchors.js +1 -1
  228. package/dist/queries/architecture.js +1 -1
  229. package/dist/queries/bottlenecks.js +1 -1
  230. package/dist/queries/by-kind.js +1 -1
  231. package/dist/queries/call-graph.d.ts +2 -0
  232. package/dist/queries/call-graph.js +1 -1
  233. package/dist/queries/change-surface.js +1 -1
  234. package/dist/queries/cleanup-plan.js +1 -1
  235. package/dist/queries/co-change.d.ts +20 -2
  236. package/dist/queries/co-change.js +1 -1
  237. package/dist/queries/code.js +1 -1
  238. package/dist/queries/complexity-hotspots.js +1 -1
  239. package/dist/queries/complexity.js +1 -1
  240. package/dist/queries/context.js +1 -1
  241. package/dist/queries/convergence.js +1 -1
  242. package/dist/queries/coupling.js +1 -1
  243. package/dist/queries/cycles.js +1 -1
  244. package/dist/queries/dataflow.js +1 -1
  245. package/dist/queries/dead.d.ts +2 -0
  246. package/dist/queries/dead.js +1 -1
  247. package/dist/queries/decorative-checkers.js +1 -1
  248. package/dist/queries/deep-chains.js +1 -1
  249. package/dist/queries/dependence-slice.js +1 -1
  250. package/dist/queries/dependency-depth.js +1 -1
  251. package/dist/queries/deps.js +1 -1
  252. package/dist/queries/diff-impact.d.ts +9 -0
  253. package/dist/queries/diff-impact.js +1 -1
  254. package/dist/queries/doc-drift.js +1 -1
  255. package/dist/queries/drift.js +1 -1
  256. package/dist/queries/duplicate-bodies.d.ts +28 -1
  257. package/dist/queries/duplicate-bodies.js +1 -1
  258. package/dist/queries/entry-map.d.ts +1 -1
  259. package/dist/queries/entry-map.js +1 -1
  260. package/dist/queries/evidence.js +1 -1
  261. package/dist/queries/extract-candidates.d.ts +50 -23
  262. package/dist/queries/extract-candidates.js +1 -1
  263. package/dist/queries/fan.js +1 -1
  264. package/dist/queries/files.js +1 -1
  265. package/dist/queries/health.d.ts +1 -1
  266. package/dist/queries/health.js +1 -1
  267. package/dist/queries/hierarchy.js +1 -1
  268. package/dist/queries/hotspots.js +1 -1
  269. package/dist/queries/imports.js +1 -1
  270. package/dist/queries/incomplete-migration.js +1 -1
  271. package/dist/queries/index.d.ts +4 -3
  272. package/dist/queries/index.js +1 -1
  273. package/dist/queries/isolated.js +1 -1
  274. package/dist/queries/locality-candidates.js +1 -1
  275. package/dist/queries/members.js +1 -1
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.js +1 -1
  278. package/dist/queries/outline.js +1 -1
  279. package/dist/queries/passthrough-candidates.d.ts +9 -1
  280. package/dist/queries/passthrough-candidates.js +1 -1
  281. package/dist/queries/plan-context.js +1 -1
  282. package/dist/queries/react-component-duplicates.d.ts +19 -3
  283. package/dist/queries/react-component-duplicates.js +1 -1
  284. package/dist/queries/react-hook-candidates.d.ts +22 -3
  285. package/dist/queries/react-hook-candidates.js +1 -1
  286. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  287. package/dist/queries/react-large-component-pressure.js +1 -1
  288. package/dist/queries/recent-duplicates.js +1 -1
  289. package/dist/queries/redundant-reexports.js +1 -1
  290. package/dist/queries/reference-neighborhood.js +1 -1
  291. package/dist/queries/reference-reachability.js +1 -1
  292. package/dist/queries/refs.js +1 -1
  293. package/dist/queries/self-audit.d.ts +7 -1
  294. package/dist/queries/self-audit.js +1 -1
  295. package/dist/queries/similar-chains.js +1 -1
  296. package/dist/queries/similar-files.js +1 -1
  297. package/dist/queries/similar-signatures.js +1 -1
  298. package/dist/queries/similar.js +1 -1
  299. package/dist/queries/slice.js +1 -1
  300. package/dist/queries/source-inspection.js +1 -1
  301. package/dist/queries/source-search.js +1 -1
  302. package/dist/queries/stale-abstractions.js +1 -1
  303. package/dist/queries/surface.js +1 -1
  304. package/dist/queries/symbols.js +1 -1
  305. package/dist/queries/system-map.d.ts +1 -1
  306. package/dist/queries/system-map.js +1 -1
  307. package/dist/queries/system.js +1 -1
  308. package/dist/queries/test-quality.js +1 -1
  309. package/dist/queries/trace.js +1 -1
  310. package/dist/queries/twin-ab.js +1 -1
  311. package/dist/queries/twin-drift.d.ts +22 -6
  312. package/dist/queries/twin-drift.js +1 -1
  313. package/dist/queries/unused-imports.js +1 -1
  314. package/dist/queries/unused-params.js +1 -1
  315. package/dist/queries/value-flow.js +1 -1
  316. package/dist/queries/vue-component-duplicates.js +1 -1
  317. package/dist/queries/vue-composable-candidates.js +1 -1
  318. package/dist/queries/vue-large-view-pressure.js +1 -1
  319. package/dist/queries/wrapper-candidates.d.ts +16 -1
  320. package/dist/queries/wrapper-candidates.js +1 -1
  321. package/dist/query-service-fastpath.js +5 -5
  322. package/dist/query-service-server.js +3 -3
  323. package/dist/refs-JNK5CLM7.js +2 -0
  324. package/dist/refs-pagination-6BLRYGMV.js +2 -0
  325. package/dist/reindex-worker.js +25 -25
  326. package/dist/reindex.d.ts +3 -2
  327. package/dist/reindex.js +35 -35
  328. package/dist/runtime.d.ts +34 -2
  329. package/dist/runtime.js +4 -4
  330. package/dist/rust-semantic-session-server.js +1 -1
  331. package/dist/rust-semantic-session-worker.js +1 -1
  332. package/dist/rust-semantic-worker.js +1 -1
  333. package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
  334. package/dist/slice-PHPVNCWX.js +2 -0
  335. package/dist/surface-MQX5MPIV.js +2 -0
  336. package/dist/symbol-resolution-DBLVXLBC.js +2 -0
  337. package/dist/system-JOPKV4OG.js +2 -0
  338. package/dist/trace-I2P2YFH4.js +2 -0
  339. package/dist/typescript-mailbox-worker.js +1 -1
  340. package/dist/value-flow-JJVMF7NP.js +2 -0
  341. package/dist/watch-server.js +3 -3
  342. package/docs/COMMAND_REFERENCE.md +2 -2
  343. package/docs/DETECTOR_GUIDE.md +51 -12
  344. package/docs/accuracy-audit-checklist.md +36 -13
  345. package/docs/locality-analyzer-design.md +9 -9
  346. package/package.json +2 -2
  347. package/skills/conductor/SKILL.md +110 -0
  348. package/skills/conductor/agents/openai.yaml +4 -0
  349. package/skills/principal-maintainability-review/SKILL.md +273 -0
  350. package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
  351. package/skills/scip-calibrate/SKILL.md +102 -0
  352. package/skills/scip-calibrate/agents/openai.yaml +4 -0
  353. package/skills/scip-claim-audit/SKILL.md +113 -0
  354. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  355. package/skills/scip-probe-reachability/SKILL.md +93 -0
  356. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  357. package/skills/scip-root-cause/SKILL.md +160 -0
  358. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  359. package/skills/scip-system-compression/SKILL.md +252 -0
  360. package/skills/scip-system-compression/agents/openai.yaml +4 -0
  361. package/skills/scip-system-compression/references/compression-atlas.md +116 -0
  362. package/skills/scip-system-compression/references/compression-patterns.md +87 -0
  363. package/skills/scip-twin-drift/SKILL.md +109 -0
  364. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  365. package/dist/by-kind-4IYG2SKW.js +0 -2
  366. package/dist/call-graph-WQNXMNNN.js +0 -2
  367. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  368. package/dist/chunk-2BTJALUS.js +0 -454
  369. package/dist/chunk-3QXC54FQ.js +0 -3
  370. package/dist/chunk-3TJY6M3B.js +0 -7
  371. package/dist/chunk-42W3LFUK.js +0 -13
  372. package/dist/chunk-4GAQ6FI4.js +0 -43
  373. package/dist/chunk-6NC3YSPY.js +0 -38
  374. package/dist/chunk-6VEFRPTD.js +0 -5
  375. package/dist/chunk-7C26EKLZ.js +0 -4
  376. package/dist/chunk-7JYHQAH2.js +0 -22
  377. package/dist/chunk-7KSO2OAP.js +0 -2
  378. package/dist/chunk-7XZGZBSQ.js +0 -2
  379. package/dist/chunk-A77SCPW2.js +0 -3
  380. package/dist/chunk-AK3PYTIK.js +0 -5
  381. package/dist/chunk-AMIMMNA4.js +0 -11
  382. package/dist/chunk-AUY5BL74.js +0 -2
  383. package/dist/chunk-BDHFVH2M.js +0 -18
  384. package/dist/chunk-BECZLYNU.js +0 -8
  385. package/dist/chunk-BUTEIZKP.js +0 -10
  386. package/dist/chunk-BWVQP3LB.js +0 -38
  387. package/dist/chunk-BYDAFMSR.js +0 -57
  388. package/dist/chunk-BZYSGZRK.js +0 -2
  389. package/dist/chunk-C7IJMOFP.js +0 -134
  390. package/dist/chunk-CBBHFNLX.js +0 -2
  391. package/dist/chunk-D2MVJSP4.js +0 -21
  392. package/dist/chunk-D35XIZGN.js +0 -2
  393. package/dist/chunk-DKM723YF.js +0 -79
  394. package/dist/chunk-DRENNWRG.js +0 -2
  395. package/dist/chunk-E44IVWIJ.js +0 -367
  396. package/dist/chunk-EDMB6SSO.js +0 -7
  397. package/dist/chunk-EETGXQY7.js +0 -3
  398. package/dist/chunk-FKGQOTKD.js +0 -2
  399. package/dist/chunk-GH5YSGZL.js +0 -5
  400. package/dist/chunk-GQIDEID3.js +0 -2
  401. package/dist/chunk-HCVJR2V4.js +0 -3
  402. package/dist/chunk-IMKZEXZG.js +0 -2
  403. package/dist/chunk-ISIQLPJ2.js +0 -61
  404. package/dist/chunk-IXESDH3J.js +0 -2
  405. package/dist/chunk-JJ62MTQH.js +0 -40
  406. package/dist/chunk-JT6XX7QY.js +0 -8
  407. package/dist/chunk-KFOYCQAJ.js +0 -9
  408. package/dist/chunk-LRI5OMPE.js +0 -2
  409. package/dist/chunk-MHIEP7EG.js +0 -4
  410. package/dist/chunk-NK3JMP22.js +0 -2
  411. package/dist/chunk-NVSZNESQ.js +0 -2
  412. package/dist/chunk-OJNK5ALA.js +0 -2
  413. package/dist/chunk-OXYAWIEA.js +0 -2
  414. package/dist/chunk-OZETODHH.js +0 -2
  415. package/dist/chunk-PBUH2P5S.js +0 -3
  416. package/dist/chunk-PLJUQFQN.js +0 -2
  417. package/dist/chunk-PLYUVM4F.js +0 -2
  418. package/dist/chunk-PXXYQK55.js +0 -2
  419. package/dist/chunk-Q5TA4OY4.js +0 -20
  420. package/dist/chunk-Q7GBK5T7.js +0 -81
  421. package/dist/chunk-QLBSG7U5.js +0 -3
  422. package/dist/chunk-QWKHW6VZ.js +0 -2
  423. package/dist/chunk-RPL3ARU7.js +0 -16
  424. package/dist/chunk-SVHTMVA4.js +0 -4
  425. package/dist/chunk-T6QD2ZQB.js +0 -43
  426. package/dist/chunk-TD7VKJ2Y.js +0 -117
  427. package/dist/chunk-TKDNDQA7.js +0 -3
  428. package/dist/chunk-TQZV7KV4.js +0 -2
  429. package/dist/chunk-TUSPIVZ3.js +0 -4
  430. package/dist/chunk-URSGGIZX.js +0 -2
  431. package/dist/chunk-UT7TADJX.js +0 -2
  432. package/dist/chunk-V4NG5OMS.js +0 -554
  433. package/dist/chunk-VTCIYFEK.js +0 -2
  434. package/dist/chunk-VU6LIWHT.js +0 -2
  435. package/dist/chunk-VUSKPCUB.js +0 -2
  436. package/dist/chunk-WN3TCGJ4.js +0 -2
  437. package/dist/chunk-WSLEJSFR.js +0 -2
  438. package/dist/chunk-WYZIHUPZ.js +0 -16
  439. package/dist/chunk-XE33FV5W.js +0 -2
  440. package/dist/chunk-XGGBK66W.js +0 -4
  441. package/dist/chunk-XSWYJCAK.js +0 -2
  442. package/dist/chunk-Y334QQU5.js +0 -3
  443. package/dist/chunk-Z2AWCTN6.js +0 -2
  444. package/dist/chunk-ZOXKSQQB.js +0 -2
  445. package/dist/chunk-ZPASRBLF.js +0 -2
  446. package/dist/chunk-ZZ3Z7D56.js +0 -2
  447. package/dist/code-EQJFDT6I.js +0 -2
  448. package/dist/code-result-json-7UWIWBOO.js +0 -2
  449. package/dist/command-descriptors-ORNTVNYV.js +0 -342
  450. package/dist/dataflow-6VL54GX5.js +0 -2
  451. package/dist/dependence-slice-DT2NUHD2.js +0 -2
  452. package/dist/deps-DB7H5IKC.js +0 -2
  453. package/dist/direct-navigation-O3LUAYWQ.js +0 -3
  454. package/dist/entry-map-6K62RV3D.js +0 -2
  455. package/dist/files-MSLD7MO6.js +0 -2
  456. package/dist/hierarchy-IVBXAKFA.js +0 -2
  457. package/dist/imports-FRAVZ3Y2.js +0 -2
  458. package/dist/members-KJOJDYGO.js +0 -2
  459. package/dist/methods-2AYABBT3.js +0 -2
  460. package/dist/output-continuation-command-JHMPH6NC.js +0 -3
  461. package/dist/output-pagination-3OFL2MJV.js +0 -19
  462. package/dist/project-reindex-HYO4WD7Z.js +0 -3
  463. package/dist/refs-ARMA6XUJ.js +0 -2
  464. package/dist/refs-pagination-VUGIWN6U.js +0 -2
  465. package/dist/slice-YOB5YFAM.js +0 -2
  466. package/dist/surface-VY5EFWTW.js +0 -2
  467. package/dist/symbol-resolution-DGQN4XIV.js +0 -2
  468. package/dist/system-2KQ3QD2P.js +0 -2
  469. package/dist/trace-HTIPTXAE.js +0 -2
  470. package/dist/value-flow-5FV3VQI7.js +0 -2
@@ -0,0 +1,81 @@
1
+ import{d as T}from"./chunk-CKBUBRYD.js";import{c as _}from"./chunk-IW5XQG5G.js";import{t as N}from"./chunk-7HXT6YLU.js";import{createHash as b}from"crypto";import{existsSync as O,mkdirSync as w}from"fs";import{dirname as m,join as I}from"path";import y from"better-sqlite3";var x="evidence.db";var k=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],v=new Set(k),M=25e4,j=512*1024*1024,U=6e4,h=new WeakMap,P=_("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),H=_("evidence-project-fingerprint",{clearGroups:["whole-project"]}),p="evidence-v1",d="version NOT LIKE 'evidence-%'",D=null;function s(){return D??=`${p}+${N()}`,D}function S(r){return b("sha256").update(r).digest("hex")}function J(r,n,e){return P.get(r,n,()=>S(e))}function z(r){return H.get(r,"current",()=>{try{if(!r.generation.metadataRaw)return null;let n=T(r.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let e=n.metadata,a=[...e.indexedLanguages??[]].sort();return S(JSON.stringify({fingerprint:e.fingerprint,indexedLanguages:a,status:e.status}))}catch(n){return E("project fingerprint unavailable",n),null}})}function E(r,n){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${r}: ${n instanceof Error?n.message:String(n)}`)}function o(r){if(h.has(r))return h.get(r)??null;let n=null;try{let e=new y(r.config.evidenceDbPath??I(m(r.config.dbPath),x));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS project_evidence (
11
+ kind TEXT NOT NULL,
12
+ cache_key TEXT NOT NULL,
13
+ project_fingerprint TEXT NOT NULL,
14
+ version TEXT NOT NULL,
15
+ payload TEXT NOT NULL,
16
+ PRIMARY KEY (kind, cache_key)
17
+ );
18
+ CREATE TABLE IF NOT EXISTS semantic_callees (
19
+ relative_path TEXT NOT NULL,
20
+ symbol TEXT NOT NULL,
21
+ content_hash TEXT NOT NULL,
22
+ deps_digest TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS semantic_references (
28
+ relative_path TEXT NOT NULL,
29
+ symbol TEXT NOT NULL,
30
+ project_fingerprint TEXT NOT NULL,
31
+ version TEXT NOT NULL,
32
+ payload TEXT NOT NULL,
33
+ PRIMARY KEY (relative_path, symbol)
34
+ );
35
+ `);for(let a of["file_evidence","project_evidence"])e.prepare(`DELETE FROM ${a} WHERE version LIKE 'evidence-%' AND version != ?`).run(s());n={evidence:e,shared:X(r.config.sharedEvidenceDbPath),readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
36
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${d}
37
+ ORDER BY version DESC
38
+ LIMIT 1`),existsFileEvidence:e.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsLegacyFileEvidence:e.prepare(`SELECT 1 AS present FROM file_evidence
39
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${d}
40
+ LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:e.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:e.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:e.prepare(`SELECT payload FROM project_evidence
41
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${d}
42
+ ORDER BY version DESC
43
+ LIMIT 1`),writeProjectEvidence:e.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:e.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
44
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
45
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${d}
46
+ ORDER BY version DESC
47
+ LIMIT 1`),readCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
48
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
49
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${d}
50
+ ORDER BY symbol, version DESC`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
51
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
52
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
53
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${d}
54
+ ORDER BY version DESC
55
+ LIMIT 1`),readReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
56
+ WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
57
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${d}
58
+ ORDER BY symbol, version DESC`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
59
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(e){E("disabled (open failed)",e)}return h.set(r,n),n}function l(r,n,e){E(`disabled (${n})`,e),h.set(r,null)}function X(r){if(!r)return null;try{w(m(r),{recursive:!0});let n=new y(r);return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
60
+ CREATE TABLE IF NOT EXISTS file_evidence (
61
+ kind TEXT NOT NULL,
62
+ relative_path TEXT NOT NULL,
63
+ content_hash TEXT NOT NULL,
64
+ version TEXT NOT NULL,
65
+ payload TEXT NOT NULL,
66
+ last_accessed_at INTEGER NOT NULL,
67
+ PRIMARY KEY (kind, relative_path, content_hash, version)
68
+ );
69
+ CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
70
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
71
+ `),{evidence:n,readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsFileEvidence:n.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:n.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
72
+ VALUES (?, ?, ?, ?, ?, ?)
73
+ ON CONFLICT(kind, relative_path, content_hash, version)
74
+ DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:n.prepare(`UPDATE file_evidence
75
+ SET last_accessed_at = ?
76
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
77
+ AND last_accessed_at < ?`)}}catch(n){return E("shared cache disabled (open failed)",n),null}}function f(r,n,e){E(`shared cache disabled (${n})`,e);try{r.shared?.evidence.close()}catch{}r.shared=null}function Q(r,n={}){if(!O(r))return null;let e;try{e=new y(r),e.pragma("busy_timeout = 50"),e.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
78
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),e.pragma("wal_checkpoint(TRUNCATE)");let a=e.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,t=n.maxRows??M,i=n.budgetBytes??j,c=Number(e.pragma("page_size",{simple:!0})),C=Number(e.pragma("page_count",{simple:!0})),A=Number(e.pragma("freelist_count",{simple:!0})),g=Math.max(0,C-A)*c,F=a>0&&g>i?Math.min(a,Math.ceil((g-i)/Math.max(1,g/a))):0,u=Math.max(a-t,F);return u>0&&(e.prepare(`DELETE FROM file_evidence WHERE rowid IN (
79
+ SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
80
+ )`).run(u),e.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:u,remainingRows:a-u}}catch(a){return E("shared cache maintenance skipped",a),null}finally{try{e?.close()}catch{}}}function q(r,n,e,a){let t=o(r);if(!t)return null;try{let i=t.readFileEvidence.get(n,e,a,s())??t.readLegacyFileEvidence.get(n,e,a);if(i?.payload!==void 0)return i.payload;if(!v.has(n)||!t.shared)return null;try{let c=t.shared.readFileEvidence.get(n,e,a,s());return c?.payload!==void 0&&R(t.shared,n,e,a),c?.payload??null}catch(c){return f(t,"file_evidence read",c),null}}catch(i){return l(r,"file_evidence read",i),null}}function Z(r,n,e,a){let t=o(r);if(!t)return!1;try{if((t.existsFileEvidence.get(n,e,a,s())??t.existsLegacyFileEvidence.get(n,e,a))?.present!==void 0)return!0;if(!v.has(n)||!t.shared)return!1;try{return t.shared.existsFileEvidence.get(n,e,a,s())?.present===void 0?!1:(R(t.shared,n,e,a),!0)}catch(c){return f(t,"file_evidence exists",c),!1}}catch(i){return l(r,"file_evidence exists",i),!1}}function R(r,n,e,a){let t=Date.now();try{r.touchFileEvidence.run(t,n,e,a,s(),t-U)}catch(i){E("shared file_evidence recency touch skipped",i)}}function ee(r,n,e,a,t){let i=o(r);if(i)try{if(i.writeFileEvidence.run(n,e,a,s(),t),v.has(n)&&i.shared)try{i.shared.writeFileEvidence.run(n,e,a,s(),t,Date.now())}catch(c){f(i,"file_evidence write",c)}}catch(c){l(r,"file_evidence write",c)}}function ne(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{for(let t of n)e.writeFileEvidence.run(t.kind,t.relativePath,t.contentHash,s(),t.payload)})();try{e.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let a=n.filter(t=>v.has(t.kind));if(a.length>0&&e.shared)try{e.shared.evidence.transaction(()=>{for(let t of a)e.shared.writeFileEvidence.run(t.kind,t.relativePath,t.contentHash,s(),t.payload,Date.now())})()}catch(t){f(e,"file_evidence batch write",t)}}catch(a){l(r,"file_evidence batch write",a)}}function te(r,n,e,a){let t=o(r);if(!t)return null;try{return(t.readProjectEvidence.get(n,e,a,s())??t.readLegacyProjectEvidence.get(n,e,a))?.payload??null}catch(i){return l(r,"project_evidence read",i),null}}function re(r,n,e,a,t){let i=o(r);if(i)try{i.writeProjectEvidence.run(n,e,a,s(),t)}catch(c){l(r,"project_evidence write",c)}}function ae(r,n,e,a){if(e===a)return 0;let t=o(r);if(!t)return 0;try{return t.rekeyProjectEvidenceKind.run(a,s(),n,e).changes}catch(i){return l(r,"project_evidence kind rekey",i),0}}function ie(r,n,e,a){let t=o(r);if(!t)return new Map;try{let i=t.readCalleesForFile.all(n,e,a,p),c=t.readLegacyCalleesForFile.all(n,e,a);return L([...c,...i])}catch(i){return l(r,"semantic_callees bulk read",i),new Map}}function ce(r,n,e){let a=o(r);if(!a)return new Map;try{let t=a.readReferencesForFile.all(n,e,p),i=a.readLegacyReferencesForFile.all(n,e);return L([...i,...t])}catch(t){return l(r,"semantic_references bulk read",t),new Map}}function L(r){let n=new Map;for(let e of r)n.set(e.symbol,e.payload);return n}function se(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let t of n){let i=`${t.relativePath}\0${t.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(t.relativePath,t.contentHash)),e.writeCallees.run(t.relativePath,t.symbol,t.contentHash,t.depsDigest,p,t.payload)}})()}catch(a){l(r,"semantic_callees write",a)}}function oe(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let t of n){let i=`${t.relativePath}\0${t.projectFingerprint}`;a.has(i)||(a.add(i),e.dropStaleReferences.run(t.relativePath,t.projectFingerprint)),e.writeReferences.run(t.relativePath,t.symbol,t.projectFingerprint,p,t.payload)}})()}catch(a){l(r,"semantic_references write",a)}}function de(r){return typeof r=="object"&&r!==null}function Ee(r){return Array.isArray(r)&&r.every(n=>typeof n=="string")?r:null}export{x as a,S as b,J as c,z as d,Q as e,q as f,Z as g,ee as h,ne as i,te as j,re as k,ae as l,ie as m,ce as n,se as o,oe as p,de as q,Ee as r};
81
+ //# sourceMappingURL=chunk-ATXPTSEI.js.map
@@ -1,2 +1,2 @@
1
- import{b as v}from"./chunk-BOJ5SVE2.js";import{c as h}from"./chunk-PLYUVM4F.js";import{a as p}from"./chunk-Z2AWCTN6.js";import{a as g,c as y}from"./chunk-BWVQP3LB.js";import{d as b}from"./chunk-TD7VKJ2Y.js";function x(i,n={}){let{limit:f=20,scope:l,minFanIn:c=2,minFanOut:m=2,scanLimit:o}=n,a=new h(i),r=v(a.productionCallableDefinitions({scope:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof o=="number"&&o>0}),o),s=n.semantic!==!1,d=y(i,r,{limit:500,semantic:s,semanticEvidence:p});return r.map(e=>S(i,e,s,d.get(e.symbolId)??[])).filter(e=>e.fanIn>=c&&e.fanOut>=m).sort((e,t)=>t.score-e.score||t.fanIn-e.fanIn).slice(0,f)}function B(i,n={}){return x(i,n)}function S(i,n,f,l){let c=[...new Set(l.map(e=>e.file))].sort(),m=[...new Set(l.filter(e=>e.source!=="caller-map-inversion"||e.callEvidence==="scip-chunk").map(e=>e.file))].sort(),o=new Map;for(let e of g(i,n,{limit:500,semantic:f,semanticEvidence:p})){if(e.file===n.relativePath)continue;let t=`${e.symbol}|${e.file}`;o.has(t)||o.set(t,{symbol:e.symbol,shortName:b(e.symbol),file:e.file,evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source})}let a=[...o.values()].sort((e,t)=>e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)),r=c.length,s=a.length,d=r*s,u=a.filter(e=>e.evidenceStrength==="candidate").map(e=>e.symbol);return{symbol:n.symbol,shortName:b(n.symbol),fanIn:r,fanOut:s,callerFiles:c,candidateCallerFiles:m,externalCallees:a.map(({symbol:e,shortName:t,file:C})=>({symbol:e,shortName:t,file:C})),externalCalleeEvidence:a,candidateExternalCallees:u,inputBasis:"mixed-static-call-or-reference-evidence",score:d,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${r} incoming file(s) reference this symbol`,`${s} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${d} (fan-in * fan-out)`,`${m.length} incoming file(s) and ${u.length} outgoing target(s) rely on candidate rather than exact call evidence`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{x as a,B as b};
2
- //# sourceMappingURL=chunk-EELG7D3Q.js.map
1
+ import{b as v}from"./chunk-BOJ5SVE2.js";import{c as h}from"./chunk-2BMSSRBH.js";import{a as p}from"./chunk-BJWFVAA5.js";import{f as g,h as y}from"./chunk-U3SXIMII.js";import{d as b}from"./chunk-C7C6AKAT.js";function x(i,n={}){let{limit:f=20,scope:l,minFanIn:c=2,minFanOut:m=2,scanLimit:o}=n,a=new h(i),r=v(a.productionCallableDefinitions({scope:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof o=="number"&&o>0}),o),s=n.semantic!==!1,d=y(i,r,{limit:500,semantic:s,semanticEvidence:p});return r.map(e=>S(i,e,s,d.get(e.symbolId)??[])).filter(e=>e.fanIn>=c&&e.fanOut>=m).sort((e,t)=>t.score-e.score||t.fanIn-e.fanIn).slice(0,f)}function B(i,n={}){return x(i,n)}function S(i,n,f,l){let c=[...new Set(l.map(e=>e.file))].sort(),m=[...new Set(l.filter(e=>e.source!=="caller-map-inversion"||e.callEvidence==="scip-chunk").map(e=>e.file))].sort(),o=new Map;for(let e of g(i,n,{limit:500,semantic:f,semanticEvidence:p})){if(e.file===n.relativePath)continue;let t=`${e.symbol}|${e.file}`;o.has(t)||o.set(t,{symbol:e.symbol,shortName:b(e.symbol),file:e.file,evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source})}let a=[...o.values()].sort((e,t)=>e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)),r=c.length,s=a.length,d=r*s,u=a.filter(e=>e.evidenceStrength==="candidate").map(e=>e.symbol);return{symbol:n.symbol,shortName:b(n.symbol),fanIn:r,fanOut:s,callerFiles:c,candidateCallerFiles:m,externalCallees:a.map(({symbol:e,shortName:t,file:C})=>({symbol:e,shortName:t,file:C})),externalCalleeEvidence:a,candidateExternalCallees:u,inputBasis:"mixed-static-call-or-reference-evidence",score:d,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${r} incoming file(s) reference this symbol`,`${s} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${d} (fan-in * fan-out)`,`${m.length} incoming file(s) and ${u.length} outgoing target(s) rely on candidate rather than exact call evidence`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{x as a,B as b};
2
+ //# sourceMappingURL=chunk-AX7IDVFT.js.map
@@ -0,0 +1,2 @@
1
+ function r(o){try{return process.kill(o,0),!0}catch(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EPERM"}}export{r as a};
2
+ //# sourceMappingURL=chunk-B3PYOSCX.js.map
@@ -0,0 +1,3 @@
1
+ import{a as fe}from"./chunk-OHIV323X.js";import{a as Ce}from"./chunk-T6HRIROJ.js";import{a as ve}from"./chunk-Q5JRIHT3.js";import{a as ye}from"./chunk-6YTSKJJ3.js";import{a as xe}from"./chunk-SCPMZ73U.js";import{b as me}from"./chunk-4KBTHJLP.js";import{a as ge}from"./chunk-WLMP3OCW.js";import{a as he}from"./chunk-SSRFUQBD.js";import{b as de}from"./chunk-7ZLWLOGT.js";import{b as pe}from"./chunk-6O7FACKB.js";import{a as le}from"./chunk-OYKU4B3Y.js";import{a as be}from"./chunk-NODFZ6ED.js";import{a as ue}from"./chunk-E4PKTOL3.js";import{a as ce}from"./chunk-EHVEIEQN.js";import{a as ne}from"./chunk-BBB5FBX4.js";import{b as ae}from"./chunk-GG45PK4S.js";import{b as oe}from"./chunk-OIOC5EHF.js";import{b as se}from"./chunk-XDAUYDFT.js";import{a as _,b as Z}from"./chunk-OIAPEKMT.js";import{c as te}from"./chunk-KVQCECPR.js";import{a as ee,b as R}from"./chunk-XKXTR6ZI.js";import{a as re}from"./chunk-EPX6NQN6.js";import{f as ie}from"./chunk-ZFVPWH62.js";import{q as W}from"./chunk-SYVJEEUJ.js";import{a as J}from"./chunk-TAA7HXHE.js";import{f as B,h as $}from"./chunk-NJQISBL4.js";import{a as Q}from"./chunk-RBAD4GJ2.js";import{A as Y,E as X}from"./chunk-ZLMXIQLC.js";import{h as M}from"./chunk-ETC674NS.js";import{Ba as U,Ca as K}from"./chunk-JZ2A7LDM.js";function Se(e){let r;try{r=R(e,["rev-parse","HEAD"]).trim()}catch{return null}return/^[0-9a-f]{40,64}$/u.test(r)?{head:r,branch:at(e),dirtyPaths:st(e)}:null}function at(e){try{let r=R(e,["rev-parse","--abbrev-ref","HEAD"]).trim();return r&&r!=="HEAD"?r:null}catch{return null}}function st(e){try{return R(e,["status","--porcelain"]).split(`
2
+ `).filter(r=>r.length>0).length}catch{return 0}}import{readdirSync as ct}from"fs";import{basename as ut,join as we}from"path";function lt(e,r,t={}){let i=new Set(e),n=new Set(r),o=[...n].filter(c=>!i.has(c)).sort(),a=t.allowExtra?[]:[...i].filter(c=>!n.has(c)).sort();return{missing:o,extra:a}}function dt(e,r){let t=pt(e,r.file,r.keys);if(!t.ok)return{name:r.name,file:r.file,status:"unavailable",missing:[],extra:[],unavailableReason:t.reason};let i=bt(e.config.projectRoot,r.mustEqual),n=lt(t.keys,i,{allowExtra:r.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:r.name,file:r.file,status:o,missing:n.missing,extra:n.extra}}function He(e,r){return r.map(t=>dt(e,t))}function pt(e,r,t){return t.type==="markdown-list"?Ct(e,r,t.marker):mt(e,r,t)}function mt(e,r,t){if(!M(e,r))return{ok:!1,reason:`file not found: ${r}`};let n=Y(r);if(!n)return{ok:!1,reason:`unsupported file type for ${t.type} extraction: ${r}`};let o=X(e,r);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${r}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let a=t.type==="object-literal-keys"?ht(o,t.identifier):ft(o,t.identifier);return a===null?{ok:!1,reason:`no ${t.type==="object-literal-keys"?"object literal":"string array"} named "${t.identifier}" found in ${r}`}:{ok:!0,keys:a}}function Re(e){let r=e.childForFieldName("value");return r?r.type==="as_expression"||r.type==="satisfies_expression"?r.namedChild(0):r:null}function ht(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=Re(t);if(n?.type==="object")return gt(n)}return null}function gt(e){let r=new Set;for(let t of e.namedChildren)if(t.type==="pair"){let i=t.childForFieldName("key");i&&r.add(Le(i.text))}else t.type==="shorthand_property_identifier"&&r.add(t.text);return[...r].sort()}function ft(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=Re(t);if(n?.type!=="array")continue;let o=new Set;for(let a of n.namedChildren)a.type==="string"&&o.add(Le(a.text));return[...o].sort()}return null}function Le(e){return e.length>=2&&(e[0]==="'"&&e.endsWith("'")||e[0]==='"'&&e.endsWith('"'))?e.slice(1,-1):e}function Ct(e,r,t){let i=M(e,r);if(!i)return{ok:!1,reason:`file not found: ${r}`};let n=De(i,t);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${t} --> ... <!-- END GENERATED ${t} --> block in ${r}`}:{ok:!0,keys:Pe(n)}}function De(e,r){let t=Q(r),n=new RegExp(`<!--\\s*BEGIN GENERATED ${t}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${t}\\s*-->`).exec(e);return n?n[1]:null}function Pe(e){let r=new Set;for(let t of e.matchAll(/`([a-z][a-z0-9-]*)`/g))r.add(t[1]);for(let t of e.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))r.add(t[1]);return[...r].sort()}function bt(e,r){switch(r.type){case"top-level-dirs":return Ee(we(e,r.path));case"file-glob":return[...new Set(J(e,r.pattern).map(t=>ut(t)))].sort();case"registered-commands":return vt(e);case"builtin-skills":return Ee(we(e,"skills"))}}function Ee(e){let r;try{r=ct(e,{withFileTypes:!0})}catch{return[]}return r.filter(t=>t.isDirectory()&&!t.name.startsWith(".")).map(t=>t.name).sort()}function vt(e){let r;try{r=U(e,"docs/COMMAND_REFERENCE.md",{maxBytes:8*1024*1024,inputKind:"generated command reference"})}catch(i){if(!K(i))throw i;return[]}let t=De(r,"COMMAND REFERENCE");return t?Pe(t):[]}function f(e){return e.scoreCount??e.count}function N(e,r){let t=Ht(e),{breakdown:i,pressure:n}=Rt(e),o=Ae(i,"risk"),a=Ae(i,"hygiene");return{score:Math.min(o,a),riskScore:o,hygieneScore:a,scoreBreakdown:i,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},...r?{provenance:r}:{},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:f(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:f(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:f(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:St(e),validation:Et(e),suppressions:e.suppressions,actions:t,pressure:n,policyExclusions:xt(e),topComplexity:e.complexity.top,detectorEvidence:e.detectorEvidence,warnings:e.warnings.length>0?e.warnings:void 0}}var yt=[["react-component-duplicates",e=>e.reactComponentDuplicates],["react-hook-candidates",e=>e.reactHookCandidates],["react-large-component-pressure",e=>e.reactLargeComponentPressure],["wrapper-candidates",e=>e.wrappers],["duplicate-bodies",e=>e.duplicateBodies],["dead",e=>e.dead]];function xt(e){let r=[],t=(i,n)=>{for(let o of n??[])o.count<=0||r.push({detector:i,reason:o.reason,detail:o.detail,count:o.count})};for(let[i,n]of yt)t(i,n(e).exclusions);return t("extract-candidates",e.extractExclusions),t("complexity-hotspots",e.complexity.exclusions),t("co-change",e.gitEvidence?.hiddenCoupling.exclusions),r}function St(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:wt(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function wt(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:C(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Et(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[s,u]of Object.entries(r))i.has(s)?n+=u.fixChanges:(o+=u.fixChanges,a+=1);let c=i.size>0?C(n/i.size):0,p=a>0?C(o/a):0,b={};for(let[s,u]of Object.entries(t)){let g=new Set(u);if(g.size===0)continue;let w=0;for(let k of g)w+=r[k]?.fixChanges??0;let x=C(w/g.size);b[s]={flaggedFiles:g.size,fixDensity:x,lift:p>0?C(x/p):null}}return{flaggedFiles:i.size,flaggedFixDensity:c,baselineFixDensity:p,ratio:i.size>0&&p>0?C(c/p):null,byCategory:b,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function C(e){return Math.round(e*100)/100}function Te(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function S(e,r="existing shared infrastructure discount"){let t=f(e);return Math.abs(t-e.count)<.01?"":` (${Te(t)} score-weighted after ${r})`}function y(e,r){let t=f(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${Te(t)} score-weighted)`}function Ht(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",evidenceContractId:"dead-visible-references",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",evidenceContractId:"isolated-visible-connectivity",description:`${e.isolated.count} symbols with no visible indexed or source-supported caller/callee after root exclusions \u2014 runtime reflection and generated dispatch remain disclosed blind spots`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure${S(e.reactComponentDuplicates,"support-tier discount")} \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${S(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${S(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with a contiguous region whose callees appear nowhere else in the body \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",evidenceContractId:"wrapper-indirection-candidate",description:`${e.wrappers.count} wrapper-shaped single-consumer callables${S(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",evidenceContractId:"passthrough-forwarding-candidate",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",evidenceContractId:"stale-abstraction-candidate",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+S({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let a=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-a}),r}var ke={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function Ae(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function Rt(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(m,E,v)=>{E>0&&i.push({axis:m,points:E,detail:v,kind:ke[m]??"hygiene"})},a=(m,E,v,tt,rt,it,nt)=>{let H=Math.max(tt,1);if(v<=H)return;let A=v/H,T=Math.min(rt,Math.ceil(Math.log2(A)*it));if(T<=0)return;let ot=ke[m]??"hygiene";n.push({axis:m,category:E,kind:ot,count:v,threshold:C(H),ratio:C(A),extraPenalty:T}),o(m,T,`${v} ${nt} exceed pressure threshold ${C(H)} (${C(A)}x)`)},c=e.dead.count/t;o("dead-code",Math.min(20,Math.round(c*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let p=e.isolated.count/t;o("isolated",Math.min(10,Math.round(p*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let b=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(b)),`${e.similarCount} similar function pair(s)`);let s=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(s*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let u=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(u*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let g=f(e.reactComponentDuplicates),w=g/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(w)),y(e.reactComponentDuplicates,"duplicated React component pair(s)"));let x=f(e.reactHookCandidates),k=x/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(k)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let Ye=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(Ye/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Xe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Xe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let G=f(e.vueComposableCandidates),Je=G/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(Je)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Ze=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(Ze/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let O=f(e.wrappers);o("wrappers",Math.min(3,O),y(e.wrappers,"wrapper candidate(s)"));let j=f(e.passthroughs);o("passthroughs",Math.min(3,j),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let et=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(et*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let m=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(m/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:m},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,Math.max(3,Math.round(r*.005)),5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let m=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",m,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),a("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),a("react-component-duplicates-pressure","Duplicated React components",g,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",x,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",G,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",O,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",j,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}var h={dead:{minLoc:1,skipBarrels:!1,deadCodeOnly:!1},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};import{getHeapStatistics as Lt}from"v8";var Dt=64*1024*1024;function I(){let e=globalThis.gc;if(!e)return;let r=Lt();r.heap_size_limit-r.used_heap_size<Dt||e()}var Pt=[{id:"dead-visible-references",detector:"dead",claim:"The symbol has no visible repository reference after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework/source fallback references","rooted-symbol exclusions"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Absence of visible references does not prove absence of reflection, generated dispatch, or external use."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"isolated-visible-connectivity",detector:"isolated",claim:"The callable has no visible non-self caller or callee after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"identity",subtype:"references",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework contract exclusions","source fallback callers"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Visible graph isolation does not establish runtime unreachability through reflection or generated dispatch."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"wrapper-indirection-candidate",detector:"wrapper-candidates",claim:"A small callable has one visible consumer and wrapper-shaped delegation, after boundary evidence is disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["callable body shape","public and runtime-boundary signals","consumer fan-in"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Wrapper shape does not prove that an API, ownership, observability, or compatibility boundary is unnecessary."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"passthrough-forwarding-candidate",detector:"passthrough-candidates",claim:"A small callable visibly forwards to one callee, with public-facade and boundary signals disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"contract",subtype:"uses-contract-symbol",minimumStrength:"exact"}],structuralEvidence:["statement-complete forwarding shape","public facade evidence","runtime-boundary signals"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Literal forwarding does not prove the callable has no contract, naming, policy, or compatibility role."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"stale-abstraction-candidate",detector:"stale-abstractions",claim:"A type-like abstraction has zero or one visible real consumer after re-export and ownership distinctions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["definition kind","barrel-only consumer distinction","defining-file usage"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Low visible consumer count does not prove a public contract or runtime-registered type is obsolete."],recoverWith:"scip-query evidence --symbol <symbol> --edge identity --edge ownership --edge contract --direction both --depth 2 --max-edges 100"},{id:"complexity-control-pressure",detector:"complexity-hotspots",claim:"A callable concentrates local branch/control pressure and graph fan-in or fan-out.",relationRequirements:[{family:"execution",subtype:"predicate-consequence",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["AST branch count or disclosed regex fallback","call fan-in","callee count"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Structural complexity does not establish runtime frequency, latency, defect density, or a required refactor."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"decorative-checker-terminal-behavior",detector:"decorative-checkers",claim:"A checker-shaped callable lacks a visible failure terminal directly or through one resolved delegate.",relationRequirements:[{family:"execution",subtype:"returns",minimumStrength:"exact"},{family:"execution",subtype:"throws",minimumStrength:"exact"}],structuralEvidence:["checker naming shape","direct terminal behavior","one-hop delegate body"],calibration:"mixed",providerCoverage:"partial",nonClaims:["No visible terminal does not prove the checker cannot fail through an opaque call, exception, or process exit."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"duplicate-structural-candidate",detector:"duplicate and similarity detectors",claim:"Two source units share the detector-specific structural or token pattern.",relationRequirements:[],structuralEvidence:["normalized source/token/JSX/template similarity"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Structural similarity does not establish shared domain identity or justify consolidation."],recoverWith:"scip-query inspect --symbol <symbol-a> --symbol <symbol-b> --view behavior"}];function Me(e=new Set(["indexed-graph","source-facts"])){return Pt.map(r=>{let t=r.relationRequirements.map(n=>{let o=se(n.family,n.subtype);if(!o)throw new Error(`Detector ${r.id} names an unregistered relation ${n.family}/${n.subtype}`);if(!o.relation.evidenceStrengths.includes(n.minimumStrength))throw new Error(`Detector ${r.id} requires unsupported strength ${n.minimumStrength} for ${n.family}/${n.subtype}`);return o.provider}),i=[...new Set(t.flatMap(n=>n.requirements))].filter(n=>!e.has(n));return{...r,status:i.length>0?"unsupported":r.calibration,providerIds:[...new Set(t.map(n=>n.id))],unavailableRequirements:i}})}var Be=50,V=10,kt=25e3,At=2500,$e=2500,_e=50,Tt=10,Mt=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],Ve={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:_t(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:Nt(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:It(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Vt(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:qt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:zt(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Gt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Ot(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:jt(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Wt(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ut(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Kt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",...Ft(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:Qt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:Yt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:Xt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:tr(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:rr(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:Jt(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:Zt(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:er(e,t)})};function ci(e,r={}){return qe(e,r.full!==!1,(t,i)=>{let n=$t(e,r.scope,t,i);return N(n,Fe(e))})}function Fe(e){let r=e.generation.identity,t=W(e.config.dbPath),i=t?.currentGeneration===r?t:null;return{computedAt:new Date().toISOString(),generation:{identity:r,publishedAt:i?.publishedAt??null,mode:i?.publication?.mode??null},git:Se(e.config.projectRoot)}}function ui(e,r,t={}){return Bt(e,[r],t)[0]}function Bt(e,r,t={}){return qe(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(a=>Ve[a](e,t.scope,o,i))})}function qe(e,r,t){let i=ye(e),n=ir(i,r);try{return t(i,n)}finally{_(e,{semanticProvider:!0}),I()}}function li(e,r){return N(ze(e),r?Fe(r):void 0)}function ze(e){let r=l(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,detectorEvidence:Me(),dead:l(e,"dead").dead,isolated:l(e,"isolated").isolated,realCycleCount:l(e,"cycles").realCycleCount,similarCount:l(e,"similar").similarCount,duplicateBodies:l(e,"duplicate-bodies").duplicateBodies,twinDrift:l(e,"twin-drift").twinDrift,reactComponentDuplicates:l(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:l(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:l(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:l(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:l(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:l(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:l(e,"extract-candidates").extractCount,extractExclusions:l(e,"extract-candidates").extractExclusions,wrappers:l(e,"wrapper-candidates").wrappers,passthroughs:l(e,"passthrough-candidates").passthroughs,stale:l(e,"stale-abstractions").stale,drift:l(e,"drift").drift,complexity:l(e,"complexity-hotspots").complexity,gitEvidence:Ne(e,"git-evidence")?.gitEvidence??null,suppressions:Ne(e,"suppressions")?.suppressions??null,coverageContracts:l(e,"coverage-contracts").coverageContracts}}function Ne(e,r){return e.find(t=>t.phase===r)}function l(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function $t(e,r,t,i){return ze(Mt.map(n=>Ve[n](e,r,i,t)))}function _t(e,r,t){return d(e,t,"dead",()=>{let i=Z(e,{scope:r,...h.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.applicability;return{...D(ar(e,i.symbols)),exclusions:P([{reason:"entry-surface-symbols",detail:"zero-reference symbols in framework entry surfaces (route handlers, pages, scheduled tasks, live barrels) that the framework invokes",count:n.entrySurfaceExcluded},{reason:"generated-artifact-symbols",detail:"zero-reference symbols in generated artifacts (migration dumps, codegen output) owned by their generator",count:n.generatedArtifactExcluded??0}])}})}function Nt(e,r,t){return d(e,t,"isolated",()=>{let i=le(e,{scope:r,...h.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return D(sr(e,i))})}function It(e,r,t){return d(e,t,"cycles",()=>ne(e,{scope:r}).filter(n=>n.kind==="real").length)}function Vt(e,r,t){let i=d(e,t,"similar",()=>ie(e,{scope:r,...h.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function Ft(e,r,t){return d(e,t,"extract-candidates",()=>{let i=ue(e,{scope:r,...h.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.actionTier==="support").length;return{extractCount:i.length-n,extractExclusions:n>0?[{reason:"wide-interface-regions",detail:"largest region would take more than five locals in or hand more than two back; listed by extract-candidates at support tier",count:n}]:[]}})}function qt(e,r,t){return d(e,t,"duplicate-bodies",()=>{let i=oe(e,{scope:r,...h.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let a of i.groups)for(let c of a.functions.slice(1))n.add(c.file),o+=c.loc;return{count:i.groups.length,loc:o,files:[...n],exclusions:i.exclusions.map(a=>({reason:a.reason,detail:`${a.detail}; group members removed before counting`,count:a.count}))}})}function zt(e,r,t){return d(e,t,"twin-drift",()=>{let i=ae(e,{scope:r,...h.twinDrift,scanLimit:t.candidateScanLimit}).filter(a=>a.relationship==="divergent"||a.relationship==="identical"),n=new Set,o=0;for(let a of i)for(let c of a.members)n.add(c.file),o+=c.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function Gt(e,r,t){return d(e,t,"react-component-duplicates",()=>{let i=de(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=i.results.filter(o=>Ie(o)>0);return{...q(n,Ie),exclusions:P(i.exclusions,[{reason:"support-tier-pairs",detail:"support-tier pairs (generic structure only, or framework route scaffolding); listed by react-component-duplicates but not counted",count:i.results.length-n.length}])}})}function Ot(e,r,t){return d(e,t,"react-hook-candidates",()=>{let i=pe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=[],o=new Map;for(let a of i.results){let c=je(a);if(c.weight>0){n.push(a);continue}let p=o.get(c.reason)??{reason:c.reason,detail:c.detail,count:0};p.count+=1,o.set(c.reason,p)}return{...q(n,ur),exclusions:P(i.exclusions,[...o.values()])}})}function jt(e,r,t){return d(e,t,"react-large-component-pressure",()=>{let i=me(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return{...cr(i.results),exclusions:P(i.exclusions,[])}})}function Wt(e,r,t){return d(e,t,"vue-component-duplicates",()=>{let i=he(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Oe(i)})}function Ut(e,r,t){return d(e,t,"vue-composable-candidates",()=>{let i=ge(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return q(i,lr)})}function Kt(e,r,t){return d(e,t,"vue-large-view-pressure",()=>{let i=fe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return D(i)})}function Qt(e,r,t){return d(e,t,"wrapper-candidates",()=>{let i=Ce(e,{scope:r,...h.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(a=>a.bodyShape==="forwarding"),o=i.length-n.length;return{...Ge(n,mr),exclusions:o>0?[{reason:"single-consumer-helpers",detail:"single-consumer callables whose body computes or branches instead of forwarding one call; listed by wrapper-candidates as signal tier",count:o}]:[]}})}function Yt(e,r,t){return d(e,t,"passthrough-candidates",()=>{let i=be(e,{scope:r,...h.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Ge(i,hr)})}function Xt(e,r,t){return d(e,t,"stale-abstractions",()=>{let i=ve(e,{scope:r,...h.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,a)=>o+a.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function Jt(e,r){return d(e,r,"git-evidence",()=>{let t=ee(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=te(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),a={};for(let[s,u]of i)a[s]={changes:u.changes,fixChanges:u.fixChanges};let c=o.findings.filter(s=>F(s).counted),p=new Map;for(let s of o.findings){let u=F(s);if(u.counted)continue;let g=p.get(u.reason)??{reason:u.reason,detail:u.detail,count:0};g.count+=1,p.set(u.reason,g)}let b=[...c].sort((s,u)=>L(u)-L(s)||u.together-s.together);return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:c.length,scoreCount:z(c.reduce((s,u)=>s+L(u),0)),exclusions:[...p.values()].sort((s,u)=>s.reason.localeCompare(u.reason)),top:b.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:L(s),subjectContext:s.subjectContext}))},fileStats:a,commitsScanned:n?.commits.length??0}})}function Zt(e,r){return d(e,r,"suppressions",()=>{let t=xe(e);return{total:t.total,byCategory:{...t.byCategory}}})}function er(e,r){return d(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=He(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function tr(e,r,t){return d(e,t,"drift",()=>{let i=ce(e,{scope:r,...h.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(c=>c.kind!=="pattern-deviation"),o=n.filter(c=>c.actionTier==="direct").length,a=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:a}})}function rr(e,r,t){return d(e,t,"complexity-hotspots",()=>{let i=re(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(a=>a.score>Be&&a.branches>=V),o=i.filter(a=>a.score>Be&&a.branches<V).length;return{top:i.slice(0,5).map(a=>({symbol:a.shortName,score:a.score,file:a.file})),extremeCount:n.length,exclusions:o>0?[{reason:"popular-low-branch-callables",detail:`callables above the extreme score only through fan-in, with fewer than ${V} branches`,count:o}]:[]}})}function ir(e,r){let t=e.symbols>=kt||e.documents>=At,i=r?Number.POSITIVE_INFINITY:_e,n=r?Number.POSITIVE_INFINITY:Tt;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:$e,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${$e} symbols and reported their top ${_e} findings. Enable full mode for unbounded candidate counts.`]}}function nr(e,r){r.releaseCachesBetweenPhases&&(_(e),I())}function d(e,r,t,i){or(t);try{return i()}finally{nr(e,r)}}function or(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function ar(e,r){return r.filter(t=>!B(e,t.relativePath)&&!$(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function sr(e,r){return r.filter(t=>!B(e,t.relativePath)&&!$(e,t.symbol,t.relativePath))}function D(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function Ge(e,r){return{...D(e),scoreCount:z(e.reduce((i,n)=>i+r(n),0))}}function cr(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Oe(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function q(e,r){return{...Oe(e),scoreCount:z(e.reduce((i,n)=>i+r(n),0))}}function Ie(e){return e.actionTier==="signal"?1:0}function ur(e){return je(e).weight}function je(e){if(e.evidenceClass==="generic-workflow-scaffolding")return{weight:0,reason:"generic-workflow-pairs",detail:"pairs whose shared behavior is only generic React mechanics (open/close/submit state and handlers)"};let r=e.sharedHooks.some(n=>!dr.has(n)),t=We({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});if(r&&t<=2)return{weight:0,reason:"shared-hook-covered-pairs",detail:"pairs whose concrete shared behavior is already carried by a project hook both sides call"};if(!r&&t===0)return{weight:0,reason:"generic-workflow-pairs",detail:"pairs whose shared behavior is only generic React mechanics (open/close/submit state and handlers)"};let i={reason:"counted",detail:"counted"};return r?{weight:.5,...i}:Ue(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?{weight:.25,...i}:{weight:t>=2?1:.5,...i}}function P(...e){let r=new Map;for(let t of e)for(let i of t){if(i.count<=0)continue;let n=r.get(i.reason);n?n.count+=i.count:r.set(i.reason,{...i})}return[...r.values()].sort((t,i)=>t.reason.localeCompare(i.reason))}function lr(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=We({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Ue(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function We(e){return e.requests.filter(t=>!pr.has(t)).length*2+e.lifecycle.length+e.namedState.filter(t=>!Qe.has(Ke(t))).length+Math.min(e.functions.length,3)}var dr=new Set(["useForm","useFormContext","useInfiniteQuery","useMutation","useParams","usePathname","useQuery","useQueryClient","useRouter","useSearchParams","useSelector","useDispatch","useSuspenseQuery","useTheme","useTranslation"]),pr=new Set(["axios","fetch","gql","graphql","mutate","query","request","useInfiniteQuery","useMutation","useQuery","useSuspenseQuery"]);function Ue(e,r,t){let i=[...e,...r,...t].map(Ke);return i.length>0&&i.every(n=>Qe.has(n))}function Ke(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function mr(e){return e.actionTier==="signal"?.25:1}function hr(e){return e.actionTier==="signal"?.25:1}function L(e){return F(e).counted?e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5:0}function F(e){if(e.actionTier==="signal"&&e.partnerClass!=="doc-code"&&e.partnerClass!=="generated-artifact")return{counted:!1,reason:"sweep-only-pairs",detail:"pairs whose shared commits were only broad sweeps, stale pairs with at most two focused co-changes, and configuration or schema partners; listed by co-change at signal tier"};switch(e.partnerClass){case"doc-code":return{counted:!1,reason:"doc-sync-pairs",detail:"documentation that changes alongside the code it describes (doc-drift owns stale docs)"};case"generated-artifact":return{counted:!1,reason:"generated-artifact-pairs",detail:"generated artifacts (migration journals, snapshots, codegen output) rewritten from their source"};default:return{counted:!0,reason:"counted",detail:"counted"}}}function z(e){return Math.round(e*100)/100}var Qe=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{h as a,Mt as b,ci as c,Fe as d,ui as e,Bt as f,li as g};
3
+ //# sourceMappingURL=chunk-B7MPDEAK.js.map
@@ -0,0 +1,2 @@
1
+ import{a as y}from"./chunk-35NLDRZC.js";import{c as d}from"./chunk-NJQISBL4.js";import{b as u}from"./chunk-FLMTCX5R.js";import{b as f}from"./chunk-BOW7SSQH.js";function W(n,e={}){return B(n,e).cycles}function B(n,e={}){return C(n,e)}function M(n,e={}){return C(n,e).cycles}function C(n,e={}){let{scope:t,maxDepth:c=10,edgeBasis:i="symbol-references"}=e,s=f(n,t,i==="imports"?{scipEdges:"imports-only",sourceEdges:"imports-only"}:void 0),{components:l}=y(s),a=l.filter(r=>S(s,r)).map(r=>{let o=[...r].sort(),{path:D,kind:p}=R(s,o);return{path:D,component:o,edgeBasis:i,witness:!0,classification:p==="real"?"dependency-cycle":"module-structure-candidate",kind:p}});return a.sort((r,o)=>r.kind!==o.kind?r.kind==="real"?-1:1:r.path.length-o.path.length),{cycles:a,truncated:!1,edgeBasis:i,maxDepth:c}}function R(n,e){let t=g(n,e),c=new Set(e.filter(r=>x(r)));if(c.size===0)return{path:t,kind:h(t)};let i=new Set(e),s=new Map;for(let r of e)c.has(r)||s.set(r,new Set([...n.get(r)??[]].filter(o=>i.has(o)&&!c.has(o))));let l=y(s).components.filter(r=>S(s,r)).map(r=>[...r].sort()).sort((r,o)=>r[0].localeCompare(o[0]))[0];if(!l)return{path:t,kind:"module-hierarchy"};let a=g(s,l);return{path:a,kind:h(a)}}function x(n){let e=u(n);return e==="test"||e==="barrel"||e==="entry"||d(n)}function S(n,e){if(e.length>1)return!0;let t=e[0];return t!==void 0&&n.get(t)?.has(t)===!0}function g(n,e){let t=e[0];if(!t)return[];let c=new Set(e);for(let i of[...n.get(t)??[]].filter(s=>c.has(s)).sort()){if(i===t)return[t,t];let s=k(n,i,t,c);if(s)return[t,...s]}throw new Error(`Cyclic component did not contain a witness path from ${t}.`)}function k(n,e,t,c){let i=[e],s=new Map([[e,null]]);for(let l=0;l<i.length;l+=1){let a=i[l];if(a===t){let r=[];for(let o=a;o!==null;o=s.get(o)??null)r.push(o);return r.reverse()}for(let r of[...n.get(a)??[]].filter(o=>c.has(o)).sort())s.has(r)||(s.set(r,a),i.push(r))}return null}function h(n){for(let c of n){let i=u(c);if(i==="test"||i==="barrel"||i==="entry")return"module-hierarchy"}if(n.length!==3)return"real";let[e,t]=n;return!e||!t?"real":d(e)||d(t)||m(e,t)||m(t,e)||b(e,t)||b(t,e)||u(e)==="entry"||u(t)==="entry"?"module-hierarchy":"real"}function m(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=e.replace(/\.rs$/,"/");return n.startsWith(t)?!n.slice(t.length).includes("/"):!1}function b(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=n.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(t===c+"_tests"||t===c+"/tests")return!0;let i=n.split("/"),s=e.split("/");if(i.length===s.length&&i.includes("tests")&&s.includes("src")){let l=i[i.length-1],a=s[s.length-1];if(l&&l===a)return!0}return!1}export{W as a,B as b,M as c,C as d};
2
+ //# sourceMappingURL=chunk-BBB5FBX4.js.map
@@ -1,2 +1,2 @@
1
- import{c as r}from"./chunk-RDULNRSJ.js";function s(o,e,t={}){if(e.length===0)throw new Error("The source search pattern must not be empty.");return r(o,[e],t)[0]}export{s as a};
2
- //# sourceMappingURL=chunk-Y2VM4CJC.js.map
1
+ import{c as r}from"./chunk-X3YVZAKZ.js";function s(o,e,t={}){if(e.length===0)throw new Error("The source search pattern must not be empty.");return r(o,[e],t)[0]}export{s as a};
2
+ //# sourceMappingURL=chunk-BHKK5RJY.js.map
@@ -0,0 +1,2 @@
1
+ import{a as B,b as J,c as y,e as b,f as O,h as T,k as _,l as z}from"./chunk-YSYPDRD5.js";import{B as N}from"./chunk-J6GLBBRK.js";import{b as U}from"./chunk-BOW7SSQH.js";import{h as d}from"./chunk-ETC674NS.js";import{c as j,h as M,i as g,r as A,t as P,v as $,y as m}from"./chunk-KNLQGXVH.js";var ce={references:T,referenceMap:_,callerMap:(t,s)=>b(t).callerMap(s),calleeMap:q};function q(t,s){let a=$(),i=new Map,l=O(t,s),r=[],n=[],u=0,c=0,p=0,f=0,E=0,k=0,H=0;for(let{definition:e,callees:o}of l.hits)E+=1,o.length>0&&(k+=1,H+=o.length,i.set(e.symbolId,o));let h=K(t,l.hits);if(h.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(t,h.entries),()=>({entries:h.entries.length,sourceMissing:h.sourceMissing,skippedUnsupportedLanguage:h.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[e,o]of B(l.misses)){if(!y(e)){a&&(u+=o.length);continue}let R=d(t,e);if(!R){a&&(c+=o.length),n.push(...o);continue}let x=g(t,e,R),C=G(t,e);if(!C){n.push(...o);continue}let Y=A(t,e,x,C);for(let D of o){let L=Y.get(D.symbol)??null;if(L!==null){let v=V(L);if(v){a&&(p+=1),v.length>0&&i.set(D.symbolId,v);continue}a&&(f+=1)}r.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:u,sourceMissing:c,cacheHits:p,parseFailures:f,misses:r.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:k,inMemoryCalleeCount:H,resultRows:i.size,missSample:r.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:n.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),r.length===0&&n.length===0)return i;let I=[...n,...r.map(e=>e.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let e=z(t,I);return w=e.size,e},()=>({definitions:I.length,misses:r.length,unkeyed:n.length,rows:w}));for(let[e,o]of F)i.set(e,o);let S=r.filter(e=>b(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(F.get(e.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(t,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:r.length})),i}function K(t,s){let a=[],i=new Map,l=0,r=0;for(let{definition:n,callees:u}of s){if(!y(n.relativePath)){r+=1;continue}if(!i.has(n.relativePath)){let p=d(t,n.relativePath),f=p?G(t,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(t,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){l+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(u)})}return{entries:a,sourceMissing:l,skippedUnsupportedLanguage:r}}var Q="typescript-callees-v3-alias-resolved";function G(t,s){let a=y(s);if(a==="typescript")return N(t,s,Q)?.key??null;let i=X(t,s);return a==="rust"?M(JSON.stringify({kind:"semantic-callees",language:a,engine:J(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(t){try{return JSON.parse(t)}catch{return null}}var W=j("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,s){return W.get(t,s,()=>{let i=[...U(t).get(s)??[]].sort().map(l=>`${l}:${g(t,l,d(t,l))}`);return M(i.join("|"))})}export{ce as a};
2
+ //# sourceMappingURL=chunk-BJWFVAA5.js.map
@@ -0,0 +1,2 @@
1
+ function i(r){let e=r?.match(/--max[-_]old[-_]space[-_]size(?:=|\s+)(\d+)/u);if(!e)return;let n=Number.parseInt(e[1],10);return Number.isInteger(n)&&n>0?n:void 0}function t(r,e){return[(r??"").replace(/(?:^|\s)--max[-_]old[-_]space[-_]size(?:=|\s+)\d+/gu," ").trim(),`--max-old-space-size=${e}`].filter(Boolean).join(" ")}export{i as a,t as b};
2
+ //# sourceMappingURL=chunk-BKVWUP7Y.js.map
@@ -1,4 +1,4 @@
1
- import{a as g}from"./chunk-ERCYGVAM.js";import{f as p}from"./chunk-PBUH2P5S.js";import{a as f}from"./chunk-5H5WTJSD.js";import{d as u,e as _,i as N}from"./chunk-TD7VKJ2Y.js";import{x as d}from"./chunk-42W3LFUK.js";import{a as I,z as l}from"./chunk-7JYHQAH2.js";import{B as b}from"./chunk-Q7GBK5T7.js";import{c}from"./chunk-GH5YSGZL.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
1
+ import{a as g}from"./chunk-NSM5IEVW.js";import{g as p}from"./chunk-YSYPDRD5.js";import{a as f}from"./chunk-F5GSBHC6.js";import{d as u,e as _,k as N}from"./chunk-C7C6AKAT.js";import{y as d}from"./chunk-RBAD4GJ2.js";import{A as l,a as I}from"./chunk-ZLMXIQLC.js";import{h as b}from"./chunk-ETC674NS.js";import{c}from"./chunk-JZ2A7LDM.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
@@ -32,4 +32,4 @@ import{a as g}from"./chunk-ERCYGVAM.js";import{f as p}from"./chunk-PBUH2P5S.js";
32
32
  WHERE imp_d.relative_path = ?
33
33
  AND m.role = 2
34
34
  ORDER BY def_d.relative_path, gs.symbol`,t).filter(n=>!e.isIgnored(n.importer));if(o.length>0){let n=r.semantic===!1?[]:p(e,t);return o.map(i=>({symbol:i.symbol,shortName:u(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function E(e,t){let r=p(e,t);return r.length>0?r.map(s=>{let o=y(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function S(e,t){let r=A(t,b(e,t));return d(e,t).map(s=>{let o=y(s.importedName,s.localName,s.kind),n=s.kind==="side-effect"||v(t,s)||r.has(s.localName??s.importedName)?!0:s.used;return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:n}})}function A(e,t){let r=new Set;if(l(e)!=="python")return r;let s=/(?:^|\n)\s*__all__\s*(?:\+?=)\s*[[(]([\s\S]*?)[\])]/g;for(let o of t.matchAll(s)){let n=o[1]??"";for(let i of n.matchAll(/(['"])([A-Za-z_]\w*)\1/g))r.add(i[2])}return r}function v(e,t){if(l(e)!=="rust"||t.used||t.kind==="side-effect")return!1;let r=t.localName??t.importedName;return r==="_"||/^[A-Z]/.test(r)}function y(e,t,r){return r==="namespace"&&e==="*"&&t?`* as ${t}`:r==="default"&&t?`default as ${t}`:r==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function $(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{Y as a,Z as b,G as c};
35
- //# sourceMappingURL=chunk-7XA3OM44.js.map
35
+ //# sourceMappingURL=chunk-BKZYTLGE.js.map
@@ -0,0 +1,2 @@
1
+ var d={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function l(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let s=t[0],i=t[1],r=e.slice(s.length+1+i.length+1),n;if(r.startsWith("`")){let f=r.indexOf("`",1);f===-1?(n=r.slice(1),r=""):(n=r.slice(1,f),r=r.slice(f+2))}else{let f=r.indexOf(" ");f===-1?(n=r,r=""):(n=r.slice(0,f),r=r.slice(f+1))}let o,c=r.indexOf(" ");c===-1?(o=r,r=""):(o=r.slice(0,c),r=r.slice(c+1));let a=m(r);return{scheme:s,manager:i,packageName:n,version:o,descriptors:a,raw:e}}function y(e){let t=l(e);if("kind"in t)return null;for(let s=t.descriptors.length-2;s>=0;s--){let i=t.descriptors[s];if(i?.suffix==="type")return i.name}return null}function m(e){let t=[],s=0;for(;s<e.length;){if(e[s]==="["){let n=e.indexOf("]",s+1);if(n===-1){t.push({name:e.slice(s+1),suffix:"type-param"});break}t.push({name:e.slice(s+1,n),suffix:"type-param"}),s=n+1;continue}if(e[s]==="("&&(t.length===0||s===0||u(e[s-1]))){let n=e.indexOf(")",s+1);if(n!==-1&&e[n+1]!=="."){t.push({name:e.slice(s+1,n),suffix:"parameter"}),s=n+1;continue}}let i;if(e[s]==="`"){let n=e.indexOf("`",s+1);if(n===-1){i=e.slice(s+1),t.push({name:i,suffix:"term"});break}i=e.slice(s+1,n),s=n+1}else{let n=s;for(;s<e.length&&!u(e[s]);)s++;i=e.slice(n,s)}if(s>=e.length){i&&t.push({name:i,suffix:"term"});break}let r=e[s];if(r==="("){let n=e.indexOf(")",s+1);n!==-1&&e[n+1]==="."?(t.push({name:i,suffix:"method"}),s=n+2):n!==-1?(t.push({name:i,suffix:"method"}),s=n+1):(t.push({name:i,suffix:"term"}),s++)}else{let n=d[r];n&&t.push({name:i,suffix:n}),s+=1}}return t}function u(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function b(e){let t=l(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let s=t;if(s.descriptors.length===0)return s.raw;let i=[];for(let r of s.descriptors){let n=g(r);n&&i.push(n)}return i.join(":")}function g(e){let t=e.suffix==="namespace"?h(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function h(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function k(e){let t=l(e);if("kind"in t&&t.kind==="local")return t.id;let s=t;return s.descriptors.length===0?"":s.descriptors[s.descriptors.length-1].name}function p(e){let t=l(e);if("kind"in t&&t.kind==="local")return null;let s=t;return s.descriptors[s.descriptors.length-1]?.suffix??null}function D(e){return e.endsWith("().")||p(e)==="method"}function $(e){let t=p(e);return t==="method"?!0:t!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function T(e){return p(e)==="namespace"}var x=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function M(e){return x.test(e)}var S=new Set(["test","tests","_tests"]);function N(e){let t=l(e);if("kind"in t)return!1;for(let s=0;s<t.descriptors.length-1;s+=1){let i=t.descriptors[s];if(i?.suffix==="namespace"&&i.name&&S.has(i.name))return!0}return!1}function O(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}function _(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length<=r.length)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}export{l as a,y as b,b as c,k as d,p as e,D as f,$ as g,T as h,M as i,N as j,O as k,_ as l};
2
+ //# sourceMappingURL=chunk-BL6DCHQP.js.map
@@ -0,0 +1,43 @@
1
+ import{x as _,z as C}from"./chunk-RBAD4GJ2.js";import{C as R,a as h}from"./chunk-ZLMXIQLC.js";import{d as x,e as I}from"./chunk-ETC674NS.js";import{c as A,h as O,j as F,y as g}from"./chunk-KNLQGXVH.js";var P=x({kind:"file-dependency-graph",invalidation:I("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:L}),J=A("file-dep-graph",{clearGroups:["whole-project"]});function ee(e,n,r){if(r.length===0)return[];let t=new Set(r),i=M(e),s=new Set;if(n==="forward")for(let o of t)for(let c of i.get(o)??[])t.has(c)||s.add(c);else for(let[o,c]of i)if(!t.has(o))for(let d of t)c.has(d)&&s.add(o);return[...s].sort()}function M(e,n,r={}){let t=r.scipEdges??"all-references",i=r.sourceEdges??"imports-only",s=D(n,t,i);return J.get(e,s,()=>{let o=new Set(h(e,{includeIgnored:!1})),c=F(e),d=0,f=0,l=null,p=!1,u=0,N=0,G=null;return g("file-dep-graph.product",()=>{if(c){let a=P.read(e,s,c);if(a){p=!0,G=a.construction;let E=v(a);return d=a.sourceFileCount,f=a.sourceEdgeCount,u=a.scipEdgeCount,N=E.size,l=a.sourceDependencyFingerprint,E}}let S=i==="none"?{files:[],edges:[],fingerprint:O("no-source-dependency-fallback")}:g("file-dep-graph.source-imports",()=>{let a=j(e,o,n,i);return d=a.files.length,f=a.edges.length,l=a.fingerprint,a},()=>({scope:n??null,sourceEdges:i,files:d,edges:f})),y=new Map,b=(a,E)=>m(e,y,o,a,E);g("file-dep-graph.scip-edges",()=>{for(let a of H(e,n,t))u=(u??0)+1,b(a.from_file,a.to_file)},()=>({scope:n??null,edges:u}));for(let a of S.edges)b(a.fromFile,a.toFile);return N=y.size,c&&(G="full",P.write(e,s,c,{version:2,construction:"full",sourceDependencyFingerprint:S.fingerprint,sourceFileCount:S.files.length,sourceEdgeCount:S.edges.length,scipEdgeCount:u,edgeCount:k(y),graph:w(y)})),y},()=>({scope:n??null,available:c!==null,hit:p,construction:G,files:d,sourceEdges:f,sourceEdgeMode:i,scipEdges:u,graphFiles:N,sourceDependencyFingerprint:l}))})}function ne(e){return T(e,"none")}function re(e,n="imports-only"){let r=D(void 0,"all-references",n),t=F(e);if(!t)return null;let i=P.read(e,r,t);return i?{cacheKey:r,sourceEdges:n,graph:v(i)}:null}function T(e,n){let r=D(void 0,"all-references",n),t=M(e,void 0,{sourceEdges:n});return{cacheKey:r,sourceEdges:n,graph:t}}function te(e,n,r,t){let i=n.sourceEdges??"imports-only",s=F(e);if(!s)return!1;let o=t??$(e,n,r);if(!o)return!1;let c=new Set(h(e,{includeIgnored:!1})),d=D(void 0,"all-references",i);return P.write(e,d,s,{version:2,construction:"carried",sourceDependencyFingerprint:null,sourceFileCount:c.size,sourceEdgeCount:null,scipEdgeCount:null,edgeCount:k(o),graph:w(o)}),!0}function $(e,n,r,t=[]){let i=n.sourceEdges??"imports-only",s=D(void 0,"all-references",i);if(n.cacheKey!==s)return null;let o=g("file-dep-graph.carry.indexed-files",()=>new Set(h(e,{includeIgnored:!1}))),c=new Set(r),d=new Map;g("file-dep-graph.carry.reuse",()=>{if(t.length===0)for(let[l,p]of n.graph)c.has(l)||d.set(l,p);else for(let[l,p]of n.graph)if(!(c.has(l)||!o.has(l)))for(let u of p)m(e,d,o,l,u)});let f=g("file-dep-graph.carry.scip-edges",()=>B(e,c,"all-references"));for(let l of f)m(e,d,o,l.from_file,l.to_file);return g("file-dep-graph.carry.source-edges",()=>{for(let l of c)if(o.has(l)){if(i!=="none")for(let p of C(e,l))p.sourcePath&&m(e,d,o,l,p.sourcePath);if(i==="imports-and-reexports")for(let p of _(e,l))p.sourcePath&&m(e,d,o,l,p.sourcePath)}}),d}async function oe(e,n={}){let r=h(e,{includeIgnored:!1}),t=Math.max(1,Math.floor(n.batchSize??64)),i=n.collectGarbage??R,s=0;for(let o=0;o<r.length;o+=t){for(let c of r.slice(o,o+t))C(e,c),_(e,c),s+=1;n.onBatch?.({files:s,total:r.length}),i(),await n.yieldToEventLoop?.()}return{files:s}}function j(e,n,r,t){let i=[],s=[];for(let o of n)if(!(r&&!o.includes(r))){i.push(o);for(let c of C(e,o))c.sourcePath&&s.push({fromFile:o,toFile:c.sourcePath});if(t==="imports-and-reexports")for(let c of _(e,o))c.sourcePath&&s.push({fromFile:o,toFile:c.sourcePath})}return{files:i,edges:s,fingerprint:z(i,s)}}function z(e,n){let r=n.map(t=>`${t.fromFile}\0${t.toFile}`).sort();return O(JSON.stringify({files:e,edges:r}))}function D(e,n,r){return`edge-mode-v4:${n}:${r}:${e??"<all>"}`}function w(e){return[...e].map(([n,r])=>[n,[...r].sort()]).sort(([n],[r])=>n.localeCompare(r))}function v(e){return new Map(e.graph.map(([n,r])=>[n,new Set(r)]))}function L(e){let n=JSON.parse(e);return K(n)?n:null}function K(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===2&&(n.construction==="full"||n.construction==="carried")&&(n.sourceDependencyFingerprint===null||typeof n.sourceDependencyFingerprint=="string")&&typeof n.sourceFileCount=="number"&&(n.sourceEdgeCount===null||typeof n.sourceEdgeCount=="number")&&(n.scipEdgeCount===null||typeof n.scipEdgeCount=="number")&&typeof n.edgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(W)}function k(e){let n=0;for(let r of e.values())n+=r.size;return n}function W(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function H(e,n,r){let t=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[],s=r==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
2
+ d1.relative_path AS from_file,
3
+ d2.relative_path AS to_file
4
+ FROM mentions m
5
+ JOIN chunks c ON m.chunk_id = c.id
6
+ JOIN documents d1 ON c.document_id = d1.id
7
+ JOIN global_symbols gs ON m.symbol_id = gs.id
8
+ JOIN (
9
+ SELECT m2.symbol_id, c2.document_id
10
+ FROM mentions m2
11
+ JOIN chunks c2 ON m2.chunk_id = c2.id
12
+ WHERE m2.role = 1
13
+ GROUP BY m2.symbol_id
14
+ ) sym_def ON sym_def.symbol_id = gs.id
15
+ JOIN documents d2 ON sym_def.document_id = d2.id
16
+ WHERE d1.id != d2.id
17
+ ${s}
18
+ ${e.pathExclusionsFor("d1","d2")}
19
+ ${t}`,...i)}function B(e,n,r){let t=[...n].sort();if(t.length===0)return[];let i=r==="imports-only"?"AND m.role = 2":"AND m.role != 1",s=[];for(let o=0;o<t.length;o+=500){let c=t.slice(o,o+500),d=c.map(()=>"?").join(", ");s.push(...e.all(`SELECT DISTINCT
20
+ d1.relative_path AS from_file,
21
+ d2.relative_path AS to_file
22
+ FROM documents d1
23
+ CROSS JOIN chunks c
24
+ CROSS JOIN mentions m
25
+ CROSS JOIN global_symbols gs
26
+ CROSS JOIN chunks c2
27
+ CROSS JOIN documents d2
28
+ WHERE d1.relative_path IN (${d})
29
+ AND c.document_id = d1.id
30
+ AND m.chunk_id = c.id
31
+ AND gs.id = m.symbol_id
32
+ AND c2.id = (
33
+ SELECT m2.chunk_id
34
+ FROM mentions m2
35
+ WHERE m2.symbol_id = gs.id AND m2.role = 1
36
+ ORDER BY m2.chunk_id
37
+ LIMIT 1
38
+ )
39
+ AND d2.id = c2.document_id
40
+ AND d1.id != d2.id
41
+ ${i}
42
+ ${e.pathExclusionsFor("d1","d2")}`,...c))}return s}function m(e,n,r,t,i){if(t===i||e.isIgnored(t)||e.isIgnored(i)||!r.has(i))return;let s=n.get(t);s||(s=new Set,n.set(t,s)),s.add(i)}export{ee as a,M as b,ne as c,re as d,te as e,$ as f,oe as g};
43
+ //# sourceMappingURL=chunk-BOW7SSQH.js.map
@@ -1,7 +1,7 @@
1
- import{a as R,b as v}from"./chunk-HCVJR2V4.js";import{a as b,b as L}from"./chunk-JHH5SCZ3.js";import{d}from"./chunk-SB25YMEQ.js";import{spawn as B}from"child_process";import{platform as P}from"os";var u=class extends Error{},h=class extends Error{},m=class extends Error{constructor(t,r,i){super(`rust-analyzer LSP request ${r} failed: ${i}`);this.code=t}code},k=3e4,M=16*1024,O=64*1024*1024,z=64*1024,A=256*1024*1024,p=Buffer.from(`\r
1
+ import{a as R,b as v}from"./chunk-ODPDP7A4.js";import{a as b,b as L}from"./chunk-2OOY75BW.js";import{d}from"./chunk-JFMEXGFE.js";import{spawn as B}from"child_process";import{platform as P}from"os";var u=class extends Error{},h=class extends Error{},m=class extends Error{constructor(t,r,i){super(`rust-analyzer LSP request ${r} failed: ${i}`);this.code=t}code},k=3e4,M=16*1024,O=64*1024*1024,z=64*1024,A=256*1024*1024,p=Buffer.from(`\r
2
2
  \r
3
3
  `,"ascii"),x=class{constructor(e,t={}){this.transport=e;this.requestTimeoutMs=t.requestTimeoutMs??k,this.configuration=t.configuration??{};let r=D(t.maxHeaderBytes,t.maxMessageBytes);this.maxHeaderBytes=r.maxHeaderBytes,this.maxMessageBytes=r.maxMessageBytes,this.monotonicNow=t.monotonicNow??d,this.headerBuffer=Buffer.allocUnsafe(this.maxHeaderBytes+p.length),this.transport.onData(i=>this.handleData(i)),this.transport.onClose((i,s)=>this.failTransport(new Error(H(i,s)),!1)),this.transport.onError(i=>this.failTransport(i,!0))}transport;nextId=1;pending=new Map;diagnosedUris=new Set;diagnosticWaiters=new Map;readinessWaiters=new Set;requestTimeoutMs;configuration;maxHeaderBytes;maxMessageBytes;monotonicNow;headerBuffer;headerLength=0;bodyBuffer=null;bodyLength=0;transportFailure=null;transportKilled=!1;transportKillPromise=null;currentServerStatusGeneration=0;latestServerStatus=null;shutdownStarted=!1;async initialize(e,t={}){let r=e.capabilities??{},i=r.experimental&&typeof r.experimental=="object"&&!Array.isArray(r.experimental)?r.experimental:{},s=await this.request("initialize",{...e,capabilities:{...r,experimental:{...i,serverStatusNotification:!0}}},t);return this.notify("initialized",{}),s}async references(e,t={}){let r=await this.request("textDocument/references",e,t);return Array.isArray(r)?r:[]}async definition(e,t={}){let r=await this.request("textDocument/definition",e,t);return W(r)}async prepareCallHierarchy(e,t={}){let r=await this.request("textDocument/prepareCallHierarchy",e,t);return Array.isArray(r)?r:[]}async outgoingCalls(e,t={}){let r=await this.request("callHierarchy/outgoingCalls",{item:e},t);return Array.isArray(r)?r:[]}async hover(e,t={}){let r=await this.request("textDocument/hover",e,t);return r&&typeof r=="object"?r:null}async readinessBarrier(e={}){try{await this.request("scip-query/readinessBarrier",null,e)}catch(t){if(t instanceof m&&t.code===-32601)return;throw t}}serverStatusGeneration(){return this.currentServerStatusGeneration}serverStatusSnapshot(){let e=this.latestServerStatus;return e?{generation:e.generation,status:{...e.status}}:null}waitForQuiescence(e,t){if(this.transportFailure)return Promise.reject(this.transportFailure);let r=this.latestServerStatus;if(r&&r.generation>e){if(r.status.health==="error")return Promise.reject(E());if(r.status.quiescent)return Promise.resolve(r.status)}return new Promise((i,s)=>{let a={afterGeneration:e,resolve:i,reject:s,timeout:setTimeout(()=>{this.readinessWaiters.delete(a),s(new Error(`rust-analyzer readiness timed out after ${t}ms`))},t)};this.readinessWaiters.add(a)})}didOpenTextDocument(e){this.notify("textDocument/didOpen",{textDocument:e})}waitForDiagnostics(e,t){return this.transportFailure?Promise.resolve(!1):this.diagnosedUris.has(e)?Promise.resolve(!0):new Promise(r=>{let i=l=>{clearTimeout(s),r(l)},s=setTimeout(()=>{let l=this.diagnosticWaiters.get(e)?.filter(o=>o!==i);l&&l.length>0?this.diagnosticWaiters.set(e,l):this.diagnosticWaiters.delete(e),r(!1)},t),a=this.diagnosticWaiters.get(e)??[];a.push(i),this.diagnosticWaiters.set(e,a)})}async shutdown(e={}){if(!this.shutdownStarted){this.shutdownStarted=!0;try{await this.request("shutdown",null,e),this.notify("exit",null)}catch(t){throw this.notify("exit",null),this.killTransportOnce(),t}}}async shutdownAndReap(e={}){let t;try{await this.shutdown(e)}catch(r){t=r}try{await this.killTransportOnce()}catch(r){throw new Error(`rust-analyzer process-tree cleanup failed: ${r instanceof Error?r.message:String(r)}`,{cause:r})}if(t)throw t}request(e,t,r={}){if(this.transportFailure)return Promise.reject(this.transportFailure);let i=y(r.timeoutMs??this.requestTimeoutMs,r.deadlineMs,this.monotonicNow),s=this.nextId++,a={jsonrpc:"2.0",id:s,method:e,params:t};return new Promise((l,o)=>{let c=setTimeout(()=>{let w=i.deadlineLimited?new u(`rust-analyzer readiness deadline expired during LSP request ${e}`):new Error(`rust-analyzer LSP request ${e} timed out after ${i.timeoutMs}ms`);this.cancelAndFailTimedOutRequest(s,w)},i.timeoutMs);this.pending.set(s,{method:e,deadlineMs:r.deadlineMs,resolve:w=>l(w),reject:o,timeout:c}),this.transport.write(f(a))})}notify(e,t){this.transportFailure||this.transport.write(f({jsonrpc:"2.0",method:e,params:t}))}handleData(e){if(this.transportFailure||e.length===0)return;let t=0;for(;t<e.length&&!this.transportFailure;){if(this.bodyBuffer){let a=Math.min(e.length-t,this.bodyBuffer.length-this.bodyLength);if(e.copy(this.bodyBuffer,this.bodyLength,t,t+a),t+=a,this.bodyLength+=a,this.bodyLength===this.bodyBuffer.length){let l=this.bodyBuffer.toString("utf8");this.bodyBuffer=null,this.bodyLength=0;let o;try{o=$(l)}catch{this.failProtocol("rust-analyzer LSP response body was not a valid JSON object");continue}try{this.dispatchMessage(o)}catch{this.failTransport(new Error("rust-analyzer LSP message handling failed"),!0)}}continue}if(this.headerLength===this.headerBuffer.length){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}if(this.headerBuffer[this.headerLength++]=e[t++],!this.headerDelimiterComplete())continue;let r=this.headerLength-p.length;if(r>this.maxHeaderBytes){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}let i=this.headerBuffer.subarray(0,r).toString("ascii");this.headerLength=0;let s;try{s=C(i,this.maxMessageBytes)}catch(a){this.failProtocol(a instanceof Error?a.message:String(a));return}this.bodyBuffer=Buffer.allocUnsafe(s),this.bodyLength=0,s===0&&(this.bodyBuffer=null,this.failProtocol("rust-analyzer LSP response body was not a valid JSON object"))}}headerDelimiterComplete(){if(this.headerLength<p.length)return!1;let e=this.headerLength-p.length;return this.headerBuffer.subarray(e,this.headerLength).equals(p)}failProtocol(e){this.failTransport(new h(e),!0)}failTransport(e,t){this.transportFailure||(this.transportFailure=e,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0,t&&this.killTransportOnce().catch(()=>{}),this.rejectPending(e),this.resolveDiagnosticWaiters(!1))}killTransportOnce(){return this.transportKilled?this.transportKillPromise??Promise.resolve():(this.transportKilled=!0,this.transportKillPromise=Promise.resolve(this.transport.kill()),this.transportKillPromise)}async cancelAndFailTimedOutRequest(e,t){let r=this.pending.get(e);if(!r)return;this.pending.delete(e);try{this.transport.write(f({jsonrpc:"2.0",method:"$/cancelRequest",params:{id:e}}))}catch{}this.transportFailure||(this.transportFailure=t,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0);let i=t;try{await this.killTransportOnce()}catch(s){i=new Error(`${t.message}; rust-analyzer cleanup failed: ${s instanceof Error?s.message:String(s)}`,{cause:s})}r.reject(i),this.rejectPending(i),this.resolveDiagnosticWaiters(!1)}dispatchMessage(e){if(this.recordDiagnosticNotification(e),this.recordServerStatusNotification(e),e.id!==void 0&&e.id!==null&&e.method){this.respondToServerRequest(e);return}if(e.id===void 0||e.id===null)return;let t=this.pending.get(e.id);if(t){if(clearTimeout(t.timeout),this.pending.delete(e.id),e.error){t.reject(new m(e.error.code,t.method,e.error.message));return}if(t.deadlineMs!==void 0&&this.monotonicNow()>=t.deadlineMs){t.reject(new u(`rust-analyzer readiness deadline expired during LSP request ${t.method}`));return}t.resolve(e.result)}}recordDiagnosticNotification(e){if(e.method!=="textDocument/publishDiagnostics")return;let t=e.params,r=t&&typeof t=="object"&&typeof t.uri=="string"?t.uri:null;if(!r)return;this.diagnosedUris.add(r);let i=this.diagnosticWaiters.get(r)??[];this.diagnosticWaiters.delete(r),i.forEach(s=>s(!0))}recordServerStatusNotification(e){if(e.method!=="experimental/serverStatus"||e.id!==void 0||!j(e.params))return;let t=e.params,r={health:t.health,quiescent:t.quiescent,...typeof t.message=="string"?{message:t.message}:{}},i=++this.currentServerStatusGeneration;if(this.latestServerStatus={generation:i,status:r},r.health==="error"){this.rejectReadinessWaiters(E());return}if(r.quiescent)for(let s of this.readinessWaiters)i<=s.afterGeneration||(clearTimeout(s.timeout),this.readinessWaiters.delete(s),s.resolve(r))}respondToServerRequest(e){if(e.id===void 0||e.id===null||!e.method)return;let t=e.method==="workspace/configuration"?this.workspaceConfiguration(e.params):null;this.transport.write(f({jsonrpc:"2.0",id:e.id,result:t}))}workspaceConfiguration(e){return(e&&typeof e=="object"&&Array.isArray(e.items)?e.items:[]).map(r=>typeof r.section=="string"?F(this.configuration,r.section):this.configuration)}rejectPending(e){for(let[t,r]of this.pending)clearTimeout(r.timeout),r.reject(e),this.pending.delete(t);this.rejectReadinessWaiters(e)}resolveDiagnosticWaiters(e){for(let t of this.diagnosticWaiters.values())t.forEach(r=>r(e));this.diagnosticWaiters.clear()}rejectReadinessWaiters(e){for(let t of this.readinessWaiters)clearTimeout(t.timeout),t.reject(e),this.readinessWaiters.delete(t)}};function D(n=M,e=O){if(!Number.isSafeInteger(n)||n<=0)throw new TypeError("maxHeaderBytes must be a positive safe integer.");if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxMessageBytes must be a positive safe integer.");if(n>z)throw new RangeError(`maxHeaderBytes cannot exceed ${z} bytes for rust-analyzer LSP.`);if(n+p.length+e>A)throw new RangeError(`Combined rust-analyzer LSP header and message limits cannot exceed ${A} bytes.`);return{maxHeaderBytes:n,maxMessageBytes:e}}function C(n,e){let t=[];for(let s of n.split(`\r
4
4
  `)){let a=s.indexOf(":");a<0||s.slice(0,a).trim().toLowerCase()!=="content-length"||t.push(s.slice(a+1).trim())}if(t.length===0)throw new h("rust-analyzer LSP response missing Content-Length header");if(t.length>1){let s=new Set(t).size>1?"rust-analyzer LSP response has conflicting Content-Length headers":"rust-analyzer LSP response has duplicate Content-Length headers";throw new h(s)}let r=t[0];if(!/^\d+$/.test(r))throw new h("rust-analyzer LSP Content-Length must be a non-negative safe integer");let i=Number(r);if(!Number.isSafeInteger(i))throw new h("rust-analyzer LSP Content-Length must be a non-negative safe integer");if(i>e)throw new h(`rust-analyzer LSP Content-Length exceeds ${e} byte message limit`);return i}function y(n,e,t=d){if(e===void 0)return{timeoutMs:n,deadlineLimited:!1};let r=e-t();if(r<=0)throw new u("rust-analyzer readiness deadline expired before LSP operation");return{timeoutMs:Math.min(n,r),deadlineLimited:r<=n}}function j(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return(e.health==="ok"||e.health==="warning"||e.health==="error")&&typeof e.quiescent=="boolean"&&(e.message===void 0||e.message===null||typeof e.message=="string")}function E(){return new u("rust-analyzer reported error health before reaching readiness")}function F(n,e){let t=e.startsWith("rust-analyzer.")?e.slice(14):e;if(t===""||t==="rust-analyzer")return n;let r=n;for(let i of t.split(".")){if(!r||typeof r!="object")return null;r=r[i]}return r??null}function W(n){return n?(Array.isArray(n)?n:[n]).flatMap(t=>N(t)?[t]:_(t)?[{uri:t.targetUri,range:t.targetSelectionRange}]:[]):[]}function N(n){return!!(n&&typeof n=="object"&&typeof n.uri=="string")}function _(n){return!!(n&&typeof n=="object"&&typeof n.targetUri=="string")}function Z(n,e,t=process.env,r){let i=B(n,[],{cwd:e,env:t,detached:P()!=="win32",stdio:["pipe","pipe","pipe"]}),s=i.pid===void 0?null:b(i.pid,P()!=="win32"),a=s?R(r,s):null,l=null;return i.on("close",()=>v(a)),{write(o){i.stdin.write(o)},onData(o){i.stdout.on("data",o)},onClose(o){i.on("close",o)},onError(o){i.on("error",o)},kill(){if(!s){i.kill();return}return l??=L(s,{gracefulMs:1e3,forceMs:1e3}).then(o=>{if(!o.reaped)throw new Error(o.detail??`rust-analyzer process tree ${s.rootPid} was not reaped.`);v(a)}),l}}}function f(n){let e=JSON.stringify(n);return`Content-Length: ${Buffer.byteLength(e,"utf8")}\r
5
5
  \r
6
6
  ${e}`}function $(n){let e=JSON.parse(n);if(!e||typeof e!="object")throw new Error("rust-analyzer LSP response was not a JSON object");return e}function H(n,e){return`rust-analyzer LSP transport closed${e?` by ${e}`:n===null?"":` with code ${n}`}`}async function q(n,e,t,r=d){let i=t-r();if(i<=0)throw new u("rust-analyzer readiness deadline expired before quiescence");try{let s=await n.waitForQuiescence(e,i);if(g(t,r,"during quiescence"),s.health==="error")throw new u("rust-analyzer reported error health before reaching readiness");if(!s.quiescent)throw new u("rust-analyzer did not report quiescence before reaching readiness");return s}catch(s){throw s instanceof u?s:new u(s instanceof Error?s.message:String(s))}}async function te(n,e,t,r,i,s=d,a=S){let l=await q(n,e,r,s);if(t===0)return l;let o=n.serverStatusSnapshot();if(!o)throw new u("rust-analyzer status is unavailable after initial document open");return await J(n,o,t,r,i,s,a)??l}async function J(n,e,t,r,i,s=d,a=S){if(t===0)return null;if(!e)throw new u("rust-analyzer status is unavailable before document open");T(e.status,"before document open");try{await n.readinessBarrier({deadlineMs:r}),g(r,s,"during post-open synchronization")}catch(c){throw c instanceof u?c:new u(c instanceof Error?c.message:String(c))}let l=n.serverStatusSnapshot();if(!l||l.generation<e.generation)throw new u("rust-analyzer status is unavailable after document open");let o;return l.generation===e.generation?(T(l.status,"after document open"),o=l.status):o=await q(n,e.generation,r,s),await U(i,r,s,a),o}async function re(n,e,t,r=d){let i=y(e,t,r);await n(i.timeoutMs),g(t,r,"during diagnostics")}async function U(n,e,t=d,r=S){if(n<=0)return;if(y(n,e,t).deadlineLimited)throw new u("rust-analyzer readiness deadline cannot accommodate delay");await r(n),g(e,t,"during delay")}async function ne(n,e){try{return await n()}catch(t){throw t instanceof u&&await e(),t}}function se(n){return n instanceof u?{ok:!1,error:n.message}:null}function g(n,e,t){if(n-e()<=0)throw new u(`rust-analyzer readiness deadline expired ${t}`)}function T(n,e){if(n.health==="error")throw new u(`rust-analyzer reported error health ${e}`);if(!n.quiescent)throw new u(`rust-analyzer did not report quiescence ${e}`)}function S(n){return new Promise(e=>setTimeout(e,n))}export{u as a,x as b,Z as c,te as d,J as e,re as f,U as g,ne as h,se as i,S as j};
7
- //# sourceMappingURL=chunk-KQHJEU6V.js.map
7
+ //# sourceMappingURL=chunk-C4RHHCKL.js.map
@@ -0,0 +1,117 @@
1
+ import{a as I,o as v,r as P,x as Q,y as j}from"./chunk-RBAD4GJ2.js";import{E as A,a as D}from"./chunk-ZLMXIQLC.js";import{a as _,c as O,e as C,f as T,h as w,k as $}from"./chunk-ETC674NS.js";import{c as h,d as N,i as S,j as x}from"./chunk-KNLQGXVH.js";var ie={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),o;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(o=r.slice(1),r=""):(o=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(o=r,r=""):(o=r.slice(0,l),r=r.slice(l+1))}let s,a=r.indexOf(" ");a===-1?(s=r,r=""):(s=r.slice(0,a),r=r.slice(a+1));let c=re(r);return{scheme:t,manager:i,packageName:o,version:s,descriptors:c,raw:e}}function p(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function re(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let o=e.indexOf("]",t+1);if(o===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,o),suffix:"type-param"}),t=o+1;continue}if(e[t]==="("&&(n.length===0||t===0||B(e[t-1]))){let o=e.indexOf(")",t+1);if(o!==-1&&e[o+1]!=="."){n.push({name:e.slice(t+1,o),suffix:"parameter"}),t=o+1;continue}}let i;if(e[t]==="`"){let o=e.indexOf("`",t+1);if(o===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,o),t=o+1}else{let o=t;for(;t<e.length&&!B(e[t]);)t++;i=e.slice(o,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let o=e.indexOf(")",t+1);o!==-1&&e[o+1]==="."?(n.push({name:i,suffix:"method"}),t=o+2):o!==-1?(n.push({name:i,suffix:"method"}),t=o+1):(n.push({name:i,suffix:"term"}),t++)}else{let o=ie[r];o&&n.push({name:i,suffix:o}),t+=1}}return n}function B(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function z(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let o=oe(r);o&&i.push(o)}return i.join(":")}function oe(e){let n=e.suffix==="namespace"?se(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function se(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function W(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function Be(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n.descriptors,i=t[t.length-1];if(!i)return"";let r=t[t.length-2];return r&&r.suffix==="type"?`${r.name} ${i.name}`:i.name}function ze(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n.descriptors,i=t[t.length-2];return i&&i.suffix==="type"?i.name:null}function g(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function We(e){return e.endsWith("().")||g(e)==="method"}function L(e){let n=g(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function Je(e){return g(e)==="namespace"}var ae=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Ge(e){return ae.test(e)}var le=new Set(["test","tests","_tests"]);function He(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&le.has(i.name))return!0}return!1}function Ue(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,o=i.descriptors;if(o.length!==r.length+1)return!1;for(let s=0;s<r.length;s++){let a=r[s],c=o[s];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ke(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,o=i.descriptors;if(o.length<=r.length)return!1;for(let s=0;s<r.length;s++){let a=r[s],c=o[s];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Xe(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
2
+ FROM global_symbols gs
3
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
+ JOIN documents d ON der.document_id = d.id
5
+ WHERE ${n.where}
6
+ ${e.pathExclusionsFor("d")}
7
+ ${G(n.orderBy)}
8
+ ${H(n.limit)}`,...n.params??[])}function Ze(e,n){return e.all(`SELECT
9
+ gs.id,
10
+ gs.symbol,
11
+ c.document_id,
12
+ MIN(c.start_line) AS start_line,
13
+ 0 AS start_char,
14
+ MAX(c.end_line) AS end_line,
15
+ 0 AS end_char,
16
+ d.relative_path,
17
+ gs.display_name,
18
+ gs.documentation
19
+ FROM global_symbols gs
20
+ JOIN mentions m ON m.symbol_id = gs.id
21
+ JOIN chunks c ON m.chunk_id = c.id
22
+ JOIN documents d ON c.document_id = d.id
23
+ WHERE m.role = 1
24
+ AND ${n.where}
25
+ ${e.pathExclusionsFor("d")}
26
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
27
+ ${G(n.orderBy)}
28
+ ${H(n.limit)}`,...n.params??[])}function G(e){return e?`ORDER BY ${e}`:""}function H(e){return typeof e=="number"?`LIMIT ${e}`:""}function U(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function K(e){if(!e)return null;let n=J(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(J(i)??i).replace(/\n/g," ")}function J(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function b(e){return{forFile(n,t){return Y(e,n,t)},forFiles(n,t){let i=new Map;for(let r of n)i.set(r,Y(e,r,t));return i}}}function Y(e,n,t){let i={file:n},r=t.facts||t.identifiers;if(t.text&&(i.text=w(e,n)),t.lines&&(i.lines=$(e,n)),t.ast&&(i.ast=A(e,n)),t.imports&&(i.imports=j(e,n)),t.reexports&&(i.reexports=Q(e,n)),r){let o=v(e,n),s=o.facts;t.facts&&(i.facts=s),o.unavailable&&(i.sourceFactsUnavailable=o.unavailable),t.identifiers&&s&&(i.identifiers=s.fileIdentifiers,i.identifierLineMap=s.identifierLineMap)}return i}function ce(e,n={}){if(p(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let r=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(r)}function F(e,n,t={}){let i=new Map;for(let o of n)e.length>0&&!ce(o,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||i.set(o.id,o);for(let o of e)i.set(o.id,o);let r=[...i.values()];return t.sort?r.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):r}function Sn(e){let n=new Map;for(let t of e){if(!t.leaf)continue;let i=n.get(t.leaf)??[];i.push(t),n.set(t.leaf,i)}return n}var de=h("file-definitions",{clearGroups:["definition-catalog"]}),ue=N("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),fe=h("file-function-like-definitions",{clearGroups:["definition-catalog"]}),X=new WeakMap;function E(e,n,t={},i){return T(n),t.includeClassMemberFallbacks?R(e,n,void 0,{includeClassMemberFallbacks:!0},i):de.get(e,n,()=>{let r=m(i,"evidence-read",()=>ee(e,n));if(r)return r;let o=R(e,n,void 0,t,i);return m(i,"evidence-write",()=>{let s=x(e),a=b(e).forFile(n,{text:!0}).text;s&&a&&V.write(e,n,S(e,n,a),{projectFingerprint:s,definitions:o.map(c=>({...c}))})}),o})}function me(e,n){return fe.get(e,n,()=>{let t=ee(e,n);return t?t.filter(i=>i.isFunctionLike):R(e,n,i=>i.isFunctionLike)})}var V=O({kind:"file-definitions",invalidation:C("file-definitions"),serialize:pe,deserialize:ge});function ee(e,n){let t=x(e);if(!t)return null;let i=b(e).forFile(n,{text:!0}).text;if(!i)return null;let r=V.read(e,n,S(e,n,i));return r?be(r,t,n):null}function pe(e){return JSON.stringify(e)}function ge(e){try{let n=JSON.parse(e);return!_(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function be(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let o=ye(r,t);if(!o)return null;i.push(o)}return i}function ye(e,n){return!_(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function R(e,n,t,i={},r){let o=m(r,"primary-rows",()=>he(e,n)),s=m(r,"fallback-rows",()=>Se(e,n)),a=m(r,"merge-rows",()=>F(o,s,{sort:!0,includeClassMemberFallbacks:i.includeClassMemberFallbacks}).map(k));return t&&(a=a.filter(t)),m(r,"range-correction",()=>M(e,n,a,r,i.rangeCorrectionEvidence))}function m(e,n,t){return e?e(n,t):t()}function he(e,n){return e.all(`SELECT
29
+ gs.id,
30
+ gs.symbol,
31
+ der.document_id,
32
+ der.start_line,
33
+ der.start_char,
34
+ der.end_line,
35
+ der.end_char,
36
+ d.relative_path,
37
+ gs.display_name,
38
+ gs.kind,
39
+ gs.documentation,
40
+ gs.enclosing_symbol
41
+ FROM global_symbols gs
42
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
43
+ JOIN documents d ON der.document_id = d.id
44
+ WHERE d.relative_path = ?
45
+ ${e.symbolNoiseFor("gs")}
46
+ ORDER BY der.start_line, der.end_line`,n)}function Se(e,n){return e.all(`SELECT
47
+ gs.id,
48
+ gs.symbol,
49
+ c.document_id,
50
+ MIN(c.start_line) AS start_line,
51
+ 0 AS start_char,
52
+ MAX(c.end_line) AS end_line,
53
+ 0 AS end_char,
54
+ d.relative_path,
55
+ gs.display_name,
56
+ gs.kind,
57
+ gs.documentation,
58
+ gs.enclosing_symbol
59
+ FROM global_symbols gs
60
+ JOIN mentions m ON m.symbol_id = gs.id
61
+ JOIN chunks c ON m.chunk_id = c.id
62
+ JOIN documents d ON c.document_id = d.id
63
+ WHERE d.relative_path = ?
64
+ AND m.role = 1
65
+ ${e.symbolNoiseFor("gs")}
66
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
67
+ ORDER BY start_line, end_line`,n)}function k(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:W(e.symbol),parentTypeName:p(e.symbol),isFunctionLike:L(e.symbol),isTypeLike:g(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function xn(e,n={}){return xe(e,n.scope)}function xe(e,n){return D(e,{scope:n,includeIgnored:!1}).flatMap(t=>E(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function Dn(e,n){return D(e,{scope:n,includeIgnored:!1}).flatMap(t=>me(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function _n(e,n){let t=ue.get(e,()=>new WeakMap),i=t.get(n.symbolMatches);i||(i=new Map,t.set(n.symbolMatches,i));let r=JSON.stringify({scope:n.scope??null,sqlPrefilter:n.sqlPrefilter??null}),o=i.get(r);if(o)return[...o];let s=Z(De(e,n.scope,n.sqlPrefilter)),a=Z(_e(e,n.scope,n.sqlPrefilter)),c=new Set([...s.keys(),...a.keys()]),l=[];for(let d of[...c].sort()){if(e.isIgnored(d))continue;let f=F(s.get(d)??[],a.get(d)??[],{sort:!0}).filter(te=>n.symbolMatches(te.symbol));f.length!==0&&l.push(...M(e,d,f.map(k)))}return i.set(r,l),[...l]}function De(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ne("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
68
+ gs.id,
69
+ gs.symbol,
70
+ der.document_id,
71
+ der.start_line,
72
+ der.start_char,
73
+ der.end_line,
74
+ der.end_char,
75
+ d.relative_path,
76
+ gs.display_name,
77
+ gs.kind,
78
+ gs.documentation,
79
+ gs.enclosing_symbol
80
+ FROM global_symbols gs
81
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
82
+ JOIN documents d ON der.document_id = d.id
83
+ WHERE 1 = 1
84
+ ${e.pathExclusionsFor("d")}
85
+ ${i}
86
+ ${r}
87
+ ${e.symbolNoiseFor("gs")}
88
+ ORDER BY d.relative_path, der.start_line, der.end_line`,...o)}function _e(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ne("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
89
+ gs.id,
90
+ gs.symbol,
91
+ c.document_id,
92
+ MIN(c.start_line) AS start_line,
93
+ 0 AS start_char,
94
+ MAX(c.end_line) AS end_line,
95
+ 0 AS end_char,
96
+ d.relative_path,
97
+ gs.display_name,
98
+ gs.kind,
99
+ gs.documentation,
100
+ gs.enclosing_symbol
101
+ FROM global_symbols gs
102
+ JOIN mentions m ON m.symbol_id = gs.id
103
+ JOIN chunks c ON m.chunk_id = c.id
104
+ JOIN documents d ON c.document_id = d.id
105
+ WHERE m.role = 1
106
+ AND NOT EXISTS (
107
+ SELECT 1
108
+ FROM defn_enclosing_ranges existing_der
109
+ WHERE existing_der.symbol_id = gs.id
110
+ )
111
+ ${e.pathExclusionsFor("d")}
112
+ ${i}
113
+ ${r}
114
+ ${e.symbolNoiseFor("gs")}
115
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
116
+ ORDER BY d.relative_path, start_line, end_line`,...o)}function Ie(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function ne(e,n){return n==="callable"?Ie(e):Le(e)}function Le(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function Z(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function In(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>E(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,o)=>r.relativePath.localeCompare(o.relativePath)||r.startLine-o.startLine||r.endLine-o.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:z(r.symbol),signature:U(K(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Fe(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function Ln(e,n){let t=X.get(e);return t||(t=Fe(e),X.set(e,t)),t.get(n)??null}function Fn(e,n){let t=E(e,n.relative_path).find(i=>i.symbolId===n.id)??(p(n.symbol)===null||!L(n.symbol)?void 0:M(e,n.relative_path,[k(n)])[0]);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function M(e,n,t,i,r){let o=m(i,"range-correction.source-text",()=>r?r.source:b(e).forFile(n,{text:!0}).text),s=m(i,"range-correction.callable-sites",()=>r?r.callables:P(e,n));return s?m(i,"range-correction.ast-correction",()=>Oe(t,s,o)):o?m(i,"range-correction.regex-fallback",()=>Re(t,o)):t}function Re(e,n){let t=n.split(/\r?\n/),i=Ee(e,t),r=ke(e,i),o=Me(r,t);return Ne(e,o)}function Ee(e,n){let t=e.some(r=>y(r.symbol))?Pe(n):null,i=new Map;for(let r of e)i.set(r.symbolId,ve(n,t,r));return i}function ke(e,n){return e.filter(t=>y(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Me(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],o=e[i+1],s=o?Math.max(r.startLine,o.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:Qe(n,r.definition,r.startLine,s)})}return t}function Ne(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function Oe(e,n,t=null){let i=new Map;for(let r of n){let o=i.get(r.name);o?o.push(r):i.set(r.name,[r])}return e.map(r=>{if(!Ae(r)||!r.leaf)return q(r,t);let o=i.get(r.leaf);if(!o||o.length===0)return q(r,t);let s=t?Ce(r,o,t):null;if(s)return{...r,startLine:s.startLine,endLine:s.endLine};let a=o[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<o.length;l+=1){let d=o[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Ce(e,n,t){let i=Te(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),o=new RegExp(`\\b${I(i)}\\b`);for(let s of n){let a=we(r,s.startLine);if(a&&o.test(a))return s}return null}function Te(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function we(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return $e(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function $e(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let o=e[r]??"";if(i.push(o),o.includes("{"))break}return i.join(" ")}function Ae(e){return y(e.symbol)?!0:g(e.symbol)==="term"&&p(e.symbol)===null}function q(e,n){if(!n||!e.leaf||g(e.symbol)!=="term"||p(e.symbol)!==null)return e;let t=I(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=n.split(/\r?\n/).findIndex(s=>i.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function ve(e,n,t){if(!y(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let o=null;for(let s of r){let a=Math.abs(s-t.startLine);(!o||a<o.distance)&&(o={line:s,distance:a})}return o?.line??i}function Pe(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(a,c)=>{let l=o.get(a);if(!l){o.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&s(d[1],a);for(let d of c.matchAll(t))d[1]&&s(d[1],a);let l=c.match(i);l?.[1]&&s(l[1],a);for(let d of c.matchAll(r))d[1]&&s(d[1],a)}return o}function Qe(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),o=Math.max(t,Math.min(r,n.endLine)),s=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=je(e[l]??"");for(let f of d)f==="{"?(s+=1,c=!0):f==="}"?s=Math.max(0,s-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&s===0||!c&&a===0&&l>=o)return l}return o}function je(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let o=e[r],s=e[r+1];if(!t&&o==="/"&&s==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(o==="\\"){i=!0,n+=" ";continue}o===t&&(t=null),n+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,n+=" ";continue}n+=o}return n}function y(e){return e.includes("().")}function Rn(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{b as a,u as b,p as c,z as d,W as e,Be as f,ze as g,g as h,We as i,L as j,Je as k,Ge as l,He as m,Ue as n,Ke as o,Xe as p,Ze as q,U as r,K as s,F as t,Sn as u,E as v,xn as w,xe as x,Dn as y,_n as z,In as A,Fe as B,Ln as C,Fn as D,Rn as E};
117
+ //# sourceMappingURL=chunk-C7C6AKAT.js.map