codebaseiq 0.2.0 → 0.3.1

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 (403) hide show
  1. package/CHANGELOG.md +59 -2
  2. package/README.md +1 -1
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-WH5SYOMD.js → chunk-2E6OUPCF.js} +2 -2
  5. package/dist/chunk-2I2UHZET.js +2 -0
  6. package/dist/{chunk-CSZOQ7YO.js → chunk-2OMXFE64.js} +2 -2
  7. package/dist/{chunk-57KFVPVZ.js → chunk-2XBJRZEM.js} +2 -2
  8. package/dist/{chunk-PFPHS4NO.js → chunk-2Z7K66D7.js} +2 -2
  9. package/dist/{chunk-5WXOEJ4G.js → chunk-356EZBIP.js} +2 -2
  10. package/dist/{chunk-DLC6JDN7.js → chunk-3H2H5ODK.js} +2 -2
  11. package/dist/{chunk-HBQGKMM3.js → chunk-3LQJRS4I.js} +2 -2
  12. package/dist/{chunk-H3CKAL6P.js → chunk-3ON3A2QV.js} +2 -2
  13. package/dist/{chunk-MTMF4N7F.js → chunk-3VJ3OCRE.js} +2 -2
  14. package/dist/{chunk-QMGWSEPL.js → chunk-4GWN76B2.js} +2 -2
  15. package/dist/{chunk-IBM3F2BJ.js → chunk-4LK5OIPW.js} +2 -2
  16. package/dist/{chunk-6SDEQTVY.js → chunk-53ELMZRF.js} +2 -2
  17. package/dist/{chunk-OJFLPVBP.js → chunk-57OPIQFM.js} +2 -2
  18. package/dist/{chunk-2E6BTWER.js → chunk-5CR4U5X2.js} +2 -2
  19. package/dist/{chunk-IYBIBMPF.js → chunk-5FWR5HLG.js} +2 -2
  20. package/dist/{chunk-HHBBGWES.js → chunk-5LL4KEHO.js} +2 -2
  21. package/dist/{chunk-NTRW52UR.js → chunk-5MPBSFZH.js} +2 -2
  22. package/dist/chunk-5T44HG5Y.js +88 -0
  23. package/dist/chunk-5TZNHP4T.js +8 -0
  24. package/dist/{chunk-L3YSDLNB.js → chunk-5YBDBY5L.js} +2 -2
  25. package/dist/{chunk-YFQPWKHR.js → chunk-5ZI2PPI7.js} +2 -2
  26. package/dist/{chunk-WO47BIPY.js → chunk-6EYESTJM.js} +2 -2
  27. package/dist/{chunk-PHPQ24UG.js → chunk-6FXXYYQM.js} +2 -2
  28. package/dist/chunk-6O3KXIDL.js +2 -0
  29. package/dist/{chunk-PLZXWZHY.js → chunk-7GAK2F3H.js} +2 -2
  30. package/dist/{chunk-W3FK73MD.js → chunk-7UCDGXRW.js} +2 -2
  31. package/dist/{chunk-U2XX3BT4.js → chunk-AGGR2BKS.js} +2 -2
  32. package/dist/{chunk-ZB3V5QM7.js → chunk-ALOEHWJS.js} +2 -2
  33. package/dist/{chunk-NDGTJHQN.js → chunk-AXQCHG77.js} +2 -2
  34. package/dist/{chunk-X5I2BQGX.js → chunk-BFANZRQ5.js} +2 -2
  35. package/dist/{chunk-VVCBMH5O.js → chunk-BGGB5N53.js} +2 -2
  36. package/dist/{chunk-PARCKE3Q.js → chunk-BGYRF5YX.js} +2 -2
  37. package/dist/{chunk-CIVYHK7U.js → chunk-BIADXGC3.js} +2 -2
  38. package/dist/{chunk-NK76RSB6.js → chunk-BPKNP3KZ.js} +2 -2
  39. package/dist/{chunk-ZOEDRCR4.js → chunk-BRQL7AFJ.js} +2 -2
  40. package/dist/{chunk-KDYQQJ6X.js → chunk-BWL3PMPT.js} +2 -2
  41. package/dist/{chunk-M7LAIM77.js → chunk-C6WKPKCF.js} +2 -2
  42. package/dist/{chunk-37TKC6MB.js → chunk-CB5AVJMM.js} +2 -2
  43. package/dist/{chunk-BX2U3QQV.js → chunk-CCIYWXX6.js} +2 -2
  44. package/dist/{chunk-3AC56WAR.js → chunk-CIYA2KZN.js} +2 -2
  45. package/dist/{chunk-6OVNYYY4.js → chunk-CJTKGAGH.js} +2 -2
  46. package/dist/{chunk-FIXYHQ3W.js → chunk-CLPCFGRT.js} +2 -2
  47. package/dist/{chunk-LY2NB5XR.js → chunk-CSPDQLLU.js} +2 -2
  48. package/dist/{chunk-CMXW7MFV.js → chunk-CYJS33YX.js} +2 -2
  49. package/dist/{chunk-ACZDU5GK.js → chunk-D7DOB27N.js} +7 -7
  50. package/dist/{chunk-XUJM6474.js → chunk-DDRA3QKN.js} +2 -2
  51. package/dist/{chunk-3NUZVLR7.js → chunk-DECN422G.js} +2 -2
  52. package/dist/{chunk-RRPK327J.js → chunk-DJKOXMNG.js} +2 -2
  53. package/dist/{chunk-SJZQ2PTZ.js → chunk-DWBAESVW.js} +2 -2
  54. package/dist/{chunk-S5SKXCND.js → chunk-EHPOTEQX.js} +2 -2
  55. package/dist/chunk-EIBGSU2R.js +2 -0
  56. package/dist/{chunk-DVYG3JTA.js → chunk-ELYMY5S2.js} +2 -2
  57. package/dist/chunk-EOKVZXNF.js +355 -0
  58. package/dist/chunk-EQNMD62X.js +51 -0
  59. package/dist/{chunk-YIOQJ45A.js → chunk-F3QSL4W2.js} +2 -2
  60. package/dist/{chunk-VG55NFXF.js → chunk-F5CJO5JN.js} +2 -2
  61. package/dist/{chunk-JOALNFY3.js → chunk-F74LZWCE.js} +2 -2
  62. package/dist/chunk-G7GVV2TV.js +27 -0
  63. package/dist/{chunk-U24M5RQM.js → chunk-GQLDYCWS.js} +2 -2
  64. package/dist/{chunk-B2E3HZ2A.js → chunk-GV2CEZCW.js} +2 -2
  65. package/dist/{chunk-AM5SUGHF.js → chunk-GVAF222T.js} +2 -2
  66. package/dist/{chunk-T3YFIJ5P.js → chunk-HJTM3C4Y.js} +2 -2
  67. package/dist/{chunk-FY5V4V4F.js → chunk-HNXRVGMY.js} +2 -2
  68. package/dist/{chunk-UWB5WMC2.js → chunk-I3OK27P7.js} +2 -2
  69. package/dist/{chunk-RVYLJDXC.js → chunk-ICUL7XRT.js} +2 -2
  70. package/dist/{chunk-QVHZB75Z.js → chunk-IHSLIIL3.js} +2 -2
  71. package/dist/chunk-ILGTMRMZ.js +2 -0
  72. package/dist/{chunk-XNUWRTYM.js → chunk-IZDPGOZR.js} +2 -2
  73. package/dist/{chunk-BH5CE4LN.js → chunk-J7AMBVWF.js} +2 -2
  74. package/dist/chunk-JAFDMV5I.js +2 -0
  75. package/dist/{chunk-YXJ4IAHH.js → chunk-JCMFBF4Z.js} +2 -2
  76. package/dist/{chunk-BLKYYQ7C.js → chunk-JNXI6NQ7.js} +95 -95
  77. package/dist/{chunk-DKJXK3HA.js → chunk-JSB43EX6.js} +2 -2
  78. package/dist/chunk-JYRJYXUV.js +2 -0
  79. package/dist/chunk-K4S2VH42.js +82 -0
  80. package/dist/{chunk-QLTFXVUI.js → chunk-K6FNTQQW.js} +2 -2
  81. package/dist/{chunk-JYX5UZSZ.js → chunk-KEJ2HLRW.js} +2 -2
  82. package/dist/{chunk-VCWAJPXQ.js → chunk-KFTHI2R6.js} +2 -2
  83. package/dist/chunk-KLX6NSWT.js +3 -0
  84. package/dist/{chunk-DFPAZXLU.js → chunk-KPZGTB2O.js} +2 -2
  85. package/dist/{chunk-T55YPJGB.js → chunk-KUKKLWJD.js} +2 -2
  86. package/dist/{chunk-RWKEXCHU.js → chunk-KUKWHP4R.js} +2 -2
  87. package/dist/{chunk-ZJZQ7Q2Q.js → chunk-KWRQVLPX.js} +2 -2
  88. package/dist/{chunk-FQA3KIFX.js → chunk-L37EQYAX.js} +2 -2
  89. package/dist/{chunk-PNVZIJ57.js → chunk-LCW3PSGL.js} +2 -2
  90. package/dist/{chunk-7Z7HCZ7J.js → chunk-LKUTSP4G.js} +2 -2
  91. package/dist/{chunk-HIEXRDJF.js → chunk-LMTSB3TB.js} +2 -2
  92. package/dist/{chunk-SF34QLK2.js → chunk-LQHYYIOB.js} +2 -2
  93. package/dist/{chunk-EXMVF3JR.js → chunk-LSZYMN2A.js} +3 -3
  94. package/dist/{chunk-RCPZOPV6.js → chunk-M2Y6PCFE.js} +2 -2
  95. package/dist/chunk-MC46AL7B.js +343 -0
  96. package/dist/{chunk-SRY26ITJ.js → chunk-MDFT325O.js} +2 -2
  97. package/dist/{chunk-WJOQC4P7.js → chunk-MEUHIDI3.js} +2 -2
  98. package/dist/{chunk-FLLXYUOL.js → chunk-MQW6SJ4P.js} +2 -2
  99. package/dist/{chunk-57KEZDPT.js → chunk-MSI3K7PJ.js} +2 -2
  100. package/dist/{chunk-27PHVDKL.js → chunk-MZNMASFM.js} +2 -2
  101. package/dist/{chunk-VYZQZ4ZN.js → chunk-N2XDMNVI.js} +2 -2
  102. package/dist/{chunk-JN5LIBT3.js → chunk-NDKOVQFG.js} +2 -2
  103. package/dist/{chunk-W6C6QTXJ.js → chunk-NEWHKGVD.js} +2 -2
  104. package/dist/chunk-NNG6M6XD.js +3 -0
  105. package/dist/chunk-O2KWU34K.js +278 -0
  106. package/dist/{chunk-HBXZAGY6.js → chunk-O2M3VNDY.js} +2 -2
  107. package/dist/{chunk-FPDL2TUB.js → chunk-OBC7HSSO.js} +2 -2
  108. package/dist/{chunk-J24VICI5.js → chunk-OKAF4OQS.js} +2 -2
  109. package/dist/{chunk-I5FCDTK2.js → chunk-OP6BUIV6.js} +2 -2
  110. package/dist/{chunk-2DMVFAY7.js → chunk-OQ3DK7FW.js} +2 -2
  111. package/dist/{chunk-FEBLLMTL.js → chunk-OQUCBKOI.js} +2 -2
  112. package/dist/chunk-OT5ISJSR.js +2 -0
  113. package/dist/{chunk-N3Q3AWGW.js → chunk-OWJWOEDU.js} +96 -96
  114. package/dist/{chunk-M4EVGA5S.js → chunk-PIFYOWS4.js} +3 -3
  115. package/dist/{chunk-35YYZD3D.js → chunk-PTR3EOXC.js} +2 -2
  116. package/dist/{chunk-5XEVXVTK.js → chunk-PUVNH4PO.js} +2 -2
  117. package/dist/{chunk-I645ZF75.js → chunk-QEOWONKY.js} +2 -2
  118. package/dist/{chunk-JXHLB7TP.js → chunk-QMOZZ2VX.js} +2 -2
  119. package/dist/{chunk-NIO346UL.js → chunk-QY7QB7I6.js} +2 -2
  120. package/dist/{chunk-YYFV32WR.js → chunk-R4OJGTMP.js} +2 -2
  121. package/dist/{chunk-2VKB5CMA.js → chunk-RCIGX23V.js} +2 -2
  122. package/dist/{chunk-TUTSO7UZ.js → chunk-RIO3JXHM.js} +2 -2
  123. package/dist/{chunk-4IFISPQW.js → chunk-SA7G6GJX.js} +2 -2
  124. package/dist/{chunk-OMBRP7BB.js → chunk-SB53KPWA.js} +2 -2
  125. package/dist/chunk-SB7NASHU.js +2 -0
  126. package/dist/{chunk-3XFJUWJE.js → chunk-SGMNWYTH.js} +2 -2
  127. package/dist/{chunk-A7XQT7MH.js → chunk-SUE7SHZL.js} +2 -2
  128. package/dist/{chunk-IOVPAZWP.js → chunk-SX72EVMY.js} +2 -2
  129. package/dist/{chunk-OVKZM2XI.js → chunk-SZ4P7MF7.js} +2 -2
  130. package/dist/{chunk-EM5UHLAM.js → chunk-T2M5HWBQ.js} +2 -2
  131. package/dist/{chunk-CZEIHYMP.js → chunk-T6MQNNAC.js} +2 -2
  132. package/dist/chunk-T75DS2E6.js +21 -0
  133. package/dist/{chunk-57GCCPLS.js → chunk-TEANKHUU.js} +2 -2
  134. package/dist/{chunk-MT5W4DUG.js → chunk-TEMM2FEL.js} +2 -2
  135. package/dist/{chunk-I2KP4AGR.js → chunk-TJWVT4DO.js} +2 -2
  136. package/dist/{chunk-77GHPR2R.js → chunk-TLTSESB4.js} +2 -2
  137. package/dist/{chunk-KM4QRWI5.js → chunk-TNJGTQWO.js} +2 -2
  138. package/dist/{chunk-EFFMFK7C.js → chunk-TOTWJZIX.js} +2 -2
  139. package/dist/{chunk-54K6556S.js → chunk-U33PMPNW.js} +2 -2
  140. package/dist/{chunk-GXVDTHFC.js → chunk-U7NUXDQO.js} +2 -2
  141. package/dist/chunk-UC2FD2PS.js +4 -0
  142. package/dist/{chunk-MRGTCMDK.js → chunk-UIAUPFBJ.js} +2 -2
  143. package/dist/{chunk-LAGDJXFY.js → chunk-UJIXCI3L.js} +2 -2
  144. package/dist/{chunk-IVJJNVSX.js → chunk-UMEPSVKT.js} +2 -2
  145. package/dist/{chunk-4O52YNKL.js → chunk-UQYQBLJX.js} +2 -2
  146. package/dist/{chunk-JUO3Z644.js → chunk-UW6KD57C.js} +2 -2
  147. package/dist/{chunk-TAJ6UGCO.js → chunk-V4NGDIEA.js} +3 -3
  148. package/dist/{chunk-VLTUX4IF.js → chunk-VGWZ4MOY.js} +2 -2
  149. package/dist/{chunk-KNV5VFDV.js → chunk-VSGOIZMQ.js} +2 -2
  150. package/dist/{chunk-K5G7SPAG.js → chunk-W7QDASTN.js} +4 -4
  151. package/dist/{chunk-IWAMYGPN.js → chunk-W7YLRXZE.js} +2 -2
  152. package/dist/{chunk-QKVTWODE.js → chunk-WK2IQJPK.js} +2 -2
  153. package/dist/{chunk-HYKSLTAR.js → chunk-WO6OFKUC.js} +2 -2
  154. package/dist/{chunk-S64NCE2Z.js → chunk-WWCV4E6J.js} +2 -2
  155. package/dist/{chunk-2F5ERMNI.js → chunk-XJBK3QDV.js} +2 -2
  156. package/dist/{chunk-IGYAZPRX.js → chunk-XN3EKMLI.js} +2 -2
  157. package/dist/{chunk-FWY2PRIF.js → chunk-XQAVQVIL.js} +2 -2
  158. package/dist/{chunk-NJA4MMBD.js → chunk-XUPFA6GH.js} +2 -2
  159. package/dist/{chunk-4AOOSCZ7.js → chunk-YHPG3S2U.js} +2 -2
  160. package/dist/{chunk-CDWSLAPN.js → chunk-YPBKBYPS.js} +2 -2
  161. package/dist/{chunk-5BDK6QC3.js → chunk-YRKP7PM7.js} +2 -2
  162. package/dist/{chunk-4NHWNAWQ.js → chunk-YT4DVWUV.js} +2 -2
  163. package/dist/{chunk-5NJPH3QZ.js → chunk-YTJHCGYB.js} +2 -2
  164. package/dist/{chunk-ZNQCR656.js → chunk-Z66XYVLZ.js} +2 -2
  165. package/dist/{chunk-A67HT5FR.js → chunk-ZB4C5TTR.js} +2 -2
  166. package/dist/chunk-ZMA5HWXY.js +3 -0
  167. package/dist/{chunk-CWMHWD56.js → chunk-ZNH33XIB.js} +2 -2
  168. package/dist/{cli-context-XEPPF4RX.js → cli-context-FJL2JHOE.js} +2 -2
  169. package/dist/{cli-context-TSADTXLB.js → cli-context-PQNWHMCQ.js} +2 -2
  170. package/dist/{cli-program-KJGQEM72.js → cli-program-SCHOHOQE.js} +2 -2
  171. package/dist/cli.js +1 -1
  172. package/dist/{code-CDe-mIjx.d.ts → code-DfX3xeWy.d.ts} +1 -1
  173. package/dist/{code-viewer-ZCTHXQ5C.js → code-viewer-AMRXV444.js} +2 -2
  174. package/dist/{code-viewer-YGDON6SY.js → code-viewer-EXI5SFFR.js} +2 -2
  175. package/dist/{command-descriptors-5VAB2MZX.js → command-descriptors-H6A4UY72.js} +129 -129
  176. package/dist/{command-descriptors-EAHKIRAG.js → command-descriptors-ROIOTCCW.js} +130 -130
  177. package/dist/{db-DmRNdCtm.d.ts → db-BoG_PWYH.d.ts} +1 -1
  178. package/dist/direct-navigation-3JOYP2MO.js +3 -0
  179. package/dist/direct-navigation-SJMJLBY7.js +2 -0
  180. package/dist/{graph-evidence-Bs54NWws.d.ts → graph-evidence-D1jx1Cql.d.ts} +1 -1
  181. package/dist/{health-BnzbSLCE.d.ts → health-DkYBS5BI.d.ts} +1 -1
  182. package/dist/index.d.ts +1 -1
  183. package/dist/index.js +1 -1
  184. package/dist/invocation-command-descriptors-GMZX3UAD.js +2 -0
  185. package/dist/invocation-command-descriptors-HNMKDEF6.js +3 -0
  186. package/dist/{scip-cli-BRFKkHQn.d.ts → maintenance-types-CdL5eQii.d.ts} +1 -20
  187. package/dist/output-continuation-command-5NWVDQT7.js +2 -0
  188. package/dist/output-continuation-command-RNEHNYPU.js +3 -0
  189. package/dist/postinstall.js +1 -1
  190. package/dist/project-reindex-MIW5CYEG.js +3 -0
  191. package/dist/project-reindex-VQ23LWDA.js +2 -0
  192. package/dist/queries/affected.d.ts +1 -1
  193. package/dist/queries/affected.js +1 -1
  194. package/dist/queries/anchors.d.ts +1 -1
  195. package/dist/queries/anchors.js +1 -1
  196. package/dist/queries/architecture.d.ts +1 -1
  197. package/dist/queries/architecture.js +1 -1
  198. package/dist/queries/bottlenecks.d.ts +1 -1
  199. package/dist/queries/bottlenecks.js +1 -1
  200. package/dist/queries/by-kind.d.ts +1 -1
  201. package/dist/queries/by-kind.js +1 -1
  202. package/dist/queries/call-graph.d.ts +1 -1
  203. package/dist/queries/call-graph.js +1 -1
  204. package/dist/queries/change-surface.d.ts +1 -1
  205. package/dist/queries/change-surface.js +1 -1
  206. package/dist/queries/cleanup-plan.d.ts +1 -1
  207. package/dist/queries/cleanup-plan.js +1 -1
  208. package/dist/queries/co-change.d.ts +1 -1
  209. package/dist/queries/co-change.js +1 -1
  210. package/dist/queries/code.d.ts +2 -2
  211. package/dist/queries/code.js +1 -1
  212. package/dist/queries/complexity-hotspots.d.ts +1 -1
  213. package/dist/queries/complexity-hotspots.js +1 -1
  214. package/dist/queries/complexity.d.ts +1 -1
  215. package/dist/queries/complexity.js +1 -1
  216. package/dist/queries/context.d.ts +1 -1
  217. package/dist/queries/context.js +1 -1
  218. package/dist/queries/convergence.d.ts +1 -1
  219. package/dist/queries/convergence.js +1 -1
  220. package/dist/queries/coupling.d.ts +1 -1
  221. package/dist/queries/coupling.js +1 -1
  222. package/dist/queries/cycles.d.ts +1 -1
  223. package/dist/queries/cycles.js +1 -1
  224. package/dist/queries/dataflow.d.ts +1 -1
  225. package/dist/queries/dataflow.js +1 -1
  226. package/dist/queries/dead.d.ts +1 -1
  227. package/dist/queries/dead.js +1 -1
  228. package/dist/queries/decorative-checkers.d.ts +1 -1
  229. package/dist/queries/decorative-checkers.js +1 -1
  230. package/dist/queries/deep-chains.d.ts +1 -1
  231. package/dist/queries/deep-chains.js +1 -1
  232. package/dist/queries/dependence-slice.d.ts +2 -2
  233. package/dist/queries/dependence-slice.js +1 -1
  234. package/dist/queries/dependency-depth.d.ts +1 -1
  235. package/dist/queries/dependency-depth.js +1 -1
  236. package/dist/queries/deps.d.ts +1 -1
  237. package/dist/queries/deps.js +1 -1
  238. package/dist/queries/diff-impact.d.ts +1 -1
  239. package/dist/queries/diff-impact.js +1 -1
  240. package/dist/queries/doc-drift.d.ts +1 -1
  241. package/dist/queries/doc-drift.js +1 -1
  242. package/dist/queries/drift.d.ts +1 -1
  243. package/dist/queries/drift.js +1 -1
  244. package/dist/queries/duplicate-bodies.d.ts +1 -1
  245. package/dist/queries/duplicate-bodies.js +1 -1
  246. package/dist/queries/entry-map.d.ts +1 -1
  247. package/dist/queries/entry-map.js +1 -1
  248. package/dist/queries/evidence.d.ts +2 -2
  249. package/dist/queries/evidence.js +1 -1
  250. package/dist/queries/extract-candidates.d.ts +1 -1
  251. package/dist/queries/extract-candidates.js +1 -1
  252. package/dist/queries/fan.d.ts +1 -1
  253. package/dist/queries/fan.js +1 -1
  254. package/dist/queries/files.d.ts +1 -1
  255. package/dist/queries/files.js +1 -1
  256. package/dist/queries/health.d.ts +2 -2
  257. package/dist/queries/health.js +1 -1
  258. package/dist/queries/hierarchy.d.ts +1 -1
  259. package/dist/queries/hierarchy.js +1 -1
  260. package/dist/queries/hotspots.d.ts +1 -1
  261. package/dist/queries/hotspots.js +1 -1
  262. package/dist/queries/imports.d.ts +1 -1
  263. package/dist/queries/imports.js +1 -1
  264. package/dist/queries/incomplete-migration.d.ts +1 -1
  265. package/dist/queries/incomplete-migration.js +1 -1
  266. package/dist/queries/index.d.ts +4 -4
  267. package/dist/queries/index.js +1 -1
  268. package/dist/queries/isolated.d.ts +1 -1
  269. package/dist/queries/isolated.js +1 -1
  270. package/dist/queries/locality-candidates.d.ts +1 -1
  271. package/dist/queries/locality-candidates.js +1 -1
  272. package/dist/queries/members.d.ts +1 -1
  273. package/dist/queries/members.js +1 -1
  274. package/dist/queries/methods.d.ts +1 -1
  275. package/dist/queries/methods.js +1 -1
  276. package/dist/queries/not-implemented.d.ts +1 -1
  277. package/dist/queries/not-implemented.js +1 -1
  278. package/dist/queries/outline.d.ts +1 -1
  279. package/dist/queries/outline.js +1 -1
  280. package/dist/queries/passthrough-candidates.d.ts +1 -1
  281. package/dist/queries/passthrough-candidates.js +1 -1
  282. package/dist/queries/plan-context.d.ts +1 -1
  283. package/dist/queries/plan-context.js +1 -1
  284. package/dist/queries/react-component-duplicates.d.ts +1 -1
  285. package/dist/queries/react-component-duplicates.js +1 -1
  286. package/dist/queries/react-hook-candidates.d.ts +1 -1
  287. package/dist/queries/react-hook-candidates.js +1 -1
  288. package/dist/queries/react-large-component-pressure.d.ts +1 -1
  289. package/dist/queries/react-large-component-pressure.js +1 -1
  290. package/dist/queries/recent-duplicates.d.ts +1 -1
  291. package/dist/queries/recent-duplicates.js +1 -1
  292. package/dist/queries/redundant-reexports.d.ts +1 -1
  293. package/dist/queries/redundant-reexports.js +1 -1
  294. package/dist/queries/reference-neighborhood.d.ts +1 -1
  295. package/dist/queries/reference-neighborhood.js +1 -1
  296. package/dist/queries/reference-reachability.d.ts +1 -1
  297. package/dist/queries/reference-reachability.js +1 -1
  298. package/dist/queries/refs.d.ts +1 -1
  299. package/dist/queries/refs.js +1 -1
  300. package/dist/queries/self-audit.d.ts +1 -1
  301. package/dist/queries/self-audit.js +1 -1
  302. package/dist/queries/similar-chains.d.ts +1 -1
  303. package/dist/queries/similar-chains.js +1 -1
  304. package/dist/queries/similar-files.d.ts +1 -1
  305. package/dist/queries/similar-files.js +1 -1
  306. package/dist/queries/similar-signatures.d.ts +1 -1
  307. package/dist/queries/similar-signatures.js +1 -1
  308. package/dist/queries/similar.d.ts +1 -1
  309. package/dist/queries/similar.js +1 -1
  310. package/dist/queries/slice.d.ts +1 -1
  311. package/dist/queries/slice.js +1 -1
  312. package/dist/queries/source-inspection.d.ts +3 -3
  313. package/dist/queries/source-inspection.js +1 -1
  314. package/dist/queries/source-search.d.ts +1 -1
  315. package/dist/queries/source-search.js +1 -1
  316. package/dist/queries/stale-abstractions.d.ts +1 -1
  317. package/dist/queries/stale-abstractions.js +1 -1
  318. package/dist/queries/stats.d.ts +1 -1
  319. package/dist/queries/surface.d.ts +1 -1
  320. package/dist/queries/surface.js +1 -1
  321. package/dist/queries/symbols.d.ts +1 -1
  322. package/dist/queries/symbols.js +1 -1
  323. package/dist/queries/system-map.d.ts +1 -1
  324. package/dist/queries/system-map.js +1 -1
  325. package/dist/queries/system.d.ts +1 -1
  326. package/dist/queries/system.js +1 -1
  327. package/dist/queries/test-quality.d.ts +1 -1
  328. package/dist/queries/test-quality.js +1 -1
  329. package/dist/queries/trace.d.ts +1 -1
  330. package/dist/queries/trace.js +1 -1
  331. package/dist/queries/twin-ab.d.ts +1 -1
  332. package/dist/queries/twin-ab.js +1 -1
  333. package/dist/queries/twin-drift.d.ts +1 -1
  334. package/dist/queries/twin-drift.js +1 -1
  335. package/dist/queries/unused-imports.d.ts +1 -1
  336. package/dist/queries/unused-imports.js +1 -1
  337. package/dist/queries/unused-params.d.ts +1 -1
  338. package/dist/queries/unused-params.js +1 -1
  339. package/dist/queries/value-flow.d.ts +2 -2
  340. package/dist/queries/value-flow.js +1 -1
  341. package/dist/queries/vue-component-duplicates.d.ts +1 -1
  342. package/dist/queries/vue-component-duplicates.js +1 -1
  343. package/dist/queries/vue-composable-candidates.d.ts +1 -1
  344. package/dist/queries/vue-composable-candidates.js +1 -1
  345. package/dist/queries/vue-large-view-pressure.d.ts +1 -1
  346. package/dist/queries/vue-large-view-pressure.js +1 -1
  347. package/dist/queries/wrapper-candidates.d.ts +1 -1
  348. package/dist/queries/wrapper-candidates.js +1 -1
  349. package/dist/reindex-worker.js +2 -2
  350. package/dist/reindex.d.ts +2 -4
  351. package/dist/reindex.js +71 -32
  352. package/dist/runtime.d.ts +1 -2
  353. package/dist/runtime.js +3 -3
  354. package/dist/rust-semantic-session-server.js +1 -1
  355. package/dist/rust-semantic-session-worker.js +1 -1
  356. package/dist/rust-semantic-worker.js +1 -1
  357. package/dist/sentinel-ensure-command-H66AZ3VE.js +2 -0
  358. package/dist/sentinel-ensure-command-R4YAUCJB.js +3 -0
  359. package/dist/sentinel-worker.js +1 -1
  360. package/dist/typescript-mailbox-worker.js +1 -1
  361. package/dist/watch-server.js +2 -2
  362. package/docs/INDEX_GENERATIONS.md +2 -2
  363. package/docs/NPM_RELEASE.md +323 -0
  364. package/docs/schemas/npm-release-state.schema.json +4 -13
  365. package/package.json +3 -11
  366. package/dist/chunk-2Q2LW5JW.js +0 -14
  367. package/dist/chunk-327YK6TB.js +0 -4
  368. package/dist/chunk-347TXATM.js +0 -2
  369. package/dist/chunk-36WRYYTE.js +0 -3
  370. package/dist/chunk-5IO2APSS.js +0 -2
  371. package/dist/chunk-6OAHRI2D.js +0 -6
  372. package/dist/chunk-6URCE5QY.js +0 -2
  373. package/dist/chunk-6ZV5EDUT.js +0 -5
  374. package/dist/chunk-7R64XY4Y.js +0 -12
  375. package/dist/chunk-CANBLFVQ.js +0 -15
  376. package/dist/chunk-CCRZLRWJ.js +0 -2
  377. package/dist/chunk-G2XUZCF2.js +0 -88
  378. package/dist/chunk-H5QXP63L.js +0 -2
  379. package/dist/chunk-HCMQZPEO.js +0 -2
  380. package/dist/chunk-IEL6Q5W3.js +0 -308
  381. package/dist/chunk-IGQQUENU.js +0 -109
  382. package/dist/chunk-K2O7SBAU.js +0 -2
  383. package/dist/chunk-QVWDQTMG.js +0 -2
  384. package/dist/chunk-RJWAB4VR.js +0 -345
  385. package/dist/chunk-VCL7FK3E.js +0 -3
  386. package/dist/chunk-WOOTEWQT.js +0 -239
  387. package/dist/chunk-XYLV727H.js +0 -21
  388. package/dist/chunk-YMGZZEW4.js +0 -2
  389. package/dist/direct-navigation-B3SGOOBW.js +0 -2
  390. package/dist/direct-navigation-ZL362KXF.js +0 -3
  391. package/dist/invocation-command-descriptors-CSUGUHTT.js +0 -2
  392. package/dist/invocation-command-descriptors-PPVZOIE5.js +0 -3
  393. package/dist/output-continuation-command-FTVVBVSN.js +0 -2
  394. package/dist/output-continuation-command-ITPRC3YV.js +0 -3
  395. package/dist/project-reindex-7HZSLLLY.js +0 -3
  396. package/dist/project-reindex-NGM3DYBN.js +0 -2
  397. package/dist/sentinel-ensure-command-KYYULCFU.js +0 -2
  398. package/dist/sentinel-ensure-command-RIZA3RY7.js +0 -3
  399. package/docs/WINDOWS_SIDECAR_RELEASE.md +0 -424
  400. package/docs/schemas/windows-sidecar-provenance.schema.json +0 -137
  401. package/scripts/build-codebaseiq-windows.mjs +0 -197
  402. package/scripts/codebaseiq-windows-provenance.mjs +0 -364
  403. package/scripts/verify-codebaseiq-windows.mjs +0 -29
@@ -0,0 +1,51 @@
1
+ import{aa as b,ba as x,h as g}from"./chunk-UQYQBLJX.js";import{execFileSync as R,spawnSync as J}from"child_process";import{platform as H}from"os";import{resolve as W}from"path";import{createHash as C}from"crypto";import{existsSync as y,renameSync as L,rmSync as B,writeFileSync as D}from"fs";import{tmpdir as j}from"os";import{join as M}from"path";var I=`'use strict';
2
+ const NativeRegExp = globalThis.RegExp;
3
+ const escapeLoneSeparator = (args) =>
4
+ typeof args[0] === 'string' && args[0] === '\\\\' ? ['\\\\\\\\', ...args.slice(1)] : args;
5
+ globalThis.RegExp = new Proxy(NativeRegExp, {
6
+ construct(target, args) {
7
+ return Reflect.construct(target, escapeLoneSeparator(args));
8
+ },
9
+ apply(target, thisArg, args) {
10
+ return Reflect.apply(target, thisArg, escapeLoneSeparator(args));
11
+ },
12
+ });
13
+ `,F=/scip-python/i;function h(e,n=process.platform){return n!=="win32"||!F.test(e)?[]:["--require",$()]}function $(e=j()){let n=C("sha256").update(I).digest("hex").slice(0,16),r=M(e,`codebaseiq-indexer-compat-${n}.cjs`);if(y(r))return r;let t=`${r}.${process.pid}.tmp`;D(t,I);try{L(t,r)}catch{if(B(t,{force:!0}),!y(r))throw new Error(`could not materialize indexer compatibility preload at ${r}`)}return r}var S=H()==="win32";function Ie(e,n=J){try{return n(e,["--version"],{stdio:"ignore",timeout:1e4}).status===0}catch{return!1}}function T(e){let n=S?"where":"which";try{return R(n,[e],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var U=/\.(?:c|m)?js$/i,z=/\.(?:exe|com)$/i;function he(e,n){return U.test(e)?{binary:process.execPath,args:[...h(e),e,...n]}:{binary:e,args:[...n]}}function G(e,n){return R(e,n,{stdio:["ignore","pipe","ignore"],windowsHide:!0,encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function _(e,n={}){let r=n.isWindows??S,t=n.lookup??G,o;try{o=t(r?"where":"which",[e])}catch{return null}let i=o.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(!r){let s=i[0];return s?W(s):null}return i.find(s=>z.test(s))??null}import{execFileSync as O}from"child_process";import{createHash as K}from"crypto";import{existsSync as u,statSync as Z}from"fs";import{createRequire as q}from"module";import{platform as Q}from"os";import{dirname as E,join as l}from"path";var X=q(import.meta.url),ke={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function m(e){return[e.indexerBinary,...e.binaryAliases??[]]}function Y(e){let n=m(e);return n.length===1?n[0]:n.join(" or ")}function p(e){for(let n of m(e)){let r=_(n);if(r)return r}return ee(e)}function Ae(e){return p(e)!==null||V(e)}function V(e){return N(e)!==null}function ee(e){let n=N(e);if(!n)return null;let t=JSON.parse(g(n,"indexer package manifest")).bin;if(!t)return null;if(typeof t=="string")return l(E(n),t);for(let o of m(e)){let i=t[o];if(i)return l(E(n),i)}return null}function N(e){if(!e.bundledNpmPackage)return null;try{return X.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function ne(e,n){for(let r of e.projectLocalBinaries??[]){let t=l(n,r);if(u(t))return t}return null}function re(e,n){for(let r of e.projectLocalBinaries??[]){let t=l(n,r);if(u(t))return w(n,r,t)}return null}function Ce(e,n){let r=te(e,n);if(!r||r.canonicalPath!==n.canonicalPath||r.sha256!==n.sha256||r.size!==n.size||r.mtimeMs!==n.mtimeMs||r.device!==n.device||r.inode!==n.inode||r.executable!==n.executable)throw new Error(`refusing changed project-local indexer ${n.relativePath}; review the current file and rerun with --trust-project-tools`)}function te(e,n){try{return w(e,n.relativePath,n.configuredPath)}catch{return null}}function w(e,n,r){let t={maxBytes:268435456,inputKind:"project-local indexer"},o=b(e,n,t),i=x(e,n,t),s=Z(o.absolutePath);return{configuredPath:r,canonicalPath:o.absolutePath,relativePath:n,sha256:K("sha256").update(i).digest("hex"),size:o.size,mtimeMs:o.mtimeMs,device:o.device,inode:o.inode,executable:(s.mode&73)!==0}}function oe(e,n,r={}){return(r.trustProjectTools?re(e,n)?.canonicalPath:null)??p(e)}function Le(e,n=process.env,r=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||f(r,n))return n;let t=P(r,n);return t?{...n,DOTNET_ROOT:t}:n}function Be(e,n,r={}){let t=Y(e),o=n?oe(e,n,r):p(e);if(!o)return{language:e.language,binaryLabel:t,installed:!1,runnable:!1,resolvedBinary:null,installUrl:e.installUrl,...n&&ne(e,n)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(e.indexerBinary!=="scip-dotnet")return{language:e.language,binaryLabel:t,installed:!0,runnable:!0,resolvedBinary:o};let i=ie(o);return{language:e.language,binaryLabel:t,installed:!0,runnable:i.runnable,resolvedBinary:o,installUrl:e.installUrl,note:i.note}}function ie(e){if(f(e,process.env))return{runnable:!0};let n=P(e,process.env);if(n)return{runnable:!0,note:`using .NET 9 runtime from ${n}`};let r=v(process.env);return{runnable:!1,note:r.length>0?`.NET 9 runtime still unavailable after checking ${r.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function P(e,n){for(let r of v(n))if(f(e,{...n,DOTNET_ROOT:r}))return r;return null}function v(e){let n=[],r=e.DOTNET_ROOT;if(r&&u(r)&&n.push(r),Q()==="darwin"&&T("brew"))try{let t=O("brew",["--prefix","dotnet@9"],{stdio:"pipe",windowsHide:!0,env:e,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),o=l(t,"libexec");u(o)&&!n.includes(o)&&n.push(o)}catch{}return n}function f(e,n){try{return O(e,["--version"],{stdio:"pipe",windowsHide:!0,env:n,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}function je(e,n){return d(e,n,r=>{let t=r?`AND m.symbol_id IN (${r.map(()=>"?").join(",")})`:"";return e.all(`SELECT
14
+ m.symbol_id,
15
+ d.relative_path,
16
+ COUNT(*) AS ref_count
17
+ FROM mentions m
18
+ JOIN chunks c ON m.chunk_id = c.id
19
+ JOIN documents d ON c.document_id = d.id
20
+ WHERE m.role != 1
21
+ ${t}
22
+ ${e.pathExclusionsFor("d")}
23
+ GROUP BY m.symbol_id, d.relative_path`,...r??[])})}function Me(e,n){return d(e,n,r=>{let t=r?`AND m.symbol_id IN (${r.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
24
+ FROM mentions m
25
+ JOIN chunks c ON m.chunk_id = c.id
26
+ JOIN documents d ON c.document_id = d.id
27
+ WHERE m.role != 1
28
+ ${t}
29
+ ${e.pathExclusionsFor("d")}`,...r??[])}).filter(r=>r.symbol_id!==null)}function Fe(e,n){return d(e,n,r=>{let t=r?`AND m.symbol_id IN (${r.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id
30
+ FROM mentions m
31
+ WHERE m.role != 1
32
+ ${t}`,...r??[])}).filter(r=>r.symbol_id!==null)}function $e(e,n){return d(e,n,r=>{let t=r?`AND m.symbol_id IN (${r.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
33
+ c.start_line AS chunk_start, c.end_line AS chunk_end
34
+ FROM mentions m
35
+ JOIN chunks c ON m.chunk_id = c.id
36
+ JOIN documents d ON c.document_id = d.id
37
+ WHERE m.role != 1
38
+ ${t}
39
+ ${e.pathExclusionsFor("d")}
40
+ ORDER BY d.relative_path, c.start_line`,...r??[])})}function d(e,n,r){if(!n)return r();if(n.length===0)return[];let t=[];for(let o=0;o<n.length;o+=750)t.push(...r(n.slice(o,o+750)));return t}function He(e){return e.startsWith("local ")}import{zstdCompressSync as ce,zstdDecompressSync as ae}from"zlib";function Ge(e){return ce(Buffer.from(JSON.stringify(e.map(n=>[n.symbol,n.roles,n.range,n.enclosingRange]))))}function A(e){let n;try{n=JSON.parse(ae(e).toString("utf8"))}catch{return null}return Array.isArray(n)?n.map(([r,t,o,i])=>({symbol:r,roles:t,range:o,enclosingRange:i})):null}function le(e){return e.length===1&&e[0]===0}function Ke(e,n){let r=e.all(`SELECT c.occurrences
41
+ FROM chunks c
42
+ JOIN documents d ON d.id = c.document_id
43
+ WHERE d.relative_path = ?
44
+ ORDER BY c.chunk_index, c.id`,n),t=[];for(let o of r){if(le(o.occurrences))continue;let i=A(o.occurrences);if(!i)return null;t.push(...i)}return t}function Ze(e,n){let r=new Map(n.map(o=>[o,[]])),t=new Map;for(let o of k([...r.keys()])){let i=e.all(`SELECT DISTINCT m.chunk_id, gs.symbol
45
+ FROM mentions m
46
+ JOIN global_symbols gs ON gs.id = m.symbol_id
47
+ WHERE gs.symbol IN (${o.map(()=>"?").join(",")})`,...o);for(let s of i){let c=t.get(s.chunk_id)??[];c.push(s.symbol),t.set(s.chunk_id,c)}}for(let o of k([...t.keys()])){let i=e.all(`SELECT c.id, d.relative_path, c.occurrences
48
+ FROM chunks c
49
+ JOIN documents d ON d.id = c.document_id
50
+ WHERE c.id IN (${o.map(()=>"?").join(",")})`,...o);for(let s of i){let c=A(s.occurrences);if(!c){for(let a of t.get(s.id)??[])r.set(a,null);continue}for(let a of c)(a.roles&1)===0&&r.get(a.symbol)?.push({relativePath:s.relative_path,occurrence:a})}}return r}function k(e){let n=[];for(let r=0;r<e.length;r+=750)n.push(e.slice(r,r+750));return n}export{Ie as a,T as b,he as c,_ as d,ke as e,Y as f,p as g,Ae as h,ne as i,re as j,Ce as k,Le as l,Be as m,je as n,Me as o,Fe as p,$e as q,He as r,Ge as s,Ke as t,Ze as u};
51
+ //# sourceMappingURL=chunk-EQNMD62X.js.map
@@ -1,4 +1,4 @@
1
- import{A as f,G as u}from"./chunk-327YK6TB.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
1
+ import{A as f,G as u}from"./chunk-UC2FD2PS.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
2
2
  `)}function A(n,t){let r=n.trimStart();if(!r||r.startsWith("#"))return n;let e=n.slice(0,n.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return n;let s=o.startsWith("/"),a=s?o.slice(1):o,p=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${e}${i?"!":""}${p}`}var F=`
3
3
  # Dependencies
4
4
  node_modules/
@@ -57,4 +57,4 @@ Thumbs.db
57
57
  # Type definitions (often noise in queries)
58
58
  *.d.ts
59
59
  `;function g(n,t,r){let e=x(t,r);if(!e)return!1;try{return n.ignores(e)}catch{return!1}}function x(n,t){if(!t||t===".")return null;if(!m(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=m(t)?t:S(n,t),e=T(n,r).replaceAll("\\","/");return!e||e==="."||e.startsWith("..")?null:e}export{E as a};
60
- //# sourceMappingURL=chunk-YIOQJ45A.js.map
60
+ //# sourceMappingURL=chunk-F3QSL4W2.js.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-OJFLPVBP.js";import{a as b,c as S}from"./chunk-57KEZDPT.js";import{o as y}from"./chunk-BH5CE4LN.js";import{a as f}from"./chunk-3XFJUWJE.js";import{d as r}from"./chunk-AM5SUGHF.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-VG55NFXF.js.map
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,4 +1,4 @@
1
- import{A as G,B as Je,C as D,D as Y,E as Ke,F as ye,G as Xe,H as Qe,e as Me,f as ve,g as _,h as $e,i as Ue,j as qe,k as B,l as Be,m as H,n as ze,o as Ve,p as We,q as F,r as J,s as A,t as de,u as ge,v as S,w as Se,x as He,y as he,z as Q}from"./chunk-RVYLJDXC.js";import{c as Oe,g as q,j as se,l as W,r as xe,t as K,v as X,w as L}from"./chunk-PLZXWZHY.js";import{c as ne}from"./chunk-327YK6TB.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(e){return e.replace(/'''[\s\S]*?'''/g,k).replace(/"""[\s\S]*?"""/g,k).replace(/#.*$/gm,k).replace(/\/\/.*$/gm,k).replace(/\/\*[\s\S]*?\*\//g,k).replace(/`(?:\\[\s\S]|[^`])*`/g,k).replace(/'(?:\\.|[^'\\\r\n])*'/g,k).replace(/"(?:\\.|[^"\\\r\n])*"/g,k)}function Vn(e){return Ge(e,{maskStrings:!1})}function Wn(e){return Ge(e,{maskStrings:!0})}function Ge(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
1
+ import{A as G,B as Je,C as D,D as Y,E as Ke,F as ye,G as Xe,H as Qe,e as Me,f as ve,g as _,h as $e,i as Ue,j as qe,k as B,l as Be,m as H,n as ze,o as Ve,p as We,q as F,r as J,s as A,t as de,u as ge,v as S,w as Se,x as He,y as he,z as Q}from"./chunk-ICUL7XRT.js";import{c as Oe,g as q,j as se,l as W,r as xe,t as K,v as X,w as L}from"./chunk-7GAK2F3H.js";import{c as ne}from"./chunk-UC2FD2PS.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(e){return e.replace(/'''[\s\S]*?'''/g,k).replace(/"""[\s\S]*?"""/g,k).replace(/#.*$/gm,k).replace(/\/\/.*$/gm,k).replace(/\/\*[\s\S]*?\*\//g,k).replace(/`(?:\\[\s\S]|[^`])*`/g,k).replace(/'(?:\\.|[^'\\\r\n])*'/g,k).replace(/"(?:\\.|[^"\\\r\n])*"/g,k)}function Vn(e){return Ge(e,{maskStrings:!1})}function Wn(e){return Ge(e,{maskStrings:!0})}function Ge(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
2
2
  `,n),a=i===-1?s:i;t+=be(e,n,a),n=a;continue}if(e[n]==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2),a=i===-1?s:i+2;t+=be(e,n,a),n=a;continue}let o=e[n];if(o==="`"||o==="'"||o==='"'){let i=o,a=n+1;for(;a<s;){if(e[a]==="\\"){a+=2;continue}if(e[a]===i){a+=1;break}if(i!=="`"&&e[a]===`
3
3
  `)break;a+=1}t+=r.maskStrings?be(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function be(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
4
4
  `?`
@@ -10,4 +10,4 @@ import{A as G,B as Je,C as D,D as Y,E as Ke,F as ye,G as Xe,H as Qe,e as Me,f as
10
10
  `:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ae(e,s);n+=lt(e.slice(s,i)),s=i;continue}if(o==='"'){let i=te(e,s,0).index;n+=lt(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Rr(e){let r=0;for(;r<e.length&&(r=Le(e,r),!(r>=e.length));){let t=pe(e,r);if(!t){r+=1;continue}if(Sr(t.form))return t.form;r=t.index}return null}function pe(e,r){let t=Le(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Tr(e,t);if(e.startsWith("#_",t)){let s=pe(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Pe(e[t]);)t+=1;let n=e[t];return n?n==="("?Te(e,t,"list",")"):n==="["?Te(e,t,"vector","]"):n==="{"?Te(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:te(e,t,0).index},index:te(e,t,0).index}:Fr(e,t):null}function Tr(e,r){let t=e.startsWith("#?@",r)?3:2,n=pe(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Er(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Er(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Te(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Le(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=pe(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Fr(e,r){let t=r;for(;t<e.length&&!_e(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Le(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ae(e,t);continue}break}return t}function lt(e){return e.replace(/[^\r\n]/g," ")}function ut(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=w(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:Se(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function mt(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:Se(e,r,o)})}return n}function ft(e,r,t){return ce(e,r,{csharp:n=>Lr(e,r,n),vb:n=>Ar(e,r,n)},()=>{let n=Ve(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[R(e,r,o,p,u,m,S(e,p,B))]})},t)}function Ar(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(d(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Lr(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(d(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var kr=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function dt(e,r){return kr.get(e,r,()=>{let t=new Set,n=L(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function ke(e,r,t){return C(e,r,n=>jr(e,r,n),()=>wr(e,r,t),t)}function wr(e,r,t){return Wr(t).flatMap(n=>Hr(e,r,n.clause,n.specifier,n.start,n.end,t))}function jr(e,r,t){let n=Dr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Or(e,r,t,o,n));return s}function Dr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of dt(e,r))n.add(s);return n}function Or(e,r,t,n,s){let o=qr(n);if(!o)return[];let i=F(e,r,o),a=b(n,"import_clause");return a?Mr(t,a,i,s,Br(n.text)):[M("*",i)]}function Mr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(vr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=$r(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Ur(i,t,n,s));return o}function vr(e,r,t,n){return d("default",e,r,t,"default",{isTypeOnly:n})}function $r(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=Vr(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Ur(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(d(c,l,r,t,"named",{isTypeOnly:n||zr(o.text)}))}return s}function qr(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function Br(e){return/^\s*import\s+type\b/.test(e)}function zr(e){return/^\s*type\b/.test(e.trim())}function Vr(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Wr(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function Hr(e,r,t,n,s,o,i){let a=F(e,r,n),c=w(i,s,o);return t?Jr(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):E(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Jr(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=Kr(n),i=[];return s&&i.push(...gt(s,t)),o&&i.push(...gt(o,t)),i}function gt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function Kr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function we(e,r,t){let n=D(e,r);return n?en(e,r,n):Xr(e,r,t)}function Xr(e,r,t){return[...Qr(e,r,t),...Gr(e,r,t),...Yr(e,r,t)]}function Qr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Zr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:F(e,r,a),names:c,startLine:l,endLine:p})}return n}function Gr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:F(e,r,i),names:o[1]?[o[1]]:[],startLine:a,endLine:c})}return n}function Yr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:F(e,r,i),names:[],startLine:a,endLine:c})}return n}function Zr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function en(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=tn(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=rn(s,o,i,a);n.push(c)}return n}function tn(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return F(e,r,s.text)}function rn(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}let o=b(e,"namespace_export");if(o){let i=o.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:r,names:i?[i]:[],startLine:t,endLine:n}}return{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function St(e,r,t){return ce(e,r,{java:n=>nn(e,r,n),kotlin:n=>sn(e,r,n),scala:n=>on(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?an(e,r,o,s):[]}),t)}function nn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(d(p,p,S(e,l,_),n))}return s}function sn(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(f=>f.type==="identifier");if(!i)continue;let a=o.namedChildren.some(f=>f.type==="wildcard_import"),c=o.namedChildren.find(f=>f.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(d(p,m,S(e,l,_),n))}return s}function on(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,f]=u.namedChildren;if(!m)continue;let h=m.text,$=f?.text??h;if(h==="_")continue;s.push(d(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(d(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(d(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function an(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[R(e,r,n,m,p,u)]})}return[R(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function xt(e,r,t){return C(e,r,n=>cn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[R(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}),t)}function cn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(d(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=ht(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=ht(c,"");l&&o(u,l,p)}}return s}function ht(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function bt(e,r,t){return C(e,r,n=>ln(e,r,n),()=>un(t).flatMap(n=>fn(e,r,n,t)),t)}function ln(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=yt(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=pn(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=yt(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function yt(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function pn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function un(e){let r=e.split(`
11
11
  `),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=Ne(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
12
12
  ${m}`,l+=1+m.length,p+=Ne(m),n+=m.length+1}let u=mn(c);u&&t.push({...u,start:a,end:l})}return t}function mn(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function fn(e,r,t,n){let s=w(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),f=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,f);return[{importedName:m,localName:f,sourcePath:h,kind:"namespace",used:x(s,f)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as dn}from"path";function Nt(e,r,t){return C(e,r,n=>Sn(e,r,n),()=>gn(e,r,t),t)}function gn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?de(e,r,i):null;if(a){let c=It(i);return[E(c,c,a,x(s,c))]}return[M(i,a)]})}function Sn(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?de(e,r,u):null;if(m){let f=It(u);s.push(d(f,f,m,n))}else s.push(M(u,m))}return s}function It(e){return Qe(dn(e).replace(/\.[^.]+$/,""),/_/)}function Ct(e,r,t){return C(e,r,n=>hn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?xn(e,r,o,s):[]}),t)}function hn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of re(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=A(e,r,a.qualifiedName)??A(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(d(a.importedName,a.localName,c,n))}}return s}function re(e,r){switch(e.type){case"identifier":case"super":case"crate":{let t=e.text;return[{qualifiedName:ue(r,t),importedName:t,localName:t}]}case"self":{let t=r.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:r||"self",importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:ue(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=ue(r,t.text),o=[];for(let i of n.namedChildren)o.push(...re(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...re(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=re(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:ue(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function ue(e,r){return e?r?`${e}::${r}`:e:r}function xn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let f=m.trim();if(!f)return[];if(f==="self"){let fe=p.split("::").filter(Boolean).pop();return fe?[R(e,r,n,p,fe,fe)]:[]}let[h,$]=f.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Et=($??U.split("::").pop()??U).trim(),Ft=`${p}::${U}`.replace(/::::/g,"::");return[R(e,r,n,Ft,U.split("::").pop()??U,Et,A(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=A(e,r,a)??A(e,r,a.split("::").slice(0,-1).join("::"));return[R(e,r,n,a,a.split("::").pop()??a,c,l)]}function Pt(e,r,t){let n=D(e,r);if(n)return yn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Nn(e,r,i))}return s}function yn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!bn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of re(o,""))i.importedName&&n.push(je(e,r,i.qualifiedName))}return n}function bn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Nn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[je(e,r,l)]})}return[je(e,r,n)]}function je(e,r,t){return{specifier:t,sourcePath:A(e,r,t)??A(e,r,t.split("::").slice(0,-1).join("::"))}}function j({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function _t(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var In={language:"javascript",extensions:Me,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:ke,parseReExports:we},Cn=j({language:"python",extensions:ve,imports:"ast-with-regex-fallback",parseImports:bt}),Pn=j({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:St}),_n={language:"rust",extensions:$e,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ct,parseExports:Pt},Rn=j({language:"ruby",extensions:Ue,imports:"ast-with-regex-fallback",parseImports:Nt}),Tn=j({language:"c/cpp",extensions:qe,imports:"ast-with-regex-fallback",parseImports:ct}),En=j({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:ft}),Fn={language:"dart",extensions:Be,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ut,parseExports:mt},An=j({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:xt}),Ln=j({language:"clojure",extensions:ze,imports:"regex-only",parseImports:pt}),kn=[In,Cn,Pn,_n,Rn,Tn,En,Fn,An,Ln];function me(e){return _t(kn,e)}var De={clearGroups:["whole-project","source-file"]},wn=q("source-imports",De),jn=q("source-exports",De),Dn=q("source-reexports",De),Rt=K({kind:"source-imports",invalidation:X("source-imports"),serialize:On,deserialize:Mn}),Tt=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:vn,deserialize:$n});function Qo(e,r){let t=ne(r);return Dn.get(e,t,()=>{let n=me(t);if(!n?.parseReExports)return[];let s=L(e,t);if(!s)return[];let o=W(e,t,s),i=he(e),a=Tt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return Tt.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Go(e,r){let t=ne(r);return wn.get(e,t,()=>{let n=me(t);if(!n)return[];let s=L(e,t);if(!s)return[];let o=W(e,t,s),i=he(e),a=Rt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Rt.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Yo(e,r){let t=ne(r);return jn.get(e,t,()=>{let n=me(t);if(!n?.parseExports)return[];let s=L(e,t);return s?n.parseExports(e,t,s):[]})}function On(e){return JSON.stringify(e)}function Mn(e){try{let r=JSON.parse(e);return!xe(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function vn(e){return JSON.stringify(e)}function $n(e){try{let r=JSON.parse(e);return!xe(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,At as b,Vn as c,Wn as d,Ne as e,T as f,Zt as g,sr as h,or as i,cr as j,lr as k,pr as l,ur as m,ue as n,Qo as o,Go as p,Yo as q};
13
- //# sourceMappingURL=chunk-JOALNFY3.js.map
13
+ //# sourceMappingURL=chunk-F74LZWCE.js.map
@@ -0,0 +1,27 @@
1
+ import{a as w,b as G,c as Te,d as Fe,e as $,f as Le,k as ie,l as oe}from"./chunk-NNG6M6XD.js";import{a as W}from"./chunk-GV2CEZCW.js";import{a as De}from"./chunk-ICUL7XRT.js";import{h as Be,k as se,t as Ne,v as qe}from"./chunk-7GAK2F3H.js";import{d as Oe,e as Ce}from"./chunk-SX72EVMY.js";import{d as ae}from"./chunk-3LCDIREB.js";import{E as Ae,H as S,L as Ee,P as ke,Q as F,R as re,i as Ie,k as Re,o as we,q as l,s as Me,t as Pe,v as _,x as ve}from"./chunk-UC2FD2PS.js";function Tt(t,e){return t.reason instanceof Error?t.reason:new Error(e)}function Er(t,e){if(t?.aborted)throw Tt(t,e)}import{join as Ft}from"path";var Lt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t.pid;return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{pid:e}:null};function Br(t,e={}){return z(Ft(t,"gc.lock"),e)}function z(t,e={}){let n=e.waitMs??0,r=e.pollMs??10,i=e.now??$,o=i()+n;do{let s=kt(t);if(s)return Bt(s);let a=o-i();if(a<=0)return null;Dt(Math.min(r,a))}while(i()<=o);return null}function kt(t){let e=Le(t,{kind:"generic",parseLegacy:Lt});return e.kind==="acquired"?e.lock:null}function Bt(t){return{release:()=>{t.release()}}}function Dt(t){let e=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(e,0,0,t)}function je(t,e,n={}){ie(t,_e(e,n),{durability:"visibility",runtime:n.runtime})}function qr(t,e,n={}){return ie(t,_e(e,n),{durability:"durable",runtime:n.runtime})}function _e(t,e){let n=JSON.stringify(t,null,e.spacing);return e.trailingNewline?`${n}
2
+ `:n}import{execFileSync as ze,spawnSync as zr}from"child_process";import{platform as Wt}from"os";import{resolve as zt}from"path";import{createHash as Nt}from"crypto";import{existsSync as Ge,renameSync as qt,rmSync as Ot,writeFileSync as Ct}from"fs";import{tmpdir as jt}from"os";import{join as _t}from"path";var $e=`'use strict';
3
+ const NativeRegExp = globalThis.RegExp;
4
+ const escapeLoneSeparator = (args) =>
5
+ typeof args[0] === 'string' && args[0] === '\\\\' ? ['\\\\\\\\', ...args.slice(1)] : args;
6
+ globalThis.RegExp = new Proxy(NativeRegExp, {
7
+ construct(target, args) {
8
+ return Reflect.construct(target, escapeLoneSeparator(args));
9
+ },
10
+ apply(target, thisArg, args) {
11
+ return Reflect.apply(target, thisArg, escapeLoneSeparator(args));
12
+ },
13
+ });
14
+ `,Gt=/scip-python/i;function We(t,e=process.platform){return e!=="win32"||!Gt.test(t)?[]:["--require",$t()]}function $t(t=jt()){let e=Nt("sha256").update($e).digest("hex").slice(0,16),n=_t(t,`codebaseiq-indexer-compat-${e}.cjs`);if(Ge(n))return n;let r=`${n}.${process.pid}.tmp`;Ct(r,$e);try{qt(r,n)}catch{if(Ot(r,{force:!0}),!Ge(n))throw new Error(`could not materialize indexer compatibility preload at ${n}`)}return n}var Je=Wt()==="win32";function He(t){let e=Je?"where":"which";try{return ze(e,[t],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var Jt=/\.(?:c|m)?js$/i,Ht=/\.(?:exe|com)$/i;function Vr(t,e){return Jt.test(t)?{binary:process.execPath,args:[...We(t),t,...e]}:{binary:t,args:[...e]}}function Ut(t,e){return ze(t,e,{stdio:["ignore","pipe","ignore"],windowsHide:!0,encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function Ue(t,e={}){let n=e.isWindows??Je,r=e.lookup??Ut,i;try{i=r(n?"where":"which",[t])}catch{return null}let o=i.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(!n){let s=o[0];return s?zt(s):null}return o.find(s=>Ht.test(s))??null}import{execFileSync as Qe}from"child_process";import{createHash as Vt}from"crypto";import{existsSync as J,statSync as Qt}from"fs";import{createRequire as Kt}from"module";import{platform as Xt}from"os";import{dirname as Ve,join as L}from"path";var Yt=Kt(import.meta.url),oi={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function ce(t){return[t.indexerBinary,...t.binaryAliases??[]]}function Zt(t){let e=ce(t);return e.length===1?e[0]:e.join(" or ")}function de(t){for(let e of ce(t)){let n=Ue(e);if(n)return n}return tn(t)}function si(t){return de(t)!==null||en(t)}function en(t){return Ke(t)!==null}function tn(t){let e=Ke(t);if(!e)return null;let r=JSON.parse(S(e,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return L(Ve(e),r);for(let i of ce(t)){let o=r[i];if(o)return L(Ve(e),o)}return null}function Ke(t){if(!t.bundledNpmPackage)return null;try{return Yt.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function nn(t,e){for(let n of t.projectLocalBinaries??[]){let r=L(e,n);if(J(r))return r}return null}function rn(t,e){for(let n of t.projectLocalBinaries??[]){let r=L(e,n);if(J(r))return Xe(e,n,r)}return null}function ai(t,e){let n=on(t,e);if(!n||n.canonicalPath!==e.canonicalPath||n.sha256!==e.sha256||n.size!==e.size||n.mtimeMs!==e.mtimeMs||n.device!==e.device||n.inode!==e.inode||n.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function on(t,e){try{return Xe(t,e.relativePath,e.configuredPath)}catch{return null}}function Xe(t,e,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=Oe(t,e,r),o=Ce(t,e,r),s=Qt(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:Vt("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function sn(t,e,n={}){return(n.trustProjectTools?rn(t,e)?.canonicalPath:null)??de(t)}function ci(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||le(n,e))return e;let r=Ye(n,e);return r?{...e,DOTNET_ROOT:r}:e}function di(t,e,n={}){let r=Zt(t),i=e?sn(t,e,n):de(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&&nn(t,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=an(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function an(t){if(le(t,process.env))return{runnable:!0};let e=Ye(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=Ze(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function Ye(t,e){for(let n of Ze(e))if(le(t,{...e,DOTNET_ROOT:n}))return n;return null}function Ze(t){let e=[],n=t.DOTNET_ROOT;if(n&&J(n)&&e.push(n),Xt()==="darwin"&&He("brew"))try{let r=Qe("brew",["--prefix","dotnet@9"],{stdio:"pipe",windowsHide:!0,env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=L(r,"libexec");J(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function le(t,e){try{return Qe(t,["--version"],{stdio:"pipe",windowsHide:!0,env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var cn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function H(t){let e=t.toLowerCase();return cn.some(n=>e.endsWith(n))}function V(t){let e=U(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(d=>[d.path,d])),i=t.snapshot.files.filter(d=>{let m=Ie(d.path,["typescript"]);return m==="config"||m==="ambient"}).map(d=>d.path),o=U([...e,...i]),s=o.find(d=>!r.has(d)),a=new Set(t.snapshot.files.map(d=>d.path)).size!==t.snapshot.files.length,c=!s&&o.some(d=>et(r.get(d))),p=se(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:U(t.snapshot.typescriptProjects),membership:e})),u=new Map;return{identityFor(d,m){if(!n.has(d))return M("target-outside-project");if(a)return M("duplicate-input-path");if(s)return M("missing-input-fingerprint");if(c)return M("unreadable-input");let g=[],f,I;if(t.graph===null)g.push("dependency-graph-unavailable"),I="whole-project",f=o;else{let j=ln(d,t.graph,u);if(j.find(ne=>!r.has(ne)))return M("missing-input-fingerprint");if(f=U([...j,...i]),f.some(ne=>et(r.get(ne))))return M("unreadable-input");I="dependency-closure"}let C=f.map(j=>un(r.get(j)));return{version:1,key:se(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:p,inputs:C})),mode:I,inputFiles:f,reasons:g}}}}function dn(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...e.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function ln(t,e,n){let r=n.get(t);if(r)return r;let i=dn(t,e);return n.set(t,i),i}function un(t){return{path:t.path,size:t.size,hash:t.hash}}function et(t){return t.size<0||t.hash==="unreadable"}function M(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function U(t){return[...new Set(t)].sort()}import{createRequire as pn}from"module";var tt=pn(import.meta.url),k,Q;function fn(){if(k!==void 0)return k;try{k=tt("ts-morph")}catch{k=null}return k}function K(){if(Q)return Q;let t=fn();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=tt("ts-morph/package.json").version??"unknown"}catch{}return Q=`ts-morph:${e}:typescript:${t.ts.version}`,Q}function gi(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function bi(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var mn=Be("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function ue(t,e,n){let r=mn.get(t,()=>yn(t));if(!r)return null;let i=`${n}\0${e}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(e,n);return r.identities.set(i,s),s}function B(t){return De(t,{includeIgnored:!1}).filter(H).sort()}function yn(t){try{if(!t.generation.metadataRaw)return null;let e=_(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=Re(e.metadata.fingerprint);return n?{builder:V({projectFiles:B(t),snapshot:n,graph:W(t),engineIdentity:K()}),identities:new Map}:null}catch{return null}}function X(t,e){let n=new Map(t.map(i=>[i.symbol,i])),r=new Map(t.map(i=>[i.symbolId,[]]));for(let i of e.values())for(let o of i){let s=n.get(o.targetSymbol);s&&r.get(s.symbolId).push(o.location)}for(let[i,o]of r)r.set(i,gn(o));return r}function it(t,e,n){let r=rt(t,e),i=rt(t,n),o=[...r].filter(d=>!i.has(d)).sort(),s=[...i].filter(d=>!r.has(d)).sort(),a=nt(t,e),c=nt(t,n),p=[...a].filter(d=>!c.has(d)).sort(),u=[...c].filter(d=>!a.has(d)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:p.length===0&&u.length===0,expectedCount:a.size,actualCount:c.size,missing:p,extra:u}}}function nt(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function Ei(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let s of e.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,bn(s));return i}function rt(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function gn(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort(ot)}function bn(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||ot(n.location,r.location))}function ot(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var pe="typescript-reference-fragment-v3-incomplete-scan",Y=Ne({kind:"typescript-reference-fragments",invalidation:qe("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:Sn});function Ci(t,e,n,r=t){let i=B(t),o=V({projectFiles:i,snapshot:e,graph:W(t),engineIdentity:K()}),s=[...n].map(([a,c])=>({relativePath:a,contentHash:o.identityFor(a,pe).key,value:[...c]}));if(s.some(a=>a.contentHash===null))throw new Error("TypeScript reference fragment identity is unavailable for an affected document.");return Y.writeBatch(r,s.map(a=>({...a,contentHash:a.contentHash}))),s.length}function ji(t,e,n,r){let i=e.filter(s=>H(s.relativePath));if(i.length===0)return D("no TypeScript definitions");let o=D("shadow did not run");return ae("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=D("TypeScript reference fragment provider is unavailable"),o;let a=B(t),c=new Set(a),p=s.referenceFragmentsForFiles(a),u=a.filter(f=>!p.has(f));if(u.length>0)return o=D(`TypeScript reference lookup was incomplete for ${u.length} file(s)`),o;let d=X(i,p),m=it(i,hn(n,c),d);if(!m.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...m},o;let g=[];for(let f of a){let I=ue(t,f,pe);I?.key&&g.push({relativePath:f,contentHash:I.key,value:p.get(f)??[]})}return Y.writeBatch(t,g),o={state:"passing",files:a.length,keyedFiles:g.length,writtenFiles:g.length,...m},o}catch(s){return o=D(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function hn(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function _i(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return ae("typescript.reference-fragments.materialize",()=>{try{let c=B(t);i=c.length;let p=new Map,u=new Map,d=[];for(let f of c){let I=ue(t,f,pe);if(!I?.key)return null;p.set(f,I.key);let C=Y.read(t,f,I.key);C===null?(s+=1,d.push(f)):(o+=1,u.set(f,C))}if(s===0)return r="hit",{references:X(e,u),files:i,cacheHits:o,cacheMisses:s,computedFiles:a};let m=n(e[0].relativePath);if(!m.availability().available||!m.referenceFragmentsForFiles)return null;let g=m.referenceFragmentsForFiles(d);if(d.some(f=>!g.has(f)))return null;a=g.size,Y.writeBatch(t,d.map(f=>({relativePath:f,contentHash:p.get(f),value:g.get(f)??[]})));for(let[f,I]of g)u.set(f,I);return r="computed",{references:X(e,u),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function D(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function Sn(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(xn)?null:e}catch{return null}}function xn(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{createHash as In,randomUUID as Rn}from"crypto";import{existsSync as P,mkdirSync as wn,readdirSync as Mn,rmSync as at,statSync as ct}from"fs";import{basename as Pn,dirname as Z,join as x}from"path";var vn=1,An=1,En=".codebaseiq-generations",Tn="manifest.json",dt="readers",Fn="gc.lock",Ln=128,N=new Map,lt={pid:process.pid,now:()=>new Date,randomToken:()=>Rn(),isProcessAlive:Fe,readProcessIdentity:Te,resolveImmutableGeneration:ft};function v(t){return x(Z(t),En)}function ut(t){return x(v(t),Fn)}function Yi(t,e=lt){let n=z(ut(t.dbPath),{waitMs:5e3});if(!n)throw new Error("SQLite generation retention is busy; retry opening the index.");let r;try{let o=ge(t.dbPath);if(!o||!pt(t.dbPath,o.currentGeneration))return{generation:qn(t),release(){}};let s=e.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(s))throw new Error("SQLite generation reader token is unsafe.");let a=x(v(t.dbPath),dt);wn(a,{recursive:!0});let c=x(a,`${e.pid}-${s}.json`),p=e.readProcessIdentity(e.pid);je(c,{version:1,token:s,generationIdentity:o.currentGeneration,pid:e.pid,...p?{processIdentity:p}:{},acquiredAt:e.now().toISOString()},{spacing:2,trailingNewline:!0});let u=!1;r={identity:o.currentGeneration,required:o.artifactSet==="immutable-v1",release(){u||(u=!0,at(c,{force:!0}))}}}finally{n.release()}let i;try{i=e.resolveImmutableGeneration(t,r.identity)}catch(o){throw r.release(),o}if(i?.source==="immutable"&&i.identity===r.identity)return{generation:i,release:r.release};if(r.release(),r.required)throw new Error(`Published SQLite generation ${r.identity} is missing or invalid.`);return kn(t,r.identity)}function kn(t,e){let n=z(ut(t.dbPath),{waitMs:5e3});if(!n)throw new Error("SQLite generation retention is busy; retry opening the index.");try{let r=ge(t.dbPath);if(r?.currentGeneration!==e)throw new Error("SQLite index publication changed while opening a legacy generation.");if(P(x(Z(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return{generation:mt(t,r.currentGeneration),release(){}}}finally{n.release()}}function Zi(t,e,n=lt,r={}){let i=x(v(t),dt);if(!P(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,s=0,a=0,c=0;for(let p of Mn(i,{withFileTypes:!0})){if(!p.isFile()||!p.name.endsWith(".json"))continue;let u=x(i,p.name),d;try{d=Bn(JSON.parse(S(u,"SQLite generation reader lease")))}catch{d=null}if(!d){c+=1;for(let m of e)o.add(m);continue}if(!Dn(d,n)){r.removeStale!==!1&&(at(u,{force:!0}),a+=1);continue}s+=1,o.add(d.generationIdentity)}return{protectedGenerations:o,activeLeases:s,staleLeasesRemoved:a,malformedLeases:c}}function Bn(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=e.processIdentity===void 0?null:w(e.processIdentity);return e.version!==1||typeof e.token!="string"||e.token.trim()===""||typeof e.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(e.generationIdentity)||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.acquiredAt!="string"||!Number.isFinite(Date.parse(e.acquiredAt))||e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,token:e.token,generationIdentity:e.generationIdentity,pid:e.pid,...n?{processIdentity:n}:{},acquiredAt:e.acquiredAt}}function Dn(t,e){if(!e.isProcessAlive(t.pid))return!1;if(!t.processIdentity)return!0;let n=e.readProcessIdentity(t.pid);return n===null||G(t.processIdentity,n)}function ge(t){try{let e=JSON.parse(S(x(v(t),"state.json"),"SQLite generation state"));return _n(e)?e:null}catch{return null}}function pt(t,e){return Nn(v(t),e)}function Nn(t,e){try{let n=JSON.parse(S(x(t,e,Tn),"SQLite generation manifest"));return jn(n,e)?n:null}catch{return null}}function qn(t){let e=ge(t.dbPath);if(e){let n=ft(t,e.currentGeneration);if(n)return n;if(e.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${e.currentGeneration} is missing or invalid.`)}if(P(x(Z(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return mt(t,e?.currentGeneration)}function On(t){return ve(_(t))??t}function ft(t,e){try{let n=x(v(t.dbPath),e),r=pt(t.dbPath,e);if(!r)return null;let i=fe(n,r.database),o=r.index?fe(n,r.index):void 0,s=r.metadata?fe(n,r.metadata):void 0;return!me(i,r.database)||r.index&&(!o||!me(o,r.index))||r.metadata&&(!s||!me(s,r.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:S(s,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function mt(t,e){let n=yt(t.dbPath),r=x(Z(t.dbPath),"meta.json"),i=P(r)?S(r,"reindex metadata"):void 0,o=P(t.indexPath)?t.indexPath:void 0;return{identity:e??Cn(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:r,metadataRaw:i},source:"legacy",databaseFileIdentity:n}}function Cn(t,e){let n=In("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&n.update(On(e)),n.update(`\0${yt(t)}`),n.digest("hex")}function yt(t){let e=ct(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function fe(t,e){if(Pn(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return x(t,e.file)}function me(t,e){if(!P(t))return!1;let n=st(t);if(!n||n.size!==e.size)return!1;let r=`${t}\0${e.sha256}\0${n.identity}`;if(N.has(r))return!0;let i=Ee(t,{inputKind:"immutable SQLite generation artifact",maxBytes:e.size}),o=st(t);if(!o||o.identity!==n.identity||i!==e.sha256)return!1;for(N.set(r,!0);N.size>Ln;){let s=N.keys().next().value;if(s===void 0)break;N.delete(s)}return!0}function st(t){let e=ct(t,{bigint:!0});return e.isFile()?{identity:`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`,size:Number(e.size)}:null}function jn(t,e){return t.version===An&&t.identity===e&&ye(t.database)&&(t.index===void 0||ye(t.index))&&(t.metadata===void 0||ye(t.metadata))}function ye(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.file=="string"&&!!e.file&&Number.isSafeInteger(e.size)&&(e.size??-1)>=0&&typeof e.sha256=="string"&&/^[a-f0-9]{64}$/.test(e.sha256)}function _n(t){return t.version===vn&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&Gn(t.stableMirrors)&&$n(t.previousGeneration)&&Wn(t.publication)}function Gn(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.databaseFileIdentity=="string"&&!!e.databaseFileIdentity&&(e.indexFileIdentity===void 0||typeof e.indexFileIdentity=="string"&&!!e.indexFileIdentity)}function $n(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.generationIdentity=="string"&&!!e.generationIdentity&&typeof e.databasePath=="string"&&!!e.databasePath&&(e.metadataPath===void 0||typeof e.metadataPath=="string"&&!!e.metadataPath)}function Wn(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t,n=[e.converterDurationMs,e.affectedDocumentCount,e.changedDocumentCount,e.producerDurationMs,e.materializationDurationMs,e.patchDurationMs].filter(r=>r!==void 0);return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&n.every(r=>typeof r=="number"&&Number.isFinite(r)&&r>=0)&&(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}function to(t){return t.startsWith("local ")}import{zstdCompressSync as Jn,zstdDecompressSync as Hn}from"zlib";function oo(t){return Jn(Buffer.from(JSON.stringify(t.map(e=>[e.symbol,e.roles,e.range,e.enclosingRange]))))}function bt(t){let e;try{e=JSON.parse(Hn(t).toString("utf8"))}catch{return null}return Array.isArray(e)?e.map(([n,r,i,o])=>({symbol:n,roles:r,range:i,enclosingRange:o})):null}function Un(t){return t.length===1&&t[0]===0}function so(t,e){let n=t.all(`SELECT c.occurrences
15
+ FROM chunks c
16
+ JOIN documents d ON d.id = c.document_id
17
+ WHERE d.relative_path = ?
18
+ ORDER BY c.chunk_index, c.id`,e),r=[];for(let i of n){if(Un(i.occurrences))continue;let o=bt(i.occurrences);if(!o)return null;r.push(...o)}return r}function ao(t,e){let n=new Map(e.map(i=>[i,[]])),r=new Map;for(let i of gt([...n.keys()])){let o=t.all(`SELECT DISTINCT m.chunk_id, gs.symbol
19
+ FROM mentions m
20
+ JOIN global_symbols gs ON gs.id = m.symbol_id
21
+ WHERE gs.symbol IN (${i.map(()=>"?").join(",")})`,...i);for(let s of o){let a=r.get(s.chunk_id)??[];a.push(s.symbol),r.set(s.chunk_id,a)}}for(let i of gt([...r.keys()])){let o=t.all(`SELECT c.id, d.relative_path, c.occurrences
22
+ FROM chunks c
23
+ JOIN documents d ON d.id = c.document_id
24
+ WHERE c.id IN (${i.map(()=>"?").join(",")})`,...i);for(let s of o){let a=bt(s.occurrences);if(!a){for(let c of r.get(s.id)??[])n.set(c,null);continue}for(let c of a)(c.roles&1)===0&&n.get(c.symbol)?.push({relativePath:s.relative_path,occurrence:c})}}return n}function gt(t){let e=[];for(let n=0;n<t.length;n+=750)e.push(t.slice(n,n+750));return e}import{createHash as Vn,randomUUID as Rt}from"crypto";import{existsSync as T,lstatSync as O,readdirSync as E,renameSync as wt,rmSync as R}from"fs";import{basename as be,dirname as Qn,join as y}from"path";function ee(t){return Array.isArray(t)?`[${t.map(ee).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>`${JSON.stringify(e)}:${ee(n)}`).join(",")}}`:JSON.stringify(t)}var Kn=1,Xn=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),A=class extends Error{constructor(n,r,i,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${i.maxItemBytes}`:n==="item-capacity"?`mailbox has ${r.totalItems} retained items; limit is ${i.maxItems}`:n==="byte-capacity"?`mailbox retains ${r.totalBytes} bytes and the request adds ${o}; limit is ${i.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=r;this.limits=i;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},Yn=".owner.json",Zn={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function xo(t){return{rootDir:t,pendingDir:y(t,"pending"),inflightDir:y(t,"inflight"),responseDir:y(t,"responses"),deadLetterDir:y(t,"dead-letter"),legacyRequestDir:y(t,"requests")}}function er(t={}){let e={...Xn,...t};for(let[n,r]of Object.entries(e))if(!Number.isFinite(r)||r<=0||!Number.isInteger(r))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return e}function Mt(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>ke(n));return re(...e)}function Io(t,e){return Vn("sha256").update(ee({namespace:t,payload:e})).digest("hex")}function tr(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function Ro(t,e,n={}){let r=er(n.limits),i=n.nowMs??Date.now(),o=Mt(t);return dr(e),rr(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??$,()=>{nr(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),c=ht(t,e.id);if(c){let m=St(c,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:m.deadlineAtMs??e.deadlineAtMs}}let p=`${JSON.stringify(e)}
25
+ `,u=Buffer.byteLength(p),d=Pt(t);if(u>r.maxItemBytes)throw new A("item-too-large",d,r,u);if(d.totalItems+1>r.maxItems)throw new A("item-capacity",d,r,u);if(d.totalBytes+u>r.maxBytes)throw new A("byte-capacity",d,r,u);n.onBeforePublish?.();try{let m=oe(s,p,{durability:"durable"}),g=re(o,m.directorySync);return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:g==="synced"?"directory-durable":"file-flushed",directorySync:g}}catch(m){if(m.code!=="EEXIST")throw m;let g=ht(t,e.id);if(!g)throw m;let f=St(g,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:f.deadlineAtMs??e.deadlineAtMs}}})}function nr(t,e,n,r=Zn){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of Se(t.inflightDir)){if(o<=0)break;let a=y(t.responseDir,`${s.requestId}.json`);if(T(a)){R(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||ar(t,s.ownerId,r)!=="dead")continue;let c=y(t.pendingDir,s.originalFile);try{wt(s.path,c),i.reclaimed++}catch(p){if(p.code!=="EEXIST")throw p;R(s.path,{force:!0})}F(Qn(s.path)),F(t.pendingDir),o--}o=xt(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=xt(t.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,e,()=>{i.deadLettersRemoved++});for(let s of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir]){if(o<=0)break;for(let a of vt(s)){if(o<=0)break;be(a).includes(".tmp-")&&(O(a).mtimeMs+n.temporaryRetentionMs>e||(R(a,{force:!0}),i.temporaryFilesRemoved++,o--))}}return lr(t.inflightDir),i}function Pt(t){Mt(t);let e=[...q(t.pendingDir).map(c=>({path:c,pending:!0})),...q(t.legacyRequestDir).map(c=>({path:c,pending:!0}))],n=Se(t.inflightDir).map(c=>({path:c.path,pending:!1})),r=q(t.responseDir).map(c=>({path:c,pending:!1})),i=q(t.deadLetterDir).map(c=>({path:c,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let c of e){let p=xe(c.path);if(!p){s++;continue}let u=p.enqueuedAtMs??O(c.path).mtimeMs;a=a===void 0?u:Math.min(a,u)}return{pending:e.length,inflight:n.length,responses:r.length,deadLetters:i.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((c,p)=>c+ur(p.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function rr(t,e,n,r,i){let o=y(t.rootDir,".admission.lock"),s=`${process.pid}-${Rt()}`,a=r()+Math.max(0,n);for(;!ir(t.rootDir,o,s);){if(or(o),r()>=a)throw new A("admission-busy",Pt(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return i()}finally{try{he(o).ownerToken===s&&(R(o,{recursive:!0,force:!0}),F(t.rootDir))}catch{}}}function ir(t,e,n){let r=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
26
+ `;try{return oe(e,r,{durability:"durable"}),!0}catch(i){if(i.code==="EEXIST")return!1;try{he(e).ownerToken===n&&(R(e,{force:!0}),F(t))}catch{}throw i}}function or(t){let e=null;try{let r=he(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||sr(e))return;let n=`${t}.stale-${Rt()}`;try{wt(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}R(n,{recursive:!0,force:!0})}function he(t){try{return JSON.parse(S(t,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof Ae&&e.reason==="not-regular"))throw e;return JSON.parse(S(y(t,"owner.json"),"mailbox lock owner record"))}}function sr(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function ar(t,e,n){let r=cr(y(t.inflightDir,At(e),Yn));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?G(r.processIdentity,i)?"live":"dead":"unknown"}function cr(t){try{let e=JSON.parse(S(t,"mailbox owner record"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let n=e.processIdentity===void 0?null:w(e.processIdentity);return e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...n?{processIdentity:n}:{}}}catch{return null}}function ht(t,e){for(let n of[y(t.pendingDir,`${e}.json`),y(t.legacyRequestDir,`${e}.json`),y(t.responseDir,`${e}.json`)])if(T(n))return n;for(let n of Se(t.inflightDir))if(n.requestId===e)return n.path;return null}function St(t,e,n){let r=xe(t);if(!r||r.operationKey!==e)throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`);return r}function dr(t){if(t.mailboxVersion!==Kn||t.id!==tr(t.operationKey)||!t.clientId.trim()||!Number.isFinite(t.enqueuedAtMs)||!Number.isFinite(t.deadlineAtMs)||t.deadlineAtMs<t.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function Se(t){if(!T(t))return[];let e=[];for(let n of E(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=It(n.name);if(r===null)continue;let i=y(t,n.name);for(let o of E(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=It(s[1]),c=Number(s[2]);if(a===null||be(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(c))continue;let p=y(i,o.name),u=xe(p)??{id:be(a,".json")},d=O(p);e.push({requestId:u.id,ownerId:r,path:p,originalFile:a,claimedAtMs:d.mtimeMs,claimExpiresAtMs:c,byteLength:d.size,...u.operationKey?{operationKey:u.operationKey}:{},...u.clientId?{clientId:u.clientId}:{},...u.enqueuedAtMs===void 0?{}:{enqueuedAtMs:u.enqueuedAtMs},...u.deadlineAtMs===void 0?{}:{deadlineAtMs:u.deadlineAtMs},legacy:u.operationKey===void 0})}}return e.sort((n,r)=>n.claimedAtMs-r.claimedAtMs||n.path.localeCompare(r.path))}function xe(t){try{let e=JSON.parse(S(t,"mailbox record"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function xt(t,e,n,r,i){for(let o of q(t)){if(e<=0)break;let s=O(o);n(o,s.mtimeMs)>r||(R(o,{force:!0}),i(),e--)}return e}function q(t){return T(t)?E(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function vt(t){if(!T(t))return[];let e=[];for(let n of E(t,{withFileTypes:!0})){let r=y(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...vt(r))}return e.sort()}function lr(t){if(T(t))for(let e of E(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=y(t,e.name);E(n).some(r=>r.endsWith(".claim"))||R(n,{recursive:!0,force:!0})}}function ur(t){try{return O(t).size}catch{return 0}}function At(t){return Buffer.from(t,"utf8").toString("base64url")}function It(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return At(e)===t?e:null}catch{return null}}import{join as te}from"path";var pr="watch.lock",fr="watch-state.json",mr="watch-activity.json",yr="watch-refresh-requests";function To(t){return{lockPath:te(t,pr),statePath:te(t,fr),activityPath:te(t,mr),refreshRequestsPath:te(t,yr)}}function Fo(t){try{return gr(JSON.parse(S(t,"watch service state")))}catch{return null}}function gr(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!b(e.startedAt)||!b(e.heartbeatAt)||!b(e.lastActivityAt)||!br(e.watcher)||e.idleDeadlineAt!==void 0&&!b(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=w(e.processIdentity);if(!n||n.pid!==e.pid)return null;e.processIdentity=n}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!hr(e.lastError)||e.lastRefresh!==void 0&&!Sr(e.lastRefresh)||e.reindexActivity!==void 0&&!xr(e.reindexActivity)||e.refreshRequests!==void 0&&!Rr(e.refreshRequests)||e.typescriptSemantic!==void 0&&!wr(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!Mr(e.typescriptIndex)||e.queryLane!==void 0&&!Pr(e.queryLane)?null:e}function b(t){return we(t)}function br(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return h(e.changedFiles)&&h(e.reindexAt);case"indexing":return h(e.startedAt);case"cooldown":return h(e.until)&&typeof e.dirty=="boolean";case"budget-paused":return h(e.until)&&typeof e.dirty=="boolean"&&typeof e.reason=="string"&&l(e.rebuilt)&&l(e.estimatedWriteBytes);case"draining":return h(e.startedAt)&&typeof e.reason=="string";default:return!1}}function hr(t){if(!t||typeof t!="object")return!1;let e=t;return b(e.at)&&typeof e.message=="string"}function Sr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&b(e.startedAt)&&b(e.completedAt)&&h(e.durationMs)}function xr(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!l(e.recordsRead)||e.invalidRecords!==void 0&&!l(e.invalidRecords)||e.skippedRecords!==void 0&&!l(e.skippedRecords)||e.readErrors!==void 0&&!l(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!l(e.ignoredPartialTailBytes)||!b(e.windowStartedAt)||!b(e.windowEndedAt)||!l(e.runs)||!l(e.rebuilt)||!l(e.reused)||!l(e.failed)||!l(e.suppressed)||!h(e.estimatedLogicalOutputBytes)||e.estimatedWriteBytes!==void 0&&!l(e.estimatedWriteBytes)||e.reflinkedBytes!==void 0&&!l(e.reflinkedBytes)||e.fallbackCopiedBytes!==void 0&&!l(e.fallbackCopiedBytes)||e.oldestRebuildAt!==void 0&&!b(e.oldestRebuildAt)||e.oldestWriteAt!==void 0&&!b(e.oldestWriteAt)||e.languageAttribution!==void 0&&e.languageAttribution!=="complete"&&e.languageAttribution!=="partial"&&e.languageAttribution!=="unavailable"||e.attributedRuns!==void 0&&!l(e.attributedRuns)||e.unattributedRuns!==void 0&&!l(e.unattributedRuns)||e.invalidLanguageDetails!==void 0&&!l(e.invalidLanguageDetails)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"||Array.isArray(e.byTrigger)||e.byLanguage!==void 0&&!Ir(e.byLanguage)?!1:Object.values(e.byTrigger).every(n=>n===void 0||l(n))}function Ir(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;for(let[e,n]of Object.entries(t)){if(!Pe.includes(e)||!n||typeof n!="object")return!1;let r=n;if(!l(r.runs)||!l(r.rebuilt)||!l(r.reused)||!l(r.producedOutputBytes)||!Me(r.durationMs)||r.rebuilt+r.reused!==r.runs)return!1}return!0}function Rr(t){if(!t||typeof t!="object")return!1;let e=t;return l(e.pending)&&l(e.claimed)&&l(e.completed)&&l(e.expired)&&l(e.invalid)&&(e.oldestPendingAt===void 0||b(e.oldestPendingAt))}function wr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&h(e.requests)&&h(e.sessionsCreated)&&h(e.sessionsReused)&&h(e.sessionsRefreshed)&&h(e.sessionsReplaced)&&h(e.projectsCreated)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||b(e.busyUntil))&&(e.mailbox===void 0||Et(e.mailbox))}function Mr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&l(e.requests)&&l(e.sessionsCreated)&&l(e.sessionsReplaced)&&l(e.initializations)&&l(e.programUpdates)&&l(e.documentsEmitted)&&l(e.documentsRemoved)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastDurationMs===void 0||h(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||b(e.busyUntil))&&(e.mailbox===void 0||Et(e.mailbox))}function Pr(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&typeof e.socketPath=="string"&&e.socketPath.length>0&&l(e.requests)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")}function Et(t){if(!t||typeof t!="object")return!1;let e=t;return l(e.pending)&&l(e.inflight)&&l(e.responses)&&l(e.deadLetters)&&l(e.invalid)&&l(e.totalItems)&&h(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||b(e.oldestPendingAt))}function h(t){return typeof t=="number"&&Number.isFinite(t)}export{Tt as a,Er as b,Br as c,z as d,je as e,qr as f,vn as g,An as h,En as i,Tn as j,v as k,ut as l,Yi as m,Zi as n,ge as o,pt as p,Nn as q,qn as r,On as s,yt as t,He as u,Vr as v,oi as w,Zt as x,de as y,si as z,nn as A,rn as B,ai as C,ci as D,di as E,ee as F,Kn as G,xo as H,Io as I,tr as J,Ro as K,to as L,oo as M,so as N,ao as O,To as P,Fo as Q,cn as R,H as S,fn as T,gi as U,bi as V,Ei as W,V as X,ue as Y,Ci as Z,ji as _,_i as $};
27
+ //# sourceMappingURL=chunk-G7GVV2TV.js.map
@@ -1,4 +1,4 @@
1
- import{a as z}from"./chunk-MTMF4N7F.js";import{p as We}from"./chunk-BH5CE4LN.js";import{a as Ze}from"./chunk-ZOEDRCR4.js";import{A as oe,t as I}from"./chunk-AM5SUGHF.js";import{f as ae,o as Xe,p as D}from"./chunk-JOALNFY3.js";import{A as Ge,C as B,F as Ke,K as H,z as He}from"./chunk-RVYLJDXC.js";import{a as Ue,g as Z,w as M}from"./chunk-PLZXWZHY.js";function se(e){let t=e.replaceAll("\\","/");return Ze(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import Mt from"better-sqlite3";var ue="codebaseiq_runtime_boundaries",j="codebaseiq_runtime_observations",ce="codebaseiq_runtime_relation_groups",de="codebaseiq_runtime_relation_participants";function Vt(e,t){let n=new Mt(Ue(e));try{n.exec(`
1
+ import{a as z}from"./chunk-3VJ3OCRE.js";import{p as We}from"./chunk-J7AMBVWF.js";import{a as Ze}from"./chunk-BRQL7AFJ.js";import{A as oe,t as I}from"./chunk-GVAF222T.js";import{f as ae,o as Xe,p as D}from"./chunk-F74LZWCE.js";import{A as Ge,C as B,F as Ke,K as H,z as He}from"./chunk-ICUL7XRT.js";import{a as Ue,g as Z,w as M}from"./chunk-7GAK2F3H.js";function se(e){let t=e.replaceAll("\\","/");return Ze(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import Mt from"better-sqlite3";var ue="codebaseiq_runtime_boundaries",j="codebaseiq_runtime_observations",ce="codebaseiq_runtime_relation_groups",de="codebaseiq_runtime_relation_participants";function Vt(e,t){let n=new Mt(Ue(e));try{n.exec(`
2
2
  CREATE TABLE IF NOT EXISTS ${ue} (
3
3
  singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
4
4
  schema_version INTEGER NOT NULL,
@@ -46,4 +46,4 @@ import{a as z}from"./chunk-MTMF4N7F.js";import{p as We}from"./chunk-BH5CE4LN.js"
46
46
  CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
47
47
  ON ${de}(observation_id, participant_role);
48
48
  `)}function qt(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function le(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function Ut(e){try{return[JSON.parse(e)]}catch{return[]}}function Ye(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",ue))return null;let n=e.get(`SELECT schema_version, payload FROM ${ue} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}import{createHash as Ot}from"crypto";import{createHash as cn}from"crypto";var pe=8;function G(e,t,n){return Pe(Je(e,t,we(n),0,new Set))}function Fe(e,t,n){return Ce(e,t,n,0,new Set)}function Je(e,t,n,r,i){if(r>pe)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?Qe(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?et(e,t,n,r,i):[]}function Qe(e,t,n,r,i,a){let o=[];for(let s of Ce(e,t,n,i+1,new Set(a))){let l=Zt(s.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let c=u.childForFieldName("key")??u.namedChild(0);if(Wt(c)!==r)continue;let d=u.childForFieldName("value")??u.namedChild(1);d&&o.push(...Je(e,s.definition.relativePath,we(d.text),i+1,new Set(a)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let d=Kt(e,s.definition.relativePath,r,u);o.push(...d.length>0?d:[Ht(s.definition,r,u)]);continue}if(u.type==="spread_element"){let c=u.namedChild(0);if(!c)continue;for(let d of Ce(e,s.definition.relativePath,we(c.text),i+1,new Set(a)))o.push(...Qe(e,d.definition.relativePath,d.definition.leaf,r,i+1,new Set(a)))}}}return Pe(o)}function Ht(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function Ce(e,t,n,r,i){return r>pe||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:et(e,t,n,r,i).flatMap(a=>{let o=B(e,a.relativePath)?.rootNode,s=o?Xt(o,a.leaf):null;return s?[{definition:a,initializer:s}]:[]})}function et(e,t,n,r,i){if(r>pe)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let o=I(e,t).filter(u=>u.leaf===n);if(o.length>0)return o;let s=Gt(e,t,n);if(s.length>0)return s;let l=D(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return Ie(e,l.sourcePath,u,r+1,new Set(i))}return Ie(e,t,n,r+1,new Set(i))}function Gt(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(ae(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function Ie(e,t,n,r,i){if(r>pe)return[];let a=I(e,t).filter(o=>o.leaf===n);return a.length>0?a:Pe(Xe(e,t).flatMap(o=>o.sourcePath?o.kind==="named"&&!o.names.includes(n)?[]:Ie(e,o.sourcePath,n,r+1,new Set(i)):[]))}function Kt(e,t,n,r){return I(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function Xt(e,t){let n=null;return tt(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Zt(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function Wt(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function we(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function Pe(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}function tt(e,t){t(e);for(let n of e.namedChildren)tt(n,t)}var Yt=8;function R(e,t){return t?K(e,t,0,new Set):null}function K(e,t,n,r){if(n>Yt)return _(t,"value-evaluation-depth");let i=rt(t),a=rn(i);if(a)return an(e.file,i,a.term,a.value,a.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>K(e,u,n+1,new Set(r)));if(l.length>=2&&l.every(u=>u!==null)){let u={kind:"concat",parts:l.map(d=>d.term)},c=l.map(d=>d.value).join("");return on(e.file,i,u,c,l.some(d=>d.precision!=="literal")?"constrained-pattern":"literal",l)}}let o=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))return tn(e,o,i,n,r);let s=sn(i);return s?nn(e,s.base,s.properties,i,n,r):i.type==="call_expression"||i.type==="call"?Jt(e,i,n,r):_(i,`unsupported-expression:${i.type}`)}function Jt(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",o=Qt(e,a);if(o.length!==1)return _(t,o.length===0?"call-target-unresolved":"call-target-ambiguous");let s=o[0],l=`${s.relativePath}\0${s.symbol}`;if(r.has(l))return _(t,"call-return-cycle");let u=B(e.db,s.relativePath)?.rootNode;if(!u)return _(t,"call-target-unparsed");let c=un(u,s.startLine,s.endLine);if(!c)return _(t,"call-target-syntax-unavailable");let d=en(c);if(!d)return _(t,"call-return-not-single-expression");let m=new Set(r);m.add(l);let p=K({db:e.db,file:s.relativePath,root:u},d,n+1,m);return p?me(t,"bounded-call-return",p,s.symbol):_(t,"call-return-unresolved")}function Qt(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=I(e.db,e.file).filter(o=>o.isFunctionLike&&o.leaf===t);if(i.length>0)return i;let a=D(e.db,e.file).find(o=>o.localName===t&&o.sourcePath&&o.kind!=="namespace");return a?.sourcePath?z(e.db,a.sourcePath,a.importedName==="default"?t:a.importedName).filter(o=>o.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=D(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?z(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function en(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return nt(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function nt(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)nt(e,r,n)}}function tn(e,t,n,r,i){let a=`${e.file}\0${t}`;if(i.has(a))return _(n,"value-cycle");i.add(a);let o=Be(e.root,t);if(o){let f=K(e,o,r+1,i);return f?me(n,"local-constant",f):_(n,"non-foldable-local")}let s=D(e.db,e.file).find(f=>f.localName===t&&f.sourcePath);if(!s?.sourcePath)return E(n,t,"unresolved-identifier");if(s.kind==="namespace")return E(n,t,"namespace-import-requires-property");let l=s.importedName==="default"?t:s.importedName,u=z(e.db,s.sourcePath,l);if(u.length!==1)return E(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let c=u[0],d=B(e.db,c.relativePath)?.rootNode;if(!d)return E(n,c.symbol,"import-definition-unparsed");let m=Be(d,c.leaf);if(!m)return E(n,c.symbol,"import-definition-non-value");let p=K({db:e.db,file:c.relativePath,root:d},m,r+1,i);return p?me(n,"imported-constant",p,c.symbol):E(n,c.symbol,"import-value-unresolved")}function nn(e,t,n,r,i,a){let o=D(e.db,e.file).find(p=>p.localName===t&&p.sourcePath),s=e.file,l=t,u;if(o?.sourcePath){o.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=o.importedName==="default"?t:o.importedName;let p=z(e.db,o.sourcePath,l);if(p.length!==1)return E(r,`${t}.${n.join(".")}`,p.length===0?"member-definition-missing":"member-definition-ambiguous");s=p[0].relativePath,l=p[0].leaf,u=p[0].symbol}let c=s===e.file?e.root:B(e.db,s)?.rootNode;if(!c)return E(r,u??t,"member-definition-unparsed");let d=Be(c,l);if(!d)return E(r,u??t,"member-base-non-value");for(let p of n){let f=rt(d);if(d=ln(f,p),!d)return E(r,u??`${t}.${n.join(".")}`,`member-property-missing:${p}`)}let m=K({db:e.db,file:s,root:c},d,i+1,a);return m?me(r,"member-constant",m,u):E(r,u??t,"member-value-unresolved")}function rn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],a=0,o=/\$\{([^}]*)\}/gu;for(let s of r.matchAll(o)){let l=s.index??0;l>a&&i.push({kind:"literal",value:r.slice(a,l)}),i.push({kind:"unknown",reason:`template-hole:${s[1]?.trim()||"expression"}`}),a=l+s[0].length}return a<r.length&&i.push({kind:"literal",value:r.slice(a)}),{term:{kind:"pattern",language:"template",value:r.replace(o,"{}")},value:r.replace(o,"{}"),precision:"constrained-pattern"}}function an(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:fe("direct-literal","direct",e,t)}}function on(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...fe("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(o=>o.derivation.inputFactIds),sourceSpans:a.flatMap(o=>o.derivation.sourceSpans)}}}function me(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function E(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:fe(n,"heuristic","",e)}}function _(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:fe(t,"heuristic","",e)}}function fe(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function sn(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}function Be(e,t){let n=null;return $e(e,r=>{if(n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t)return;let a=r.parent;!a||a.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(a.text)||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function ln(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function rt(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function un(e,t,n){let r=null;return $e(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function $e(e,t){t(e);for(let n of e.namedChildren)$e(n,t)}var st=new Set(["delete","get","head","options","patch","post","put"]),dn=/(?:^|\.)(?:app|router|server)$/u,pn=new Set(["findFirst","findMany","findUnique","from","get","select"]),mn=new Set(["create","delete","insert","remove","update","upsert"]),fn=new Set(["execute","query","raw"]),ke=[vn(),gn(),yn(),bn(),Sn(),Nn(),In()],Re=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function yn(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=hn(e.source),n=[];return k(e.root,r=>{if(r.type!=="call_expression")return;let i=J(r);if(!i)return;let a=t.direct.get(i),o=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),s=o&&t.namespaces.has(o[1])?o[2]:null,l=a??s;if(!l||!Re.has(l))return;let u=q(r),c=$(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},d=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(S(e,r,"builtin.node-child-process",d,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...c}],"exact","node-child-process-import"))}),n}}}function hn(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let l of e.matchAll(i))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Re.has(c[1])&&t.set(c[2]??c[1],c[1])}let a=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(a))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Re.has(c[1])&&t.set(c[2]??c[1],c[1])}let o=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(o))n.add(l[1]);let s=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(s))n.add(l[1]);return{direct:t,namespaces:n}}function N(e,t){let n=B(e,t)?.rootNode;if(!n)return null;let r=M(e,t),i=I(e,t),a=ae(e,t)?.callables??[];return{db:e,file:t,source:r,root:n,constants:En(n),ownerAt:o=>{let s=i.filter(u=>u.startLine<=o&&u.endLine>=o).sort((u,c)=>u.endLine-u.startLine-(c.endLine-c.startLine)||u.startLine-c.startLine)[0];if(s)return{file:t,symbol:s.symbol,name:s.leaf,startLine:s.startLine,endLine:s.endLine};let l=a.filter(u=>u.startLine<=o&&u.endLine>=o).sort((u,c)=>u.endLine-u.startLine-(c.endLine-c.startLine)||u.startLine-c.startLine)[0];return{file:t,symbol:null,name:l?.name??null,startLine:l?.startLine??o,endLine:l?.endLine??o}}}}function gn(){return{id:"builtin.effect-httpapi",supports:e=>W(e,"HttpApiEndpoint").size>0||W(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=W(e.source,"HttpApiEndpoint"),r=W(e.source,"HttpApiGroup"),i=W(e.source,"HttpApiBuilder");return k(e.root,a=>{if(a.type!=="call_expression")return;let o=lt(a);if(!o)return;let s=q(a);if(n.has(o.receiver)&&st.has(o.member)){let y=$(s[0],e),h=$(s[1],e),C=at(a,r,"make",0,e);if(!y||!h||!C)return;let P=o.member.toUpperCase();t.push(S(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:P,evidence:"literal"},{name:"path",...h}],T([{name:"path",...h}]),"effect-httpapi-endpoint-declaration")),t.push(S(e,a,"builtin.effect-httpapi","framework.declare",Ee(C,y),T(Ee(C,y)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(o.member))return;let l=at(a,i,"group",1,e),u=$(s[0],e),c=s[1];if(!l||!u||!c)return;let d=Ee(l,u),m=G(e.db,e.file,c.text),p=S(e,a,"builtin.effect-httpapi","framework.handle",d,m.length===1?T(d):"candidate","effect-httpapi-handler-registration"),f=m[0];m.length===1&&f&&(p.owner={file:f.relativePath,symbol:f.symbol,name:f.leaf,startLine:f.startLine,endLine:f.endLine}),t.push(p)}),t}}}function Ee(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function W(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(r)){let o=a[2]??"";if(it(o))for(let s of(a[1]??"").split(",")){let l=s.trim().replace(/^type\s+/u,""),u=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(l);u?.[1]===t&&n.add(u[2]??u[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(i)){let o=a[2]??"";o.endsWith(`/${t}`)&&it(o)&&n.add(a[1])}return n}function it(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function at(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let o=ot(a,t,n,r,i);if(o)return o;let s=a.childForFieldName("function")??a.namedChild(0),l=null;if(s&&k(s,u=>{!l&&u.type==="call_expression"&&(l=ot(u,t,n,r,i))}),l)return l}a=a.parent}return null}function ot(e,t,n,r,i){let a=lt(e);return!a||a.member!==n||!t.has(a.receiver)?null:$(q(e)[r],i)}function lt(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function vn(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||Y(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return k(e.root,n=>{if(n.type==="decorator"){let m=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!m||!Y(e.source,["fastapi","flask"]))return;t.push(S(e,n,"builtin.http","http.handle",[{name:"method",value:m[1].toUpperCase(),evidence:"literal"},{name:"path",value:m[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=J(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",a=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",o=q(n);if(i==="route"&&Y(e.source,["axum"])){let m=$(o[0],e),p=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(o[1]?.text??"")?.[1];if(!m||!p)return;t.push(S(e,n,"builtin.http","http.handle",[{name:"method",value:p.toUpperCase(),evidence:"literal"},{name:"path",...m}],T([{name:"path",...m}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let m=$(o[0],e);if(!m)return;let f=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(o[1]?.text??"")?.[1]?.toUpperCase()??(o[1]?null:"GET"),y=[...f?[{name:"method",value:f,evidence:"literal"}]:[],{name:"path",...m}];t.push(S(e,n,"builtin.http","http.request",y,f?T(y):"candidate","call-expression"));return}if(!st.has(i))return;let s=$(o[0],e);if(!s)return;let l=i.toUpperCase();if(dn.test(a)&&Y(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(S(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...s}],T([{name:"path",...s}]),"framework-adapter"));return}let c=Pn(e.source,["axios"]),d=a.split(".")[0]??"";c.has(d)&&t.push(S(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...s}],T([{name:"path",...s}]),"client-adapter"))}),t}}}function bn(){return{id:"builtin.capability-registry",supports:e=>/\b(?:execute|handler|invoke|run)\s*(?:[:(])/u.test(e)||/['"`][^'"`\n]{0,256}\b[A-Za-z_$][\w$-]*\s*\(/u.test(e),extract:e=>{let t=[],n=new Set;return k(e.root,r=>{if(r.type==="pair"){let a=r.childForFieldName("key")??r.namedChild(0),o=r.childForFieldName("value")??r.namedChild(1),s=a?.text.replace(/^['"`]|['"`]$/gu,"");if(s!=="name"&&s!=="id")return;let l=ut(o,e),u=kn(r);if(!l||l.evidence!=="literal"||!u)return;let c=`handle\0${l.value}\0${u.startPosition.row}`;if(n.has(c))return;n.add(c),t.push(S(e,u,"builtin.capability-registry","registry.handle",[{name:"key",...l}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(r.type))return;let i=r.text.replace(/^['"`]|['"`]$/gu,"");for(let a of i.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let o=a[1];if(!xn(i,o,a.index))continue;let s=`reference\0${o}\0${r.startPosition.row}`;n.has(s)||(n.add(s),t.push(S(e,r,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function xn(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function Sn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return k(e.root,n=>{if(n.type==="pair"){let a=Rn(n);if(!a)return;let o=n.childForFieldName("key")??n.namedChild(0),s=n.childForFieldName("value")??n.namedChild(1),l=ut(o,e);if(!l||!s||!ct(s))return;let u=Le(s)?"exact":"candidate";t.push(S(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],T([{name:"key",...l}],u),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(S(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function Nn(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=_n(e.root);return k(e.root,r=>{if(r.type!=="call_expression")return;let i=J(r);if(!i)return;let a=i.split("."),o=a.at(-1)??"",s=q(r),l=s[0]?.text??"",u=Ln(o,l);if(!u)return;let c=dt(a,n);if(!c)return;let d=Cn(s[0],e)??Tn(l),m=On(c,a,o,d);if(!m)return;let p=o==="insert"?"persistence-insert":u==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(l)?"persistence-skip-locked-claim":"persistence-adapter";t.push(S(e,r,"builtin.persistence",u,[{name:"resource",...m}],T([{name:"resource",...m}]),p))}),t}}}function Cn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:$(e,t)}function In(){return{id:"builtin.queue",supports:e=>Y(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return k(e.root,n=>{if(n.type!=="call_expression")return;let r=J(n);if(!r)return;let i=r.split(".").at(-1)??"",a=q(n),o=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!o)return;let s=i==="send"||i==="subscribe"?Bn(a[0],"topic",e):$(a[0],e);s&&t.push(S(e,n,"builtin.queue",o,[{name:"address",...s}],T([{name:"address",...s}]),"framework-adapter"))}),t}}}function S(e,t,n,r,i,a,o){let s=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${cn("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:s,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:o,strength:a,protocol:r.split(".")[0]??r,role:wn(r),executionDomain:Fn(e.file),derivation:{kind:a==="candidate"?"heuristic":a==="derived"?"mechanically-derived":"direct",rule:o,ruleVersion:"1",inputFactIds:i.flatMap(u=>u.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(u=>u.derivation?.sourceSpans??[])]},valuePrecision:i.some(u=>u.evidence==="expression")?"unknown":i.some(u=>u.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:se(e.file)}}function wn(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function Fn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function Y(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function Pn(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),a=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let o of e.matchAll(a)){let s=o[1]??o[2];s&&n.add(s)}}return n}function ye(e,t,n,r,i,a,o){return S(e,t,n,r,i,a,o)}function J(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function q(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function $(e,t){let n=R(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function Bn(e,t,n){if(!e)return null;let r=e.namedChildren.find(a=>a.type!=="pair"?!1:(a.childForFieldName("key")??a.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return $(i,n)}function ut(e,t){if(!e)return null;let n=$(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function T(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function $n(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function En(e){let t=new Map;return k(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let a=$n(i);a!==null&&t.set(r.text,a)}),t}function Rn(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function Le(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function ct(e){return Le(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function kn(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),o=i?.text.replace(/^['"`]|['"`]$/gu,"");if(o&&["execute","handler","invoke","run"].includes(o)&&a&&ct(a))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function dt(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function Ln(e,t){if(pn.has(e))return"database.read";if(mn.has(e))return"database.write";if(!fn.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function _n(e){let t=new Set;return k(e,n=>{if(n.type!=="call_expression")return;let r=J(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!dt(i)))for(let a of q(n)){if(!Le(a))continue;let s=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=s?pt(s):null;l&&t.add(l)}}),t}function pt(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?pt(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function Tn(e){let t=mt(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function On(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let a=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return a?{value:a,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=mt(r.value);return i?{value:i,evidence:r.evidence}:null}function mt(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function k(e,t){t(e);for(let n of e.namedChildren)k(n,t)}var An=Z("resolved-call-syntax",{clearGroups:[]}),Dn=Z("resolved-call-sites",{clearGroups:[]});function Q(e,t){return Dn.get(e,t.symbolId,()=>Mn(e,t))}function Mn(e,t){let n=[],r=[],i=new Set,a=new Set;for(let o of We(e,t,{semantic:!1})){i.add(o.file);let s=An.get(e,o.file,()=>Vn(e,o.file));if(!s){r.push({callee:t,file:o.file,line:o.line,reason:"ast-unavailable",candidates:0,referenceProvenance:o.provenance});continue}let l=(s.byLeaf.get(t.leaf)??[]).filter(({callNode:d})=>d.startPosition.row<=o.line&&d.endPosition.row>=o.line);if(l.length!==1){r.push({callee:t,file:o.file,line:o.line,reason:l.length===0?"call-not-found":"ambiguous-call",candidates:l.length,referenceProvenance:o.provenance});continue}let u=l[0],c=`${o.file}\0${u.callNode.startIndex}\0${u.callNode.endIndex}`;a.has(c)||(a.add(c),n.push({callee:t,caller:oe(I(e,o.file),u.callNode.startPosition.row),file:o.file,line:o.line,startLine:u.callNode.startPosition.row,endLine:u.callNode.endPosition.row,targetText:u.targetNode.text,callNode:u.callNode,targetNode:u.targetNode,arguments:u.arguments,referenceProvenance:o.provenance}))}return{sites:n,unresolved:r,filesVisited:i.size}}function Vn(e,t){let n=B(e,t)?.rootNode;if(!n)return null;let r=new Map;return ft(n,i=>{if(i.type!=="call_expression"&&i.type!=="call")return;let a=i.childForFieldName("function")??i.namedChild(0);if(!a)return;let o=Ke(a);if(!o)return;let s=i.childForFieldName("arguments")??i.namedChildren.find(c=>c.type==="arguments"),l={callNode:i,targetNode:a,arguments:s?.namedChildren??[]},u=r.get(o);u?u.push(l):r.set(o,[l])}),{byLeaf:r}}function ft(e,t){t(e);for(let n of e.namedChildren)ft(n,t)}var zn=Z("call-parameter-value-flow",{clearGroups:[]});function ee(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return zn.get(e,n,()=>jn(e,t))}function te(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function jn(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-unavailable",proof:n}))};let r=B(e,t.caller.relativePath)?.rootNode,i=r?qn(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let a=Un(i),o=[],s=[];return t.arguments.forEach((l,u)=>{let c=l.text.trim(),d=a.indexOf(c);d>=0?o.push({calleePosition:u,callerPosition:d,argumentText:c,proof:n}):s.push({calleePosition:u,argumentText:c,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:o,unknown:s}}function qn(e,t,n){let r=null;return ht(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function Un(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(yt)??[]}function yt(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?yt(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function ht(e,t){t(e);for(let n of e.namedChildren)ht(n,t)}var Hn=8,Gn=8;function vt(e,t){let n=[],r=Kn(e,n),i=r.summaries,a=Xn(e,t,i,n),o=Zn(e,t,n);return{observations:or([...a.observations,...o]),bodySummaries:i.size,discriminatorSummaries:a.summaries,filesInspected:r.filesInspected,errors:n}}function Kn(e,t){let n=new Map,r=[],i=H(e);for(let a of i){let o=M(e,a);if(!/\bJSON\.stringify\s*\(/u.test(o)||!/\bbody\s*:/u.test(o))continue;let s=N(e,a);if(s)for(let[l,u]of Wn(s)){let c={definition:l,parameterIndexes:u,depth:0,proofSpans:[{file:a,startLine:l.startLine,endLine:l.endLine}]};n.set(l.symbol,c),r.push(c)}}for(;r.length>0;){let a=r.shift();if(!(a.depth>=Hn))try{for(let o of Q(e,a.definition).sites){if(!N(e,o.file))continue;let l=o.caller;if(!l)continue;let u=te(ee(e,o),a.parameterIndexes);if(u.length===0)continue;let c={definition:l,parameterIndexes:wt(u),depth:a.depth+1,proofSpans:[...a.proofSpans,{file:o.file,startLine:o.startLine,endLine:o.endLine}]};er(n,c)&&r.push(n.get(l.symbol))}}catch(o){t.push(`builtin.carrier body summary failed for ${a.definition.relativePath}: ${Ae(o)}`)}}return{summaries:n,filesInspected:i.length}}function Xn(e,t,n,r){let i=new Map,a=[],o=[];for(let s of t){if(s.action!=="http.request"||s.strength==="candidate"||s.sourceScope!=="production")continue;let l=bt(s);if(!l)continue;let u=N(e,s.source.file);if(!u)continue;let c=Nt(u.root,s.source.startLine),d=c.find(P=>P.startPosition.row===s.source.startLine)??c[0];if(!d)continue;let m=Oe(d);if(!m)continue;let p=G(e,s.source.file,m.text);if(p.length!==1)continue;let f=n.get(p[0].symbol);if(!f)continue;let y=s.owner.symbol?I(e,s.owner.file).find(P=>P.symbol===s.owner.symbol):null;if(!y)continue;let h=tr(u,y),C=ge(d);for(let P of f.parameterIndexes){let O=rr(u,C[P]);if(O)for(let v of ir(O)){let w=Ct(v),L=It(v);if(!w||!L)continue;let A=h.indexOf(L.text.trim());if(A>=0){let F={definition:y,carrier:l,field:w,parameterIndex:A,depth:0,proofObservationIds:[s.id],proofSpans:[s.source,{file:s.source.file,startLine:v.startPosition.row,endLine:v.endPosition.row}]},x=gt(F);i.has(x)||(i.set(x,F),a.push(F));continue}let b=R(u,L);!b||b.evidence==="expression"||o.push(Te(u,v,"carrier.publish",l,w,b.value,[s.id]))}}}for(;a.length>0;){let s=a.shift();if(!(s.depth>=Gn))try{for(let l of Q(e,s.definition).sites){let u=N(e,l.file);if(!u)continue;let c=l.callNode,d=ge(c)[s.parameterIndex];if(!d)continue;let m=R(u,d);m&&m.evidence!=="expression"&&o.push(Te(u,c,"carrier.publish",s.carrier,s.field,m.value,s.proofObservationIds));let p=l.caller;if(!p)continue;let f=ee(e,l).transfers.find(C=>C.calleePosition===s.parameterIndex)?.callerPosition;if(f===void 0)continue;let y={...s,definition:p,parameterIndex:f,depth:s.depth+1,proofSpans:[...s.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},h=gt(y);i.has(h)||(i.set(h,y),a.push(y))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${s.definition.relativePath}: ${Ae(l)}`)}}return{observations:o,summaries:i.size}}function Zn(e,t,n){let r=[],i=t.filter(a=>a.action==="registry.handle"&&a.strength!=="candidate"&&a.sourceScope==="production");for(let a of t){if(a.action!=="http.handle"||a.strength==="candidate"||a.sourceScope!=="production")continue;let o=bt(a);if(!o)continue;let s=N(e,a.source.file);if(!s)continue;let l=Nt(s.root,a.source.startLine)[0];if(l)for(let u of ge(l).slice(1)){let c=G(e,a.source.file,u.text);for(let d of c)try{let m=N(e,d.relativePath);if(!m)continue;let p=he(m.root,d.startLine,d.endLine);if(!p)continue;V(p,f=>{if(f.type!=="call_expression")return;let y=Oe(f);if(!y)return;let h=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(y.text.trim());if(!h)return;let C=h[1],P=h[2],O=Jn(e,m,d,P);if(!O)return;let v=Qn(e,d.relativePath,C);for(let w of i){let L=w.keyParts.find(x=>x.name==="registry")?.value,A=w.keyParts.find(x=>x.name==="key")?.value;if(!L||!A||!v.some(x=>x.file===w.source.file&&x.binding===L))continue;let b=N(e,w.source.file),F=b?nr(b.root,w.source.startLine):null;!b||!F||r.push(Te(b,F,"carrier.consume",o,O,A,[a.id,w.id]))}})}catch(m){n.push(`builtin.carrier consumer analysis failed for ${d.relativePath}: ${Ae(m)}`)}}}return r}function Wn(e){let t=I(e.db,e.file),n=new Map;return V(e.root,r=>{if(r.type!=="pair"||Ct(r)?.toLowerCase()!=="body")return;let i=It(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=oe(t,r.startPosition.row),o=Yn(r);if(!a||!o)return;let s=xt(o),l=new Set;ar(i,s,l);let u=n.get(a.symbol)??new Set;s.forEach((c,d)=>{c&&l.has(c)&&u.add(d)}),u.size>0&&n.set(a.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[[r,[...i].sort((a,o)=>a-o)]]:[]})}function Yn(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function Jn(e,t,n,r){let i=he(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${_e(r)}\\b`,"u");if(a.test(i.text))return r;let o=null;if(V(i,c=>{if(o||c.type!=="variable_declarator")return;let d=c.childForFieldName("name")??c.namedChild(0),m=c.childForFieldName("value")??c.namedChild(1);!d||!m||!new RegExp(`(?:^|[,{}])\\s*${_e(r)}\\s*(?:[,}]|$)`,"u").test(d.text)||m.type==="call_expression"&&(o=Oe(m)?.text??null)}),!o)return null;let s=G(e,n.relativePath,o);if(s.length!==1)return null;let l=N(e,s[0].relativePath),u=l?he(l.root,s[0].startLine,s[0].endLine):null;return u&&a.test(u.text)&&new RegExp(`\\b${_e(r)}\\s*[,}]`,"u").test(u.text)?r:null}function Qn(e,t,n){let r=[];for(let i of Fe(e,t,n)){let a=ne(i.initializer);if(a.type==="call_expression")for(let o of ge(a)){let s=o.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))for(let l of Fe(e,i.definition.relativePath,s))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Te(e,t,n,r,i,a,o){let l=ye(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:a,evidence:"constant",term:{kind:"literal",value:a}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...o],sourceSpans:[l.source]},l}function bt(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function er(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=wt([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function gt(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function tr(e,t){let n=he(e.root,t.startLine,t.endLine);return n?xt(n):[]}function xt(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(St)??[]}function St(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?St(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function he(e,t,n){let r=null;return V(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function nr(e,t){let n=null;return V(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function Nt(e,t){let n=[];return V(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function Oe(e){return e.childForFieldName("function")??e.namedChild(0)}function ge(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function rr(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return ne(t);let r=null;return V(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),ne(r||t)}function ir(e){let t=ne(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function Ct(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function It(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function ne(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function ar(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function wt(e){return[...new Set(e)].sort((t,n)=>t-n)}function or(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function _e(e){return e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function Ae(e){return e instanceof Error?e.message:String(e)}function V(e,t){t(e);for(let n of e.namedChildren)V(n,t)}import{createHash as sr}from"crypto";function Ft(e,t){let n=new Map;for(let a of t){if(a.action!=="http.handle"||a.sourceScope!=="production")continue;let o=n.get(a.source.file)??[];o.push(a),n.set(a.source.file,o)}let r=[],i=lr(e);for(let a of i.mounts)for(let o of a.targetFiles)for(let s of n.get(o)??[]){let l=s.keyParts.find(m=>m.name==="path");if(!l||l.evidence==="expression")continue;let u=cr(a.prefix.value,l.value),c=s.keyParts.map(m=>m.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[a.prefix.term??{kind:"literal",value:a.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[s.id],sourceSpans:[s.source,{file:a.file,startLine:a.line,endLine:a.line},...a.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:m),d=`${s.id}\0${a.file}\0${a.line}\0${u}`;r.push({...s,id:`boundary:${sr("sha256").update(d).digest("hex").slice(0,16)}`,keyParts:c,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[s.id],sourceSpans:[s.source,{file:a.file,startLine:a.line,endLine:a.line}]},resolution:"unresolved"}),s.strength="candidate",s.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function lr(e){let t=[],n=H(e);for(let r of n){let i=M(e,r);if(!dr(i))continue;let a=N(e,r);a&&Pt(a.root,o=>{if(o.type!=="call_expression")return;let s=o.childForFieldName("function")??o.namedChild(0);if(!s||!/\.use$/u.test(s.text.replace(/\s+/gu,"")))return;let l=pr(o);if(l.length<2)return;let u=R(a,l[0]);if(!u||u.evidence==="expression")return;let c=ur(e,r,l[1]);c.length!==0&&t.push({file:r,line:o.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:c})})}return{mounts:t,filesInspected:n.length}}function ur(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let a=D(e,t).find(l=>l.localName===i&&l.sourcePath);if(!a?.sourcePath)return[t];if(a.kind==="namespace")return[a.sourcePath];let o=a.importedName==="default"?i:a.importedName,s=z(e,a.sourcePath,o);return[...new Set(s.map(l=>l.relativePath))]}function cr(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function dr(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function pr(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Pt(e,t){t(e);for(let n of e.namedChildren)Pt(n,t)}import{createHash as mr}from"crypto";var De=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),fr=8;function Et(e,t){let n=new Map,r=[],i=[],a=new Set,o=[],s=[];for(let l of t){if(l.action!=="http.request"||!l.owner.symbol||l.evidence!=="call-expression"&&l.evidence!=="client-adapter")continue;let u=I(e,l.owner.file).find(p=>p.symbol===l.owner.symbol);if(!u)continue;let c=N(e,u.relativePath);if(!c)continue;let d=Bt(c,u),m={definition:u,...d,constantMethods:l.keyParts.flatMap(p=>p.name==="method"&&p.evidence!=="expression"&&De.has(p.value.toUpperCase())?[p.value.toUpperCase()]:[]),depth:0,proofObservationIds:[l.id],proofSpans:[l.source]};$t(n,m)&&r.push(n.get(u.symbol))}for(;r.length>0;){let l=r.shift();if(!(l.depth>=fr))try{let u=Q(e,l.definition);s.push(...u.unresolved.map(c=>yr(l,c)));for(let c of u.sites){let d=N(e,c.file);if(!d)continue;a.add(c.file);let m=c.callNode,p=gr(l,m,d);p&&i.push(p);let f=c.caller;if(!f)continue;let y=Bt(d,f),h=vr(e,l,c),C={definition:f,pathParameterIndexes:ve([...y.pathParameterIndexes,...h.pathParameterIndexes]),methodParameterIndexes:ve([...y.methodParameterIndexes,...h.methodParameterIndexes]),constantMethods:X([...l.constantMethods,...y.constantMethods]),depth:l.depth+1,proofObservationIds:X([...l.proofObservationIds,...p?[p.id]:[]]),proofSpans:[...l.proofSpans,{file:c.file,startLine:c.startLine,endLine:c.endLine}]};$t(n,C)&&r.push(n.get(f.symbol))}}catch(u){o.push(`builtin.http-summary failed for ${l.definition.relativePath}:${l.definition.startLine+1}: ${u instanceof Error?u.message:String(u)}`)}}return{observations:i,frontiers:hr(s),summaries:n.size,filesInspected:a.size,errors:o}}function yr(e,t){let n=X([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${mr("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:se(t.file)}}function hr(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}function gr(e,t,n){let r=kt(t),i=e.pathParameterIndexes.flatMap(d=>{let m=R(n,r[d]);return m&&m.evidence!=="expression"&&Nr(m.value)?[{index:d,value:m}]:[]}),a=e.methodParameterIndexes.flatMap(d=>{let m=R(n,r[d]),p=m?.value.toUpperCase();return m&&p&&m.evidence!=="expression"&&De.has(p)?[{index:d,value:{...m,value:p}}]:[]}),o=X([...e.constantMethods,...a.map(d=>d.value.value)]);if(i.length!==1||o.length!==1)return null;let s=i[0].value,l=a.find(d=>d.value.value===o[0])?.value,u=[{name:"method",value:o[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:o[0]},derivation:l?.derivation},{name:"path",value:s.value,evidence:"constant",term:s.term,derivation:s.derivation}],c=ye(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return c.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,c.source]},c}function Bt(e,t){let n=Sr(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=xr(n),i=new Set,a=new Set,o=new Set;return Me(n,s=>{if(s.type==="call_expression"&&((s.childForFieldName("function")??s.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let p=kt(s);re(p[0],r,i);let f=br(p[1],"method");if(f){re(f,r,a);let y=R(e,f),h=y?.value.toUpperCase();h&&y?.evidence!=="expression"&&De.has(h)&&o.add(h)}else re(p[1],r,a)}if(s.type!=="pair")return;let l=s.childForFieldName("key")??s.namedChild(0),u=s.childForFieldName("value")??s.namedChild(1),c=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(c==="url"||c==="path"||c==="endpoint")&&re(u,r,i),(c==="init"||c==="requestinit"||c==="options")&&re(u,r,a)}),{pathParameterIndexes:r.flatMap((s,l)=>s&&i.has(s)?[l]:[]),methodParameterIndexes:r.flatMap((s,l)=>s&&a.has(s)?[l]:[]),constantMethods:[...o].sort()}}function vr(e,t,n){let r=ee(e,n);return{pathParameterIndexes:te(r,t.pathParameterIndexes),methodParameterIndexes:te(r,t.methodParameterIndexes)}}function $t(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=ve([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=ve([...n.methodParameterIndexes,...t.methodParameterIndexes]),a=X([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||a.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:a,depth:Math.min(n.depth,t.depth),proofObservationIds:X([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function br(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function re(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function xr(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(Rt)??[]}function Rt(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?Rt(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function Sr(e,t,n){let r=null;return Me(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function kt(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Nr(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function ve(e){return[...new Set(e)].sort((t,n)=>t-n)}function X(e){return[...new Set(e)].sort()}function Me(e,t){t(e);for(let n of e.namedChildren)Me(n,t)}import{createHash as Cr}from"crypto";function Tt(e){let t=Lt(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=Lt(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?Ve(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[_t(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?Ve(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[_t(r,a,i,"queue.consume")]:[]}):[])}function Lt(e){let t=new Map;for(let n of e)for(let r of Ve(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function Ve(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function _t(e,t,n,r){let i=`database:${n}`,a=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",o=[e.id,r,i,a].join("\0");return{...e,id:`boundary:${Cr("sha256").update(o).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:a,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var ze="runtime-boundaries-v15",Se=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],Ir=64;function wr(e,t={}){let n=H(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map($r)),a=t.previousGraph?.fileCoverage,o=i.size>0&&t.previousGraph?.extractorVersion===ze&&a!==void 0&&a.length===t.previousGraph.coverage.filesScanned,s=o?a.filter(g=>r.has(g.file)&&!i.has(g.file)):[],l=new Set(s.flatMap(g=>g.observationIds)),u=o?t.previousGraph.observations.filter(g=>l.has(g.id)&&r.has(g.source.file)):[],c=o?n.filter(g=>i.has(g)):n,d=[],m=a?.reduce((g,Ne)=>g+Ne.observationIds.length,0)??0,p=performance.now(),f=Fr(e,c);U(d,"direct-extraction",p,c.length,f.observations.length,{filesVisited:c.length,filesReused:s.length,factsReused:u.length,factsInvalidated:Math.max(0,m-u.length)});let y=[...s,...f.fileCoverage].sort((g,Ne)=>g.file.localeCompare(Ne.file)),h=Br(y),C=y.flatMap(g=>g.extractionErrors),P=ie([...u,...f.observations]),O=ie([...P,...Tt(P)]);p=performance.now();let v=Et(e,O);U(d,"http-summary",p,O.length,v.observations.length,{filesVisited:v.filesInspected}),h.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:v.filesInspected,observations:v.observations.length,errors:v.errors.length}),C.push(...v.errors);let w=ie([...O,...v.observations]);p=performance.now();let L=Ft(e,w);U(d,"http-mount",p,w.length,L.observations.length,{filesVisited:L.filesInspected});let A=ie([...w,...L.observations]);p=performance.now();let b=vt(e,A);U(d,"carrier",p,A.length,b.observations.length,{filesVisited:b.filesInspected}),h.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:b.bodySummaries,observations:b.observations.length,errors:b.errors.length}),C.push(...b.errors);let F=ie([...A,...b.observations]);p=performance.now();let x=Er(F);U(d,"relations",p,F.length,x.length),p=performance.now();let je=kr(F,x);U(d,"links",p,x.length,je.length),Lr(F,x),p=performance.now();let qe=Or([..._r(F,x),...v.frontiers]);return U(d,"frontiers",p,F.length,qe.length),{schemaVersion:2,extractorVersion:ze,observations:F,relationGroups:x,links:je,frontiers:qe,coverage:{filesScanned:n.length,filesWithAst:y.filter(g=>g.hasAst).length,filesWithoutAst:y.filter(g=>!g.hasAst).length,...o?{filesReused:s.length}:{},extractors:[...h.values()],extractionErrors:C,phases:d},fileCoverage:y}}function U(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}function Fr(e,t){let n=[],r=[];for(let i of t){let a=M(e,i),o=ke.filter(u=>u.supports(a)),s=o.length>0?N(e,i):null,l={file:i,hasAst:s!==null||Pr(i,a),observationIds:[],extractors:[],extractionErrors:[]};if(s)for(let u of o){let c={id:u.id,applicableFiles:1,observations:0,errors:0};try{let d=u.extract(s);c.observations=d.length,n.push(...d),l.observationIds.push(...d.map(m=>m.id))}catch(d){c.errors=1,l.extractionErrors.push(`${u.id} failed for ${i}: ${d instanceof Error?d.message:String(d)}`)}l.extractors.push(c)}r.push(l)}return{observations:n,fileCoverage:r}}function Pr(e,t){return t?Ge(e)?/<script\b/iu.test(t):He(e)!==null:!1}function Br(e){let t=new Map(ke.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function $r(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function Er(e){let t=new Map;for(let n of Se){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let a=Ar(i,n.keyNames);if(!a)continue;let o=a.map(d=>`${d.name}=${Dt(d.name,d.value)}`).join("\0"),s=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${s}\0${o}`,u=`boundary-group:${Ot("sha256").update(l).digest("hex").slice(0,16)}`,c=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:o,keyParts:a,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&c.producerIds.push(i.id),n.consumerActions.includes(i.action)&&c.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&c.declarationIds.push(i.id),c.derivation.inputFactIds.push(i.id),c.derivation.sourceSpans.push(i.source),t.set(u,c)}}return[...t.values()].map(Rr).sort(Mr)}function Rr(e){return{...e,producerIds:be(e.producerIds),consumerIds:be(e.consumerIds),declarationIds:be(e.declarationIds),derivation:{...e.derivation,inputFactIds:be(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function kr(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=Se.find(s=>s.id===i.joinRule);if(!a?.traversable)continue;let o=a.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(o.length===0||i.consumerIds.length===0)&&!(a.requireUniquePair&&(o.length!==1||i.consumerIds.length!==1))&&!(a.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(o.length*i.consumerIds.length>Ir))for(let s of o)for(let l of i.consumerIds){let u=n.get(s),c=n.get(l);if(!u||!c||Dr(u,c))continue;let d=u.strength==="derived"||c.strength==="derived"?"derived":"exact",m=`${i.joinRule}\0${s}\0${l}`,p={id:`boundary-link:${Ot("sha256").update(m).digest("hex").slice(0,16)}`,from:s,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:d,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[s,l],sourceSpans:[u.source,c.source]}};r.set(p.id,p)}}return[...r.values()].sort(Vr)}function Lr(e,t){let n=new Set(t.filter(At).flatMap(xe)),r=new Set(t.filter(Tr).flatMap(xe));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function _r(e,t){let n=new Set(e.filter(a=>a.strength!=="candidate").map(a=>`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)),r=new Set(t.flatMap(xe)),i=new Set(t.filter(At).flatMap(xe));return e.filter(a=>a.sourceScope==="production").filter(a=>a.strength!=="candidate"||!n.has(`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)).filter(a=>!i.has(a.id)).map(a=>{let o=a.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),s=o.length>0?`${a.extractor} observed ${a.action}, but ${o.join(", ")} remained symbolic or unknown.`:a.resolution==="ambiguous"?`${a.extractor} established the address for ${a.action}, but more than one indexed peer has the same runtime key.`:r.has(a.id)?`${a.extractor} established the address for ${a.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${a.extractor} observed ${a.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:a.id,reason:s,missingKeyParts:o,sourceScope:a.sourceScope}}).sort((a,o)=>a.observationId.localeCompare(o.observationId))}function xe(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function At(e){let t=Se.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function Tr(e){let t=Se.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function Or(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}function Ar(e,t){let n=[];for(let r of t){let i=e.keyParts.find(a=>a.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:Dt(r,i.value)})}return n}function Dt(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function Dr(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function ie(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function be(e){return[...new Set(e)].sort()}function Mr(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function Vr(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}export{se as a,R as b,Q as c,ee as d,ze as e,wr as f,Vt as g,zt as h,Ye as i};
49
- //# sourceMappingURL=chunk-U24M5RQM.js.map
49
+ //# sourceMappingURL=chunk-GQLDYCWS.js.map
@@ -1,4 +1,4 @@
1
- import{o as O,p as A}from"./chunk-JOALNFY3.js";import{a as P}from"./chunk-RVYLJDXC.js";import{g as F,k as S,m as _,u as C,v as N}from"./chunk-PLZXWZHY.js";import{d as y}from"./chunk-3LCDIREB.js";var G=C({kind:"file-dependency-graph",invalidation:N("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:x}),I=F("file-dep-graph",{clearGroups:["whole-project"]});function U(e,n,t={}){let s=t.scipEdges??"all-references",i=t.sourceEdges??"imports-only",o=v(n,s,i);return I.get(e,o,()=>{let d=new Set(P(e,{includeIgnored:!1})),c=_(e),p=0,l=0,m=null,E=!1,a=0,h=0;return y("file-dep-graph.product",()=>{if(c){let r=G.read(e,o,c);if(r){E=!0;let f=R(r);return p=r.sourceFileCount,l=r.sourceEdgeCount,a=r.scipEdgeCount,h=f.size,m=r.sourceDependencyFingerprint,f}}let g=y("file-dep-graph.source-imports",()=>{let r=b(e,d,n,i);return p=r.files.length,l=r.edges.length,m=r.fingerprint,r},()=>({scope:n??null,sourceEdges:i,files:p,edges:l})),u=new Map,D=(r,f)=>j(e,u,d,r,f);y("file-dep-graph.scip-edges",()=>{for(let r of $(e,n,s))a+=1,D(r.from_file,r.to_file)},()=>({scope:n??null,edges:a}));for(let r of g.edges)D(r.fromFile,r.toFile);return h=u.size,c&&G.write(e,o,c,{sourceDependencyFingerprint:g.fingerprint,sourceFileCount:g.files.length,sourceEdgeCount:g.edges.length,scipEdgeCount:a,graph:w(u)}),u},()=>({scope:n??null,available:c!==null,hit:E,files:p,sourceEdges:l,sourceEdgeMode:i,scipEdges:a,graphFiles:h,sourceDependencyFingerprint:m}))})}function b(e,n,t,s){let i=[],o=[];for(let d of n)if(!(t&&!d.includes(t))){i.push(d);for(let c of A(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath});if(s==="imports-and-reexports")for(let c of O(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath})}return{files:i,edges:o,fingerprint:M(i,o)}}function M(e,n){let t=n.map(s=>`${s.fromFile}\0${s.toFile}`).sort();return S(JSON.stringify({files:e,edges:t}))}function v(e,n,t){return`edge-mode-v3:${n}:${t}:${e??"<all>"}`}function w(e){return[...e].map(([n,t])=>[n,[...t]])}function R(e){return new Map(e.graph.map(([n,t])=>[n,new Set(t)]))}function x(e){let n=JSON.parse(e);return k(n)?n:null}function k(e){if(!e||typeof e!="object")return!1;let n=e;return typeof n.sourceDependencyFingerprint=="string"&&typeof n.sourceFileCount=="number"&&typeof n.sourceEdgeCount=="number"&&typeof n.scipEdgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(J)}function J(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function $(e,n,t){let s=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[],o=t==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
1
+ import{o as O,p as A}from"./chunk-F74LZWCE.js";import{a as P}from"./chunk-ICUL7XRT.js";import{g as F,k as S,m as _,u as C,v as N}from"./chunk-7GAK2F3H.js";import{d as y}from"./chunk-3LCDIREB.js";var G=C({kind:"file-dependency-graph",invalidation:N("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:x}),I=F("file-dep-graph",{clearGroups:["whole-project"]});function U(e,n,t={}){let s=t.scipEdges??"all-references",i=t.sourceEdges??"imports-only",o=v(n,s,i);return I.get(e,o,()=>{let d=new Set(P(e,{includeIgnored:!1})),c=_(e),p=0,l=0,m=null,E=!1,a=0,h=0;return y("file-dep-graph.product",()=>{if(c){let r=G.read(e,o,c);if(r){E=!0;let f=R(r);return p=r.sourceFileCount,l=r.sourceEdgeCount,a=r.scipEdgeCount,h=f.size,m=r.sourceDependencyFingerprint,f}}let g=y("file-dep-graph.source-imports",()=>{let r=b(e,d,n,i);return p=r.files.length,l=r.edges.length,m=r.fingerprint,r},()=>({scope:n??null,sourceEdges:i,files:p,edges:l})),u=new Map,D=(r,f)=>j(e,u,d,r,f);y("file-dep-graph.scip-edges",()=>{for(let r of $(e,n,s))a+=1,D(r.from_file,r.to_file)},()=>({scope:n??null,edges:a}));for(let r of g.edges)D(r.fromFile,r.toFile);return h=u.size,c&&G.write(e,o,c,{sourceDependencyFingerprint:g.fingerprint,sourceFileCount:g.files.length,sourceEdgeCount:g.edges.length,scipEdgeCount:a,graph:w(u)}),u},()=>({scope:n??null,available:c!==null,hit:E,files:p,sourceEdges:l,sourceEdgeMode:i,scipEdges:a,graphFiles:h,sourceDependencyFingerprint:m}))})}function b(e,n,t,s){let i=[],o=[];for(let d of n)if(!(t&&!d.includes(t))){i.push(d);for(let c of A(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath});if(s==="imports-and-reexports")for(let c of O(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath})}return{files:i,edges:o,fingerprint:M(i,o)}}function M(e,n){let t=n.map(s=>`${s.fromFile}\0${s.toFile}`).sort();return S(JSON.stringify({files:e,edges:t}))}function v(e,n,t){return`edge-mode-v3:${n}:${t}:${e??"<all>"}`}function w(e){return[...e].map(([n,t])=>[n,[...t]])}function R(e){return new Map(e.graph.map(([n,t])=>[n,new Set(t)]))}function x(e){let n=JSON.parse(e);return k(n)?n:null}function k(e){if(!e||typeof e!="object")return!1;let n=e;return typeof n.sourceDependencyFingerprint=="string"&&typeof n.sourceFileCount=="number"&&typeof n.sourceEdgeCount=="number"&&typeof n.scipEdgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(J)}function J(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function $(e,n,t){let s=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[],o=t==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
2
2
  d1.relative_path AS from_file,
3
3
  d2.relative_path AS to_file
4
4
  FROM mentions m
@@ -17,4 +17,4 @@ import{o as O,p as A}from"./chunk-JOALNFY3.js";import{a as P}from"./chunk-RVYLJD
17
17
  ${o}
18
18
  ${e.pathExclusionsFor("d1","d2")}
19
19
  ${s}`,...i)}function j(e,n,t,s,i){if(s===i||e.isIgnored(s)||e.isIgnored(i)||!t.has(i))return;let o=n.get(s);o||(o=new Set,n.set(s,o)),o.add(i)}export{U as a};
20
- //# sourceMappingURL=chunk-B2E3HZ2A.js.map
20
+ //# sourceMappingURL=chunk-GV2CEZCW.js.map
@@ -1,4 +1,4 @@
1
- import{a as _,g as C,j as T,o as $,p as w}from"./chunk-JOALNFY3.js";import{C as O,a as x}from"./chunk-RVYLJDXC.js";import{g as y,h as R,l as S,m as h,r as D,t as E,v as M,w as k,x as N}from"./chunk-PLZXWZHY.js";var ne={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=te(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function te(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||A(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!A(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=ne[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function A(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function v(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=ie(r);s&&i.push(s)}return i.join(":")}function ie(e){let n=e.suffix==="namespace"?re(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function re(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function P(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function Qe(e){return e.endsWith("().")||p(e)==="method"}function Q(e){let n=p(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function je(e){return p(e)==="namespace"}var se=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Be(e){return se.test(e)}var oe=new Set(["test","tests","_tests"]);function Je(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&oe.has(i.name))return!0}return!1}function We(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ze(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ue(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
1
+ import{a as _,g as C,j as T,o as $,p as w}from"./chunk-F74LZWCE.js";import{C as O,a as x}from"./chunk-ICUL7XRT.js";import{g as y,h as R,l as S,m as h,r as D,t as E,v as M,w as k,x as N}from"./chunk-7GAK2F3H.js";var ne={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=te(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function te(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||A(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!A(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=ne[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function A(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function v(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=ie(r);s&&i.push(s)}return i.join(":")}function ie(e){let n=e.suffix==="namespace"?re(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function re(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function P(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function Qe(e){return e.endsWith("().")||p(e)==="method"}function Q(e){let n=p(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function je(e){return p(e)==="namespace"}var se=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Be(e){return se.test(e)}var oe=new Set(["test","tests","_tests"]);function Je(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&oe.has(i.name))return!0}return!1}function We(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ze(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ue(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
4
  JOIN documents d ON der.document_id = d.id
@@ -114,4 +114,4 @@ import{a as _,g as C,j as T,o as $,p as w}from"./chunk-JOALNFY3.js";import{C as
114
114
  ${e.symbolNoiseFor("gs")}
115
115
  GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
116
116
  ORDER BY d.relative_path, start_line, end_line`,...s)}function De(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function q(e,n){return n==="callable"?De(e):_e(e)}function _e(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function G(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function Sn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>F(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:W(z(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Ie(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function hn(e,n){let t=U.get(e);return t||(t=Ie(e),U.set(e,t)),t.get(n)??null}function xn(e,n){let t=F(e,n.relative_path).find(i=>i.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function V(e,n,t){let i=g(e).forFile(n,{text:!0}).text,r=T(e,n);return r?ke(t,r,i):i?Le(t,i):t}function Le(e,n){let t=n.split(/\r?\n/),i=Fe(e,t),r=Re(e,i),s=Ee(r,t);return Me(e,s)}function Fe(e,n){let t=e.some(r=>b(r.symbol))?Ae(n):null,i=new Map;for(let r of e)i.set(r.symbolId,we(n,t,r));return i}function Re(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Ee(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:ve(n,r.definition,r.startLine,o)})}return t}function Me(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function ke(e,n,t=null){let i=new Map;for(let r of n){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!$e(r)||!r.leaf)return K(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return K(r,t);let o=t?Ne(r,s,t):null;if(o)return{...r,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<s.length;l+=1){let d=s[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Ne(e,n,t){let i=Oe(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${_(i)}\\b`);for(let o of n){let a=Ce(r,o.startLine);if(a&&s.test(a))return o}return null}function Oe(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Ce(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return Te(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function Te(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let s=e[r]??"";if(i.push(s),s.includes("{"))break}return i.join(" ")}function $e(e){return b(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function K(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=_(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),s=n.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function we(e,n,t){if(!b(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-t.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function Ae(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&o(d[1],a);for(let d of c.matchAll(t))d[1]&&o(d[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let d of c.matchAll(r))d[1]&&o(d[1],a)}return s}function ve(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),s=Math.max(t,Math.min(r,n.endLine)),o=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=Pe(e[l]??"");for(let f of d)f==="{"?(o+=1,c=!0):f==="}"?o=Math.max(0,o-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function Pe(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!t&&s==="/"&&o==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(s==="\\"){i=!0,n+=" ";continue}s===t&&(t=null),n+=" ";continue}if(s==='"'||s==="'"||s==="`"){t=s,n+=" ";continue}n+=s}return n}function b(e){return e.includes("().")}function Dn(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{g as a,u as b,m as c,v as d,P as e,p as f,Qe as g,Q as h,je as i,Be as j,Je as k,We as l,ze as m,Ue as n,Ge as o,W as p,z as q,I as r,pn as s,F as t,gn as u,Se as v,bn as w,yn as x,Sn as y,Ie as z,hn as A,xn as B,Dn as C};
117
- //# sourceMappingURL=chunk-AM5SUGHF.js.map
117
+ //# sourceMappingURL=chunk-GVAF222T.js.map