codebaseiq 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (447) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +1 -1
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-ZMI2JSX2.js → chunk-23C5AD3B.js} +2 -2
  5. package/dist/chunk-2E6OUPCF.js +2 -0
  6. package/dist/chunk-2EDX3JT5.js +3 -0
  7. package/dist/chunk-2I2UHZET.js +2 -0
  8. package/dist/{chunk-T3DGWPXM.js → chunk-2OMXFE64.js} +2 -2
  9. package/dist/chunk-2PRONPAS.js +3 -0
  10. package/dist/{chunk-GW6Z3WGY.js → chunk-356EZBIP.js} +2 -2
  11. package/dist/{chunk-UDS562V4.js → chunk-36JC5BG2.js} +2 -2
  12. package/dist/chunk-3RR2K7EZ.js +20 -0
  13. package/dist/{chunk-JE3WZ6II.js → chunk-3RSBGWGL.js} +2 -2
  14. package/dist/{chunk-VE5AVNMP.js → chunk-3VJ3OCRE.js} +2 -2
  15. package/dist/{chunk-FDGD5AB5.js → chunk-4LK5OIPW.js} +2 -2
  16. package/dist/chunk-5DSL3NT2.js +17 -0
  17. package/dist/chunk-5FWR5HLG.js +90 -0
  18. package/dist/chunk-5IC2WZAL.js +22 -0
  19. package/dist/{chunk-MVB3DAEY.js → chunk-5IZRKWTZ.js} +2 -2
  20. package/dist/{chunk-Q65CQ4XL.js → chunk-5LL4KEHO.js} +2 -2
  21. package/dist/chunk-5T44HG5Y.js +88 -0
  22. package/dist/{chunk-TRRC4ZJ7.js → chunk-5ZI2PPI7.js} +2 -2
  23. package/dist/{chunk-7XAN6GKB.js → chunk-67VJAYVR.js} +2 -2
  24. package/dist/{chunk-MOVBWNIP.js → chunk-6BF3VYEF.js} +2 -2
  25. package/dist/chunk-6JMAVFL4.js +3 -0
  26. package/dist/chunk-6O3KXIDL.js +2 -0
  27. package/dist/{chunk-JOIRNPPY.js → chunk-6VREELBC.js} +2 -2
  28. package/dist/chunk-6WAPPQ5F.js +82 -0
  29. package/dist/{chunk-FW53T7EB.js → chunk-75KJGYX7.js} +2 -2
  30. package/dist/chunk-7GAK2F3H.js +77 -0
  31. package/dist/{chunk-UBGWN7I4.js → chunk-7JELP5YE.js} +2 -2
  32. package/dist/chunk-7UCDGXRW.js +8 -0
  33. package/dist/{chunk-L57ZKWVG.js → chunk-AEXQYQD7.js} +2 -2
  34. package/dist/chunk-AQI4N64O.js +22 -0
  35. package/dist/{chunk-ICFDQHAM.js → chunk-AURCQHSG.js} +2 -2
  36. package/dist/{chunk-I2T2LLK2.js → chunk-BBP7HVBJ.js} +2 -2
  37. package/dist/{chunk-OFBE4NGP.js → chunk-BFBIMTCJ.js} +2 -2
  38. package/dist/{chunk-JEJLSICM.js → chunk-BGGB5N53.js} +2 -2
  39. package/dist/{chunk-TIIC3ZE7.js → chunk-BRQL7AFJ.js} +2 -2
  40. package/dist/{chunk-YSNONTJ2.js → chunk-BWL3PMPT.js} +2 -2
  41. package/dist/chunk-C6WKPKCF.js +127 -0
  42. package/dist/{chunk-YESXMKX3.js → chunk-C7OUW52M.js} +2 -2
  43. package/dist/chunk-C7QWUBR2.js +545 -0
  44. package/dist/{chunk-4WKDMDEW.js → chunk-CCIYWXX6.js} +2 -2
  45. package/dist/{chunk-FAJQ7LWY.js → chunk-CIYA2KZN.js} +2 -2
  46. package/dist/{chunk-VEXUL62T.js → chunk-CR3OG6SQ.js} +2 -2
  47. package/dist/{chunk-JSOYNVWH.js → chunk-CVHOQONG.js} +2 -2
  48. package/dist/{chunk-LU3BMVH2.js → chunk-CW6AXOLR.js} +2 -2
  49. package/dist/{chunk-TXXOEMZJ.js → chunk-D53LWANR.js} +2 -2
  50. package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
  51. package/dist/{chunk-N3IQCBCF.js → chunk-D7AZAOZX.js} +2 -2
  52. package/dist/{chunk-RDBI2RXU.js → chunk-D7DOB27N.js} +7 -7
  53. package/dist/chunk-DAKIGMIK.js +21 -0
  54. package/dist/chunk-DDN2F6GB.js +2 -0
  55. package/dist/chunk-DUKHVPU5.js +4 -0
  56. package/dist/chunk-DVWO7RBC.js +2 -0
  57. package/dist/{chunk-HKQUXIFO.js → chunk-E52K4L2W.js} +2 -2
  58. package/dist/chunk-EIBGSU2R.js +2 -0
  59. package/dist/chunk-EN4AHLL3.js +3 -0
  60. package/dist/chunk-EQNMD62X.js +51 -0
  61. package/dist/{chunk-ENCCHKM6.js → chunk-EXZ7VLRY.js} +4 -4
  62. package/dist/{chunk-NEDP5RFQ.js → chunk-F3QSL4W2.js} +2 -2
  63. package/dist/{chunk-O6QTXQPJ.js → chunk-F74LZWCE.js} +2 -2
  64. package/dist/{chunk-BH5F2Q4O.js → chunk-FEIZXBLH.js} +2 -2
  65. package/dist/chunk-FH5WG4LE.js +2 -0
  66. package/dist/{chunk-BVAJLC5A.js → chunk-FOZ74V56.js} +2 -2
  67. package/dist/{chunk-L4NRUAGJ.js → chunk-FQTIFWLR.js} +2 -2
  68. package/dist/chunk-FTTV7IRX.js +355 -0
  69. package/dist/chunk-FWQGH2N2.js +2 -0
  70. package/dist/{chunk-CAUCPUOF.js → chunk-GDHWOA57.js} +2 -2
  71. package/dist/{chunk-6MUIJMVL.js → chunk-GIDCP7KV.js} +2 -2
  72. package/dist/{chunk-ZV3JV5G5.js → chunk-GL6UTNUB.js} +2 -2
  73. package/dist/chunk-GP7C5VAE.js +2 -0
  74. package/dist/{chunk-FQKZWM4L.js → chunk-GQLDYCWS.js} +5 -5
  75. package/dist/chunk-GQXXOS55.js +2 -0
  76. package/dist/{chunk-H3LGFZVK.js → chunk-GUFPEFBG.js} +2 -2
  77. package/dist/{chunk-NNOKTMZT.js → chunk-GV2CEZCW.js} +2 -2
  78. package/dist/{chunk-FETNQCFO.js → chunk-GVAF222T.js} +2 -2
  79. package/dist/chunk-GWYZVVKY.js +21 -0
  80. package/dist/{chunk-7FND7D7N.js → chunk-HENP2O4A.js} +2 -2
  81. package/dist/{chunk-LZYFLFEH.js → chunk-HINZQKSY.js} +2 -2
  82. package/dist/{chunk-RR7SX44N.js → chunk-HQA7EBSK.js} +2 -2
  83. package/dist/{chunk-XMQ23E27.js → chunk-HVFB3PME.js} +2 -2
  84. package/dist/chunk-I22IZYDI.js +2 -0
  85. package/dist/chunk-ICUL7XRT.js +21 -0
  86. package/dist/{chunk-CQP3THUZ.js → chunk-IHSLIIL3.js} +2 -2
  87. package/dist/{chunk-34WBMAYK.js → chunk-ITSJMNUD.js} +2 -2
  88. package/dist/{chunk-PX4RYAAK.js → chunk-IZDPGOZR.js} +2 -2
  89. package/dist/chunk-J3GLP7Q5.js +3 -0
  90. package/dist/{chunk-CVYSU6BX.js → chunk-J7AMBVWF.js} +2 -2
  91. package/dist/{chunk-Y6KHROC3.js → chunk-JCMFBF4Z.js} +2 -2
  92. package/dist/chunk-JFIA2JI3.js +3 -0
  93. package/dist/chunk-JLZLLLW5.js +3 -0
  94. package/dist/{chunk-5PUWMSDU.js → chunk-JSNTHRLQ.js} +2 -2
  95. package/dist/{chunk-C6SBF2WH.js → chunk-JX6ZWDOS.js} +2 -2
  96. package/dist/{chunk-4XTAUQFD.js → chunk-JYI7CV25.js} +2 -2
  97. package/dist/chunk-K7JLSGCJ.js +8 -0
  98. package/dist/{chunk-XWUOUWYI.js → chunk-KPZGTB2O.js} +2 -2
  99. package/dist/{chunk-VXYS3FZD.js → chunk-LKUTSP4G.js} +2 -2
  100. package/dist/{chunk-GTXSJDCO.js → chunk-LMTSB3TB.js} +2 -2
  101. package/dist/chunk-LONKINMJ.js +543 -0
  102. package/dist/{chunk-WMPRTGH2.js → chunk-LQHYYIOB.js} +2 -2
  103. package/dist/{chunk-VUIYB2V3.js → chunk-LZSQ6X7E.js} +2 -2
  104. package/dist/{chunk-ST7V3SKN.js → chunk-M2Y6PCFE.js} +2 -2
  105. package/dist/chunk-MEUHIDI3.js +7 -0
  106. package/dist/{chunk-OZYRSMSH.js → chunk-MHWMEZDA.js} +2 -2
  107. package/dist/{chunk-RKEJ6VTF.js → chunk-MQW6SJ4P.js} +2 -2
  108. package/dist/{chunk-J77SU6VA.js → chunk-MSI3K7PJ.js} +2 -2
  109. package/dist/chunk-MVRGB4KJ.js +278 -0
  110. package/dist/{chunk-DQMDCD24.js → chunk-MZNMASFM.js} +2 -2
  111. package/dist/{chunk-ID63777H.js → chunk-NBCQZSGR.js} +2 -2
  112. package/dist/chunk-NBZKSTXP.js +2 -0
  113. package/dist/{chunk-SZD2KF7Q.js → chunk-NCJILOAK.js} +2 -2
  114. package/dist/{chunk-C7QOQX32.js → chunk-NDKOVQFG.js} +2 -2
  115. package/dist/{chunk-UNBY47BC.js → chunk-NEWHKGVD.js} +2 -2
  116. package/dist/{chunk-PYAB5SM6.js → chunk-O2M3VNDY.js} +2 -2
  117. package/dist/chunk-OFGOOL6U.js +3 -0
  118. package/dist/{chunk-SWHMHUKF.js → chunk-OQUCBKOI.js} +2 -2
  119. package/dist/{chunk-7MGU3HPH.js → chunk-P4NVCOM7.js} +2 -2
  120. package/dist/{chunk-ANFVSJWQ.js → chunk-PFC44E6D.js} +2 -2
  121. package/dist/{chunk-EZNMUY67.js → chunk-PHNCEUXX.js} +2 -2
  122. package/dist/{chunk-4FC325IF.js → chunk-PTQPPPG2.js} +2 -2
  123. package/dist/chunk-PUVNH4PO.js +3 -0
  124. package/dist/chunk-Q23IMHXS.js +343 -0
  125. package/dist/chunk-Q3ZCQY2Y.js +3 -0
  126. package/dist/{chunk-KMITESMT.js → chunk-Q4XEU3UH.js} +2 -2
  127. package/dist/{chunk-QKPLA6IC.js → chunk-QEOWONKY.js} +2 -2
  128. package/dist/{chunk-BJ6SQAEN.js → chunk-QMOZZ2VX.js} +2 -2
  129. package/dist/chunk-RCIGX23V.js +60 -0
  130. package/dist/{chunk-IOP6FWIM.js → chunk-RIYJ4L33.js} +2 -2
  131. package/dist/chunk-RJVAPMHF.js +14 -0
  132. package/dist/chunk-SB7NASHU.js +2 -0
  133. package/dist/{chunk-UZGZB3VB.js → chunk-SGMNWYTH.js} +2 -2
  134. package/dist/chunk-SMDIEDM4.js +27 -0
  135. package/dist/chunk-SV2LEFVM.js +2 -0
  136. package/dist/chunk-SX72EVMY.js +3 -0
  137. package/dist/chunk-T5X7DK6C.js +3 -0
  138. package/dist/{chunk-6NW7MU72.js → chunk-T6MQNNAC.js} +2 -2
  139. package/dist/chunk-T75DS2E6.js +21 -0
  140. package/dist/{chunk-HRWGYWRJ.js → chunk-TEANKHUU.js} +2 -2
  141. package/dist/chunk-TJBOJUVN.js +3 -0
  142. package/dist/{chunk-XLQ3GLWZ.js → chunk-TJWVT4DO.js} +2 -2
  143. package/dist/{chunk-7NVGT435.js → chunk-TNJGTQWO.js} +2 -2
  144. package/dist/{chunk-NE6IU5ZD.js → chunk-TOTWJZIX.js} +2 -2
  145. package/dist/{chunk-PBI2LFKH.js → chunk-TPO7XC5Z.js} +2 -2
  146. package/dist/{chunk-HPJRBHVT.js → chunk-U33PMPNW.js} +2 -2
  147. package/dist/{chunk-QHRNXP3C.js → chunk-U7NUXDQO.js} +2 -2
  148. package/dist/chunk-UC2FD2PS.js +4 -0
  149. package/dist/{chunk-PIOMTC27.js → chunk-UQE4XFSA.js} +2 -2
  150. package/dist/chunk-UQYQBLJX.js +5 -0
  151. package/dist/{chunk-KWVHSKHK.js → chunk-USOAJHY7.js} +2 -2
  152. package/dist/{chunk-GCHRX4YW.js → chunk-UW6KD57C.js} +2 -2
  153. package/dist/{chunk-PTAWHLVJ.js → chunk-VGWZ4MOY.js} +2 -2
  154. package/dist/{chunk-XME3HPXZ.js → chunk-VWYGCMV5.js} +2 -2
  155. package/dist/{chunk-AKB7V7TV.js → chunk-W7YLRXZE.js} +2 -2
  156. package/dist/{chunk-SYDJMPES.js → chunk-WK2IQJPK.js} +2 -2
  157. package/dist/{chunk-RBAS5ZHI.js → chunk-WWCV4E6J.js} +2 -2
  158. package/dist/{chunk-OL6KJP3N.js → chunk-XMJ53WG4.js} +2 -2
  159. package/dist/chunk-XN3EKMLI.js +4 -0
  160. package/dist/chunk-XQAVQVIL.js +3 -0
  161. package/dist/{chunk-IJ4HMYBE.js → chunk-XQPPURLQ.js} +2 -2
  162. package/dist/{chunk-OVTS4DKB.js → chunk-YHPG3S2U.js} +2 -2
  163. package/dist/{chunk-WOQBZPIF.js → chunk-YRKP7PM7.js} +2 -2
  164. package/dist/chunk-YT4DVWUV.js +11 -0
  165. package/dist/chunk-YTJHCGYB.js +61 -0
  166. package/dist/chunk-Z35GOVEH.js +2 -0
  167. package/dist/{chunk-OLF4MA5W.js → chunk-Z6RL7XOE.js} +4 -4
  168. package/dist/{chunk-UP3BUZR5.js → chunk-ZAFGY22Q.js} +2 -2
  169. package/dist/{chunk-CO5R3UNA.js → chunk-ZB4C5TTR.js} +2 -2
  170. package/dist/{chunk-ZZXSWSN6.js → chunk-ZNH33XIB.js} +2 -2
  171. package/dist/{chunk-EMNIHCRB.js → chunk-ZQ62NNKN.js} +2 -2
  172. package/dist/cli-context-FJL2JHOE.js +3 -0
  173. package/dist/cli-context-PQNWHMCQ.js +2 -0
  174. package/dist/cli-program-UO7PZD6V.js +7 -0
  175. package/dist/cli.js +1 -1
  176. package/dist/{code-DlqpBDd0.d.ts → code-DfX3xeWy.d.ts} +1 -1
  177. package/dist/code-viewer-KIXEYQNJ.js +12 -0
  178. package/dist/code-viewer-VHLBLIUM.js +11 -0
  179. package/dist/command-descriptors-F5P2V3NW.js +335 -0
  180. package/dist/command-descriptors-YCLATF5I.js +337 -0
  181. package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
  182. package/dist/{db-D7sauVFH.d.ts → db-BoG_PWYH.d.ts} +2 -2
  183. package/dist/direct-navigation-4XJTXIDT.js +2 -0
  184. package/dist/direct-navigation-J5MVYYAD.js +3 -0
  185. package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-D1jx1Cql.d.ts} +1 -1
  186. package/dist/{health-DJaZXg8I.d.ts → health-DkYBS5BI.d.ts} +1 -1
  187. package/dist/index.d.ts +2 -2
  188. package/dist/index.js +1 -1
  189. package/dist/invocation-command-descriptors-RWV4VAI4.js +2 -0
  190. package/dist/invocation-command-descriptors-U76PN7IY.js +3 -0
  191. package/dist/{scip-cli-B7N3haxa.d.ts → maintenance-types-CdL5eQii.d.ts} +2 -21
  192. package/dist/output-continuation-command-BL25S26S.js +3 -0
  193. package/dist/output-continuation-command-BTETTXEC.js +2 -0
  194. package/dist/postinstall.js +1 -1
  195. package/dist/project-reindex-CRJU3IFG.js +2 -0
  196. package/dist/project-reindex-TQFCOA2O.js +3 -0
  197. package/dist/queries/affected.d.ts +2 -2
  198. package/dist/queries/affected.js +1 -1
  199. package/dist/queries/anchors.d.ts +2 -2
  200. package/dist/queries/anchors.js +1 -1
  201. package/dist/queries/architecture.d.ts +2 -2
  202. package/dist/queries/architecture.js +1 -1
  203. package/dist/queries/bottlenecks.d.ts +2 -2
  204. package/dist/queries/bottlenecks.js +1 -1
  205. package/dist/queries/by-kind.d.ts +2 -2
  206. package/dist/queries/by-kind.js +1 -1
  207. package/dist/queries/call-graph.d.ts +2 -2
  208. package/dist/queries/call-graph.js +1 -1
  209. package/dist/queries/change-surface.d.ts +2 -2
  210. package/dist/queries/change-surface.js +1 -1
  211. package/dist/queries/cleanup-plan.d.ts +2 -2
  212. package/dist/queries/cleanup-plan.js +1 -1
  213. package/dist/queries/co-change.d.ts +2 -2
  214. package/dist/queries/co-change.js +1 -1
  215. package/dist/queries/code.d.ts +3 -3
  216. package/dist/queries/code.js +1 -1
  217. package/dist/queries/complexity-hotspots.d.ts +2 -2
  218. package/dist/queries/complexity-hotspots.js +1 -1
  219. package/dist/queries/complexity.d.ts +2 -2
  220. package/dist/queries/complexity.js +1 -1
  221. package/dist/queries/context.d.ts +2 -2
  222. package/dist/queries/context.js +1 -1
  223. package/dist/queries/convergence.d.ts +2 -2
  224. package/dist/queries/convergence.js +1 -1
  225. package/dist/queries/coupling.d.ts +2 -2
  226. package/dist/queries/coupling.js +1 -1
  227. package/dist/queries/cycles.d.ts +2 -2
  228. package/dist/queries/cycles.js +1 -1
  229. package/dist/queries/dataflow.d.ts +2 -2
  230. package/dist/queries/dataflow.js +1 -1
  231. package/dist/queries/dead.d.ts +2 -2
  232. package/dist/queries/dead.js +1 -1
  233. package/dist/queries/decorative-checkers.d.ts +2 -2
  234. package/dist/queries/decorative-checkers.js +1 -1
  235. package/dist/queries/deep-chains.d.ts +2 -2
  236. package/dist/queries/deep-chains.js +1 -1
  237. package/dist/queries/dependence-slice.d.ts +3 -3
  238. package/dist/queries/dependence-slice.js +1 -1
  239. package/dist/queries/dependency-depth.d.ts +2 -2
  240. package/dist/queries/dependency-depth.js +1 -1
  241. package/dist/queries/deps.d.ts +2 -2
  242. package/dist/queries/deps.js +1 -1
  243. package/dist/queries/diff-impact.d.ts +2 -2
  244. package/dist/queries/diff-impact.js +1 -1
  245. package/dist/queries/doc-drift.d.ts +2 -2
  246. package/dist/queries/doc-drift.js +1 -1
  247. package/dist/queries/drift.d.ts +2 -2
  248. package/dist/queries/drift.js +1 -1
  249. package/dist/queries/duplicate-bodies.d.ts +2 -2
  250. package/dist/queries/duplicate-bodies.js +1 -1
  251. package/dist/queries/entry-map.d.ts +2 -2
  252. package/dist/queries/entry-map.js +1 -1
  253. package/dist/queries/evidence.d.ts +3 -3
  254. package/dist/queries/evidence.js +1 -1
  255. package/dist/queries/extract-candidates.d.ts +2 -2
  256. package/dist/queries/extract-candidates.js +1 -1
  257. package/dist/queries/fan.d.ts +2 -2
  258. package/dist/queries/fan.js +1 -1
  259. package/dist/queries/files.d.ts +2 -2
  260. package/dist/queries/files.js +1 -1
  261. package/dist/queries/health.d.ts +3 -3
  262. package/dist/queries/health.js +1 -1
  263. package/dist/queries/hierarchy.d.ts +2 -2
  264. package/dist/queries/hierarchy.js +1 -1
  265. package/dist/queries/hotspots.d.ts +2 -2
  266. package/dist/queries/hotspots.js +1 -1
  267. package/dist/queries/imports.d.ts +2 -2
  268. package/dist/queries/imports.js +1 -1
  269. package/dist/queries/incomplete-migration.d.ts +2 -2
  270. package/dist/queries/incomplete-migration.js +1 -1
  271. package/dist/queries/index.d.ts +5 -5
  272. package/dist/queries/index.js +1 -1
  273. package/dist/queries/isolated.d.ts +2 -2
  274. package/dist/queries/isolated.js +1 -1
  275. package/dist/queries/locality-candidates.d.ts +2 -2
  276. package/dist/queries/locality-candidates.js +1 -1
  277. package/dist/queries/members.d.ts +2 -2
  278. package/dist/queries/members.js +1 -1
  279. package/dist/queries/methods.d.ts +2 -2
  280. package/dist/queries/methods.js +1 -1
  281. package/dist/queries/not-implemented.d.ts +2 -2
  282. package/dist/queries/not-implemented.js +1 -1
  283. package/dist/queries/outline.d.ts +2 -2
  284. package/dist/queries/outline.js +1 -1
  285. package/dist/queries/passthrough-candidates.d.ts +2 -2
  286. package/dist/queries/passthrough-candidates.js +1 -1
  287. package/dist/queries/plan-context.d.ts +2 -2
  288. package/dist/queries/plan-context.js +1 -1
  289. package/dist/queries/react-component-duplicates.d.ts +2 -2
  290. package/dist/queries/react-component-duplicates.js +1 -1
  291. package/dist/queries/react-hook-candidates.d.ts +2 -2
  292. package/dist/queries/react-hook-candidates.js +1 -1
  293. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  294. package/dist/queries/react-large-component-pressure.js +1 -1
  295. package/dist/queries/recent-duplicates.d.ts +2 -2
  296. package/dist/queries/recent-duplicates.js +1 -1
  297. package/dist/queries/redundant-reexports.d.ts +2 -2
  298. package/dist/queries/redundant-reexports.js +1 -1
  299. package/dist/queries/reference-neighborhood.d.ts +2 -2
  300. package/dist/queries/reference-neighborhood.js +1 -1
  301. package/dist/queries/reference-reachability.d.ts +2 -2
  302. package/dist/queries/reference-reachability.js +1 -1
  303. package/dist/queries/refs.d.ts +2 -2
  304. package/dist/queries/refs.js +1 -1
  305. package/dist/queries/self-audit.d.ts +2 -2
  306. package/dist/queries/self-audit.js +1 -1
  307. package/dist/queries/similar-chains.d.ts +2 -2
  308. package/dist/queries/similar-chains.js +1 -1
  309. package/dist/queries/similar-files.d.ts +2 -2
  310. package/dist/queries/similar-files.js +1 -1
  311. package/dist/queries/similar-signatures.d.ts +2 -2
  312. package/dist/queries/similar-signatures.js +1 -1
  313. package/dist/queries/similar.d.ts +2 -2
  314. package/dist/queries/similar.js +1 -1
  315. package/dist/queries/slice.d.ts +2 -2
  316. package/dist/queries/slice.js +1 -1
  317. package/dist/queries/source-inspection.d.ts +4 -4
  318. package/dist/queries/source-inspection.js +1 -1
  319. package/dist/queries/source-search.d.ts +2 -2
  320. package/dist/queries/source-search.js +1 -1
  321. package/dist/queries/stale-abstractions.d.ts +2 -2
  322. package/dist/queries/stale-abstractions.js +1 -1
  323. package/dist/queries/stats.d.ts +2 -2
  324. package/dist/queries/surface.d.ts +2 -2
  325. package/dist/queries/surface.js +1 -1
  326. package/dist/queries/symbols.d.ts +2 -2
  327. package/dist/queries/symbols.js +1 -1
  328. package/dist/queries/system-map.d.ts +2 -2
  329. package/dist/queries/system-map.js +1 -1
  330. package/dist/queries/system.d.ts +2 -2
  331. package/dist/queries/system.js +1 -1
  332. package/dist/queries/test-quality.d.ts +2 -2
  333. package/dist/queries/test-quality.js +1 -1
  334. package/dist/queries/trace.d.ts +2 -2
  335. package/dist/queries/trace.js +1 -1
  336. package/dist/queries/twin-ab.d.ts +2 -2
  337. package/dist/queries/twin-ab.js +1 -1
  338. package/dist/queries/twin-drift.d.ts +2 -2
  339. package/dist/queries/twin-drift.js +1 -1
  340. package/dist/queries/unused-imports.d.ts +2 -2
  341. package/dist/queries/unused-imports.js +1 -1
  342. package/dist/queries/unused-params.d.ts +2 -2
  343. package/dist/queries/unused-params.js +1 -1
  344. package/dist/queries/value-flow.d.ts +3 -3
  345. package/dist/queries/value-flow.js +1 -1
  346. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  347. package/dist/queries/vue-component-duplicates.js +1 -1
  348. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  349. package/dist/queries/vue-composable-candidates.js +1 -1
  350. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  351. package/dist/queries/vue-large-view-pressure.js +1 -1
  352. package/dist/queries/wrapper-candidates.d.ts +2 -2
  353. package/dist/queries/wrapper-candidates.js +1 -1
  354. package/dist/reindex-worker.js +2 -2
  355. package/dist/reindex.d.ts +3 -5
  356. package/dist/reindex.js +72 -33
  357. package/dist/runtime.d.ts +23 -4
  358. package/dist/runtime.js +3 -3
  359. package/dist/rust-semantic-session-server.js +1 -1
  360. package/dist/rust-semantic-session-worker.js +1 -1
  361. package/dist/rust-semantic-worker.js +1 -1
  362. package/dist/sentinel-ensure-command-OSWGCFFL.js +3 -0
  363. package/dist/sentinel-ensure-command-SPW7XQLB.js +2 -0
  364. package/dist/sentinel-hook.js +39 -0
  365. package/dist/sentinel-worker.js +16 -0
  366. package/dist/typescript-mailbox-worker.js +1 -1
  367. package/dist/watch-server.js +6 -6
  368. package/docs/COMMAND_REFERENCE.md +5 -3
  369. package/docs/INDEX_GENERATIONS.md +2 -2
  370. package/docs/NPM_RELEASE.md +323 -0
  371. package/docs/schemas/npm-release-state.schema.json +4 -13
  372. package/docs/schemas/project-config.schema.json +159 -0
  373. package/package.json +10 -14
  374. package/skills/codebaseiq/SKILL.md +1 -1
  375. package/skills/concrete-plan/SKILL.md +1 -1
  376. package/ui/view/api.js +450 -0
  377. package/ui/view/app.js +394 -0
  378. package/ui/view/builder.js +323 -0
  379. package/ui/view/file-panel.js +170 -0
  380. package/ui/view/focus.js +379 -0
  381. package/ui/view/index.html +54 -0
  382. package/ui/view/map.js +424 -0
  383. package/ui/view/styles.css +1125 -0
  384. package/dist/chunk-2Q2LW5JW.js +0 -14
  385. package/dist/chunk-2X7V4HS4.js +0 -88
  386. package/dist/chunk-3IER7Q6H.js +0 -12
  387. package/dist/chunk-3JSXXYTZ.js +0 -345
  388. package/dist/chunk-476NR5B7.js +0 -2
  389. package/dist/chunk-5VKBFZZU.js +0 -3
  390. package/dist/chunk-6BQ3DSPK.js +0 -2
  391. package/dist/chunk-6CS3UQTN.js +0 -3
  392. package/dist/chunk-6OAHRI2D.js +0 -6
  393. package/dist/chunk-ADTBPVUZ.js +0 -21
  394. package/dist/chunk-BFFZDZQV.js +0 -2
  395. package/dist/chunk-BMYOV5GP.js +0 -77
  396. package/dist/chunk-C74PPYLA.js +0 -3
  397. package/dist/chunk-CWONGW6P.js +0 -3
  398. package/dist/chunk-DDZ7VHWV.js +0 -20
  399. package/dist/chunk-DR2LURYU.js +0 -3
  400. package/dist/chunk-ECQBG7PW.js +0 -564
  401. package/dist/chunk-EF2R3WNQ.js +0 -2
  402. package/dist/chunk-FM5BPL4V.js +0 -60
  403. package/dist/chunk-G6XFR4ZL.js +0 -4
  404. package/dist/chunk-GTIYTDRE.js +0 -562
  405. package/dist/chunk-HOA5YGOH.js +0 -3
  406. package/dist/chunk-KUW32IRO.js +0 -2
  407. package/dist/chunk-LTA3BRZX.js +0 -2
  408. package/dist/chunk-NAUD7LCA.js +0 -2
  409. package/dist/chunk-NCZUNH3E.js +0 -109
  410. package/dist/chunk-NNJ2KZZG.js +0 -4
  411. package/dist/chunk-NNO6A2PO.js +0 -2
  412. package/dist/chunk-OGTFJ3XD.js +0 -2
  413. package/dist/chunk-Q5ELPRKQ.js +0 -2
  414. package/dist/chunk-Q72QSKXC.js +0 -308
  415. package/dist/chunk-QCN62RTF.js +0 -3
  416. package/dist/chunk-QW7EP6WI.js +0 -21
  417. package/dist/chunk-RU65DDUP.js +0 -215
  418. package/dist/chunk-SELM5MER.js +0 -2
  419. package/dist/chunk-SMRBZ6EC.js +0 -2
  420. package/dist/chunk-SNNWPCN7.js +0 -4
  421. package/dist/chunk-TFZB6XTM.js +0 -239
  422. package/dist/chunk-UCD3H3UZ.js +0 -5
  423. package/dist/chunk-UXM43C7T.js +0 -3
  424. package/dist/chunk-VFY6Y2H6.js +0 -61
  425. package/dist/chunk-WE5RZHZ7.js +0 -5
  426. package/dist/chunk-YMGZZEW4.js +0 -2
  427. package/dist/chunk-YVCIMIOC.js +0 -12
  428. package/dist/chunk-Z54RD7VL.js +0 -3
  429. package/dist/chunk-ZKX2FRS6.js +0 -15
  430. package/dist/cli-context-3SNLDYBM.js +0 -3
  431. package/dist/cli-context-T3B7W6GG.js +0 -2
  432. package/dist/cli-program-YNOXO72B.js +0 -7
  433. package/dist/command-descriptors-6AOUKWW7.js +0 -346
  434. package/dist/command-descriptors-ZFKJSRUP.js +0 -344
  435. package/dist/direct-navigation-DP4LVMRX.js +0 -3
  436. package/dist/direct-navigation-FLUS3BT6.js +0 -2
  437. package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
  438. package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
  439. package/dist/output-continuation-command-2V2SL4TD.js +0 -2
  440. package/dist/output-continuation-command-65J5IP3O.js +0 -3
  441. package/dist/project-reindex-5JOKXAXT.js +0 -2
  442. package/dist/project-reindex-UQBIKO4M.js +0 -3
  443. package/docs/WINDOWS_SIDECAR_RELEASE.md +0 -424
  444. package/docs/schemas/windows-sidecar-provenance.schema.json +0 -137
  445. package/scripts/build-codebaseiq-windows.mjs +0 -197
  446. package/scripts/codebaseiq-windows-provenance.mjs +0 -364
  447. package/scripts/verify-codebaseiq-windows.mjs +0 -29
@@ -1,2 +0,0 @@
1
- import{wb as o}from"./chunk-GTIYTDRE.js";import{G as n}from"./chunk-WE5RZHZ7.js";async function i(t){if(typeof t!="string"||t.length===0)throw new Error("Output continuation requires a cursor.");await o(t,n)}var u={id:"continue",command:"continue <cursor>",hidden:!0,description:"Continue an immutable output snapshot",renderShape:"custom",handler:i};export{u as a};
2
- //# sourceMappingURL=chunk-476NR5B7.js.map
@@ -1,3 +0,0 @@
1
- import{b as m}from"./chunk-7MGU3HPH.js";import{a as p}from"./chunk-EF2R3WNQ.js";import{$ as d,ba as P,ca as h,g as f}from"./chunk-WE5RZHZ7.js";import{realpathSync as c}from"fs";import{basename as x,dirname as L,join as T,relative as I,sep as O}from"path";import{fileURLToPath as S,pathToFileURL as y}from"url";function F(n,e){return e==="."||e==="./"?y(c(n)).href:y(d(n,e).absolutePath).href}function b(n,e){let r=S(e);return I(c(n),v(r)).split(O).join("/")}function v(n){try{return c(n)}catch{try{return T(c(L(n)),x(n))}catch{return n}}}function H(n,e,r){return{textDocument:{uri:F(n,e.relativePath)},position:z(n,e),context:{includeDeclaration:r}}}function z(n,e){let r={line:e.startLine,character:e.startChar??0};try{return M(P(n,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(t){if(!h(t))throw t;return r}}function M(n,e,r={line:e.startLine,character:e.startChar??0}){let t=n.split(/\r?\n/),o=t[e.startLine];if(o===void 0||e.leaf.length===0)return r;let i=Math.max(0,Math.min(r.character,o.length)),s=o.indexOf(e.leaf,i);if(s>=0)return{line:e.startLine,character:u(s,e.leaf)};let a=o.indexOf(e.leaf);if(a>=0)return{line:e.startLine,character:u(a,e.leaf)};let l=D(t,e.startLine,e.leaf);return l||r}function u(n,e){return n+Math.max(0,e.length-2)}function D(n,e,r){for(let t of[-1,1,-2,2]){let o=e+t;if(o<0||o>=n.length)continue;let i=n[o].indexOf(r);if(i>=0)return{line:o,character:u(i,r)}}return null}function K(n,e){return e.map(r=>({file:b(n,r.uri),line:r.range.start.line,column:r.range.start.character}))}function X(n){let e=new Map;for(let r of n)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,t)=>{let o=r.file.localeCompare(t.file);return o!==0?o:r.line!==t.line?r.line-t.line:r.column-t.column})}import{randomUUID as E}from"crypto";import{readdirSync as $,rmSync as j,writeFileSync as A}from"fs";import{join as g}from"path";var R="rust-analyzer-owner-",w=".json",U=16*1024;function Z(n,e){if(!n||!e.rootIdentity)return null;let r=g(n,`${R}${e.rootPid}-${E()}${w}`),t={version:1,rootIdentity:e.rootIdentity,ownsProcessGroup:e.ownsProcessGroup};return A(r,`${JSON.stringify(t)}
2
- `,{encoding:"utf8",mode:384,flag:"wx"}),r}function ee(n){n&&j(n,{force:!0})}async function re(n,e){if(!n)return[];let r;try{r=$(n)}catch{return[]}let t=r.filter(s=>s.startsWith(R)&&s.endsWith(w)).map(s=>g(n,s)),o=[],i=[];for(let s of t){let a=C(s);a?i.push(a):o.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return o.push(...await Promise.all(i.map(s=>m(s,e)))),o}function C(n){try{let e=f(n,{maxBytes:U,inputKind:"rust-analyzer process ownership record"}),r=JSON.parse(e),t=p(r.rootIdentity);return r.version!==1||!t||typeof r.ownsProcessGroup!="boolean"?null:{rootPid:t.pid,rootIdentity:t,ownsProcessGroup:r.ownsProcessGroup,knownMembers:new Map([[t.pid,t]])}}catch{return null}}export{Z as a,ee as b,re as c,F as d,b as e,H as f,K as g,X as h};
3
- //# sourceMappingURL=chunk-5VKBFZZU.js.map
@@ -1,2 +0,0 @@
1
- import{a as P,d as w}from"./chunk-FAJQ7LWY.js";import{s as M}from"./chunk-Z54RD7VL.js";import{b as g,c as T}from"./chunk-FDGD5AB5.js";import{U as v,W as b,X as d}from"./chunk-RU65DDUP.js";import{d as f}from"./chunk-QW7EP6WI.js";import{w as l}from"./chunk-RDBI2RXU.js";import{c,d as y}from"./chunk-EF2R3WNQ.js";import{o as h,p as S}from"./chunk-WE5RZHZ7.js";import{randomUUID as A}from"crypto";import{resolve as q}from"path";var E=class{projectRoot;currentGeneration;createEmitter;wallNow;monotonicNow;active=new Map;requests=0;sessionsCreated=0;sessionsReplaced=0;lastRequestAtMs=null;lastDurationMs=null;lastError=null;unavailable=!1;constructor(e){this.projectRoot=q(e.projectRoot),this.currentGeneration=e.currentGeneration,this.createEmitter=e.createEmitter??g,this.wallNow=e.wallNow??e.now??Date.now,this.monotonicNow=e.monotonicNow??e.now??y}handle(e,t){let r=this.monotonicNow();try{if(this.currentGeneration()!==e)throw new Error("TypeScript index request does not match the currently published generation.");let s=this.emitterFor(t);if(s.emitter.producerIdentity!==t.producerIdentity)throw new Error("TypeScript index producer identity changed.");let o=s.emitter.snapshotStats(),a=s.emitter.advance({modifiedFiles:t.modifiedFiles,affectedFiles:t.affectedFiles}),m=this.monotonicNow()-r;return this.requests+=1,this.lastRequestAtMs=this.wallNow(),this.lastDurationMs=m,this.lastError=null,this.unavailable=!1,{producerIdentity:a.producerIdentity,cold:a.stats.initializations>o.initializations,durationMs:m,fragments:a.fragments.map(n=>({relativePath:n.relativePath,bytesBase64:n.bytes===null?null:Buffer.from(n.bytes).toString("base64"),occurrences:n.occurrences,symbols:n.symbols,referenceFragments:n.referenceFragments}))}}catch(s){throw this.lastError=s instanceof Error?s.message:String(s),s}}status(e){let t=[...this.active.values()].map(s=>s.emitter.snapshotStats()),r=s=>t.reduce((o,a)=>o+a[s],0);return{protocolVersion:T,state:this.unavailable?"unavailable":this.lastError?"error":this.active.size>0?"ready":"idle",requests:this.requests,sessionsCreated:this.sessionsCreated,sessionsReplaced:this.sessionsReplaced,initializations:r("initializations"),programUpdates:r("programUpdates"),documentsEmitted:r("documentsEmitted"),documentsRemoved:r("documentsRemoved"),...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastDurationMs===null?{}:{lastDurationMs:this.lastDurationMs},...this.lastError?{lastError:this.lastError}:{},...e?{mailbox:e}:{}}}close(){this.active.clear()}emitterFor(e){let t=`${e.tsconfigPath}\0${e.projectArgument}`,r=this.active.get(t);if(r?.projectIdentity===e.projectIdentity)return r;let s=this.createEmitter({workspaceRoot:this.projectRoot,tsconfigPath:e.tsconfigPath,projectRoot:e.projectArgument});if(!s.available)throw this.unavailable=!0,new Error(s.reason);r&&(this.sessionsReplaced+=1);let o={projectIdentity:e.projectIdentity,emitter:s.emitter};return this.active.set(t,o),this.sessionsCreated+=1,o}};function Q(i){l(i)}var Z=`typescript-index-${process.pid}-${A()}`,I=c(process.pid),ee={pid:process.pid,...I?{processIdentity:I}:{}};import{randomUUID as _}from"crypto";import{resolve as R}from"path";var p=class{loadModule;discoverTsconfigs;createProjects;createProvider;db;module=null;projects=null;provider=null;stats={providerRequests:0,sessionsCreated:0,sessionsReused:0,sessionsRefreshed:0,sessionsReplaced:0,projectsCreated:0};constructor(e,t={}){this.db=e,this.loadModule=t.loadModule??v,this.discoverTsconfigs=t.discoverTsconfigs??P,this.createProjects=t.createProjects??b,this.createProvider=t.createProvider??((r,s,o)=>w(r,s,o,{reusedProjects:!0}))}semanticProvider(){return this.stats.providerRequests+=1,this.provider?(this.stats.sessionsReused+=1,this.provider):this.createSession()}advanceGeneration(e,t){let r=O(t);return this.provider?.dispose?.(),this.provider=null,this.db=e,this.projects?r.mode==="replace"?(this.projects=null,this.module=null,this.stats.sessionsReplaced+=1,r):(r.mode==="refresh"&&(B(this.projects,e.config.projectRoot,r),this.stats.sessionsRefreshed+=1),r):r}snapshotStats(){return{...this.stats}}dispose(){this.provider?.dispose?.(),this.provider=null,this.projects=null,this.module=null}createSession(){let e=this.module??this.loadModule();if(!e)return this.provider=d("ts-morph is not installed"),this.provider;if(this.module=e,!this.projects){let t=this.discoverTsconfigs(this.db);if(t.length===0)return this.provider=d("no tsconfig found"),this.provider;this.projects=this.createProjects(e,t),this.stats.projectsCreated+=this.projects.length}return this.provider=this.createProvider(this.db,e,this.projects),this.stats.sessionsCreated+=1,this.provider}};function O(i){let e=new Set;i.projectIdentityChanged&&e.add("project-identity-changed");for(let o of i.uncertainty)e.add(o);for(let o of i.changes)o.inputKind!=="source"&&e.add(`${o.inputKind}-input-changed`);if(e.size>0)return{mode:"replace",addedFiles:[],modifiedFiles:[],deletedFiles:[],reasons:[...e].sort()};let t=u(i.changes,"added"),r=u(i.changes,"modified"),s=u(i.changes,"deleted");return{mode:t.length+r.length+s.length===0?"reuse":"refresh",addedFiles:t,modifiedFiles:r,deletedFiles:s,reasons:[]}}function u(i,e){return i.filter(t=>t.kind===e).map(t=>t.path).sort()}function B(i,e,t){for(let r of i){for(let s of t.deletedFiles)r.project.getSourceFile(R(e,s))?.forget();for(let s of t.modifiedFiles){let o=r.project.getSourceFile(R(e,s));o&&o.refreshFromFileSystemSync()}t.addedFiles.length>0&&r.project.addSourceFilesFromTsConfig(r.tsconfigPath)}}var j=class{openDb;createHost;generationIdentity;readSnapshot;now;db=null;host=null;generation=null;snapshot=null;requests=0;lastRequestAtMs=null;lastError=null;available=null;constructor(e){this.openDb=e.openDb,this.createHost=e.createHost??(t=>new p(t)),this.generationIdentity=e.generationIdentity?t=>e.generationIdentity(t.config.dbPath):t=>t.generation.identity,this.readSnapshot=e.readSnapshot?t=>e.readSnapshot(t.config.dbPath):k,this.now=e.now??Date.now}handle(e,t){try{this.syncGeneration(e);let r=this.host.semanticProvider();switch(this.available=r.availability().available,this.requests+=1,this.lastRequestAtMs=this.now(),this.lastError=null,t.kind){case"availability":return r.availability();case"import-usage":return r.importUsage(t.file);case"references":return[...H(r,t.definitions,{exact:t.exact===!0})];case"reference-fragments":if(!r.referenceFragmentsForFiles)throw new Error("TypeScript provider does not support reference fragments.");return[...r.referenceFragmentsForFiles(t.files)];case"callees":return[...L(r,t.definitions)];case"signature":return r.signatureFor(t.definition);default:return Y(t)}}catch(r){throw this.lastError=r instanceof Error?r.message:String(r),r}}status(e){let t=this.host?.snapshotStats();return{protocolVersion:M,state:this.lastError?"error":this.host?this.available?"ready":"unavailable":"idle",requests:this.requests,...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastError?{lastError:this.lastError}:{},sessionsCreated:t?.sessionsCreated??0,sessionsReused:t?.sessionsReused??0,sessionsRefreshed:t?.sessionsRefreshed??0,sessionsReplaced:t?.sessionsReplaced??0,projectsCreated:t?.projectsCreated??0,...e?{mailbox:e}:{}}}closeTypeScriptService(){this.host?.dispose(),this.db?.close(),this.host=null,this.db=null,this.generation=null,this.snapshot=null,this.available=null}syncGeneration(e){if(this.generation===e&&this.host&&this.db)return;let t=this.openDb(),r=this.generationIdentity(t);if(!r||r!==e)throw t.close(),new Error("TypeScript semantic request does not match the currently published index generation.");let s=this.readSnapshot(t);if(!this.host||!this.db)this.db=t,this.host=this.createHost(t);else{let o=this.db;this.host.advanceGeneration(t,G(this.snapshot,s)),this.db=t,o.close()}this.generation=r,this.snapshot=s,this.available=null}};function Se(i){l(i)}function H(i,e,t){return i.referencesForDefinitions?.(e,t)??new Map(e.map(r=>[r.symbolId,i.referencesFor(r)]))}function L(i,e){return i.calleesForDefinitions?.(e)??new Map(e.map(t=>[t.symbolId,i.calleesFor(t)]))}function k(i){if(!i.generation.metadataRaw)return null;let e=f(i.generation.metadataRaw);return e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache?null:h(e.metadata.fingerprint)}function G(i,e){return e?S(i,e):{version:1,changes:[],projectIdentityChanged:!0,uncertainty:["prior-snapshot-unavailable"]}}function Y(i){throw new Error(`Unhandled TypeScript semantic request: ${JSON.stringify(i)}`)}var fe=`typescript-semantic-${process.pid}-${_()}`,x=c(process.pid),ye={pid:process.pid,...x?{processIdentity:x}:{}};export{E as a,Q as b,j as c,Se as d};
2
- //# sourceMappingURL=chunk-6BQ3DSPK.js.map
@@ -1,3 +0,0 @@
1
- import{a as X}from"./chunk-P5XHIJHI.js";import{C as wt,D as me,E as $,F as Le,G as Z,H as ee,I as Oe,J as Pt,K as dn,L as Ue,M as ne,N as Et,O as At,P as Be,Q as Ft,S as pn,U as mn,V as yn,u as Tt}from"./chunk-UCD3H3UZ.js";import{d as Ct}from"./chunk-ELNRLMC5.js";import{a as De,b as xe,c as we,d as ke,e as q,q as kt}from"./chunk-ZKX2FRS6.js";import{b as Dt,e as V,f as Ne,h as xt,j as pe,t as z,u as _e}from"./chunk-FETNQCFO.js";import{a as de,f as Fe,n as Mt,p as vt}from"./chunk-O6QTXQPJ.js";import{C as It,a as Ee,c as pt,d as mt,q as ln,z as ht}from"./chunk-ADTBPVUZ.js";import{a as ot,b as st,e as lt,f as ut,i as Pe,k as cn,m as ft,o as dt,r as un,s as fn,t as ue}from"./chunk-BMYOV5GP.js";import{d as gt,f as bt,g as fe,j as Rt}from"./chunk-CWONGW6P.js";import{a as _,c as yt,d as k,f as Ae}from"./chunk-3LCDIREB.js";import{A as at,B as H,C as Ce,F as Te,G as B,H as ct,L as an,ea as St,n as le,q as N}from"./chunk-NNJ2KZZG.js";function Nt(n){let e=new Map,t=ui(n),r=new Map;return i=>{let o=li(i),s=r.get(o);if(s!==void 0)return s;if(!t.has(i.file))return r.set(o,i.symbol),i.symbol;let a=e.get(i.file);a||(a=fi(z(n,i.file)),e.set(i.file,a));let c=di(a,i);return r.set(o,c),c}}function li(n){return`${n.file}\0${n.symbol}\0${n.line}`}function ui(n){return new Set(n.all("SELECT relative_path FROM documents").map(e=>e.relative_path))}function fi(n){let e=new Map,t=new Map;for(let r of n){let i=e.get(r.leaf);i?i.push(r):e.set(r.leaf,[r]);let o=t.get(r.startLine);o?o.push(r):t.set(r.startLine,[r])}return{definitions:n,byLeaf:e,byStartLine:t}}function di(n,e){if(n.definitions.length===0)return e.symbol;let t=yi(e.symbol),r=pi(n.byLeaf,t),i=mi(r,e.line);if(i)return i.symbol;let o=n.byStartLine.get(e.line)??[];return o.length===1?o[0].symbol:e.symbol}function pi(n,e){let t=[],r=new Set;for(let i of e)for(let o of n.get(i)??[])r.has(o.symbolId)||(r.add(o.symbolId),t.push(o));return t}function mi(n,e){let t=null;for(let r of n)if(!(r.startLine>e||r.endLine<e)){if(r.startLine===e)return r;(!t||r.endLine-r.startLine<t.endLine-t.startLine)&&(t=r)}return t}function yi(n){let e=new Set([n]),r=n.split(/::|\.|#/).filter(Boolean).at(-1);return r&&e.add(r),e}function _t(n,e){let r=vt(n,e).map(i=>gi(e,i));return{usage:r,positions:bi(n,e,r)}}function Lt(n,e){return{importUsage(t){let r=n.importUsageFacts(t);if(!e||r.positions.length===0)return r.usage;let i=e.importDefinitionsForFile(t,r.positions);return i.available?Si(r.usage,i.sourcePaths):r.usage}}}function Si(n,e){return n.map((t,r)=>{let i=e.get(String(r));return i?{...t,sourcePath:i}:t})}function gi(n,e){let t=e.isTypeOnly===!0,r=e.kind==="side-effect"||t||e.used;return{importer:n,sourcePath:e.sourcePath,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:t,isUsed:r,isTypeUsed:t,isValueUsed:e.kind==="side-effect"||!t&&e.used,references:[]}}function bi(n,e,t){let r=It(n,e);if(!r)return[];let i=Ri(r.rootNode),o=new Map;for(let a of i){let c=o.get(gn(a.importedName,a.localName));c?c.push(a.position):o.set(gn(a.importedName,a.localName),[a.position])}let s=[];return t.forEach((a,c)=>{let u=o.get(gn(a.importedName,a.localName??a.importedName))?.shift();u&&s.push({...u,id:String(c),file:e})}),s}function Ri(n){let e=[];for(let t of n.descendantsOfType("use_declaration")){let r=t.namedChildren.find(i=>i.type!=="visibility_modifier");r&&e.push(...qe(r,""))}return e.filter(t=>t.importedName!=="*")}function qe(n,e){switch(n.type){case"identifier":case"super":case"self":case"crate":return[{importedName:n.text,localName:n.text,position:Sn(n,n.text)}];case"scoped_identifier":{let t=n.text.split("::").pop()??n.text;return[{importedName:t,localName:t,position:Sn(n,t)}]}case"scoped_use_list":{let t=n.namedChild(0),r=n.namedChild(1);if(!t||!r)return[];let i=Mt(e,t.text);return r.namedChildren.flatMap(o=>qe(o,i))}case"use_list":return n.namedChildren.flatMap(t=>qe(t,e));case"use_as_clause":{let t=n.namedChild(0),r=n.namedChild(1);return!t||!r?[]:qe(t,e).map(i=>({...i,localName:r.text}))}case"use_wildcard":{let t=n.namedChild(0),r="*";return[{importedName:r,localName:r,position:Sn(t??n,r)}]}default:return[]}}function Sn(n,e){let t=Math.max(0,n.text.lastIndexOf(e));return{id:"",file:"",line:n.startPosition.row,column:n.startPosition.column+t+hi(e)}}function hi(n){return Math.max(0,Math.min(n.length-1,1))}function gn(n,e){return`${n}\0${e}`}import{spawnSync as wn}from"child_process";import{existsSync as kn}from"fs";import{fileURLToPath as vo}from"url";function je(n){let e=wt(Tt,n),t=e.runnable;return t?{available:!0,dependencyAvailable:t,resolvedBinary:e.resolvedBinary??void 0,note:"rust-analyzer semantic reference queries are enabled."}:{available:!1,dependencyAvailable:t,resolvedBinary:e.resolvedBinary??void 0,reason:"rust-analyzer is not runnable; Rust semantic checks will use SCIP/source evidence only."}}import{existsSync as oo,mkdtempSync as sr,rmSync as vn}from"fs";import{tmpdir as ar}from"os";import{join as Dn}from"path";import{fileURLToPath as Ye,pathToFileURL as so}from"url";import{SHARE_ENV as ao,Worker as co}from"worker_threads";function K(n,e,t=new Set){let r=new Map;for(let i of n)t.has(i.symbolId)||r.set(i.symbolId,e.get(i.symbolId)??[]);return r}function Y(n,e,t){let r=X(process.env.SCIP_RUST_SEMANTIC_BATCH_TIMEOUT_MS)??0;if(r>0)return r;let i=Math.max(1,Math.ceil(n/Math.max(1,t)));return Math.max(12e4,3e4+i*e)}import{spawn as Bi}from"child_process";import{createHash as qi,randomUUID as ji}from"crypto";import{existsSync as Qt,realpathSync as Wi,rmSync as zi}from"fs";import{tmpdir as Ki}from"os";import{resolve as re}from"path";import{execFileSync as wi}from"child_process";import{existsSync as Ii}from"fs";import{deserializeSCIP as Mi,SymbolRole as vi}from"@c4312/scip";import{realpathSync as ea}from"fs";import{basename as ta,dirname as ra,join as ia,relative as oa,sep as sa}from"path";import{fileURLToPath as ca,pathToFileURL as la}from"url";function We(n){let e=new Map;for(let t of n)e.set(`${t.file}\0${t.line}\0${t.column}`,t);return[...e.values()].sort((t,r)=>{let i=t.file.localeCompare(r.file);return i!==0?i:t.line!==r.line?t.line-r.line:t.column-r.column})}var bn=new WeakMap,Di="SCIP_RUST_SCIP_OCCURRENCE_REFERENCE_MODE";function Ot(n,e){let t=new Map,r=ze(),i=e.filter(s=>qt(s,r));if(i.length===0)return t;let o=jt(n);if(!o)return t;for(let s of i){let a=Bt(o,s);a!==null&&t.set(s.symbolId,a)}return t}function Ut(n,e){if(!qt(e,ze()))return null;let t=jt(n);return t?Bt(t,e):null}function Bt(n,e){return n.referencesBySymbol.get(e.symbol)??[]}function qt(n,e="safe"){if(!n.symbol.startsWith("rust-analyzer ")||!n.relativePath.endsWith(".rs")||pe(n.symbol)||/impl#\[[^\]]+\]\[Default\]default\(\)\.$/.test(n.symbol))return!1;if(e==="all")return!0;let t=Ne(n.symbol);if(t==="method")return!0;if(t!=="term")return!1;let r=Dt(n.symbol);return"kind"in r?!1:!xi(r)}function xi(n){for(let e=0;e<n.descriptors.length-1;e+=1)if(n.descriptors[e]?.suffix==="type")return!0;return!1}function jt(n){if(bn.has(n))return bn.get(n)??null;let e=Ci(n);return bn.set(n,e),e}function Ci(n){if(!n.generation.indexPath||!Ii(n.generation.indexPath))return null;try{let e=Mi(Te(n.generation.indexPath,{inputKind:"SCIP occurrence-reference index",maxBytes:Ce})),t=new Map;for(let r of e.documents??[]){let i=r.relativePath;if(!(!i||n.isIgnored(i)))for(let o of r.occurrences??[]){if(!o.symbol||(o.symbolRoles&vi.Definition)!==0)continue;let s=Ti(i,o.range);if(!s)continue;let a=t.get(o.symbol)??[];a.push(s),t.set(o.symbol,a)}}for(let[r,i]of t)t.set(r,We(i));return{referencesBySymbol:t}}catch{return null}}function Ti(n,e){if(e.length<3)return null;let t=e[0],r=e[1];return!Number.isInteger(t)||!Number.isInteger(r)?null:{file:n,line:t,column:r}}function ze(){return process.env[Di]==="all"?"all":"safe"}var Wt=new Map;function Rn(n){let t=je(n).resolvedBinary??null;return{engine:"rust-analyzer",resolvedBinary:t,version:t?ki(n,t):"unavailable"}}function hn(n){return{...Rn(n),scipOccurrenceReferenceMode:ze()}}function ki(n,e){let t=`${n}\0${e}`,r=Wt.get(t);if(r)return r;let i;try{i=wi(e,["--version"],{cwd:n,encoding:"utf8",stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:2e3}).trim()}catch{i="unknown"}return Wt.set(t,i),i}import{createHash as Pi}from"crypto";var Ei=new Set(["Cargo.lock","Cargo.toml","rust-project.json","rust-toolchain","rust-toolchain.toml"]);function zt(n){let e=Rt(n,{includePath:Ai});return Pi("sha256").update(JSON.stringify(e)).digest("hex")}function Ai(n){let e=n.replaceAll("\\","/"),t=e.split("/").at(-1)??e;return e.endsWith(".rs")||Ei.has(t)?!0:e===".cargo/config"||e===".cargo/config.toml"||e.endsWith("/.cargo/config")||e.endsWith("/.cargo/config.toml")}import{createHash as Fi}from"crypto";import{resolve as Ni}from"path";var te=3;function Mn(n){return Fi("sha256").update(me({kind:"codebaseiq-durable-rust-mailbox",protocolVersion:te,sessionDir:Ni(n)})).digest("hex")}function Vt(n,e){return le(n)?n.protocolVersion!==te?Ht(n.protocolVersion===void 0?"helper wrote a prior uncorrelated response protocol":`helper wrote unsupported response protocol ${String(n.protocolVersion)}`):n.mailboxVersion!==$||n.id!==e.requestId||n.operationKey!==e.operationKey||n.sessionIdentity!==e.sessionIdentity||n.deadlineAtMs!==e.deadlineAtMs?Ht("helper wrote an incompatible response identity"):typeof n.completedAtMs!="number"||!Number.isFinite(n.completedAtMs)||n.completedAtMs>e.deadlineAtMs||e.nowMs>e.deadlineAtMs?{ok:!1,code:"expired-request",error:"helper response arrived after the durable request deadline"}:n.ok===!1?typeof n.error!="string"||!Ui(n.errorCode)?In("helper wrote an invalid rejection response"):{ok:!1,code:n.errorCode,error:n.error}:n.ok!==!0||n.session!=="created"&&n.session!=="reused"&&n.session!=="invalidated"||!_i(n.response,e.requestKind)?In("helper wrote an invalid success response"):{ok:!0,session:n.session,response:n.response}:In("helper wrote an invalid response object")}function _i(n,e){return!le(n)||typeof n.available!="boolean"||n.available===!1&&(typeof n.reason!="string"||n.reason.length===0)||n.available===!0&&n.reason!==void 0?!1:e==="import-definitions"?Array.isArray(n.sourcePaths)&&n.sourcePaths.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&(t[1]===null||typeof t[1]=="string")):Kt(n.references,Li)&&(n.incompleteReferenceSymbolIds===void 0||Array.isArray(n.incompleteReferenceSymbolIds)&&n.incompleteReferenceSymbolIds.every(t=>Number.isSafeInteger(t)))&&(n.callees===void 0||Kt(n.callees,Oi))&&(n.signatures===void 0||Array.isArray(n.signatures)&&n.signatures.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&(t[1]===null||typeof t[1]=="string")))}function Kt(n,e){return Array.isArray(n)&&n.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&Array.isArray(t[1])&&t[1].every(e))}function Li(n){return le(n)&&typeof n.file=="string"&&N(n.line)&&N(n.column)}function Oi(n){return le(n)&&typeof n.symbol=="string"&&typeof n.file=="string"&&N(n.line)&&(n.callsiteLine===void 0||N(n.callsiteLine))}function Ui(n){return n==="unsupported-protocol"||n==="malformed-request"||n==="expired-request"||n==="handler-error"}function In(n){return{ok:!1,code:"malformed-response",error:n}}function Ht(n){return{ok:!1,code:"incompatible-response",error:n}}var Hi=5e3,Xt=10,Vi=3e4;function $t(n,e,t,r=rr){let i=r.engineIdentity(n),o={protocolVersion:te,projectRoot:r.canonicalProjectRoot(n),projectFingerprint:r.projectFingerprint(n),engine:{engine:i.engine,resolvedBinary:i.resolvedBinary,version:i.version},workerFingerprint:r.fileFingerprint(e),environment:er(r.environment())};return{key:ir(me(o)),...o}}function Ke(n,e,t,r){if(n.protocolVersion!==te||!t(n.pid))return!1;if(!n.processIdentity)return!0;let i=r?.(n.pid);return i!=null&&xe(n.processIdentity,i)}function Zt(n,e,t){let r;try{r=an(e,{maxBytes:H,inputKind:"Rust semantic engine artifact"})}catch{r="missing"}let i=ir(me({projectRoot:re(n),serverPath:re(e),serverFingerprint:r})).slice(0,20);return re(t,`codebaseiq-rust-session-${i}`)}function Yt(n){let e=n===void 0?Number.NaN:Number(n);return Number.isInteger(e)&&e>=0?e:0}function er(n){return Object.fromEntries(Object.entries(n).filter(([e])=>tr(e)).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,t??null]))}function nr(n,e){let t=e.runtime??Xi,r=e.identityRuntime??rr,i=Zt(n,e.serverPath,e.tempRoot??Ki()),o=!1,s=(a,c)=>{if(o)throw new Error("Durable Rust semantic session was already disposed.");return Yi(i,e.serverPath,e.semanticWorkerPath,a,c,t,e.mailboxLimits)};return{requestSemantic(a,c){let u=$t(n,e.semanticWorkerPath,a,r),{readinessDeadlineMs:f,...l}=a;return s({kind:"semantic",identityKey:u.key,workerEnvironment:Gt(),request:{...l,referenceRetryTimeoutMs:$i(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,a.referenceRetryTimeoutMs),settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?a.settleDelayMs:Yt(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:c},c)},requestImportDefinitions(a,c){let u=$t(n,e.semanticWorkerPath,a,r),{readinessDeadlineMs:f,...l}=a;return s({kind:"import-definitions",identityKey:u.key,workerEnvironment:Gt(),request:{...l,settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?a.settleDelayMs:Yt(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:c},c)},shutdown(){o=!0}}}function $i(n,e){return e!==void 0?e:n===void 0?Vi:void 0}function Yi(n,e,t,r,i,o,s={}){let a=o.now(),c=a+i,u=(o.monotonicNow??q)(),f=u+i,l=Z("rust-semantic-v3",r),d=ee(l),p=Le(n),m=Mn(n),R=Oe(p,{mailboxVersion:$,protocolVersion:te,id:d,operationKey:l,clientId:o.randomId(),enqueuedAtMs:a,deadlineAtMs:c,sessionIdentity:m,request:r},{nowMs:a,limits:s});for(Jt(n,e,t,f,o);(o.monotonicNow??q)()<=f;){if(Qt(R.responsePath)){let S=Ji(B(R.responsePath,{maxBytes:s.maxItemBytes??H,inputKind:"durable Rust semantic mailbox response"}),{requestId:d,operationKey:l,sessionIdentity:m,deadlineAtMs:R.authoritativeDeadlineAtMs,requestKind:r.kind,nowMs:o.now()});if(!S.ok)throw new Error(S.error);return _()&&Ae({type:"span",name:"rust.semantic.durable-session.request",durationMs:(o.monotonicNow??q)()-u,ok:!0,session:S.session,kind:r.kind}),S.response}let I=He(n);(!I||!Ke(I,o.now(),o.isProcessAlive,o.readProcessIdentity))&&Jt(n,e,t,f,o),o.sleep(Xt)}throw new Error(`Durable Rust semantic session timed out after ${(i/1e3).toFixed(0)}s.`)}function Jt(n,e,t,r,i){let o=He(n);if(o&&Ke(o,i.now(),i.isProcessAlive,i.readProcessIdentity))return;zi(re(n,"server.json"),{force:!0}),i.spawnServer(e,n,t);let s=i.monotonicNow??q,a=Math.min(r,s()+Hi);for(;s()<=a;){let c=He(n);if(c&&Ke(c,i.now(),i.isProcessAlive,i.readProcessIdentity))return;i.sleep(Xt)}throw new Error("Durable Rust semantic session helper did not become ready within 5s.")}function He(n){try{let e=JSON.parse(B(re(n,"server.json"),{maxBytes:at,inputKind:"durable Rust session state"}));if(typeof e.protocolVersion!="number"||e.sessionIdentity!==void 0&&(typeof e.sessionIdentity!="string"||e.sessionIdentity!==Mn(n))||typeof e.pid!="number"||typeof e.heartbeatAtMs!="number"||e.busyUntilMs!==void 0&&typeof e.busyUntilMs!="number"||e.mailbox!==void 0&&!Gi(e.mailbox))return null;let t=e.processIdentity===void 0?null:De(e.processIdentity);return e.processIdentity!==void 0&&(!t||t.pid!==e.pid)?null:{protocolVersion:e.protocolVersion,...e.sessionIdentity===void 0?{}:{sessionIdentity:e.sessionIdentity},pid:e.pid,...t?{processIdentity:t}:{},heartbeatAtMs:e.heartbeatAtMs,...e.busyUntilMs===void 0?{}:{busyUntilMs:e.busyUntilMs},...e.mailbox===void 0?{}:{mailbox:e.mailbox}}}catch{return null}}function Ji(n,e){try{return Vt(JSON.parse(n),e)}catch(t){return{ok:!1,code:"malformed-response",error:`helper wrote malformed JSON: ${t instanceof Error?t.message:String(t)}`}}}function Gi(n){if(!n||typeof n!="object")return!1;let e=n;return N(e.pending)&&N(e.inflight)&&N(e.responses)&&N(e.deadLetters)&&N(e.invalid)&&N(e.totalItems)&&typeof e.totalBytes=="number"&&Number.isFinite(e.totalBytes)&&e.totalBytes>=0&&(e.oldestPendingAt===void 0||Number.isFinite(Date.parse(e.oldestPendingAt)))}function Gt(){return Object.fromEntries(Object.entries(process.env).filter(([n])=>Qi(n)).sort(([n],[e])=>n.localeCompare(e)).map(([n,e])=>[n,e??null]))}function tr(n){return n==="HOME"||n==="PATH"||n.startsWith("CARGO_")||n.startsWith("RA_")||n.startsWith("RUST")}function Qi(n){return tr(n)||n.startsWith("SCIP_RUST_")||n==="CODEBASEIQ_PROFILE"||n==="CODEBASEIQ_PROFILE_CACHE_STATE"||n==="CODEBASEIQ_PROFILE_COMMAND"||n==="CODEBASEIQ_PROFILE_OUT"||n==="CODEBASEIQ_PROFILE_RUN_ID"||n==="CODEBASEIQ_PROFILE_WORKLOAD_IDENTITY"||n==="CODEBASEIQ_PROFILE_WORKLOAD_IDENTITY_KIND"||n==="CODEBASEIQ_PROFILE_MIN_MS"}var rr={canonicalProjectRoot(n){try{return Wi(n)}catch{return re(n)}},projectFingerprint(n){return zt(n)},engineIdentity:Rn,fileFingerprint(n){return an(n,{maxBytes:H,inputKind:"Rust semantic engine artifact"})},environment(){return er(process.env)}},Xi={now:Date.now,monotonicNow:q,randomId:ji,isProcessAlive:ke,readProcessIdentity:we,spawnServer(n,e,t){if(!Qt(n))throw new Error(`Durable Rust semantic session helper was not found at ${n}. Run npm run build first.`);Bi(process.execPath,[n,e,t],{detached:!0,stdio:"ignore",windowsHide:!0}).unref()},sleep(n){let e=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(e,0,0,n)}};function ir(n){return qi("sha256").update(n).digest("hex")}import{randomUUID as Xa}from"crypto";import{readdirSync as Zi,rmSync as ec,writeFileSync as nc}from"fs";import{join as eo}from"path";var no="rust-analyzer-owner-",to=".json",ro=16*1024;async function or(n,e){if(!n)return[];let t;try{t=Zi(n)}catch{return[]}let r=t.filter(s=>s.startsWith(no)&&s.endsWith(to)).map(s=>eo(n,s)),i=[],o=[];for(let s of r){let a=io(s);a?o.push(a):i.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return i.push(...await Promise.all(o.map(s=>kt(s,e)))),i}function io(n){try{let e=B(n,{maxBytes:ro,inputKind:"rust-analyzer process ownership record"}),t=JSON.parse(e),r=De(t.rootIdentity);return t.version!==1||!r||typeof t.ownsProcessGroup!="boolean"?null:{rootPid:r.pid,rootIdentity:r,ownsProcessGroup:t.ownsProcessGroup,knownMembers:new Map([[r.pid,r]])}}catch{return null}}var cr=15e3,lr=8,fr=5e3,lo=64,uo=96,Cn=class{constructor(e,t,r={}){this.projectRoot=e;this.status=t;this.opts=r;this.requester=r.requester??yo(e,process.env.SCIP_RUST_SEMANTIC_DURABLE_SESSION)}projectRoot;status;opts;requester;referencesForDefinitions(e){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:Se(t),references:ge(e)};try{let r=this.requestSession(t.resolvedBinary,e,{includeReferences:!0});return{...ye(r),resolvedBinary:t.resolvedBinary,references:K(e,new Map(r.references),new Set(r.incompleteReferenceSymbolIds??[]))}}catch(r){return this.opts.fallbackReferenceResolver?.referencesForDefinitions(e)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),references:ge(e)}}}calleesForDefinitions(e){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:Se(t),callees:be(e)};try{let r=this.requestSession(t.resolvedBinary,e,{includeReferences:!1,includeCallees:!0});return{...ye(r),resolvedBinary:t.resolvedBinary,callees:xn(e,new Map(r.callees??[]))}}catch(r){return this.opts.fallbackCalleeResolver?.calleesForDefinitions(e)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),callees:be(e)}}}referencesAndCalleesForDefinitions(e,t){let r=this.status(this.projectRoot);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Se(r),references:ge(e),callees:be(t)};let i=[...e,...t];try{let o=this.requestSession(r.resolvedBinary,i,{includeReferences:e.length>0,includeCallees:t.length>0,referenceDefinitions:e,calleeDefinitions:t});return{...ye(o),resolvedBinary:r.resolvedBinary,references:K(e,new Map(o.references),new Set(o.incompleteReferenceSymbolIds??[])),callees:xn(t,new Map(o.callees??[]))}}catch(o){return this.fallbackReferencesAndCallees(r,e,t,o)}}signaturesForDefinitions(e){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:Se(t),signatures:ur(e)};try{let r=this.requestSession(t.resolvedBinary,e,{includeReferences:!1,includeCallees:!1,includeSignatures:!0});return{...ye(r),resolvedBinary:t.resolvedBinary,signatures:ho(e,new Map(r.signatures??[]))}}catch(r){return this.opts.fallbackSignatureResolver?.signaturesForDefinitions(e)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),signatures:ur(e)}}}importDefinitionsForFile(e,t){let r=this.status(this.projectRoot);if(t.length===0)return r.available?{available:!0,resolvedBinary:r.resolvedBinary,sourcePaths:new Map}:{available:!1,reason:r.reason,resolvedBinary:r.resolvedBinary,sourcePaths:new Map};if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Se(r),sourcePaths:new Map(t.map(i=>[i.id,null]))};try{let i=this.requestImportDefinitions(r.resolvedBinary,e,t);return{...ye(i),resolvedBinary:r.resolvedBinary,sourcePaths:new Map(i.sourcePaths)}}catch(i){return{available:!1,resolvedBinary:r.resolvedBinary,reason:i instanceof Error?i.message:String(i),sourcePaths:new Map(t.map(o=>[o.id,null]))}}}dispose(){this.requester.shutdown()}requestSession(e,t,r){let i=Ve(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,cr),o=$e(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),s=Ve(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,lr),a=$e(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(i,1e4)),c=r.referenceDefinitions?[...r.referenceDefinitions]:void 0,u=r.calleeDefinitions?[...r.calleeDefinitions]:void 0,f=r.signatureDefinitions?[...r.signatureDefinitions]:void 0,l=Re(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,...r}),d={projectRoot:this.projectRoot,rustAnalyzerBinary:e,definitions:[...t],...c?{referenceDefinitions:c}:{},...u?{calleeDefinitions:u}:{},...f?{signatureDefinitions:f}:{},requestTimeoutMs:i,...r.includeReferences!==!1&&o>0?{referenceRetryTimeoutMs:o}:{},diagnosticsTimeoutMs:a,settleDelayMs:l,concurrency:s,includeReferences:r.includeReferences,includeCallees:r.includeCallees,includeSignatures:r.includeSignatures},p=Io(d);return k("rust.semantic.session.request",()=>this.requester.requestSemantic(d,Y(p,Tn(i,d.referenceRetryTimeoutMs),s)),()=>({definitions:t.length,operationDefinitions:p,referenceDefinitions:d.referenceDefinitions?.length,calleeDefinitions:d.calleeDefinitions?.length,signatureDefinitions:d.signatureDefinitions?.length,references:d.includeReferences!==!1,callees:d.includeCallees===!0,signatures:d.includeSignatures===!0,referenceRetryTimeoutMs:d.referenceRetryTimeoutMs}))}fallbackReferencesAndCallees(e,t,r,i){let o=t.length===0?{available:!0,resolvedBinary:e.resolvedBinary,references:ge(t)}:this.opts.fallbackReferenceResolver?.referencesForDefinitions(t),s=r.length===0?{available:!0,resolvedBinary:e.resolvedBinary,callees:be(r)}:this.opts.fallbackCalleeResolver?.calleesForDefinitions(r);if(o&&s){let a={resolvedBinary:o.resolvedBinary??s.resolvedBinary??e.resolvedBinary,references:K(t,o.references),callees:xn(r,s.callees)};return o.available&&s.available?{available:!0,...a}:{available:!1,reason:(o.available?void 0:o.reason)??(s.available?void 0:s.reason)??"Rust semantic fallback was unavailable.",...a}}return{available:!1,resolvedBinary:e.resolvedBinary,reason:i instanceof Error?i.message:String(i),references:ge(t),callees:be(r)}}requestImportDefinitions(e,t,r){let i=Ve(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,cr),o=Ve(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,lr),s=$e(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(i,1e4)),a=$e(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,fr),c={projectRoot:this.projectRoot,rustAnalyzerBinary:e,file:t,positions:[...r],requestTimeoutMs:i,diagnosticsTimeoutMs:s,settleDelayMs:a,concurrency:o};return k("rust.semantic.import-definitions.session.request",()=>this.requester.requestImportDefinitions(c,Y(r.length,i,o)),()=>({file:t,positions:r.length}))}};function ye(n){return n.available?{available:!0}:{available:!1,reason:n.reason}}function Se(n){return n.available?"rust-analyzer binary path is unavailable.":n.reason}function dr(n,e,t={}){return new Cn(n,e,t)}function Re(n,e){let t=mr(n);if(t!==null)return t;let r=e.includeReferences!==!1;return r&&e.includeCallees!==!0&&e.includeSignatures!==!0&&e.definitionCount<=lo||r&&e.includeCallees===!0&&e.includeSignatures!==!0&&e.definitionCount<=uo?0:fr}function fo(n){let e=n?.trim().toLowerCase(),t=e==="0"||e==="false"||e==="off"||e==="worker",r=e==="1"||e==="true"||e==="on"||e==="durable",i=e===void 0||e==="";return{transport:t||!i&&!r?"worker":"durable",source:i?"default":"environment",fallback:"worker",valid:i||t||r,optOut:"SCIP_RUST_SEMANTIC_DURABLE_SESSION=0"}}function po(n){return fo(n).transport}function mo(n,e){let t=null,r=!1,i=!1,o=!1,s=()=>t??=e(),a=()=>{i||(n.shutdown(),i=!0)},c=(f,l,d)=>{let p=Ro(f);r=!0;try{a()}catch{}_()&&Ae({type:"span",name:"rust.semantic.durable-session.request",durationMs:d,ok:!1,kind:l,session:"worker-fallback",reason:p})},u=(f,l,d)=>{if(o)throw new Error("Rust semantic failover session was already disposed.");if(r)return d(s());let p=performance.now();try{return l(n)}catch(m){c(m,f,performance.now()-p)}return d(s())};return{requestSemantic(f,l){return u("semantic",d=>d.requestSemantic(f,l),d=>d.requestSemantic(f,l))},requestImportDefinitions(f,l){return u("import-definitions",d=>d.requestImportDefinitions(f,l),d=>d.requestImportDefinitions(f,l))},shutdown(){if(o)return;o=!0;let f=[];try{a()}catch(l){f.push(l)}try{t?.shutdown()}catch(l){f.push(l)}if(f.length>0)throw f[0]}}}function yo(n,e,t={worker:()=>So(),durable:()=>nr(n,{serverPath:Ye(Mo()),semanticWorkerPath:Ye(pr())})}){return po(e)==="durable"?mo(t.durable(),t.worker):t.worker()}function So(n={}){let e=null,t=null,r=1,i=!1,o=null,s=null,a=l=>{l&&vn(l,{recursive:!0,force:!0})},c=()=>{if(o)return;let l=e,d=t;e=null,t=null;let p=l?l.terminate():Promise.resolve(0);o=Promise.allSettled([p,or(d,{gracefulMs:1e3,forceMs:1e3})]).then(([m,R])=>{let S=(R.status==="fulfilled"?R.value:[{reaped:!1,detail:String(R.reason)}]).filter(h=>!h.reaped);if(m.status==="rejected"||S.length>0){s=new Error(`Rust semantic worker cleanup did not complete; ownership evidence remains at ${d??"unknown"}.`);return}a(d)}).finally(()=>{o=null})},u=()=>{if(e)return e;if(o)throw new Error("The previous Rust semantic session worker is still terminating; retry the request.");if(s)throw s;let l=n.semanticWorkerPath?so(n.semanticWorkerPath):pr();if(!oo(Ye(l)))throw new Error(`Rust semantic session worker was not found at ${Ye(l)}. Run npm run build before using built semantic Rust queries.`);return t=sr(Dn(ar(),"codebaseiq-rust-session-")),e=new co(l,n.shareEnvironment?{env:ao}:void 0),e.unref(),e},f=()=>{let l=t??sr(Dn(ar(),"codebaseiq-rust-session-"));return t=l,Dn(l,`${r++}.json`)};return{requestSemantic(l,d){if(i)throw new Error("Rust semantic session was already disposed.");let p=u(),m=f(),R=new SharedArrayBuffer(4),I=new Int32Array(R);if(p.postMessage({kind:"semantic",request:l,responsePath:m,sharedBuffer:R}),Atomics.wait(I,0,0,d)==="timed-out")throw c(),new Error(`Rust semantic session worker timed out after ${(d/1e3).toFixed(0)}s`);try{let h=go(B(m,{maxBytes:H,inputKind:"Rust semantic worker response"}));if(!h.ok)throw new Error(h.error);return h.response}finally{vn(m,{force:!0})}},requestImportDefinitions(l,d){if(i)throw new Error("Rust semantic session was already disposed.");let p=u(),m=f(),R=new SharedArrayBuffer(4),I=new Int32Array(R);if(p.postMessage({kind:"import-definitions",request:l,responsePath:m,sharedBuffer:R}),Atomics.wait(I,0,0,d)==="timed-out")throw c(),new Error(`Rust semantic import-definition session worker timed out after ${(d/1e3).toFixed(0)}s`);try{let h=bo(B(m,{maxBytes:H,inputKind:"Rust import-definition worker response"}));if(!h.ok)throw new Error(h.error);return h.response}finally{vn(m,{force:!0})}},shutdown(){if(i)return;if(i=!0,!e){a(t),t=null;return}let l=f(),d=new SharedArrayBuffer(4),p=new Int32Array(d);e.postMessage({kind:"shutdown",responsePath:l,sharedBuffer:d}),Atomics.wait(p,0,0,5e3),c()}}}function go(n){let e=JSON.parse(n);if(!e||typeof e!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=e;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof e.error=="string"?e.error:"Rust semantic session worker failed."}}function bo(n){let e=JSON.parse(n);if(!e||typeof e!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=e;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof e.error=="string"?e.error:"Rust semantic session worker failed."}}function Ro(n){let e=n instanceof Error?`${n.name} ${n.message}`.toLowerCase():String(n).toLowerCase();return e.includes("readiness")?"readiness":e.includes("timeout")||e.includes("timed out")?"timeout":e.includes("helper")?"helper":"request"}function ge(n){return new Map(n.map(e=>[e.symbolId,[]]))}function be(n){return new Map(n.map(e=>[e.symbolId,[]]))}function ur(n){return new Map(n.map(e=>[e.symbolId,null]))}function xn(n,e){return new Map(n.map(t=>[t.symbolId,e.get(t.symbolId)??[]]))}function ho(n,e){return new Map(n.map(t=>[t.symbolId,e.get(t.symbolId)??null]))}function Io(n){let e=0;return n.includeReferences!==!1&&(e+=(n.referenceDefinitions??n.definitions).length),n.includeCallees===!0&&(e+=(n.calleeDefinitions??n.definitions).length),n.includeSignatures===!0&&(e+=(n.signatureDefinitions??n.definitions).length),Math.max(1,e)}function Tn(n,e){return e&&e>0?Math.max(n,e):n}function pr(){return new URL("./rust-semantic-session-worker.js",import.meta.url)}function Mo(){return new URL("./rust-semantic-session-server.js",import.meta.url)}function Ve(n,e){return X(n)??e}function $e(n,e){return mr(n)??e}function mr(n){if(!n)return null;let e=Number(n);return Number.isInteger(e)&&e>=0?e:null}var Pn=15e3,En=8;function br(n,e={}){let t=e.status??je,r=Co(n,t),i=To(n,t),o=wo(n,t),s=e.referenceResolver||e.calleeResolver||e.signatureResolver||!Do(e)?null:dr(n,t,{fallbackReferenceResolver:r,fallbackCalleeResolver:i,fallbackSignatureResolver:o}),a=e.referenceResolver??s??r,c=e.calleeResolver??s??i,u=e.signatureResolver??s??o,f=e.importUsageResolver??Lt(e.sourceImportUsageResolver??xo(),e.importDefinitionResolver??s),l=e.calleeSymbolResolver,d=e.sourceZeroCalleeOracle,p=e.scipOccurrenceCalleeOracle,m=new Map,R=new Map,I=null,S=null,h=()=>(I??=t(n),I),P=()=>{let b=h();return b.dependencyAvailable?S??b:b},M=b=>{if(b.length===0)return new Map;let y=Ie(b);try{let g=a.referencesForDefinitions(y),T=h();return S=Je(T,g),g.available?new Map(g.references):K(y,g.references)}catch(g){let T=h();return S=he(T,g),J(y)}},v=b=>{if(b.length===0)return new Map;let y=Ie(b),g=y.filter(yr);if(g.length===0)return G(y);let T=new Map,j=gr(g,p),F=[];for(let w of g)R.has(w.symbolId)?T.set(w.symbolId,R.get(w.symbolId)??[]):j.has(w.symbolId)?T.set(w.symbolId,j.get(w.symbolId)??[]):Sr(w,d)?T.set(w.symbolId,[]):F.push(w);if(F.length===0)return ie(y,T,void 0);try{let w=c.calleesForDefinitions(F),O=h();S=Je(O,w);let E=ie(F,w.callees,l);for(let[ce,rn]of E)T.set(ce,rn);return ie(y,T,void 0)}catch(w){let O=h();return S=he(O,w),G(y)}},C=(b,y)=>{let g=Ie(b),T=Ie(y),j=T.filter(yr),F=new Map,w=gr(j,p),O=[];for(let E of j)w.has(E.symbolId)?F.set(E.symbolId,w.get(E.symbolId)??[]):Sr(E,d)?F.set(E.symbolId,[]):O.push(E);if(g.length===0&&O.length===0)return{references:J(g),callees:ie(T,F,void 0)};try{let E=s?s.referencesAndCalleesForDefinitions(g,O):Ao(a,c,{referenceDefinitions:g,calleeDefinitions:O}),ce=h();S=Je(ce,E);let rn=E.available?new Map(E.references):K(g,E.references);for(let[on,sn]of E.callees)F.set(on,sn);let it=ie(T,F,l);for(let[on,sn]of it)R.set(on,sn);return{references:rn,callees:it}}catch(E){let ce=h();return S=he(ce,E),{references:J(g),callees:G(T)}}},D=b=>{if(b.length===0)return new Map;let y=Ie(b);try{let g=u.signaturesForDefinitions(y),T=h();return S=Je(T,g),Rr(y,g.signatures)}catch(g){let T=h();return S=he(T,g),Ge(y)}};return{language:"rust",availability:P,dispose:()=>{s?.dispose()},importUsage:b=>{let y=m.get(b);if(y)return y;try{let g=f.importUsage(b);return m.set(b,g),g}catch(g){let T=h();return S=he(T,g),[]}},referencesFor:b=>M([b]).get(b.symbolId)??[],referencesForDefinitions:M,referencesAndCalleesForDefinitions:C,calleesFor:b=>v([b]).get(b.symbolId)??[],calleesForDefinitions:v,signatureFor:b=>D([b]).get(b.symbolId)??null}}function Je(n,e){let t={dependencyAvailable:n.dependencyAvailable,resolvedBinary:e.resolvedBinary??n.resolvedBinary,...n.note?{note:n.note}:{}};return e.available?{available:!0,...t}:{available:!1,reason:e.reason,...t}}function he(n,e){return{available:!1,dependencyAvailable:n.dependencyAvailable,resolvedBinary:n.resolvedBinary,...n.note?{note:n.note}:{},reason:e instanceof Error?e.message:String(e)}}function Do(n){if(n.usePersistentSession!==void 0)return n.usePersistentSession;let e=process.env.SCIP_RUST_SEMANTIC_SESSION;return e!=="0"&&e!=="false"}function xo(){return{importUsageFacts:()=>({usage:[],positions:[]})}}function Ie(n){return n.map(e=>{let t=e;return{...e,leaf:typeof t.leaf=="string"?t.leaf:V(e.symbol),parentTypeName:t.parentTypeName??null,isFunctionLike:typeof t.isFunctionLike=="boolean"?t.isFunctionLike:xt(e.symbol),isTypeLike:t.isTypeLike??!1,kind:t.kind??null,documentation:t.documentation??null,enclosingSymbol:t.enclosingSymbol??null}})}function yr(n){return n.isFunctionLike}function Sr(n,e){if(!e)return!1;try{return e(n)}catch{return!1}}function gr(n,e){if(!e||n.length===0)return new Map;try{return e(n)}catch{return new Map}}function Co(n,e){return{referencesForDefinitions:t=>ko(n,e,t)}}function To(n,e){return{calleesForDefinitions:t=>Po(n,e,t)}}function wo(n,e){return{signaturesForDefinitions:t=>Eo(n,e,t)}}function ko(n,e,t){let r=e(n);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Nn(r),references:J(t)};let i=An();if(!kn(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,references:J(t)};let o=oe(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,Pn),s=Qe(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),a=oe(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,En),c=Qe(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(o,1e4)),u=Re(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,includeReferences:!0}),f={projectRoot:n,rustAnalyzerBinary:r.resolvedBinary,definitions:[...t],requestTimeoutMs:o,...s>0?{referenceRetryTimeoutMs:s}:{},diagnosticsTimeoutMs:c,settleDelayMs:u,concurrency:a},l=wn(process.execPath,[i],{cwd:n,input:JSON.stringify(f),encoding:"utf8",maxBuffer:50*1024*1024,windowsHide:!0,timeout:Y(t.length,Tn(o,f.referenceRetryTimeoutMs),a)}),d=_n(l.stdout);if(d)return{...Fn(d),resolvedBinary:r.resolvedBinary,references:K(t,new Map(d.references),new Set(d.incompleteReferenceSymbolIds??[]))};let p=l.error instanceof Error?l.error.message:l.stderr.trim()||`Rust semantic worker exited with status ${l.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:p,references:J(t)}}function Po(n,e,t){let r=e(n);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Nn(r),callees:G(t)};let i=An();if(!kn(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,callees:G(t)};let o=oe(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,Pn),s=oe(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,En),a=Qe(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(o,1e4)),c=Re(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,includeReferences:!1,includeCallees:!0}),u={projectRoot:n,rustAnalyzerBinary:r.resolvedBinary,definitions:[...t],requestTimeoutMs:o,diagnosticsTimeoutMs:a,settleDelayMs:c,concurrency:s,includeReferences:!1,includeCallees:!0},f=wn(process.execPath,[i],{cwd:n,input:JSON.stringify(u),encoding:"utf8",maxBuffer:50*1024*1024,windowsHide:!0,timeout:Y(t.length,o,s)}),l=_n(f.stdout);if(l)return{...Fn(l),resolvedBinary:r.resolvedBinary,callees:ie(t,new Map(l.callees??[]),void 0)};let d=f.error instanceof Error?f.error.message:f.stderr.trim()||`Rust semantic worker exited with status ${f.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:d,callees:G(t)}}function Eo(n,e,t){let r=e(n);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:Nn(r),signatures:Ge(t)};let i=An();if(!kn(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,signatures:Ge(t)};let o=oe(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,Pn),s=oe(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,En),a=Qe(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(o,1e4)),c=Re(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,includeReferences:!1,includeCallees:!1,includeSignatures:!0}),u={projectRoot:n,rustAnalyzerBinary:r.resolvedBinary,definitions:[...t],requestTimeoutMs:o,diagnosticsTimeoutMs:a,settleDelayMs:c,concurrency:s,includeReferences:!1,includeCallees:!1,includeSignatures:!0},f=wn(process.execPath,[i],{cwd:n,input:JSON.stringify(u),encoding:"utf8",maxBuffer:50*1024*1024,windowsHide:!0,timeout:Y(t.length,o,s)}),l=_n(f.stdout);if(l)return{...Fn(l),resolvedBinary:r.resolvedBinary,signatures:Rr(t,new Map(l.signatures??[]))};let d=f.error instanceof Error?f.error.message:f.stderr.trim()||`Rust semantic worker exited with status ${f.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:d,signatures:Ge(t)}}function Ao(n,e,t){let r=t.referenceDefinitions.length>0?n.referencesForDefinitions(t.referenceDefinitions):{available:!0,references:J(t.referenceDefinitions)},i=t.calleeDefinitions.length>0?e.calleesForDefinitions(t.calleeDefinitions):{available:!0,callees:G(t.calleeDefinitions)},o={resolvedBinary:r.resolvedBinary??i.resolvedBinary,references:r.references,callees:i.callees};return r.available&&i.available?{available:!0,...o}:{available:!1,reason:(r.available?void 0:r.reason)??(i.available?void 0:i.reason)??"Rust semantic resolution was unavailable.",...o}}function J(n){return new Map(n.map(e=>[e.symbolId,[]]))}function G(n){return new Map(n.map(e=>[e.symbolId,[]]))}function Ge(n){return new Map(n.map(e=>[e.symbolId,null]))}function ie(n,e,t){let r=0,i=0;return k("rust.semantic.callees.complete-map",()=>{let o=new Map;for(let s of n){let a=e.get(s.symbolId)??[];a.length>0&&(r+=1),i+=a.length,o.set(s.symbolId,a.map(c=>({...c,symbol:t?t(c):c.symbol})))}return o},()=>({definitions:n.length,rows:r,callees:i,resolveSymbols:!!t}))}function Rr(n,e){return new Map(n.map(t=>[t.symbolId,e.get(t.symbolId)??null]))}function An(){return vo(new URL("./rust-semantic-worker.js",import.meta.url))}function Fn(n){return n.available?{available:!0}:{available:!1,reason:n.reason}}function Nn(n){return n.available?"rust-analyzer binary path is unavailable.":n.reason}function _n(n){try{let e=JSON.parse(n);if(!e||typeof e!="object")return null;let t=e;if(typeof t.available!="boolean"||!Array.isArray(t.references)||t.available===!1&&typeof t.reason!="string"||t.available===!0&&t.reason!==void 0)return null;let r={references:t.references,incompleteReferenceSymbolIds:Array.isArray(t.incompleteReferenceSymbolIds)?t.incompleteReferenceSymbolIds.filter(i=>typeof i=="number"):void 0,callees:Array.isArray(t.callees)?t.callees:void 0,signatures:Array.isArray(t.signatures)?t.signatures:void 0};return t.available===!0?{available:!0,...r}:{available:!1,reason:String(t.reason),...r}}catch{return null}}function oe(n,e){return X(n)??e}function Qe(n,e){if(!n)return e;let t=Number(n);return Number.isInteger(t)&&t>=0?t:e}import{existsSync as Fo}from"fs";import{deserializeSCIP as No,SymbolRole as _o}from"@c4312/scip";var Ln=new WeakMap;function Ir(n,e){let t=e.filter(Lo);if(t.length===0)return new Map;let r=!1,i=0,o=0;return k("rust.scip-occurrence.callees",()=>{let s=Bo(n);if(r=!!s,!s)return new Map;let a=new Map;for(let c of t){let u=Oo(n,s,c);u!==null&&(a.set(c.symbolId,u),i+=1,o+=u.length)}return a},()=>({definitions:e.length,candidates:t.length,indexAvailable:r,resolvedDefinitions:i,resolvedCallees:o}))}function Lo(n){return!(!n.symbol.startsWith("rust-analyzer ")||!n.relativePath.endsWith(".rs")||!n.isFunctionLike||n.leaf==="main"||pe(n.symbol))}function Oo(n,e,t){let r=Fe(n,t.relativePath);if(!r||r.language!=="rust")return null;let i=r.callables.find(u=>u.startLine!==t.startLine||u.endLine!==t.endLine?!1:u.name===t.leaf||t.leaf.endsWith(u.name)||u.name.endsWith(t.leaf));if(!i)return null;let o=r.callSites.filter(u=>u.line>=i.startLine&&u.line<=i.endLine);if(o.length===0)return null;let s=(e.occurrencesByFile.get(t.relativePath)??[]).filter(u=>u.line>=i.startLine&&u.line<=i.endLine&&u.callee.symbol!==t.symbol);if(s.some(u=>u.traitImplMember)||!Uo(o,s))return null;let a=[],c=new Set;for(let u of s){let f=`${u.callee.symbol}\0${u.callee.file}\0${u.callee.line}`;c.has(f)||(c.add(f),a.push(u.callee))}return a}function Uo(n,e){let t=hr(n),r=hr(e);if(t.size!==r.size)return!1;for(let[i,o]of t)if(r.get(i)!==o)return!1;return!0}function hr(n){let e=new Map;for(let t of n){let r=t.calleeLeaf??t.leaf;if(!r)continue;let i=`${t.line}\0${r}`;e.set(i,(e.get(i)??0)+1)}return e}function Bo(n){if(Ln.has(n))return Ln.get(n)??null;let e=qo(n);return Ln.set(n,e),e}function qo(n){if(!n.generation.indexPath||!Fo(n.generation.indexPath))return null;try{let e=_e(n).filter(o=>o.symbol.startsWith("rust-analyzer ")&&o.relativePath.endsWith(".rs")&&o.isFunctionLike),t=new Map(e.map(o=>[o.symbol,o])),r=No(Te(n.generation.indexPath,{inputKind:"SCIP occurrence-callee index",maxBytes:Ce})),i=new Map;for(let o of r.documents??[]){let s=o.relativePath;if(!s||!s.endsWith(".rs")||n.isIgnored(s))continue;let a=[];for(let c of o.occurrences??[]){if(!c.symbol||(c.symbolRoles&_o.Definition)!==0)continue;let u=t.get(c.symbol);if(!u)continue;let f=c.range?.[0];Number.isInteger(f)&&a.push({line:f,leaf:u.leaf,traitImplMember:pe(u.symbol),callee:{symbol:u.symbol,file:u.relativePath,line:u.startLine,callsiteLine:f}})}i.set(s,a)}return{occurrencesByFile:i}}catch{return null}}var Xe=class{sessions=new WeakMap;getOrCreate(e,t,r){let i=jo(e,t),o=this.sessions.get(e);o||(o=new Map,this.sessions.set(e,o));let s=o.get(i);if(s)return s.hits+=1,s.lastUsedAtMs=Date.now(),s.provider;let a=Date.now(),c=r();return o.set(i,{key:i,language:t,projectRoot:e.config.projectRoot,provider:c,createdAtMs:a,lastUsedAtMs:a,hits:1}),c}sessionsFor(e){return[...this.sessions.get(e)?.values()??[]]}clear(e){let t=this.sessions.get(e);if(t)for(let r of t.values())r.provider.dispose?.();this.sessions.delete(e)}};function jo(n,e){return`${n.config.projectRoot}:${e}-workspace`}import{randomUUID as ps}from"crypto";import{existsSync as ms}from"fs";import{dirname as ys}from"path";function Mr(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.available!="boolean"||e.dependencyAvailable!==void 0&&typeof e.dependencyAvailable!="boolean"||e.tsconfigPath!==void 0&&typeof e.tsconfigPath!="string"||e.tsconfigPaths!==void 0&&(!Array.isArray(e.tsconfigPaths)||!e.tsconfigPaths.every(t=>typeof t=="string"))||e.resolvedBinary!==void 0&&typeof e.resolvedBinary!="string"||e.note!==void 0&&typeof e.note!="string")return null;if(e.available===!0){if(e.reason!==void 0)return null}else if(typeof e.reason!="string"||e.reason.length===0)return null;return e}import{performance as x}from"perf_hooks";function U(n,e,t){if(n.has(e))return n.get(e);let r=t();return n.set(e,r),r}import xr from"path";import{realpathSync as vr}from"fs";function Wo(n,e){return n.getReferences().map(t=>{let r=t.getNode();return Ze(r,e)})}function zo(n){let e=n;return typeof e.findReferences=="function"?e.findReferences():[]}function Cr(n,e,t,r){let i=[];for(let o of zo(n))for(let s of Wo(o,r))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||i.push(s);for(let o of t)i.push(o);return se(i)}function Tr(n,e,t,r){let i=[],o=t?.getStart();for(let s of n.getReferences()){let a=s.getNode();ae(r,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||i.push({location:Ze(a,r),node:a}))}return i}function Ze(n,e){let t=n.getSourceFile(),r=t.getLineAndColumnAtPos(n.getStart());return{file:ae(e,t.getFilePath())??t.getBaseName(),line:r.line-1,column:r.column-1}}function On(n,e,t){let r=n.getSourceFile(),i=Bn(r,n),o=n.getText(),s=new RegExp(`\\b${de(o)}\\b`,"g"),a=r.getFullText().split(`
2
- `),c=[];for(let u=0;u<a.length;u++){if(u===i)continue;let f=a[u]??"";s.lastIndex=0;let l;for(;(l=s.exec(f))!==null;)c.push({file:e,line:u,column:l.index})}return se(c.filter(u=>ae(t,xr.join(t,u.file))===e))}function Un(n){for(let e=n;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function Bn(n,e){return n.getLineAndColumnAtPos(e.getStart()).line-1}function se(n){let e=new Set,t=[];for(let r of n){let i=`${r.file}:${r.line}:${r.column}`;e.has(i)||(e.add(i),t.push(r))}return t}function ae(n,e){let t=n||process.cwd(),r=Dr(t,e);if(r)return r;try{return Dr(vr(t),vr(e))}catch{return null}}function Dr(n,e){let t=xr.relative(n,e).replace(/\\/g,"/");return!t||t===".."||t.startsWith("../")?null:t}function wr(n,e,t,r){let i=Ko(e,r);return i.size===0?new Map:Ho(n,t,i)}function Ko(n,e){let t=new Map;for(let r of z(n,e)){let i=V(r.symbol)??r.leaf;if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.push(r)}return t}function Ho(n,e,t){let r=new Map,i=new Map;return e.forEachDescendant(o=>{for(let s of Vo(n,o)){let a=t.get(s);if(!a)continue;let c=Bn(e,o);for(let u of a){if(c<u.startLine-1||c>u.endLine+1)continue;let f=Math.abs(c-u.startLine),l=i.get(u.symbolId);l!==void 0&&l<=f||(i.set(u.symbolId,f),r.set(u.symbolId,o))}}}),r}function Vo(n,e){let t=[],r=i=>{i&&!t.includes(i)&&t.push(i)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let i=e.getNameNode();r(i?.getText())}if("getName"in e&&typeof e.getName=="function"){let i=e.getName();r(i)}return n.Node.isIdentifier(e)&&r(e.getText()),t}var $o=lt("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function kr(n,e,t,r){let i=Wn(n,e),o=qn(i.get(r)??[],t);if(o)return o;let s=[];for(let a of i.values())for(let c of a)((c.leaf||V(c.symbol)||"").includes(r)||c.symbol.includes(r))&&s.push(c);return qn(s,t)}function jn(n,e,t,r){return qn(Wn(n,e).get(r)??[],t)}function Pr(n,e){let t=new Map;for(let[r,i]of Wn(n,e)){let o=i[0];o&&t.set(r,o)}return t}function Wn(n,e){return $o.get(n,e,()=>{let t=new Map;for(let r of z(n,e)){let i=r.leaf||V(r.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.push({...r,leaf:i})}for(let r of t.values())r.sort((i,o)=>i.startLine-o.startLine||i.endLine-o.endLine||i.symbolId-o.symbolId);return t})}function qn(n,e){let t=null,r=Number.POSITIVE_INFINITY;for(let i of n){let o=Math.abs(i.startLine-e);(o<r||o===r&&t&&i.startLine<t.startLine)&&(t=i,r=o)}return t}import Yo from"path";import{realpathSync as Jo}from"fs";function Er(n,e){let t=new Map,r=null,i=null,o=()=>(i??=Ee(n,{extensions:Ue}),i),s=()=>(r??=k("typescript.source-file-index",()=>Go(n.config.projectRoot,e,o()),()=>({projects:e.length,indexedDocuments:o().length})),r),a=c=>ne(c)?U(t,c,()=>{let u=Ar(n.config.projectRoot,c);if(!u)return null;for(let{project:f,sourceFiles:l}of s()){let d=l.get(u)??null;if(d||(d=f.addSourceFileAtPathIfExists(u)??null,d&&zn(l,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:o}}function Go(n,e,t){let r=e.map(({project:i})=>{let o=new Map;for(let s of i.getSourceFiles())zn(o,s);return{project:i,sourceFiles:o}});for(let i of t){let o=Ar(n,i);if(o)for(let s of r){if(s.sourceFiles.has(o))break;let a=s.project.addSourceFileAtPathIfExists(o)??null;if(a){zn(s.sourceFiles,a);break}}}return r}function zn(n,e){let t=Kn(e.getFilePath());n.set(t,e);try{n.set(Kn(Jo(t)),e)}catch(r){if(!fe(r))throw r}}function Ar(n,e){try{return Kn(gt(n,e,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(t){if(!fe(t))throw t;return null}}function Kn(n){return Yo.resolve(n)}function Hn(n,e){for(let t of n)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function Fr(n){let e=`${n.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}import{existsSync as Me}from"fs";import A from"path";var Vn=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function $n(n,e){let r=e?A.dirname(A.join(n,e)):n,i=A.resolve(n);for(;r.startsWith(i);){for(let s of Vn){let a=A.join(r,s);if(Me(a))return a}let o=A.dirname(r);if(o===r)break;r=o}for(let o of Vn){let s=A.join(n,o);if(Me(s))return s}return null}function Nr(n){let e=n.config.projectRoot,t=new Set(Qo(e,n.config.semantic?.typescript?.tsconfigs)),r=Ee(n,{includeIgnored:!1,extensions:Ue});for(let i of r){let o=$n(e,i);o&&t.add(A.resolve(o))}if(t.size===0){let i=$n(e);i&&t.add(A.resolve(i))}return[...t].filter(i=>!_r(e,i)).sort((i,o)=>i.localeCompare(o))}function Qo(n,e=[]){let t=new Set;for(let r of e){let i=A.isAbsolute(r)?r:A.join(n,r);Me(i)&&t.add(A.resolve(i))}for(let r of Xo(n))for(let i of Vn){let o=A.join(r,i);Me(o)&&t.add(A.resolve(o))}if(t.size===0){let r=$n(n);r&&t.add(A.resolve(r))}return[...t].filter(r=>!_r(n,r)).sort((r,i)=>r.localeCompare(i))}function Xo(n){let e=A.join(n,"package.json");if(!Me(e))return[];let t;try{t=JSON.parse(ct(e,"project package manifest"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(i=>mt(n,i))}function _r(n,e){let t=A.relative(n,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}function Yn(n,e){try{return n()}catch{e?.();return}}var Zo=32;function jr(n,e){let t=k("typescript.provider.load",()=>Et());if(!t)return Be("ts-morph is not installed");let r=k("typescript.provider.tsconfig-discovery",()=>Nr(n));if(r.length===0)return Be("no tsconfig found");try{let i=k("typescript.provider.project-bundles",()=>At(t,r),()=>({tsconfigs:r.length}));return es(n,t,i)}catch(i){return Be(i instanceof Error?i.message:String(i),r[0],r)}}function es(n,e,t,r={}){return k("typescript.provider.construct",()=>new Jn(n,e,t),()=>({tsconfigs:t.length,reusedProjects:r.reusedProjects===!0}))}var Jn=class{constructor(e,t,r){this.db=e;this.tsMorph=t;this.projects=r;this.workspacePackages=pt(e.config.projectRoot),this.sourceFiles=Er(e,r)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return U(this.importUsageCache,e,()=>{let t=this.sourceFiles.sourceFile(e);if(!t)return[];let r=ts();return k("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,t,r),()=>({file:e,...r}))})}referencesFor(e){return U(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,t)})}referencesForDefinitions(e,t={}){let r=new Map,i=_(),o=[];for(let f of e){let l=this.referencesCache.get(f.symbolId);l?r.set(f.symbolId,l):o.push(f)}if(o.length===0)return r;let s=o,a=t.exact?[]:o.filter(f=>!Or(f));if(a.length>=Zo){let f=this.referencesForDefinitionsBySymbolScan(a);if(f.incompleteFiles.size===0)for(let l of a){let d=f.references.get(l.symbolId)??[];this.referencesCache.set(l.symbolId,d),r.set(l.symbolId,d)}if(s=o.filter(l=>Or(l)),s.length===0)return r}let c=new Map;for(let f of s){let l=c.get(f.relativePath);l?l.push(f):c.set(f.relativePath,[f])}let u=[];for(let[f,l]of c){let d=Ur();k("typescript.references-map.file",()=>{let p=this.definitionNodesForFile(f);for(let m of l){i&&(d.cacheMisses+=1);let R=p.get(m.symbolId)??null;i&&(R?d.nodeHits+=1:d.nodeMisses+=1);try{let I=this.referencesForDefinitionNode(m,R,i?d:void 0);this.referencesCache.set(m.symbolId,I),r.set(m.symbolId,I)}catch{d.preciseSearchFailures+=1,u.push(m)}}},()=>({relativePath:f,definitions:l.length,...Br(d)}))}if(u.length>0){let f=this.referencesForDefinitionsBySymbolScan(u);if(f.incompleteFiles.size===0)for(let l of u){let d=f.references.get(l.symbolId)??[];this.referencesCache.set(l.symbolId,d),r.set(l.symbolId,d)}}return r}referenceFragmentsForFiles(e){let t=_e(this.db).filter(s=>ne(s.relativePath)),r=e.filter(s=>this.sourceFiles.sourceFile(s)!==null),i=this.referencesForDefinitionsBySymbolScan(t,r),o=r.filter(s=>!i.incompleteFiles.has(s));return Ft(t,i.references,o)}referencesForDefinitionsBySymbolScan(e,t){let r=_(),i=Ur(),o=new Map,s=new Set,a=new Set(e.map(u=>u.symbolId)),c=new Map(e.map(u=>[u.symbolId,u]));for(let u of e)o.set(u.symbolId,[]);return k("typescript.references-map.inverted-scan",()=>{let u=r?x.now():0,f=t?this.packageImportReferencesForFiles(t):this.packageImportReferences();for(let S of e){let h=f.get(S.symbolId)??[];if(h.length>0){let P=o.get(S.symbolId)??[];P.push(...h),o.set(S.symbolId,P)}r&&(i.packageReferenceCount+=h.length)}r&&(i.packageRefsMs+=x.now()-u);let l=new Map,d=new Map,p=this.hierarchyTargetsForDefinitions(e),m=new Set(e.map(S=>S.leaf).filter(Boolean)),R=r?x.now():0;for(let S of t??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(S))continue;let h=this.sourceFiles.sourceFile(S);if(!h)continue;r&&(i.scanFiles+=1),this.addReferencesFromSourceFileScan(h,S,a,c,p,m,l,d,o,r?i:void 0)||s.add(S)}r&&(i.scanMs+=x.now()-R);let I=r?x.now():0;this.addHierarchyMemberReferences(e,o,r?i:void 0),r&&(i.hierarchyMs+=x.now()-I);for(let[S,h]of o){let P=se(h);o.set(S,P),r&&(i.referenceCount+=P.length)}},()=>({definitions:e.length,...Br(i)})),{references:o,incompleteFiles:s}}addReferencesFromSourceFileScan(e,t,r,i,o,s,a,c,u,f){let l=this.compilerCheckerForSourceFile(e),d=e.compilerNode,p=os(e),m=!0,R=I=>{if(this.tsMorph.ts.isIdentifier(I)){if(f&&(f.identifiers+=1),!s.has(I.text)&&!p.has(I.text)){this.tsMorph.ts.forEachChild(I,R);return}let S=this.compilerReferenceSymbol(l,I,f,()=>{m=!1});if(S){let h;a.has(S)?h=a.get(S)??null:(h=this.referenceDefinitionFromCompilerSymbol(S),a.set(S,h)),f&&(h?f.targetHits+=1:f.targetMisses+=1);let P=U(c,S,()=>this.compilerSymbolKeys(S)),M=null,v=null,C=h&&r.has(h.symbolId)?i.get(h.symbolId):void 0;if(C&&(M=en(d,I),!Lr(C,t,M))){let D=d.getLineAndCharacterOfPosition(I.getStart(d));v={file:t,line:D.line,column:D.character};let b=u.get(C.symbolId)??[];b.push(v),u.set(C.symbolId,b),f&&(f.requestedHits+=1)}for(let D of P)for(let b of o.get(D)?.values()??[]){if(M??=en(d,I),Lr(b,t,M))continue;if(!v){let g=d.getLineAndCharacterOfPosition(I.getStart(d));v={file:t,line:g.line,column:g.character}}let y=u.get(b.symbolId)??[];y.push(v),u.set(b.symbolId,y),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(I,R)};return R(d),m}hierarchyTargetsForDefinitions(e){let t=new Map;for(let r of e){let i=this.nodeForDefinition(r),o=i?.compilerNode;if(!o||!this.isHierarchyMethod(o))continue;let s=o.parent;if(!this.isHierarchyContainer(s))continue;let a=this.compilerCheckerForSourceFile(i.getSourceFile()),c=a.getSymbolAtLocation(o.name);if(c)for(let u of this.hierarchyMemberSymbols(a,s,c))for(let f of this.compilerSymbolKeys(u)){let l=t.get(f)??new Map;l.set(r.symbolId,r),t.set(f,l)}}return t}hierarchyMemberSymbols(e,t,r){let i=new Set,o=new Set,s=(a,c,u)=>{if(!o.has(a)){o.add(a),i.add(c);for(let f of u){let l=f.getProperty(r.name);l&&s(f,l,this.hierarchyAncestorTypesForType(e,f))}}};return s(e.getTypeAtLocation(t),r,this.hierarchyAncestorTypes(e,t)),i}addHierarchyMemberReferences(e,t,r){let i=new Map;for(let o of e){let s=this.nodeForDefinition(o),a=s?.compilerNode;if(!a||!this.isHierarchyMethod(a))continue;let c=a.parent;if(!this.isHierarchyContainer(c))continue;let u=this.compilerCheckerForSourceFile(s.getSourceFile()),f=u.getSymbolAtLocation(a.name);if(!f)continue;let l=a.getSourceFile(),d=l.getLineAndCharacterOfPosition(a.name.getStart(l)),p={definition:o,location:{file:o.relativePath,line:d.line,column:d.character}},m=t.get(o.symbolId)??[];for(let I of this.hierarchyMemberSymbols(u,c,f))if(I!==f)for(let S of this.compilerSymbolLocations(I))m.push(S),r&&(r.hierarchyReferences+=1);t.set(o.symbolId,m);let R=this.hierarchyRootMemberSymbols(u,c,f);for(let I of R){let S=i.get(I)??new Map;S.set(o.symbolId,p),i.set(I,S)}r&&(r.hierarchyDefinitions+=1)}for(let o of i.values())if(!(o.size<2)){r&&(r.hierarchyFamilies+=1);for(let{definition:s}of o.values()){let a=t.get(s.symbolId)??[];for(let c of o.values())c.definition.symbolId!==s.symbolId&&(a.push(c.location),r&&(r.hierarchyReferences+=1));t.set(s.symbolId,a)}}}hierarchyRootMemberSymbols(e,t,r){let i=new Set,o=new Set,s=(a,c,u)=>{if(o.has(a))return;o.add(a);let f=!1;for(let l of u){let d=l.getProperty(r.name);d&&(f=!0,s(l,d,this.hierarchyAncestorTypesForType(e,l)))}if(!f)for(let l of this.compilerSymbolKeys(c))i.add(l)};return s(e.getTypeAtLocation(t),r,this.hierarchyAncestorTypes(e,t)),i}compilerSymbolKeys(e){return(e.declarations??[]).map(t=>{let r=t.getSourceFile();return`${r.fileName}\0${t.getStart(r)}\0${e.name}`})}compilerSymbolLocations(e){let t=[];for(let r of e.declarations??[]){let i=r.getSourceFile(),o=ae(this.db.config.projectRoot,i.fileName);if(!o)continue;let s=r.name,a=i.getLineAndCharacterOfPosition((s??r).getStart(i));t.push({file:o,line:a.line,column:a.character})}return t}baseTypes(e,t){try{return e.getBaseTypes(t)??[]}catch{return[]}}hierarchyAncestorTypes(e,t){let r=new Set(this.hierarchyAncestorTypesForType(e,e.getTypeAtLocation(t)));for(let i of t.heritageClauses??[])for(let o of i.types)r.add(e.getTypeAtLocation(o));return[...r]}hierarchyAncestorTypesForType(e,t){let r=new Set(this.baseTypes(e,t));for(let i of t.getSymbol()?.declarations??[])if(this.isHierarchyContainer(i))for(let o of i.heritageClauses??[])for(let s of o.types)r.add(e.getTypeAtLocation(s));return[...r]}isHierarchyMethod(e){return this.tsMorph.ts.isMethodDeclaration(e)||this.tsMorph.ts.isMethodSignature(e)}isHierarchyContainer(e){return this.tsMorph.ts.isClassDeclaration(e)||this.tsMorph.ts.isClassExpression(e)||this.tsMorph.ts.isInterfaceDeclaration(e)}compilerReferenceSymbol(e,t,r,i){r&&(r.symbolLookups+=1);let o=Yn(()=>e.getSymbolAtLocation(t),i);if(o){if((o.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return o;try{return r&&(r.aliasResolutions+=1),e.getAliasedSymbol(o)}catch{return i?.(),o}}}calleesFor(e){if(this.calleesCache.has(e.symbolId))return this.calleesCache.get(e.symbolId)??[];let t=U(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath));if(t.incompleteSymbolIds.has(e.symbolId))throw new Error(`TypeScript callee evidence is incomplete for ${e.symbol}.`);let r=t.callees.get(e.symbolId)??[];return this.calleesCache.set(e.symbolId,r),r}calleesForDefinitions(e){let t=new Map,r=new Map;for(let i of e){if(this.calleesCache.has(i.symbolId)){t.set(i.symbolId,this.calleesCache.get(i.symbolId)??[]);continue}let o=r.get(i.relativePath);o?o.push(i):r.set(i.relativePath,[i])}for(let[i,o]of r){let s=this.fileCalleesCache.get(i),a=new Set(o.map(u=>u.symbolId)),c=s??this.calleeMapForFile(i,a);for(let u of o){if(c.incompleteSymbolIds.has(u.symbolId))continue;let f=c.callees.get(u.symbolId)??[];this.calleesCache.set(u.symbolId,f),t.set(u.symbolId,f)}}return t}referencesForDefinitionNode(e,t,r){let i=r?x.now():0,o=this.packageImportReferencesForDefinition(e);if(r&&(r.packageRefsMs+=x.now()-i,r.packageReferenceCount+=o.length),!t)return o;let s=r?x.now():0,a=Cr(t,e,o,this.db.config.projectRoot);return r&&(r.semanticRefsMs+=x.now()-s,r.referenceCount+=a.length),a}signatureFor(e){return U(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let r=t.getType().getCallSignatures()[0];if(!r)return null;let i=r.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return qr(c)}),o=r.getReturnType().getText(t);return`(${i.join(",")})=>${qr(o)}`})}importUsageForSourceFile(e,t,r){let i=[],o=new Map;for(let s of t.getImportDeclarations()){r.declarations+=1;let a=ln(this.db,e,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let u of Gn(s)){r.entries+=1;let f=c?null:u.identifier?.getSymbol()?.compilerSymbol??null;!c&&u.identifier&&(f?r.bindingSymbols+=1:r.missingBindingSymbols+=1);let l={sourcePath:a,entry:u,typeOnlyDeclaration:c,bindingSymbol:f,references:[]};if(i.push(l),c||!u.localName||!f)continue;let d=o.get(u.localName);d?d.push(l):o.set(u.localName,[l])}}return o.size>0&&t.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=o.get(s.getText());if(!a||rs(s))return;r.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(r.symbolLookups+=1,!!c){for(let u of a)if(u.bindingSymbol===c){u.references.push({location:Ze(s,this.db.config.projectRoot),node:s}),r.matchedReferences+=1;break}}}),i.map(s=>s.typeOnlyDeclaration?ns(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(r.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,t,r){let i;try{i=r.identifier?r.identifier.findReferences():[]}catch{let s=r.identifier?On(r.identifier,e,this.db.config.projectRoot):[];return{importer:e,sourcePath:t,importedName:r.importedName,localName:r.localName,kind:r.kind,isTypeOnly:r.isTypeOnly,isUsed:r.isTypeOnly||s.length>0,isTypeUsed:r.isTypeOnly,isValueUsed:!r.isTypeOnly&&s.length>0,references:s}}let o=[];for(let s of i)for(let a of Tr(s,e,r.identifier,this.db.config.projectRoot))o.push(a);return this.valueImportUsageFromLocations(e,t,r,o)}valueImportUsageFromLocations(e,t,r,i){let o=i.some(c=>!Un(c.node)),s=i.some(c=>Un(c.node)),a=r.isTypeOnly;return{importer:e,sourcePath:t,importedName:r.importedName,localName:r.localName,kind:r.kind,isTypeOnly:a,isUsed:a||i.length>0,isTypeUsed:a||s,isValueUsed:o,references:i.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferencesForFiles(e){let t=new Map,r=new Set;for(let o of e){let s=this.sourceFiles.sourceFile(o);if(s)for(let a of s.getImportDeclarations()){let c=Hn(this.workspacePackages,a.getModuleSpecifierValue());c&&r.add(c)}}if(r.size===0)return t;let i=this.packageExportsForNames(r);for(let o of e)this.addPackageImportReferencesForDocument(t,i,o);for(let[o,s]of t)t.set(o,se(s));return t}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let r of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,r);for(let[r,i]of e)e.set(r,se(i));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,t,r){if(this.db.isIgnored(r))return;let i=this.sourceFiles.sourceFileMatch(r);if(i)for(let o of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,r,o)}addPackageImportReferencesForDeclaration(e,t,r,i){let o=Hn(this.workspacePackages,i.getModuleSpecifierValue());if(!o)return;let s=t.get(o);if(s)for(let a of Gn(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let u=On(a.identifier,r,this.db.config.projectRoot);u.length>0&&ls(e,c,u)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(e=>e.name))),this.packageExportIndex)}packageExportsForNames(e){let t=new Map;for(let r of this.workspacePackages){if(!e.has(r.name))continue;let i=new Map;for(let o of Fr(r))this.collectPackageExports(r,o,i,new Set);i.size>0&&t.set(r.name,i)}return t}collectPackageExports(e,t,r,i){if(i.has(t))return;i.add(t);let o=this.sourceFiles.sourceFile(t);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?ln(this.db,t,a):t;if(!c||!c.startsWith(`${e.relativeDir}/src/`))continue;let u=s.getNamedExports();if(u.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,r,i);continue}for(let f of u){let l=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??l,p=this.indexedDefinitionByLeaf(c,l);if(!p)continue;let m=r.get(d);m||(m=new Set,r.set(d,m)),m.add(p.symbolId)}}}indexedDefinitionByLeaf(e,t){return U(this.indexedDefinitionLeafCache,e,()=>Pr(this.db,e)).get(t)??null}nodeForDefinition(e){return U(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return U(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFiles.sourceFile(e);return t?wr(this.tsMorph,this.db,t,e):new Map})}referenceDefinitionFromCompilerSymbol(e){return this.definitionFromCompilerSymbol(e,void 0,!0)}definitionFromCompilerSymbol(e,t,r=!1){let i=e.name,o=t?x.now():0,s=e.declarations??[];t&&(t.declarationsMs+=x.now()-o,t.declarationChecks+=s.length);for(let a of s){let c=t?x.now():0,u=a.getSourceFile(),f=ae(this.db.config.projectRoot,u.fileName),l=u.getLineAndCharacterOfPosition(a.getStart(u)).line;if(t&&(t.declarationLocationMs+=x.now()-c),!f||this.db.isIgnored(f))continue;let d=t?x.now():0,p=this.compilerDeclarationName(a),m=r?jn(this.db,f,l,i)??(p&&p!==i?jn(this.db,f,l,p):null):kr(this.db,f,l,i);if(t&&(t.indexedLookupMs+=x.now()-d),m)return{symbolId:m.symbolId,symbol:m.symbol,file:m.relativePath,line:m.startLine}}return null}compilerDeclarationName(e){let t=e.name;return t&&this.tsMorph.ts.isIdentifier(t)?t.text:null}calleeMapForFile(e,t){let r=_(),i=0,o=0,s=0,a=0,c=0,u=0,f=0,l=0,d=r?as():void 0;return k("typescript.callee-map.file",()=>{let p=r?x.now():0,m=this.sourceFiles.sourceFile(e);if(r&&(c=Math.round(x.now()-p)),!m)return{callees:new Map,incompleteSymbolIds:new Set};let R=r?x.now():0,I=z(this.db,e).sort((y,g)=>y.startLine-g.startLine||g.endLine-y.endLine);if(r&&(u=Math.round(x.now()-R)),i=I.length,I.length===0)return{callees:new Map,incompleteSymbolIds:new Set};let S=new Map,h=new Set,P=r?x.now():0,M=this.compilerCheckerForSourceFile(m),v=m.compilerNode;r&&(f=Math.round(x.now()-P));let C=new Map,D=y=>{if(this.tsMorph.ts.isCallExpression(y)||this.tsMorph.ts.isNewExpression(y)){r&&(o+=1);let g=this.semanticCalleeForCallNode(M,v,I,y,C,t,h,d);g&&(r&&(s+=1),is(S,g.callerId,g.target))}this.tsMorph.ts.forEachChild(y,D)},b=r?x.now():0;D(v),r&&(l=Math.round(x.now()-b));for(let[y,g]of S)S.set(y,us(g));return a=S.size,{callees:S,incompleteSymbolIds:h}},()=>({relativePath:e,definitions:i,callNodes:o,resolvedCallees:s,outputRows:a,requestedDefinitions:t?.size??i,sourceFileLookupMs:c,definitionsLoadMs:u,checkerLookupMs:f,traversalMs:l,...d?cs(d):{}}))}semanticCalleeForCallNode(e,t,r,i,o,s,a,c){let u=c?x.now():0,f=ss(r,en(t,i));if(c&&(c.callerLookupMs+=x.now()-u),!f)return null;if(s&&!s.has(f.symbolId))return c&&(c.skippedUnrequestedCallers+=1),null;let l=i.expression,d=this.compilerSymbolForExpression(e,l,c);d.incomplete&&a?.add(f.symbolId);let p=d.symbol,m=null;if(p)if(c&&(c.targetSymbolHits+=1),o.has(p))c&&(c.compilerSymbolCacheHits+=1),m=o.get(p)??null;else{c&&(c.compilerSymbolCacheMisses+=1);let R=c?x.now():0;m=this.definitionFromCompilerSymbol(p,c),c&&(c.targetLookupMs+=x.now()-R),o.set(p,m)}else c&&(c.targetMisses+=1);return m?{callerId:f.symbolId,target:{symbol:m.symbol,file:m.file,line:m.line,callsiteLine:en(t,i)}}:null}compilerSymbolForExpression(e,t,r){let i=!1,o=r?x.now():0,s=Yn(()=>e.getSymbolAtLocation(t),()=>{i=!0});if(r&&(r.expressionSymbolMs+=x.now()-o),s)return{symbol:s,incomplete:!1};r&&(r.typeFallbacks+=1);let a=!1,c=r?x.now():0,u=Yn(()=>e.getTypeAtLocation(t).getSymbol(),()=>{a=!0});return r&&(r.typeSymbolMs+=x.now()-c),{symbol:u,incomplete:!u&&(i||a)}}compilerCheckerForSourceFile(e){let t=e.getProject(),r=this.compilerCheckerCache.get(t);return r||(r=t.getTypeChecker().compilerObject,this.compilerCheckerCache.set(t,r)),r}};function Gn(n){let e=[],t=n.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:n.getImportClause()?.isTypeOnly()??!1});let r=n.getNamespaceImport();r&&e.push({identifier:r,importedName:"*",localName:r.getText(),kind:"namespace",isTypeOnly:n.getImportClause()?.isTypeOnly()??!1});for(let i of n.getNamedImports()){let o=i.getNameNode(),a=i.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(n.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function ns(n,e,t){return{importer:n,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function ts(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function rs(n){for(let e=n;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function is(n,e,t){let r=n.get(e);r||(r=[],n.set(e,r)),r.push(t)}function os(n){let e=new Set;for(let t of n.getImportDeclarations())for(let r of Gn(t))r.localName&&e.add(r.localName);return e}function ss(n,e){let t=null;for(let r of n)e<r.startLine||e>r.endLine||(!t||r.startLine>=t.startLine)&&(t=r);return t}function en(n,e){return n.getLineAndCharacterOfPosition(e.getStart(n)).line}function Lr(n,e,t){return e===n.relativePath&&t>=n.startLine&&t<=n.endLine}function Or(n){return n.symbol.includes("#")?Ne(n.symbol)==="type"&&n.relativePath.endsWith(".d.ts"):!1}function as(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function cs(n){return{...n,callerLookupMs:Math.round(n.callerLookupMs),expressionSymbolMs:Math.round(n.expressionSymbolMs),typeSymbolMs:Math.round(n.typeSymbolMs),targetLookupMs:Math.round(n.targetLookupMs),declarationsMs:Math.round(n.declarationsMs),declarationLocationMs:Math.round(n.declarationLocationMs),indexedLookupMs:Math.round(n.indexedLookupMs)}}function Ur(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function Br(n){return{...n,scanMs:Math.round(n.scanMs),packageRefsMs:Math.round(n.packageRefsMs),semanticRefsMs:Math.round(n.semanticRefsMs),hierarchyMs:Math.round(n.hierarchyMs)}}function ls(n,e,t){for(let r of e){let i=n.get(r)??[];i.push(...t),n.set(r,i)}}function us(n){let e=new Set,t=[];for(let r of n){let i=`${r.symbol}|${r.file}|${r.line}|${r.callsiteLine??""}`;e.has(i)||(e.add(i),t.push(r))}return t}function qr(n){return n.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}import{join as fs}from"path";var nn=4;var ds="typescript-semantic";function Wr(n){let e=fs(n,ds),t=Le(e);return{...t,requestDir:t.legacyRequestDir}}var Ss=12e4,gs=5;function Vr(n,e,t={}){let r=new Qn(n,t),i=null,o=null,s=process.env.CODEBASEIQ_SKIP_WATCH_SERVICE==="1",a=()=>(i??=jr(n,e),i),c=(l,d,p)=>{if(s)return p();try{return d(r.request(l))}catch{return s=!0,p()}},u=(l,d)=>c({kind:"references",definitions:[...l],...d?.exact?{exact:!0}:{}},p=>Hr(p),()=>a().referencesForDefinitions?.(l,d)??new Map(l.map(p=>[p.symbolId,a().referencesFor(p)]))),f=l=>c({kind:"callees",definitions:[...l]},d=>Hr(d),()=>a().calleesForDefinitions?.(l)??new Map(l.map(d=>[d.symbolId,a().calleesFor(d)])));return{language:"typescript",availability:()=>(o??=c({kind:"availability"},hs,()=>a().availability()),o),importUsage:l=>c({kind:"import-usage",file:l},d=>d,()=>a().importUsage(l)),referencesFor:l=>zr(u([l]),l,"reference"),referencesForDefinitions:u,referenceFragmentsForFiles:l=>c({kind:"reference-fragments",files:[...l]},d=>Rs(d),()=>a().referenceFragmentsForFiles?.(l)??new Map),calleesFor:l=>zr(f([l]),l,"callee"),calleesForDefinitions:f,signatureFor:l=>c({kind:"signature",definition:l},Is,()=>a().signatureFor(l)),dispose:()=>i?.dispose?.()}}function zr(n,e,t){if(!n.has(e.symbolId))throw new Error(`TypeScript ${t} evidence is incomplete for ${e.symbol}.`);return n.get(e.symbolId)}var Qn=class{constructor(e,t={}){this.db=e;this.runtime=t.runtime??vs,this.timeoutMs=t.timeoutMs??Ms(),this.mailboxLimits=t.mailboxLimits??{},this.cacheDir=ys(e.config.dbPath),this.projectRoot=St(e.config.projectRoot)}db;runtime;timeoutMs;cacheDir;projectRoot;mailboxLimits;request(e){let t=Pt(this.cacheDir),r=Wr(this.cacheDir),i=dn(t.statePath);if(!Kr(i,this.projectRoot,this.runtime))throw new Error("Compatible TypeScript semantic service is not running.");let o=this.db.generation.identity;if(!o)throw new Error("Published TypeScript generation identity is unavailable.");let s=this.runtime.now(),a=s+this.timeoutMs,c=(this.runtime.monotonicNow??q)()+this.timeoutMs,u=yt(),f=Z("typescript-semantic-v4",{generation:o,profileEnvironment:u,request:e}),l=ee(f),d=Oe(r,{mailboxVersion:$,operationKey:f,clientId:this.runtime.randomId(),enqueuedAtMs:s,deadlineAtMs:a,protocolVersion:nn,id:l,generation:o,profileEnvironment:u,request:e},{nowMs:s,limits:this.mailboxLimits});for(;(this.runtime.monotonicNow??q)()<=c;){if(ms(d.responsePath))return bs(B(d.responsePath,{maxBytes:this.mailboxLimits.maxItemBytes??64*1024*1024,inputKind:"TypeScript semantic mailbox response"}),l,o,f);let p=dn(t.statePath);if(!Kr(p,this.projectRoot,this.runtime))throw new Error("TypeScript semantic service stopped while processing a request.");this.runtime.sleep(gs)}throw new Error(`TypeScript semantic service timed out after ${this.timeoutMs}ms.`)}};function Kr(n,e,t){let r=n?.processIdentity?t.readProcessIdentity?.(n.pid):null;return n!==null&&n.projectRoot===e&&n.typescriptSemantic?.protocolVersion===nn&&t.isProcessAlive(n.pid)&&(!n.processIdentity||r!=null&&xe(n.processIdentity,r))}function bs(n,e,t,r){let i=JSON.parse(n);if(i.protocolVersion!==nn||i.id!==e||i.operationKey!==r||i.ok===!0&&i.generation!==t)throw new Error("TypeScript semantic service wrote an incompatible response.");if(i.ok===!0)return i.response;throw new Error(typeof i.error=="string"?i.error:"TypeScript semantic service request failed.")}function Hr(n){if(!Array.isArray(n))throw new Error("TypeScript semantic service wrote an invalid numeric map.");return new Map(n)}function Rs(n){if(!Array.isArray(n))throw new Error("TypeScript semantic service wrote an invalid string map.");return new Map(n)}function hs(n){let e=Mr(n);if(!e)throw new Error("TypeScript semantic service wrote invalid availability.");return e}function Is(n){if(n!==null&&typeof n!="string")throw new Error("TypeScript semantic service wrote an invalid signature.");return n}function Ms(){let n=Number(process.env.SCIP_TYPESCRIPT_SEMANTIC_TIMEOUT_MS);return Number.isInteger(n)&&n>0?n:Ss}var vs={now:Date.now,monotonicNow:q,randomId:ps,sleep(n){let e=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(e,0,0,n)},isProcessAlive:ke,readProcessIdentity:we};var Xn=new Xe;ot({name:"semantic-provider",groups:["semantic-provider"],clearAll:n=>Xn.clear(n)});st({name:"semantic-provider",close:n=>Xn.clear(n)});function Q(n,e){let t=L(e)??"typescript";return Xn.getOrCreate(n,t,()=>t==="rust"?br(n.config.projectRoot,{sourceImportUsageResolver:{importUsageFacts:r=>_t(n,r)},calleeSymbolResolver:Nt(n),sourceZeroCalleeOracle:r=>Ds(n,r),scipOccurrenceCalleeOracle:r=>Ir(n,r)}):Vr(n,e))}function L(n){return n?ht(n)==="rust"?"rust":ne(n)?"typescript":null:"typescript"}function Ds(n,e){let t=Fe(n,e.relativePath);if(!t||t.language!=="rust")return!1;let r=t.callables.find(i=>i.startLine===e.startLine&&i.endLine===e.endLine&&i.name===e.leaf)??t.callables.find(i=>i.startLine===e.startLine&&i.endLine===e.endLine);return r?!t.callSites.some(i=>i.line>=r.startLine&&i.line<=r.endLine):!1}var xs=/^[A-Za-z_][A-Za-z0-9_]*$/,$r=/\bDefault::default\b/g,Cs=/^\.\.\s*Default::default\b/;function Yr(n,e){let t=new Map,r=new Map;for(let i of e){let o=Zn(n,i,r);o!==null&&t.set(i.symbolId,o)}return t}function Zn(n,e,t=new Map){let r=ws(e.symbol);if(!r)return null;let i=Ct(n,[e.symbolId]);if(i.length===0)return null;let o=new RegExp(`(^|[^A-Za-z0-9_])${de(r)}::default\\b`,"g"),s=new RegExp(`(^|[^A-Za-z0-9_])${de(r)}\\s*$`),a=Ts(n,e.symbolId),c=[];for(let u of i){let f=ks(n,u.relative_path,t);if(f===null)return null;let l=f.split(/\r?\n/),d=0,p=[],m=0;for(let R=u.chunk_start;R<=u.chunk_end&&R<l.length;R+=1){let S=l[R]??"",h=new Set;o.lastIndex=0;let P;for(;P=o.exec(S);)c.push({file:u.relative_path,line:R,column:P.index+P[1].length+r.length+2}),m+=1;for(let M=0;M<S.length;M+=1){let v=Cs.exec(S.slice(M));if(v){if(a&&p.includes(d)){let D=M+v[0].lastIndexOf("default");c.push({file:u.relative_path,line:R,column:D}),h.add(D),m+=1}M+=v[0].length-1;continue}let C=S[M];if(C==="{"){let D=s.test(S.slice(0,M));d+=1,D&&p.push(d);continue}if(C==="}")for(d=Math.max(0,d-1);p.length>0&&p[p.length-1]>d;)p.pop()}for($r.lastIndex=0;P=$r.exec(S);){let M=P.index+9;if(!h.has(M))return null}}if(m===0)return null}return We(c)}function Ts(n,e){return n.get("SELECT 1 AS present FROM mentions WHERE symbol_id = ? AND role = 1 LIMIT 1",e)?.present===1}function ws(n){let e=/impl#\[([^\]]+)\]\[Default\]default\(\)\./.exec(n)?.[1]??null;return!e||!xs.test(e)?null:e}function ks(n,e,t){if(t.has(e))return t.get(e)??null;let r=n.get("SELECT text FROM documents WHERE relative_path = ?",e),i=typeof r?.text=="string"?r.text:Ps(n,e);return t.set(e,i),i}function Ps(n,e){try{return bt(n.config.projectRoot,e,{inputKind:"indexed Rust source file"})}catch(t){if(!fe(t))throw t;return null}}function Jr(n){let e=new Map;for(let t of n){let r=e.get(t.relativePath)??[];r.push(t),e.set(t.relativePath,r)}return e}var tn=new WeakMap;function Du(n){tn.delete(n)}function xu(n){let e=tn.get(n);return{incompleteSymbolIds:new Set(e?.incompleteSymbolIds),unavailableSymbolIds:new Set(e?.unavailableSymbolIds)}}function tt(n,e){if(e.incompleteSymbolIds.size===0&&e.unavailableSymbolIds.size===0)return;let t=tn.get(n)??{incompleteSymbolIds:new Set,unavailableSymbolIds:new Set};for(let r of e.incompleteSymbolIds)t.incompleteSymbolIds.add(r);for(let r of e.unavailableSymbolIds)t.unavailableSymbolIds.add(r);tn.set(n,t)}var Es="typescript-import-usage-v1",As="typescript-signatures-v1",et=ut("semantic-prefetched-callees",{clearGroups:["whole-project","source-file","semantic-provider"]}),Gr=fn({kind:"semantic-import-usage",invalidation:ue("semantic-import-usage"),serialize:n=>JSON.stringify(n),deserialize:ai}),Qr=fn({kind:"semantic-signatures",invalidation:ue("semantic-signatures"),serialize:n=>JSON.stringify(n),deserialize:js}),Xr=un({kind:"typescript-import-usage",invalidation:ue("typescript-import-usage"),serialize:n=>JSON.stringify(n),deserialize:ai}),Zr=un({kind:"typescript-signatures",invalidation:ue("typescript-signatures"),serialize:n=>JSON.stringify(n),deserialize:Ws});function rt(n){let e=new Map,t=new Set;return{capability:(r,i)=>ci(n,r,i),importUsage:r=>Ns(n,r),references:r=>ni(n,r),materializeReferences:(r,i)=>ti(n,r,e,t,i),callerMap:r=>Ls(n,r,e,t),calleeMap:r=>oi(n,r),signature:r=>Bs(n,r)}}function Fs(n,e){if(e.size===0)return;let t=et.get(n,()=>new Map);for(let[r,i]of e)t.set(r,[...i])}function Cu(n,e){if(!et.has(n))return{hits:[],misses:[...e]};let t=et.get(n,()=>new Map),r=[],i=[];for(let o of e)t.has(o.symbolId)?r.push({definition:o,callees:t.get(o.symbolId)??[]}):i.push(o);return{hits:r,misses:i}}function Tu(n,e){return rt(n).importUsage(e)}function Ns(n,e){if(L(e)==="typescript"){let o="fallback",s=0,a=0,c=0,u=0;return k("typescript.import-usage.materialize",()=>{let f=pn(n,e,Es);if(f?.key){s=1;let d=Xr.read(n,e,f.key);if(d)return o="hit",a=1,d;c=1;let p=W(n,e);if(!p)return o="unavailable",[];let m=p.importUsage(e);return Xr.write(n,e,f.key,m),o="computed",m}u=1;let l=W(n,e);return l?(o="direct-fallback",l.importUsage(e)):(o="unavailable",[])},()=>({state:o,eligible:s,cacheHits:a,cacheMisses:c,fallbacks:u}))}let t=si(n,"semantic-import-usage",e);if(t){let o=Gr.read(n,e,t);if(o)return o}let r=W(n,e);if(!r)return[];let i=r.importUsage(e);return t&&Gr.write(n,e,t,i),i}function wu(n,e){return rt(n).references(e)}function ni(n,e){let t=Zn(n,e);if(t)return t;let r=Ut(n,e);if(r)return r;let i=W(n,e.relativePath);return i?i.referencesFor(e):[]}function ku(n,e){let t=_s(n,e),r=t.incompleteSymbolIds.size+t.unavailableSymbolIds.size;if(r>0)throw new Error(`Exact semantic caller evidence is incomplete for ${r} definition(s).`);return t.callers}function _s(n,e,t=r=>Q(n,r)){let r=new Map,i=new Set,o=new Set,s=new Map;for(let c of e){let u=L(c.relativePath);if(!u)continue;let f;try{f=t(c.relativePath)}catch{o.add(c.symbolId);continue}if(!f.availability().available){o.add(c.symbolId);continue}if(u==="typescript"){let l=s.get(f)??[];l.push(c),s.set(f,l);continue}nt(n,r,c,ni(n,c))}for(let[c,u]of s){let f=yn(n,u,t),l=f?.references??(c.referencesForDefinitions?c.referencesForDefinitions(u,{exact:!0}):new Map(u.map(d=>[d.symbolId,c.referencesFor(d)])));!f&&_()&&mn(n,u,l,t);for(let d of u){if(!l.has(d.symbolId)){i.add(d.symbolId);continue}nt(n,r,d,l.get(d.symbolId)??[])}}let a={callers:r,incompleteSymbolIds:i,unavailableSymbolIds:o};return tt(n,a),a}function Ls(n,e,t=new Map,r=new Set){let i=new Map,o=ti(n,e,t,r),s=0;return k("semantic.callers.from-references",()=>{for(let a of e)s+=nt(n,i,a,t.get(a.symbolId)??[])},()=>({definitions:e.length,materialized:o.definitions,inMemoryHits:o.inMemoryHits,incompleteInMemoryHits:o.incompleteInMemoryHits,resultRows:i.size,callerFiles:s})),i}function ti(n,e,t,r,i={}){let o=cn(n),s=[],a=[],c=[],u=0,f=0,l=0,d=0,p=0,m=0,R=0,I=0,S=0,h=0,P=0,M=0,v=[],C=new Map,D=e.filter(y=>L(y.relativePath)==="typescript"&&!t.has(y.symbolId)&&!r.has(y.symbolId)),b=yn(n,D,y=>Q(n,y));if(b){S=D.length,h=b.cacheHits,P=b.cacheMisses,M=b.computedFiles;for(let y of D)t.set(y.symbolId,b.references.get(y.symbolId)??[])}if(k("semantic.references.cache-scan",()=>{for(let[y,g]of Jr(e)){let T=[];for(let w of g)t.has(w.symbolId)?f+=1:r.has(w.symbolId)?I+=1:T.push(w);if(T.length===0){R+=1;continue}let j=Os(n,o,y);if(!j){for(let w of T)L(w.relativePath)||(u+=1),c.push(w);continue}m+=1;let F=ft(n,y,j);for(let w of T){let O=F.get(w.symbol)??null;if(O!==null){let E=Us(O);if(E){l+=1,t.set(w.symbolId,E);continue}d+=1}a.push({definition:w,cacheFingerprint:j})}}},()=>({definitions:e.length,skippedUnsupportedLanguage:u,cacheHits:l,parseFailures:d,misses:a.length,unkeyed:c.length,inMemoryHits:f,incompleteInMemoryHits:I,fullyInMemoryFiles:R,cacheReadFiles:m})),a.length>0||c.length>0){v=[...c,...a.map(y=>y.definition)],C=k("semantic.references.compute-misses",()=>{let y=ri(n,v,i);return p=y.size,y},()=>({definitions:v.length,misses:a.length,unkeyed:c.length,rows:p}));for(let y of v)C.has(y.symbolId)?(t.set(y.symbolId,C.get(y.symbolId)??[]),r.delete(y.symbolId)):r.add(y.symbolId);for(let{definition:y,cacheFingerprint:g}of a)C.has(y.symbolId)&&ci(n,"semantic-references",y.relativePath).available&&s.push({relativePath:y.relativePath,symbol:y.symbol,projectFingerprint:g,payload:JSON.stringify(C.get(y.symbolId)??[])})}return s.length>0&&k("semantic.references.cache-write",()=>dt(n,s),()=>({entries:s.length})),C.size>0&&mn(n,v,C,y=>Q(n,y)),{definitions:e.length,inMemoryHits:f,incompleteInMemoryHits:I,cacheHits:l,misses:a.length,unkeyed:c.length,skippedUnsupportedLanguage:u,parseFailures:d,computed:p,incomplete:r.size,cacheWrites:s.length,fragmentDefinitions:S,fragmentCacheHits:h,fragmentCacheMisses:P,fragmentComputedFiles:M}}function Os(n,e,t){if(!e)return null;let r=L(t);return r==="typescript"?Pe(JSON.stringify({kind:"semantic-references",language:r,schema:"typescript-references-v2-incomplete-scan",projectFingerprint:e})):r==="rust"?Pe(JSON.stringify({kind:"semantic-references",language:r,engine:hn(n.config.projectRoot),projectFingerprint:e})):null}function ri(n,e,t={}){let r=_(),i=new Map,o=0,s=0,a=0,c=0,u=0,f=0,l=0,d=0,p=0;return k("semantic.references.provider-loop",()=>{let m=Yr(n,e),R=Ot(n,e),I=new Map,S=t.prefetchCallees?new Map:null,h=[];for(let M of e){let v,C=()=>(v??=W(n,M.relativePath),v);if(S){let g=C();if(g?.referencesAndCalleesForDefinitions){let T=S.get(g);T?T.push(M):S.set(g,[M]),p+=1}}let D=m.get(M.symbolId);if(D){a+=1,c+=D.length,ve(i,M.symbolId,D,r,g=>{l+=1,d+=g});continue}let b=R.get(M.symbolId);if(b){u+=1,f+=b.length,ve(i,M.symbolId,b,r,g=>{l+=1,d+=g});continue}let y=C();if(!y){r&&(s+=1);continue}if(r&&(o+=1),y.referencesForDefinitions){let g=I.get(y);g?g.push(M):I.set(y,[M])}else h.push({provider:y,definition:M})}let P=new Set;if(S)for(let[M,v]of S){if(!M.referencesAndCalleesForDefinitions)continue;let C=I.get(M)??[],D=M.referencesAndCalleesForDefinitions(C,v);P.add(M),Fs(n,D.callees);for(let b of C){if(!D.references.has(b.symbolId))continue;let y=D.references.get(b.symbolId)??[];ve(i,b.symbolId,y,r,g=>{l+=1,d+=g})}}for(let[M,v]of I){if(P.has(M))continue;let C=M.referencesForDefinitions(v);for(let D of v){if(!C.has(D.symbolId))continue;let b=C.get(D.symbolId)??[];ve(i,D.symbolId,b,r,y=>{l+=1,d+=y})}}for(let{provider:M,definition:v}of h){let C=M.referencesFor(v);ve(i,v.symbolId,C,r,D=>{l+=1,d+=D})}return i},()=>({definitions:e.length,providerHits:o,providerMisses:s,rustDefaultFastPathRows:a,rustDefaultFastPathReferences:c,rustScipOccurrenceFastPathRows:u,rustScipOccurrenceFastPathReferences:f,prefetchCalleeDefinitions:p,definitionsWithReferences:l,referenceCount:d,rows:i.size}))}function Pu(n,e,t={}){let r=ri(n,e,t),i=ii(n,e,r);return tt(n,i),{rows:r,...i}}function ve(n,e,t,r,i){n.set(e,t),r&&t.length>0&&i(t.length)}function nt(n,e,t,r){let i=0;for(let o of r){if(o.file===t.relativePath||n.isIgnored(o.file))continue;let s=e.get(t.symbolId);s||(s=new Set,e.set(t.symbolId,s));let a=s.size;s.add(o.file),s.size!==a&&(i+=1)}return i}function Us(n){try{return JSON.parse(n)}catch{return null}}function Eu(n,e,t){let r=oi(n,e,t),i=ii(n,e,r,t);return tt(n,i),{rows:r,...i}}function ii(n,e,t,r){let i=new Set,o=new Set;for(let s of e)if(!(t.has(s.symbolId)||!L(s.relativePath)))try{(r?r(s.relativePath):Q(n,s.relativePath)).availability().available?i.add(s.symbolId):o.add(s.symbolId)}catch{o.add(s.symbolId)}return{incompleteSymbolIds:i,unavailableSymbolIds:o}}function oi(n,e,t){let r=_(),i=new Map,o=0,s=0,a=0,c=0;return k("semantic.callees.provider-loop",()=>{let u=new Map,f=[];for(let l of e){let d=t?t(l.relativePath):W(n,l.relativePath);if(d&&!d.availability().available){r&&(s+=1);continue}if(!d){r&&(s+=1);continue}r&&(o+=1);let p=l;if(d.calleesForDefinitions){let m=u.get(d);m?m.push(p):u.set(d,[p])}else f.push({provider:d,definition:p})}for(let[l,d]of u){let p=l.calleesForDefinitions(d);for(let m of d){if(!p.has(m.symbolId))continue;let R=p.get(m.symbolId)??[];ei(i,m.symbolId,R,r,I=>{a+=1,c+=I})}}for(let{provider:l,definition:d}of f){let p=l.calleesFor(d);ei(i,d.symbolId,p,r,m=>{a+=1,c+=m})}return i},()=>({definitions:e.length,providerHits:o,providerMisses:s,definitionsWithCallees:a,calleeCount:c,rows:i.size}))}function ei(n,e,t,r,i){n.set(e,t),r&&t.length>0&&i(t.length)}function Au(n,e){return rt(n).signature(e)}function Bs(n,e){if(L(e.relativePath)==="typescript"){let s="fallback",a=0,c=0,u=0,f=0;return k("typescript.signature.materialize",()=>{let l=pn(n,e.relativePath,As);if(l?.key){a=1;let p=Zr.read(n,e.relativePath,l.key)??{};if(Object.prototype.hasOwnProperty.call(p,e.symbol))return s="hit",c=1,p[e.symbol]??null;u=1;let m=W(n,e.relativePath);if(!m)return s="unavailable",null;let R=m.signatureFor(e);return Zr.write(n,e.relativePath,l.key,{...p,[e.symbol]:R}),s="computed",R}f=1;let d=W(n,e.relativePath);return d?(s="direct-fallback",d.signatureFor(e)):(s="unavailable",null)},()=>({state:s,eligible:a,cacheHits:c,cacheMisses:u,fallbacks:f}))}let t=si(n,"semantic-signatures",e.relativePath),r=qs(e);if(t){let s=Qr.read(n,r,t);if(s)return s.signature}let i=W(n,e.relativePath);if(!i)return null;let o=i.signatureFor(e);return t&&Qr.write(n,r,t,{signature:o}),o}function si(n,e,t){let r=cn(n);if(!r)return null;let i=L(t);return i!=="rust"?null:Pe(JSON.stringify({kind:e,language:i,engine:hn(n.config.projectRoot),projectFingerprint:r}))}function qs(n){return`${n.relativePath}\0${n.symbol}`}function ai(n){try{let e=JSON.parse(n);return Array.isArray(e)?e:null}catch{return null}}function js(n){try{let e=JSON.parse(n);if(!e||typeof e!="object")return null;let t=e.signature;return t!==null&&typeof t!="string"?null:{signature:t}}catch{return null}}function Ws(n){try{let e=JSON.parse(n);if(!e||typeof e!="object"||Array.isArray(e))return null;for(let t of Object.values(e))if(t!==null&&typeof t!="string")return null;return e}catch{return null}}function ci(n,e,t){let r=L(t);if(!r)return{slot:e,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript or Rust files"};try{return{slot:e,language:r,...Q(n,t).availability()}}catch(i){return{slot:e,language:r,available:!1,reason:i instanceof Error?i.message:String(i)}}}function W(n,e){if(!L(e))return null;let t=Q(n,e);return t.availability().available?t:null}export{Jr as a,hn as b,L as c,Du as d,xu as e,rt as f,Cu as g,Tu as h,wu as i,ku as j,_s as k,ri as l,Pu as m,Eu as n,Au as o};
3
- //# sourceMappingURL=chunk-6CS3UQTN.js.map
@@ -1,6 +0,0 @@
1
- import{b as t,d}from"./chunk-2Q2LW5JW.js";import{execFileSync as g}from"child_process";import{createRequire as v}from"module";import{existsSync as w}from"fs";import{platform as i,arch as f}from"os";var r="v0.8.1",c="https://github.com/sourcegraph/scip",s=`github.com/sourcegraph/scip/cmd/scip@${r}`,m=v(import.meta.url),h="CODEBASEIQ_SCIP_BIN";function x(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let n=e.env[h];if(n&&e.fileExists(n))return{source:"env",path:n};if(e.platform==="win32"){let o=e.resolveSidecar(e.arch);if(o&&e.fileExists(o))return{source:"sidecar",path:o}}return null}function S(e){for(let n of e==="arm64"?["arm64","x64"]:[e])try{return m.resolve(`codebaseiq-windows/scip-win32-${n}.exe`)}catch{}return null}function u(e=process.env){let n=x({platform:i(),arch:f(),env:e,isOnPath:t,fileExists:w,resolveSidecar:S});return n?.source==="path"?d("scip")??n.path:n?.path??null}function C(){return u()!==null}function b(){let e=u();if(!e)return null;try{return g(e,["--version"],{stdio:"pipe",windowsHide:!0,timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function y(){let e=i(),n=f(),o,l,a;switch(e){case"darwin":o="darwin",a="tar.gz";break;case"linux":o="linux",a="tar.gz";break;default:return null}switch(n){case"arm64":l="arm64";break;case"x64":l="amd64";break;default:return null}let p=`scip-${o}-${l}.${a}`;return{url:`${c}/releases/download/${r}/${p}`,filename:p}}function O(){let e=y();if(console.log("\nThe `scip` CLI is required but not found on PATH.\n"),i()==="darwin"||i()==="linux")console.log("Install the reviewed version with Go:"),console.log(` go install ${s}
2
- `),console.log("Or download that exact release manually:");else if(i()==="win32"){let n=$();console.log("On Windows the scip binary ships via the npm sidecar package codebaseiq-windows,"),console.log("installed automatically with codebaseiq. If it is missing:"),console.log(` npm install -g ${n}`),console.log(`Or set ${h} to a local scip.exe path.
3
- `),console.log("Upstream release page:")}else console.log("Download from:");console.log(e?` ${e.url}
4
- `:` ${c}/releases/tag/${r}
5
- `),console.log("After installing, ensure `scip` is on your PATH and run `codebaseiq reindex`.")}function $(){let n=m("../../package.json").optionalDependencies?.["codebaseiq-windows"];if(!n||!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(n))throw new Error("codebaseiq package metadata does not declare an exact Windows sidecar version.");return`codebaseiq-windows@${n}`}function k(e){if(t("go")){e(`Installing immutable ${s} via go install into the Go bin directory (GOBIN or GOPATH/bin); expected executable: scip.`);try{if(g("go",["install",s],{stdio:"inherit",windowsHide:!0,timeout:3e5,env:process.env}),t("scip")){let n=u(),o=b();if(n&&o&&o.includes(r))return e(`Successfully installed ${s}; resolved executable: ${n}; reported version: ${o}.`),!0;e(`go install completed, but the resolved scip executable did not report ${r} (executable: ${n??"unresolved"}; version: ${o??"unavailable"}).`)}}catch(n){let o=n instanceof Error?n.message:String(n);e(`go install failed: ${o}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${c}/releases`),!1}export{u as a,C as b,O as c,k as d};
6
- //# sourceMappingURL=chunk-6OAHRI2D.js.map
@@ -1,21 +0,0 @@
1
- import{e as F,f as X,g as L,h as _e,i as Le,j as Fe,p as Pe,q as y,r as Ee,t as Ae,u as g,v as we}from"./chunk-BMYOV5GP.js";import{H,c as v}from"./chunk-NNJ2KZZG.js";import{basename as Re}from"path";var $t=F("indexed-document-paths",{clearGroups:["whole-project"]});function O(e,t={}){let n=Ot(t);return[...$t.get(e,n,()=>{let o=t.scope?"AND relative_path LIKE ?":"",s=t.like?"AND relative_path LIKE ?":"",i=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
2
- FROM documents
3
- WHERE 1 = 1
4
- ${e.pathExclusionsFor("documents")}
5
- ${o}
6
- ${s}
7
- ORDER BY relative_path`,...i).map(l=>l.relative_path),c=t.extensions?a.filter(l=>t.extensions.some(p=>l.toLowerCase().endsWith(p.toLowerCase()))):a;return t.includeIgnored===!1?c.filter(l=>!e.isIgnored(l)):c})]}function Ot(e){let t=e.extensions?[...new Set(e.extensions.map(n=>n.toLowerCase()))].sort():null;return JSON.stringify({scope:e.scope??null,like:e.like??null,extensions:t,includeIgnored:e.includeIgnored!==!1})}function Uo(e,t,n){let r=Ve(t);if(!r)return[];let o=e.all(`SELECT relative_path
8
- FROM documents
9
- WHERE relative_path = ?
10
- ${e.pathExclusionsFor("documents")}`,r).filter(c=>!e.isIgnored(c.relative_path)).map(c=>({relativePath:c.relative_path,score:Ie(c.relative_path,r)}));if(o.length>0)return o;let s=O(e,{includeIgnored:!1}).map(c=>({relativePath:c,score:Ie(c,r)})).filter(c=>c.score>0).sort((c,l)=>l.score-c.score||c.relativePath.localeCompare(l.relativePath)),i=s.filter(c=>c.score>=1100);if(i.length>0)return n.allowMultiple?i:[i[0]];let a=s.filter(c=>c.score>=800);return a.length>0?n.allowMultiple?a:[a[0]]:n.allowMultiple?s:s.slice(0,1)}function Ie(e,t){let n=Ve(e),r=Re(n),o=Re(t),s=0;return n===t&&(s+=1200),n.endsWith(`/${t}`)&&(s+=1100),r===o&&(s+=900),n.startsWith(`${t}/`)&&(s+=850),n.includes(t)&&(s+=250),s}function Ve(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}import{extname as je}from"path";var Dt={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function D(e){return Dt[je(e).toLowerCase()]??null}function ce(e){return je(e).toLowerCase()===".vue"}import{createRequire as Wt}from"module";var d=Wt(import.meta.url),J=null,Be=!1;function Ut(){if(Be)return null;if(J)return J;try{return J=d("tree-sitter"),J}catch{return Be=!0,null}}var $e=new Map,Z=new Set;function Mt(e){if(Z.has(e))return null;let t=$e.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Z.add(e),null}}catch{return Z.add(e),null}return $e.set(e,n),n}var Oe=new Map;function zt(e){let t=Oe.get(e);if(t)return t;let n=Mt(e);if(!n)return null;let r=Ut();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return Z.add(e),null}return Oe.set(e,o),o}function qt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function P(e,t){let n=zt(e);if(!n)return null;try{return qt(n,t)}catch{return null}}import{posix as le}from"path";import{parse as Ht}from"@vue/compiler-sfc";var Xt=L("vue-sfc-units");function R(e,t){let n=Ue(t),r=g(e,n);return Xt.get(e,n,r,()=>ue(e,n,r))}function Ue(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Jt(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function E(e){return!e||e.body.length===0?0:e.body.split(`
11
- `).length}function ue(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Ht(n,{filename:t})}catch(i){return r.errors.push(We(i)),r}r.errors.push(...o.errors.map(We));let{descriptor:s}=o;return s.template&&(r.template=G(e,t,"template",s.template)),s.script&&r.scripts.push(De(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(De(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>G(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>G(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function De(e,t,n,r){let o=G(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:Jt(o.lang)}}function G(e,t,n,r){let o=Gt(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=Zt(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),p=l?Math.max(0,l.split(`
12
- `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:p,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function Zt(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Ue(le.normalize(le.join(le.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Gt(e){return{...e}}function We(e){return e instanceof Error?e.message:String(e)}function pe(e,t,n){let o=ue(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
13
- `.repeat(i.startLine)}${i.body}`).join(`
14
- `),startLine:0,language:s}:null}var Me=_e("ast-trees",{clearGroups:["whole-project","source-file"]});function ze(e,t){if(ce(t))return Kt(e,t);let n=D(t);if(!n)return null;let r=g(e,t);return r?Me.get(e,t,r,()=>P(n,r)):null}function is(e,t,n){if(ce(t)){let s=pe(e,t,n);if(!s)return null;let i=P(s.language,`
15
- `.repeat(s.startLine)+s.body);return i?{tree:i,language:s.language}:null}let r=D(t);if(!r)return null;let o=P(r,n);return o?{tree:o,language:r}:null}function Kt(e,t){let n=g(e,t);return n?Me.get(e,t,n,()=>{let r=pe(e,t,n);if(!r)return null;let o=`
16
- `.repeat(r.startLine)+r.body;return P(r.language,o)}):null}import{readdirSync as Qt}from"fs";import{execFileSync as Yt}from"child_process";import{extname as K,join as en}from"path";var tn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],ms=[".vue"],qe=[".tsx",".jsx"],He=[".vue"],nn=[...qe,...He],rn=new Set(qe),on=new Set(He),Xe=new Set(tn.map(e=>e.toLowerCase())),sn=[...Xe].sort().join(","),Je=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".codebaseiq-cache","__pycache__",".venv","venv",".idea",".vscode"]);function W(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):Xe,i=o?[...s].sort().join(","):sn,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return an.get(e,a,()=>{let c=new Set;if(n)for(let l of O(e,{includeIgnored:!1}))s.has(K(l).toLowerCase())&&c.add(l);if(r)for(let l of cn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function ds(e,t={}){let n=!1,r=!1;for(let o of W(e,{extensions:nn})){if(t.scope&&!o.includes(t.scope))continue;let s=K(o).toLowerCase();if(n||=rn.has(s),r||=on.has(s),n&&r)break}return{react:n,vue:r}}var an=F("source-files",{clearGroups:[]});function cn(e,t){return ln(e,t)??pn(e,t)}function ln(e,t){try{let n=Yt("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"],windowsHide:!0}),r=new Set;for(let o of n.split(`
17
- `)){let s=o.trim();s&&(un(s)||t.has(K(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function un(e){return e.split("/").some(t=>Je.has(t))}function pn(e,t){let n=new Set,r=o=>{let s=o?en(e,o):e,i;try{i=Qt(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!Je.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(K(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as hn}from"path";function Y(e,t){let n=mn(e,t);if(!n)return null;let r=Q(n);if(!r)return null;let o=dn(n);return{calleeLeaf:r,calleeQualifier:o?fn(n):void 0,calleeText:n.text,memberAccess:o,line:e.startPosition.row}}function fn(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function mn(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function dn(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function Q(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?Q(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"super":case"self":case"this":return null;default:return null}}var gn=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function ee(e){return e.length<=2||gn.has(e)}var Sn=[".tsx",".jsx"],Ze=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),yn=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),xn=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),vn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Nn=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Cn=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),bn=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),kn=L("react-component-behavior-profiles"),Ge=Ee({kind:"react-component-behavior-profiles",invalidation:Ae("react-component-behavior-profiles"),serialize:Fn,deserialize:Pn});function et(e,t={}){let n=W(e,{extensions:Sn}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>me(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function me(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return kn.get(e,n,r,()=>Tn(e,n,r)).map(Ln)}function Tn(e,t,n){let r=Fe(e,t,n),o=Ge.read(e,t,r);if(o)return o;let s=_n(e,t);return Ge.write(e,t,r,s),s}function _n(e,t){let n=An(t);if(!n)return[];let r=ze(e,t);if(!r)return[];let o=we(e,t).length;return wn(r.rootNode,n).filter(i=>i.kind==="hook"||de(i.bodyNode)).map(i=>{let a=On(i.bodyNode),c=zn(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:b(a.componentNames),nativeTags:b(a.nativeTags),propNames:b(a.propNames),eventNames:b(a.eventNames),hookNames:b(c.hookNames),requestNames:b(c.requestNames),stateNames:b(c.stateNames),effectNames:b(c.effectNames),handlerNames:b(c.handlerNames)}})}function Ln(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Fn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function Pn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=En(r);if(!o)return null;n.push(o)}return n}catch{return null}}function En(e){if(!Pe(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:p,nativeTags:u,propNames:N,eventNames:B,hookNames:ie,requestNames:ae,stateNames:m,effectNames:C,handlerNames:$}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!te(o)||!te(s)||!te(i)||!te(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(p),nativeTags:y(u),propNames:y(N),eventNames:y(B),hookNames:y(ie),requestNames:y(ae),stateNames:y(m),effectNames:y(C),handlerNames:y($)};return Object.values(S).some(Bt=>Bt===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function te(e){return typeof e=="number"&&Number.isFinite(e)}function An(e){let t=hn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:D(e)}function wn(e,t){let n=[],r=new Set,o=s=>{let i=Rn(s);if(i&&(!Bn(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function Rn(e){if(e.type==="class_declaration"){let s=fe(e);if(!s||!/^[A-Z]/.test(s))return null;let i=In(e);return!i||!Vn(e)&&!de(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=fe(e);return!s||!Ke(s)?null:{name:s,kind:Qe(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=U(t);if(!r||!n||!Ke(r))return null;let o=jn(n);return o?{name:r,kind:Qe(r),node:e,bodyNode:o}:null}function In(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function Vn(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Ke(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function Qe(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function jn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=$n(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Bn(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function fe(e){return U(e.childForFieldName("name")??e.namedChild(0))}function $n(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function de(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(de)}function On(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?Dn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Wn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function Dn(e,t){let n=Un(e),r=!1;if(n){let o=Ye(n),s=o==="Fragment"||o==="React.Fragment";r=Zn(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=Mn(o);if(!s)continue;let i=Ye(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else bn.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(tt(o))}function Wn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(tt(e)),nt(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of Gn(n))ee(r)||t.tokens.add(`binding:${r}`)}function tt(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function nt(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(nt)}function Un(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function Mn(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function zn(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=Y(o,t);s&&qn(s.calleeLeaf,n)}else if(o.type==="variable_declarator")Xn(o,n);else if(o.type==="function_declaration"){let s=fe(o);s&&rt(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function qn(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Ze.has(e)&&!vn.has(e)&&t.tokens.add(`hook:${e}`)),Ze.has(e)&&t.tokens.add(`react-hook:${e}`),yn.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),xn.has(e)&&t.tokens.add(`state-hook:${e}`),Hn(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function Hn(e){if(Nn.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Xn(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>U(a)),i=U(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=U(n);o&&rt(o,t)}function rt(e,t){let n=Jn(e);!n||!Cn.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Jn(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function Zn(e){return/^[A-Z]/.test(e)||e.includes(".")}function Ye(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function U(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Gn(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function b(e){return[...e].sort()}function M(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var Kn=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),ot=new Set(["arrow_function","function_expression","generator_function"]);function ut(e,t){let n=Yn(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:ct(n.functionNode),params:st(n.functionNode),paramsEndLine:it(n.functionNode),isLiteralPassthrough:lt(n.functionNode,t)};if(!Qn(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:ct(e),params:st(e),paramsEndLine:it(e),isLiteralPassthrough:lt(e,t)}:null}function pt(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function st(e){let t=pt(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(M(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function it(e){let t=pt(e);return t?t.endPosition.row:e.startPosition.row}function Qn(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?Kn.has(e):!1}function Yn(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=at(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=at(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}return null}function at(e){if(ot.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"))?.namedChildren??[]).filter(o=>ot.has(o.type));return r.length===1?r[0]:null}function ct(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)M(r)||(n+=1);return n}function lt(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!M(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!M(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let p=[];for(let u of l.namedChildren){if(u.type==="identifier"){p.push(u.text);continue}let N=u.namedChildren.find(B=>B.type==="identifier");N&&p.push(N.text)}if(c.length!==p.length)return!1;for(let u=0;u<p.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==p[u])return!1}return!0}var er=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),tr=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),nr=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),rr=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),or=new Set(["catch","for","function","if","return","switch","while"]);function re(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=E(n),n.external&&(t.externalLineCount+=E(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...cr(n));let r=P(n.astLanguage,n.body);r?ir(n,r.rootNode,t):ar(n,t)}return sr(t),t.externalScriptPaths=mt(t.externalScriptPaths),t}function sr(e){e.composables=I(e,"composable"),e.stores=I(e,"store"),e.reactivity=I(e,"reactivity"),e.lifecycle=I(e,"lifecycle"),e.requests=I(e,"request"),e.macros=I(e,"macro")}function I(e,t){return mt(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function ir(e,t,n){let r=new Set,o=new Set,s=i=>{let a=ut(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=Y(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:ft(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function ar(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||or.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+ne(e.body,n.index??0),categories:ft(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+ne(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+ne(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function cr(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+ne(e.body,n.index??0);for(let i of lr(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function lr(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function ft(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),er.has(e)&&t.push("reactivity"),tr.has(e)&&t.push("lifecycle"),nr.has(e)&&t.push("request"),rr.has(e)&&t.push("macro"),t}function ne(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function mt(e){return[...new Set(e)].sort()}import{ElementTypes as ur,NodeTypes as ge,parse as pr}from"@vue/compiler-dom";import{parse as Ws}from"@vue/compiler-sfc";function dt(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var fr=L("vue-template-facts"),mr=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),dr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),gr=new Set(["div","span","template"]),hr=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function oe(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return fr.get(e,n,r,()=>Sr(n,R(e,n).template))}function Sr(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=pr(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return ht(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function ht(e,t,n,r){for(let o of e)if(o.type===ge.ELEMENT)yr(o,t,n,r),ht(o.children,t,n,r);else if(o.type===ge.INTERPOLATION){r("interpolation");let s=he(o.content);s&&St(s,t,o.loc.start.line,n,r)}}function yr(e,t,n,r){let o=Tr(e.tag),s={tag:e.tag,normalized:o,kind:kr(e),startLine:V(t,e.loc.start.line),endLine:V(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),gr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)xr(i,t,n,r)}function xr(e,t,n,r){if(e.type===ge.ATTRIBUTE){let a=e.value?.content??null,c=gt("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=Nr(e),s=he(e.exp),i=gt(vr(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&St(s,t,e.loc.start.line,n,r)}function gt(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:V(r,o),endLine:V(r,s)}}function vr(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Nr(e){let t=he(e.arg);return t||e.name}function he(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function St(e,t,n,r,o){for(let s of Cr(e)){let i={name:s,startLine:V(t,n),endLine:V(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function Cr(e){let t=new Set,n=br(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];hr.has(s)||ee(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function br(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function kr(e){let t=e.tag;return e.tagType===ur.COMPONENT?"component":mr.has(t)?"builtin":dr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function Tr(e){return dt(e,/[-_:]/)}function V(e,t){return e+Math.max(0,t-1)}import{createRequire as jr}from"module";import{existsSync as w}from"fs";import{basename as xt,dirname as h,extname as k,join as x,relative as A,resolve as f,sep as Br}from"path";import{existsSync as ye,readdirSync as _r,statSync as Lr}from"fs";import{join as j,relative as Fr}from"path";function yt(e){let t=Pr(e)??Rr(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Ir(e,o)){if(r.has(s))continue;r.add(s);let i=Vr(e,s);i&&n.push(i)}return n}function Pr(e){let t=j(e,"pnpm-workspace.yaml");if(!ye(t))return null;try{return Er(H(t,"pnpm workspace manifest"))}catch{return null}}function Er(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Ar(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=wr(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Ar(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function wr(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Rr(e){let t=j(e,"package.json");if(!ye(t))return null;try{let n=JSON.parse(H(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Ir(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=j(e,t);return Se(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=j(e,r||".");return Se(s)?_r(s).map(i=>j(s,i,o)).filter(Se):[]}function Se(e){try{return Lr(e).isDirectory()}catch{return!1}}function Vr(e,t){let n=j(t,"package.json");if(!ye(n))return null;try{let r=JSON.parse(H(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:Fr(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var $r=X("indexed-paths",{clearGroups:[]}),Or=X("indexed-path-digest",{clearGroups:[]}),Dr=F("tsconfig-alias-config",{clearGroups:["whole-project"]}),Wr=F("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Ur=jr(import.meta.url),z;function Mr(){if(z!==void 0)return z;try{z=Ur("typescript")}catch{z=null}return z}var zr=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],qr=X("workspace-packages",{clearGroups:["whole-project"]}),q=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],vt=[".py",".pyi"],Nt=[".java",".scala",".kt",".kts"],Ct=[".rs"],bt=[".rb"],kt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Tt=[".cs",".vb"],_t=[".dart"],Lt=[".php"],se=[".clj",".cljs",".cljc"],Hr=new Set(q),xe=new Set(vt),Ft=new Set(Nt),ve=new Set(Ct),Ne=new Set(bt),Pt=new Set(kt),Et=new Set(Tt),Ce=new Set(_t),At=new Set(Lt),wt=new Set(se),Xr=[{extensions:q,lookup:Hr},{extensions:vt,lookup:xe},{extensions:Nt,lookup:Ft},{extensions:Ct,lookup:ve},{extensions:bt,lookup:Ne},{extensions:kt,lookup:Pt},{extensions:Tt,lookup:Et},{extensions:_t,lookup:Ce},{extensions:Lt,lookup:At},{extensions:se,lookup:wt}];function T(e,t){return t.has(k(e).toLowerCase())}function Jr(e){return T(e,xe)}function Zr(e){return T(e,Ft)}function Gr(e){return T(e,ve)}function Kr(e){return T(e,Ne)}function Qr(e){return T(e,Pt)}function Yr(e){return T(e,Et)}function ii(e){return k(e).toLowerCase()===".vb"}function eo(e){return T(e,Ce)}function to(e){return T(e,At)}function no(e){return T(e,wt)}function ro(e){let t=k(e).toLowerCase();for(let n of Xr)if(n.lookup.has(t))return n.extensions;return q}function oo(e){return Zr(e)||Yr(e)||to(e)}function Rt(e,t,n){return Jr(t)?yo(e,t,n):Gr(t)?xo(e,t,n):Kr(t)?vo(e,t,n):Qr(t)?No(e,t,n):oo(t)?Co(e,n.replace(/\\/g,"."),ro(t)):eo(t)?bo(e,t,n):no(t)?ko(e,n):so(e,t,n)}function so(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return io(e,t,n)??co(e,n);let r=h(x(e.config.projectRoot,t)),o=f(r,n),s=_(e);for(let i of ke(o)){let a=v(A(e.config.projectRoot,i));if(s.has(a)||w(i))return a}return v(A(e.config.projectRoot,o))}function io(e,t,n){let r=go(e,t);if(!r)return null;let o=_(e);for(let s of ao(r,n)){let i=f(r.baseUrl,s);for(let a of ke(i)){let c=v(A(e.config.projectRoot,a));if(o.has(c)||w(a))return c}}return null}function ao(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function co(e,t){let n=uo(lo(e),t);if(!n)return null;let r=_(e);for(let o of po(n)){let s=f(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of ke(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}}return null}function lo(e){return qr.get(e,()=>yt(e.config.projectRoot))}function uo(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function po(e){let t=[],n=fo(e.pkg.exports,e.subpath);if(n){let r=mo(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function fo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return It(e[n])}function It(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=It(t[n]);if(r)return r}return null}function mo(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function go(e,t){let n=v(h(t));return Wr.get(e,n,()=>ho(e,n))}function ho(e,t){let n=Mr();if(!n)return null;let r=f(e.config.projectRoot),o=f(r,t);for(;o===r||o.startsWith(r+Br);){for(let i of zr){let a=x(o,i);if(!w(a))continue;let c=Dr.get(e,a,()=>So(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function So(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?f(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function yo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?f(c,a.replace(/\./g,"/")):c}else o=f(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of To(o)){let i=v(A(e.config.projectRoot,s));if(r.has(i)||w(s))return i}return null}function xo(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=f(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=f(o,r.slice(6).replace(/::/g,"/")):s=f(h(o),r.slice(7).replace(/::/g,"/")),be(e,_o(s))}function vo(e,t,n){let r=h(x(e.config.projectRoot,t)),o=f(r,n);return be(e,Lo(o))}function No(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[f(r,n),f(e.config.projectRoot,n),f(e.config.projectRoot,"include",n),f(e.config.projectRoot,"src",n)];return be(e,o)}function Co(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,p=[...r].find(u=>u.endsWith(l));if(p)return p}for(let c of n){let l=[...r].find(p=>xt(p)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(k(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function bo(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=f(o,n);for(let i of Fo(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}return null}function ko(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of se){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of se){let s=[...r].find(i=>xt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function To(e){let t=k(e);return xe.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function be(e,t){let n=_(e);for(let r of t){let o=v(A(e.config.projectRoot,r));if(n.has(o)||w(r))return o}return null}function _o(e){let t=k(e);return ve.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function Lo(e){let t=k(e);return Ne.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Fo(e){let t=k(e);return Ce.has(t)?[e]:[`${e}.dart`,e]}function ke(e){let t=k(e),n=new Set;if(t){n.add(e);for(let r of q)n.add(e.slice(0,-t.length)+r)}else for(let r of q)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return $r.get(e,()=>new Set(O(e,{includeIgnored:!1}).map(v)))}function ai(e){return Or.get(e,()=>Le([..._(e)].sort().join(`
18
- `)))}var Po=new Set(["in","key","of"]),Eo=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),Ao=L("vue-component-behavior-profiles");function Vt(e,t={}){let n=W(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Te(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Te(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=Ao.get(e,n,r,()=>wo(e,n,r));return Io(o)}function wo(e,t,n){let r=R(e,t),o=oe(e,t),s=re(r),i=Bo(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,$)=>$.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,$)=>$.indexOf(m)===C).sort(),l=n?n.split(`
19
- `).length:0,p=E(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+E(C),0),B=r.customBlocks.reduce((m,C)=>m+E(C),0),{lines:ie,paths:ae}=Ro(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:jo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:p,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:B,delegatedComposableLines:ie,delegatedComposablePaths:ae}}function Ro(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Rt(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
20
- `).length:0)},0),paths:o}}function Io(e){let t=Vo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function Vo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function jo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Eo.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function Bo(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of $o(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of jt(n.value))t.add(r);return[...t].sort()}function $o(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?jt(t[1]??""):[]}function jt(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];Po.has(r)||t.push(r)}return t}function Ci(e){return{capability:(t,n)=>Oo(t,n),reactProfiles:(t={})=>et(e,t),reactProfilesForFile:t=>me(e,t),vueProfiles:(t={})=>Vt(e,t),vueProfileForFile:t=>Te(e,t),vueTemplateFacts:t=>oe(e,t),vueScriptFacts:t=>re(R(e,t))}}function Oo(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{O as a,Uo as b,yt as c,Ir as d,q as e,vt as f,Nt as g,Ct as h,bt as i,kt as j,Tt as k,_t as l,Lt as m,se as n,ii as o,ro as p,Rt as q,yo as r,xo as s,vo as t,No as u,Co as v,bo as w,ko as x,ai as y,D as z,ce as A,pe as B,ze as C,is as D,Y as E,Q as F,ut as G,dt as H,ms as I,Je as J,W as K,ds as L,Ci as M};
21
- //# sourceMappingURL=chunk-ADTBPVUZ.js.map
@@ -1,2 +0,0 @@
1
- import{K as c}from"./chunk-ADTBPVUZ.js";import{f as a,u,w as p}from"./chunk-BMYOV5GP.js";var g=a("suppression-inventory",{clearGroups:["whole-project"]});function b(t){return g.get(t,()=>y(t))}function y(t){let e={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,twin:0,uncategorized:0},n=new Map,o=0;for(let r of c(t)){let i=u(t,r);if(!(!i||!i.includes("codebaseiq")))for(let f of i.split(/\r?\n/)){let s=p(f);if(s===null)continue;o+=1,n.set(r,(n.get(r)??0)+1);let d=l(s);e[d]+=1}}for(let r of t.config.suppressions??[])r.expiresAt&&Date.parse(r.expiresAt)<=Date.now()||(o+=1,r.file&&n.set(r.file,(n.get(r.file)??0)+1),e[l(r.check)]+=1);return{total:o,byCategory:e,byFile:n}}function l(t){if(!t)return"uncategorized";let e=t.toLowerCase();return e==="dead-code"||e==="new-dead"?"dead":e.includes("twin")?"twin":e.includes("similar")||e.includes("duplicate")?"similar":e.includes("wrapper")?"wrapper":e.includes("passthrough")?"passthrough":e.includes("drift")?"drift":e.includes("extract")?"extract":e.includes("stale")?"stale":"uncategorized"}export{b as a};
2
- //# sourceMappingURL=chunk-BFFZDZQV.js.map
@@ -1,77 +0,0 @@
1
- import{f as w,g as P}from"./chunk-CWONGW6P.js";import{a as T,b as S,d as _}from"./chunk-3LCDIREB.js";import{v as R}from"./chunk-NNJ2KZZG.js";var F=[],L=[];function y(t){t.groups.length>0&&F.push(t)}function O(t){L.push(t)}function pe(t){let n=[];for(let e of L)try{e.close(t)}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Multiple database-owned resources failed to close.")}function ue(t,n){let e=new Set(n.groups);for(let a of F)a.groups.some(r=>e.has(r))&&(n.file!==void 0&&a.clearFile?a.clearFile(t,n.file):a.clearAll(t))}function A(){let t=new WeakMap;return{cache:t,ensure(n){let e=t.get(n);return e||(e=new Map,t.set(n,e)),e}}}function h(t,n){let{cache:e,ensure:a}=A(),r={get(i,s,o){let c=a(i);if(c.has(s))return c.get(s);let d=o();return c.set(s,d),d},invalidate(i,s){e.get(i)?.delete(s)},invalidateAll(i){e.delete(i)},size(i){return e.get(i)?.size??0}};return y({name:t,groups:n.clearGroups,clearAll:i=>r.invalidateAll(i),clearFile:(i,s)=>r.invalidate(i,s)}),r}function he(t,n){let e=new WeakMap,a={get(r,i){let s=e.get(r);if(s)return s.value;let o=i();return e.set(r,{value:o}),o},invalidate(r){e.delete(r)},has(r){return e.has(r)}};return y({name:t,groups:n.clearGroups,clearAll:r=>a.invalidate(r)}),a}var $={clearGroups:["whole-project","source-file"]};function ve(t){return G(t,$)}function G(t,n){let{cache:e,ensure:a}=A(),r={get(i,s,o,c){let d=a(i),D=d.get(s);if(D&&D.source===o)return D.value;let N=c();return d.set(s,{source:o,value:N}),N},invalidate(i,s){e.get(i)?.delete(s)},invalidateAll(i){e.delete(i)}};return y({name:t,groups:n.clearGroups,clearAll:i=>r.invalidateAll(i),clearFile:(i,s)=>r.invalidate(i,s)}),r}import{createHash as Y}from"crypto";import{existsSync as De,mkdirSync as z}from"fs";import{dirname as k,join as q}from"path";import x from"better-sqlite3";var J="evidence.db";var Q=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],C=new Set(Q);var Ne=512*1024*1024,Z=6e4,f=new WeakMap;O({name:"evidence-connections",close:V});var ee=h("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),te=h("evidence-project-fingerprint",{clearGroups:["whole-project"]}),p="evidence-v1",v="version NOT LIKE 'evidence-%'";function I(t){return Y("sha256").update(t).digest("hex")}function Re(t,n,e){return ee.get(t,n,()=>I(e))}function j(t){return te.get(t,"current",()=>{try{if(!t.generation.metadataRaw)return null;let n=R(t.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let e=n.metadata,a=[...e.indexedLanguages??[]].sort();return I(JSON.stringify({fingerprint:e.fingerprint,indexedLanguages:a,status:e.status}))}catch(n){return E("project fingerprint unavailable",n),null}})}function E(t,n){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${t}: ${n instanceof Error?n.message:String(n)}`)}function u(t){if(f.has(t))return f.get(t)??null;let n=null;try{let e=new x(q(k(t.config.dbPath),J));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
2
- CREATE TABLE IF NOT EXISTS file_evidence (
3
- kind TEXT NOT NULL,
4
- relative_path TEXT NOT NULL,
5
- content_hash TEXT NOT NULL,
6
- version TEXT NOT NULL,
7
- payload TEXT NOT NULL,
8
- PRIMARY KEY (kind, relative_path)
9
- );
10
- CREATE TABLE IF NOT EXISTS project_evidence (
11
- kind TEXT NOT NULL,
12
- cache_key TEXT NOT NULL,
13
- project_fingerprint TEXT NOT NULL,
14
- version TEXT NOT NULL,
15
- payload TEXT NOT NULL,
16
- PRIMARY KEY (kind, cache_key)
17
- );
18
- CREATE TABLE IF NOT EXISTS semantic_callees (
19
- relative_path TEXT NOT NULL,
20
- symbol TEXT NOT NULL,
21
- content_hash TEXT NOT NULL,
22
- deps_digest TEXT NOT NULL,
23
- version TEXT NOT NULL,
24
- payload TEXT NOT NULL,
25
- PRIMARY KEY (relative_path, symbol)
26
- );
27
- CREATE TABLE IF NOT EXISTS semantic_references (
28
- relative_path TEXT NOT NULL,
29
- symbol TEXT NOT NULL,
30
- project_fingerprint TEXT NOT NULL,
31
- version TEXT NOT NULL,
32
- payload TEXT NOT NULL,
33
- PRIMARY KEY (relative_path, symbol)
34
- );
35
- `),n={evidence:e,shared:ne(t.config.sharedEvidenceDbPath),readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
36
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${v}
37
- ORDER BY version DESC
38
- LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:e.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:e.prepare(`SELECT payload FROM project_evidence
39
- WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${v}
40
- ORDER BY version DESC
41
- LIMIT 1`),writeProjectEvidence:e.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
42
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
43
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${v}
44
- ORDER BY version DESC
45
- LIMIT 1`),readCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
46
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
47
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${v}
48
- ORDER BY symbol, version DESC`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
49
- (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
50
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
51
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${v}
52
- ORDER BY version DESC
53
- LIMIT 1`),readReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
54
- WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
55
- WHERE relative_path = ? AND project_fingerprint = ? AND ${v}
56
- ORDER BY symbol, version DESC`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
57
- (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(e){E("disabled (open failed)",e)}return f.set(t,n),n}function g(t,n,e){E(`disabled (${n})`,e);try{V(t)}catch(a){E("close failed while disabling",a)}f.set(t,null)}function V(t){let n=f.get(t);if(f.delete(t),!n)return;let e,a;try{n.shared?.evidence.close()}catch(r){e=r}try{n.evidence.close()}catch(r){a=r}if(e!==void 0&&a!==void 0)throw new AggregateError([e,a],"Shared and project evidence connections failed to close.");if(e!==void 0)throw e;if(a!==void 0)throw a}function ne(t){if(!t)return null;try{z(k(t),{recursive:!0});let n=new x(t);return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
58
- CREATE TABLE IF NOT EXISTS file_evidence (
59
- kind TEXT NOT NULL,
60
- relative_path TEXT NOT NULL,
61
- content_hash TEXT NOT NULL,
62
- version TEXT NOT NULL,
63
- payload TEXT NOT NULL,
64
- last_accessed_at INTEGER NOT NULL,
65
- PRIMARY KEY (kind, relative_path, content_hash, version)
66
- );
67
- CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
68
- ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
69
- `),{evidence:n,readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:n.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
70
- VALUES (?, ?, ?, ?, ?, ?)
71
- ON CONFLICT(kind, relative_path, content_hash, version)
72
- DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:n.prepare(`UPDATE file_evidence
73
- SET last_accessed_at = ?
74
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
75
- AND last_accessed_at < ?`)}}catch(n){return E("shared cache disabled (open failed)",n),null}}function b(t,n,e){E(`shared cache disabled (${n})`,e);try{t.shared?.evidence.close()}catch{}t.shared=null}function M(t,n,e,a){let r=u(t);if(!r)return null;try{let i=r.readFileEvidence.get(n,e,a,p)??r.readLegacyFileEvidence.get(n,e,a);if(i?.payload!==void 0)return i.payload;if(!C.has(n)||!r.shared)return null;try{let s=r.shared.readFileEvidence.get(n,e,a,p);return s?.payload!==void 0&&re(r.shared,n,e,a),s?.payload??null}catch(s){return b(r,"file_evidence read",s),null}}catch(i){return g(t,"file_evidence read",i),null}}function re(t,n,e,a){let r=Date.now();try{t.touchFileEvidence.run(r,n,e,a,p,r-Z)}catch(i){E("shared file_evidence recency touch skipped",i)}}function K(t,n,e,a,r){let i=u(t);if(i)try{if(i.writeFileEvidence.run(n,e,a,p,r),C.has(n)&&i.shared)try{i.shared.writeFileEvidence.run(n,e,a,p,r,Date.now())}catch(s){b(i,"file_evidence write",s)}}catch(s){g(t,"file_evidence write",s)}}function H(t,n){if(n.length===0)return;let e=u(t);if(e)try{e.evidence.transaction(()=>{for(let r of n)e.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload)})();let a=n.filter(r=>C.has(r.kind));if(a.length>0&&e.shared)try{e.shared.evidence.transaction(()=>{for(let r of a)e.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload,Date.now())})()}catch(r){b(e,"file_evidence batch write",r)}}catch(a){g(t,"file_evidence batch write",a)}}function U(t,n,e,a){let r=u(t);if(!r)return null;try{return(r.readProjectEvidence.get(n,e,a,p)??r.readLegacyProjectEvidence.get(n,e,a))?.payload??null}catch(i){return g(t,"project_evidence read",i),null}}function X(t,n,e,a,r){let i=u(t);if(i)try{i.writeProjectEvidence.run(n,e,a,p,r)}catch(s){g(t,"project_evidence write",s)}}function we(t,n,e,a){let r=u(t);if(!r)return new Map;try{let i=r.readCalleesForFile.all(n,e,a,p),s=r.readLegacyCalleesForFile.all(n,e,a);return B([...s,...i])}catch(i){return g(t,"semantic_callees bulk read",i),new Map}}function Pe(t,n,e){let a=u(t);if(!a)return new Map;try{let r=a.readReferencesForFile.all(n,e,p),i=a.readLegacyReferencesForFile.all(n,e);return B([...i,...r])}catch(r){return g(t,"semantic_references bulk read",r),new Map}}function B(t){let n=new Map;for(let e of t)n.set(e.symbol,e.payload);return n}function Fe(t,n){if(n.length===0)return;let e=u(t);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of n){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(r.relativePath,r.contentHash)),e.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,p,r.payload)}})()}catch(a){g(t,"semantic_callees write",a)}}function Le(t,n){if(n.length===0)return;let e=u(t);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of n){let i=`${r.relativePath}\0${r.projectFingerprint}`;a.has(i)||(a.add(i),e.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),e.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,p,r.payload)}})()}catch(a){g(t,"semantic_references write",a)}}function Ae(t){return typeof t=="object"&&t!==null}function ke(t){return Array.isArray(t)&&t.every(n=>typeof n=="string")?t:null}var ae=[l("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),l("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),l("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),l("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),l("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),l("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),l("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),l("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),l("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),l("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),l("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),l("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),m("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),m("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),m("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),m("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function Ke(t){let n=new Map;return{kind:t.kind,read(e,a,r){let i=!1,s=0,o;if(T()){let c=j(e);if(c){let d=`${c}\0${a}\0${r}`;o=n.get(d),o||(o=S(["evidence-product-file-read-v1",t.kind,c,a,r]),n.set(d,o))}}return _("evidence-product.file.read",()=>{let c=M(e,t.kind,a,r);if(c===null)return null;s=c.length;try{let d=t.deserialize(c);return i=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:t.kind,available:!0,hit:i,payloadBytes:s}))},write(e,a,r,i){K(e,t.kind,a,r,t.serialize(i))},writeBatch(e,a){H(e,a.map(r=>({kind:t.kind,relativePath:r.relativePath,contentHash:r.contentHash,payload:t.serialize(r.value)})))}}}function He(t){let n=new Map;return{kind:t.kind,read(e,a,r){let i=!1,s=0,o;if(T()){let c=`${r}\0${a}`;o=n.get(c),o||(o=S(["evidence-product-project-read-v1",t.kind,r,a]),n.set(c,o))}return _("evidence-product.project.read",()=>{let c=U(e,t.kind,a,r);if(c===null)return null;s=c.length;try{let d=t.deserialize(c);return i=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:t.kind,available:!0,hit:i,payloadBytes:s}))},write(e,a,r,i){X(e,t.kind,a,r,t.serialize(i))}}}function Ue(t){let n=ae.find(e=>e.kind===t);if(!n)throw new Error(`missing evidence product manifest entry for ${t}`);return n.invalidation}function l(t,n){return{scope:"file",kind:t,invalidation:{scope:"file",...n}}}function m(t,n){return{scope:"project",kind:t,invalidation:{scope:"project",...n}}}var ie=h("source-text",{clearGroups:["whole-project","source-file"]}),se=h("source-lines",{clearGroups:["whole-project","source-file"]});function oe(t,n){let e=n.replace(/\\/g,"/");return ie.get(t,e,()=>{try{return w(t.config.projectRoot,e,{inputKind:"indexed source file"})}catch(a){if(P(a))return"";throw a}})}function ce(t,n){let e=n.replace(/\\/g,"/");return se.get(t,e,()=>{let a=oe(t,e);return a?a.split(`
76
- `):[]})}var de=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function le(t){let n=de.exec(t);return n?n[1]??"":null}function $e(t,n,e){return W(t,n,e).length>0}function Ge(t,n,e,a){let r=a.toLowerCase();return W(t,n,e).some(i=>i.toLowerCase()===r)}function W(t,n,e){if(e<=0)return[];let a=ce(t,n);if(a.length===0)return[];let r=[];for(let i=e-1;i>=0&&i>=e-5;i-=1){let s=(a[i]??"").trim();if(s==="")continue;let o=le(s);if(o!==null){r.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return r}return r}export{y as a,O as b,pe as c,ue as d,h as e,he as f,ve as g,G as h,I as i,Re as j,j as k,we as l,Pe as m,Fe as n,Le as o,Ae as p,ke as q,Ke as r,He as s,Ue as t,oe as u,ce as v,le as w,$e as x,Ge as y};
77
- //# sourceMappingURL=chunk-BMYOV5GP.js.map
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(t){if(t[2]!=="evidence")return;let i=t[3];if(!i||i.startsWith("-"))return;if(t.slice(4).some(e=>c.some(r=>e===r||e.startsWith(`${r}=`)))){t.splice(3,1,"--symbol",i);return}t[2]="evidence-source"}function a(t){return t!==void 0&&s.has(t)}async function p(t){if(t==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-65J5IP3O.js");return[n]}if(a(t)){let{directNavigationQueryCommandDescriptors:n}=await import("./direct-navigation-DP4LVMRX.js"),o=n.find(e=>e.id===t);if(!o)throw new Error(`Direct navigation command descriptor is unavailable: ${t}`);return[o]}let{commandDescriptors:i}=await import("./command-descriptors-6AOUKWW7.js");return i}export{d as a,a as b,p as c};
3
- //# sourceMappingURL=chunk-C74PPYLA.js.map