codebaseiq 0.3.1 → 0.4.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 (321) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-7GAK2F3H.js → chunk-23AD24QZ.js} +12 -12
  4. package/dist/chunk-24TEZJST.js +2 -0
  5. package/dist/{chunk-356EZBIP.js → chunk-26EDDGAX.js} +2 -2
  6. package/dist/{chunk-O2M3VNDY.js → chunk-26EZWQ24.js} +2 -2
  7. package/dist/{chunk-U33PMPNW.js → chunk-2L3NCI52.js} +2 -2
  8. package/dist/{chunk-MSI3K7PJ.js → chunk-2QJAVISG.js} +2 -2
  9. package/dist/{chunk-4LK5OIPW.js → chunk-2ZBZRYX4.js} +2 -2
  10. package/dist/{chunk-JYRJYXUV.js → chunk-33AXWMO2.js} +2 -2
  11. package/dist/{chunk-EQNMD62X.js → chunk-37K55EG3.js} +2 -2
  12. package/dist/{chunk-LCW3PSGL.js → chunk-3EFZ5KQ4.js} +2 -2
  13. package/dist/{chunk-D7DOB27N.js → chunk-3F23W57G.js} +2 -2
  14. package/dist/{chunk-BGGB5N53.js → chunk-3GKKCVKK.js} +2 -2
  15. package/dist/{chunk-MQW6SJ4P.js → chunk-3SYRGMCL.js} +2 -2
  16. package/dist/{chunk-DWBAESVW.js → chunk-3VDL7GTY.js} +2 -2
  17. package/dist/{chunk-BFANZRQ5.js → chunk-3XBZ5PKL.js} +2 -2
  18. package/dist/{chunk-K6FNTQQW.js → chunk-42PXSE74.js} +2 -2
  19. package/dist/{chunk-ALOEHWJS.js → chunk-4GIERC2P.js} +2 -2
  20. package/dist/{chunk-W7YLRXZE.js → chunk-4UXDBRIF.js} +2 -2
  21. package/dist/chunk-4XMZYLW5.js +2 -0
  22. package/dist/{chunk-JSB43EX6.js → chunk-55NUXP2V.js} +2 -2
  23. package/dist/chunk-5AJQCOZZ.js +21 -0
  24. package/dist/{chunk-L37EQYAX.js → chunk-5NUPFZFA.js} +2 -2
  25. package/dist/{chunk-PIFYOWS4.js → chunk-65QIFIF6.js} +2 -2
  26. package/dist/{chunk-SUE7SHZL.js → chunk-66Q5VLH6.js} +2 -2
  27. package/dist/{chunk-KFTHI2R6.js → chunk-6CQPIIS7.js} +2 -2
  28. package/dist/{chunk-GV2CEZCW.js → chunk-6CTSFS7R.js} +2 -2
  29. package/dist/{chunk-SB53KPWA.js → chunk-6EBUAKJT.js} +2 -2
  30. package/dist/chunk-6I55VYFG.js +4 -0
  31. package/dist/chunk-6NUURWPF.js +3 -0
  32. package/dist/{chunk-TEMM2FEL.js → chunk-6P5QMOM7.js} +2 -2
  33. package/dist/{chunk-3LQJRS4I.js → chunk-6S5FE4ZF.js} +2 -2
  34. package/dist/chunk-74LRKLNC.js +22 -0
  35. package/dist/{chunk-NNG6M6XD.js → chunk-75A23IID.js} +2 -2
  36. package/dist/chunk-75VNTSO6.js +7 -0
  37. package/dist/chunk-7HBBVZJ6.js +3 -0
  38. package/dist/{chunk-AGGR2BKS.js → chunk-7PPBMBH6.js} +2 -2
  39. package/dist/{chunk-DECN422G.js → chunk-7WG57A5X.js} +2 -2
  40. package/dist/{chunk-ILGTMRMZ.js → chunk-7XHZX6FX.js} +2 -2
  41. package/dist/{chunk-OKAF4OQS.js → chunk-A5HJ3CJW.js} +2 -2
  42. package/dist/{chunk-JNXI6NQ7.js → chunk-AJ5HVC5Z.js} +2 -2
  43. package/dist/{chunk-SZ4P7MF7.js → chunk-AYRHOFLV.js} +2 -2
  44. package/dist/chunk-AZDY3EKD.js +93 -0
  45. package/dist/{chunk-SA7G6GJX.js → chunk-AZZNG5Z2.js} +2 -2
  46. package/dist/chunk-BEKCTUPY.js +3 -0
  47. package/dist/{chunk-PTR3EOXC.js → chunk-BKKX2OU5.js} +2 -2
  48. package/dist/{chunk-5LL4KEHO.js → chunk-BQKRYKDD.js} +2 -2
  49. package/dist/{chunk-UIAUPFBJ.js → chunk-BVDQU2XJ.js} +2 -2
  50. package/dist/chunk-C3PPB2T5.js +5 -0
  51. package/dist/chunk-CABIZQXQ.js +21 -0
  52. package/dist/{chunk-M2Y6PCFE.js → chunk-CAH322MC.js} +2 -2
  53. package/dist/{chunk-EIBGSU2R.js → chunk-CBOOHUK4.js} +2 -2
  54. package/dist/chunk-CFIICAOM.js +2 -0
  55. package/dist/{chunk-UMEPSVKT.js → chunk-CPWYEPWQ.js} +2 -2
  56. package/dist/{chunk-LQHYYIOB.js → chunk-CRT7I7RJ.js} +2 -2
  57. package/dist/{chunk-IZDPGOZR.js → chunk-CZVSQQDU.js} +2 -2
  58. package/dist/{chunk-TNJGTQWO.js → chunk-D3KE26FS.js} +2 -2
  59. package/dist/{chunk-CB5AVJMM.js → chunk-DNRHRVKS.js} +2 -2
  60. package/dist/{chunk-SGMNWYTH.js → chunk-DOQLO74K.js} +2 -2
  61. package/dist/{chunk-DDRA3QKN.js → chunk-DP3EJ6XL.js} +2 -2
  62. package/dist/{chunk-OWJWOEDU.js → chunk-DQZF7MP6.js} +2 -2
  63. package/dist/{chunk-VSGOIZMQ.js → chunk-DTM4EHD2.js} +2 -2
  64. package/dist/{chunk-YRKP7PM7.js → chunk-DUM7GR6B.js} +2 -2
  65. package/dist/{chunk-HNXRVGMY.js → chunk-DZ4QOIRY.js} +2 -2
  66. package/dist/{chunk-CSPDQLLU.js → chunk-E3R6TJ5T.js} +2 -2
  67. package/dist/chunk-E4DP45YU.js +3 -0
  68. package/dist/{chunk-PUVNH4PO.js → chunk-E5U6N5WI.js} +2 -2
  69. package/dist/chunk-E7T22WET.js +21 -0
  70. package/dist/{chunk-QEOWONKY.js → chunk-ED7ZAZ5V.js} +2 -2
  71. package/dist/{chunk-RCIGX23V.js → chunk-EDMG5CSO.js} +2 -2
  72. package/dist/{chunk-IHSLIIL3.js → chunk-EOSUV7H5.js} +2 -2
  73. package/dist/{chunk-EHPOTEQX.js → chunk-ESWVTSHU.js} +2 -2
  74. package/dist/{chunk-57OPIQFM.js → chunk-ETZBIG6K.js} +2 -2
  75. package/dist/chunk-EYSJHKX6.js +3 -0
  76. package/dist/{chunk-MC46AL7B.js → chunk-F4AGM7ZE.js} +37 -37
  77. package/dist/{chunk-EOKVZXNF.js → chunk-FPUJRBHL.js} +55 -55
  78. package/dist/{chunk-CCIYWXX6.js → chunk-G2UU6PQP.js} +2 -2
  79. package/dist/{chunk-C6WKPKCF.js → chunk-G3KRXNNT.js} +2 -2
  80. package/dist/{chunk-TEANKHUU.js → chunk-G3ZBP72R.js} +2 -2
  81. package/dist/{chunk-ELYMY5S2.js → chunk-GC4I33OD.js} +2 -2
  82. package/dist/{chunk-NDKOVQFG.js → chunk-GLXEWYQY.js} +2 -2
  83. package/dist/{chunk-CYJS33YX.js → chunk-GRHNPFHT.js} +2 -2
  84. package/dist/{chunk-QY7QB7I6.js → chunk-GWESWURK.js} +2 -2
  85. package/dist/{chunk-R4OJGTMP.js → chunk-GXOFPAIR.js} +2 -2
  86. package/dist/{chunk-OBC7HSSO.js → chunk-H4FGIFEU.js} +2 -2
  87. package/dist/{chunk-LKUTSP4G.js → chunk-HOGS6JFP.js} +2 -2
  88. package/dist/{chunk-RIO3JXHM.js → chunk-HSJLK5MC.js} +2 -2
  89. package/dist/{chunk-BWL3PMPT.js → chunk-HTPEUJ42.js} +2 -2
  90. package/dist/{chunk-DJKOXMNG.js → chunk-IBPXUGJV.js} +2 -2
  91. package/dist/{chunk-2XBJRZEM.js → chunk-ITA3N7G6.js} +2 -2
  92. package/dist/chunk-JG5OWAEB.js +22 -0
  93. package/dist/{chunk-LSZYMN2A.js → chunk-JGJKRTTB.js} +2 -2
  94. package/dist/{chunk-TJWVT4DO.js → chunk-JGXLB7PR.js} +2 -2
  95. package/dist/{chunk-5TZNHP4T.js → chunk-JKUF2UG6.js} +2 -2
  96. package/dist/{chunk-CIYA2KZN.js → chunk-JOYASZRF.js} +2 -2
  97. package/dist/{chunk-U7NUXDQO.js → chunk-K3PFL5QQ.js} +2 -2
  98. package/dist/{chunk-WK2IQJPK.js → chunk-KAXBWTSX.js} +2 -2
  99. package/dist/{chunk-5ZI2PPI7.js → chunk-KHHAGHAW.js} +2 -2
  100. package/dist/{chunk-UW6KD57C.js → chunk-KJLUQVBG.js} +2 -2
  101. package/dist/{chunk-WWCV4E6J.js → chunk-KOVUXHIZ.js} +2 -2
  102. package/dist/chunk-KPMMOAV5.js +4 -0
  103. package/dist/{chunk-2Z7K66D7.js → chunk-LKJZNGMA.js} +2 -2
  104. package/dist/{chunk-3VJ3OCRE.js → chunk-LMPOC372.js} +2 -2
  105. package/dist/{chunk-F3QSL4W2.js → chunk-LTPNP6D5.js} +2 -2
  106. package/dist/{chunk-O2KWU34K.js → chunk-M3IBH6C3.js} +9 -9
  107. package/dist/{chunk-UJIXCI3L.js → chunk-MAGBSB6E.js} +2 -2
  108. package/dist/{chunk-QMOZZ2VX.js → chunk-MFMHD36E.js} +2 -2
  109. package/dist/{chunk-LMTSB3TB.js → chunk-MJX2J5QE.js} +2 -2
  110. package/dist/{chunk-WO6OFKUC.js → chunk-N26LGGSF.js} +2 -2
  111. package/dist/{chunk-J7AMBVWF.js → chunk-NB2DAVPP.js} +2 -2
  112. package/dist/{chunk-MDFT325O.js → chunk-NJDXNYLG.js} +2 -2
  113. package/dist/{chunk-BRQL7AFJ.js → chunk-NMKQOIYZ.js} +2 -2
  114. package/dist/{chunk-ICUL7XRT.js → chunk-NRNVMB2R.js} +2 -2
  115. package/dist/{chunk-JAFDMV5I.js → chunk-O5BWFNIH.js} +2 -2
  116. package/dist/{chunk-3H2H5ODK.js → chunk-O7PCDZ5B.js} +2 -2
  117. package/dist/{chunk-KPZGTB2O.js → chunk-OAJYNPRU.js} +2 -2
  118. package/dist/{chunk-KUKWHP4R.js → chunk-OFUC6R46.js} +2 -2
  119. package/dist/chunk-OSZ7PW5K.js +5 -0
  120. package/dist/{chunk-B3UYV66Z.js → chunk-OZ2M2X7A.js} +2 -2
  121. package/dist/{chunk-6O3KXIDL.js → chunk-OZI44VCR.js} +2 -2
  122. package/dist/{chunk-XN3EKMLI.js → chunk-PCKIKOUA.js} +2 -2
  123. package/dist/{chunk-I3OK27P7.js → chunk-PFMQRHC6.js} +2 -2
  124. package/dist/{chunk-K4S2VH42.js → chunk-PVKSZBX5.js} +2 -2
  125. package/dist/{chunk-NEWHKGVD.js → chunk-QANCT4MO.js} +2 -2
  126. package/dist/{chunk-ZNH33XIB.js → chunk-QEWN7BLP.js} +2 -2
  127. package/dist/{chunk-OQUCBKOI.js → chunk-QFJ46F6F.js} +2 -2
  128. package/dist/{chunk-2E6OUPCF.js → chunk-QPQWR6CW.js} +2 -2
  129. package/dist/{chunk-YTJHCGYB.js → chunk-QX4HDF2I.js} +2 -2
  130. package/dist/{chunk-KLX6NSWT.js → chunk-R2F2CTBA.js} +2 -2
  131. package/dist/{chunk-2OMXFE64.js → chunk-R7PXHYMY.js} +2 -2
  132. package/dist/{chunk-F74LZWCE.js → chunk-RGBZDOUO.js} +2 -2
  133. package/dist/{chunk-362QOSFD.js → chunk-RNPG5P4P.js} +2 -2
  134. package/dist/{chunk-D62CTZX6.js → chunk-RS6UYNEP.js} +2 -2
  135. package/dist/{chunk-VGWZ4MOY.js → chunk-RVBRPBLQ.js} +2 -2
  136. package/dist/{chunk-BGYRF5YX.js → chunk-RWAZCEJD.js} +2 -2
  137. package/dist/{chunk-Z66XYVLZ.js → chunk-RWDIONS7.js} +2 -2
  138. package/dist/{chunk-CJTKGAGH.js → chunk-S3CJYDXP.js} +2 -2
  139. package/dist/{chunk-53ELMZRF.js → chunk-S6UTKCBT.js} +2 -2
  140. package/dist/chunk-SLLFJXTW.js +27 -0
  141. package/dist/{chunk-TOTWJZIX.js → chunk-T3KTMLQT.js} +2 -2
  142. package/dist/{chunk-HJTM3C4Y.js → chunk-TB575ZGO.js} +2 -2
  143. package/dist/{chunk-YHPG3S2U.js → chunk-TG4GMU73.js} +2 -2
  144. package/dist/{chunk-N2XDMNVI.js → chunk-THKM7OXM.js} +2 -2
  145. package/dist/{chunk-GVAF222T.js → chunk-TNLOX4TN.js} +2 -2
  146. package/dist/{chunk-BPKNP3KZ.js → chunk-UHFZDQZJ.js} +2 -2
  147. package/dist/{chunk-YT4DVWUV.js → chunk-UUMAM5LM.js} +2 -2
  148. package/dist/{chunk-TLTSESB4.js → chunk-UUT5P3V7.js} +2 -2
  149. package/dist/{chunk-W7QDASTN.js → chunk-VEPK6M5C.js} +2 -2
  150. package/dist/{chunk-XJBK3QDV.js → chunk-VPCHKZ3I.js} +2 -2
  151. package/dist/{chunk-3ON3A2QV.js → chunk-VZY3XOBU.js} +2 -2
  152. package/dist/{chunk-XQAVQVIL.js → chunk-W6E6ME7G.js} +2 -2
  153. package/dist/{chunk-KEJ2HLRW.js → chunk-WGYZBS5S.js} +2 -2
  154. package/dist/{chunk-5MPBSFZH.js → chunk-WUP24Q4U.js} +2 -2
  155. package/dist/chunk-WXUHXSLN.js +2 -0
  156. package/dist/{chunk-F5CJO5JN.js → chunk-X4YZD2MP.js} +2 -2
  157. package/dist/chunk-XARPGCTL.js +2 -0
  158. package/dist/{chunk-5FWR5HLG.js → chunk-XDQ6QJF5.js} +20 -20
  159. package/dist/{chunk-JCMFBF4Z.js → chunk-XRH7R5SX.js} +2 -2
  160. package/dist/{chunk-T2M5HWBQ.js → chunk-XVJ2E7W7.js} +2 -2
  161. package/dist/{chunk-AXQCHG77.js → chunk-Y7GFAU5N.js} +2 -2
  162. package/dist/{chunk-T6MQNNAC.js → chunk-YBDLHFZZ.js} +2 -2
  163. package/dist/{chunk-ZB4C5TTR.js → chunk-YI3CJPOY.js} +2 -2
  164. package/dist/chunk-YMAGXBLT.js +3 -0
  165. package/dist/{chunk-MZNMASFM.js → chunk-YRAGNEBZ.js} +2 -2
  166. package/dist/chunk-YXZAAQHZ.js +3 -0
  167. package/dist/chunk-Z2L5H2HF.js +3 -0
  168. package/dist/{chunk-5CR4U5X2.js → chunk-ZHK7TVAJ.js} +2 -2
  169. package/dist/chunk-ZJNV27DZ.js +4 -0
  170. package/dist/{chunk-GQLDYCWS.js → chunk-ZQ6GAIUV.js} +2 -2
  171. package/dist/{chunk-4GWN76B2.js → chunk-ZQE2QYAC.js} +2 -2
  172. package/dist/chunk-ZUQ2MDFT.js +2 -0
  173. package/dist/cli-context-4R2LREXQ.js +3 -0
  174. package/dist/cli-context-6X7JYARX.js +2 -0
  175. package/dist/cli-failure-RECEHOM2.js +3 -0
  176. package/dist/cli-program-MXA3WTAO.js +7 -0
  177. package/dist/cli.js +1 -1
  178. package/dist/{code-viewer-AMRXV444.js → code-viewer-C6HE4DFC.js} +2 -2
  179. package/dist/{code-viewer-EXI5SFFR.js → code-viewer-XHSSAMBX.js} +2 -2
  180. package/dist/{command-descriptors-ROIOTCCW.js → command-descriptors-NWW34Z54.js} +171 -171
  181. package/dist/{command-descriptors-H6A4UY72.js → command-descriptors-XHK3PK2I.js} +116 -116
  182. package/dist/{command-panels-SZONPMLJ.js → command-panels-OXMCJ2QZ.js} +2 -2
  183. package/dist/direct-navigation-236VXYBZ.js +3 -0
  184. package/dist/direct-navigation-36YSILY6.js +2 -0
  185. package/dist/index.js +1 -1
  186. package/dist/invocation-command-descriptors-35JULLNR.js +3 -0
  187. package/dist/invocation-command-descriptors-FEWSFUO2.js +2 -0
  188. package/dist/output-continuation-command-MJBVH3A5.js +2 -0
  189. package/dist/output-continuation-command-TBXIOPHQ.js +3 -0
  190. package/dist/project-reindex-5TCGOVSK.js +2 -0
  191. package/dist/project-reindex-BUNTSYKM.js +3 -0
  192. package/dist/queries/affected.js +1 -1
  193. package/dist/queries/anchors.js +1 -1
  194. package/dist/queries/architecture.js +1 -1
  195. package/dist/queries/bottlenecks.js +1 -1
  196. package/dist/queries/by-kind.js +1 -1
  197. package/dist/queries/call-graph.js +1 -1
  198. package/dist/queries/change-surface.js +1 -1
  199. package/dist/queries/cleanup-plan.js +1 -1
  200. package/dist/queries/co-change.js +1 -1
  201. package/dist/queries/code.js +1 -1
  202. package/dist/queries/complexity-hotspots.js +1 -1
  203. package/dist/queries/complexity.js +1 -1
  204. package/dist/queries/context.js +1 -1
  205. package/dist/queries/convergence.js +1 -1
  206. package/dist/queries/coupling.js +1 -1
  207. package/dist/queries/cycles.js +1 -1
  208. package/dist/queries/dataflow.js +1 -1
  209. package/dist/queries/dead.js +1 -1
  210. package/dist/queries/decorative-checkers.js +1 -1
  211. package/dist/queries/deep-chains.js +1 -1
  212. package/dist/queries/dependence-slice.js +1 -1
  213. package/dist/queries/dependency-depth.js +1 -1
  214. package/dist/queries/deps.js +1 -1
  215. package/dist/queries/diff-impact.js +1 -1
  216. package/dist/queries/doc-drift.js +1 -1
  217. package/dist/queries/drift.js +1 -1
  218. package/dist/queries/duplicate-bodies.js +1 -1
  219. package/dist/queries/entry-map.js +1 -1
  220. package/dist/queries/evidence.js +1 -1
  221. package/dist/queries/extract-candidates.js +1 -1
  222. package/dist/queries/fan.js +1 -1
  223. package/dist/queries/files.js +1 -1
  224. package/dist/queries/health.js +1 -1
  225. package/dist/queries/hierarchy.js +1 -1
  226. package/dist/queries/hotspots.js +1 -1
  227. package/dist/queries/imports.js +1 -1
  228. package/dist/queries/incomplete-migration.js +1 -1
  229. package/dist/queries/index.js +1 -1
  230. package/dist/queries/isolated.js +1 -1
  231. package/dist/queries/locality-candidates.js +1 -1
  232. package/dist/queries/members.js +1 -1
  233. package/dist/queries/methods.js +1 -1
  234. package/dist/queries/not-implemented.js +1 -1
  235. package/dist/queries/outline.js +1 -1
  236. package/dist/queries/passthrough-candidates.js +1 -1
  237. package/dist/queries/plan-context.js +1 -1
  238. package/dist/queries/react-component-duplicates.js +1 -1
  239. package/dist/queries/react-hook-candidates.js +1 -1
  240. package/dist/queries/react-large-component-pressure.js +1 -1
  241. package/dist/queries/recent-duplicates.js +1 -1
  242. package/dist/queries/redundant-reexports.js +1 -1
  243. package/dist/queries/reference-neighborhood.js +1 -1
  244. package/dist/queries/reference-reachability.js +1 -1
  245. package/dist/queries/refs.js +1 -1
  246. package/dist/queries/self-audit.js +1 -1
  247. package/dist/queries/similar-chains.js +1 -1
  248. package/dist/queries/similar-files.js +1 -1
  249. package/dist/queries/similar-signatures.js +1 -1
  250. package/dist/queries/similar.js +1 -1
  251. package/dist/queries/slice.js +1 -1
  252. package/dist/queries/source-inspection.js +1 -1
  253. package/dist/queries/source-search.js +1 -1
  254. package/dist/queries/stale-abstractions.js +1 -1
  255. package/dist/queries/surface.js +1 -1
  256. package/dist/queries/symbols.js +1 -1
  257. package/dist/queries/system-map.js +1 -1
  258. package/dist/queries/system.js +1 -1
  259. package/dist/queries/test-quality.js +1 -1
  260. package/dist/queries/trace.js +1 -1
  261. package/dist/queries/twin-ab.js +1 -1
  262. package/dist/queries/twin-drift.js +1 -1
  263. package/dist/queries/unused-imports.js +1 -1
  264. package/dist/queries/unused-params.js +1 -1
  265. package/dist/queries/value-flow.js +1 -1
  266. package/dist/queries/vue-component-duplicates.js +1 -1
  267. package/dist/queries/vue-composable-candidates.js +1 -1
  268. package/dist/queries/vue-large-view-pressure.js +1 -1
  269. package/dist/queries/wrapper-candidates.js +1 -1
  270. package/dist/reindex-worker.js +1 -1
  271. package/dist/reindex.js +30 -30
  272. package/dist/runtime.js +1 -1
  273. package/dist/rust-semantic-session-server.js +1 -1
  274. package/dist/rust-semantic-session-worker.js +1 -1
  275. package/dist/rust-semantic-worker.js +1 -1
  276. package/dist/sentinel-ensure-command-3MZCLPQY.js +2 -0
  277. package/dist/sentinel-ensure-command-LEWHIRLL.js +3 -0
  278. package/dist/sentinel-worker.js +1 -1
  279. package/dist/typescript-mailbox-worker.js +1 -1
  280. package/dist/watch-server.js +6 -6
  281. package/docs/COMMAND_REFERENCE.md +2 -2
  282. package/docs/SECURITY_MODEL.md +3 -0
  283. package/package.json +1 -1
  284. package/skills/codebaseiq/SKILL.md +15 -3
  285. package/dist/chunk-2I2UHZET.js +0 -2
  286. package/dist/chunk-5T44HG5Y.js +0 -88
  287. package/dist/chunk-5YBDBY5L.js +0 -2
  288. package/dist/chunk-6EYESTJM.js +0 -3
  289. package/dist/chunk-6FXXYYQM.js +0 -22
  290. package/dist/chunk-7UCDGXRW.js +0 -8
  291. package/dist/chunk-BIADXGC3.js +0 -22
  292. package/dist/chunk-CLPCFGRT.js +0 -3
  293. package/dist/chunk-DUKHVPU5.js +0 -4
  294. package/dist/chunk-G7GVV2TV.js +0 -27
  295. package/dist/chunk-KUKKLWJD.js +0 -3
  296. package/dist/chunk-KWRQVLPX.js +0 -3
  297. package/dist/chunk-MEUHIDI3.js +0 -7
  298. package/dist/chunk-OP6BUIV6.js +0 -2
  299. package/dist/chunk-OQ3DK7FW.js +0 -2
  300. package/dist/chunk-OT5ISJSR.js +0 -2
  301. package/dist/chunk-SX72EVMY.js +0 -3
  302. package/dist/chunk-T75DS2E6.js +0 -21
  303. package/dist/chunk-UC2FD2PS.js +0 -4
  304. package/dist/chunk-UQYQBLJX.js +0 -5
  305. package/dist/chunk-V4NGDIEA.js +0 -21
  306. package/dist/chunk-XUPFA6GH.js +0 -2
  307. package/dist/chunk-YPBKBYPS.js +0 -21
  308. package/dist/chunk-ZMA5HWXY.js +0 -3
  309. package/dist/cli-context-FJL2JHOE.js +0 -3
  310. package/dist/cli-context-PQNWHMCQ.js +0 -2
  311. package/dist/cli-program-SCHOHOQE.js +0 -7
  312. package/dist/direct-navigation-3JOYP2MO.js +0 -3
  313. package/dist/direct-navigation-SJMJLBY7.js +0 -2
  314. package/dist/invocation-command-descriptors-GMZX3UAD.js +0 -2
  315. package/dist/invocation-command-descriptors-HNMKDEF6.js +0 -3
  316. package/dist/output-continuation-command-5NWVDQT7.js +0 -2
  317. package/dist/output-continuation-command-RNEHNYPU.js +0 -3
  318. package/dist/project-reindex-MIW5CYEG.js +0 -3
  319. package/dist/project-reindex-VQ23LWDA.js +0 -2
  320. package/dist/sentinel-ensure-command-H66AZ3VE.js +0 -2
  321. package/dist/sentinel-ensure-command-R4YAUCJB.js +0 -3
@@ -1,8 +1,8 @@
1
- import{a as w}from"./chunk-ILMHV3KM.js";import{a as F,b as x,d as T,e as H,f as b,g as _,h as N}from"./chunk-LSZYMN2A.js";import{a as W,b as j}from"./chunk-JYRJYXUV.js";import{a as f}from"./chunk-6O3KXIDL.js";import{ca as B,da as q}from"./chunk-UQYQBLJX.js";import m from"process";import{existsSync as Se}from"fs";import{dirname as M,join as ve,resolve as E,sep as Le}from"path";import{fileURLToPath as ze}from"url";import{spawn as ae}from"child_process";import{platform as $}from"os";var c=class extends Error{},p=class extends Error{},v=class extends Error{constructor(r,n,i){super(`rust-analyzer LSP request ${n} failed: ${i}`);this.code=r}code},ue=3e4,le=16*1024,ce=64*1024*1024,U=64*1024,J=256*1024*1024,g=Buffer.from(`\r
1
+ import{a as w}from"./chunk-ILMHV3KM.js";import{a as F,b as x,d as T,e as H,f as b,g as _,h as N}from"./chunk-JGJKRTTB.js";import{a as W,b as j}from"./chunk-33AXWMO2.js";import{a as f}from"./chunk-OZI44VCR.js";import{ga as B,ha as q}from"./chunk-C3PPB2T5.js";import m from"process";import{existsSync as Se}from"fs";import{dirname as M,join as ve,resolve as E,sep as Le}from"path";import{fileURLToPath as ze}from"url";import{spawn as ae}from"child_process";import{platform as $}from"os";var c=class extends Error{},p=class extends Error{},v=class extends Error{constructor(r,n,i){super(`rust-analyzer LSP request ${n} failed: ${i}`);this.code=r}code},ue=3e4,le=16*1024,ce=64*1024*1024,U=64*1024,J=256*1024*1024,g=Buffer.from(`\r
2
2
  \r
3
3
  `,"ascii"),L=class{constructor(e,r={}){this.transport=e;this.requestTimeoutMs=r.requestTimeoutMs??ue,this.configuration=r.configuration??{};let n=de(r.maxHeaderBytes,r.maxMessageBytes);this.maxHeaderBytes=n.maxHeaderBytes,this.maxMessageBytes=n.maxMessageBytes,this.monotonicNow=r.monotonicNow??f,this.headerBuffer=Buffer.allocUnsafe(this.maxHeaderBytes+g.length),this.transport.onData(i=>this.handleData(i)),this.transport.onClose((i,s)=>this.failTransport(new Error(we(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,r={}){let n=e.capabilities??{},i=n.experimental&&typeof n.experimental=="object"&&!Array.isArray(n.experimental)?n.experimental:{},s=await this.request("initialize",{...e,capabilities:{...n,experimental:{...i,serverStatusNotification:!0}}},r);return this.notify("initialized",{}),s}async references(e,r={}){let n=await this.request("textDocument/references",e,r);return Array.isArray(n)?n:[]}async definition(e,r={}){let n=await this.request("textDocument/definition",e,r);return he(n)}async prepareCallHierarchy(e,r={}){let n=await this.request("textDocument/prepareCallHierarchy",e,r);return Array.isArray(n)?n:[]}async outgoingCalls(e,r={}){let n=await this.request("callHierarchy/outgoingCalls",{item:e},r);return Array.isArray(n)?n:[]}async hover(e,r={}){let n=await this.request("textDocument/hover",e,r);return n&&typeof n=="object"?n:null}async readinessBarrier(e={}){try{await this.request("codebaseiq/readinessBarrier",null,e)}catch(r){if(r instanceof v&&r.code===-32601)return;throw r}}serverStatusGeneration(){return this.currentServerStatusGeneration}serverStatusSnapshot(){let e=this.latestServerStatus;return e?{generation:e.generation,status:{...e.status}}:null}waitForQuiescence(e,r){if(this.transportFailure)return Promise.reject(this.transportFailure);let n=this.latestServerStatus;if(n&&n.generation>e){if(n.status.health==="error")return Promise.reject(G());if(n.status.quiescent)return Promise.resolve(n.status)}return new Promise((i,s)=>{let o={afterGeneration:e,resolve:i,reject:s,timeout:setTimeout(()=>{this.readinessWaiters.delete(o),s(new Error(`rust-analyzer readiness timed out after ${r}ms`))},r)};this.readinessWaiters.add(o)})}didOpenTextDocument(e){this.notify("textDocument/didOpen",{textDocument:e})}waitForDiagnostics(e,r){return this.transportFailure?Promise.resolve(!1):this.diagnosedUris.has(e)?Promise.resolve(!0):new Promise(n=>{let i=u=>{clearTimeout(s),n(u)},s=setTimeout(()=>{let u=this.diagnosticWaiters.get(e)?.filter(l=>l!==i);u&&u.length>0?this.diagnosticWaiters.set(e,u):this.diagnosticWaiters.delete(e),n(!1)},r),o=this.diagnosticWaiters.get(e)??[];o.push(i),this.diagnosticWaiters.set(e,o)})}async shutdown(e={}){if(!this.shutdownStarted){this.shutdownStarted=!0;try{await this.request("shutdown",null,e),this.notify("exit",null)}catch(r){throw this.notify("exit",null),this.killTransportOnce(),r}}}async shutdownAndReap(e={}){let r;try{await this.shutdown(e)}catch(n){r=n}try{await this.killTransportOnce()}catch(n){throw new Error(`rust-analyzer process-tree cleanup failed: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(r)throw r}request(e,r,n={}){if(this.transportFailure)return Promise.reject(this.transportFailure);let i=z(n.timeoutMs??this.requestTimeoutMs,n.deadlineMs,this.monotonicNow),s=this.nextId++,o={jsonrpc:"2.0",id:s,method:e,params:r};return new Promise((u,l)=>{let d=setTimeout(()=>{let y=i.deadlineLimited?new c(`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,y)},i.timeoutMs);this.pending.set(s,{method:e,deadlineMs:n.deadlineMs,resolve:y=>u(y),reject:l,timeout:d}),this.transport.write(S(o))})}notify(e,r){this.transportFailure||this.transport.write(S({jsonrpc:"2.0",method:e,params:r}))}handleData(e){if(this.transportFailure||e.length===0)return;let r=0;for(;r<e.length&&!this.transportFailure;){if(this.bodyBuffer){let o=Math.min(e.length-r,this.bodyBuffer.length-this.bodyLength);if(e.copy(this.bodyBuffer,this.bodyLength,r,r+o),r+=o,this.bodyLength+=o,this.bodyLength===this.bodyBuffer.length){let u=this.bodyBuffer.toString("utf8");this.bodyBuffer=null,this.bodyLength=0;let l;try{l=Re(u)}catch{this.failProtocol("rust-analyzer LSP response body was not a valid JSON object");continue}try{this.dispatchMessage(l)}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[r++],!this.headerDelimiterComplete())continue;let n=this.headerLength-g.length;if(n>this.maxHeaderBytes){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}let i=this.headerBuffer.subarray(0,n).toString("ascii");this.headerLength=0;let s;try{s=fe(i,this.maxMessageBytes)}catch(o){this.failProtocol(o instanceof Error?o.message:String(o));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<g.length)return!1;let e=this.headerLength-g.length;return this.headerBuffer.subarray(e,this.headerLength).equals(g)}failProtocol(e){this.failTransport(new p(e),!0)}failTransport(e,r){this.transportFailure||(this.transportFailure=e,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0,r&&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,r){let n=this.pending.get(e);if(!n)return;this.pending.delete(e);try{this.transport.write(S({jsonrpc:"2.0",method:"$/cancelRequest",params:{id:e}}))}catch{}this.transportFailure||(this.transportFailure=r,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0);let i=r;try{await this.killTransportOnce()}catch(s){i=new Error(`${r.message}; rust-analyzer cleanup failed: ${s instanceof Error?s.message:String(s)}`,{cause:s})}n.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 r=this.pending.get(e.id);if(r){if(clearTimeout(r.timeout),this.pending.delete(e.id),e.error){r.reject(new v(e.error.code,r.method,e.error.message));return}if(r.deadlineMs!==void 0&&this.monotonicNow()>=r.deadlineMs){r.reject(new c(`rust-analyzer readiness deadline expired during LSP request ${r.method}`));return}r.resolve(e.result)}}recordDiagnosticNotification(e){if(e.method!=="textDocument/publishDiagnostics")return;let r=e.params,n=r&&typeof r=="object"&&typeof r.uri=="string"?r.uri:null;if(!n)return;this.diagnosedUris.add(n);let i=this.diagnosticWaiters.get(n)??[];this.diagnosticWaiters.delete(n),i.forEach(s=>s(!0))}recordServerStatusNotification(e){if(e.method!=="experimental/serverStatus"||e.id!==void 0||!me(e.params))return;let r=e.params,n={health:r.health,quiescent:r.quiescent,...typeof r.message=="string"?{message:r.message}:{}},i=++this.currentServerStatusGeneration;if(this.latestServerStatus={generation:i,status:n},n.health==="error"){this.rejectReadinessWaiters(G());return}if(n.quiescent)for(let s of this.readinessWaiters)i<=s.afterGeneration||(clearTimeout(s.timeout),this.readinessWaiters.delete(s),s.resolve(n))}respondToServerRequest(e){if(e.id===void 0||e.id===null||!e.method)return;let r=e.method==="workspace/configuration"?this.workspaceConfiguration(e.params):null;this.transport.write(S({jsonrpc:"2.0",id:e.id,result:r}))}workspaceConfiguration(e){return(e&&typeof e=="object"&&Array.isArray(e.items)?e.items:[]).map(n=>typeof n.section=="string"?pe(this.configuration,n.section):this.configuration)}rejectPending(e){for(let[r,n]of this.pending)clearTimeout(n.timeout),n.reject(e),this.pending.delete(r);this.rejectReadinessWaiters(e)}resolveDiagnosticWaiters(e){for(let r of this.diagnosticWaiters.values())r.forEach(n=>n(e));this.diagnosticWaiters.clear()}rejectReadinessWaiters(e){for(let r of this.readinessWaiters)clearTimeout(r.timeout),r.reject(e),this.readinessWaiters.delete(r)}};function de(t=le,e=ce){if(!Number.isSafeInteger(t)||t<=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(t>U)throw new RangeError(`maxHeaderBytes cannot exceed ${U} bytes for rust-analyzer LSP.`);if(t+g.length+e>J)throw new RangeError(`Combined rust-analyzer LSP header and message limits cannot exceed ${J} bytes.`);return{maxHeaderBytes:t,maxMessageBytes:e}}function fe(t,e){let r=[];for(let s of t.split(`\r
4
4
  `)){let o=s.indexOf(":");o<0||s.slice(0,o).trim().toLowerCase()!=="content-length"||r.push(s.slice(o+1).trim())}if(r.length===0)throw new p("rust-analyzer LSP response missing Content-Length header");if(r.length>1){let s=new Set(r).size>1?"rust-analyzer LSP response has conflicting Content-Length headers":"rust-analyzer LSP response has duplicate Content-Length headers";throw new p(s)}let n=r[0];if(!/^\d+$/.test(n))throw new p("rust-analyzer LSP Content-Length must be a non-negative safe integer");let i=Number(n);if(!Number.isSafeInteger(i))throw new p("rust-analyzer LSP Content-Length must be a non-negative safe integer");if(i>e)throw new p(`rust-analyzer LSP Content-Length exceeds ${e} byte message limit`);return i}function z(t,e,r=f){if(e===void 0)return{timeoutMs:t,deadlineLimited:!1};let n=e-r();if(n<=0)throw new c("rust-analyzer readiness deadline expired before LSP operation");return{timeoutMs:Math.min(t,n),deadlineLimited:n<=t}}function me(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;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 G(){return new c("rust-analyzer reported error health before reaching readiness")}function pe(t,e){let r=e.startsWith("rust-analyzer.")?e.slice(14):e;if(r===""||r==="rust-analyzer")return t;let n=t;for(let i of r.split(".")){if(!n||typeof n!="object")return null;n=n[i]}return n??null}function he(t){return t?(Array.isArray(t)?t:[t]).flatMap(r=>ye(r)?[r]:ge(r)?[{uri:r.targetUri,range:r.targetSelectionRange}]:[]):[]}function ye(t){return!!(t&&typeof t=="object"&&typeof t.uri=="string")}function ge(t){return!!(t&&typeof t=="object"&&typeof t.targetUri=="string")}function K(t,e,r=process.env,n){let i=ae(t,[],{cwd:e,env:r,detached:$()!=="win32",stdio:["pipe","pipe","pipe"],windowsHide:!0}),s=i.pid===void 0?null:W(i.pid,$()!=="win32"),o=s?F(n,s):null,u=null;return i.on("close",()=>x(o)),{write(l){i.stdin.write(l)},onData(l){i.stdout.on("data",l)},onClose(l){i.on("close",l)},onError(l){i.on("error",l)},kill(){if(!s){i.kill();return}return u??=j(s,{gracefulMs:1e3,forceMs:1e3}).then(l=>{if(!l.reaped)throw new Error(l.detail??`rust-analyzer process tree ${s.rootPid} was not reaped.`);x(o)}),u}}}function S(t){let e=JSON.stringify(t);return`Content-Length: ${Buffer.byteLength(e,"utf8")}\r
5
5
  \r
6
6
  ${e}`}function Re(t){let e=JSON.parse(t);if(!e||typeof e!="object")throw new Error("rust-analyzer LSP response was not a JSON object");return e}function we(t,e){return`rust-analyzer LSP transport closed${e?` by ${e}`:t===null?"":` with code ${t}`}`}async function Q(t,e,r,n=f){let i=r-n();if(i<=0)throw new c("rust-analyzer readiness deadline expired before quiescence");try{let s=await t.waitForQuiescence(e,i);if(P(r,n,"during quiescence"),s.health==="error")throw new c("rust-analyzer reported error health before reaching readiness");if(!s.quiescent)throw new c("rust-analyzer did not report quiescence before reaching readiness");return s}catch(s){throw s instanceof c?s:new c(s instanceof Error?s.message:String(s))}}async function tt(t,e,r,n,i,s=f,o=D){let u=await Q(t,e,n,s);if(r===0)return u;let l=t.serverStatusSnapshot();if(!l)throw new c("rust-analyzer status is unavailable after initial document open");return await be(t,l,r,n,i,s,o)??u}async function be(t,e,r,n,i,s=f,o=D){if(r===0)return null;if(!e)throw new c("rust-analyzer status is unavailable before document open");Y(e.status,"before document open");try{await t.readinessBarrier({deadlineMs:n}),P(n,s,"during post-open synchronization")}catch(d){throw d instanceof c?d:new c(d instanceof Error?d.message:String(d))}let u=t.serverStatusSnapshot();if(!u||u.generation<e.generation)throw new c("rust-analyzer status is unavailable after document open");let l;return u.generation===e.generation?(Y(u.status,"after document open"),l=u.status):l=await Q(t,e.generation,n,s),await C(i,n,s,o),l}async function rt(t,e,r,n=f){let i=z(e,r,n);await t(i.timeoutMs),P(r,n,"during diagnostics")}async function C(t,e,r=f,n=D){if(t<=0)return;if(z(t,e,r).deadlineLimited)throw new c("rust-analyzer readiness deadline cannot accommodate delay");await n(t),P(e,r,"during delay")}async function nt(t,e){try{return await t()}catch(r){throw r instanceof c&&await e(),r}}function it(t){return t instanceof c?{ok:!1,error:t.message}:null}function P(t,e,r){if(t-e()<=0)throw new c(`rust-analyzer readiness deadline expired ${r}`)}function Y(t,e){if(t.health==="error")throw new c(`rust-analyzer reported error health ${e}`);if(!t.quiescent)throw new c(`rust-analyzer did not report quiescence ${e}`)}function D(t){return new Promise(e=>setTimeout(e,t))}async function Pe(t){let e=t.includeReferences!==!1,r=t.includeCallees===!0,n=t.includeSignatures===!0,i={timeoutMs:t.requestTimeoutMs},s=Ae(t),o=X(t),u=V(t),l=ee(t),d=Oe(t.projectRoot,s),y=Ie(t.projectRoot,d),k=ke(d),h=new L(K(t.rustAnalyzerBinary,y),{requestTimeoutMs:t.requestTimeoutMs,configuration:k});try{let A=await h.initialize({processId:m.pid,rootUri:T(y,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:k});if(e&&!A.capabilities.referencesProvider)return{available:!1,reason:"rust-analyzer initialized without textDocument/references support.",references:o.map(a=>[a.symbolId,[]]),...r?{callees:u.map(a=>[a.symbolId,[]])}:{}};if(r&&!A.capabilities.callHierarchyProvider)return{available:!1,reason:"rust-analyzer initialized without call hierarchy support.",references:o.map(a=>[a.symbolId,[]]),callees:u.map(a=>[a.symbolId,[]]),...n?{signatures:l.map(a=>[a.symbolId,null])}:{}};if(n&&!A.capabilities.hoverProvider)return{available:!1,reason:"rust-analyzer initialized without hover support.",references:o.map(a=>[a.symbolId,[]]),...r?{callees:u.map(a=>[a.symbolId,[]])}:{},signatures:l.map(a=>[a.symbolId,null])};let ie=Be(h,t.projectRoot,s);await qe(h,ie,t.diagnosticsTimeoutMs??1e4),await ne(t.settleDelayMs??5e3);let I=e?await w(o,t.concurrency??8,async a=>{let O=await te(h,b(t.projectRoot,a,!1),{requestTimeoutMs:t.requestTimeoutMs,retryTimeoutMs:t.referenceRetryTimeoutMs});return{symbolId:a.symbolId,references:N(_(t.projectRoot,O.locations)),complete:O.complete}}):o.map(a=>({symbolId:a.symbolId,references:[],complete:!0})),se=r?await w(u,t.concurrency??8,async a=>({symbolId:a.symbolId,callees:await je(h,t.projectRoot,a,i)})):[],oe=n?await w(l,t.concurrency??8,async a=>({symbolId:a.symbolId,signature:await xe(h,t.projectRoot,a,i)})):[];return{available:!0,references:I.filter(a=>a.complete).map(a=>[a.symbolId,a.references]),incompleteReferenceSymbolIds:I.filter(a=>!a.complete).map(a=>a.symbolId),...r?{callees:se.map(a=>[a.symbolId,a.callees])}:{},...n?{signatures:oe.map(a=>[a.symbolId,a.signature])}:{}}}finally{await h.shutdown().catch(()=>{})}}function X(t){return t.referenceDefinitions??t.definitions}function V(t){return t.calleeDefinitions??t.definitions}function ee(t){return t.signatureDefinitions??t.definitions}function Ae(t){return[...t.includeReferences!==!1?X(t):[],...t.includeCallees===!0?V(t):[],...t.includeSignatures===!0?ee(t):[]]}async function xe(t,e,r,n={}){let i=b(e,r,!1),s=await Te(t,{textDocument:i.textDocument,position:i.position},n);return Ce(s)}async function Te(t,e,r={}){try{return await t.hover(e,r)}catch(n){if(R(n),!(n instanceof Error?n.message:String(n)).includes("content modified"))return null;await re(r.deadlineMs);try{return await t.hover(e,r)}catch(s){return R(s),null}}}function Ce(t){if(!t)return null;let e=De(t.contents),r=/```(?:rust)?\s*([\s\S]*?)```/i.exec(e),n=r?r[1]:e;for(let i of n.split(/\r?\n/)){let s=i.replace(/^`+|`+$/g,"").trim();if(s&&Ee(s))return s}return null}function De(t){return typeof t=="string"?t:Array.isArray(t)?t.map(Me).join(`
7
7
  `):"value"in t?t.value:""}function Me(t){return typeof t=="string"?t:t.value}function Ee(t){return/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?(?:unsafe\s+)?(?:extern\s+(?:"[^"]+"\s+)?)?(?:fn|struct|enum|trait|type|const|static|mod)\b/.test(t)}function ke(t){return{...t.length>0?{linkedProjects:t}:{},references:{excludeImports:!1,excludeTests:!1}}}function Ie(t,e){return e.length===1?M(e[0]):E(t)}function Oe(t,e){let r=E(t),n=[],i=new Set;for(let s of e){let o=M(E(r,s.relativePath));for(;$e(r,o);){let u=ve(o,"Cargo.toml");if(Se(u)){i.has(u)||(i.add(u),n.push(u));break}let l=M(o);if(l===o)break;o=l}}return n}function Be(t,e,r){let n=new Set,i=[];for(let s of r)if(!n.has(s.relativePath)){n.add(s.relativePath);try{let o=T(e,s.relativePath);t.didOpenTextDocument({uri:o,languageId:"rust",version:1,text:B(e,s.relativePath,{inputKind:"indexed Rust source file"})}),i.push(o)}catch(o){if(!q(o))throw o}}return i}async function qe(t,e,r){await Promise.all(e.map(n=>t.waitForDiagnostics(n,r).catch(()=>!1)))}async function ht(t,e){return(await te(t,e)).locations}async function te(t,e,r={}){try{return{locations:await t.references(e,{timeoutMs:r.requestTimeoutMs,deadlineMs:r.deadlineMs}),complete:!0}}catch(n){R(n);let i=n instanceof Error?n.message:String(n);if(Z(n))return{locations:[],complete:!1};if(!i.includes("content modified"))return{locations:[],complete:!0};await re(r.deadlineMs);try{return{locations:await t.references(e,We(r)),complete:!0}}catch(s){return R(s),{locations:[],complete:!Z(s)}}}}function We(t){return{...t.retryTimeoutMs&&t.retryTimeoutMs>0?{timeoutMs:t.retryTimeoutMs}:{},...t.deadlineMs!==void 0?{deadlineMs:t.deadlineMs}:{}}}function Z(t){let e=t instanceof Error?t.message:String(t);return e.includes("rust-analyzer LSP request")&&e.includes("timed out after")}async function je(t,e,r,n={}){let i=b(e,r,!1),s=await Fe(t,{textDocument:i.textDocument,position:i.position},n),o=(await Promise.all(s.map(u=>He(t,u,n)))).flat();return Ne(_e(e,o))}async function Fe(t,e,r={}){try{return await t.prepareCallHierarchy(e,r)}catch(n){return R(n),[]}}async function He(t,e,r={}){try{return await t.outgoingCalls(e,r)}catch(n){return R(n),[]}}async function re(t){if(t===void 0){await ne(1e3);return}await C(1e3,t)}function R(t){if(t instanceof c)throw t}function _e(t,e){return e.map(r=>({symbol:r.to.name,file:H(t,r.to.uri),line:r.to.selectionRange.start.line,...r.fromRanges[0]===void 0?{}:{callsiteLine:r.fromRanges[0].start.line}}))}function Ne(t){let e=new Set,r=[];for(let n of t){let i=`${n.symbol}\0${n.file}\0${n.line}\0${n.callsiteLine??""}`;e.has(i)||(e.add(i),r.push(n))}return r.sort((n,i)=>n.file.localeCompare(i.file)||n.line-i.line||n.symbol.localeCompare(i.symbol))}function ne(t){return t<=0?Promise.resolve():new Promise(e=>setTimeout(e,t))}function $e(t,e){return e===t||e.startsWith(`${t}${Le}`)}async function Ue(){return new Promise((t,e)=>{let r=[];m.stdin.on("data",n=>r.push(n)),m.stdin.on("error",e),m.stdin.on("end",()=>t(Buffer.concat(r).toString("utf8")))})}async function Je(){try{let t=JSON.parse(await Ue()),e=await Pe(t);m.stdout.write(JSON.stringify(e))}catch(t){let e={available:!1,reason:t instanceof Error?t.message:String(t),references:[]};m.stdout.write(JSON.stringify(e)),m.exitCode=1}}m.argv[1]&&ze(import.meta.url)===m.argv[1]&&Je();export{L as a,K as b,tt as c,be as d,rt as e,nt as f,it as g,Pe as h,X as i,V as j,ee as k,Ae as l,xe as m,Te as n,Ce as o,ke as p,Ie as q,Oe as r,Be as s,qe as t,ht as u,te as v,je as w,ne as x};
8
- //# sourceMappingURL=chunk-W7QDASTN.js.map
8
+ //# sourceMappingURL=chunk-VEPK6M5C.js.map
@@ -1,3 +1,3 @@
1
- import{a as D}from"./chunk-U7NUXDQO.js";import{c as C}from"./chunk-BPKNP3KZ.js";import{a as I}from"./chunk-57OPIQFM.js";import{e as P}from"./chunk-MSI3K7PJ.js";import{b as F}from"./chunk-SGMNWYTH.js";import{f as M,g as S}from"./chunk-NDKOVQFG.js";import{d as g}from"./chunk-GVAF222T.js";function oe(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||$(s).includes(l)).sort(G)}function re(e,n,o={}){let t=F(e,n);if(!t.match)return{kind:"missing",query:n};if(t.total>1)return{kind:"ambiguous",query:n,total:t.total,candidates:[{symbol:t.match.symbol,shortName:g(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let r=new C(e),l=r.definitionsForFile(t.match.relativePath).find(a=>a.symbol===t.match.symbol);if(!l?.isFunctionLike)return{kind:"not-entry",query:n,symbol:t.match.symbol,shortName:g(t.match.symbol),file:t.match.relativePath,reason:"The resolved symbol is not a callable definition."};let s=L(e,[l]),f=j(e,l,s.get(l.symbolId)??[]);if(!f)return{kind:"not-entry",query:n,symbol:l.symbol,shortName:g(l.symbol),file:l.relativePath,reason:"The callable is neither an external root nor an uncalled callable on a detected entry surface."};let m=K(e,r,l),i=new Set(o.expand??[]),c=z(m,i),d=new Set(c.regions.filter(a=>a.expanded).map(a=>a.id)),p=[...i].filter(a=>!d.has(a)).sort();return{kind:"matched",query:n,entry:f.result,regions:c.regions,regionEdges:c.regionEdges,unmatchedExpansions:p,coverage:{completeWithinIndexedStaticCallEdges:!0,completeWithinSelectedStaticEvidence:!0,candidateReachabilityIncluded:m.edges.some(a=>a.evidenceStrength==="candidate"),dynamicDispatchRepresented:!1,symbolCount:m.symbols.length,symbolEdgeCount:m.edges.length,exactSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="exact").length,candidateSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="candidate").length,regionCount:c.regions.length,regionEdgeCount:c.regionEdges.length,externalCallCount:m.externalCalls.length}}}function L(e,n){let o=n.filter(t=>B(e,t.relativePath)||S(e,t.symbol,t.relativePath).length>0);return P(e,o,{semantic:!1,semanticEvidence:I})}function j(e,n,o){let t=T(e,n),r=t.length>0,l=B(e,n.relativePath)&&o.length===0;if(!r&&!l)return null;let s=[...t];return l&&s.push("entry-surface-without-indexed-caller"),{definition:n,result:{symbol:n.symbol,shortName:g(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,documentation:n.documentation,confidence:r?"root":"candidate",evidence:s,indexedCallerCount:o.length}}}function B(e,n){return M(e,n)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(n)}function T(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function $(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
1
+ import{a as D}from"./chunk-K3PFL5QQ.js";import{c as C}from"./chunk-UHFZDQZJ.js";import{a as I}from"./chunk-ETZBIG6K.js";import{e as P}from"./chunk-2QJAVISG.js";import{b as F}from"./chunk-DOQLO74K.js";import{f as M,g as S}from"./chunk-GLXEWYQY.js";import{d as g}from"./chunk-TNLOX4TN.js";function oe(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||$(s).includes(l)).sort(G)}function re(e,n,o={}){let t=F(e,n);if(!t.match)return{kind:"missing",query:n};if(t.total>1)return{kind:"ambiguous",query:n,total:t.total,candidates:[{symbol:t.match.symbol,shortName:g(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let r=new C(e),l=r.definitionsForFile(t.match.relativePath).find(a=>a.symbol===t.match.symbol);if(!l?.isFunctionLike)return{kind:"not-entry",query:n,symbol:t.match.symbol,shortName:g(t.match.symbol),file:t.match.relativePath,reason:"The resolved symbol is not a callable definition."};let s=L(e,[l]),f=j(e,l,s.get(l.symbolId)??[]);if(!f)return{kind:"not-entry",query:n,symbol:l.symbol,shortName:g(l.symbol),file:l.relativePath,reason:"The callable is neither an external root nor an uncalled callable on a detected entry surface."};let m=K(e,r,l),i=new Set(o.expand??[]),c=z(m,i),d=new Set(c.regions.filter(a=>a.expanded).map(a=>a.id)),p=[...i].filter(a=>!d.has(a)).sort();return{kind:"matched",query:n,entry:f.result,regions:c.regions,regionEdges:c.regionEdges,unmatchedExpansions:p,coverage:{completeWithinIndexedStaticCallEdges:!0,completeWithinSelectedStaticEvidence:!0,candidateReachabilityIncluded:m.edges.some(a=>a.evidenceStrength==="candidate"),dynamicDispatchRepresented:!1,symbolCount:m.symbols.length,symbolEdgeCount:m.edges.length,exactSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="exact").length,candidateSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="candidate").length,regionCount:c.regions.length,regionEdgeCount:c.regionEdges.length,externalCallCount:m.externalCalls.length}}}function L(e,n){let o=n.filter(t=>B(e,t.relativePath)||S(e,t.symbol,t.relativePath).length>0);return P(e,o,{semantic:!1,semanticEvidence:I})}function j(e,n,o){let t=T(e,n),r=t.length>0,l=B(e,n.relativePath)&&o.length===0;if(!r&&!l)return null;let s=[...t];return l&&s.push("entry-surface-without-indexed-caller"),{definition:n,result:{symbol:n.symbol,shortName:g(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,documentation:n.documentation,confidence:r?"root":"candidate",evidence:s,indexedCallerCount:o.length}}}function B(e,n){return M(e,n)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(n)}function T(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function $(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
2
2
  `).toLocaleLowerCase()}function G(e,n){return N(e.confidence)-N(n.confidence)||e.file.localeCompare(n.file)||e.startLine-n.startLine||e.symbol.localeCompare(n.symbol)}function N(e){return e==="root"?0:1}function K(e,n,o){let t=new Map([[o.symbol,0]]),r=new Map,l=new Map([[o.symbol,o]]),s=new Map,f=new Map,m=[o];for(;m.length>0;){let i=n.calleeMap(m,{additive:!1,semantic:!1}),c=[];for(let d of m){let p=t.get(d.symbol)??0;r.set(d.symbol,k(d,p));for(let a of i.get(d.symbolId)??[]){let y=W(n,a,l);if(!y){let R=O(d,a);f.set(J(R),R);continue}let u=p+1,h=t.get(y.symbol);(h===void 0||u<h)&&t.set(y.symbol,u),r.set(y.symbol,k(y,Math.min(u,h??u)));let v=q(d,y,a);s.set(H(v),v),h===void 0&&c.push(y)}}m=c}return{symbols:[...r.values()].sort(Q),edges:[...s.values()].sort(U),externalCalls:[...f.values()].sort(V)}}function W(e,n,o){let t=o.get(n.symbol);if(t)return t;let r=e.definitionsForFile(n.file).find(l=>l.symbol===n.symbol)??null;return r&&o.set(r.symbol,r),r}function k(e,n){return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,depth:n}}function q(e,n,o){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),toFile:n.relativePath,source:o.source,evidenceStrength:o.source==="scip-chunk"?"candidate":"exact"}}function O(e,n){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),reportedFile:n.file,source:n.source,evidenceStrength:n.source==="scip-chunk"?"candidate":"exact"}}function z(e,n){let o=b(e.symbols,i=>i.file),t=b(e.edges.filter(i=>i.fromFile===i.toFile),i=>i.fromFile),r=b(e.externalCalls,i=>i.fromFile),l=A(e.edges.filter(i=>i.fromFile!==i.toFile)),s=b(l,i=>i.toRegionId),f=b(l,i=>i.fromRegionId);return{regions:[...o.entries()].map(([i,c])=>{let d=x(i),p=n.has(d),a=t.get(i)??[],y=r.get(i)??[];return{id:d,file:i,minDepth:Math.min(...c.map(u=>u.depth)),symbolCount:c.length,internalEdgeCount:a.length,externalCallCount:y.length,incomingRegionIds:E((s.get(d)??[]).map(u=>u.fromRegionId)),outgoingRegionIds:E((f.get(d)??[]).map(u=>u.toRegionId)),expanded:p,symbols:p?c:[],internalEdges:p?a:[],externalCalls:p?y:[]}}).sort((i,c)=>i.minDepth-c.minDepth||i.file.localeCompare(c.file)),regionEdges:l}}function A(e){let n=new Map;for(let o of e){let t=`${o.fromFile}\0${o.toFile}`,r=n.get(t)??[];r.push(o),n.set(t,r)}return[...n.values()].map(o=>{let t=o[0];return{fromRegionId:x(t.fromFile),fromFile:t.fromFile,toRegionId:x(t.toFile),toFile:t.toFile,callCount:o.length,exactCallCount:o.filter(r=>r.evidenceStrength==="exact").length,candidateCallCount:o.filter(r=>r.evidenceStrength==="candidate").length,fromSymbols:E(o.map(r=>r.fromShortName)),toSymbols:E(o.map(r=>r.toShortName)),evidence:E(o.map(r=>r.source))}}).sort((o,t)=>o.fromFile.localeCompare(t.fromFile)||o.toFile.localeCompare(t.toFile))}function b(e,n){let o=new Map;for(let t of e){let r=n(t),l=o.get(r)??[];l.push(t),o.set(r,l)}return o}function x(e){return`file:${e}`}function E(e){return[...new Set(e)].sort()}function H(e){return`${e.fromSymbol}\0${e.toSymbol}`}function J(e){return`${e.fromSymbol}\0${e.toSymbol}`}function Q(e,n){return e.depth-n.depth||e.file.localeCompare(n.file)||e.symbol.localeCompare(n.symbol)}function U(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}function V(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}export{oe as a,re as b};
3
- //# sourceMappingURL=chunk-XJBK3QDV.js.map
3
+ //# sourceMappingURL=chunk-VPCHKZ3I.js.map
@@ -1,6 +1,6 @@
1
- import{a as le}from"./chunk-KFTHI2R6.js";import{a as re}from"./chunk-UW6KD57C.js";import{b as _}from"./chunk-AGGR2BKS.js";import{a as se}from"./chunk-2E6OUPCF.js";import{b as ie}from"./chunk-ELYMY5S2.js";import{a as ne,b as oe}from"./chunk-W7YLRXZE.js";import{b as ee}from"./chunk-F5CJO5JN.js";import{f as te}from"./chunk-2OMXFE64.js";import{a as X}from"./chunk-SB53KPWA.js";import{a as Z}from"./chunk-DWBAESVW.js";import{b as Q}from"./chunk-OQUCBKOI.js";import{a as J}from"./chunk-CCIYWXX6.js";import{d as V}from"./chunk-VGWZ4MOY.js";import{b as Y}from"./chunk-LMTSB3TB.js";import{a as W}from"./chunk-UMEPSVKT.js";import{a as D}from"./chunk-SUE7SHZL.js";import{b as q}from"./chunk-SA7G6GJX.js";import{a as H,c as K}from"./chunk-SGMNWYTH.js";import{a as G}from"./chunk-BRQL7AFJ.js";import{e as P,t as w}from"./chunk-GVAF222T.js";import{d as z}from"./chunk-3LCDIREB.js";function ae(e){let t=new Set(e.filter(o=>o.definition?.isFunctionLike).map(o=>`${o.role}:${o.definition.relativePath}`));return e.flatMap(o=>o.definition?!o.definition.isFunctionLike&&t.has(`${o.role}:${o.definition.relativePath}`)?[]:[{definition:o.definition,role:o.role}]:[])}var pe=6,I=10,B=3,N=8,he=.7,ce=24,M=200,ye=12,ue=80,me=600;function Ve(e,t,o={}){let l=o.impactDepth??3,m=o.sliceDepth??3,u=o.semantic,c=Ee(t)?be(e,t):null,a=c?c.primary?.symbol??null:t,s=a!==null,d=s?f("trace",a,()=>ie(e,a,{semantic:u,referenceContext:ye}),i=>({definitions:i.definitions.length,references:i.referencedBy.length})):{definitions:[],referencedBy:[],claimSupport:null},g=s?f("call-graph",a,()=>X(e,a,{semantic:u}),i=>({callers:i?.callers.length??0,callees:i?.callees.length??0})):null,n=s?f("complexity",a,()=>W(e,a,{semantic:u}),i=>({callees:i?.calleeCount??0})):null,y=s?f("dataflow",a,()=>ee(e,a,{semantic:u}),i=>({references:i?.usageSites.length??0,producers:i?.producers.length??0,consumers:i?.consumers.length??0})):null,r=s?f("backward-slice",a,()=>_(e,a,{direction:"backward",maxDepth:m,semantic:u}),i=>({maxDepth:m,connectedSymbols:i?.connectedSymbols.length??0})):null,C=s?f("forward-slice",a,()=>_(e,a,{direction:"forward",maxDepth:m,semantic:u}),i=>({maxDepth:m,connectedSymbols:i?.connectedSymbols.length??0})):null,h=s?f("affected",a,()=>q(e,a,{maxDepth:l,scope:o.scope}),i=>({maxDepth:l,affectedSymbols:i.rows.length,coverage:i.coverage.status})):null,b=h?.rows??[],p=h?.coverage??null,S=s?f("reuse-candidates",a,()=>D(e,a,{minSimilarity:.4,limit:5,semantic:u,sourceCandidateMode:"target-pruned"}),i=>({candidates:i.length,direct:i.filter(Ce=>Ce.actionTier==="direct").length})):[],L=s?H(e,a)?.symbol??null:null,k=s?f("affected-consumer-reuse",a,()=>Re(d,L,i=>D(e,i,{minSimilarity:.4,limit:I,semantic:u,sourceCandidateMode:"target-pruned"}),{consumerLimit:pe,perConsumerSearchLimit:I,perConsumerCandidateLimit:B,candidateLimit:N}),i=>({totalConsumers:i.coverage.totalConsumers,analyzedConsumers:i.coverage.analyzedConsumers,candidates:i.candidates.length})):ve(),A=f("change-surface",t,()=>Z(e,t,{semantic:u}),i=>({symbols:i?.symbols.length??0,externalConsumers:i?.totalExternalConsumers??0})),R=f("system",t,()=>re(e,t),i=>({files:i.files.length,symbols:i.symbols.length})),T=R.files.length===1,F=f("deps",t,()=>T?R.dependsOn.map(i=>({relativePath:i,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):ne(e,t),i=>({files:i.length,reusedSystem:T})),O=f("rdeps",t,()=>T?R.dependedOnBy.map(i=>({relativePath:i,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):oe(e,t),i=>({files:i.length,reusedSystem:T})),U=f("surface",t,()=>le(e,t),i=>({consumers:i.length})),v={symbol:d.definitions.length>0||d.referencedBy.length>0||g!==null||n!==null||y!==null||r!==null||C!==null||b.length>0,file:A!==null||F.length>0||O.length>0,module:R.files.length>0||R.symbols.length>0||U.length>0},x=[];c&&!c.primary&&c.callableCount>1&&x.push(`File target has ${c.callableCount} callable symbols; use one callable name for compiler-resolved flow.`);let $=[...new Set(d.referencedBy.map(i=>i.relativePath))];$.length>0&&$.every(i=>G(i)==="test")&&x.push("Only test references were found for this target. For replacement or retirement work, map the currently wired owner or one production entry point before planning; this target does not describe the live affected surface."),!v.symbol&&!v.file&&!v.module&&x.push("No symbol, file, or module matched target."),p&&p.status!=="accounted"&&x.push(`Possible-impact coverage is ${p.status}: ${p.reasons.join(" ")}`);let j=A?.file??d.definitions[0]?.relativePath??null;return{target:t,...c?.primary?{primaryCallable:{symbol:c.primary.symbol,shortName:P(c.primary.symbol),file:c.primary.relativePath}}:{},matched:v,history:f("history",j??t,()=>Pe(e,j,o.gitHead)),trace:ge(d),callGraph:g,complexity:n,dataflow:y,backwardSlice:r,forwardSlice:C,affected:b,affectedCoverage:p,changeSurface:A,deps:F,rdeps:O,system:R,surface:U,reuseCandidates:S,affectedConsumerReuse:k,sourcePacket:Se(e,L,d,k,S),warnings:x}}function ge(e){return{definitions:e.definitions,referencedBy:e.referencedBy.map(t=>({relativePath:t.relativePath,line:t.line,enclosingSymbol:t.enclosingSymbol,enclosingShort:t.enclosingShort}))}}function be(e,t){let o=Y(e,t);if(o.length!==1)return{primary:null,callableCount:0};let l=w(e,o[0]).filter(c=>c.isFunctionLike),m=l.filter(c=>c.enclosingSymbol===null),u=m.length>0?m:l;return{primary:u.length===1?u[0]:null,callableCount:u.length}}function Se(e,t,o,l,m){let u=[...t?[{definition:fe(e,t),role:"target"}]:[],...[...l.candidates.map(n=>n.candidate),...m].map(n=>({definition:fe(e,n.symbolB),role:"reuse-candidate"}))],c=new Map;for(let n of ae(u)){if(c.has(n.definition.symbol))continue;let y=n.role==="target"?M:ue,r=n.definition.endLine<=n.definition.startLine?V(e,n.definition.relativePath,n.definition.startLine,y):null,C=r?.unitType?r.source:te(e,n.definition);if(!C)continue;let h=C.split(`
1
+ import{a as le}from"./chunk-6CQPIIS7.js";import{a as re}from"./chunk-KJLUQVBG.js";import{b as _}from"./chunk-7PPBMBH6.js";import{a as se}from"./chunk-QPQWR6CW.js";import{b as ie}from"./chunk-GC4I33OD.js";import{a as ne,b as oe}from"./chunk-4UXDBRIF.js";import{b as ee}from"./chunk-X4YZD2MP.js";import{f as te}from"./chunk-R7PXHYMY.js";import{a as X}from"./chunk-6EBUAKJT.js";import{a as Z}from"./chunk-3VDL7GTY.js";import{b as Q}from"./chunk-QFJ46F6F.js";import{a as J}from"./chunk-G2UU6PQP.js";import{d as V}from"./chunk-RVBRPBLQ.js";import{b as Y}from"./chunk-MJX2J5QE.js";import{a as W}from"./chunk-CPWYEPWQ.js";import{a as D}from"./chunk-66Q5VLH6.js";import{b as q}from"./chunk-AZZNG5Z2.js";import{a as H,c as K}from"./chunk-DOQLO74K.js";import{a as G}from"./chunk-NMKQOIYZ.js";import{e as P,t as w}from"./chunk-TNLOX4TN.js";import{d as z}from"./chunk-3LCDIREB.js";function ae(e){let t=new Set(e.filter(o=>o.definition?.isFunctionLike).map(o=>`${o.role}:${o.definition.relativePath}`));return e.flatMap(o=>o.definition?!o.definition.isFunctionLike&&t.has(`${o.role}:${o.definition.relativePath}`)?[]:[{definition:o.definition,role:o.role}]:[])}var pe=6,I=10,B=3,N=8,he=.7,ce=24,M=200,ye=12,ue=80,me=600;function Ve(e,t,o={}){let l=o.impactDepth??3,m=o.sliceDepth??3,u=o.semantic,c=Ee(t)?be(e,t):null,a=c?c.primary?.symbol??null:t,s=a!==null,d=s?f("trace",a,()=>ie(e,a,{semantic:u,referenceContext:ye}),i=>({definitions:i.definitions.length,references:i.referencedBy.length})):{definitions:[],referencedBy:[],claimSupport:null},g=s?f("call-graph",a,()=>X(e,a,{semantic:u}),i=>({callers:i?.callers.length??0,callees:i?.callees.length??0})):null,n=s?f("complexity",a,()=>W(e,a,{semantic:u}),i=>({callees:i?.calleeCount??0})):null,y=s?f("dataflow",a,()=>ee(e,a,{semantic:u}),i=>({references:i?.usageSites.length??0,producers:i?.producers.length??0,consumers:i?.consumers.length??0})):null,r=s?f("backward-slice",a,()=>_(e,a,{direction:"backward",maxDepth:m,semantic:u}),i=>({maxDepth:m,connectedSymbols:i?.connectedSymbols.length??0})):null,C=s?f("forward-slice",a,()=>_(e,a,{direction:"forward",maxDepth:m,semantic:u}),i=>({maxDepth:m,connectedSymbols:i?.connectedSymbols.length??0})):null,h=s?f("affected",a,()=>q(e,a,{maxDepth:l,scope:o.scope}),i=>({maxDepth:l,affectedSymbols:i.rows.length,coverage:i.coverage.status})):null,b=h?.rows??[],p=h?.coverage??null,S=s?f("reuse-candidates",a,()=>D(e,a,{minSimilarity:.4,limit:5,semantic:u,sourceCandidateMode:"target-pruned"}),i=>({candidates:i.length,direct:i.filter(Ce=>Ce.actionTier==="direct").length})):[],L=s?H(e,a)?.symbol??null:null,k=s?f("affected-consumer-reuse",a,()=>Re(d,L,i=>D(e,i,{minSimilarity:.4,limit:I,semantic:u,sourceCandidateMode:"target-pruned"}),{consumerLimit:pe,perConsumerSearchLimit:I,perConsumerCandidateLimit:B,candidateLimit:N}),i=>({totalConsumers:i.coverage.totalConsumers,analyzedConsumers:i.coverage.analyzedConsumers,candidates:i.candidates.length})):ve(),A=f("change-surface",t,()=>Z(e,t,{semantic:u}),i=>({symbols:i?.symbols.length??0,externalConsumers:i?.totalExternalConsumers??0})),R=f("system",t,()=>re(e,t),i=>({files:i.files.length,symbols:i.symbols.length})),T=R.files.length===1,F=f("deps",t,()=>T?R.dependsOn.map(i=>({relativePath:i,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):ne(e,t),i=>({files:i.length,reusedSystem:T})),O=f("rdeps",t,()=>T?R.dependedOnBy.map(i=>({relativePath:i,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):oe(e,t),i=>({files:i.length,reusedSystem:T})),U=f("surface",t,()=>le(e,t),i=>({consumers:i.length})),v={symbol:d.definitions.length>0||d.referencedBy.length>0||g!==null||n!==null||y!==null||r!==null||C!==null||b.length>0,file:A!==null||F.length>0||O.length>0,module:R.files.length>0||R.symbols.length>0||U.length>0},x=[];c&&!c.primary&&c.callableCount>1&&x.push(`File target has ${c.callableCount} callable symbols; use one callable name for compiler-resolved flow.`);let $=[...new Set(d.referencedBy.map(i=>i.relativePath))];$.length>0&&$.every(i=>G(i)==="test")&&x.push("Only test references were found for this target. For replacement or retirement work, map the currently wired owner or one production entry point before planning; this target does not describe the live affected surface."),!v.symbol&&!v.file&&!v.module&&x.push("No symbol, file, or module matched target."),p&&p.status!=="accounted"&&x.push(`Possible-impact coverage is ${p.status}: ${p.reasons.join(" ")}`);let j=A?.file??d.definitions[0]?.relativePath??null;return{target:t,...c?.primary?{primaryCallable:{symbol:c.primary.symbol,shortName:P(c.primary.symbol),file:c.primary.relativePath}}:{},matched:v,history:f("history",j??t,()=>Pe(e,j,o.gitHead)),trace:ge(d),callGraph:g,complexity:n,dataflow:y,backwardSlice:r,forwardSlice:C,affected:b,affectedCoverage:p,changeSurface:A,deps:F,rdeps:O,system:R,surface:U,reuseCandidates:S,affectedConsumerReuse:k,sourcePacket:Se(e,L,d,k,S),warnings:x}}function ge(e){return{definitions:e.definitions,referencedBy:e.referencedBy.map(t=>({relativePath:t.relativePath,line:t.line,enclosingSymbol:t.enclosingSymbol,enclosingShort:t.enclosingShort}))}}function be(e,t){let o=Y(e,t);if(o.length!==1)return{primary:null,callableCount:0};let l=w(e,o[0]).filter(c=>c.isFunctionLike),m=l.filter(c=>c.enclosingSymbol===null),u=m.length>0?m:l;return{primary:u.length===1?u[0]:null,callableCount:u.length}}function Se(e,t,o,l,m){let u=[...t?[{definition:fe(e,t),role:"target"}]:[],...[...l.candidates.map(n=>n.candidate),...m].map(n=>({definition:fe(e,n.symbolB),role:"reuse-candidate"}))],c=new Map;for(let n of ae(u)){if(c.has(n.definition.symbol))continue;let y=n.role==="target"?M:ue,r=n.definition.endLine<=n.definition.startLine?V(e,n.definition.relativePath,n.definition.startLine,y):null,C=r?.unitType?r.source:te(e,n.definition);if(!C)continue;let h=C.split(`
2
2
  `),b=Math.min(h.length,y),p=r?.unitType?r.startLine:n.definition.startLine;c.set(n.definition.symbol,{role:n.role,symbol:n.definition.symbol,shortName:P(n.definition.symbol),file:n.definition.relativePath,startLine:p,endLine:p+b-1,source:h.slice(0,b).join(`
3
3
  `),omittedLines:(r?.unitType?r.omittedLines:0)+Math.max(0,h.length-b)})}let a=new Map;for(let n of o.referencedBy){if(n.source===void 0||n.source===null||n.sourceStartLine===void 0||n.sourceStartLine===null||n.sourceEndLine===void 0||n.sourceEndLine===null)continue;let y=`${n.relativePath}:${n.sourceStartLine}-${n.sourceEndLine}`,r=a.get(y);if(r){r.focusLines=[...new Set([...r.focusLines??[],n.line])].sort((C,h)=>C-h);continue}a.set(y,{role:"consumer",symbol:n.enclosingSymbol??`${n.relativePath}:${n.line}`,shortName:n.enclosingShort,file:n.relativePath,startLine:n.sourceStartLine,endLine:n.sourceEndLine,source:n.source,omittedLines:0,focusLines:[n.line]})}let s=[...[...c.values()].filter(n=>n.role==="target"),...a.values(),...[...c.values()].filter(n=>n.role==="reuse-candidate")],d=[],g=me;for(let n of s){if(d.length>=ce||g<=0)break;let y=n.source.split(`
4
4
  `),r=Math.min(y.length,g);d.push({...n,endLine:n.startLine+r-1,source:y.slice(0,r).join(`
5
5
  `),omittedLines:n.omittedLines+Math.max(0,y.length-r),...n.focusLines?{focusLines:n.focusLines.filter(C=>C<=n.startLine+r-1)}:{}}),g-=r}return{slices:d,candidateSlices:s.length,omittedSlices:Math.max(0,s.length-d.length),maxSlices:ce,maxLinesPerSlice:M,maxTotalLines:me,targetLineLimit:M,consumerContextLines:ye,reuseLineLimit:ue}}function fe(e,t){let o=K(e,t);return o?w(e,o.relativePath).find(l=>l.symbol===t)??null:null}function Re(e,t,o,l={}){let m=E(l.consumerLimit,pe),u=E(l.perConsumerSearchLimit,I),c=E(l.perConsumerCandidateLimit,B),a=E(l.candidateLimit,N),s=xe(e),d=s.slice(0,m),g=new Set(s.map(r=>r.symbol));t&&g.add(t);let n=new Map;for(let r of d){let C=o(r.symbol).slice(0,u),h=0;for(let b of C){let p=Le(b,r.symbol);if(!p||g.has(p.symbolB))continue;let S=n.get(p.symbolB);if(S?(S.consumers.some(L=>L.symbol===r.symbol)||S.consumers.push(r),p.similarity>S.candidate.similarity&&(S.candidate=p)):n.set(p.symbolB,{candidate:p,consumers:[r]}),h+=1,h>=c)break}}let y=[...n.values()].filter(r=>r.candidate.actionTier==="direct"||r.candidate.similarity>=he||r.consumers.length>1).sort(Te).slice(0,a);return{candidates:y,coverage:{totalConsumers:s.length,analyzedConsumers:d.length,omittedConsumers:Math.max(0,s.length-d.length),perConsumerSearchLimit:u,perConsumerCandidateLimit:c,candidateLimit:a,returnedCandidates:y.length}}}function xe(e){let t=new Map;for(let o of e.referencedBy){if(!o.enclosingSymbol)continue;let l=t.get(o.enclosingSymbol);if(l){l.referenceCount+=1;continue}t.set(o.enclosingSymbol,{symbol:o.enclosingSymbol,shortName:P(o.enclosingSymbol)||o.enclosingShort,file:o.relativePath,referenceCount:1})}return[...t.values()].sort((o,l)=>l.referenceCount-o.referenceCount||o.symbol.localeCompare(l.symbol))}function Le(e,t){return e.symbolA===t?e:e.symbolB!==t?null:{...e,symbolA:e.symbolB,shortNameA:e.shortNameB,fileA:e.fileB,symbolB:e.symbolA,shortNameB:e.shortNameA,fileB:e.fileA,uniqueToA:e.uniqueToB,uniqueToB:e.uniqueToA}}function Te(e,t){let o=de(t.candidate.actionTier)-de(e.candidate.actionTier);if(o!==0)return o;let l=t.consumers.length-e.consumers.length;if(l!==0)return l;let m=t.candidate.similarity-e.candidate.similarity;return m!==0?m:e.candidate.symbolB.localeCompare(t.candidate.symbolB)}function de(e){return e==="direct"?1:0}function E(e,t){return typeof e=="number"&&Number.isFinite(e)?Math.max(1,Math.floor(e)):t}function ve(){return{candidates:[],coverage:{totalConsumers:0,analyzedConsumers:0,omittedConsumers:0,perConsumerSearchLimit:I,perConsumerCandidateLimit:B,candidateLimit:N,returnedCandidates:0}}}function f(e,t,o,l=()=>({})){let m;return z(`context.${e}`,()=>(m=o(),m),()=>({target:t,...l(m)}))}function Pe(e,t,o){let l={available:!1,file:t,churn:null,coChangePartners:[],suppressionsInFile:0};if(!t)return l;let m=J(e,o?{head:o}:{}),u=f("history.churn",t,()=>m.fileChurn(),s=>({files:s?.size??0}));if(!u)return l;let c=f("history.co-change",t,()=>Q(e,t,{limit:5,...o?{head:o}:{}}),s=>({commits:s.commitsAnalyzed,partners:s.findings.length})),a=f("history.suppressions",t,()=>se(e).byFile.get(t)??0,s=>({suppressions:s}));return{available:!0,file:t,churn:u.get(t)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:c.findings.map(s=>({file:s.fileA===t?s.fileB:s.fileA,together:s.together,confidence:s.confidence,subjectContext:s.subjectContext})),suppressionsInFile:a}}function Ee(e){return e.includes("/")||e.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(e)}export{Ve as a,Re as b};
6
- //# sourceMappingURL=chunk-3ON3A2QV.js.map
6
+ //# sourceMappingURL=chunk-VZY3XOBU.js.map
@@ -1,3 +1,3 @@
1
- import{a as S,e as d}from"./chunk-YT4DVWUV.js";import{readdirSync as m}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var h=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],X=[".vue"],f=[".tsx",".jsx"],g=[".vue"],_=[...f,...g],I=new Set(f),w=new Set(g),p=new Set(h.map(e=>e.toLowerCase())),C=[...p].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".codebaseiq-cache","__pycache__",".venv","venv",".idea",".vscode"]);function O(e,t={}){let s=t.includeIndexed??!0,i=t.includeAuxiliary??!0,n=t.extensions?.map(c=>c.toLowerCase()),o=n?new Set(n):p,u=n?[...o].sort().join(","):C,r=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return R.get(e,r,()=>{let c=new Set;if(s)for(let a of d(e,{includeIgnored:!1}))o.has(l(a).toLowerCase())&&c.add(a);if(i)for(let a of N(e.config.projectRoot,o))e.isIgnored(a)||s&&c.has(a)||c.add(a);return[...c].sort()})}function k(e,t={}){let s=!1,i=!1;for(let n of O(e,{extensions:_})){if(t.scope&&!n.includes(t.scope))continue;let o=l(n).toLowerCase();if(s||=I.has(o),i||=w.has(o),s&&i)break}return{react:s,vue:i}}var R=S("source-files",{clearGroups:[]});function N(e,t){return T(e,t)??v(e,t)}function T(e,t){try{let s=x("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"],windowsHide:!0}),i=new Set;for(let n of s.split(`
1
+ import{a as S,e as d}from"./chunk-UUMAM5LM.js";import{readdirSync as m}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var h=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],X=[".vue"],f=[".tsx",".jsx"],g=[".vue"],_=[...f,...g],I=new Set(f),w=new Set(g),p=new Set(h.map(e=>e.toLowerCase())),C=[...p].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".codebaseiq-cache","__pycache__",".venv","venv",".idea",".vscode"]);function O(e,t={}){let s=t.includeIndexed??!0,i=t.includeAuxiliary??!0,n=t.extensions?.map(c=>c.toLowerCase()),o=n?new Set(n):p,u=n?[...o].sort().join(","):C,r=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return R.get(e,r,()=>{let c=new Set;if(s)for(let a of d(e,{includeIgnored:!1}))o.has(l(a).toLowerCase())&&c.add(a);if(i)for(let a of N(e.config.projectRoot,o))e.isIgnored(a)||s&&c.has(a)||c.add(a);return[...c].sort()})}function k(e,t={}){let s=!1,i=!1;for(let n of O(e,{extensions:_})){if(t.scope&&!n.includes(t.scope))continue;let o=l(n).toLowerCase();if(s||=I.has(o),i||=w.has(o),s&&i)break}return{react:s,vue:i}}var R=S("source-files",{clearGroups:[]});function N(e,t){return T(e,t)??v(e,t)}function T(e,t){try{let s=x("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"],windowsHide:!0}),i=new Set;for(let n of s.split(`
2
2
  `)){let o=n.trim();o&&(j(o)||t.has(l(o).toLowerCase())&&i.add(o))}return i}catch{return null}}function j(e){return e.split("/").some(t=>E.has(t))}function v(e,t){let s=new Set,i=n=>{let o=n?y(e,n):e,u;try{u=m(o,{withFileTypes:!0})}catch{return}for(let r of u)if(!E.has(r.name)){if(r.isDirectory()){i(n?`${n}/${r.name}`:r.name);continue}t.has(l(r.name).toLowerCase())&&s.add(n?`${n}/${r.name}`:r.name)}};return i(""),s}export{X as a,E as b,O as c,k as d};
3
- //# sourceMappingURL=chunk-XQAVQVIL.js.map
3
+ //# sourceMappingURL=chunk-W6E6ME7G.js.map
@@ -1,3 +1,3 @@
1
- import{a as R}from"./chunk-57OPIQFM.js";import{o as h}from"./chunk-J7AMBVWF.js";import{a as g}from"./chunk-SGMNWYTH.js";import{h as d}from"./chunk-GVAF222T.js";import{a as m}from"./chunk-ICUL7XRT.js";import{w as p}from"./chunk-7GAK2F3H.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
1
+ import{a as R}from"./chunk-ETZBIG6K.js";import{o as h}from"./chunk-NB2DAVPP.js";import{a as g}from"./chunk-DOQLO74K.js";import{h as d}from"./chunk-TNLOX4TN.js";import{a as m}from"./chunk-NRNVMB2R.js";import{w as p}from"./chunk-23AD24QZ.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
2
2
  `);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
3
- //# sourceMappingURL=chunk-KEJ2HLRW.js.map
3
+ //# sourceMappingURL=chunk-WGYZBS5S.js.map
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-MZNMASFM.js";import{a as D}from"./chunk-WWCV4E6J.js";import{a as g}from"./chunk-KPZGTB2O.js";import{a as F}from"./chunk-WK2IQJPK.js";import{a as y}from"./chunk-CCIYWXX6.js";import{e as f}from"./chunk-SUE7SHZL.js";import{j as d}from"./chunk-GVAF222T.js";import{L as h}from"./chunk-ICUL7XRT.js";var A=.7,S=.62,C=.45;function J(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=y(i,{historyMode:t.historyMode}).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let r=P(s,e);if(r.size===0)return{available:!0,windowCommits:e,findings:[]};let b=B(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:r}).map(l=>O(l,s,e)).filter(l=>l!==null);b.sort((l,c)=>(l.kind===c.kind?0:l.kind==="echo"?-1:1)||c.similarity-l.similarity||l.echoFile.localeCompare(c.echoFile)||l.echoSymbol.localeCompare(c.echoSymbol)||l.domain.localeCompare(c.domain));let p=b.slice(0,n).map(M);return{available:!0,windowCommits:e,findings:p,rootCauseGroups:N(p)}}function B(i,t){let e=K(t.limit),n=[...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??A,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=h(i,{scope:t.scope});return a.react&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...T(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function k(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).filter(e=>!d(e.symbolA)&&!d(e.symbolB)).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function E(i,t){return u(i,t,{query:g,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).filter(n=>e.acceptPair?.(n)??!0).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:G(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:F,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,acceptPair:w,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}var I=new Set(["useCallback","useEffect","useLayoutEffect","useMemo","useMutation","useQueries","useQuery","useQueryClient","useReducer","useRef","useState"]);function w(i){return i.sharedHooks.some(t=>!I.has(t))||i.sharedState.length>0||i.sharedHandlers.length>0||i.sharedHandlerVerbs.length>=2}function x(i,t){return u(i,t,{query:D,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function T(i,t){return u(i,t,{query:R,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function P(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function O(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let r=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:r?i.symbolA:i.symbolB,echoFile:r?i.fileA:i.fileB,echoAgeCommits:(r?n:a)??0,establishedSymbol:r?i.symbolB:i.symbolA,establishedFile:r?i.fileB:i.fileA,establishedAgeCommits:r?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function M(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??v(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:H(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let r of n.sharedEvidence)s.sharedEvidence.add(r)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function H(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function G(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{J as a};
2
- //# sourceMappingURL=chunk-5MPBSFZH.js.map
1
+ import{a as R}from"./chunk-YRAGNEBZ.js";import{a as D}from"./chunk-KOVUXHIZ.js";import{a as g}from"./chunk-OAJYNPRU.js";import{a as F}from"./chunk-KAXBWTSX.js";import{a as y}from"./chunk-G2UU6PQP.js";import{e as f}from"./chunk-66Q5VLH6.js";import{j as d}from"./chunk-TNLOX4TN.js";import{L as h}from"./chunk-NRNVMB2R.js";var A=.7,S=.62,C=.45;function J(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=y(i,{historyMode:t.historyMode}).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let r=P(s,e);if(r.size===0)return{available:!0,windowCommits:e,findings:[]};let b=B(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:r}).map(l=>O(l,s,e)).filter(l=>l!==null);b.sort((l,c)=>(l.kind===c.kind?0:l.kind==="echo"?-1:1)||c.similarity-l.similarity||l.echoFile.localeCompare(c.echoFile)||l.echoSymbol.localeCompare(c.echoSymbol)||l.domain.localeCompare(c.domain));let p=b.slice(0,n).map(M);return{available:!0,windowCommits:e,findings:p,rootCauseGroups:N(p)}}function B(i,t){let e=K(t.limit),n=[...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??A,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=h(i,{scope:t.scope});return a.react&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...T(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function k(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).filter(e=>!d(e.symbolA)&&!d(e.symbolB)).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function E(i,t){return u(i,t,{query:g,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).filter(n=>e.acceptPair?.(n)??!0).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:G(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:F,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,acceptPair:w,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}var I=new Set(["useCallback","useEffect","useLayoutEffect","useMemo","useMutation","useQueries","useQuery","useQueryClient","useReducer","useRef","useState"]);function w(i){return i.sharedHooks.some(t=>!I.has(t))||i.sharedState.length>0||i.sharedHandlers.length>0||i.sharedHandlerVerbs.length>=2}function x(i,t){return u(i,t,{query:D,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function T(i,t){return u(i,t,{query:R,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function P(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function O(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let r=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:r?i.symbolA:i.symbolB,echoFile:r?i.fileA:i.fileB,echoAgeCommits:(r?n:a)??0,establishedSymbol:r?i.symbolB:i.symbolA,establishedFile:r?i.fileB:i.fileA,establishedAgeCommits:r?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function M(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??v(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:H(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let r of n.sharedEvidence)s.sharedEvidence.add(r)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function H(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function G(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{J as a};
2
+ //# sourceMappingURL=chunk-WUP24Q4U.js.map
@@ -0,0 +1,2 @@
1
+ import{h as g,j as p,l as E,p as C,w as y}from"./chunk-CABIZQXQ.js";import{Q as m}from"./chunk-PVKSZBX5.js";import{a as x,d as l,y as v}from"./chunk-ZJNV27DZ.js";import{G as c,H as h,I as u,J as f}from"./chunk-C3PPB2T5.js";import{existsSync as R}from"fs";import{dirname as S,join as b}from"path";var P=5e3,F=100,j={prepare:v,freshness:x,ensureService:p,inspectService:E,requestRefresh:C,async reindex(e,t,n,o){let{reindexConfiguredProject:a}=await import("./project-reindex-5TCGOVSK.js");return a(e,t,n,o)},indexExists:R,wait(e){return new Promise(t=>setTimeout(t,e))},now:Date.now};async function H(e,t=j,n={}){if(e.dbPathSource==="env"){let i=D(e,t);return{source:"explicit-index",service:{kind:"skipped",reason:"environment"},...i?.state==="stale"?{freshness:i}:{}}}if(u())return W(e,t);if(y(e.commandName,e.config)&&t.indexExists(e.paths.dbPath))return{source:"published-generation",service:{kind:"skipped",reason:"excluded-command"}};let o=I(e,t),a=t.prepare(e.projectRoot,e.config,e.paths,{gitContext:e.gitContext,...o?{watcherGeneration:o}:{}}),r=t.freshness(e.projectRoot,e.config,e.paths),s=t.ensureService({commandName:e.commandName,projectRoot:e.projectRoot,cacheDir:e.paths.cacheDir,cliVersion:c,config:e.config,gitContext:e.gitContext});if(r.state==="fresh")return{source:a.kind==="local-fresh"?"existing":"shared-generation",service:s};if(f()&&t.indexExists(e.paths.dbPath))return(s.kind==="started"||s.kind==="reused")&&t.requestRefresh(m(e.paths.cacheDir).activityPath,`evidence command ${e.commandName} answered from a stale generation`),{source:"stale-overlay",service:s,freshness:r};if((s.kind==="started"||s.kind==="reused")&&(t.requestRefresh(m(e.paths.cacheDir).activityPath,`evidence command ${e.commandName} requires a fresh generation`),r=await M(e,r,t,n,s),r.state==="fresh"))return{source:"watcher",service:s};try{await t.reindex(e.projectRoot,e.config,e.paths,{allowPartial:!1,skipAutoInstall:!0,trigger:{kind:"watch-demand",detail:`codebaseiq ${e.commandName}`},onStatus:()=>{}})}catch(i){throw new Error(`Could not prepare fresh evidence for codebaseiq ${e.commandName}: ${i instanceof Error?i.message:String(i)}`,{cause:i})}if(r=t.freshness(e.projectRoot,e.config,e.paths),r.state!=="fresh")throw new Error(`Could not prepare fresh evidence for codebaseiq ${e.commandName}: index remained ${r.state} (${r.reason})`);return{source:"synchronous-reindex",service:s}}function W(e,t){if(!t.indexExists(e.paths.dbPath))throw new Error(`${h}=1 needs an existing index at ${e.paths.dbPath}; build one outside the sandbox with 'codebaseiq reindex', or set CODEBASEIQ_CACHE_DIR to the cache directory of a checkout that has one`);let n=t.freshness(e.projectRoot,e.config,e.paths);return n.state!=="fresh"&&console.error(`warning: ${h}=1 is answering from a ${n.state} index (${n.reason}); results may not reflect current edits.`),{source:"read-only",service:{kind:"skipped",reason:"environment"},...n.state!=="fresh"?{freshness:n}:{}}}function D(e,t){if(e.dbPath)return t.freshness(e.projectRoot,e.config,{dbPath:e.dbPath,metaPath:b(S(e.dbPath),"meta.json")})}function I(e,t){if(e.config.watch?.enabled===!0)try{return g(t.inspectService({projectRoot:e.projectRoot,cacheDir:e.paths.cacheDir,cliVersion:c,gitContext:e.gitContext}))}catch{return}}async function M(e,t,n,o,a){if(a.state.watcher.state==="budget-paused")return t;let r=Math.max(0,o.waitMs??P),s=Math.max(1,o.pollMs??F),i=n.now()+r,d=t;for(;n.now()<i;)if(await n.wait(Math.min(s,Math.max(1,i-n.now()))),l(),d=n.freshness(e.projectRoot,e.config,e.paths),d.state==="fresh")return d;return d}export{H as a};
2
+ //# sourceMappingURL=chunk-WXUHXSLN.js.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-57OPIQFM.js";import{a as b,c as S}from"./chunk-MSI3K7PJ.js";import{o as y}from"./chunk-J7AMBVWF.js";import{a as f}from"./chunk-SGMNWYTH.js";import{d as r}from"./chunk-GVAF222T.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=a(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m}).map(n=>({symbol:n.symbol,file:n.file}))),s=a(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m})),c=s.length>0?s:a(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
2
- //# sourceMappingURL=chunk-F5CJO5JN.js.map
1
+ import{c as a}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-ETZBIG6K.js";import{a as b,c as S}from"./chunk-2QJAVISG.js";import{o as y}from"./chunk-NB2DAVPP.js";import{a as f}from"./chunk-DOQLO74K.js";import{d as r}from"./chunk-TNLOX4TN.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=a(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m}).map(n=>({symbol:n.symbol,file:n.file}))),s=a(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m})),c=s.length>0?s:a(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
2
+ //# sourceMappingURL=chunk-X4YZD2MP.js.map
@@ -0,0 +1,2 @@
1
+ import{e as g}from"./chunk-M3IBH6C3.js";import{B as s}from"./chunk-75VNTSO6.js";import{P as c,Q as d,W as l}from"./chunk-C3PPB2T5.js";import{spawnSync as p}from"child_process";import{mkdtempSync as y,rmSync as m}from"fs";import{tmpdir as x}from"os";import{join as P}from"path";function h(t,r,i,e){return g({projectRoot:t,languages:e.languages?.length?e.languages:r.languages,outputScip:i.indexPath,outputDb:i.dbPath,pnpmWorkspaces:r.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:r.indexer?.typescript?.projectMode,typescriptProjects:r.indexer?.typescript?.projects,clojureConfigPath:r.indexer?.clojure?.configPath,skipIfUnchanged:e.force!==!0,allowPartial:e.allowPartial===!0,skipAutoInstall:e.skipAutoInstall===!0,installMissing:e.installMissing===!0,trustProjectTools:e.trustProjectTools===!0,indexerConcurrency:e.indexerConcurrency??r.indexerConcurrency,trigger:e.trigger,...e.onStatus?{onStatus:e.onStatus}:{}})}async function _(t,r,i){if(!c(s(t)))throw new Error("reindex --base publishes a shared generation, which CODEBASEIQ_CACHE_DIR, CODEBASEIQ_INDEX_DB, CODEBASEIQ_READ_ONLY, CODEBASEIQ_SHARED_CACHE=0 and a configured dbPath disable");let e=l(t,r),o=y(P(x(),"codebaseiq-base-"));C(t,["-c","core.longpaths=true","worktree","add","--detach",o,e]);let n;try{let a=s(o),u=d(o,a);return n=u.cacheDir,{commit:e,result:await h(o,a,u,i)}}finally{p("git",["worktree","remove","--force",o],{cwd:t,timeout:f,windowsHide:!0}),m(o,{recursive:!0,force:!0}),n&&m(n,{recursive:!0,force:!0})}}var f=6e5;function C(t,r){let i=p("git",r,{cwd:t,encoding:"utf8",timeout:f,windowsHide:!0});if(i.status!==0)throw new Error(`git ${r.join(" ")} failed: ${(i.stderr||i.stdout).trim()}`)}export{h as a,_ as b};
2
+ //# sourceMappingURL=chunk-XARPGCTL.js.map
@@ -1,4 +1,4 @@
1
- import{d as q}from"./chunk-T75DS2E6.js";import{a as S,c as ne,d as F}from"./chunk-YT4DVWUV.js";import{a as k,c as ee,d as te}from"./chunk-RCIGX23V.js";import{a as j,f as O,i as I}from"./chunk-R2NOK63J.js";import{ca as J,da as Z}from"./chunk-UQYQBLJX.js";import{createHash as xe}from"crypto";import{existsSync as Le,mkdirSync as De}from"fs";import{dirname as re,join as ke}from"path";import V from"better-sqlite3";var Fe="evidence.db";var we=["source-facts","callable-units","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],M=new Set(we),Re=25e4,Ae=512*1024*1024,Pe=6e4,N=new WeakMap;te({name:"evidence-connections",close:se});var je=S("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Oe=S("evidence-project-fingerprint",{clearGroups:["whole-project"]}),f="evidence-v1",_="version NOT LIKE 'evidence-%'";function ie(e){return xe("sha256").update(e).digest("hex")}function Ct(e,n,t){return je.get(e,n,()=>ie(t))}function ae(e){return Oe.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let n=q(e.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let t=n.metadata,r=[...t.indexedLanguages??[]].sort();return ie(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:r,status:t.status}))}catch(n){return y("project fingerprint unavailable",n),null}})}function y(e,n){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${e}: ${n instanceof Error?n.message:String(n)}`)}function m(e){if(N.has(e))return N.get(e)??null;let n=null;try{let t=new V(k(ke(re(e.config.dbPath),Fe)));t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 5000"),t.pragma("synchronous = NORMAL"),t.exec(`
1
+ import{d as q}from"./chunk-E7T22WET.js";import{a as _,c as re,d as F}from"./chunk-UUMAM5LM.js";import{a as k,c as te,d as ne}from"./chunk-EDMG5CSO.js";import{a as j,f as O,i as I}from"./chunk-R2NOK63J.js";import{I as J,ga as Z,ha as ee}from"./chunk-C3PPB2T5.js";import{createHash as Le}from"crypto";import{existsSync as De,mkdirSync as ke}from"fs";import{dirname as ie,join as Fe}from"path";import V from"better-sqlite3";var we="evidence.db";var Re=["source-facts","callable-units","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],M=new Set(Re),Ae=25e4,Pe=512*1024*1024,je=6e4,v=new WeakMap;ne({name:"evidence-connections",close:oe});var Oe=_("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Ie=_("evidence-project-fingerprint",{clearGroups:["whole-project"]}),f="evidence-v1",N="version NOT LIKE 'evidence-%'";function ae(e){return Le("sha256").update(e).digest("hex")}function Tt(e,n,t){return Oe.get(e,n,()=>ae(t))}function se(e){return Ie.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let n=q(e.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let t=n.metadata,r=[...t.indexedLanguages??[]].sort();return ae(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:r,status:t.status}))}catch(n){return y("project fingerprint unavailable",n),null}})}function y(e,n){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${e}: ${n instanceof Error?n.message:String(n)}`)}function m(e){if(v.has(e))return v.get(e)??null;if(J())return v.set(e,null),null;let n=null;try{let t=new V(k(Fe(ie(e.config.dbPath),we)));t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 5000"),t.pragma("synchronous = NORMAL"),t.exec(`
2
2
  CREATE TABLE IF NOT EXISTS file_evidence (
3
3
  kind TEXT NOT NULL,
4
4
  relative_path TEXT NOT NULL,
@@ -32,29 +32,29 @@ import{d as q}from"./chunk-T75DS2E6.js";import{a as S,c as ne,d as F}from"./chun
32
32
  payload TEXT NOT NULL,
33
33
  PRIMARY KEY (relative_path, symbol)
34
34
  );
35
- `),n={evidence:t,shared:Ie(e.config.sharedEvidenceDbPath),readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:t.prepare(`SELECT payload FROM file_evidence
36
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${_}
35
+ `),n={evidence:t,shared:Ve(e.config.sharedEvidenceDbPath),readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:t.prepare(`SELECT payload FROM file_evidence
36
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${N}
37
37
  ORDER BY version DESC
38
38
  LIMIT 1`),writeFileEvidence:t.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:t.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:t.prepare(`SELECT payload FROM project_evidence
39
- WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${_}
39
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${N}
40
40
  ORDER BY version DESC
41
41
  LIMIT 1`),writeProjectEvidence:t.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:t.prepare(`SELECT payload FROM semantic_callees
42
42
  WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:t.prepare(`SELECT payload FROM semantic_callees
43
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${_}
43
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${N}
44
44
  ORDER BY version DESC
45
45
  LIMIT 1`),readCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
46
46
  WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
47
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${_}
47
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${N}
48
48
  ORDER BY symbol, version DESC`),writeCallees:t.prepare(`INSERT OR REPLACE INTO semantic_callees
49
49
  (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:t.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:t.prepare(`SELECT payload FROM semantic_references
50
50
  WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:t.prepare(`SELECT payload FROM semantic_references
51
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${_}
51
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${N}
52
52
  ORDER BY version DESC
53
53
  LIMIT 1`),readReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
54
54
  WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
55
- WHERE relative_path = ? AND project_fingerprint = ? AND ${_}
55
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${N}
56
56
  ORDER BY symbol, version DESC`),writeReferences:t.prepare(`INSERT OR REPLACE INTO semantic_references
57
- (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:t.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(t){y("disabled (open failed)",t)}return N.set(e,n),n}function h(e,n,t){y(`disabled (${n})`,t);try{se(e)}catch(r){y("close failed while disabling",r)}N.set(e,null)}function se(e){let n=N.get(e);if(N.delete(e),!n)return;let t,r;try{n.shared?.evidence.close()}catch(i){t=i}try{n.evidence.close()}catch(i){r=i}if(t!==void 0&&r!==void 0)throw new AggregateError([t,r],"Shared and project evidence connections failed to close.");if(t!==void 0)throw t;if(r!==void 0)throw r}function Ie(e){if(!e)return null;try{De(re(e),{recursive:!0});let n=new V(k(e));return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
57
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:t.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(t){y("disabled (open failed)",t)}return v.set(e,n),n}function h(e,n,t){y(`disabled (${n})`,t);try{oe(e)}catch(r){y("close failed while disabling",r)}v.set(e,null)}function oe(e){let n=v.get(e);if(v.delete(e),!n)return;let t,r;try{n.shared?.evidence.close()}catch(i){t=i}try{n.evidence.close()}catch(i){r=i}if(t!==void 0&&r!==void 0)throw new AggregateError([t,r],"Shared and project evidence connections failed to close.");if(t!==void 0)throw t;if(r!==void 0)throw r}function Ve(e){if(!e)return null;try{ke(ie(e),{recursive:!0});let n=new V(k(e));return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
58
58
  CREATE TABLE IF NOT EXISTS file_evidence (
59
59
  kind TEXT NOT NULL,
60
60
  relative_path TEXT NOT NULL,
@@ -72,19 +72,19 @@ import{d as q}from"./chunk-T75DS2E6.js";import{a as S,c as ne,d as F}from"./chun
72
72
  DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:n.prepare(`UPDATE file_evidence
73
73
  SET last_accessed_at = ?
74
74
  WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
75
- AND last_accessed_at < ?`)}}catch(n){return y("shared cache disabled (open failed)",n),null}}function B(e,n,t){y(`shared cache disabled (${n})`,t);try{e.shared?.evidence.close()}catch{}e.shared=null}function bt(e,n={}){if(!Le(e))return null;let t;try{t=new V(k(e)),t.pragma("busy_timeout = 50"),t.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
76
- ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),t.pragma("wal_checkpoint(TRUNCATE)");let r=t.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,i=n.maxRows??Re,a=n.budgetBytes??Ae,s=Number(t.pragma("page_size",{simple:!0})),o=Number(t.pragma("page_count",{simple:!0})),l=Number(t.pragma("freelist_count",{simple:!0})),d=Math.max(0,o-l)*s,g=r>0&&d>a?Math.min(r,Math.ceil((d-a)/Math.max(1,d/r))):0,c=Math.max(r-i,g);return c>0&&(t.prepare(`DELETE FROM file_evidence WHERE rowid IN (
75
+ AND last_accessed_at < ?`)}}catch(n){return y("shared cache disabled (open failed)",n),null}}function B(e,n,t){y(`shared cache disabled (${n})`,t);try{e.shared?.evidence.close()}catch{}e.shared=null}function xt(e,n={}){if(!De(e))return null;let t;try{t=new V(k(e)),t.pragma("busy_timeout = 50"),t.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
76
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),t.pragma("wal_checkpoint(TRUNCATE)");let r=t.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,i=n.maxRows??Ae,a=n.budgetBytes??Pe,s=Number(t.pragma("page_size",{simple:!0})),o=Number(t.pragma("page_count",{simple:!0})),l=Number(t.pragma("freelist_count",{simple:!0})),d=Math.max(0,o-l)*s,g=r>0&&d>a?Math.min(r,Math.ceil((d-a)/Math.max(1,d/r))):0,c=Math.max(r-i,g);return c>0&&(t.prepare(`DELETE FROM file_evidence WHERE rowid IN (
77
77
  SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
78
- )`).run(c),t.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:c,remainingRows:r-c}}catch(r){return y("shared cache maintenance skipped",r),null}finally{try{t?.close()}catch{}}}function oe(e,n,t,r){let i=m(e);if(!i)return null;try{let a=i.readFileEvidence.get(n,t,r,f)??i.readLegacyFileEvidence.get(n,t,r);if(a?.payload!==void 0)return a.payload;if(!M.has(n)||!i.shared)return null;try{let s=i.shared.readFileEvidence.get(n,t,r,f);return s?.payload!==void 0&&Ve(i.shared,n,t,r),s?.payload??null}catch(s){return B(i,"file_evidence read",s),null}}catch(a){return h(e,"file_evidence read",a),null}}function Ve(e,n,t,r){let i=Date.now();try{e.touchFileEvidence.run(i,n,t,r,f,i-Pe)}catch(a){y("shared file_evidence recency touch skipped",a)}}function ce(e,n,t,r,i){let a=m(e);if(a)try{if(a.writeFileEvidence.run(n,t,r,f,i),M.has(n)&&a.shared)try{a.shared.writeFileEvidence.run(n,t,r,f,i,Date.now())}catch(s){B(a,"file_evidence write",s)}}catch(s){h(e,"file_evidence write",s)}}function le(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{for(let i of n)t.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,f,i.payload)})();let r=n.filter(i=>M.has(i.kind));if(r.length>0&&t.shared)try{t.shared.evidence.transaction(()=>{for(let i of r)t.shared.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,f,i.payload,Date.now())})()}catch(i){B(t,"file_evidence batch write",i)}}catch(r){h(e,"file_evidence batch write",r)}}function de(e,n,t,r){let i=m(e);if(!i)return null;try{return(i.readProjectEvidence.get(n,t,r,f)??i.readLegacyProjectEvidence.get(n,t,r))?.payload??null}catch(a){return h(e,"project_evidence read",a),null}}function pe(e,n,t,r,i){let a=m(e);if(a)try{a.writeProjectEvidence.run(n,t,r,f,i)}catch(s){h(e,"project_evidence write",s)}}function Tt(e,n,t,r){let i=m(e);if(!i)return new Map;try{let a=i.readCalleesForFile.all(n,t,r,f),s=i.readLegacyCalleesForFile.all(n,t,r);return ue([...s,...a])}catch(a){return h(e,"semantic_callees bulk read",a),new Map}}function xt(e,n,t){let r=m(e);if(!r)return new Map;try{let i=r.readReferencesForFile.all(n,t,f),a=r.readLegacyReferencesForFile.all(n,t);return ue([...a,...i])}catch(i){return h(e,"semantic_references bulk read",i),new Map}}function ue(e){let n=new Map;for(let t of e)n.set(t.symbol,t.payload);return n}function Lt(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{let r=new Set;for(let i of n){let a=`${i.relativePath}\0${i.contentHash}`;r.has(a)||(r.add(a),t.dropStaleCallees.run(i.relativePath,i.contentHash)),t.writeCallees.run(i.relativePath,i.symbol,i.contentHash,i.depsDigest,f,i.payload)}})()}catch(r){h(e,"semantic_callees write",r)}}function Dt(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{let r=new Set;for(let i of n){let a=`${i.relativePath}\0${i.projectFingerprint}`;r.has(a)||(r.add(a),t.dropStaleReferences.run(i.relativePath,i.projectFingerprint)),t.writeReferences.run(i.relativePath,i.symbol,i.projectFingerprint,f,i.payload)}})()}catch(r){h(e,"semantic_references write",r)}}var Me=[p("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),p("callable-units",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/source/callable-units.test.ts",owner:"src/source/facts/callable-units.ts"}),p("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),p("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),p("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),p("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),p("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),p("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),p("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),p("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),p("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),p("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),p("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),p("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),p("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),w("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function Pt(e){let n=new Map;return{kind:e.kind,read(t,r,i){let a=!1,s=0,o;if(j()){let l=ae(t);if(l){let d=`${l}\0${r}\0${i}`;o=n.get(d),o||(o=O(["evidence-product-file-read-v1",e.kind,l,r,i]),n.set(d,o))}}return I("evidence-product.file.read",()=>{let l=oe(t,e.kind,r,i);if(l===null)return null;s=l.length;try{let d=e.deserialize(l);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(t,r,i,a){ce(t,e.kind,r,i,e.serialize(a))},writeBatch(t,r){le(t,r.map(i=>({kind:e.kind,relativePath:i.relativePath,contentHash:i.contentHash,payload:e.serialize(i.value)})))}}}function jt(e){let n=new Map;return{kind:e.kind,read(t,r,i){let a=!1,s=0,o;if(j()){let l=`${i}\0${r}`;o=n.get(l),o||(o=O(["evidence-product-project-read-v1",e.kind,i,r]),n.set(l,o))}return I("evidence-product.project.read",()=>{let l=de(t,e.kind,r,i);if(l===null)return null;s=l.length;try{let d=e.deserialize(l);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(t,r,i,a){pe(t,e.kind,r,i,e.serialize(a))}}}function Ot(e){let n=Me.find(t=>t.kind===e);if(!n)throw new Error(`missing evidence product manifest entry for ${e}`);return n.invalidation}function p(e,n){return{scope:"file",kind:e,invalidation:{scope:"file",...n}}}function w(e,n){return{scope:"project",kind:e,invalidation:{scope:"project",...n}}}var Be=S("source-text",{clearGroups:["whole-project","source-file"]}),Ue=S("source-lines",{clearGroups:["whole-project","source-file"]});function v(e,n){let t=n.replace(/\\/g,"/");return Be.get(e,t,()=>{try{return J(e.config.projectRoot,t,{inputKind:"indexed source file"})}catch(r){if(Z(r))return"";throw r}})}function He(e,n){let t=n.replace(/\\/g,"/");return Ue.get(e,t,()=>{let r=v(e,t);return r?r.split(`
79
- `):[]})}var Ke=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function $e(e){let n=Ke.exec(e);return n?n[1]??"":null}function Bt(e,n,t){return fe(e,n,t).length>0}function Ut(e,n,t,r){let i=r.toLowerCase();return fe(e,n,t).some(a=>a.toLowerCase()===i)}function fe(e,n,t){if(t<=0)return[];let r=He(e,n);if(r.length===0)return[];let i=[];for(let a=t-1;a>=0&&a>=t-5;a-=1){let s=(r[a]??"").trim();if(s==="")continue;let o=$e(s);if(o!==null){i.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return i}return i}function U(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(e){return e.replace(/'''[\s\S]*?'''/g,E).replace(/"""[\s\S]*?"""/g,E).replace(/#.*$/gm,E).replace(/\/\/.*$/gm,E).replace(/\/\*[\s\S]*?\*\//g,E).replace(/`(?:\\[\s\S]|[^`])*`/g,E).replace(/'(?:\\.|[^'\\\r\n])*'/g,E).replace(/"(?:\\.|[^"\\\r\n])*"/g,E)}function Yt(e){return ge(e,{maskStrings:!1})}function zt(e){return ge(e,{maskStrings:!0})}function ge(e,n){let t="",r=0,i=e.length;for(;r<i;){if(e[r]==="/"&&e[r+1]==="/"){let s=e.indexOf(`
78
+ )`).run(c),t.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:c,remainingRows:r-c}}catch(r){return y("shared cache maintenance skipped",r),null}finally{try{t?.close()}catch{}}}function ce(e,n,t,r){let i=m(e);if(!i)return null;try{let a=i.readFileEvidence.get(n,t,r,f)??i.readLegacyFileEvidence.get(n,t,r);if(a?.payload!==void 0)return a.payload;if(!M.has(n)||!i.shared)return null;try{let s=i.shared.readFileEvidence.get(n,t,r,f);return s?.payload!==void 0&&Me(i.shared,n,t,r),s?.payload??null}catch(s){return B(i,"file_evidence read",s),null}}catch(a){return h(e,"file_evidence read",a),null}}function Me(e,n,t,r){let i=Date.now();try{e.touchFileEvidence.run(i,n,t,r,f,i-je)}catch(a){y("shared file_evidence recency touch skipped",a)}}function le(e,n,t,r,i){let a=m(e);if(a)try{if(a.writeFileEvidence.run(n,t,r,f,i),M.has(n)&&a.shared)try{a.shared.writeFileEvidence.run(n,t,r,f,i,Date.now())}catch(s){B(a,"file_evidence write",s)}}catch(s){h(e,"file_evidence write",s)}}function de(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{for(let i of n)t.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,f,i.payload)})();let r=n.filter(i=>M.has(i.kind));if(r.length>0&&t.shared)try{t.shared.evidence.transaction(()=>{for(let i of r)t.shared.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,f,i.payload,Date.now())})()}catch(i){B(t,"file_evidence batch write",i)}}catch(r){h(e,"file_evidence batch write",r)}}function pe(e,n,t,r){let i=m(e);if(!i)return null;try{return(i.readProjectEvidence.get(n,t,r,f)??i.readLegacyProjectEvidence.get(n,t,r))?.payload??null}catch(a){return h(e,"project_evidence read",a),null}}function ue(e,n,t,r,i){let a=m(e);if(a)try{a.writeProjectEvidence.run(n,t,r,f,i)}catch(s){h(e,"project_evidence write",s)}}function Lt(e,n,t,r){let i=m(e);if(!i)return new Map;try{let a=i.readCalleesForFile.all(n,t,r,f),s=i.readLegacyCalleesForFile.all(n,t,r);return fe([...s,...a])}catch(a){return h(e,"semantic_callees bulk read",a),new Map}}function Dt(e,n,t){let r=m(e);if(!r)return new Map;try{let i=r.readReferencesForFile.all(n,t,f),a=r.readLegacyReferencesForFile.all(n,t);return fe([...a,...i])}catch(i){return h(e,"semantic_references bulk read",i),new Map}}function fe(e){let n=new Map;for(let t of e)n.set(t.symbol,t.payload);return n}function kt(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{let r=new Set;for(let i of n){let a=`${i.relativePath}\0${i.contentHash}`;r.has(a)||(r.add(a),t.dropStaleCallees.run(i.relativePath,i.contentHash)),t.writeCallees.run(i.relativePath,i.symbol,i.contentHash,i.depsDigest,f,i.payload)}})()}catch(r){h(e,"semantic_callees write",r)}}function Ft(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{let r=new Set;for(let i of n){let a=`${i.relativePath}\0${i.projectFingerprint}`;r.has(a)||(r.add(a),t.dropStaleReferences.run(i.relativePath,i.projectFingerprint)),t.writeReferences.run(i.relativePath,i.symbol,i.projectFingerprint,f,i.payload)}})()}catch(r){h(e,"semantic_references write",r)}}var Be=[p("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),p("callable-units",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/source/callable-units.test.ts",owner:"src/source/facts/callable-units.ts"}),p("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),p("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),p("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),p("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),p("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),p("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),p("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),p("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),p("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),p("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),p("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),p("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),p("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),w("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function Ot(e){let n=new Map;return{kind:e.kind,read(t,r,i){let a=!1,s=0,o;if(j()){let l=se(t);if(l){let d=`${l}\0${r}\0${i}`;o=n.get(d),o||(o=O(["evidence-product-file-read-v1",e.kind,l,r,i]),n.set(d,o))}}return I("evidence-product.file.read",()=>{let l=ce(t,e.kind,r,i);if(l===null)return null;s=l.length;try{let d=e.deserialize(l);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(t,r,i,a){le(t,e.kind,r,i,e.serialize(a))},writeBatch(t,r){de(t,r.map(i=>({kind:e.kind,relativePath:i.relativePath,contentHash:i.contentHash,payload:e.serialize(i.value)})))}}}function It(e){let n=new Map;return{kind:e.kind,read(t,r,i){let a=!1,s=0,o;if(j()){let l=`${i}\0${r}`;o=n.get(l),o||(o=O(["evidence-product-project-read-v1",e.kind,i,r]),n.set(l,o))}return I("evidence-product.project.read",()=>{let l=pe(t,e.kind,r,i);if(l===null)return null;s=l.length;try{let d=e.deserialize(l);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(t,r,i,a){ue(t,e.kind,r,i,e.serialize(a))}}}function Vt(e){let n=Be.find(t=>t.kind===e);if(!n)throw new Error(`missing evidence product manifest entry for ${e}`);return n.invalidation}function p(e,n){return{scope:"file",kind:e,invalidation:{scope:"file",...n}}}function w(e,n){return{scope:"project",kind:e,invalidation:{scope:"project",...n}}}var Ue=_("source-text",{clearGroups:["whole-project","source-file"]}),He=_("source-lines",{clearGroups:["whole-project","source-file"]});function S(e,n){let t=n.replace(/\\/g,"/");return Ue.get(e,t,()=>{try{return Z(e.config.projectRoot,t,{inputKind:"indexed source file"})}catch(r){if(ee(r))return"";throw r}})}function Ke(e,n){let t=n.replace(/\\/g,"/");return He.get(e,t,()=>{let r=S(e,t);return r?r.split(`
79
+ `):[]})}var $e=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Xe(e){let n=$e.exec(e);return n?n[1]??"":null}function Ht(e,n,t){return ge(e,n,t).length>0}function Kt(e,n,t,r){let i=r.toLowerCase();return ge(e,n,t).some(a=>a.toLowerCase()===i)}function ge(e,n,t){if(t<=0)return[];let r=Ke(e,n);if(r.length===0)return[];let i=[];for(let a=t-1;a>=0&&a>=t-5;a-=1){let s=(r[a]??"").trim();if(s==="")continue;let o=Xe(s);if(o!==null){i.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return i}return i}function U(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function We(e){return e.replace(/'''[\s\S]*?'''/g,E).replace(/"""[\s\S]*?"""/g,E).replace(/#.*$/gm,E).replace(/\/\/.*$/gm,E).replace(/\/\*[\s\S]*?\*\//g,E).replace(/`(?:\\[\s\S]|[^`])*`/g,E).replace(/'(?:\\.|[^'\\\r\n])*'/g,E).replace(/"(?:\\.|[^"\\\r\n])*"/g,E)}function Qt(e){return me(e,{maskStrings:!1})}function Gt(e){return me(e,{maskStrings:!0})}function me(e,n){let t="",r=0,i=e.length;for(;r<i;){if(e[r]==="/"&&e[r+1]==="/"){let s=e.indexOf(`
80
80
  `,r),o=s===-1?i:s;t+=H(e,r,o),r=o;continue}if(e[r]==="/"&&e[r+1]==="*"){let s=e.indexOf("*/",r+2),o=s===-1?i:s+2;t+=H(e,r,o),r=o;continue}let a=e[r];if(a==="`"||a==="'"||a==='"'){let s=a,o=r+1;for(;o<i;){if(e[o]==="\\"){o+=2;continue}if(e[o]===s){o+=1;break}if(s!=="`"&&e[o]===`
81
81
  `)break;o+=1}t+=n.maskStrings?H(e,r,o):e.slice(r,o),r=o;continue}t+=a,r+=1}return t}function H(e,n,t){let r="";for(let i=n;i<t;i+=1)r+=e[i]===`
82
82
  `?`
83
- `:" ";return r}function E(e){return e.replace(/[^\r\n]/g," ")}var Qt=F("stripped-lines",{clearGroups:["whole-project","source-file"]});ee({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{R=null,T=""},clearFile:()=>{R=null,T=""}});var R=null,T="";function We(e){return R===e||(R=e,T=Xe(e)),T}function Gt(e,n,t){let r=We(e);return`${r.slice(0,n)}${" ".repeat(t-n)}${r.slice(t)}`}function qt(e,n){return new RegExp(`\\b${U(n)}\\b`,"m").test(e)}function Jt(e,n){let t=new Set,r=new RegExp(`\\b${U(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let i of e.matchAll(r)){let a=i[1];a&&t.add(a)}return[...t]}function Zt(e){let n=0;for(let t of e)t==="("&&(n+=1),t===")"&&(n-=1);return n}import{extname as me}from"path";var Ye={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function K(e){return Ye[me(e).toLowerCase()]??null}function $(e){return me(e).toLowerCase()===".vue"}import{createRequire as ze}from"module";var u=ze(import.meta.url),x=null,X=!1;function he(){if(X)return null;if(x)return x;try{return x=u("tree-sitter"),x}catch{return X=!0,null}}function an(e){if(e==="clojure")return"reader";let n=he();if(!n)return"unavailable";let t=ye(e);if(!t)return"unavailable";try{return new n().setLanguage(t),"ast"}catch{return C.add(e),"unavailable"}}var W=new Map,C=new Set;function ye(e){if(C.has(e))return null;let n=W.get(e);if(n)return n;let t;try{switch(e){case"rust":t=u("tree-sitter-rust");break;case"typescript":t=u("tree-sitter-typescript").typescript;break;case"tsx":t=u("tree-sitter-typescript").tsx;break;case"javascript":t=u("tree-sitter-javascript");break;case"python":t=u("tree-sitter-python");break;case"java":t=u("tree-sitter-java");break;case"kotlin":t=u("tree-sitter-kotlin");break;case"scala":t=u("tree-sitter-scala");break;case"ruby":t=u("tree-sitter-ruby");break;case"c":t=u("tree-sitter-c");break;case"cpp":t=u("tree-sitter-cpp");break;case"csharp":t=u("tree-sitter-c-sharp");break;case"php":t=u("tree-sitter-php").php;break;case"vb":{let r=u("tree-sitter-vb-dotnet");t=r.language??r;break}case"clojure":return C.add(e),null}}catch{return C.add(e),null}return W.set(e,t),t}var Y=new Map;function sn(){x=null,X=!1,W.clear(),C.clear(),Y.clear(),qe.clear()}function Qe(e){let n=Y.get(e);if(n)return n;let t=ye(e);if(!t)return null;let r=he();if(!r)return null;let i=new r;try{i.setLanguage(t)}catch{return C.add(e),null}return Y.set(e,i),i}function Ge(e,n){return e.parse(r=>r>=n.length?null:n.slice(r,Math.min(n.length,r+16384)))}function L(e,n){let t=Qe(e);if(!t)return null;try{return Ge(t,n)}catch{return null}}var qe=new Map;import{posix as z}from"path";import{parse as Je}from"@vue/compiler-sfc";var Ze=ne("vue-sfc-units");function un(e,n){let t=Se(n),r=v(e,t);return Ze.get(e,t,r,()=>Q(e,t,r))}function Se(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function et(e){let n=e?.toLowerCase();return!n||n==="js"||n==="javascript"||n==="jsx"?"javascript":n==="ts"||n==="typescript"?"typescript":n==="tsx"?"tsx":null}function fn(e){return!e||e.body.length===0?0:e.body.split(`
84
- `).length}function Q(e,n,t){let r={relativePath:n,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!t)return r;let i;try{i=Je(t,{filename:n})}catch(s){return r.errors.push(ve(s)),r}r.errors.push(...i.errors.map(ve));let{descriptor:a}=i;return a.template&&(r.template=A(e,n,"template",a.template)),a.script&&r.scripts.push(Ee(e,n,a.script,!1)),a.scriptSetup&&r.scripts.push(Ee(e,n,a.scriptSetup,!0)),r.styles=a.styles.map(s=>A(e,n,"style",s)),r.customBlocks=a.customBlocks.map(s=>A(e,n,"custom",s)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(s=>s?.errors??[])),r}function Ee(e,n,t,r){let i=A(e,n,"script",t);return{...i,kind:"script",setup:r,astLanguage:et(i.lang)}}function A(e,n,t,r){let i=nt(r.attrs),a=typeof i.lang=="string"?i.lang:null,s=typeof i.src=="string"?i.src:typeof r.src=="string"?r.src:void 0;if(s){let l=tt(n,s);if(!l)return{kind:t,ownerPath:n,sourcePath:n,external:!0,src:s,attrs:i,lang:a,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${t} block source: ${s}`]};let d=v(e,l),g=d?Math.max(0,d.split(`
85
- `).length-1):0;return{kind:t,ownerPath:n,sourcePath:l,external:!0,src:s,attrs:i,lang:a,body:d,startLine:0,endLine:g,errors:d?[]:[`Vue ${t} block source not found: ${l}`]}}let o=Math.max(0,r.loc.start.line-1);return{kind:t,ownerPath:n,sourcePath:n,external:!1,attrs:i,lang:a,body:r.content,startLine:o,endLine:Math.max(o,r.loc.end.line-1),errors:[]}}function tt(e,n){let t=n.split(/[?#]/,1)[0];if(!t||t.startsWith("/")||t.includes("://"))return null;let r=Se(z.normalize(z.join(z.dirname(e),t)));return r===".."||r.startsWith("../")?null:r}function nt(e){return{...e}}function ve(e){return e instanceof Error?e.message:String(e)}function G(e,n,t){let i=Q(e,n,t).scripts.filter(s=>s.astLanguage&&s.body.length>0),a=i[0]?.astLanguage;return a?{body:i.map(s=>`${`
83
+ `:" ";return r}function E(e){return e.replace(/[^\r\n]/g," ")}var qt=F("stripped-lines",{clearGroups:["whole-project","source-file"]});te({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{R=null,T=""},clearFile:()=>{R=null,T=""}});var R=null,T="";function Ye(e){return R===e||(R=e,T=We(e)),T}function Jt(e,n,t){let r=Ye(e);return`${r.slice(0,n)}${" ".repeat(t-n)}${r.slice(t)}`}function Zt(e,n){return new RegExp(`\\b${U(n)}\\b`,"m").test(e)}function en(e,n){let t=new Set,r=new RegExp(`\\b${U(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let i of e.matchAll(r)){let a=i[1];a&&t.add(a)}return[...t]}function tn(e){let n=0;for(let t of e)t==="("&&(n+=1),t===")"&&(n-=1);return n}import{extname as he}from"path";var ze={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function K(e){return ze[he(e).toLowerCase()]??null}function $(e){return he(e).toLowerCase()===".vue"}import{createRequire as Qe}from"module";var u=Qe(import.meta.url),x=null,X=!1;function ye(){if(X)return null;if(x)return x;try{return x=u("tree-sitter"),x}catch{return X=!0,null}}function on(e){if(e==="clojure")return"reader";let n=ye();if(!n)return"unavailable";let t=Ee(e);if(!t)return"unavailable";try{return new n().setLanguage(t),"ast"}catch{return C.add(e),"unavailable"}}var W=new Map,C=new Set;function Ee(e){if(C.has(e))return null;let n=W.get(e);if(n)return n;let t;try{switch(e){case"rust":t=u("tree-sitter-rust");break;case"typescript":t=u("tree-sitter-typescript").typescript;break;case"tsx":t=u("tree-sitter-typescript").tsx;break;case"javascript":t=u("tree-sitter-javascript");break;case"python":t=u("tree-sitter-python");break;case"java":t=u("tree-sitter-java");break;case"kotlin":t=u("tree-sitter-kotlin");break;case"scala":t=u("tree-sitter-scala");break;case"ruby":t=u("tree-sitter-ruby");break;case"c":t=u("tree-sitter-c");break;case"cpp":t=u("tree-sitter-cpp");break;case"csharp":t=u("tree-sitter-c-sharp");break;case"php":t=u("tree-sitter-php").php;break;case"vb":{let r=u("tree-sitter-vb-dotnet");t=r.language??r;break}case"clojure":return C.add(e),null}}catch{return C.add(e),null}return W.set(e,t),t}var Y=new Map;function cn(){x=null,X=!1,W.clear(),C.clear(),Y.clear(),Je.clear()}function Ge(e){let n=Y.get(e);if(n)return n;let t=Ee(e);if(!t)return null;let r=ye();if(!r)return null;let i=new r;try{i.setLanguage(t)}catch{return C.add(e),null}return Y.set(e,i),i}function qe(e,n){return e.parse(r=>r>=n.length?null:n.slice(r,Math.min(n.length,r+16384)))}function L(e,n){let t=Ge(e);if(!t)return null;try{return qe(t,n)}catch{return null}}var Je=new Map;import{posix as z}from"path";import{parse as Ze}from"@vue/compiler-sfc";var et=re("vue-sfc-units");function gn(e,n){let t=_e(n),r=S(e,t);return et.get(e,t,r,()=>Q(e,t,r))}function _e(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function tt(e){let n=e?.toLowerCase();return!n||n==="js"||n==="javascript"||n==="jsx"?"javascript":n==="ts"||n==="typescript"?"typescript":n==="tsx"?"tsx":null}function mn(e){return!e||e.body.length===0?0:e.body.split(`
84
+ `).length}function Q(e,n,t){let r={relativePath:n,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!t)return r;let i;try{i=Ze(t,{filename:n})}catch(s){return r.errors.push(Se(s)),r}r.errors.push(...i.errors.map(Se));let{descriptor:a}=i;return a.template&&(r.template=A(e,n,"template",a.template)),a.script&&r.scripts.push(ve(e,n,a.script,!1)),a.scriptSetup&&r.scripts.push(ve(e,n,a.scriptSetup,!0)),r.styles=a.styles.map(s=>A(e,n,"style",s)),r.customBlocks=a.customBlocks.map(s=>A(e,n,"custom",s)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(s=>s?.errors??[])),r}function ve(e,n,t,r){let i=A(e,n,"script",t);return{...i,kind:"script",setup:r,astLanguage:tt(i.lang)}}function A(e,n,t,r){let i=rt(r.attrs),a=typeof i.lang=="string"?i.lang:null,s=typeof i.src=="string"?i.src:typeof r.src=="string"?r.src:void 0;if(s){let l=nt(n,s);if(!l)return{kind:t,ownerPath:n,sourcePath:n,external:!0,src:s,attrs:i,lang:a,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${t} block source: ${s}`]};let d=S(e,l),g=d?Math.max(0,d.split(`
85
+ `).length-1):0;return{kind:t,ownerPath:n,sourcePath:l,external:!0,src:s,attrs:i,lang:a,body:d,startLine:0,endLine:g,errors:d?[]:[`Vue ${t} block source not found: ${l}`]}}let o=Math.max(0,r.loc.start.line-1);return{kind:t,ownerPath:n,sourcePath:n,external:!1,attrs:i,lang:a,body:r.content,startLine:o,endLine:Math.max(o,r.loc.end.line-1),errors:[]}}function nt(e,n){let t=n.split(/[?#]/,1)[0];if(!t||t.startsWith("/")||t.includes("://"))return null;let r=_e(z.normalize(z.join(z.dirname(e),t)));return r===".."||r.startsWith("../")?null:r}function rt(e){return{...e}}function Se(e){return e instanceof Error?e.message:String(e)}function G(e,n,t){let i=Q(e,n,t).scripts.filter(s=>s.astLanguage&&s.body.length>0),a=i[0]?.astLanguage;return a?{body:i.map(s=>`${`
86
86
  `.repeat(s.startLine)}${s.body}`).join(`
87
- `),startLine:0,language:a}:null}var _e=F("ast-trees",{clearGroups:["whole-project","source-file"]});function Nn(e,n){if($(n))return rt(e,n);let t=K(n);if(!t)return null;let r=v(e,n);return r?_e.get(e,n,r,()=>L(t,r)):null}function Cn(e,n,t){if($(n)){let a=G(e,n,t);if(!a)return null;let s=L(a.language,`
88
- `.repeat(a.startLine)+a.body);return s?{tree:s,language:a.language}:null}let r=K(n);if(!r)return null;let i=L(r,t);return i?{tree:i,language:r}:null}function rt(e,n){let t=v(e,n);return t?_e.get(e,n,t,()=>{let r=G(e,n,t);if(!r)return null;let i=`
89
- `.repeat(r.startLine)+r.body;return L(r.language,i)}):null}function Tn(e,n){let t=at(e,n);if(!t)return null;let r=P(t);if(!r)return null;let i=st(t);return{calleeLeaf:r,calleeQualifier:i?it(t):void 0,calleeText:t.text,memberAccess:i,line:e.startPosition.row}}function it(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function at(e,n){if(n==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(n==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(n==="typescript"||n==="tsx"||n==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function st(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function P(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let n=e.namedChild(e.namedChildCount-1);return n?P(n):null}case"generic_function":{let n=e.childForFieldName("function")??e.namedChild(0);return n?P(n):null}case"scoped_identifier":{let n=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return n?P(n):null}case"super":case"self":case"this":return null;default:return null}}function D(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var ot=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),Ne=new Set(["arrow_function","function_expression","generator_function"]);function ct(e,n){let t=ut(e,n);if(t)return t;if(!pt(e.type,n))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,definitionNode:e,functionNode:e}:null}function kn(e,n){let t=ct(e,n);if(!t)return null;let{definitionNode:r,functionNode:i}=t;return{name:t.name,startLine:r.startPosition.row,endLine:r.endPosition.row,paramCount:ft(i),params:lt(i),paramsEndLine:dt(i),isLiteralPassthrough:gt(i,n)}}function be(e){return e.namedChildren.find(n=>n.type==="parameters"||n.type==="formal_parameters")}function lt(e){let n=be(e);if(!n)return[];let t=[];for(let r of n.namedChildren){if(D(r))continue;if(r.type==="identifier"){t.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(o=>o.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),a=r.childForFieldName("pattern");if(!i&&a&&a.type==="identifier"){t.push({name:a.text,simple:!0});continue}let s=r.namedChildren.find(o=>o.type==="identifier");t.push({name:a?.type==="identifier"?a.text:s?.text??"",simple:!1})}return t}function dt(e){let n=be(e);return n?n.endPosition.row:e.startPosition.row}function pt(e,n){return n==="rust"?e==="function_item"||e==="function_signature_item":n==="python"?e==="function_definition":n==="typescript"||n==="tsx"||n==="javascript"?ot.has(e):!1}function ut(e,n){if(n!=="typescript"&&n!=="tsx"&&n!=="javascript")return null;if(e.type==="variable_declarator"){let t=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!t||!r)return null;let i=Ce(r);return i?{name:t.text,definitionNode:e,functionNode:i}:null}if(e.type==="public_field_definition"){let t=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!t||!r)return null;let i=Ce(r);return i?{name:t.text,definitionNode:e,functionNode:i}:null}return null}function Ce(e){if(Ne.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(i=>i.type==="arguments"))?.namedChildren??[]).filter(i=>Ne.has(i.type));return r.length===1?r[0]:null}function ft(e){let n=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!n)return 0;let t=0;for(let r of n.namedChildren)D(r)||(t+=1);return t}function gt(e,n){let t=e.namedChildren.find(c=>c.type==="block"||c.type==="statement_block");if(!t)return!1;let r=t.namedChildren.filter(c=>!D(c));if(r.length!==1)return!1;let i=r[0],a=null;if(i.type==="return_statement"||i.type==="expression_statement"?a=i.namedChild(0)??null:n==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(a=i),!a)return!1;let s=n==="python"?"call":"call_expression";if(a.type!==s)return!1;let o=a.namedChildren.find(c=>c.type==="arguments"||c.type==="argument_list");if(!o)return!1;let l=o.namedChildren.filter(c=>!D(c)),d=e.namedChildren.find(c=>c.type==="parameters"||c.type==="formal_parameters");if(!d)return!1;let g=[];for(let c of d.namedChildren){if(c.type==="identifier"){g.push(c.text);continue}let b=c.namedChildren.find(Te=>Te.type==="identifier");b&&g.push(b.text)}if(l.length!==g.length)return!1;for(let c=0;c<g.length;c+=1){let b=l[c];if(b.type!=="identifier"||b.text!==g[c])return!1}return!0}export{ie as a,Ct as b,ae as c,bt as d,Tt as e,xt as f,Lt as g,Dt as h,Pt as i,jt as j,Ot as k,v as l,He as m,$e as n,Bt as o,Ut as p,U as q,Xe as r,Yt as s,zt as t,Gt as u,qt as v,Jt as w,Zt as x,K as y,$ as z,an as A,sn as B,L as C,un as D,fn as E,G as F,Nn as G,Cn as H,Tn as I,P as J,D as K,ct as L,kn as M};
90
- //# sourceMappingURL=chunk-5FWR5HLG.js.map
87
+ `),startLine:0,language:a}:null}var Ne=F("ast-trees",{clearGroups:["whole-project","source-file"]});function bn(e,n){if($(n))return it(e,n);let t=K(n);if(!t)return null;let r=S(e,n);return r?Ne.get(e,n,r,()=>L(t,r)):null}function Tn(e,n,t){if($(n)){let a=G(e,n,t);if(!a)return null;let s=L(a.language,`
88
+ `.repeat(a.startLine)+a.body);return s?{tree:s,language:a.language}:null}let r=K(n);if(!r)return null;let i=L(r,t);return i?{tree:i,language:r}:null}function it(e,n){let t=S(e,n);return t?Ne.get(e,n,t,()=>{let r=G(e,n,t);if(!r)return null;let i=`
89
+ `.repeat(r.startLine)+r.body;return L(r.language,i)}):null}function Ln(e,n){let t=st(e,n);if(!t)return null;let r=P(t);if(!r)return null;let i=ot(t);return{calleeLeaf:r,calleeQualifier:i?at(t):void 0,calleeText:t.text,memberAccess:i,line:e.startPosition.row}}function at(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function st(e,n){if(n==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(n==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(n==="typescript"||n==="tsx"||n==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function ot(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function P(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let n=e.namedChild(e.namedChildCount-1);return n?P(n):null}case"generic_function":{let n=e.childForFieldName("function")??e.namedChild(0);return n?P(n):null}case"scoped_identifier":{let n=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return n?P(n):null}case"super":case"self":case"this":return null;default:return null}}function D(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var ct=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),Ce=new Set(["arrow_function","function_expression","generator_function"]);function lt(e,n){let t=ft(e,n);if(t)return t;if(!ut(e.type,n))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,definitionNode:e,functionNode:e}:null}function wn(e,n){let t=lt(e,n);if(!t)return null;let{definitionNode:r,functionNode:i}=t;return{name:t.name,startLine:r.startPosition.row,endLine:r.endPosition.row,paramCount:gt(i),params:dt(i),paramsEndLine:pt(i),isLiteralPassthrough:mt(i,n)}}function Te(e){return e.namedChildren.find(n=>n.type==="parameters"||n.type==="formal_parameters")}function dt(e){let n=Te(e);if(!n)return[];let t=[];for(let r of n.namedChildren){if(D(r))continue;if(r.type==="identifier"){t.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(o=>o.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),a=r.childForFieldName("pattern");if(!i&&a&&a.type==="identifier"){t.push({name:a.text,simple:!0});continue}let s=r.namedChildren.find(o=>o.type==="identifier");t.push({name:a?.type==="identifier"?a.text:s?.text??"",simple:!1})}return t}function pt(e){let n=Te(e);return n?n.endPosition.row:e.startPosition.row}function ut(e,n){return n==="rust"?e==="function_item"||e==="function_signature_item":n==="python"?e==="function_definition":n==="typescript"||n==="tsx"||n==="javascript"?ct.has(e):!1}function ft(e,n){if(n!=="typescript"&&n!=="tsx"&&n!=="javascript")return null;if(e.type==="variable_declarator"){let t=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!t||!r)return null;let i=be(r);return i?{name:t.text,definitionNode:e,functionNode:i}:null}if(e.type==="public_field_definition"){let t=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!t||!r)return null;let i=be(r);return i?{name:t.text,definitionNode:e,functionNode:i}:null}return null}function be(e){if(Ce.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(i=>i.type==="arguments"))?.namedChildren??[]).filter(i=>Ce.has(i.type));return r.length===1?r[0]:null}function gt(e){let n=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!n)return 0;let t=0;for(let r of n.namedChildren)D(r)||(t+=1);return t}function mt(e,n){let t=e.namedChildren.find(c=>c.type==="block"||c.type==="statement_block");if(!t)return!1;let r=t.namedChildren.filter(c=>!D(c));if(r.length!==1)return!1;let i=r[0],a=null;if(i.type==="return_statement"||i.type==="expression_statement"?a=i.namedChild(0)??null:n==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(a=i),!a)return!1;let s=n==="python"?"call":"call_expression";if(a.type!==s)return!1;let o=a.namedChildren.find(c=>c.type==="arguments"||c.type==="argument_list");if(!o)return!1;let l=o.namedChildren.filter(c=>!D(c)),d=e.namedChildren.find(c=>c.type==="parameters"||c.type==="formal_parameters");if(!d)return!1;let g=[];for(let c of d.namedChildren){if(c.type==="identifier"){g.push(c.text);continue}let b=c.namedChildren.find(xe=>xe.type==="identifier");b&&g.push(b.text)}if(l.length!==g.length)return!1;for(let c=0;c<g.length;c+=1){let b=l[c];if(b.type!=="identifier"||b.text!==g[c])return!1}return!0}export{ae as a,Tt as b,se as c,xt as d,Lt as e,Dt as f,kt as g,Ft as h,Ot as i,It as j,Vt as k,S as l,Ke as m,Xe as n,Ht as o,Kt as p,U as q,We as r,Qt as s,Gt as t,Jt as u,Zt as v,en as w,tn as x,K as y,$ as z,on as A,cn as B,L as C,gn as D,mn as E,G as F,bn as G,Tn as H,Ln as I,P as J,D as K,lt as L,wn as M};
90
+ //# sourceMappingURL=chunk-XDQ6QJF5.js.map
@@ -1,7 +1,7 @@
1
- import{d as j}from"./chunk-VGWZ4MOY.js";import{a as k}from"./chunk-M2Y6PCFE.js";import{a as _}from"./chunk-U7NUXDQO.js";import{b as C}from"./chunk-TJWVT4DO.js";import{a as T}from"./chunk-3VJ3OCRE.js";import{g as S}from"./chunk-MSI3K7PJ.js";import{a as O,b as w,e as $}from"./chunk-SGMNWYTH.js";import{d as L,e as I,t as g}from"./chunk-GVAF222T.js";import{f as B,p as M}from"./chunk-F74LZWCE.js";import{x as P}from"./chunk-7GAK2F3H.js";import{a as F}from"./chunk-UC2FD2PS.js";import{basename as le,extname as U}from"path";var ee=12,ne=280;function y(n,e,t,o){let i=te(n,e,t,o);if(i.size===0)return se();let r=[],s=new Set,l=(a,d,c,f)=>{if(d===e&&c<=o&&f>=t)return;let b=`${d}:${c}:${f}:${a}`;s.has(b)||(s.add(b),r.push({name:a,relativePath:d,startLine:c,endLine:f}))};for(let a of g(n,e))i.has(a.leaf)&&l(a.leaf,a.relativePath,a.startLine,a.endLine);for(let a of M(n,e)){let d=a.localName;if(!d||!i.has(d)||!a.sourcePath||a.kind==="namespace")continue;let c=a.importedName==="default"?d:a.importedName;for(let f of T(n,a.sourcePath,c,{maxReexportDepth:3}))l(d,f.relativePath,f.startLine,f.endLine)}r.sort(W);let u=r.map(a=>{let d=ie(n,a);return d?{...a,source:d}:null}).filter(a=>a!==null).slice(0,ee);return D(u)}function A(n,e=[]){return D(re(n.flatMap(t=>t?.inline??[]),e))}function Ne(n){return n?n.inline.reduce((e,t)=>e+t.name.length+t.source.length+32,0):0}function te(n,e,t,o){let i=B(n,e),r=new Set;if(!i)return r;for(let s=t;s<=o;s+=1)for(let l of i.identifiersByLine[s]??[])r.add(l);return r}function ie(n,e){if(e.startLine!==e.endLine)return null;let t=(P(n,e.relativePath)[e.startLine]??"").trim();if(!t||t.length>ne)return null;let o=t.indexOf("=");if(o<0||t[o+1]===">")return null;let i=t.slice(o+1).replace(/(?:\/\/|#).*$/u,"").trim();if(!i||i.includes("${")||/\b(?:function|class|struct|interface|trait|enum|lambda)\b/u.test(i))return null;let s=i.replace(/(['"`])(?:\\.|(?!\1).)*\1/gu,"").replace(/\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)n?\b/gu,""),l=new Set(["true","false","null","undefined","None","True","False"]);return(s.match(/[A-Za-z_][A-Za-z0-9_]*/gu)??[]).some(a=>!l.has(a))?null:t}function re(n,e){let t=new Map;for(let o of n){if(oe(o,e))continue;let i=`${o.relativePath}:${o.startLine}:${o.endLine}:${o.name}`;t.has(i)||t.set(i,{...o})}return[...t.values()].sort(W)}function oe(n,e){return e.some(t=>t.relativePath===n.relativePath&&t.startLine<=n.startLine&&t.endLine>=n.endLine)}function W(n,e){return n.relativePath.localeCompare(e.relativePath)||n.startLine-e.startLine||n.name.localeCompare(e.name)}function D(n){return{coverage:"indexed-project-literal-values",inline:n}}function se(){return D([])}function Ae(n,e,t={}){let{context:o=0}=t,i=Y(e);if(i)return q(n,i.filePath,i.startLine,i.endLine,o);let r=Q(n,e);if(r)return K(n,r);let s=O(n,e);return s?p(n,s,o):null}function We(n,e,t={}){if(e.length===0)throw new RangeError("code requires at least one selector.");if(e.length>24)throw new RangeError(`code accepts at most ${24} selectors per complete packet; received ${e.length}.`);let o=t.context??0,i=t.members??"exported",r=e.map(u=>ue(n,u,o,i)),s=r.flatMap(u=>u.results),l=s.map(u=>({relativePath:u.relativePath,startLine:u.startLine,endLine:u.endLine}));return{requested:e.length,matched:r.filter(u=>u.status==="matched").length,ambiguous:r.filter(u=>u.status==="ambiguous").length,missing:r.filter(u=>u.status==="missing").length,entries:r,bindingClosure:A(s.map(u=>u.bindingClosure),l)}}function ue(n,e,t,o){let i=Y(e);if(i){let d=q(n,i.filePath,i.startLine,i.endLine,t);return d?de(n,e,d,t):x(n,e,"definition-source-unreadable")}let r=Q(n,e);if(r)return fe(n,e,r,t,o);let s=w(n,e);if(!s.match)return x(n,e,"definition-not-found");let l=Le(n,s),u=l.map(V);if(s.total>1){let d=s.total<=4&&l.length===s.total;return{selector:e,status:"ambiguous",kind:"source",totalCandidates:s.total,results:d?l.flatMap(c=>{let f=p(n,c,t);return f?[f]:[]}):[],definitions:[],candidates:u,omittedCandidates:Math.max(0,s.total-u.length),suggestions:[]}}let a=p(n,s.match,t);return a?ve(e,a):x(n,e,"definition-source-unreadable")}function de(n,e,t,o){let i=g(n,t.relativePath).filter(a=>!X(a,t.relativePath)),r=ce(n,t,i),s=G(r.map(a=>p(n,a,o)).filter(a=>a!==null)).filter(a=>!J(t,a)),l=new Set(s.map(a=>a.symbol)),u=r.filter(a=>!l.has(a.symbol)&&!(t.startLine<=a.startLine&&t.endLine>=a.endLine)).map(V);return{selector:e,status:"matched",kind:"source",totalCandidates:1,results:[t,...s],definitions:[],candidates:[],omittedCandidates:0,suggestions:[],rangeCoverage:{basis:"requested-range-and-same-file-call-closure",referencedDefinitions:r.length,returnedDefinitions:r.length-u.length,returnedBodies:s.length,omittedDefinitions:u.length,omittedLedger:u}}}function ce(n,e,t){if(!h(e.freshness))return[];if(t.length===0)return[];let o=S(n,t,{additive:!1,semantic:!1}),i=new Map;for(let s of t){let l=i.get(s.symbol)??[];l.push(s),i.set(s.symbol,l)}let r=new Map;for(let s of t)if(!(s.endLine<e.startLine||s.startLine>e.endLine)){for(let l of o.get(s.symbolId)??[])if(l.file===e.relativePath&&!(l.source==="ast-callsite"&&(l.chunkId<e.startLine||l.chunkId>e.endLine)))for(let u of i.get(l.symbol)??[])r.set(u.symbolId,u)}return H(n,[...r.values()],t)}function fe(n,e,t,o,i){let r=t.relativePath,s=ge(n,r),l=h(t.freshness)?g(n,r).filter(m=>!X(m,r)):[],u=l.filter(m=>_(n,m)),a=u.length>0?u:me(s,l),d=i==="all"?[]:H(n,a,l),c=i==="all"||l.length===0?[K(n,t)]:G(d.map(m=>p(n,m,o)).filter(m=>m!==null)),f=he(s,c),b=be(r,s,c),N=Ce(s);return{selector:e,status:"matched",kind:"file-source",totalCandidates:1,results:c,definitions:[],candidates:[],omittedCandidates:0,suggestions:[],fileCoverage:{members:i,basis:i==="all"||l.length===0?"complete-file-source":u.length>0?"explicit-exports-and-same-file-reference-closure":"top-level-and-same-file-reference-closure",totalDefinitions:N,returnedDefinitions:f,returnedBodies:c.length,omittedDefinitions:Math.max(0,N-f),omittedLedger:b}}}function me(n,e){let t=new Set(n.map(o=>o.symbol));return e.filter(o=>t.has(o.symbol))}function ge(n,e){return k(n,e).flatMap(t=>pe(t,e)?t.children:[t])}function X(n,e){return z(e).has(n.leaf)}function pe(n,e){return z(e).has(I(n.symbol))}function z(n){let e=le(n);return new Set([e,e.slice(0,Math.max(0,e.length-U(e).length))])}function H(n,e,t){if(e.length===0)return[];let o=S(n,t,{additive:!0,semantic:!1}),i=new Map;for(let l of t){let u=i.get(l.symbol)??[];u.push(l),i.set(l.symbol,u)}let r=new Map,s=[...e];for(;s.length>0;){let l=s.shift();if(!r.has(l.symbolId)){r.set(l.symbolId,l);for(let u of o.get(l.symbolId)??[])for(let a of i.get(u.symbol)??[])r.has(a.symbolId)||s.push(a)}}return[...r.values()].sort(ye)}function G(n){let e=[...n].sort((o,i)=>o.relativePath.localeCompare(i.relativePath)||o.startLine-i.startLine||i.endLine-o.endLine),t=[];for(let o of e)t.some(i=>J(i,o))||t.push(o);return t}function K(n,e){let t=e.text.split(`
1
+ import{d as j}from"./chunk-RVBRPBLQ.js";import{a as k}from"./chunk-CAH322MC.js";import{a as _}from"./chunk-K3PFL5QQ.js";import{b as C}from"./chunk-JGXLB7PR.js";import{a as T}from"./chunk-LMPOC372.js";import{g as S}from"./chunk-2QJAVISG.js";import{a as O,b as w,e as $}from"./chunk-DOQLO74K.js";import{d as L,e as I,t as g}from"./chunk-TNLOX4TN.js";import{f as B,p as M}from"./chunk-RGBZDOUO.js";import{x as P}from"./chunk-23AD24QZ.js";import{a as F}from"./chunk-6I55VYFG.js";import{basename as le,extname as U}from"path";var ee=12,ne=280;function y(n,e,t,o){let i=te(n,e,t,o);if(i.size===0)return se();let r=[],s=new Set,l=(a,d,c,f)=>{if(d===e&&c<=o&&f>=t)return;let b=`${d}:${c}:${f}:${a}`;s.has(b)||(s.add(b),r.push({name:a,relativePath:d,startLine:c,endLine:f}))};for(let a of g(n,e))i.has(a.leaf)&&l(a.leaf,a.relativePath,a.startLine,a.endLine);for(let a of M(n,e)){let d=a.localName;if(!d||!i.has(d)||!a.sourcePath||a.kind==="namespace")continue;let c=a.importedName==="default"?d:a.importedName;for(let f of T(n,a.sourcePath,c,{maxReexportDepth:3}))l(d,f.relativePath,f.startLine,f.endLine)}r.sort(W);let u=r.map(a=>{let d=ie(n,a);return d?{...a,source:d}:null}).filter(a=>a!==null).slice(0,ee);return D(u)}function A(n,e=[]){return D(re(n.flatMap(t=>t?.inline??[]),e))}function Ne(n){return n?n.inline.reduce((e,t)=>e+t.name.length+t.source.length+32,0):0}function te(n,e,t,o){let i=B(n,e),r=new Set;if(!i)return r;for(let s=t;s<=o;s+=1)for(let l of i.identifiersByLine[s]??[])r.add(l);return r}function ie(n,e){if(e.startLine!==e.endLine)return null;let t=(P(n,e.relativePath)[e.startLine]??"").trim();if(!t||t.length>ne)return null;let o=t.indexOf("=");if(o<0||t[o+1]===">")return null;let i=t.slice(o+1).replace(/(?:\/\/|#).*$/u,"").trim();if(!i||i.includes("${")||/\b(?:function|class|struct|interface|trait|enum|lambda)\b/u.test(i))return null;let s=i.replace(/(['"`])(?:\\.|(?!\1).)*\1/gu,"").replace(/\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)n?\b/gu,""),l=new Set(["true","false","null","undefined","None","True","False"]);return(s.match(/[A-Za-z_][A-Za-z0-9_]*/gu)??[]).some(a=>!l.has(a))?null:t}function re(n,e){let t=new Map;for(let o of n){if(oe(o,e))continue;let i=`${o.relativePath}:${o.startLine}:${o.endLine}:${o.name}`;t.has(i)||t.set(i,{...o})}return[...t.values()].sort(W)}function oe(n,e){return e.some(t=>t.relativePath===n.relativePath&&t.startLine<=n.startLine&&t.endLine>=n.endLine)}function W(n,e){return n.relativePath.localeCompare(e.relativePath)||n.startLine-e.startLine||n.name.localeCompare(e.name)}function D(n){return{coverage:"indexed-project-literal-values",inline:n}}function se(){return D([])}function Ae(n,e,t={}){let{context:o=0}=t,i=Y(e);if(i)return q(n,i.filePath,i.startLine,i.endLine,o);let r=Q(n,e);if(r)return K(n,r);let s=O(n,e);return s?p(n,s,o):null}function We(n,e,t={}){if(e.length===0)throw new RangeError("code requires at least one selector.");if(e.length>24)throw new RangeError(`code accepts at most ${24} selectors per complete packet; received ${e.length}.`);let o=t.context??0,i=t.members??"exported",r=e.map(u=>ue(n,u,o,i)),s=r.flatMap(u=>u.results),l=s.map(u=>({relativePath:u.relativePath,startLine:u.startLine,endLine:u.endLine}));return{requested:e.length,matched:r.filter(u=>u.status==="matched").length,ambiguous:r.filter(u=>u.status==="ambiguous").length,missing:r.filter(u=>u.status==="missing").length,entries:r,bindingClosure:A(s.map(u=>u.bindingClosure),l)}}function ue(n,e,t,o){let i=Y(e);if(i){let d=q(n,i.filePath,i.startLine,i.endLine,t);return d?de(n,e,d,t):x(n,e,"definition-source-unreadable")}let r=Q(n,e);if(r)return fe(n,e,r,t,o);let s=w(n,e);if(!s.match)return x(n,e,"definition-not-found");let l=Le(n,s),u=l.map(V);if(s.total>1){let d=s.total<=4&&l.length===s.total;return{selector:e,status:"ambiguous",kind:"source",totalCandidates:s.total,results:d?l.flatMap(c=>{let f=p(n,c,t);return f?[f]:[]}):[],definitions:[],candidates:u,omittedCandidates:Math.max(0,s.total-u.length),suggestions:[]}}let a=p(n,s.match,t);return a?ve(e,a):x(n,e,"definition-source-unreadable")}function de(n,e,t,o){let i=g(n,t.relativePath).filter(a=>!X(a,t.relativePath)),r=ce(n,t,i),s=G(r.map(a=>p(n,a,o)).filter(a=>a!==null)).filter(a=>!J(t,a)),l=new Set(s.map(a=>a.symbol)),u=r.filter(a=>!l.has(a.symbol)&&!(t.startLine<=a.startLine&&t.endLine>=a.endLine)).map(V);return{selector:e,status:"matched",kind:"source",totalCandidates:1,results:[t,...s],definitions:[],candidates:[],omittedCandidates:0,suggestions:[],rangeCoverage:{basis:"requested-range-and-same-file-call-closure",referencedDefinitions:r.length,returnedDefinitions:r.length-u.length,returnedBodies:s.length,omittedDefinitions:u.length,omittedLedger:u}}}function ce(n,e,t){if(!h(e.freshness))return[];if(t.length===0)return[];let o=S(n,t,{additive:!1,semantic:!1}),i=new Map;for(let s of t){let l=i.get(s.symbol)??[];l.push(s),i.set(s.symbol,l)}let r=new Map;for(let s of t)if(!(s.endLine<e.startLine||s.startLine>e.endLine)){for(let l of o.get(s.symbolId)??[])if(l.file===e.relativePath&&!(l.source==="ast-callsite"&&(l.chunkId<e.startLine||l.chunkId>e.endLine)))for(let u of i.get(l.symbol)??[])r.set(u.symbolId,u)}return H(n,[...r.values()],t)}function fe(n,e,t,o,i){let r=t.relativePath,s=ge(n,r),l=h(t.freshness)?g(n,r).filter(m=>!X(m,r)):[],u=l.filter(m=>_(n,m)),a=u.length>0?u:me(s,l),d=i==="all"?[]:H(n,a,l),c=i==="all"||l.length===0?[K(n,t)]:G(d.map(m=>p(n,m,o)).filter(m=>m!==null)),f=he(s,c),b=be(r,s,c),N=Ce(s);return{selector:e,status:"matched",kind:"file-source",totalCandidates:1,results:c,definitions:[],candidates:[],omittedCandidates:0,suggestions:[],fileCoverage:{members:i,basis:i==="all"||l.length===0?"complete-file-source":u.length>0?"explicit-exports-and-same-file-reference-closure":"top-level-and-same-file-reference-closure",totalDefinitions:N,returnedDefinitions:f,returnedBodies:c.length,omittedDefinitions:Math.max(0,N-f),omittedLedger:b}}}function me(n,e){let t=new Set(n.map(o=>o.symbol));return e.filter(o=>t.has(o.symbol))}function ge(n,e){return k(n,e).flatMap(t=>pe(t,e)?t.children:[t])}function X(n,e){return z(e).has(n.leaf)}function pe(n,e){return z(e).has(I(n.symbol))}function z(n){let e=le(n);return new Set([e,e.slice(0,Math.max(0,e.length-U(e).length))])}function H(n,e,t){if(e.length===0)return[];let o=S(n,t,{additive:!0,semantic:!1}),i=new Map;for(let l of t){let u=i.get(l.symbol)??[];u.push(l),i.set(l.symbol,u)}let r=new Map,s=[...e];for(;s.length>0;){let l=s.shift();if(!r.has(l.symbolId)){r.set(l.symbolId,l);for(let u of o.get(l.symbolId)??[])for(let a of i.get(u.symbol)??[])r.has(a.symbolId)||s.push(a)}}return[...r.values()].sort(ye)}function G(n){let e=[...n].sort((o,i)=>o.relativePath.localeCompare(i.relativePath)||o.startLine-i.startLine||i.endLine-o.endLine),t=[];for(let o of e)t.some(i=>J(i,o))||t.push(o);return t}function K(n,e){let t=e.text.split(`
2
2
  `);return{symbol:e.relativePath,shortName:e.relativePath,relativePath:e.relativePath,startLine:0,endLine:Math.max(0,t.length-1),language:n.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath)?.language??E(e.relativePath),source:e.text,freshness:e.freshness,...h(e.freshness)?{bindingClosure:y(n,e.relativePath,0,Math.max(0,t.length-1))}:{}}}function he(n,e){return v(n).filter(t=>e.some(o=>R(t,o))).length}function be(n,e,t){let o=[];return Z(o,n,e,t,0),o}function Z(n,e,t,o,i){for(let r of t){if(o.some(l=>R(r,l)))continue;let s=v(r.children).filter(l=>!o.some(u=>R(l,u))).length;n.push({symbol:r.symbol,shortName:r.shortName,relativePath:e,startLine:r.startLine,endLine:r.endLine,signature:r.signature,depth:i,nestedDefinitions:s}),Z(n,e,r.children,o,i+1)}}function v(n){return n.flatMap(e=>[e,...v(e.children)])}function Ce(n){return v(n).length}function R(n,e){return e.startLine<=n.startLine&&e.endLine>=n.endLine}function J(n,e){return n.relativePath===e.relativePath&&n.startLine<=e.startLine&&n.endLine>=e.endLine}function ye(n,e){return n.startLine-e.startLine||e.endLine-n.endLine||n.symbol.localeCompare(e.symbol)}function ve(n,e){return{selector:n,status:"matched",kind:"source",totalCandidates:1,results:[e],definitions:[],candidates:[],omittedCandidates:0,suggestions:[]}}function x(n,e,t){return{selector:e,status:"missing",kind:"source",totalCandidates:0,results:[],definitions:[],candidates:[],omittedCandidates:0,suggestions:$(n,e,5),reason:t}}function Q(n,e){try{return C(n,e)}catch(t){if(t instanceof F)return null;throw t}}function Le(n,e){if(!e.match)return[];let t=[e.match];for(let i of e.candidates){let r=g(n,i.relativePath).find(s=>s.symbol===i.symbol&&s.startLine===i.startLine);r&&t.push(r)}let o=new Set;return t.filter(i=>{let r=`${i.relativePath}:${i.startLine}:${i.endLine}:${i.symbol}`;return o.has(r)?!1:(o.add(r),!0)})}function V(n){return{symbol:n.symbol,shortName:L(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine}}function Y(n){let e=n.match(/^(.+):(\d+)-(\d+)$/);if(!e)return null;let t=Number(e[2]),o=Number(e[3]);if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`Source range start line must be a positive integer, got "${e[2]}".`);if(!Number.isSafeInteger(o)||o<t)throw new RangeError(`Source range end line must be an integer at or after ${t}, got "${e[3]}".`);return{filePath:e[1],startLine:t,endLine:o}}function p(n,e,t){let o=n.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),i=C(n,e.relativePath);if(!i)return null;let s=i.text.split(`
3
3
  `),l=e.endLine<=e.startLine?j(n,e.relativePath,e.startLine,Number.MAX_SAFE_INTEGER):null,u=l?.unitType?l.unitStartLine:e.startLine,a=l?.unitType?l.unitEndLine:e.endLine,d=Math.max(0,u-t),c=Math.min(s.length-1,a+t),f=s.slice(d,c+1).join(`
4
4
  `);return{symbol:e.symbol,shortName:L(e.symbol),relativePath:e.relativePath,startLine:d,endLine:c,language:o?.language??E(e.relativePath),source:f,freshness:i.freshness,...h(i.freshness)?{bindingClosure:y(n,e.relativePath,d,c)}:{}}}function q(n,e,t,o,i){let r=C(n,e);if(!r)return null;let s=n.get("SELECT language FROM documents WHERE relative_path = ?",r.relativePath),u=r.text.split(`
5
5
  `);if(t>u.length)return null;let a=Math.max(0,t-1-i),d=Math.min(u.length-1,o-1+i),c=u.slice(a,d+1).join(`
6
6
  `);return{symbol:`${r.relativePath}:${t}-${o}`,shortName:`${r.relativePath}:${t}-${o}`,relativePath:r.relativePath,startLine:a,endLine:d,language:s?.language??E(r.relativePath),source:c,freshness:r.freshness,...h(r.freshness)?{bindingClosure:y(n,r.relativePath,a,d)}:{}}}function h(n){return!!(n&&n.semantic.state!=="stale"&&n.semantic.basis!=="no-compiler-document")}function E(n){switch(U(n).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{y as a,A as b,Ne as c,Ae as d,We as e};
7
- //# sourceMappingURL=chunk-JCMFBF4Z.js.map
7
+ //# sourceMappingURL=chunk-XRH7R5SX.js.map