codebaseiq 0.1.0 → 0.2.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 (422) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-DQMDCD24.js → chunk-27PHVDKL.js} +2 -2
  4. package/dist/{chunk-ZMI2JSX2.js → chunk-2DMVFAY7.js} +2 -2
  5. package/dist/{chunk-5PUWMSDU.js → chunk-2E6BTWER.js} +2 -2
  6. package/dist/{chunk-YESXMKX3.js → chunk-2F5ERMNI.js} +2 -2
  7. package/dist/chunk-2VKB5CMA.js +60 -0
  8. package/dist/{chunk-NNJ2KZZG.js → chunk-327YK6TB.js} +4 -4
  9. package/dist/chunk-347TXATM.js +2 -0
  10. package/dist/{chunk-VEXUL62T.js → chunk-35YYZD3D.js} +2 -2
  11. package/dist/chunk-36WRYYTE.js +3 -0
  12. package/dist/chunk-37TKC6MB.js +2 -0
  13. package/dist/{chunk-FAJQ7LWY.js → chunk-3AC56WAR.js} +2 -2
  14. package/dist/{chunk-JE3WZ6II.js → chunk-3NUZVLR7.js} +2 -2
  15. package/dist/{chunk-UZGZB3VB.js → chunk-3XFJUWJE.js} +2 -2
  16. package/dist/{chunk-OVTS4DKB.js → chunk-4AOOSCZ7.js} +2 -2
  17. package/dist/{chunk-LU3BMVH2.js → chunk-4IFISPQW.js} +2 -2
  18. package/dist/chunk-4NHWNAWQ.js +11 -0
  19. package/dist/chunk-4O52YNKL.js +5 -0
  20. package/dist/{chunk-HPJRBHVT.js → chunk-54K6556S.js} +2 -2
  21. package/dist/{chunk-HRWGYWRJ.js → chunk-57GCCPLS.js} +2 -2
  22. package/dist/{chunk-J77SU6VA.js → chunk-57KEZDPT.js} +2 -2
  23. package/dist/{chunk-OFBE4NGP.js → chunk-57KFVPVZ.js} +2 -2
  24. package/dist/{chunk-WOQBZPIF.js → chunk-5BDK6QC3.js} +2 -2
  25. package/dist/{chunk-7MGU3HPH.js → chunk-5IO2APSS.js} +2 -2
  26. package/dist/chunk-5NJPH3QZ.js +61 -0
  27. package/dist/{chunk-GW6Z3WGY.js → chunk-5WXOEJ4G.js} +2 -2
  28. package/dist/chunk-5XEVXVTK.js +3 -0
  29. package/dist/{chunk-RR7SX44N.js → chunk-6OVNYYY4.js} +2 -2
  30. package/dist/{chunk-ZV3JV5G5.js → chunk-6SDEQTVY.js} +2 -2
  31. package/dist/{chunk-EF2R3WNQ.js → chunk-6URCE5QY.js} +2 -2
  32. package/dist/{chunk-UCD3H3UZ.js → chunk-6ZV5EDUT.js} +2 -2
  33. package/dist/{chunk-C6SBF2WH.js → chunk-77GHPR2R.js} +2 -2
  34. package/dist/{chunk-YVCIMIOC.js → chunk-7R64XY4Y.js} +2 -2
  35. package/dist/{chunk-VXYS3FZD.js → chunk-7Z7HCZ7J.js} +2 -2
  36. package/dist/{chunk-CO5R3UNA.js → chunk-A67HT5FR.js} +2 -2
  37. package/dist/{chunk-UDS562V4.js → chunk-A7XQT7MH.js} +2 -2
  38. package/dist/{chunk-RDBI2RXU.js → chunk-ACZDU5GK.js} +2 -2
  39. package/dist/{chunk-FETNQCFO.js → chunk-AM5SUGHF.js} +2 -2
  40. package/dist/{chunk-NNOKTMZT.js → chunk-B2E3HZ2A.js} +2 -2
  41. package/dist/{chunk-CVYSU6BX.js → chunk-BH5CE4LN.js} +2 -2
  42. package/dist/chunk-BLKYYQ7C.js +543 -0
  43. package/dist/{chunk-4WKDMDEW.js → chunk-BX2U3QQV.js} +2 -2
  44. package/dist/{chunk-ZKX2FRS6.js → chunk-CANBLFVQ.js} +2 -2
  45. package/dist/{chunk-SMRBZ6EC.js → chunk-CCRZLRWJ.js} +2 -2
  46. package/dist/chunk-CDWSLAPN.js +21 -0
  47. package/dist/chunk-CIVYHK7U.js +22 -0
  48. package/dist/{chunk-L57ZKWVG.js → chunk-CMXW7MFV.js} +2 -2
  49. package/dist/{chunk-T3DGWPXM.js → chunk-CSZOQ7YO.js} +2 -2
  50. package/dist/{chunk-ZZXSWSN6.js → chunk-CWMHWD56.js} +2 -2
  51. package/dist/{chunk-6NW7MU72.js → chunk-CZEIHYMP.js} +2 -2
  52. package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
  53. package/dist/{chunk-XWUOUWYI.js → chunk-DFPAZXLU.js} +2 -2
  54. package/dist/{chunk-MOVBWNIP.js → chunk-DKJXK3HA.js} +2 -2
  55. package/dist/{chunk-XMQ23E27.js → chunk-DLC6JDN7.js} +2 -2
  56. package/dist/chunk-DUKHVPU5.js +4 -0
  57. package/dist/{chunk-ID63777H.js → chunk-DVYG3JTA.js} +2 -2
  58. package/dist/{chunk-NE6IU5ZD.js → chunk-EFFMFK7C.js} +2 -2
  59. package/dist/{chunk-I2T2LLK2.js → chunk-EM5UHLAM.js} +2 -2
  60. package/dist/chunk-EN4AHLL3.js +3 -0
  61. package/dist/chunk-EXMVF3JR.js +3 -0
  62. package/dist/{chunk-SWHMHUKF.js → chunk-FEBLLMTL.js} +2 -2
  63. package/dist/chunk-FIXYHQ3W.js +3 -0
  64. package/dist/{chunk-RKEJ6VTF.js → chunk-FLLXYUOL.js} +2 -2
  65. package/dist/{chunk-KWVHSKHK.js → chunk-FPDL2TUB.js} +2 -2
  66. package/dist/chunk-FQA3KIFX.js +17 -0
  67. package/dist/chunk-FWY2PRIF.js +3 -0
  68. package/dist/chunk-FY5V4V4F.js +2 -0
  69. package/dist/chunk-G2XUZCF2.js +88 -0
  70. package/dist/{chunk-QHRNXP3C.js → chunk-GXVDTHFC.js} +2 -2
  71. package/dist/{chunk-6MUIJMVL.js → chunk-H3CKAL6P.js} +2 -2
  72. package/dist/chunk-H5QXP63L.js +2 -0
  73. package/dist/{chunk-VUIYB2V3.js → chunk-HBQGKMM3.js} +2 -2
  74. package/dist/{chunk-PYAB5SM6.js → chunk-HBXZAGY6.js} +2 -2
  75. package/dist/{chunk-NNO6A2PO.js → chunk-HCMQZPEO.js} +2 -2
  76. package/dist/{chunk-Q65CQ4XL.js → chunk-HHBBGWES.js} +2 -2
  77. package/dist/{chunk-GTXSJDCO.js → chunk-HIEXRDJF.js} +2 -2
  78. package/dist/{chunk-4FC325IF.js → chunk-HYKSLTAR.js} +2 -2
  79. package/dist/{chunk-XLQ3GLWZ.js → chunk-I2KP4AGR.js} +2 -2
  80. package/dist/chunk-I5FCDTK2.js +2 -0
  81. package/dist/{chunk-QKPLA6IC.js → chunk-I645ZF75.js} +2 -2
  82. package/dist/{chunk-FDGD5AB5.js → chunk-IBM3F2BJ.js} +2 -2
  83. package/dist/{chunk-Q72QSKXC.js → chunk-IEL6Q5W3.js} +38 -38
  84. package/dist/{chunk-NCZUNH3E.js → chunk-IGQQUENU.js} +12 -12
  85. package/dist/chunk-IGYAZPRX.js +4 -0
  86. package/dist/chunk-IOVPAZWP.js +3 -0
  87. package/dist/{chunk-OL6KJP3N.js → chunk-IVJJNVSX.js} +2 -2
  88. package/dist/{chunk-AKB7V7TV.js → chunk-IWAMYGPN.js} +2 -2
  89. package/dist/chunk-IYBIBMPF.js +90 -0
  90. package/dist/{chunk-IOP6FWIM.js → chunk-J24VICI5.js} +2 -2
  91. package/dist/{chunk-C7QOQX32.js → chunk-JN5LIBT3.js} +2 -2
  92. package/dist/{chunk-O6QTXQPJ.js → chunk-JOALNFY3.js} +2 -2
  93. package/dist/{chunk-GCHRX4YW.js → chunk-JUO3Z644.js} +2 -2
  94. package/dist/{chunk-BJ6SQAEN.js → chunk-JXHLB7TP.js} +2 -2
  95. package/dist/{chunk-IJ4HMYBE.js → chunk-JYX5UZSZ.js} +2 -2
  96. package/dist/chunk-K2O7SBAU.js +2 -0
  97. package/dist/{chunk-OLF4MA5W.js → chunk-K5G7SPAG.js} +2 -2
  98. package/dist/{chunk-YSNONTJ2.js → chunk-KDYQQJ6X.js} +2 -2
  99. package/dist/{chunk-7NVGT435.js → chunk-KM4QRWI5.js} +2 -2
  100. package/dist/{chunk-HKQUXIFO.js → chunk-KNV5VFDV.js} +2 -2
  101. package/dist/chunk-L3YSDLNB.js +2 -0
  102. package/dist/{chunk-EZNMUY67.js → chunk-LAGDJXFY.js} +2 -2
  103. package/dist/{chunk-ENCCHKM6.js → chunk-LY2NB5XR.js} +4 -4
  104. package/dist/chunk-M4EVGA5S.js +14 -0
  105. package/dist/chunk-M7LAIM77.js +127 -0
  106. package/dist/{chunk-BVAJLC5A.js → chunk-MRGTCMDK.js} +2 -2
  107. package/dist/{chunk-OZYRSMSH.js → chunk-MT5W4DUG.js} +2 -2
  108. package/dist/{chunk-VE5AVNMP.js → chunk-MTMF4N7F.js} +2 -2
  109. package/dist/chunk-N3Q3AWGW.js +545 -0
  110. package/dist/{chunk-TXXOEMZJ.js → chunk-NDGTJHQN.js} +2 -2
  111. package/dist/chunk-NIO346UL.js +2 -0
  112. package/dist/chunk-NJA4MMBD.js +2 -0
  113. package/dist/{chunk-7FND7D7N.js → chunk-NK76RSB6.js} +2 -2
  114. package/dist/{chunk-H3LGFZVK.js → chunk-NTRW52UR.js} +2 -2
  115. package/dist/{chunk-JOIRNPPY.js → chunk-OJFLPVBP.js} +2 -2
  116. package/dist/{chunk-KMITESMT.js → chunk-OMBRP7BB.js} +2 -2
  117. package/dist/{chunk-UP3BUZR5.js → chunk-OVKZM2XI.js} +2 -2
  118. package/dist/{chunk-MVB3DAEY.js → chunk-PARCKE3Q.js} +2 -2
  119. package/dist/{chunk-CAUCPUOF.js → chunk-PFPHS4NO.js} +2 -2
  120. package/dist/chunk-PHPQ24UG.js +22 -0
  121. package/dist/chunk-PLZXWZHY.js +77 -0
  122. package/dist/{chunk-34WBMAYK.js → chunk-PNVZIJ57.js} +2 -2
  123. package/dist/{chunk-SYDJMPES.js → chunk-QKVTWODE.js} +2 -2
  124. package/dist/{chunk-FW53T7EB.js → chunk-QLTFXVUI.js} +2 -2
  125. package/dist/{chunk-PBI2LFKH.js → chunk-QMGWSEPL.js} +2 -2
  126. package/dist/{chunk-CQP3THUZ.js → chunk-QVHZB75Z.js} +2 -2
  127. package/dist/{chunk-6BQ3DSPK.js → chunk-QVWDQTMG.js} +2 -2
  128. package/dist/{chunk-ST7V3SKN.js → chunk-RCPZOPV6.js} +2 -2
  129. package/dist/chunk-RJWAB4VR.js +345 -0
  130. package/dist/chunk-RRPK327J.js +20 -0
  131. package/dist/chunk-RVYLJDXC.js +21 -0
  132. package/dist/chunk-RWKEXCHU.js +3 -0
  133. package/dist/{chunk-L4NRUAGJ.js → chunk-S5SKXCND.js} +2 -2
  134. package/dist/{chunk-RBAS5ZHI.js → chunk-S64NCE2Z.js} +2 -2
  135. package/dist/{chunk-WMPRTGH2.js → chunk-SF34QLK2.js} +2 -2
  136. package/dist/{chunk-ANFVSJWQ.js → chunk-SJZQ2PTZ.js} +2 -2
  137. package/dist/{chunk-4XTAUQFD.js → chunk-SRY26ITJ.js} +2 -2
  138. package/dist/chunk-SV2LEFVM.js +2 -0
  139. package/dist/{chunk-7XAN6GKB.js → chunk-T3YFIJ5P.js} +2 -2
  140. package/dist/chunk-T55YPJGB.js +3 -0
  141. package/dist/chunk-TAJ6UGCO.js +21 -0
  142. package/dist/{chunk-PIOMTC27.js → chunk-TUTSO7UZ.js} +2 -2
  143. package/dist/{chunk-FQKZWM4L.js → chunk-U24M5RQM.js} +5 -5
  144. package/dist/{chunk-XME3HPXZ.js → chunk-U2XX3BT4.js} +2 -2
  145. package/dist/{chunk-SZD2KF7Q.js → chunk-UWB5WMC2.js} +2 -2
  146. package/dist/{chunk-6CS3UQTN.js → chunk-VCL7FK3E.js} +2 -2
  147. package/dist/{chunk-N3IQCBCF.js → chunk-VCWAJPXQ.js} +2 -2
  148. package/dist/{chunk-LZYFLFEH.js → chunk-VG55NFXF.js} +2 -2
  149. package/dist/{chunk-PTAWHLVJ.js → chunk-VLTUX4IF.js} +2 -2
  150. package/dist/{chunk-JEJLSICM.js → chunk-VVCBMH5O.js} +2 -2
  151. package/dist/{chunk-JSOYNVWH.js → chunk-VYZQZ4ZN.js} +2 -2
  152. package/dist/chunk-W3FK73MD.js +8 -0
  153. package/dist/{chunk-UNBY47BC.js → chunk-W6C6QTXJ.js} +2 -2
  154. package/dist/chunk-WH5SYOMD.js +2 -0
  155. package/dist/chunk-WJOQC4P7.js +7 -0
  156. package/dist/chunk-WO47BIPY.js +3 -0
  157. package/dist/chunk-WOOTEWQT.js +239 -0
  158. package/dist/{chunk-UBGWN7I4.js → chunk-X5I2BQGX.js} +2 -2
  159. package/dist/{chunk-PX4RYAAK.js → chunk-XNUWRTYM.js} +2 -2
  160. package/dist/{chunk-ICFDQHAM.js → chunk-XUJM6474.js} +2 -2
  161. package/dist/chunk-XYLV727H.js +21 -0
  162. package/dist/{chunk-TRRC4ZJ7.js → chunk-YFQPWKHR.js} +2 -2
  163. package/dist/{chunk-NEDP5RFQ.js → chunk-YIOQJ45A.js} +2 -2
  164. package/dist/{chunk-Y6KHROC3.js → chunk-YXJ4IAHH.js} +2 -2
  165. package/dist/chunk-YYFV32WR.js +3 -0
  166. package/dist/{chunk-BH5F2Q4O.js → chunk-ZB3V5QM7.js} +2 -2
  167. package/dist/chunk-ZJZQ7Q2Q.js +3 -0
  168. package/dist/{chunk-EMNIHCRB.js → chunk-ZNQCR656.js} +2 -2
  169. package/dist/{chunk-TIIC3ZE7.js → chunk-ZOEDRCR4.js} +2 -2
  170. package/dist/cli-context-TSADTXLB.js +2 -0
  171. package/dist/cli-context-XEPPF4RX.js +3 -0
  172. package/dist/cli-program-KJGQEM72.js +7 -0
  173. package/dist/cli.js +1 -1
  174. package/dist/{code-DlqpBDd0.d.ts → code-CDe-mIjx.d.ts} +1 -1
  175. package/dist/code-viewer-YGDON6SY.js +12 -0
  176. package/dist/code-viewer-ZCTHXQ5C.js +11 -0
  177. package/dist/command-descriptors-5VAB2MZX.js +335 -0
  178. package/dist/command-descriptors-EAHKIRAG.js +337 -0
  179. package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
  180. package/dist/{db-D7sauVFH.d.ts → db-DmRNdCtm.d.ts} +1 -1
  181. package/dist/direct-navigation-B3SGOOBW.js +2 -0
  182. package/dist/direct-navigation-ZL362KXF.js +3 -0
  183. package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-Bs54NWws.d.ts} +1 -1
  184. package/dist/{health-DJaZXg8I.d.ts → health-BnzbSLCE.d.ts} +1 -1
  185. package/dist/index.d.ts +2 -2
  186. package/dist/index.js +1 -1
  187. package/dist/invocation-command-descriptors-CSUGUHTT.js +2 -0
  188. package/dist/invocation-command-descriptors-PPVZOIE5.js +3 -0
  189. package/dist/output-continuation-command-FTVVBVSN.js +2 -0
  190. package/dist/output-continuation-command-ITPRC3YV.js +3 -0
  191. package/dist/project-reindex-7HZSLLLY.js +3 -0
  192. package/dist/project-reindex-NGM3DYBN.js +2 -0
  193. package/dist/queries/affected.d.ts +2 -2
  194. package/dist/queries/affected.js +1 -1
  195. package/dist/queries/anchors.d.ts +2 -2
  196. package/dist/queries/anchors.js +1 -1
  197. package/dist/queries/architecture.d.ts +2 -2
  198. package/dist/queries/architecture.js +1 -1
  199. package/dist/queries/bottlenecks.d.ts +2 -2
  200. package/dist/queries/bottlenecks.js +1 -1
  201. package/dist/queries/by-kind.d.ts +2 -2
  202. package/dist/queries/by-kind.js +1 -1
  203. package/dist/queries/call-graph.d.ts +2 -2
  204. package/dist/queries/call-graph.js +1 -1
  205. package/dist/queries/change-surface.d.ts +2 -2
  206. package/dist/queries/change-surface.js +1 -1
  207. package/dist/queries/cleanup-plan.d.ts +2 -2
  208. package/dist/queries/cleanup-plan.js +1 -1
  209. package/dist/queries/co-change.d.ts +2 -2
  210. package/dist/queries/co-change.js +1 -1
  211. package/dist/queries/code.d.ts +3 -3
  212. package/dist/queries/code.js +1 -1
  213. package/dist/queries/complexity-hotspots.d.ts +2 -2
  214. package/dist/queries/complexity-hotspots.js +1 -1
  215. package/dist/queries/complexity.d.ts +2 -2
  216. package/dist/queries/complexity.js +1 -1
  217. package/dist/queries/context.d.ts +2 -2
  218. package/dist/queries/context.js +1 -1
  219. package/dist/queries/convergence.d.ts +2 -2
  220. package/dist/queries/convergence.js +1 -1
  221. package/dist/queries/coupling.d.ts +2 -2
  222. package/dist/queries/coupling.js +1 -1
  223. package/dist/queries/cycles.d.ts +2 -2
  224. package/dist/queries/cycles.js +1 -1
  225. package/dist/queries/dataflow.d.ts +2 -2
  226. package/dist/queries/dataflow.js +1 -1
  227. package/dist/queries/dead.d.ts +2 -2
  228. package/dist/queries/dead.js +1 -1
  229. package/dist/queries/decorative-checkers.d.ts +2 -2
  230. package/dist/queries/decorative-checkers.js +1 -1
  231. package/dist/queries/deep-chains.d.ts +2 -2
  232. package/dist/queries/deep-chains.js +1 -1
  233. package/dist/queries/dependence-slice.d.ts +3 -3
  234. package/dist/queries/dependence-slice.js +1 -1
  235. package/dist/queries/dependency-depth.d.ts +2 -2
  236. package/dist/queries/dependency-depth.js +1 -1
  237. package/dist/queries/deps.d.ts +2 -2
  238. package/dist/queries/deps.js +1 -1
  239. package/dist/queries/diff-impact.d.ts +2 -2
  240. package/dist/queries/diff-impact.js +1 -1
  241. package/dist/queries/doc-drift.d.ts +2 -2
  242. package/dist/queries/doc-drift.js +1 -1
  243. package/dist/queries/drift.d.ts +2 -2
  244. package/dist/queries/drift.js +1 -1
  245. package/dist/queries/duplicate-bodies.d.ts +2 -2
  246. package/dist/queries/duplicate-bodies.js +1 -1
  247. package/dist/queries/entry-map.d.ts +2 -2
  248. package/dist/queries/entry-map.js +1 -1
  249. package/dist/queries/evidence.d.ts +3 -3
  250. package/dist/queries/evidence.js +1 -1
  251. package/dist/queries/extract-candidates.d.ts +2 -2
  252. package/dist/queries/extract-candidates.js +1 -1
  253. package/dist/queries/fan.d.ts +2 -2
  254. package/dist/queries/fan.js +1 -1
  255. package/dist/queries/files.d.ts +2 -2
  256. package/dist/queries/files.js +1 -1
  257. package/dist/queries/health.d.ts +3 -3
  258. package/dist/queries/health.js +1 -1
  259. package/dist/queries/hierarchy.d.ts +2 -2
  260. package/dist/queries/hierarchy.js +1 -1
  261. package/dist/queries/hotspots.d.ts +2 -2
  262. package/dist/queries/hotspots.js +1 -1
  263. package/dist/queries/imports.d.ts +2 -2
  264. package/dist/queries/imports.js +1 -1
  265. package/dist/queries/incomplete-migration.d.ts +2 -2
  266. package/dist/queries/incomplete-migration.js +1 -1
  267. package/dist/queries/index.d.ts +5 -5
  268. package/dist/queries/index.js +1 -1
  269. package/dist/queries/isolated.d.ts +2 -2
  270. package/dist/queries/isolated.js +1 -1
  271. package/dist/queries/locality-candidates.d.ts +2 -2
  272. package/dist/queries/locality-candidates.js +1 -1
  273. package/dist/queries/members.d.ts +2 -2
  274. package/dist/queries/members.js +1 -1
  275. package/dist/queries/methods.d.ts +2 -2
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.d.ts +2 -2
  278. package/dist/queries/not-implemented.js +1 -1
  279. package/dist/queries/outline.d.ts +2 -2
  280. package/dist/queries/outline.js +1 -1
  281. package/dist/queries/passthrough-candidates.d.ts +2 -2
  282. package/dist/queries/passthrough-candidates.js +1 -1
  283. package/dist/queries/plan-context.d.ts +2 -2
  284. package/dist/queries/plan-context.js +1 -1
  285. package/dist/queries/react-component-duplicates.d.ts +2 -2
  286. package/dist/queries/react-component-duplicates.js +1 -1
  287. package/dist/queries/react-hook-candidates.d.ts +2 -2
  288. package/dist/queries/react-hook-candidates.js +1 -1
  289. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  290. package/dist/queries/react-large-component-pressure.js +1 -1
  291. package/dist/queries/recent-duplicates.d.ts +2 -2
  292. package/dist/queries/recent-duplicates.js +1 -1
  293. package/dist/queries/redundant-reexports.d.ts +2 -2
  294. package/dist/queries/redundant-reexports.js +1 -1
  295. package/dist/queries/reference-neighborhood.d.ts +2 -2
  296. package/dist/queries/reference-neighborhood.js +1 -1
  297. package/dist/queries/reference-reachability.d.ts +2 -2
  298. package/dist/queries/reference-reachability.js +1 -1
  299. package/dist/queries/refs.d.ts +2 -2
  300. package/dist/queries/refs.js +1 -1
  301. package/dist/queries/self-audit.d.ts +2 -2
  302. package/dist/queries/self-audit.js +1 -1
  303. package/dist/queries/similar-chains.d.ts +2 -2
  304. package/dist/queries/similar-chains.js +1 -1
  305. package/dist/queries/similar-files.d.ts +2 -2
  306. package/dist/queries/similar-files.js +1 -1
  307. package/dist/queries/similar-signatures.d.ts +2 -2
  308. package/dist/queries/similar-signatures.js +1 -1
  309. package/dist/queries/similar.d.ts +2 -2
  310. package/dist/queries/similar.js +1 -1
  311. package/dist/queries/slice.d.ts +2 -2
  312. package/dist/queries/slice.js +1 -1
  313. package/dist/queries/source-inspection.d.ts +4 -4
  314. package/dist/queries/source-inspection.js +1 -1
  315. package/dist/queries/source-search.d.ts +2 -2
  316. package/dist/queries/source-search.js +1 -1
  317. package/dist/queries/stale-abstractions.d.ts +2 -2
  318. package/dist/queries/stale-abstractions.js +1 -1
  319. package/dist/queries/stats.d.ts +2 -2
  320. package/dist/queries/surface.d.ts +2 -2
  321. package/dist/queries/surface.js +1 -1
  322. package/dist/queries/symbols.d.ts +2 -2
  323. package/dist/queries/symbols.js +1 -1
  324. package/dist/queries/system-map.d.ts +2 -2
  325. package/dist/queries/system-map.js +1 -1
  326. package/dist/queries/system.d.ts +2 -2
  327. package/dist/queries/system.js +1 -1
  328. package/dist/queries/test-quality.d.ts +2 -2
  329. package/dist/queries/test-quality.js +1 -1
  330. package/dist/queries/trace.d.ts +2 -2
  331. package/dist/queries/trace.js +1 -1
  332. package/dist/queries/twin-ab.d.ts +2 -2
  333. package/dist/queries/twin-ab.js +1 -1
  334. package/dist/queries/twin-drift.d.ts +2 -2
  335. package/dist/queries/twin-drift.js +1 -1
  336. package/dist/queries/unused-imports.d.ts +2 -2
  337. package/dist/queries/unused-imports.js +1 -1
  338. package/dist/queries/unused-params.d.ts +2 -2
  339. package/dist/queries/unused-params.js +1 -1
  340. package/dist/queries/value-flow.d.ts +3 -3
  341. package/dist/queries/value-flow.js +1 -1
  342. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  343. package/dist/queries/vue-component-duplicates.js +1 -1
  344. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  345. package/dist/queries/vue-composable-candidates.js +1 -1
  346. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  347. package/dist/queries/vue-large-view-pressure.js +1 -1
  348. package/dist/queries/wrapper-candidates.d.ts +2 -2
  349. package/dist/queries/wrapper-candidates.js +1 -1
  350. package/dist/reindex-worker.js +1 -1
  351. package/dist/reindex.d.ts +3 -3
  352. package/dist/reindex.js +31 -31
  353. package/dist/runtime.d.ts +24 -4
  354. package/dist/runtime.js +3 -3
  355. package/dist/rust-semantic-session-server.js +1 -1
  356. package/dist/rust-semantic-session-worker.js +1 -1
  357. package/dist/rust-semantic-worker.js +1 -1
  358. package/dist/{scip-cli-B7N3haxa.d.ts → scip-cli-BRFKkHQn.d.ts} +1 -1
  359. package/dist/sentinel-ensure-command-KYYULCFU.js +2 -0
  360. package/dist/sentinel-ensure-command-RIZA3RY7.js +3 -0
  361. package/dist/sentinel-hook.js +39 -0
  362. package/dist/sentinel-worker.js +16 -0
  363. package/dist/typescript-mailbox-worker.js +1 -1
  364. package/dist/watch-server.js +6 -6
  365. package/docs/COMMAND_REFERENCE.md +5 -3
  366. package/docs/schemas/project-config.schema.json +159 -0
  367. package/package.json +9 -5
  368. package/skills/codebaseiq/SKILL.md +1 -1
  369. package/skills/concrete-plan/SKILL.md +1 -1
  370. package/ui/view/api.js +450 -0
  371. package/ui/view/app.js +394 -0
  372. package/ui/view/builder.js +323 -0
  373. package/ui/view/file-panel.js +170 -0
  374. package/ui/view/focus.js +379 -0
  375. package/ui/view/index.html +54 -0
  376. package/ui/view/map.js +424 -0
  377. package/ui/view/styles.css +1125 -0
  378. package/dist/chunk-2X7V4HS4.js +0 -88
  379. package/dist/chunk-3IER7Q6H.js +0 -12
  380. package/dist/chunk-3JSXXYTZ.js +0 -345
  381. package/dist/chunk-476NR5B7.js +0 -2
  382. package/dist/chunk-5VKBFZZU.js +0 -3
  383. package/dist/chunk-ADTBPVUZ.js +0 -21
  384. package/dist/chunk-BFFZDZQV.js +0 -2
  385. package/dist/chunk-BMYOV5GP.js +0 -77
  386. package/dist/chunk-C74PPYLA.js +0 -3
  387. package/dist/chunk-CWONGW6P.js +0 -3
  388. package/dist/chunk-DDZ7VHWV.js +0 -20
  389. package/dist/chunk-DR2LURYU.js +0 -3
  390. package/dist/chunk-ECQBG7PW.js +0 -564
  391. package/dist/chunk-FM5BPL4V.js +0 -60
  392. package/dist/chunk-G6XFR4ZL.js +0 -4
  393. package/dist/chunk-GTIYTDRE.js +0 -562
  394. package/dist/chunk-HOA5YGOH.js +0 -3
  395. package/dist/chunk-KUW32IRO.js +0 -2
  396. package/dist/chunk-LTA3BRZX.js +0 -2
  397. package/dist/chunk-NAUD7LCA.js +0 -2
  398. package/dist/chunk-OGTFJ3XD.js +0 -2
  399. package/dist/chunk-Q5ELPRKQ.js +0 -2
  400. package/dist/chunk-QCN62RTF.js +0 -3
  401. package/dist/chunk-QW7EP6WI.js +0 -21
  402. package/dist/chunk-RU65DDUP.js +0 -215
  403. package/dist/chunk-SELM5MER.js +0 -2
  404. package/dist/chunk-SNNWPCN7.js +0 -4
  405. package/dist/chunk-TFZB6XTM.js +0 -239
  406. package/dist/chunk-UXM43C7T.js +0 -3
  407. package/dist/chunk-VFY6Y2H6.js +0 -61
  408. package/dist/chunk-WE5RZHZ7.js +0 -5
  409. package/dist/chunk-Z54RD7VL.js +0 -3
  410. package/dist/cli-context-3SNLDYBM.js +0 -3
  411. package/dist/cli-context-T3B7W6GG.js +0 -2
  412. package/dist/cli-program-YNOXO72B.js +0 -7
  413. package/dist/command-descriptors-6AOUKWW7.js +0 -346
  414. package/dist/command-descriptors-ZFKJSRUP.js +0 -344
  415. package/dist/direct-navigation-DP4LVMRX.js +0 -3
  416. package/dist/direct-navigation-FLUS3BT6.js +0 -2
  417. package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
  418. package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
  419. package/dist/output-continuation-command-2V2SL4TD.js +0 -2
  420. package/dist/output-continuation-command-65J5IP3O.js +0 -3
  421. package/dist/project-reindex-5JOKXAXT.js +0 -2
  422. package/dist/project-reindex-UQBIKO4M.js +0 -3
@@ -0,0 +1,14 @@
1
+ import{a as at}from"./chunk-ILMHV3KM.js";import{a as mt}from"./chunk-IGYAZPRX.js";import{G as ht,a as pt,b as gt,h as Z,i as W,j as de,k as bt}from"./chunk-BLKYYQ7C.js";import{b as We,c as je,j as he,n as ot,x as st}from"./chunk-IGQQUENU.js";import{b as Ve,c as Ge,d as qe}from"./chunk-2Q2LW5JW.js";import{D as tt,E as nt,I as rt}from"./chunk-M7LAIM77.js";import{d as Qe,e as Ze,f as et}from"./chunk-DRENNWRG.js";import{b as X,c as Ee,d as it,e as dt,f as ct,i as lt,j as ut,k as ft}from"./chunk-WJOQC4P7.js";import{a as be,l as Xe,m as Ye}from"./chunk-IYBIBMPF.js";import{i as H,j as J,m as ze}from"./chunk-XYLV727H.js";import{b as Je}from"./chunk-4NHWNAWQ.js";import{a as Ke}from"./chunk-2VKB5CMA.js";import{d as ge,e as ie}from"./chunk-6URCE5QY.js";import{e as He,g as pe}from"./chunk-4O52YNKL.js";import{join as $e}from"path";import{createHash as gn}from"crypto";import{mkdirSync as Ct,mkdtempSync as bn,renameSync as hn,rmSync as kt,statSync as En,writeFileSync as wt}from"fs";import{tmpdir as yn}from"os";import{extname as Sn,join as ee,resolve as vn,sep as Cn}from"path";var kn=1024*1024,Et=500,wn=64,Rn=/\.(?:cmd|bat)$/i;async function Rt(e,t,n={}){let r=Se(e);if(!r.ok)return $(r.reason,r.detail);let a=JSON.stringify(it),o;try{Ct(t.workDir,{recursive:!0}),o=bn(ee(yn(),"codebaseiq-probe-")),e.argv.includes("{schemaFile}")&&wt(ee(o,"schema.json"),a)}catch(s){return yt(o),$("spawn-failed",`could not prepare the agent sandbox: ${te(xn(s))}`)}try{let s=ee(o,"schema.json"),d=ee(o,"output.json"),i=e.argv.includes("{outputFile}"),c=new Map([["{schemaJson}",a],["{schemaFile}",s],["{outputFile}",d]]),l=Ge(r.path,e.argv.slice(1).map(S=>c.get(S)??S)),b;try{b=await je({command:l.binary,args:l.args,label:`agent probe command ${e.name}`,timeoutMs:e.timeoutMs,maxStdoutBytes:e.maxOutputBytes,maxStderrBytes:kn,cwd:t.workDir,env:Tn(n.env??process.env),input:ct(t.description,t.languages),signal:n.signal})}catch(S){return _n(S,n.signal)}if(b.status!==0){let S=St(b.stdout),g=b.status===null?`signal ${b.signal}`:`code ${b.status}`,m=S.kind==="error"?S.detail:b.stderr.trim()||b.stdout.trim();return $("agent-error",`${e.name} exited with ${g}: ${te(m)}`)}let p=[];if(i){let S=Mn(d,e.maxOutputBytes);if(S==="too-large")return $("output-too-large",`${e.name} wrote more than ${e.maxOutputBytes} bytes.`);S!==null&&p.push(S)}p.push(b.stdout);for(let S of p){let g=St(S);if(g.kind==="error")return $("agent-error",g.detail);if(g.kind==="none")continue;let{probes:m,diagnostics:w}=Ee(g.value);return X(m)?{ok:!0,probes:m,diagnostics:w,raw:S.trim()}:$("invalid-probes",On(w))}return $("no-json",`${e.name} printed no JSON object: ${te(b.stdout.trim())}`)}finally{yt(o)}}function yt(e){if(e!==void 0)try{kt(e,{recursive:!0,force:!0,maxRetries:3})}catch{}}function xn(e){return e instanceof Error?e.message:String(e)}function $(e,t){return{ok:!1,reason:e,detail:t}}function Pn(e){let t=ut({agent:{commands:[e]}}).filter(n=>n.level==="error");return t.length>0?t.map(n=>`${n.path}: ${n.message}`).join(" "):ft.has(e.argv[0])?"argv[0] must be the executable, not a placeholder.":[e.timeoutMs,e.maxOutputBytes].every(n=>Number.isFinite(n)&&n>0)?null:"timeoutMs and maxOutputBytes must be positive numbers."}function Se(e){let t=Pn(e);if(t)return{ok:!1,reason:"misconfigured",detail:t};let n=e.argv[0],r=`argv[0] "${n}" is a .cmd/.bat shim, which cannot be started without a shell. Point argv[0] at the real executable or at a node script (.js, .mjs, .cjs).`,a=n.includes("/")||n.includes(Cn),o;if(a){o=An(vn(n));let s=ye(o);if(s==="missing")return{ok:!1,reason:"spawn-failed",detail:`argv[0] "${n}" was not found.`};if(s==="other")return{ok:!1,reason:"misconfigured",detail:`argv[0] "${n}" is not an executable file.`}}else o=qe(n);return o===null?Ve(n)?{ok:!1,reason:"misconfigured",detail:r}:{ok:!1,reason:"spawn-failed",detail:`argv[0] "${n}" was not found on PATH.`}:process.platform==="win32"&&Rn.test(o)?{ok:!1,reason:"misconfigured",detail:r}:{ok:!0,path:o}}function An(e,t=process.platform){return t!=="win32"||Sn(e)!==""||ye(e)!=="missing"?e:[".exe",".com"].map(n=>`${e}${n}`).find(n=>ye(n)==="file")??e}function ye(e){try{return En(e).isFile()?"file":"other"}catch{return"missing"}}function Tn(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&!/^CODEBASEIQ_/i.test(n)&&(t[n]=r);return t}function _n(e,t){if(!(e instanceof We))throw e;switch(e.kind){case"spawn":return $("spawn-failed",e.message);case"timeout":return $("timeout",e.message);case"stdout-limit":case"stderr-limit":return $("output-too-large",e.message);case"aborted":throw t?H(t,e.message):e}}function Mn(e,t){try{return pe(e,{maxBytes:t,inputKind:"agent output file"})}catch(n){return n instanceof He&&n.reason==="too-large"?"too-large":null}}function St(e){let t=vt(e);if(!t)return{kind:"none"};if(t.type!=="result")return{kind:"object",value:t};if(t.is_error===!0){let r=typeof t.result=="string"&&t.result?t.result:t.subtype;return{kind:"error",detail:te(`The agent reported an error: ${String(r??"no message")}`)}}if(Pt(t.structured_output))return{kind:"object",value:t.structured_output};let n=typeof t.result=="string"?vt(t.result):null;return n?{kind:"object",value:n}:{kind:"none"}}function vt(e){let t=e.trim();return xt(t)??Bn(t)}function xt(e){try{let t=JSON.parse(e);return Pt(t)?t:null}catch{return null}}function Bn(e){let t=/\{\s*["}]/g,n=null,r=0;for(let a=0;a<wn;){t.lastIndex=r;let o=t.exec(e);if(!o)break;let s=Nn(e,o.index),d=s===-1?null:xt(e.slice(o.index,s+1));d?(n=d,r=s+1):(r=o.index+1,a++)}return n}function Nn(e,t){let n=0,r=!1,a=!1;for(let o=t;o<e.length;o++){let s=e[o];if(r)a?a=!1:s==="\\"?a=!0:s==='"'&&(r=!1);else if(s==='"')r=!0;else if(s==="{")n++;else if(s==="}"&&--n===0)return o}return-1}function Pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function On(e){return e.length===0?"The agent returned no usable probes.":te(`The agent returned no usable probes: ${e.slice(0,3).map(t=>`${t.path||"root"}: ${t.message}`).join("; ")}`)}function te(e){return e.length>Et?`${e.slice(0,Et)}...`:e}var Fn=64*1024,Ln=3600*1e3;function At(e,t,n=Date.now){let r=(a,o)=>ee(e,`${gn("sha256").update(JSON.stringify([a,3,o])).digest("hex")}.json`);return{get(a,o){try{let s=JSON.parse(pe(r(a,o),{maxBytes:Fn,inputKind:"agent probe cache entry"}));if(typeof s.storedAt!="number"||n()-s.storedAt>=t*Ln)return;let{probes:d}=Ee(s.probes);return X(d)?d:void 0}catch{return}},set(a,o,s){let d=r(a,o),i=`${d}.${process.pid}.tmp`;try{Ct(e,{recursive:!0}),wt(i,JSON.stringify({storedAt:n(),probes:s})),hn(i,d)}catch{try{kt(i,{force:!0})}catch{}}}}}import{BlockList as In,isIP as $n}from"net";var Ce=64*1024*1024,Dn=2,Tt="embedding request aborted",Un="codebaseiq embedding canary: parse a retry delay from a config file",M=class extends Error{constructor(n,r,a){super(r);this.kind=n;this.status=a;this.name="EmbeddingClientError"}kind;status},ne=new In;for(let[e,t]of[["127.0.0.0",8],["10.0.0.0",8],["172.16.0.0",12],["192.168.0.0",16],["100.64.0.0",10],["169.254.0.0",16]])ne.addSubnet(e,t,"ipv4");ne.addAddress("::1","ipv6");ne.addSubnet("fe80::",10,"ipv6");ne.addSubnet("fc00::",7,"ipv6");var Hn=[".local",".lan",".home.arpa",".internal"];function _t(e){let t;try{t=new URL(e).hostname}catch{return!1}let n=(t.startsWith("[")?t.slice(1,-1):t).replace(/\.$/,""),r=$n(n);return r!==0?ne.check(n,r===4?"ipv4":"ipv6"):n==="localhost"||Hn.some(a=>n.endsWith(a))}function Nt(e,t={}){let n=t.fetchImpl??fetch,r=t.env??process.env,a=e.baseUrl.replace(/\/+$/,"");function o(){let l=e.apiKeyEnv?r[e.apiKeyEnv]:void 0;return l||void 0}function s(){let l;try{l=new URL(e.baseUrl)}catch{throw new M("invalid-endpoint",`embedding endpoint "${e.name}" has an invalid baseUrl`)}if(l.protocol!=="http:"&&l.protocol!=="https:")throw new M("invalid-endpoint",`embedding endpoint "${e.name}" must use http or https`);if(l.username!==""||l.password!=="")throw new M("invalid-endpoint",`embedding endpoint "${e.name}" must not embed credentials in baseUrl; use apiKeyEnv`);if(!e.allowRemote&&!_t(e.baseUrl))throw new M("remote-not-allowed",`embedding endpoint "${e.name}" is not on a private network; set allowRemote to use it`);if(l.protocol==="http:"&&o()!==void 0&&!_t(e.baseUrl))throw new M("insecure-token-transport",`embedding endpoint "${e.name}" would send its API key over plain http to a non-private host; use https`)}function d(l){let b={};l&&(b["content-type"]="application/json");let p=o();return p&&(b.authorization=`Bearer ${p}`),b}async function i(l,b,p,S){let g={model:e.model,input:l,encoding_format:"float",...e.dimensions!==void 0?{dimensions:e.dimensions}:{}},{status:m,text:w}=await Mt(n,`${a}/embeddings`,{method:"POST",headers:d(!0),body:JSON.stringify(g)},b,!0,S);if(m<200||m>=300)throw new M("http",`embeddings request failed with HTTP ${m}`,m);return Vn(w,l.length,p)}async function c(l,b,p){try{return await i(l,e.requestTimeoutMs,b,p)}catch(S){if(!Wn(S))throw S;return i(l,e.requestTimeoutMs,b,p)}}return{async checkHealth({signal:l}={}){try{s()}catch(p){return ve(p)}try{await Mt(n,`${a}/models`,{method:"GET",headers:d(!1)},e.healthTimeoutMs,!1,l)}catch(p){return l?.aborted?ve(p,l):{ok:!1,reason:"unreachable",detail:ke(p)}}let b=ge();try{let[p]=await i([e.documentPrefix+Un],e.warmTimeoutMs,{dims:e.dimensions},l);return{ok:!0,model:e.model,dimensions:p.length,latencyMs:Math.round(ge()-b),canary:p}}catch(p){return ve(p,l)}},async embed(l,b,{signal:p}={}){if(s(),l.length===0)return[];let S=b==="query"?e.queryPrefix:e.documentPrefix,g=Math.max(1,Math.floor(e.batchSize)),m=[];for(let x=0;x<l.length;x+=g)m.push(l.slice(x,x+g).map(A=>S+A));let w={dims:e.dimensions};return(await at(m,Dn,x=>c(x,w,p))).flat()}}}function Wn(e){return e instanceof M&&(e.kind==="timeout"||e.kind==="http"&&(e.status??0)>=500)}function ve(e,t){let n=ke(e);if(t?.aborted)return{ok:!1,reason:"aborted",detail:n};if(!(e instanceof M))return{ok:!1,reason:"bad-response",detail:n};switch(e.kind){case"remote-not-allowed":case"insecure-token-transport":case"invalid-endpoint":return{ok:!1,reason:e.kind,detail:n};case"network":return{ok:!1,reason:"unreachable",detail:n};case"timeout":return{ok:!1,reason:"model-loading",detail:n};case"http":return e.status===503?{ok:!1,reason:"model-loading",detail:n}:e.status===401||e.status===403?{ok:!1,reason:"unauthorized",detail:n}:{ok:!1,reason:"bad-response",detail:n};default:return{ok:!1,reason:"bad-response",detail:n}}}function ke(e){return e instanceof Error?e.message:String(e)}async function Mt(e,t,n,r,a,o){J(o,Tt);let s=new AbortController,d=setTimeout(()=>{s.abort(new M("timeout",`no response within ${r}ms`))},r),i=()=>s.abort(o?.reason);o?.addEventListener("abort",i,{once:!0});try{let c=await Ot(e(t,{...n,signal:s.signal,redirect:"error"}),s.signal);return{status:c.status,text:a?await Kn(c,s.signal):""}}catch(c){throw o?.aborted&&s.signal.reason===o.reason?H(o,Tt):c instanceof M?c:s.signal.aborted&&s.signal.reason instanceof M?s.signal.reason:new M("network",`could not reach the embeddings endpoint: ${jn(c)}`)}finally{clearTimeout(d),o?.removeEventListener("abort",i),s.abort()}}function jn(e){let t=e instanceof Error?e.cause:void 0;return typeof t?.code=="string"?t.code:ke(e)}async function Kn(e,t){let n=Number(e.headers.get("content-length"));if(Number.isFinite(n)&&n>Ce)throw Bt();if(!e.body)return"";let r=e.body.getReader(),a=[],o=0;for(;;){let{done:s,value:d}=await Ot(r.read(),t);if(s)break;if(o+=d.byteLength,o>Ce)throw r.cancel().catch(()=>{}),Bt();a.push(d)}return new TextDecoder().decode(Buffer.concat(a))}function Bt(){return new M("too-large",`embeddings response exceeded the ${Ce} byte limit`)}function Ot(e,t){return new Promise((n,r)=>{let a=()=>r(t.reason);if(t.aborted){a();return}t.addEventListener("abort",a,{once:!0}),e.then(n,r).finally(()=>t.removeEventListener("abort",a))})}function Vn(e,t,n){let r;try{r=JSON.parse(e)}catch{throw j("response is not valid JSON")}let a=typeof r=="object"&&r!==null?r.data:void 0;if(!Array.isArray(a)||a.length!==t)throw j(`expected ${t} embeddings, received ${Array.isArray(a)?a.length:"none"}`);let o=new Array(t).fill(void 0),s=new Set;return a.forEach((d,i)=>{let c=typeof d=="object"&&d!==null?d:{},l=c.index===void 0?i:c.index;if(typeof l!="number"||!Number.isInteger(l)||l<0||l>=t||s.has(l))throw j("embedding indexes are not a permutation of the inputs");s.add(l),o[l]=c.embedding}),o.map(d=>Gn(d,n))}function Gn(e,t){if(!Array.isArray(e)||e.length===0)throw j("embedding is not a non-empty float array");if(t.dims!==void 0&&e.length!==t.dims)throw j(`embedding has ${e.length} dimensions, expected ${t.dims}`);let n=0;for(let o of e){if(typeof o!="number"||!Number.isFinite(o))throw j("embedding contains a non-finite value");n+=o*o}let r=Math.sqrt(n);if(!Number.isFinite(r)||r===0)throw j("embedding has zero or unrepresentable magnitude");t.dims=e.length;let a=new Float32Array(e.length);for(let o=0;o<e.length;o+=1)a[o]=e[o]/r;return a}function j(e){return new M("bad-response",`embeddings response rejected: ${e}`)}var xe=["name","container","doc","signature","path"],qn=1e3,zn=150,Jn=400,Xn=3,we=/@deprecated\b|#\[deprecated\b|\bdeprecated\s*[:(]/i,Ft=/^\s*(?:\/\/|\/\*|\*|#|@)/,Yn=new Set(gt()),Qn=/(?:^|\/)(?:__generated__|generated)\/|\.(?:generated|gen|g)\.[a-z0-9]+$|\.pb2?\.[a-z0-9]+$|_pb2?\.[a-z0-9]+$/i,Re=/@generated\b|\bcode generated\b.*\bdo not edit\b/i,Zn=40,er=/^(?:\/\/|--|#(?![[!\w]))/,tr=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function|(?:abstract\s+)?class|interface|type|enum|namespace|module|const|let|var)\s+([\p{L}\p{N}_$]+)/u,nr=/^\s*export\s*\{([^}\n]*)/,rr=/[\p{L}\p{N}_$]+/gu,or=2,sr=Je("builder-candidate-corpus",{clearGroups:["whole-project","definition-catalog"]});function Y(e){return sr.get(e,()=>dr(e))}function D(e,t=2,n=Number.POSITIVE_INFINITY){let r=[],a=[],o=new Set;for(let s of W(e)){if(r.length>=n)break;if(Z.has(s.toLocaleLowerCase()))continue;let d=de(s),i=d[0];if(!(i.length<t||Z.has(i))){r.push(i),a.push(d);for(let c of d)o.add(c)}}return{words:r,variants:a,set:o}}function Pe(e){return W(e).map(bt)}function ar(e){let t=0,n=0,r=0,a=-1;for(let i=0;i<e.length&&a<0;i+=1){let c=e[i];c==="["?t+=1:c==="]"?t=Math.max(0,t-1):c==="{"?n+=1:c==="}"?n=Math.max(0,n-1):c==="<"?r+=1:c===">"&&e[i-1]!=="="&&e[i-1]!=="-"?r=Math.max(0,r-1):c==="("&&t===0&&n===0&&r===0&&(a=i)}if(a<0)return{params:null,returns:null};let o=0,s=-1;for(let i=a;i<e.length;i+=1){let c=e[i];if(c==="(")o+=1;else if(c===")"&&(o-=1,o===0)){s=i;break}}if(s<0)return{params:e.slice(a+1).trim(),returns:null};let d=e.slice(s+1).trim().replace(/^(?:=>|->|:)\s*/,"").replace(/\s+where\b.*$/,"").replace(/\s*(?:=>|=|\{|:)\s*$/,"").trim();return{params:e.slice(a+1,s).trim(),returns:d||null}}function ir(e){if(!e)return"";let t=/^\s*```(?:\w+)?\s*\n?[\s\S]*?\n?```/.exec(e);return(t?e.slice(t[0].length):e.includes("|")?e.slice(0,e.indexOf("|")):"").replace(/\s+/g," ").trim().slice(0,qn)}function dr(e){let t=new Map,n=new Set;for(let s of rt(e)){if(s.symbol.startsWith("local ")||!s.isFunctionLike&&!s.isTypeLike||e.isIgnored(s.relativePath)||he(s.relativePath)==="test")continue;let d=`${s.symbol}\0${s.relativePath}`;if(n.has(d))continue;n.add(d);let i=t.get(s.relativePath);i?i.push(s):t.set(s.relativePath,[s])}let r=[];for(let s of[...t.keys()].sort()){let d=Ye(e,s);if(Cr(s,d))continue;let i=t.get(s),c=fr(e,s,d,i);for(let l of i){let b=pr(l,c);b&&r.push({definition:l,candidate:b})}}r.sort((s,d)=>s.candidate.file.localeCompare(d.candidate.file)||s.candidate.startLine-d.candidate.startLine||s.candidate.name.localeCompare(d.candidate.name));let a=ht(e,new Set,r.map(({definition:s})=>s.symbolId)),o=r.map(({definition:s,candidate:d})=>{let i=[...a.get(s.symbolId)??[]].filter(([c,l])=>c!==d.file&&l.occurrences>0&&he(c)!=="test").map(([c])=>c).sort();return{...d,referencedFrom:i,consumable:d.exported||i.length>0}});return lr(o,r.map(({definition:s})=>cr(s)))}function cr(e){let{symbolId:t,documentId:n,startLine:r,endLine:a,symbol:o,relativePath:s}=e;return{symbolId:t,documentId:n,startLine:r,endLine:a,symbol:o,relativePath:s}}function lr(e,t){let n=new Map,r=new Map,a=new Map,o=new Set;return e.forEach((s,d)=>{let i=new Set;for(let c of xe)for(let l of s.fields[c].set)i.add(l);for(let c of i)It(n,c,d);for(let c of s.fields.name.set)r.set(c,(r.get(c)??0)+1);It(a,s.name,d);for(let c of s.calleeLeaves)o.add(c)}),{candidates:e,locations:t,byToken:n,nameDocFreq:r,byName:a,calledLeaves:o}}var Lt=new WeakMap;function $t(e,t,n,r){let a=Lt.get(t);a||(a=new Map,Lt.set(t,a));let o=a.get(n);return o||(o=ur(e,t.locations[n],t.candidates[n].name),a.set(n,o)),o.get(r)??[]}function ur(e,t,n){let r=new Map;for(let o of st(e,[t.symbolId])){if(e.isIgnored(o.relative_path))continue;let s=[o.chunk_start,o.chunk_end],d=r.get(o.relative_path);d?d.push(s):r.set(o.relative_path,[s])}let a=new Map;for(let[o,s]of r){let d=o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},i=ot(e,o,n,d);a.set(o,s.flatMap(([c,l])=>{let b=i.filter(p=>p>=c&&p<=l);return b.length>0?b.map(p=>[p,p]):[[c,l]]}))}return a}function It(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function fr(e,t,n,r){let a=null;return{lines:n,units:mr(e,t),endLines:r.map(o=>o.endLine).sort((o,s)=>o-s),exportedNames:()=>a??=Sr(n)}}function mr(e,t){let n=new Map,r=Xe(e,t);if(!r)return n;for(let a of mt(e,t,r)?.units??[]){let o=n.get(a.name);o?o.push(a):n.set(a.name,[a])}return n}function pr(e,t){let{units:n}=t,r=e.isTypeLike?null:gr(n.get(e.leaf),e.startLine),a=!e.isTypeLike&&(r!==null||et(e.symbol)||Yn.has(e.kind??-1));if(!e.isTypeLike&&!a)return null;let o=tt(nt(e.documentation)),s=kr(a&&(!o||!o.includes("("))&&r?r.signature:o??r?.signature??"").slice(0,Jn),d=a&&s?ar(s):{params:null,returns:null},i=ir(e.documentation),c=br(e,r),l=e.leaf;return{symbol:e.symbol,name:l,kind:a?e.parentTypeName?"method":"function":hr(e,s),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,container:c,doc:i,signature:s||null,paramsText:d.params,returnsText:d.returns,nameWords:Pe(l),fields:{name:D(l),container:D(c??""),doc:D(i,3,zn),signature:D(s),path:D(e.relativePath.replace(/\.[^./]+$/,""))},calleeLeaves:r?.calleeLeaves??[],hasBody:r!==null,exported:r?.exported===!0||vr(t.exportedNames(),e),deprecated:Er(t,e,i)}}function gr(e,t){let n=null;for(let r of e??[]){let a=Math.abs(r.startLine-t);a<=Xn&&(!n||a<Math.abs(n.startLine-t))&&(n=r)}return n}function br(e,t){return e.parentTypeName?e.parentTypeName:e.enclosingSymbol&&Ze(e.enclosingSymbol)!=="namespace"?Qe(e.enclosingSymbol)||null:t?.container.at(-1)??null}function hr(e,t){let r=(/^(?:export\s+)?(?:default\s+)?(?:declare\s+)?(?:abstract\s+)?(class|struct|interface|trait|protocol)\b/.exec(t)?.[1]??pt(e.kind??0)).toLowerCase();return r==="class"||r==="struct"?"class":r==="interface"||r==="trait"||r==="protocol"?"interface":"type"}function Er(e,t,n){if(we.test(n))return!0;let{lines:r}=e,a=r[t.startLine];if(a!==void 0&&Ft.test(a)&&we.test(a))return!0;let o=yr(e.endLines,t.startLine),s=!1;for(let d=t.startLine-1;d>o;d-=1){let i=r[d]?.trim()??"";if(i===""){if(s)continue;return!1}if(!s&&!Ft.test(i))return!1;if(we.test(i))return!0;s?s=!i.includes("/*"):s=i.endsWith("*/")&&!i.includes("/*")}return!1}function yr(e,t){let n=0,r=e.length;for(;n<r;){let a=n+r>>>1;e[a]<t?n=a+1:r=a}return n>0?e[n-1]:-1}function Sr(e){let t=new Map,n=new Set;return e.forEach((r,a)=>{if(!r.includes("export"))return;let o=tr.exec(r)?.[1];if(o){let s=t.get(o);s?s.push(a):t.set(o,[a])}for(let s of nr.exec(r)?.[1]?.match(rr)??[])n.add(s)}),{declared:t,listed:n}}function vr(e,t){if(e.listed.has(t.leaf))return!0;let n=t.startLine-or;return e.declared.get(t.leaf)?.some(r=>r>=n&&r<=t.startLine)??!1}function Cr(e,t){if(Qn.test(e.replace(/\\/g,"/")))return!0;let n=!1;for(let[r,a]of t.slice(0,Zn).entries()){let o=a.trim();if(n){if(Re.test(o))return!0;n=!o.includes("*/")}else{if(o===""||r===0&&o.startsWith("#!"))continue;if(o.startsWith("/*")){if(Re.test(o))return!0;n=!o.includes("*/",2)}else if(er.test(o)){if(Re.test(o))return!0}else return!1}}return!1}function kr(e){return e.replace(/\s+/g," ").trim()}var wr={name:1,container:.8,doc:.6,signature:.5,path:.3},Rr=200,xr=3,Pr=5,Ar=new Set(["add","apply","build","calculate","call","check","compute","config","context","convert","create","data","default","delete","do","ensure","error","fetch","find","format","get","handle","has","info","init","is","item","load","make","new","normalize","option","param","parse","process","read","remove","resolve","result","run","set","state","type","update","use","validate","value","with","wrap","write"]);function Ut(e,t,n={}){let r=Tr(e,t,n.scope),a=[];for(let o of Mr(e,r)){if(!Wt(r,e.candidates[o]))continue;let s=jt(r,e,o);(s.exactName||s.match>0)&&a.push(s)}return a.sort((o,s)=>Number(s.exactName)-Number(o.exactName)||s.match-o.match||s.nameCoverage-o.nameCoverage||o.index-s.index),{plan:r,corpusUnits:e.candidates.filter(o=>Q(r.scope,o)).length,shortlist:a.slice(0,Rr).map(o=>Kt(r,e,o)),unresolvedProbes:r.calls.filter(o=>o.status!=="matched").map(o=>({probe:o.probe,status:o.status}))}}function Ht(e,t,n){return Wt(t,e.candidates[n])?Kt(t,e,jt(t,e,n)):null}function re(e){return e?e.replace(/\\/g,"/").toLowerCase():null}function Q(e,t){return!e||t.file.toLowerCase().includes(e)}function Wt(e,t){return Q(e.scope,t)?e.kinds.size===0||e.kinds.has(t.kind)?!0:(t.kind==="function"||t.kind==="method")&&(e.kinds.has("function")||e.kinds.has("method")):!1}function Tr(e,t,n){let r=new Set,a=i=>{for(let c of W(i))for(let l of de(c))r.add(l)},o=[];for(let i of t.terms){let c=[],l=[];for(let p of i){let S=Ae(p);S.length!==0&&(c.push(p),l.push(S),a(p))}if(l.length===0)continue;let b=Math.max(...l.map(p=>_r(e,p)));o.push({labels:c,synonyms:l,weight:Math.log((e.candidates.length+1)/(b+1))+1})}let s=t.names.map(Pe).filter(i=>i.length>0);for(let i of t.names)a(i);for(let i of t.calls)a(i);for(let i of[...t.params,...t.returns])a(i);let d=t.calls.map(i=>Nr(e,i));return{groups:o,totalWeight:o.reduce((i,c)=>i+c.weight,0),names:s,vocab:r,calls:d,callTargets:new Set(d.flatMap(i=>i.targets)),params:{label:t.params.join("/"),words:t.params.flatMap(Ae)},returns:{label:t.returns.join("/"),words:t.returns.flatMap(Ae)},kinds:new Set(t.kinds),scope:re(n)}}function Ae(e){return D(e).variants}function _r(e,t){return Math.min(...t.map(n=>Math.max(0,...n.map(r=>e.nameDocFreq.get(r)??0))))}function Mr(e,t){let n=new Set,r=o=>o.flatMap(s=>e.byToken.get(s)??[]),a=o=>{let s=o.map(r).sort((d,i)=>d.length-i.length)[0];for(let d of s??[])n.add(d)};for(let o of t.groups)for(let s of o.synonyms)a(s);for(let o of t.names)a(o.filter(s=>s.length>=2&&!Z.has(s)).map(s=>[s]));return n}var Br=/[.#:/]/;function Nr(e,t){let n=t.replace(/`/g,""),r=Br.test(n),a=r?n.split(/[.#:/]+/).filter(Boolean).at(-1)??n:n,o=e.byName.get(a)??[],s=r?o.filter(i=>Fr(e.candidates[i]).has(n)):o;if(s.length>0)return new Set(s.map(c=>Or(e.candidates[c]))).size>Pr?{probe:t,leaf:a,status:"ambiguous",targets:[]}:{probe:t,leaf:a,status:"matched",targets:s};let d=!r&&e.calledLeaves.has(n);return{probe:t,leaf:a,status:d?"matched":"unmatched",targets:[]}}function Or(e){return`${e.file}\0${e.container??""}`}function Fr(e){let t=new Set,n=[e.name];if(e.container){for(let r of[".","#","::"])t.add(`${e.container}${r}${e.name}`);n.push(`${e.container}.${e.name}`)}for(let r of[e.file,e.file.replace(/\.[^./]+$/,"")])for(let a of[":","#","/"])for(let o of n)t.add(`${r}${a}${o}`);return t}function jt(e,t,n){let r=t.candidates[n],a=e.names.some(l=>Lr(l,r.nameWords)),o=0,s=0,d=0,i=[];for(let l of e.groups){let b={label:l.labels[0],field:null};for(let p of xe){let S=l.synonyms.findIndex(g=>Ir(r.fields[p],g));if(!(S<0)){b={label:l.labels[S],field:p};break}}i.push(b),b.field&&(o+=l.weight*wr[b.field]),b.field==="name"&&(s+=l.weight,d+=1)}let c=e.totalWeight;return{index:n,match:c>0?o/c:0,nameCoverage:c>0?s/c:0,nameGroups:d,exactName:a,hits:i}}function Lr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Ir(e,t){if(t.length===1)return t[0].some(n=>e.set.has(n));for(let n=0;n+t.length<=e.words.length;n+=1)if(t.every((r,a)=>e.variants[n+a].some(o=>r.includes(o))))return!0;return!1}function Kt(e,t,n){let r=t.candidates[n.index],a=e.calls.filter(i=>i.status==="matched"),o=a.filter(i=>r.calleeLeaves.includes(i.leaf)).map(i=>i.probe),{fit:s,note:d}=Dr(e,r);return{...n,candidate:r,callContainment:r.hasBody&&a.length>0?o.length/a.length:null,callsFound:o,fit:s,fitNote:d,specializedWords:$r(e,t,r),isCallTarget:e.callTargets.has(n.index)}}function $r(e,t,n){let r=n.fields.name;return r.words.filter((a,o)=>(t.nameDocFreq.get(a)??0)<=xr&&!Ar.has(a)&&!r.variants[o].some(s=>e.vocab.has(s)))}function Dr(e,t){if(t.kind!=="function"&&t.kind!=="method")return{fit:"unknown",note:null};let n=[Ur(e,t),Hr(e,t)].filter(a=>a!==null),r=n.find(a=>a.verdict==="conflicts")??n[0];return r?{fit:r.verdict,note:r.note}:{fit:"unknown",note:null}}function Ur(e,t){if(e.returns.words.length===0)return null;let n=t.returnsText;return n?Vt(D(n),e.returns.words)?{verdict:"fits",note:`returns ${Dt(n)}`}:{verdict:"conflicts",note:`returns ${Dt(n)}, probe expects ${e.returns.label}`}:null}function Hr(e,t){return e.params.words.length===0||t.paramsText===null?null:t.paramsText===""?{verdict:"conflicts",note:`takes no parameters, probe expects ${e.params.label}`}:Vt(D(t.paramsText),e.params.words)?{verdict:"fits",note:`parameters include ${e.params.label}`}:null}function Vt(e,t){return t.some(n=>n.some(r=>e.set.has(r)))}function Dt(e){return e.length>40?`${e.slice(0,39)}\u2026`:e}import{createHash as Yr}from"crypto";var Wr=.6,jr=.35,Gt=.5,Kr=.75,Vr=.5,Me="blocked: file-internal (not exported, no references from other files)",Be="blocked: marked @deprecated",oe=["reuse","rework","compose"];function zt(e,t,n){let{plan:r}=n,a=new Map(n.shortlist.map(i=>[i.index,i])),o=i=>{if(a.has(i))return;let c=Ht(t,r,i);c&&a.set(i,c)};for(let i of r.callTargets)o(i);let s=new Map;for(let i of[...a.values()].filter(c=>qr(r,c)))for(let c of i.candidate.calleeLeaves)for(let l of Jr(e,t,i.candidate,c)){if(l===i.index)continue;let b=s.get(l);b?b.push(i):s.set(l,[i])}for(let i of s.keys())o(i);let d=[];for(let i of a.values()){let c=Gr(r,i,s.get(i.index)??[]);c&&d.push(c)}return d.sort(Xr)}function Gr(e,t,n){let r=Yt(t),a=zr(e,t,n),o=t.exactName||t.nameCoverage>=Kr,s=t.candidate.consumable&&!t.candidate.deprecated;return a.length>0&&!o&&s?Te(t,"compose",[..._e(t),...a]):Jt(t,r)?Te(t,"reuse",_e(t)):(t.exactName||t.match>=jr)&&r.length>0?Te(t,"rework",[..._e(t),...r.map(d=>d.text)]):null}function Te(e,t,n){let r=e.exactName||(e.callContainment??0)>=Vr&&e.fit==="fits";return{candidate:e.candidate,bucket:t,tier:r?"direct":"signal",score:Le(e.exactName?Math.max(e.match,.9):e.match),why:n}}function Jt(e,t){return(e.exactName||e.match>=Wr)&&t.length===0}function qr(e,t){return Jt(t,Yt(t))&&!t.isCallTarget&&!Xt(e,t)}function Xt(e,t){return e.groups.length>=2&&t.nameGroups===1&&t.specializedWords.length===0&&t.hits.some(n=>n.field===null)}function zr(e,t,n){let r=[];t.isCallTarget&&r.push(`name matches call probe ${t.candidate.name}`),Xt(e,t)&&r.push(`part of the task: name covers 1 of ${e.groups.length} concepts`);let a=n.filter(o=>qt(o)>qt(t));if(a.length>0){let o=[...new Set(a.map(s=>s.candidate.name))].slice(0,3);r.push(`referenced inside ${o.join(", ")}`)}return r}function qt(e){return e.exactName?Math.max(e.match,.9):e.match}function Jr(e,t,n,r){return(t.byName.get(r)??[]).filter(a=>{let o=t.candidates[a];return o.file!==n.file&&!o.referencedFrom.includes(n.file)?!1:$t(e,t,a,n.file).some(([s,d])=>s>=n.startLine&&d<=n.endLine)})}function Yt(e){let{candidate:t}=e,n=[];e.fit==="conflicts"&&n.push({kind:"signature",text:`blocked: ${e.fitNote??"signature conflicts with the probes"}`}),t.consumable||n.push({kind:"file-internal",text:Me}),e.specializedWords.length>0&&n.push({kind:"specialized",text:`blocked: specialized name (${e.specializedWords.join(", ")} not in the probes)`}),t.deprecated&&n.push({kind:"deprecated",text:Be});let r=[...new Set(e.hits.flatMap(o=>o.field&&o.field!=="name"?[o.field]:[]))],a=e.exactName||e.nameCoverage>=Gt||(e.callContainment??0)>=Gt;return r.length>0&&!a&&n.push({kind:"doc-only",text:`blocked: concept appears only in ${r.join("/")}, not in the name or callees`}),n}function _e(e){let t=[];e.exactName&&t.push(`name equals probe name ${e.candidate.name}`);let n=new Map;for(let a of e.hits){if(!a.field)continue;let o=n.get(a.field)??[];o.push(a.label),n.set(a.field,o)}let r=n.get("name");r&&!e.exactName&&t.push(`name matches ${r.join("+")}`);for(let[a,o]of n)a!=="name"&&t.push(`${a} mentions ${o.join("+")}`);return e.callsFound.length>0&&t.push(`calls ${e.callsFound.join(", ")}`),e.candidate.consumable&&t.push(Ne(e.candidate)),e.fit==="fits"&&e.fitNote&&t.push(`signature fits: ${e.fitNote}`),t}function Ne(e){let t=e.referencedFrom.length,n=`referenced from ${t} ${t===1?"file":"files"}`;return e.exported?t>0?`exported, ${n}`:"exported, no references from other files":t>0?`not exported, ${n}`:"file-internal"}function Oe(e,t){return{symbolId:e.symbol,name:e.kind==="method"&&e.container?`${e.container}.${e.name}`:e.name,file:e.file,line:e.startLine+1,signature:e.signature,...t}}function Fe(e,t,n){let r=new Map;return e.filter(a=>{if(n&&a.bucket!==n)return!1;let o=r.get(a.bucket)??0;return r.set(a.bucket,o+1),o<t})}function Xr(e,t){return oe.indexOf(e.bucket)-oe.indexOf(t.bucket)||+(t.tier==="direct")-+(e.tier==="direct")||t.score-e.score||e.candidate.file.localeCompare(t.candidate.file)||e.candidate.startLine-t.candidate.startLine||e.candidate.name.localeCompare(t.candidate.name)}function Le(e){return Math.round(e*1e3)/1e3}var tn=5,nn=1200,Qr=.05,Zr=.12,eo=15,to=3,no=.5,ro=200,oo=300,Qt=1e-9;function rn(e,t,n={}){let r=Y(e),a=Ut(r,t,{scope:n.scope}),o=zt(e,r,a);return{candidates:Fe(o,n.limit??tn,n.bucket).map(s=>Oe(s.candidate,{bucket:s.bucket,tier:s.tier,score:s.score,scoreBasis:"probe-match",why:s.why})),unresolvedProbes:a.unresolvedProbes,coverage:{corpusUnits:a.corpusUnits}}}var Zt=new WeakMap;function on(e,t=nn){return sn(Y(e),t).cards}function sn(e,t){let n=Zt.get(e);n||(n=new Map,Zt.set(e,n));let r=n.get(t);if(!r){let a=e.candidates.map((s,d)=>{let i=ao(s,t);return{cardHash:so(i),text:i,candidateIndex:d}}),o=new Map;for(let s of a){let d=o.get(s.cardHash);d?d.push(s.candidateIndex):o.set(s.cardHash,[s.candidateIndex])}r={cards:a,indexesByHash:o},n.set(t,r)}return r}function so(e){return Yr("sha256").update(`card-format-${1}
2
+ ${e}`).digest("hex")}function ao(e,t){let n=o=>W(o).map(s=>s.toLocaleLowerCase()).join(" "),r=`name: ${n(e.name)} | kind: ${e.kind} | in: ${e.container??""}`,a=[`signature: ${(e.signature??"").slice(0,ro)}`,`doc: ${e.doc.slice(0,oo)}`,`path: ${n(e.file.replace(/\.[^./]+$/,""))}`].join(" | ");return`${r}
3
+ ${a}`.slice(0,t)}function an(e,t,n={}){let{topBandMargin:r=Qr,maxCardChars:a=nn}=n,o=Y(e),{indexesByHash:s}=sn(o,a),d=re(n.scope),i=new Map;for(let b of t)for(let p of s.get(b.cardHash)??[])Q(d,o.candidates[p])&&i.set(p,Math.max(i.get(p)??Number.NEGATIVE_INFINITY,b.score));if(i.size===0)return[];let c=Math.max(...i.values()),l=[];for(let[b,p]of i){let S=o.candidates[b],g=c-p,m=io(S),w=S.endLine-S.startLine+1<=eo&&S.referencedFrom.length>=to,P=g<=Zr+Qt,x=null;if(g<=r+Qt?x=m.length===0?"reuse":"rework":w&&m.length===0&&(P||p>=no)?x="compose":P&&m.length>0&&(x="rework"),!x)continue;let A=[`cosine ${p.toFixed(3)} (best ${c.toFixed(3)})`];S.consumable&&A.push(Ne(S)),x==="compose"&&A.push(`small utility: ${S.endLine-S.startLine+1} lines, referenced from ${S.referencedFrom.length} files`),A.push(...m),l.push(Oe(S,{bucket:x,tier:"signal",score:Le(p),scoreBasis:"cosine",why:A}))}return l.sort((b,p)=>oe.indexOf(b.bucket)-oe.indexOf(p.bucket)||p.score-b.score||b.file.localeCompare(p.file)||b.line-p.line||b.name.localeCompare(p.name)),Fe(l,n.limit??tn,n.bucket)}function io(e){let t=[];return e.consumable||t.push(Me),e.deprecated&&t.push(Be),t}import{mkdirSync as co}from"fs";import{dirname as lo,join as uo}from"path";import fo from"better-sqlite3";var mo="embeddings",po=1,go=720*60*60*1e3,bo=.995,ho=3600*1e3;function Eo(e){return be(JSON.stringify({model:e.model,dims:e.dims,documentPrefix:e.documentPrefix,cardFormatVersion:e.cardFormatVersion})).slice(0,16)}function ln(e,t){return be(`${e}\0${t}`).slice(0,16)}function ce(e,t){process.env.CODEBASEIQ_DEBUG&&console.error(`embedding-store: ${e}: ${t instanceof Error?t.message:String(t)}`)}function Ie(e,t,n={}){let r=n.now??ie,a=n.storeKey??Eo(t),o=uo(e,mo,`${a}.db`),s=t.dims,d=yo(o,t),i=null;function c(g,m){ce(`disabled (${g})`,m),i=null;try{d?.db.close()}catch(w){ce("close failed while disabling",w)}d=null}function l(g){return g.readDataVersion.get()}function b(g){return i&&i.dataVersion===l(g)||(i=p(g)),i}function p(g){return g.db.transaction(()=>{let m=l(g),w=g.countRows.get().count,P=new Float32Array(w*s),x=[],A=new Map;for(let N of g.readAll.iterate())new Uint8Array(P.buffer,x.length*s*4,s*4).set(N.vector),A.set(N.card_hash,x.length),x.push(N.card_hash);return{dataVersion:m,hashes:x,index:A,data:P}})()}function S(g,m){let w=0;for(let P of m)g.readUsed.get(P)!==void 0&&(w+=1);return w}return{get available(){return d!==null},key:a,path:o,verifyCanary(g){if(!d)return"first";try{let m=d.readCanary.get();return m?Co(vo(m.value),g)>=bo?"match":"drift":(d.writeCanary.run(cn(g)),"first")}catch(m){return c("canary",m),"first"}},missing(g){let m=[...new Set(g)];if(!d)return m;try{let w=[],P=[],x=r()-ho;for(let A of m){let N=d.readUsed.get(A);N?N.last_used_at<x&&P.push(A):w.push(A)}if(P.length>0){let A=d,N=r();A.db.transaction(()=>{for(let O of P)A.touch.run(N,O)})()}return w}catch(w){return c("missing",w),m}},put(g){for(let m of g)if(m.vector.length!==s)throw new RangeError(`vector for ${m.cardHash} has ${m.vector.length} dimensions, store holds ${s}`);if(!(!d||g.length===0))try{let m=d,w=r();m.db.transaction(()=>{for(let P of g)m.upsert.run(P.cardHash,w,w,cn(P.vector))})(),i=null}catch(m){c("put",m)}},topK(g,m,w){if(g.length!==s)throw new RangeError(`query vector has ${g.length} dimensions, store holds ${s}`);if(!d||m<=0)return[];let P;try{P=b(d)}catch(B){return c("topK",B),[]}let{hashes:x,index:A,data:N}=P,O=[],ae=B=>{let I=x[B],K=0,fe=B*s;for(let G=0;G<s;G+=1)K+=N[fe+G]*g[G];if(O.length===m&&!dn(K,I,O[m-1]))return;let V=O.length;for(;V>0&&dn(K,I,O[V-1]);)V-=1;O.splice(V,0,{cardHash:I,score:K}),O.length>m&&O.pop()};if(w)for(let B of w){let I=A.get(B);I!==void 0&&ae(I)}else for(let B=0;B<x.length;B+=1)ae(B);return O},coverage(g){let m=new Set(g);if(m.size===0)return 1;if(!d)return 0;try{return S(d,m)/m.size}catch(w){return c("coverage",w),0}},prune(g={}){if(!d)return 0;try{let m=d,w=g.unusedForMs??go,P=m.db.transaction(()=>{let x=m.deleteUnusedBefore.run(r()-w).changes;if(g.maxRows!==void 0){let A=m.countRows.get().count;A>g.maxRows&&(x+=m.deleteOldest.run(A-g.maxRows).changes)}return x})();return P>0&&(i=null),P}catch(m){return c("prune",m),0}},async withRefreshLock(g){if(!d)return{acquired:!1};let m=await ze(`${o}.refresh.lock`);if(!m)return{acquired:!1};try{return{acquired:!0,value:await g()}}finally{m.release()}},close(){i=null;try{d?.db.close()}catch(g){ce("close failed",g)}d=null}}}function dn(e,t,n){return e>n.score||e===n.score&&t<n.cardHash}function yo(e,t){let n;try{return co(lo(e),{recursive:!0}),n=new fo(Ke(e)),n.pragma("busy_timeout = 5000"),n.pragma("journal_mode = WAL"),n.pragma("synchronous = NORMAL"),n.exec(`
4
+ CREATE TABLE IF NOT EXISTS meta (key TEXT PRIMARY KEY, value) WITHOUT ROWID;
5
+ CREATE TABLE IF NOT EXISTS vectors (
6
+ card_hash TEXT PRIMARY KEY,
7
+ embedded_at INTEGER NOT NULL,
8
+ last_used_at INTEGER NOT NULL,
9
+ vector BLOB NOT NULL
10
+ ) WITHOUT ROWID;
11
+ `),So(n,t),{db:n,readDataVersion:n.prepare("PRAGMA data_version").pluck(),readCanary:n.prepare("SELECT value FROM meta WHERE key = 'canary'"),writeCanary:n.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES ('canary', ?)"),readUsed:n.prepare("SELECT last_used_at FROM vectors WHERE card_hash = ?"),touch:n.prepare("UPDATE vectors SET last_used_at = ? WHERE card_hash = ?"),upsert:n.prepare("INSERT OR REPLACE INTO vectors (card_hash, embedded_at, last_used_at, vector) VALUES (?, ?, ?, ?)"),countRows:n.prepare("SELECT COUNT(*) AS count FROM vectors"),readAll:n.prepare("SELECT card_hash, vector FROM vectors"),deleteUnusedBefore:n.prepare("DELETE FROM vectors WHERE last_used_at < ?"),deleteOldest:n.prepare(`DELETE FROM vectors WHERE card_hash IN (
12
+ SELECT card_hash FROM vectors ORDER BY last_used_at ASC, embedded_at ASC, card_hash ASC LIMIT ?
13
+ )`)}}catch(r){ce("disabled (open failed)",r);try{n?.close()}catch{}return null}}function So(e,t){let n={schema_version:String(po),model:t.model,dims:String(t.dims),document_prefix:t.documentPrefix,card_format_version:String(t.cardFormatVersion)};e.transaction(()=>{let r=new Map(e.prepare("SELECT key, value FROM meta").all().map(s=>[s.key,s.value]));if(Object.entries(n).every(([s,d])=>r.get(s)===d))return;e.exec("DELETE FROM vectors; DELETE FROM meta;");let o=e.prepare("INSERT INTO meta (key, value) VALUES (?, ?)");for(let[s,d]of Object.entries(n))o.run(s,d)}).immediate()}function cn(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function vo(e){return new Float32Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}function Co(e,t){if(e.length!==t.length)return 0;let n=0,r=0,a=0;for(let o=0;o<e.length;o+=1)n+=e[o]*t[o],r+=e[o]*e[o],a+=t[o]*t[o];return r===0||a===0?0:n/Math.sqrt(r*a)}var ko="builder";function $s(e){return $e(e,ko)}var wo=.8,un="inside an agent session: pass probes (--term/--name/--calls) instead of a description",Ro=3e4,xo=6e4,Po=2,Ao=50,To=12,De=2e3,_o=5,se="builder query aborted",Mo=2147483647;function Bo(e){return e>=De?`vector search returns at most ${De} hits; lower-ranked units are not listed`:void 0}function Ds(e){let{settings:t,storeRoot:n,languages:r}=e,a=e.env??process.env,o=e.now??ie,s=new Map,d;function i(u){let f=e.openDb();try{return u(f)}finally{e.closeDb?.(f)}}function c(){return Object.entries(a).some(([u,f])=>f!==void 0&&(u==="CLAUDECODE"||u.startsWith("CODEX_")))}function l(u){let f=s.get(u.name);return f||(f={client:Nt(u,{fetchImpl:e.fetchImpl,env:a})},s.set(u.name,f)),f}function b(u,f,h){u.health=void 0,u.failure={state:f,detail:h,openUntil:o()+xo}}async function p(u,f,h=!1){let E=l(u),v=o();if(!h&&E.failure&&v<E.failure.openUntil){let k=Math.ceil((E.failure.openUntil-v)/1e3);return{ok:!1,state:E.failure.state,detail:`${E.failure.detail} (not retried for another ${k}s)`}}let C=!h&&E.health!==void 0&&v-E.health.checkedAt<Ro,y;if(C)y=E.health.value;else{let k=await E.client.checkHealth({signal:f});if(!k.ok){J(f,se);let T=No(k.reason);return b(E,T,k.detail),{ok:!1,state:T,detail:k.detail}}y=k,E.health={value:k,checkedAt:o()},E.failure=void 0}let R=S(E,u,y,!C);return R.ok?{ok:!0,endpoint:u,store:R.held.store,client:E.client,...R.held.forked?{note:`model weights differ from the shared ${u.model} store; using a store forked for ${u.name}`}:{}}:R}function S(u,f,h,E){let v=u.held;if(v&&v.dims===h.dimensions&&(!E||v.store.verifyCanary(h.canary)!=="drift"))return{ok:!0,held:v};v?.store.close(),u.held=void 0;let C={model:f.model,dims:h.dimensions,documentPrefix:f.documentPrefix,cardFormatVersion:1},y=Ie(n,C);if(!y.available)return y.close(),{ok:!1,state:"degraded",detail:`the vector store ${y.path} could not be opened`};if(y.verifyCanary(h.canary)!=="drift")return u.held={store:y,dims:h.dimensions,forked:!1},{ok:!0,held:u.held};let R=y.key;y.close();let k=Ie(n,C,{storeKey:ln(R,f.name)});return!k.available||k.verifyCanary(h.canary)==="drift"?(k.close(),{ok:!1,state:"degraded",detail:`model weights for ${f.model} keep changing between runs`}):(u.held={store:k,dims:h.dimensions,forked:!0},{ok:!0,held:u.held})}function g(u){return i(f=>{let h=on(f,t.maxCardChars),E=new Map;for(let y of h)E.has(y.cardHash)||E.set(y.cardHash,y.text);let v=re(u),C=null;if(v){let{candidates:y}=Y(f);C=new Set(h.filter(R=>Q(v,y[R.candidateIndex])).map(R=>R.cardHash))}return{hashes:h.map(y=>y.cardHash),textByHash:E,scopedHashes:C}})}function m(u,f){let h=new Set(u.missing(f.hashes)),E=f.hashes.filter(v=>!h.has(v)).length;return{embeddedUnits:E,fraction:f.hashes.length===0?1:E/f.hashes.length}}async function w(u,f,h,E){let{endpoint:v,store:C,client:y}=u,R=C.missing(f.hashes);if(R.length===0)return{embedded:0,budgetExhausted:!1};let k=AbortSignal.timeout(Math.min(E,Mo)),T=h?AbortSignal.any([h,k]):k,F=Math.max(1,Math.floor(v.batchSize))*Po,_={embedded:0,budgetExhausted:!1};return(await C.withRefreshLock(async()=>{for(let q=0;q<R.length;q+=F){let z=R.slice(q,q+F);try{let U=await y.embed(z.map(L=>f.textByHash.get(L)),"document",{signal:T});C.put(z.map((L,me)=>({cardHash:L,vector:U[me]}))),_.embedded+=z.length}catch(U){if(h?.aborted)throw H(h,se);if(k.aborted){_.budgetExhausted=!0;return}b(l(v),"degraded",ue(U)),_.note=`embedding stopped: ${ue(U)}`;return}}})).acquired?_.embedded>0&&C.prune():_.note="another process is already embedding this repository",_}async function P(u,f,h,E){let v=await p(u,E);if(!v.ok)return{kind:"failed",reason:`${v.state}: ${v.detail}`};let C=g(f.scope),y=await w(v,C,E,t.indexBudgetMs),{embeddedUnits:R,fraction:k}=m(v.store,C),T;try{let[L]=await v.client.embed([h],"query",{signal:E}),me=Math.min(De,Math.max(Ao,(f.limit??_o)*To));T=v.store.topK(L,me,C.scopedHashes??new Set(C.hashes))}catch(L){if(E?.aborted)throw H(E,se);return b(l(u),"degraded",ue(L)),{kind:"failed",reason:`degraded: ${ue(L)}`}}let F=i(L=>an(L,T,{topBandMargin:t.topBandMargin,maxCardChars:t.maxCardChars,limit:f.limit,scope:f.scope,bucket:f.bucket})),_=C.hashes.length,Ue=R<_?`partial embeddings: ${R} of ${_} units (${le(k)})`:void 0,q=y.budgetExhausted?`index budget of ${t.indexBudgetMs} ms used up`:void 0,z=[v.note,Ue,q,y.note,Bo(T.length)].filter(L=>L!==void 0),U={provider:`embeddings:${u.name}`,probes:null,unresolvedProbes:[],candidates:F,coverage:{corpusUnits:_,embeddedUnits:R,...z.length>0?{note:z.join("; ")}:{}}};return k>=t.minCoverage?{kind:"answer",answer:U}:{kind:"degraded",answer:U,fraction:k,reason:`degraded: embedded ${R} of ${_} units (${le(k)}), below the ${le(t.minCoverage)} minimum`}}function x(){return d??=At($e(n,"agent-probes"),t.cacheTtlHours,o),d}async function A(u,f,h,E){if(c())return{kind:"failed",reason:un};let v=x(),C=v.get(u.argv,h);if(!C){let y=await Rt(u,{description:h,languages:r,workDir:$e(n,"agent-sandbox")},{signal:E,env:a});if(!y.ok)return{kind:"failed",reason:`${y.reason}: ${y.detail}`};C=y.probes,v.set(u.argv,h,C)}return{kind:"answer",answer:{provider:`agent:${u.name}`,...N(f,C)}}}function N(u,f){let h=i(E=>rn(E,f,{limit:u.limit,scope:u.scope,bucket:u.bucket}));return{probes:f,unresolvedProbes:h.unresolvedProbes,candidates:h.candidates,coverage:h.coverage}}function O(u){return u==="agent"?t.agents.map(f=>({kind:"agent",name:f.name})):u==="embeddings"?t.endpoints.map(f=>({kind:"embeddings",name:f.name})):t.chain}async function ae(u,f,h,E){if(u.kind==="agent"){let C=t.agents.find(y=>y.name===u.name);return C?A(C,f,h,E):{kind:"failed",reason:"not configured"}}let v=t.endpoints.find(C=>C.name===u.name);return v?P(v,f,h,E):{kind:"failed",reason:"not configured"}}function B(u,f){return{...u,fallbacksTried:f,evidence:"heuristic"}}function I(u,f){return B({provider:"none",probes:null,unresolvedProbes:[],candidates:[],coverage:{corpusUnits:0,note:f}},u)}async function K(u,f={}){let{signal:h}=f;J(h,se);let E=u.mode??t.mode;if(u.probes&&X(u.probes)&&E!=="embeddings")return B({provider:"agent:caller",...N(u,u.probes)},[]);let v=dt(u.description?.trim()??"").trim();if(v===""){let k=E==="embeddings"&&u.probes&&X(u.probes)?"embeddings mode ranks a description; probes are not embedded":"no description or probes were given";return I([{provider:"request",reason:k}],"nothing to look up")}let C=O(E);if(C.length===0)return I([{provider:E,reason:"no providers are configured for this mode"}],"no provider ran");let y=[],R=[];for(let k of C){J(h,se);let T=await ae(k,u,v,h);if(T.kind==="answer")return B(T.answer,y);let F={provider:lt(k),reason:T.reason};y.push(F),T.kind==="degraded"&&R.push({entry:F,answer:T.answer,fraction:T.fraction})}if(R.length>0){let k=R.reduce((T,F)=>F.fraction>T.fraction?F:T);return B(k.answer,y.filter(T=>T!==k.entry))}return I(y,"no provider answered")}function fe(u){let f=`agent:${u.name}`;if(c())return{provider:f,state:"skipped",detail:un};let h=Se(u);return h.ok?{provider:f,state:"ok",detail:`runs ${u.argv[0]} with a ${Math.round(u.timeoutMs/1e3)}s timeout`}:{provider:f,state:h.reason==="misconfigured"?"misconfigured":"unreachable",detail:h.detail}}async function V(u,f){let h=`embeddings:${u.name}`,E=await p(u,f,!0);if(!E.ok)return{provider:h,state:E.state,detail:E.detail};let v=g(void 0),{embeddedUnits:C,fraction:y}=m(E.store,v),R=`${u.model} reachable; embedded ${C} of ${v.hashes.length} units (${le(y)})`;return{provider:h,state:y>=t.minCoverage?"ok":"degraded",detail:E.note?`${R}; ${E.note}`:R,coverage:y}}async function G(u={}){let f=[];for(let h of t.endpoints)f.push(await V(h,u.signal));for(let h of t.agents)f.push(fe(h));return f}async function fn(u={}){let{endpoint:f,signal:h,endsAt:E,budgetMs:v=t.indexBudgetMs}=u,C=f===void 0?t.endpoints:t.endpoints.filter(R=>R.name===f);if(C.length===0)throw new Error(f===void 0?"No embeddings endpoint is configured.":`No embeddings endpoint is named ${f}.`);let y=[];for(let R of C){let k=await p(R,h);if(!k.ok){y.push(`embeddings:${R.name} ${k.state}: ${k.detail}`);continue}let T=g(void 0),F=E===void 0?v:Math.max(1,Math.floor((E-o())*wo)),_=await w(k,T,h,F);return{provider:`embeddings:${R.name}`,embedded:_.embedded,coverage:m(k.store,T).fraction,budgetExhausted:_.budgetExhausted,..._.note?{note:_.note}:{}}}throw new Error(`No embeddings endpoint could be refreshed: ${y.join("; ")}`)}function mn(){for(let u of s.values())u.held?.store.close(),u.held=void 0}return{query:K,providerStatus:G,refreshEmbeddings:fn,close:mn}}function No(e){switch(e){case"unreachable":return"unreachable";case"remote-not-allowed":case"insecure-token-transport":case"invalid-endpoint":case"unauthorized":return"misconfigured";default:return"degraded"}}function le(e){return`${Math.round(e*100)}%`}function ue(e){return e instanceof Error?e.message:String(e)}export{$s as a,Ds as b};
14
+ //# sourceMappingURL=chunk-M4EVGA5S.js.map
@@ -0,0 +1,127 @@
1
+ import{c as we}from"./chunk-FWY2PRIF.js";import{a as Xt,b as oe,c as Kt,d as Gt,e as Ae,g as Zt}from"./chunk-DRENNWRG.js";import{C as Jt,D as de,E as re,F as Qt,G as O,H as _e,I as ge,J as ct,M as De,a as Ht,b as $,c as it,i as V,k as W,l as x,m as Ee,q as te,u as G,v as C,w as fe,x as at,y as ne,z as Ce}from"./chunk-IYBIBMPF.js";import{p as K,q as L}from"./chunk-XYLV727H.js";import{a as k,b as pe,c as me,d as qt,e as Ie}from"./chunk-4NHWNAWQ.js";import{A as I,h as Pe}from"./chunk-4O52YNKL.js";var Cr=new Set(["identifier","type_identifier","field_identifier"]),_r=new Set(["identifier"]),Tr=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Fr=new Set(["rust","python"]),Rr=/\{([^{}]*)\}/g,kr=/\b([A-Za-z_][\w]*)\b/g;function Yt(e,t){return Lr(t).has(e.type)}function en(e,t){return Fr.has(t)&&e.type==="string_content"}function lt(e){let t=0;for(let r of e.values()){let o=r[r.length-1];o!==void 0&&o>t&&(t=o)}let n=new Array(t+1);for(let r=0;r<=t;r+=1)n[r]=new Set;for(let[r,o]of e)for(let s of o)n[s].add(r);return n}function Lr(e){return e==="rust"?Cr:e==="python"?_r:Tr}function tn(e,t){let n=e.startPosition.row;for(let r of e.text.matchAll(Rr)){let o=r[1]??"";for(let s of o.matchAll(kr))s[1]&&t(s[1],n)}}var vr=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Pr=/^#!?\[\s*serde\s*\(/,Er=/^#!?\[\s*schemars\s*\(/,Dr=/^#!?\[\s*validate\s*\(/,wr=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function nn(e,t,n){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let r=e.childForFieldName("function")??e.namedChild(0);if(!r)return;let o=ct(r);if(!o||!wr.has(o))return;let s=e.namedChildren.find(c=>c.type==="arguments");if(!s)return;let i=s.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&n.add(a.text)}function rn(e,t){let n=Pr.test(e),r=Er.test(e),o=Dr.test(e);if(!(!n&&!r&&!o))for(let s of vr){s.lastIndex=0;let i;for(;(i=s.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&t.add(c)}}}function on(e,t){let n=new Map,r=(i,a)=>{if(i===a)return;let c=n.get(i);c||(c=new Set,n.set(i,c)),c.add(a)},o=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),s=(i,a)=>{let c=l=>{o.has(l.type)&&l.text!==a&&r(l.text,a);for(let u of l.children)c(u)};for(let l of i.children)c(l)};if(t==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&s(c,a),i.type==="type_item"&&s(i,a)}else if(t==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(u=>u.type==="identifier")?.text;if(!a)continue;let c=i.childForFieldName("superclasses");c&&s(c,a);let l=i.namedChildren.find(u=>u.type==="block");if(l)for(let u of l.descendantsOfType("type"))for(let p of u.descendantsOfType("identifier"))p.text!==a&&r(p.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&s(i,a)}return n}var Ar=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),ut=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function sn(e){let t=[],n=[],r=[],o=new Map,s=[],i=0,a=0,c=(l,u)=>{let p=o.get(l);if(!p){o.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)};for(;a<e.length;){let l=e[a];if(l===`
2
+ `){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=Me(e,a);continue}if(l==='"'){let g=Fe(e,a,i);i=g.line,a=g.index;continue}if(l==="("||l==="["||l==="{"){s.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let g=s.pop();g&&(g.endLine=i,Or(g,{callables:t,callSites:n,clojureMembers:r,recordIdentifier:c}),s[s.length-1]?.children.push(g)),a+=1;continue}if(pt(l)){a+=1;continue}let u=i,p=a;for(;a<e.length&&!mt(e[a]);)a+=1;let m=e.slice(p,a);if(!m)continue;let f={text:m,line:u};Mr(s[s.length-1],f),c(v(m),u)}return{language:"clojure",callables:t,callSites:n,clojureMembers:r,typeContainerMap:new Map,identifierLineMap:o,identifiersByLine:Wr(o),fileIdentifiers:new Set(o.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Or(e,t){if(e.kind!=="("||e.headTokens.length===0)return;let n=e.headTokens[0],r=v(n.text),o=Ar.get(n.text);if(o){let i=e.headTokens[1];if(i){let a=v(i.text);t.recordIdentifier(a,i.line),t.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:o})}}if(jr(e,t),!r||ut.has(n.text)||ut.has(r)||r.startsWith(":"))return;let s=Vr(n.text);t.callSites.push({calleeLeaf:s.leaf,calleeQualifier:s.qualifier,calleeText:s.text,memberAccess:!1,line:n.line})}function Mr(e,t){e&&(e.headTokens.length<2&&e.headTokens.push(t),e.tokens.length<200&&e.tokens.push(t))}function jr(e,t){let n=v(e.tokens[0]?.text??"");if(n==="defprotocol"){let r=v(e.tokens[1]?.text??"");if(!r)return;for(let o of Oe(e))Te(t,r,"protocol",o,"protocol-method");return}if(n==="defrecord"||n==="deftype"){let r=v(e.tokens[1]?.text??"");if(!r)return;let o=n==="defrecord"?"record":"type",s=n==="defrecord"?"record-method":"type-method";for(let i of Oe(e))Te(t,r,o,i,s);return}if(n==="extend-type"){let r=v(e.tokens[1]?.text??"");if(!r)return;for(let o of Oe(e))Te(t,r,"extension",o,"extension-method");return}if(n==="extend-protocol"){let r=v(e.tokens[1]?.text??"");for(let o of Oe(e)){r&&Te(t,r,"extension",o,"extension-method");let s=Br(e,o.startLine);s&&s!==r&&Te(t,s,"extension",o,"extension-method")}}}function Oe(e){return e.children.filter($r)}function $r(e){if(e.kind!=="(")return!1;let t=v(e.tokens[0]?.text??"");return!!(t&&!ut.has(t)&&!t.startsWith(":"))}function Te(e,t,n,r,o){let s=r.tokens[0],i=v(s?.text??"");!s||!i||(e.recordIdentifier(i,s.line),e.clojureMembers.push({ownerName:t,ownerKind:n,memberName:i,memberKind:o,startLine:r.startLine,endLine:r.endLine}))}function Br(e,t){let n=null;for(let r=2;r<e.tokens.length;r+=1){let o=e.tokens[r];if(o.line>t)break;let s=v(o.text);s&&!s.startsWith(":")&&(n=s)}return n}function v(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Vr(e){let t=e.replace(/^#?['`~@]+/,""),n=t.lastIndexOf("/"),r=v(t);if(n<=0)return{leaf:r,text:t};let o=t.slice(0,n);return{leaf:r,qualifier:o,text:t}}function Me(e,t){let n=t;for(;n<e.length&&e[n]!==`
3
+ `;)n+=1;return n}function Fe(e,t,n){let r=t+1,o=n;for(;r<e.length;){let s=e[r];if(s==="\\"){r+=2;continue}if(s===`
4
+ `&&(o+=1),r+=1,s==='"')break}return{index:r,line:o}}function pt(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function mt(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Wr(e){let t=[];for(let[n,r]of e)for(let o of r)t[o]??=new Set,t[o].add(n);return t}var an=6,zr=qt("source-facts",{clearGroups:["whole-project","source-file"]}),ft=V({kind:"source-facts",invalidation:W("source-facts"),serialize:Hr,deserialize:Jr});function z(e,t){return dt(e,t).facts}function dt(e,t){let n=x(e,t);if(!n)return{facts:null};let r=Ur(e,t,n);return r?zr.get(e,t,n,()=>qr(e,t,r,n)):{facts:null}}function Ur(e,t,n){return Ce(t)?Qt(e,t,n)?.language??null:ne(t)}function qr(e,t,n,r){let o=$(e,t,r),s=ft.read(e,t,o);if(s&&s.language===n)return{facts:s};if(n==="clojure"){let c=sn(r);return ft.write(e,t,o,c),{facts:c}}let i=O(e,t);if(!i)return{facts:null,unavailable:{language:n,reason:"parser-unavailable"}};let a=Gr(i,n);return ft.write(e,t,o,a),{facts:a}}function Hr(e){let t={version:an,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([n,r])=>[n,[...r]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function Jr(e){try{let t=JSON.parse(e);if(t.version!==an||t.language==="clojure"&&(t.clojureMembers===void 0||t.callSites.some(r=>r.calleeText===void 0)))return null;let n=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,clojureMembers:t.clojureMembers??[],typeContainerMap:new Map(t.typeContainerMap.map(([r,o])=>[r,new Set(o)])),identifierLineMap:n,identifiersByLine:lt(n),fileIdentifiers:new Set(n.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function Qr(e,t,n,r){let o=z(e,t);return o?Kr(o,n,r)?.isLiteralPassthrough??!0:!0}function Xr(e,t){return t.relativePath.includes(".clj-kondo/hooks/")?!0:z(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine)?.clojureKind==="macro"}function Kr(e,t,n){return e.callables.find(r=>r.startLine===t&&r.endLine===n)??null}function Gr(e,t){let n=[],r=[],o=new Set,s=new Set,i=new Map,a=(l,u)=>{let p=i.get(l);if(!p){i.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)},c=l=>{let u=De(l,t);u&&n.push(u);let p=ge(l,t);p&&r.push(p),nn(l,t,s),t==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&rn(l.text,o),Yt(l,t)&&a(l.text,l.startPosition.row),en(l,t)&&tn(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:t,callables:n,callSites:r,clojureMembers:[],typeContainerMap:on(e,t),identifierLineMap:i,identifiersByLine:lt(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:o,crossLanguageDispatchNames:s}}var cn=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function gt(e,t){let n=z(e,t);return!n||!cn.has(n.language)?null:n.callables.map(r=>({name:r.name,startLine:r.startLine,endLine:r.endLine}))}function Zr(e,t){let n=z(e,t);return!n||!cn.has(n.language)?null:n.callSites}function Yr(e,t){return z(e,t)?.typeContainerMap??new Map}import{ElementTypes as to,NodeTypes as ht,parse as no}from"@vue/compiler-dom";import{parse as Xc}from"@vue/compiler-sfc";var eo=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 je(e){return e.length<=2||eo.has(e)}function $e(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var ro=me("vue-template-facts"),oo=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),so=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"]),io=new Set(["div","span","template"]),ao=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 Be(e,t){let n=t.replace(/\\/g,"/"),r=x(e,n);return ro.get(e,n,r,()=>co(n,de(e,n).template))}function co(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=no(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return un(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function un(e,t,n,r){for(let o of e)if(o.type===ht.ELEMENT)lo(o,t,n,r),un(o.children,t,n,r);else if(o.type===ht.INTERPOLATION){r("interpolation");let s=St(o.content);s&&pn(s,t,o.loc.start.line,n,r)}}function lo(e,t,n,r){let o=So(e.tag),s={tag:e.tag,normalized:o,kind:ho(e),startLine:he(t,e.loc.start.line),endLine:he(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),io.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)uo(i,t,n,r)}function uo(e,t,n,r){if(e.type===ht.ATTRIBUTE){let a=e.value?.content??null,c=ln("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=mo(e),s=St(e.exp),i=ln(po(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&&pn(s,t,e.loc.start.line,n,r)}function ln(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:he(r,o),endLine:he(r,s)}}function po(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function mo(e){let t=St(e.arg);return t||e.name}function St(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function pn(e,t,n,r,o){for(let s of fo(e)){let i={name:s,startLine:he(t,n),endLine:he(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function fo(e){let t=new Set,n=go(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];ao.has(s)||je(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function go(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 ho(e){let t=e.tag;return e.tagType===to.COMPONENT?"component":oo.has(t)?"builtin":so.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function So(e){return $e(e,/[-_:]/)}function he(e,t){return e+Math.max(0,t-1)}import{createRequire as ko}from"module";import{existsSync as ae}from"fs";import{basename as fn,dirname as T,extname as U,join as P,relative as se,resolve as b,sep as Lo}from"path";import{existsSync as xt,readdirSync as yo,statSync as xo}from"fs";import{join as Se,relative as bo}from"path";function mn(e){let t=No(e)??To(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Fo(e,o)){if(r.has(s))continue;r.add(s);let i=Ro(e,s);i&&n.push(i)}return n}function No(e){let t=Se(e,"pnpm-workspace.yaml");if(!xt(t))return null;try{return Io(Pe(t,"pnpm workspace manifest"))}catch{return null}}function Io(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Co(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=_o(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Co(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function _o(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function To(e){let t=Se(e,"package.json");if(!xt(t))return null;try{let n=JSON.parse(Pe(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Fo(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=Se(e,t);return yt(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=Se(e,r||".");return yt(s)?yo(s).map(i=>Se(s,i,o)).filter(yt):[]}function yt(e){try{return xo(e).isDirectory()}catch{return!1}}function Ro(e,t){let n=Se(t,"package.json");if(!xt(n))return null;try{let r=JSON.parse(Pe(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:bo(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var vo=pe("indexed-paths",{clearGroups:[]}),Po=pe("indexed-path-digest",{clearGroups:[]}),Eo=k("tsconfig-alias-config",{clearGroups:["whole-project"]}),Do=k("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),wo=ko(import.meta.url),Re;function Ao(){if(Re!==void 0)return Re;try{Re=wo("typescript")}catch{Re=null}return Re}var Oo=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Mo=pe("workspace-packages",{clearGroups:["whole-project"]}),ie=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],Ve=[".py",".pyi"],F=[".java",".scala",".kt",".kts"],We=[".rs"],ze=[".rb"],Ue=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Z=[".cs",".vb"],qe=[".dart"],ce=[".php"],ye=[".clj",".cljs",".cljc"],jo=new Set(ie),bt=new Set(Ve),dn=new Set(F),Nt=new Set(We),It=new Set(ze),gn=new Set(Ue),hn=new Set(Z),Ct=new Set(qe),Sn=new Set(ce),yn=new Set(ye),$o=[{extensions:ie,lookup:jo},{extensions:Ve,lookup:bt},{extensions:F,lookup:dn},{extensions:We,lookup:Nt},{extensions:ze,lookup:It},{extensions:Ue,lookup:gn},{extensions:Z,lookup:hn},{extensions:qe,lookup:Ct},{extensions:ce,lookup:Sn},{extensions:ye,lookup:yn}];function q(e,t){return t.has(U(e).toLowerCase())}function Bo(e){return q(e,bt)}function Vo(e){return q(e,dn)}function Wo(e){return q(e,Nt)}function zo(e){return q(e,It)}function Uo(e){return q(e,gn)}function qo(e){return q(e,hn)}function xn(e){return U(e).toLowerCase()===".vb"}function Ho(e){return q(e,Ct)}function Jo(e){return q(e,Sn)}function Qo(e){return q(e,yn)}function _t(e){let t=U(e).toLowerCase();for(let n of $o)if(n.lookup.has(t))return n.extensions;return ie}function Xo(e){return Vo(e)||qo(e)||Jo(e)}function B(e,t,n){return Bo(t)?xe(e,t,n):Wo(t)?H(e,t,n):zo(t)?He(e,t,n):Uo(t)?Je(e,t,n):Xo(t)?S(e,n.replace(/\\/g,"."),_t(t)):Ho(t)?Qe(e,t,n):Qo(t)?Tt(e,n):Ko(e,t,n)}function Ko(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return Go(e,t,n)??Yo(e,n);let r=T(P(e.config.projectRoot,t)),o=b(r,n),s=J(e);for(let i of Rt(o)){let a=I(se(e.config.projectRoot,i));if(s.has(a)||ae(i))return a}return I(se(e.config.projectRoot,o))}function Go(e,t,n){let r=ss(e,t);if(!r)return null;let o=J(e);for(let s of Zo(r,n)){let i=b(r.baseUrl,s);for(let a of Rt(i)){let c=I(se(e.config.projectRoot,a));if(o.has(c)||ae(a))return c}}return null}function Zo(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 Yo(e,t){let n=ts(es(e),t);if(!n)return null;let r=J(e);for(let o of ns(n)){let s=b(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of Rt(s)){let a=I(se(e.config.projectRoot,i));if(r.has(a)||ae(i))return a}}return null}function es(e){return Mo.get(e,()=>mn(e.config.projectRoot))}function ts(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 ns(e){let t=[],n=rs(e.pkg.exports,e.subpath);if(n){let r=os(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function rs(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return bn(e[n])}function bn(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=bn(t[n]);if(r)return r}return null}function os(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function ss(e,t){let n=I(T(t));return Do.get(e,n,()=>is(e,n))}function is(e,t){let n=Ao();if(!n)return null;let r=b(e.config.projectRoot),o=b(r,t);for(;o===r||o.startsWith(r+Lo);){for(let i of Oo){let a=P(o,i);if(!ae(a))continue;let c=Eo.get(e,a,()=>as(n,a));if(c)return c}let s=T(o);if(s===o)break;o=s}return null}function as(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,T(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?b(T(t),r.options.baseUrl):T(t),paths:o}}catch{return null}}function xe(e,t,n){let r=J(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=T(P(e.config.projectRoot,t));for(let l=1;l<i;l++)c=T(c);o=a?b(c,a.replace(/\./g,"/")):c}else o=b(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of cs(o)){let i=I(se(e.config.projectRoot,s));if(r.has(i)||ae(s))return i}return null}function H(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=T(P(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=b(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=b(o,r.slice(6).replace(/::/g,"/")):s=b(T(o),r.slice(7).replace(/::/g,"/")),Ft(e,ls(s))}function He(e,t,n){let r=T(P(e.config.projectRoot,t)),o=b(r,n);return Ft(e,us(o))}function Je(e,t,n){let r=T(P(e.config.projectRoot,t)),o=[b(r,n),b(e.config.projectRoot,n),b(e.config.projectRoot,"include",n),b(e.config.projectRoot,"src",n)];return Ft(e,o)}function S(e,t,n){let r=J(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}`,u=[...r].find(p=>p.endsWith(l));if(u)return u}for(let c of n){let l=[...r].find(u=>fn(u)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(U(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Qe(e,t,n){let r=J(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=I(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=T(P(e.config.projectRoot,t)),s=b(o,n);for(let i of ps(s)){let a=I(se(e.config.projectRoot,i));if(r.has(a)||ae(i))return a}return null}function Tt(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=J(e);for(let o of ye){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of ye){let s=[...r].find(i=>fn(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function cs(e){let t=U(e);return bt.has(t)?[e]:[`${e}.py`,`${e}.pyi`,P(e,"__init__.py"),P(e,"__init__.pyi")]}function Ft(e,t){let n=J(e);for(let r of t){let o=I(se(e.config.projectRoot,r));if(n.has(o)||ae(r))return o}return null}function ls(e){let t=U(e);return Nt.has(t)?[e]:[`${e}.rs`,P(e,"mod.rs")]}function us(e){let t=U(e);return It.has(t)?[e]:[`${e}.rb`,P(e,"index.rb")]}function ps(e){let t=U(e);return Ct.has(t)?[e]:[`${e}.dart`,e]}function Rt(e){let t=U(e),n=new Set;if(t){n.add(e);for(let r of ie)n.add(e.slice(0,-t.length)+r)}else for(let r of ie)n.add(`${e}${r}`),n.add(P(e,`index${r}`));return[...n]}function J(e){return vo.get(e,()=>new Set(Ie(e,{includeIgnored:!1}).map(I)))}function kt(e){return Po.get(e,()=>Ht([...J(e)].sort().join(`
5
+ `)))}var ms=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),fs=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),ds=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),gs=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),hs=new Set(["catch","for","function","if","return","switch","while"]);function Ke(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+=re(n),n.external&&(t.externalLineCount+=re(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(...bs(n));let r=Jt(n.astLanguage,n.body);r?ys(n,r.rootNode,t):xs(n,t)}return Ss(t),t.externalScriptPaths=In(t.externalScriptPaths),t}function Ss(e){e.composables=be(e,"composable"),e.stores=be(e,"store"),e.reactivity=be(e,"reactivity"),e.lifecycle=be(e,"lifecycle"),e.requests=be(e,"request"),e.macros=be(e,"macro")}function be(e,t){return In(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function ys(e,t,n){let r=new Set,o=new Set,s=i=>{let a=De(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=ge(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:Nn(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function xs(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||hs.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+Xe(e.body,n.index??0),categories:Nn(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+Xe(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+Xe(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function bs(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+Xe(e.body,n.index??0);for(let i of Ns(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function Ns(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 Nn(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),ms.has(e)&&t.push("reactivity"),fs.has(e)&&t.push("lifecycle"),ds.has(e)&&t.push("request"),gs.has(e)&&t.push("macro"),t}function Xe(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 In(e){return[...new Set(e)].sort()}var Is=new Set(["in","key","of"]),Cs=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),_s=me("vue-component-behavior-profiles");function Cn(e,t={}){let n=we(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=>Lt(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Lt(e,t){let n=t.replace(/\\/g,"/"),r=x(e,n),o=_s.get(e,n,r,()=>Ts(e,n,r));return Rs(o)}function Ts(e,t,n){let r=de(e,t),o=Be(e,t),s=Ke(r),i=vs(o),a=o.expressionIdentifiers.map(d=>d.name).filter(d=>!i.includes(d)).filter((d,A,ee)=>ee.indexOf(d)===A).sort(),c=o.componentTags.map(d=>d.normalized).filter((d,A,ee)=>ee.indexOf(d)===A).sort(),l=n?n.split(`
6
+ `).length:0,u=re(r.template),p=s.lineCount,m=r.styles.reduce((d,A)=>d+re(A),0),f=r.customBlocks.reduce((d,A)=>d+re(A),0),{lines:g,paths:j}=Fs(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:Ls(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:u,scriptLines:p,styleLines:m,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:f,delegatedComposableLines:g,delegatedComposablePaths:j}}function Fs(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=B(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=x(e,a);return i+(c?c.split(`
7
+ `).length:0)},0),paths:o}}function Rs(e){let t=ks(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 ks(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 Ls(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(Cs.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 vs(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Ps(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of _n(n.value))t.add(r);return[...t].sort()}function Ps(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?_n(t[1]??""):[]}function _n(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];Is.has(r)||t.push(r)}return t}import{extname as Es}from"path";var Ds=[".tsx",".jsx"],Tn=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),ws=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),As=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),Os=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Ms=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),js=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),$s=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),Bs=me("react-component-behavior-profiles"),Fn=V({kind:"react-component-behavior-profiles",invalidation:W("react-component-behavior-profiles"),serialize:Us,deserialize:qs});function vn(e,t={}){let n=we(e,{extensions:Ds}).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=>Pt(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Pt(e,t){let n=t.replace(/\\/g,"/"),r=x(e,n);return Bs.get(e,n,r,()=>Vs(e,n,r)).map(zs)}function Vs(e,t,n){let r=$(e,t,n),o=Fn.read(e,t,r);if(o)return o;let s=Ws(e,t);return Fn.write(e,t,r,s),s}function Ws(e,t){let n=Js(t);if(!n)return[];let r=O(e,t);if(!r)return[];let o=Ee(e,t).length;return Qs(r.rootNode,n).filter(i=>i.kind==="hook"||Et(i.bodyNode)).map(i=>{let a=ti(i.bodyNode),c=ii(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:Q(a.componentNames),nativeTags:Q(a.nativeTags),propNames:Q(a.propNames),eventNames:Q(a.eventNames),hookNames:Q(c.hookNames),requestNames:Q(c.requestNames),stateNames:Q(c.stateNames),effectNames:Q(c.effectNames),handlerNames:Q(c.handlerNames)}})}function zs(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 Us(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function qs(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=Hs(r);if(!o)return null;n.push(o)}return n}catch{return null}}function Hs(e){if(!K(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:u,nativeTags:p,propNames:m,eventNames:f,hookNames:g,requestNames:j,stateNames:d,effectNames:A,handlerNames:ee}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!Ge(o)||!Ge(s)||!Ge(i)||!Ge(a))return null;let N={jsxTokens:L(c),behaviorTokens:L(l),componentNames:L(u),nativeTags:L(p),propNames:L(m),eventNames:L(f),hookNames:L(g),requestNames:L(j),stateNames:L(d),effectNames:L(A),handlerNames:L(ee)};return Object.values(N).some(Ir=>Ir===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(N.jsxTokens),behaviorTokens:new Set(N.behaviorTokens),componentNames:N.componentNames,nativeTags:N.nativeTags,propNames:N.propNames,eventNames:N.eventNames,hookNames:N.hookNames,requestNames:N.requestNames,stateNames:N.stateNames,effectNames:N.effectNames,handlerNames:N.handlerNames}}function Ge(e){return typeof e=="number"&&Number.isFinite(e)}function Js(e){let t=Es(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:ne(e)}function Qs(e,t){let n=[],r=new Set,o=s=>{let i=Xs(s);if(i&&(!Ys(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 Xs(e){if(e.type==="class_declaration"){let s=vt(e);if(!s||!/^[A-Z]/.test(s))return null;let i=Ks(e);return!i||!Gs(e)&&!Et(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=vt(e);return!s||!Rn(s)?null:{name:s,kind:kn(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=ke(t);if(!r||!n||!Rn(r))return null;let o=Zs(n);return o?{name:r,kind:kn(r),node:e,bodyNode:o}:null}function Ks(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 Gs(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Rn(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function kn(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function Zs(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=ei(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 Ys(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 vt(e){return ke(e.childForFieldName("name")??e.namedChild(0))}function ei(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function Et(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(Et)}function ti(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"?ni(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?ri(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function ni(e,t){let n=oi(e),r=!1;if(n){let o=Ln(n),s=o==="Fragment"||o==="React.Fragment";r=pi(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=si(o);if(!s)continue;let i=Ln(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 $s.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(Pn(o))}function ri(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(Pn(e)),En(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of mi(n))je(r)||t.tokens.add(`binding:${r}`)}function Pn(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 En(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(En)}function oi(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 si(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 ii(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=ge(o,t);s&&ai(s.calleeLeaf,n)}else if(o.type==="variable_declarator")li(o,n);else if(o.type==="function_declaration"){let s=vt(o);s&&Dn(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function ai(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Tn.has(e)&&!Os.has(e)&&t.tokens.add(`hook:${e}`)),Tn.has(e)&&t.tokens.add(`react-hook:${e}`),ws.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),As.has(e)&&t.tokens.add(`state-hook:${e}`),ci(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function ci(e){if(Ms.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function li(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=>ke(a)),i=ke(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=ke(n);o&&Dn(o,t)}function Dn(e,t){let n=ui(e);!n||!js.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function ui(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 pi(e){return/^[A-Z]/.test(e)||e.includes(".")}function Ln(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function ke(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 mi(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 Q(e){return[...e].sort()}function ql(e){return{capability:(t,n)=>fi(t,n),reactProfiles:(t={})=>vn(e,t),reactProfilesForFile:t=>Pt(e,t),vueProfiles:(t={})=>Cn(e,t),vueProfileForFile:t=>Lt(e,t),vueTemplateFacts:t=>Be(e,t),vueScriptFacts:t=>Ke(de(e,t))}}function fi(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}}function di(e,t,n={}){let r=z(e,t);if(!r)return[];let o=[];if(n.includeCrossLanguageDispatchNames)for(let s of r.crossLanguageDispatchNames)o.push({name:s,kind:"cross-language-dispatch",occurrences:1});if(n.includeRustAttributeNames&&r.language==="rust")for(let s of r.rustAttrReferencedNames)o.push({name:s,kind:"rust-attribute",occurrences:1});return o}import{basename as wn}from"path";var gi=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function _(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let s=e[o];(s==="{"||s==="["||s==="(")&&n++,(s==="}"||s==="]"||s===")")&&n--,s===","&&n===0&&(t.push(e.slice(r,o)),r=o+1)}return t.push(e.slice(r)),t}function R(e,t){for(let n of e.namedChildren)if(n.type===t)return n;return null}function y(e,t){let n=new Set,r=(o,s)=>{let i=s||t.has(o.type);!i&&gi.has(o.type)&&n.add(o.text);for(let a of o.children)r(a,i)};return r(e.rootNode,!1),n}function M(e,t,n,r,o,s,i){return{importedName:o,localName:s,sourcePath:i??S(e,r,_t(t)),kind:"named",used:C(n,s),usedMembers:[]}}function h(e,t,n,r,o="named",s={}){return{importedName:e,localName:t,sourcePath:n,kind:o,used:r.has(t),usedMembers:[],isTypeOnly:s.isTypeOnly}}function X(e,t,n,r,o="named",s=[],i={}){return{importedName:e,localName:t,sourcePath:n,kind:o,used:r,usedMembers:s,isTypeOnly:i.isTypeOnly}}function le(e,t){return{importedName:e,localName:null,sourcePath:t,kind:"side-effect",used:!0,usedMembers:[]}}function ue(e,t,n={}){return{importedName:e,localName:n.localName??null,sourcePath:t,kind:"namespace",used:n.used??!0,usedMembers:n.usedMembers??[],isTypeOnly:n.isTypeOnly}}function E(e,t,n){let r=[];for(let o of e.matchAll(t)){let s=o[0];if(!s||typeof o.index!="number")continue;let i=G(e,o.index,o.index+s.length);for(let a of n(o,i))r.push(a)}return r}function D(e,t,n,r,o){let s=_e(e,t,o)?.tree??null;if(s){let i=n(s);if(i)return i}return r()}function Ze(e,t,n,r,o){let s=_e(e,t,o)?.tree??null,i=ne(t),a=i?n[i]:void 0;return s&&a?a(s):r()}function An(e,t,n){return D(e,t,r=>Si(e,t,r),()=>hi(e,t,n),n)}function hi(e,t,n){return E(n,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(r,o)=>{let s=r[1]?.trim();if(!s)return[];let i=wn(s).replace(/\.[^.]+$/,"");return[X(s,i,Je(e,t,s),C(o,i))]})}function Si(e,t,n){let r=y(n,new Set(["preproc_include"])),o=[];for(let s of n.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of s.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=wn(i).replace(/\.[^.]+$/,"");o.push(h(i,a,Je(e,t,i),r))}return o}var yi=new Set([":require",":require-macros",":use"]),At=String.raw`A-Za-z0-9_$*+!?.<>=-`;function Mn(e,t,n){let r=Li(n);if(!r)return[];let o=ki(n,r.start,r.end),s=[];for(let i of r.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=w(i.children[0]);if(a){if(yi.has(a)){for(let c of Ni(i.children.slice(1)))s.push(...bi(e,c,o));continue}if(a===":import")for(let c of Ci(i.children.slice(1)))s.push(c)}}return s}function xi(e){return e.type==="list"&&w(e.children[0])==="ns"}function bi(e,t,n){let r=Tt(e,t.namespace),o=t.alias??t.namespace,s=Ti(n,o),i=[{importedName:t.namespace,localName:o,sourcePath:r,kind:"namespace",used:t.refers.length>0||t.referAll||s.length>0||Fi(n,t.namespace),usedMembers:s}];t.referAll&&i.push({importedName:"*",localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]});for(let a of t.refers)i.push({importedName:a,localName:a,sourcePath:r,kind:"named",used:Ri(n,a),usedMembers:[]});return i}function Ni(e){return e.flatMap(t=>Ye(t,null))}function Ye(e,t){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:wt(t,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&w(e.children[0])===null?e.children.flatMap(n=>Ye(n,t)):Ii(e,t);if(e.type==="list"&&e.children.length>0){let n=w(e.children[0]);return n?!n||n.startsWith(":")?[]:e.children.slice(1).flatMap(r=>Ye(r,wt(t,n))):e.children.flatMap(r=>Ye(r,t))}return[]}function Ii(e,t){let n=w(e.children[0]);if(!n||n.startsWith(":"))return[];let r={namespace:wt(t,n),alias:null,refers:[],referAll:!1};for(let o=1;o<e.children.length;o+=1){let s=w(e.children[o]);if(!s?.startsWith(":"))continue;let i=e.children[o+1];if((s===":as"||s===":as-alias")&&i){r.alias=w(i),o+=1;continue}s===":refer"&&i&&(w(i)===":all"?r.referAll=!0:(i.type==="vector"||i.type==="list")&&r.refers.push(...i.children.map(w).filter(_i)),o+=1)}return[r]}function Ci(e){let t=[];for(let n of e){if(n.type==="atom"){let o=n.text.split(".").pop()??n.text;t.push(X(o,o,null,!0));continue}if(n.type!=="vector")continue;let r=w(n.children[0]);if(r)for(let o of n.children.slice(1)){let s=w(o);s&&t.push(X(`${r}.${s}`,s,null,!0))}}return t}function wt(e,t){return e?`${e}.${t}`:t}function w(e){return e?.type==="atom"?e.text:null}function _i(e){return!!(e&&!e.startsWith(":"))}function Ti(e,t){let n=new Set,r=new RegExp(`${Ot()}${te(t)}\\s*/\\s*([${At}]+)`,"g");for(let o of e.matchAll(r)){let s=o[1];s&&n.add(s)}return[...n]}function Fi(e,t){return new RegExp(`${Ot()}${te(t)}\\s*/`,"m").test(e)}function Ri(e,t){return new RegExp(`${Ot()}${te(t)}(?![${At}])`,"m").test(e)}function Ot(){return`(?<![${At}])`}function ki(e,t,n){let r="",o=0;for(;o<e.length;){if(o>=t&&o<n){r+=e[o]===`
8
+ `?`
9
+ `:" ",o+=1;continue}let s=e[o];if(s===";"){let i=Me(e,o);r+=On(e.slice(o,i)),o=i;continue}if(s==='"'){let i=Fe(e,o,0).index;r+=On(e.slice(o,i)),o=i;continue}r+=s,o+=1}return r}function Li(e){let t=0;for(;t<e.length&&(t=Mt(e,t),!(t>=e.length));){let n=et(e,t);if(!n){t+=1;continue}if(xi(n.form))return n.form;t=n.index}return null}function et(e,t){let n=Mt(e,t);if(e.startsWith("#?@",n)||e.startsWith("#?",n))return vi(e,n);if(e.startsWith("#_",n)){let o=et(e,n+2);return o?{form:{type:"atom",text:"",start:n,end:o.index},index:o.index}:null}for(;pt(e[n]);)n+=1;let r=e[n];return r?r==="("?Dt(e,n,"list",")"):r==="["?Dt(e,n,"vector","]"):r==="{"?Dt(e,n,"map","}"):r==='"'?{form:{type:"atom",text:"",start:n,end:Fe(e,n,0).index},index:Fe(e,n,0).index}:Ei(e,n):null}function vi(e,t){let n=e.startsWith("#?@",t)?3:2,r=et(e,t+n);return r?{form:{type:"list",children:r.form.type==="list"||r.form.type==="vector"||r.form.type==="map"?Pi(r.form.children):[],start:t,end:r.index},index:r.index}:null}function Pi(e){let t=[];for(let n=0;n<e.length;n+=2){let r=w(e[n]),o=e[n+1];r?.startsWith(":")&&o&&t.push(o)}return t}function Dt(e,t,n,r){let o=[],s=t+1;for(;s<e.length;){if(s=Mt(e,s),e[s]===r)return{form:{type:n,children:o,start:t,end:s+1},index:s+1};let i=et(e,s);if(!i){s+=1;continue}i.form.type==="atom"&&i.form.text===""||o.push(i.form),s=i.index}return{form:{type:n,children:o,start:t,end:e.length},index:e.length}}function Ei(e,t){let n=t;for(;n<e.length&&!mt(e[n]);)n+=1;return{form:{type:"atom",text:e.slice(t,n),start:t,end:n},index:n}}function Mt(e,t){let n=t;for(;n<e.length;){let r=e[n];if(/\s|,/.test(r)){n+=1;continue}if(r===";"){n=Me(e,n);continue}break}return n}function On(e){return e.replace(/[^\r\n]/g," ")}function jn(e,t,n){let r=[];for(let o of n.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let s=o[1]?.trim(),i=o[2]?.trim()??null,a=o[0];if(!s||!a||typeof o.index!="number")continue;let c=G(n,o.index,o.index+a.length);r.push({importedName:s,localName:i,sourcePath:Qe(e,t,s),kind:i?"namespace":"side-effect",used:i?C(c,i):!0,usedMembers:i?fe(c,i):[]})}return r}function $n(e,t,n){let r=[];for(let o of n.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let s=o[1]?.trim();s&&r.push({specifier:s,sourcePath:Qe(e,t,s)})}return r}function Bn(e,t,n){return Ze(e,t,{csharp:r=>wi(e,t,r),vb:r=>Di(e,t,r)},()=>{let r=xn(t)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return E(n,r,(o,s)=>{let i=o[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,u=(l?c:a)?.trim()??i,p=u.split(".").pop()??u,m=l?a?.trim()??p:p;return[M(e,t,s,u,p,m,S(e,u,Z))]})},n)}function Di(e,t,n){let r=y(n,new Set(["imports_statement"])),o=[];for(let s of n.rootNode.descendantsOfType("imports_statement")){let i=s.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,u=l.split(".").pop()??l,p=c?.text??u;o.push(h(u,p,S(e,l,Z),r,c?"namespace":"named"))}return o}function wi(e,t,n){let r=y(n,new Set(["using_directive"])),o=[];for(let s of n.rootNode.descendantsOfType("using_directive")){let i=s.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,u=l.split(".").pop()??l,p=a?.text??u;o.push(h(u,p,S(e,l,Z),r,a?"namespace":"named"))}return o}var Ai=k("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Vn(e,t){return Ai.get(e,t,()=>{let n=new Set,r=x(e,t);if(!r)return n;let s=r.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of s.matchAll(/[A-Za-z_$][\w$]*/g))n.add(i[0]);return n})}function jt(e,t,n){return D(e,t,r=>Mi(e,t,r),()=>Oi(e,t,n),n)}function Oi(e,t,n){return Qi(n).flatMap(r=>Xi(e,t,r.clause,r.specifier,r.start,r.end,n))}function Mi(e,t,n){let r=ji(e,t,n),o=[];for(let s of n.rootNode.descendantsOfType("import_statement"))o.push(...$i(e,t,n,s,r));return o}function ji(e,t,n){let r=y(n,new Set(["import_statement"]));if(Ce(t))for(let o of Vn(e,t))r.add(o);return r}function $i(e,t,n,r,o){let s=Ui(r);if(!s)return[];let i=B(e,t,s),a=R(r,"import_clause");return a?Bi(n,a,i,o,qi(r.text)):[le("*",i)]}function Bi(e,t,n,r,o){let s=[];for(let i of t.namedChildren)if(i.type==="identifier")s.push(Vi(i.text,n,r,o));else if(i.type==="namespace_import"){let a=Wi(e,i,n,r,o);a&&s.push(a)}else i.type==="named_imports"&&s.push(...zi(i,n,r,o));return s}function Vi(e,t,n,r){return h("default",e,t,n,"default",{isTypeOnly:r})}function Wi(e,t,n,r,o){let i=R(t,"identifier")?.text??"";if(!i)return null;let a=Ji(e,i);return ue("*",n,{localName:i,usedMembers:a,isTypeOnly:o,used:a.length>0||r.has(i)})}function zi(e,t,n,r){let o=[];for(let s of e.namedChildren){if(s.type!=="import_specifier")continue;let i=s.namedChild(0),a=s.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;o.push(h(c,l,t,n,"named",{isTypeOnly:r||Hi(s.text)}))}return o}function Ui(e){let t=R(e,"string");if(!t)return null;let n=R(t,"string_fragment");return n?n.text:null}function qi(e){return/^\s*import\s+type\b/.test(e)}function Hi(e){return/^\s*type\b/.test(e.trim())}function Ji(e,t){let n=new Set;for(let r of e.rootNode.descendantsOfType("member_expression")){let o=r.namedChild(0),s=r.namedChild(1);!o||!s||o.type!=="identifier"||o.text!==t||(s.type==="property_identifier"||s.type==="identifier")&&n.add(s.text)}return[...n]}function Qi(e){let t=[],n=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){let s=o[0],i=o[1],a=o[2];!s||!a||typeof o.index!="number"||t.push({clause:i,specifier:a,start:o.index,end:o.index+s.length})}let r=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(r)){let s=o[0],i=o[1];!s||!i||typeof o.index!="number"||t.push({clause:null,specifier:i,start:o.index,end:o.index+s.length})}return t.sort((o,s)=>o.start-s.start)}function Xi(e,t,n,r,o,s,i){let a=B(e,t,r),c=G(i,o,s);return n?Ki(n).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let p=fe(c,u.localName);return ue(u.importedName,u.sourcePath,{localName:u.localName,usedMembers:p,used:p.length>0||C(c,u.localName),isTypeOnly:u.isTypeOnly})}return u.kind==="side-effect"?le(u.importedName,u.sourcePath):X(u.importedName,u.localName??"",u.sourcePath,u.localName?C(c,u.localName):!1,u.kind,[],{isTypeOnly:u.isTypeOnly})}):[le("*",a)]}function Ki(e){let t=e.trim(),n=/^type\b/.test(t),r=t.replace(/^type\s+/,""),[o,s]=Gi(r),i=[];return o&&i.push(...Wn(o,n)),s&&i.push(...Wn(s,n)),i}function Wn(e,t){let n=e.trim();if(!n)return[];if(n.startsWith("{")){let r=n.slice(1,-1).trim();return r?_(r).map(o=>{let s=o.trim(),i=t||/^type\b/.test(s),a=s.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return n.startsWith("* as ")?[{importedName:"*",localName:n.slice(5).trim(),kind:"namespace",isTypeOnly:t}]:[{importedName:"default",localName:n,kind:"default",isTypeOnly:t}]}function Gi(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r==="{"&&t++,r==="}"&&t--,r===","&&t===0)return[e.slice(0,n).trim(),e.slice(n+1).trim()]}return[e.trim(),null]}function $t(e,t,n){let r=O(e,t);return r?ra(e,t,r):Zi(e,t,n)}function Zi(e,t,n){return[...Yi(e,t,n),...ea(e,t,n),...ta(e,t,n)]}function Yi(e,t,n){let r=[],o=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(o)){if(typeof s.index!="number")continue;let i=s[1]??"",a=s[2]??"",c=_(i).map(p=>na(p.trim())).filter(p=>!!p),l=Ne(n,s.index),u=Ne(n,s.index+s[0].length-1);r.push({kind:"named",sourcePath:B(e,t,a),names:c,startLine:l,endLine:u})}return r}function ea(e,t,n){let r=[],o=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(o)){if(typeof s.index!="number")continue;let i=s[2]??"",a=Ne(n,s.index),c=Ne(n,s.index+s[0].length-1);r.push({kind:"star-as",sourcePath:B(e,t,i),names:s[1]?[s[1]]:[],startLine:a,endLine:c})}return r}function ta(e,t,n){let r=[],o=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(o)){if(typeof s.index!="number")continue;let i=s[1]??"",a=Ne(n,s.index),c=Ne(n,s.index+s[0].length-1);r.push({kind:"star",sourcePath:B(e,t,i),names:[],startLine:a,endLine:c})}return r}function na(e){if(!e)return null;let t=e.replace(/^type\s+/,"").trim();if(!t)return null;let n=t.match(/^(\w+)\s+as\s+(\w+)$/);if(n)return n[2]??null;let r=t.match(/^(\w+)$/);return r?r[1]??null:null}function Ne(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)e.charCodeAt(r)===10&&n++;return n}function ra(e,t,n){let r=[];for(let o of n.rootNode.descendantsOfType("export_statement")){let s=oa(e,t,o);if(s===void 0)continue;let i=o.startPosition.row,a=o.endPosition.row,c=sa(o,s,i,a);r.push(c)}return r}function oa(e,t,n){let r=R(n,"string");if(!r)return;let o=R(r,"string_fragment");if(o)return B(e,t,o.text)}function sa(e,t,n,r){let o=R(e,"export_clause");if(o){let i=[];for(let a of o.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:t,names:i,startLine:n,endLine:r}}let s=R(e,"namespace_export");if(s){let i=s.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:t,names:i?[i]:[],startLine:n,endLine:r}}return{kind:"star",sourcePath:t,names:[],startLine:n,endLine:r}}function zn(e,t,n){return Ze(e,t,{java:r=>ia(e,t,r),kotlin:r=>aa(e,t,r),scala:r=>ca(e,t,r)},()=>E(n,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(r,o)=>{let s=r[1]?.trim();return s?la(e,t,s,o):[]}),n)}function ia(e,t,n){let r=y(n,new Set(["import_declaration"])),o=[];for(let s of n.rootNode.descendantsOfType("import_declaration")){let i=s.children.some(p=>p.type==="asterisk"),c=s.namedChildren.find(p=>p.type==="scoped_identifier")??s.namedChildren.find(p=>p.type==="identifier");if(!c)continue;let l=c.text;if(i){o.push(ue("*",S(e,l,F)));continue}let u=l.split(".").pop()??l;o.push(h(u,u,S(e,l,F),r))}return o}function aa(e,t,n){let r=y(n,new Set(["import_header","import_list"])),o=[];for(let s of n.rootNode.descendantsOfType("import_header")){let i=s.namedChildren.find(f=>f.type==="identifier");if(!i)continue;let a=s.namedChildren.some(f=>f.type==="wildcard_import"),c=s.namedChildren.find(f=>f.type==="import_alias");if(a){o.push(ue("*",S(e,i.text,F)));continue}let l=i.text,u=l.split(".").pop()??l,m=c?.namedChild(0)?.text??u;o.push(h(u,m,S(e,l,F),r))}return o}function ca(e,t,n){let r=y(n,new Set(["import_declaration"])),o=[];for(let s of n.rootNode.descendantsOfType("import_declaration")){let i=s.namedChildren.find(p=>p.type==="namespace_selectors"||p.type==="namespace_wildcard"),a=s.namedChildren.filter(p=>p!==i&&(p.type==="identifier"||p.type==="stable_identifier")),c=a.map(p=>p.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){o.push(ue("*",S(e,c,F)));continue}if(i?.type==="namespace_selectors"){for(let p of i.namedChildren)if(p.type==="arrow_renamed_identifier"){let[m,f]=p.namedChildren;if(!m)continue;let g=m.text,j=f?.text??g;if(g==="_")continue;o.push(h(g,j,S(e,`${c}.${g}`,F),r))}else if(p.type==="identifier"){let m=p.text;o.push(h(m,m,S(e,`${c}.${m}`,F),r))}continue}let l=a[a.length-1]?.text??c,u=a.slice(0,-1).map(p=>p.text).join(".")||c;o.push(h(l,l,S(e,u&&a.length>1?`${u}.${l}`:c,F),r))}return o}function la(e,t,n,r){if(n.includes("{")&&n.includes("}")){let o=n.slice(0,n.indexOf("{")).replace(/\.$/,"").trim(),s=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return _(s).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),u=c?.trim();if(!u||u==="_")return[];let p=(l??u.split(".").pop()??u).trim(),m=u==="_"?o:`${o}.${u}`.replace(/\.\./g,".");return[M(e,t,r,m,u,p)]})}return[M(e,t,r,n,n.split(".").pop()??n,n.split(".").pop()??n)]}function qn(e,t,n){return D(e,t,r=>ua(e,t,r),()=>E(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,o)=>{let s=r[1]?.trim();return s?_(s).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),u=c?.trim()??a,p=u.split("\\").pop()??u,m=(l??p).trim();return[M(e,t,o,u,p,m,S(e,u.replace(/\\/g,"."),ce))]}):[]}),n)}function ua(e,t,n){let r=y(n,new Set(["namespace_use_declaration"])),o=[],s=(i,a,c)=>{o.push(h(a,c,S(e,i.replace(/\\/g,"."),ce),r))};for(let i of n.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:u,localName:p,qualified:m}=Un(l,c);u&&s(m,u,p)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:p}=Un(c,"");l&&s(p,l,u)}}return o}function Un(e,t){let n=e.namedChildren.find(l=>l.type==="qualified_name"),r=e.namedChildren.filter(l=>l.type==="name"),o="";n?o=n.text:r.length>=1&&(o=r[0].text);let s=n&&r.length>0?r[r.length-1]:null,i=o.split("\\").pop()??o,a=s?.text??i,c=t?`${t}\\${o}`:o;return{importedName:i,localName:a,qualified:c}}function Jn(e,t,n){return D(e,t,r=>pa(e,t,r),()=>fa(n).flatMap(r=>ga(e,t,r,n)),n)}function pa(e,t,n){let r=y(n,new Set(["import_statement","import_from_statement"])),o=[];for(let s of n.rootNode.descendantsOfType("import_statement"))for(let i of s.namedChildren){let a=Hn(i);if(!a)continue;let c=xe(e,t,a.qualifiedName);o.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:r.has(a.localName),usedMembers:[]})}for(let s of n.rootNode.descendantsOfType("import_from_statement")){let i=s.namedChild(0);if(!i)continue;let a=ma(i);if(a===null)continue;let c=xe(e,t,a);for(let l=1;l<s.namedChildCount;l+=1){let u=s.namedChild(l);if(u.type==="wildcard_import"){o.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let p=Hn(u);p&&o.push({importedName:p.qualifiedName,localName:p.localName,sourcePath:c,kind:"named",used:r.has(p.localName),usedMembers:[]})}}return o}function Hn(e){if(e.type==="aliased_import"){let t=e.namedChild(0),n=e.namedChild(1);return!t||!n?null:{qualifiedName:t.text,localName:n.text}}if(e.type==="dotted_name"){let t=e.text;return{qualifiedName:t,localName:t.split(".")[0]??t}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function ma(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let t=R(e,"import_prefix")?.text??"",n=R(e,"dotted_name")?.text??"";return`${t}${n}`}return null}function fa(e){let t=e.split(`
10
+ `),n=[],r=0;for(let o=0;o<t.length;o++){let s=t[o],i=s.trimStart(),a=r;if(r+=s.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=s,l=a+s.length,u=at(s);for(;o+1<t.length&&(u>0||c.trimEnd().endsWith("\\"));){o++;let m=t[o];c+=`
11
+ ${m}`,l+=1+m.length,u+=at(m),r+=m.length+1}let p=da(c);p&&n.push({...p,start:a,end:l})}return n}function da(e){let t=e.replace(/\\\s*\n/g," ").trim();if(t.startsWith("import "))return{kind:"import",module:null,clause:t.slice(7).trim()};let n=t.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!n)return null;let r=n[2].trim();return r.startsWith("(")&&r.endsWith(")")&&(r=r.slice(1,-1).trim()),{kind:"from",module:n[1],clause:r}}function ga(e,t,n,r){let o=G(r,n.start,n.end),s=n.clause.replace(/\n/g," ").trim();if(n.kind==="import")return _(s).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[u,p]=l.split(/\s+as\s+/),m=u.trim(),f=(p??m.split(".")[0]??m).trim(),g=xe(e,t,m),j=fe(o,f);return[{importedName:m,localName:f,sourcePath:g,kind:"namespace",used:C(o,f)||j.length>0,usedMembers:j}]});let i=n.module?xe(e,t,n.module):null,a=[];for(let c of _(s)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[u,p]=l.split(/\s+as\s+/),m=(p??u).trim();a.push({importedName:u.trim(),localName:m,sourcePath:i,kind:"named",used:C(o,m),usedMembers:[]})}return a}import{basename as ha}from"path";function Qn(e,t,n){return D(e,t,r=>ya(e,t,r),()=>Sa(e,t,n),n)}function Sa(e,t,n){return E(n,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(r,o)=>{let s=r[1],i=r[2];if(!s||!i)return[];let a=s==="require_relative"?He(e,t,i):null;if(a){let c=Xn(i);return[X(c,c,a,C(o,c))]}return[le(i,a)]})}function ya(e,t,n){let r=y(n,new Set([])),o=[],s=new Set(["require","require_relative","load"]);for(let i of n.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!s.has(a.text))continue;let l=i.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let p=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!p)continue;let m=a.text==="require_relative"?He(e,t,p):null;if(m){let f=Xn(p);o.push(h(f,f,m,r))}else o.push(le(p,m))}return o}function Xn(e){return $e(ha(e).replace(/\.[^.]+$/,""),/_/)}function Kn(e,t,n){return D(e,t,r=>xa(e,t,r),()=>E(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,o)=>{let s=r[1]?.trim();return s?ba(e,t,s,o):[]}),n)}function xa(e,t,n){let r=y(n,new Set(["use_declaration"])),o=[];for(let s of n.rootNode.descendantsOfType("use_declaration")){let i=s.namedChild(0);if(i)for(let a of Le(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=H(e,t,a.qualifiedName)??H(e,t,a.qualifiedName.split("::").slice(0,-1).join("::"));o.push(h(a.importedName,a.localName,c,r))}}return o}function Le(e,t){switch(e.type){case"identifier":case"super":case"crate":{let n=e.text;return[{qualifiedName:tt(t,n),importedName:n,localName:n}]}case"self":{let n=t.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:t||"self",importedName:n,localName:n}]}case"scoped_identifier":{let n=e.text,r=n.split("::").pop()??n;return[{qualifiedName:tt(t,n),importedName:r,localName:r}]}case"scoped_use_list":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let o=tt(t,n.text),s=[];for(let i of r.namedChildren)s.push(...Le(i,o));return s}case"use_list":{let n=[];for(let r of e.namedChildren)n.push(...Le(r,t));return n}case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let o=Le(n,t),s=r.text;return o.map(i=>({...i,localName:s}))}case"use_wildcard":{let n=e.namedChild(0),r=n?n.text:"";return[{qualifiedName:tt(t,`${r}::*`),importedName:"*",localName:"*"}]}default:return[]}}function tt(e,t){return e?t?`${e}::${t}`:e:t}function ba(e,t,n,r){let o=n.trim();if(o.includes("{")&&o.includes("}")){let u=o.slice(0,o.indexOf("{")).replace(/::$/,"").trim(),p=o.slice(o.indexOf("{")+1,o.lastIndexOf("}")).trim();return _(p).flatMap(m=>{let f=m.trim();if(!f)return[];if(f==="self"){let N=u.split("::").filter(Boolean).pop();return N?[M(e,t,r,u,N,N)]:[]}let[g,j]=f.split(/\s+as\s+/),d=g?.trim();if(!d)return[];let A=(j??d.split("::").pop()??d).trim(),ee=`${u}::${d}`.replace(/::::/g,"::");return[M(e,t,r,ee,d.split("::").pop()??d,A,H(e,t,u))]})}let[s,i]=o.split(/\s+as\s+/),a=s?.trim()??o,c=(i??a.split("::").pop()??a).trim(),l=H(e,t,a)??H(e,t,a.split("::").slice(0,-1).join("::"));return[M(e,t,r,a,a.split("::").pop()??a,c,l)]}function Gn(e,t,n){let r=O(e,t);if(r)return Na(e,t,r);let o=[];for(let s of n.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=s[1]?.trim();i&&o.push(...Ca(e,t,i))}return o}function Na(e,t,n){let r=[];for(let o of n.rootNode.descendantsOfType("use_declaration")){if(!Ia(o))continue;let s=o.namedChildren.find(i=>i.type!=="visibility_modifier");if(s)for(let i of Le(s,""))i.importedName&&r.push(Bt(e,t,i.qualifiedName))}return r}function Ia(e){for(let t of e.children)if(t.type==="visibility_modifier"&&t.text.startsWith("pub"))return!0;return!1}function Ca(e,t,n){let r=n.trim();if(r.includes("{")&&r.includes("}")){let o=r.slice(0,r.indexOf("{")).replace(/::$/,"").trim(),s=r.slice(r.indexOf("{")+1,r.lastIndexOf("}")).trim();return _(s).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${o}::${c?.trim()??a}`.replace(/::::/g,"::");return[Bt(e,t,l)]})}return[Bt(e,t,r)]}function Bt(e,t,n){return{specifier:n,sourcePath:H(e,t,n)??H(e,t,n.split("::").slice(0,-1).join("::"))}}function Y({language:e,extensions:t,imports:n,parseImports:r}){return{language:e,extensions:t,capabilities:{imports:n},parseImports:r}}function Zn(e,t){let n=t.toLowerCase();for(let r of e)for(let o of r.extensions)if(n.endsWith(o))return r;return null}var _a={language:"javascript",extensions:ie,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:jt,parseReExports:$t},Ta=Y({language:"python",extensions:Ve,imports:"ast-with-regex-fallback",parseImports:Jn}),Fa=Y({language:"jvm",extensions:F,imports:"ast-dispatch-with-regex-fallback",parseImports:zn}),Ra={language:"rust",extensions:We,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Kn,parseExports:Gn},ka=Y({language:"ruby",extensions:ze,imports:"ast-with-regex-fallback",parseImports:Qn}),La=Y({language:"c/cpp",extensions:Ue,imports:"ast-with-regex-fallback",parseImports:An}),va=Y({language:"dotnet",extensions:Z,imports:"ast-dispatch-with-regex-fallback",parseImports:Bn}),Pa={language:"dart",extensions:qe,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:jn,parseExports:$n},Ea=Y({language:"php",extensions:ce,imports:"ast-with-regex-fallback",parseImports:qn}),Da=Y({language:"clojure",extensions:ye,imports:"regex-only",parseImports:Mn}),Yn=[_a,Ta,Fa,Ra,ka,La,va,Pa,Ea,Da];function nt(e){return Zn(Yn,e)}function xp(e){return Yn.find(n=>n.language===e)?.capabilities??null}var Vt={clearGroups:["whole-project","source-file"]},wa=k("source-imports",Vt),Aa=k("source-exports",Vt),Oa=k("source-reexports",Vt),er=V({kind:"source-imports",invalidation:W("source-imports"),serialize:Ma,deserialize:ja}),tr=V({kind:"source-reexports",invalidation:W("source-reexports"),serialize:$a,deserialize:Ba});function nr(e,t){let n=I(t);return Oa.get(e,n,()=>{let r=nt(n);if(!r?.parseReExports)return[];let o=x(e,n);if(!o)return[];let s=$(e,n,o),i=kt(e),a=tr.read(e,n,s);if(a?.resolutionFingerprint===i)return a.reExports;let c=r.parseReExports(e,n,o);return tr.write(e,n,s,{resolutionFingerprint:i,reExports:c}),c})}function rr(e,t){let n=I(t);return wa.get(e,n,()=>{let r=nt(n);if(!r)return[];let o=x(e,n);if(!o)return[];let s=$(e,n,o),i=kt(e),a=er.read(e,n,s);if(a?.resolutionFingerprint===i)return a.imports;let c=r.parseImports(e,n,o);return er.write(e,n,s,{resolutionFingerprint:i,imports:c}),c})}function kp(e,t){let n=I(t);return Aa.get(e,n,()=>{let r=nt(n);if(!r?.parseExports)return[];let o=x(e,n);return o?r.parseExports(e,n,o):[]})}function Ma(e){return JSON.stringify(e)}function ja(e){try{let t=JSON.parse(e);return!K(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.imports)?null:{resolutionFingerprint:t.resolutionFingerprint,imports:t.imports}}catch{return null}}function $a(e){return JSON.stringify(e)}function Ba(e){try{let t=JSON.parse(e);return!K(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.reExports)?null:{resolutionFingerprint:t.resolutionFingerprint,reExports:t.reExports}}catch{return null}}function rt(e){return{forFile(t,n){return or(e,t,n)},forFiles(t,n){let r=new Map;for(let o of t)r.set(o,or(e,o,n));return r}}}function or(e,t,n){let r={file:t},o=n.facts||n.identifiers;if(n.text&&(r.text=x(e,t)),n.lines&&(r.lines=Ee(e,t)),n.ast&&(r.ast=O(e,t)),n.imports&&(r.imports=rr(e,t)),n.reexports&&(r.reexports=nr(e,t)),o){let s=dt(e,t),i=s.facts;n.facts&&(r.facts=i),s.unavailable&&(r.sourceFactsUnavailable=s.unavailable),n.identifiers&&i&&(r.identifiers=i.fileIdentifiers,r.identifierLineMap=i.identifierLineMap)}return r}function Ap(e,t){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
12
+ FROM global_symbols gs
13
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
14
+ JOIN documents d ON der.document_id = d.id
15
+ WHERE ${t.where}
16
+ ${e.pathExclusionsFor("d")}
17
+ ${ir(t.orderBy)}
18
+ ${ar(t.limit)}`,...t.params??[])}function Op(e,t){return e.all(`SELECT
19
+ gs.id,
20
+ gs.symbol,
21
+ c.document_id,
22
+ MIN(c.start_line) AS start_line,
23
+ 0 AS start_char,
24
+ MAX(c.end_line) AS end_line,
25
+ 0 AS end_char,
26
+ d.relative_path,
27
+ gs.display_name,
28
+ gs.documentation
29
+ FROM global_symbols gs
30
+ JOIN mentions m ON m.symbol_id = gs.id
31
+ JOIN chunks c ON m.chunk_id = c.id
32
+ JOIN documents d ON c.document_id = d.id
33
+ WHERE m.role = 1
34
+ AND ${t.where}
35
+ ${e.pathExclusionsFor("d")}
36
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
37
+ ${ir(t.orderBy)}
38
+ ${ar(t.limit)}`,...t.params??[])}function ir(e){return e?`ORDER BY ${e}`:""}function ar(e){return typeof e=="number"?`LIMIT ${e}`:""}function cr(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function lr(e){if(!e)return null;let t=sr(e);if(t)return t.replace(/\n/g," ");let n=e.indexOf("|");if(n===-1)return e.replace(/\n/g," ");let r=e.slice(n+1);return(sr(r)??r).replace(/\n/g," ")}function sr(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function Va(e,t={}){if(oe(e.symbol)!==null)return t.includeClassMemberFallbacks===!0;let o=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(o)}function Wt(e,t,n={}){let r=new Map;for(let s of t)e.length>0&&!Va(s,{includeClassMemberFallbacks:n.includeClassMemberFallbacks})||r.set(s.id,s);for(let s of e)r.set(s.id,s);let o=[...r.values()];return n.sort?o.sort((s,i)=>s.start_line-i.start_line||s.end_line-i.end_line||s.symbol.localeCompare(i.symbol)):o}function Gp(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let r=t.get(n.leaf)??[];r.push(n),t.set(n.leaf,r)}return t}var Wa=k("file-definitions",{clearGroups:["definition-catalog"]}),za=pe("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),Ua=k("file-function-like-definitions",{clearGroups:["definition-catalog"]}),ur=new WeakMap;function Ut(e,t,n={}){return n.includeClassMemberFallbacks?zt(e,t,void 0,{includeClassMemberFallbacks:!0}):Wa.get(e,t,()=>{let r=dr(e,t);if(r)return r;let o=zt(e,t),s=it(e),i=rt(e).forFile(t,{text:!0}).text;return s&&i&&fr.write(e,t,$(e,t,i),{projectFingerprint:s,definitions:o.map(a=>({...a}))}),o})}function qa(e,t){return Ua.get(e,t,()=>{let n=dr(e,t);return n?n.filter(r=>r.isFunctionLike):zt(e,t,r=>r.isFunctionLike)})}var fr=V({kind:"file-definitions",invalidation:W("file-definitions"),serialize:Ha,deserialize:Ja});function dr(e,t){let n=it(e);if(!n)return null;let r=rt(e).forFile(t,{text:!0}).text;if(!r)return null;let o=fr.read(e,t,$(e,t,r));return o?Qa(o,n,t):null}function Ha(e){return JSON.stringify(e)}function Ja(e){try{let t=JSON.parse(e);return!K(t)||typeof t.projectFingerprint!="string"||!Array.isArray(t.definitions)?null:{projectFingerprint:t.projectFingerprint,definitions:t.definitions}}catch{return null}}function Qa(e,t,n){if(e.projectFingerprint!==t)return null;let r=[];for(let o of e.definitions){let s=Xa(o,n);if(!s)return null;r.push(s)}return r}function Xa(e,t){return!K(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==t||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function zt(e,t,n,r={}){let o=Wt(Ka(e,t),Ga(e,t),{sort:!0,includeClassMemberFallbacks:r.includeClassMemberFallbacks}).map(gr);return n&&(o=o.filter(n)),Sr(e,t,o)}function Ka(e,t){return e.all(`SELECT
39
+ gs.id,
40
+ gs.symbol,
41
+ der.document_id,
42
+ der.start_line,
43
+ der.start_char,
44
+ der.end_line,
45
+ der.end_char,
46
+ d.relative_path,
47
+ gs.display_name,
48
+ gs.kind,
49
+ gs.documentation,
50
+ gs.enclosing_symbol
51
+ FROM global_symbols gs
52
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
53
+ JOIN documents d ON der.document_id = d.id
54
+ WHERE d.relative_path = ?
55
+ ${e.symbolNoiseFor("gs")}
56
+ ORDER BY der.start_line, der.end_line`,t)}function Ga(e,t){return e.all(`SELECT
57
+ gs.id,
58
+ gs.symbol,
59
+ c.document_id,
60
+ MIN(c.start_line) AS start_line,
61
+ 0 AS start_char,
62
+ MAX(c.end_line) AS end_line,
63
+ 0 AS end_char,
64
+ d.relative_path,
65
+ gs.display_name,
66
+ gs.kind,
67
+ gs.documentation,
68
+ gs.enclosing_symbol
69
+ FROM global_symbols gs
70
+ JOIN mentions m ON m.symbol_id = gs.id
71
+ JOIN chunks c ON m.chunk_id = c.id
72
+ JOIN documents d ON c.document_id = d.id
73
+ WHERE d.relative_path = ?
74
+ AND m.role = 1
75
+ ${e.symbolNoiseFor("gs")}
76
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
77
+ ORDER BY start_line, end_line`,t)}function gr(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:Gt(e.symbol),parentTypeName:oe(e.symbol),isFunctionLike:Zt(e.symbol),isTypeLike:Ae(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function Zp(e,t={}){return Za(e,t.scope)}function Za(e,t){return Ie(e,{scope:t,includeIgnored:!1}).flatMap(n=>Ut(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function Yp(e,t){return Ie(e,{scope:t,includeIgnored:!1}).flatMap(n=>qa(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function em(e,t){let n=za.get(e,()=>new WeakMap),r=n.get(t.symbolMatches);r||(r=new Map,n.set(t.symbolMatches,r));let o=JSON.stringify({scope:t.scope??null,sqlPrefilter:t.sqlPrefilter??null}),s=r.get(o);if(s)return[...s];let i=pr(Ya(e,t.scope,t.sqlPrefilter)),a=pr(ec(e,t.scope,t.sqlPrefilter)),c=new Set([...i.keys(),...a.keys()]),l=[];for(let u of[...c].sort()){if(e.isIgnored(u))continue;let p=Wt(i.get(u)??[],a.get(u)??[],{sort:!0}).filter(m=>t.symbolMatches(m.symbol));p.length!==0&&l.push(...Sr(e,u,p.map(gr)))}return r.set(o,l),[...l]}function Ya(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",o=n?`AND ${hr("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
78
+ gs.id,
79
+ gs.symbol,
80
+ der.document_id,
81
+ der.start_line,
82
+ der.start_char,
83
+ der.end_line,
84
+ der.end_char,
85
+ d.relative_path,
86
+ gs.display_name,
87
+ gs.kind,
88
+ gs.documentation,
89
+ gs.enclosing_symbol
90
+ FROM global_symbols gs
91
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
92
+ JOIN documents d ON der.document_id = d.id
93
+ WHERE 1 = 1
94
+ ${e.pathExclusionsFor("d")}
95
+ ${r}
96
+ ${o}
97
+ ${e.symbolNoiseFor("gs")}
98
+ ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function ec(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",o=n?`AND ${hr("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
99
+ gs.id,
100
+ gs.symbol,
101
+ c.document_id,
102
+ MIN(c.start_line) AS start_line,
103
+ 0 AS start_char,
104
+ MAX(c.end_line) AS end_line,
105
+ 0 AS end_char,
106
+ d.relative_path,
107
+ gs.display_name,
108
+ gs.kind,
109
+ gs.documentation,
110
+ gs.enclosing_symbol
111
+ FROM global_symbols gs
112
+ JOIN mentions m ON m.symbol_id = gs.id
113
+ JOIN chunks c ON m.chunk_id = c.id
114
+ JOIN documents d ON c.document_id = d.id
115
+ WHERE m.role = 1
116
+ AND NOT EXISTS (
117
+ SELECT 1
118
+ FROM defn_enclosing_ranges existing_der
119
+ WHERE existing_der.symbol_id = gs.id
120
+ )
121
+ ${e.pathExclusionsFor("d")}
122
+ ${r}
123
+ ${o}
124
+ ${e.symbolNoiseFor("gs")}
125
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
126
+ ORDER BY d.relative_path, start_line, end_line`,...s)}function tc(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function hr(e,t){return t==="callable"?tc(e):nc(e)}function nc(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function pr(e){let t=new Map;for(let n of e){let r=t.get(n.relative_path);r?r.push(n):t.set(n.relative_path,[n])}return t}function tm(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(o=>Ut(e,o)).filter(o=>!e.isIgnored(o.relativePath));return n.onlyDocumented&&(r=r.filter(o=>o.documentation!==null&&o.documentation!=="")),n.sort&&(r=r.sort((o,s)=>o.relativePath.localeCompare(s.relativePath)||o.startLine-s.startLine||o.endLine-s.endLine)),r.map(o=>({startLine:o.startLine,endLine:o.endLine,symbol:o.symbol,shortName:Kt(o.symbol),signature:cr(lr(o.documentation)),relativePath:o.relativePath,enclosingSymbol:o.enclosingSymbol}))}function rc(e){let t=new Map,n=e.map((r,o)=>({definition:r,index:o,span:r.endLine-r.startLine})).sort((r,o)=>r.span-o.span||r.index-o.index);for(let{definition:r}of n)for(let o=r.startLine;o<=r.endLine;o+=1)t.has(o)||t.set(o,r);return t}function nm(e,t){let n=ur.get(e);return n||(n=rc(e),ur.set(e,n)),n.get(t)??null}function rm(e,t){let n=Ut(e,t.relative_path).find(r=>r.symbolId===t.id);return n?{symbolId:n.symbolId,symbol:n.symbol,documentId:n.documentId,startLine:n.startLine,startChar:n.startChar,endLine:n.endLine,endChar:n.endChar,relativePath:n.relativePath}:{symbolId:t.id,symbol:t.symbol,documentId:t.document_id,startLine:t.start_line,startChar:t.start_char??0,endLine:t.end_line,endChar:t.end_char??0,relativePath:t.relative_path}}function Sr(e,t,n){let r=rt(e).forFile(t,{text:!0}).text,o=gt(e,t);return o?lc(n,o,r):r?oc(n,r):n}function oc(e,t){let n=t.split(/\r?\n/),r=sc(e,n),o=ic(e,r),s=ac(o,n);return cc(e,s)}function sc(e,t){let n=e.some(o=>ot(o.symbol))?hc(t):null,r=new Map;for(let o of e)r.set(o.symbolId,gc(t,n,o));return r}function ic(e,t){return e.filter(n=>ot(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,r)=>n.startLine-r.startLine||n.definition.startLine-r.definition.startLine||n.definition.symbol.localeCompare(r.definition.symbol))}function ac(e,t){let n=new Map;for(let r=0;r<e.length;r+=1){let o=e[r],s=e[r+1],i=s?Math.max(o.startLine,s.startLine-1):t.length-1;n.set(o.definition.symbolId,{startLine:o.startLine,endLine:Sc(t,o.definition,o.startLine,i)})}return n}function cc(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function lc(e,t,n=null){let r=new Map;for(let o of t){let s=r.get(o.name);s?s.push(o):r.set(o.name,[o])}return e.map(o=>{if(!dc(o)||!o.leaf)return mr(o,n);let s=r.get(o.leaf);if(!s||s.length===0)return mr(o,n);let i=n?uc(o,s,n):null;if(i)return{...o,startLine:i.startLine,endLine:i.endLine};let a=s[0],c=Math.abs(a.startLine-o.startLine);for(let l=1;l<s.length;l+=1){let u=s[l],p=Math.abs(u.startLine-o.startLine);p<c&&(a=u,c=p)}return{...o,startLine:a.startLine,endLine:a.endLine}})}function uc(e,t,n){let r=pc(e.symbol);if(!r)return null;let o=n.split(/\r?\n/),s=new RegExp(`\\b${te(r)}\\b`);for(let i of t){let a=mc(o,i.startLine);if(a&&s.test(a))return i}return null}function pc(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function mc(e,t){for(let n=t;n>=0;n-=1){let r=e[n]?.trim()??"";if(r){if(/^impl\b/.test(r))return fc(e,n,t);if(/^(?:struct|enum|trait|mod)\b/.test(r))return null}}return null}function fc(e,t,n){let r=[];for(let o=t;o<=n;o+=1){let s=e[o]??"";if(r.push(s),s.includes("{"))break}return r.join(" ")}function dc(e){return ot(e.symbol)?!0:Ae(e.symbol)==="term"&&oe(e.symbol)===null}function mr(e,t){if(!t||!e.leaf||Ae(e.symbol)!=="term"||oe(e.symbol)!==null)return e;let n=te(e.leaf),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),s=t.split(/\r?\n/).findIndex(i=>r.test(i));return s>=0?{...e,startLine:s,endLine:s}:e}function gc(e,t,n){if(!ot(n.symbol))return n.startLine;let r=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return r;let o=t.get(n.leaf);if(!o||o.length===0)return r;let s=null;for(let i of o){let a=Math.abs(i-n.startLine);(!s||a<s.distance)&&(s={line:i,distance:a})}return s?.line??r}function hc(e){let t=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,n=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,o=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,i=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let u of c.matchAll(t))u[1]&&i(u[1],a);for(let u of c.matchAll(n))u[1]&&i(u[1],a);let l=c.match(r);l?.[1]&&i(l[1],a);for(let u of c.matchAll(o))u[1]&&i(u[1],a)}return s}function Sc(e,t,n,r){let o=Math.max(n,Math.min(e.length-1,r)),s=Math.max(n,Math.min(o,t.endLine)),i=0,a=0,c=!1;for(let l=n;l<=o;l+=1){let u=yc(e[l]??"");for(let p of u)p==="{"?(i+=1,c=!0):p==="}"?i=Math.max(0,i-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&i===0||!c&&a===0&&l>=s)return l}return s}function yc(e){let t="",n=null,r=!1;for(let o=0;o<e.length;o+=1){let s=e[o],i=e[o+1];if(!n&&s==="/"&&i==="/"){t+=" ".repeat(e.length-o);break}if(n){if(r){r=!1,t+=" ";continue}if(s==="\\"){r=!0,t+=" ";continue}s===n&&(n=null),t+=" ";continue}if(s==='"'||s==="'"||s==="`"){n=s,t+=" ";continue}t+=s}return t}function ot(e){return e.includes("().")}function om(e){let t=Xt(e);if("kind"in t)return[];let n=[];for(let r=t.descriptors.length-2;r>=0;r-=1){let o=t.descriptors[r];o?.suffix==="type"&&o.name&&n.push(o.name)}return n}var xc=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function am(e){let t=e.toLowerCase();return xc.some(n=>t.endsWith(n))}import{createRequire as bc}from"module";var yr=bc(import.meta.url),ve,st;function Nc(){if(ve!==void 0)return ve;try{ve=yr("ts-morph")}catch{ve=null}return ve}function um(){if(st)return st;let e=Nc();if(!e)return"ts-morph:unavailable";let t="unknown";try{t=yr("ts-morph/package.json").version??"unknown"}catch{}return st=`ts-morph:${t}:typescript:${e.ts.version}`,st}function pm(e,t){return t.map(n=>({tsconfigPath:n,project:new e.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function mm(e,t,n){return{language:"typescript",availability:()=>({available:!1,reason:e,tsconfigPath:t,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function dm(e,t){let n=new Map(e.map(o=>[o.symbol,o])),r=new Map(e.map(o=>[o.symbolId,[]]));for(let o of t.values())for(let s of o){let i=n.get(s.targetSymbol);i&&r.get(i.symbolId).push(s.location)}for(let[o,s]of r)r.set(o,Ic(s));return r}function gm(e,t,n){let r=br(e,t),o=br(e,n),s=[...r].filter(p=>!o.has(p)).sort(),i=[...o].filter(p=>!r.has(p)).sort(),a=xr(e,t),c=xr(e,n),l=[...a].filter(p=>!c.has(p)).sort(),u=[...c].filter(p=>!a.has(p)).sort();return{passed:s.length===0&&i.length===0,expectedCount:r.size,actualCount:o.size,missing:s,extra:i,callerFiles:{passed:l.length===0&&u.length===0,expectedCount:a.size,actualCount:c.size,missing:l,extra:u}}}function xr(e,t){let n=new Set;for(let r of e)for(let o of t.get(r.symbolId)??[])o.file!==r.relativePath&&n.add(`${r.symbol}\0${o.file}`);return n}function hm(e,t,n){let r=new Set(n),o=new Map(n.map(s=>[s,[]]));for(let s of e)for(let i of t.get(s.symbolId)??[])r.has(i.file)&&o.get(i.file).push({targetSymbol:s.symbol,location:i});for(let[s,i]of o)o.set(s,Cc(i));return o}function br(e,t){let n=new Set;for(let r of e)for(let o of t.get(r.symbolId)??[])n.add(`${r.symbol}\0${o.file}\0${o.line}\0${o.column}`);return n}function Ic(e){let t=new Map;for(let n of e)t.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...t.values()].sort(Nr)}function Cc(e){let t=new Map;for(let n of e){let{location:r}=n;t.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...t.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||Nr(n.location,r.location))}function Nr(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.column-t.column}export{mn as a,Fo as b,ye as c,B as d,z as e,Qr as f,Xr as g,gt as h,Zr as i,Yr as j,ql as k,di as l,tt as m,xp as n,nr as o,rr as p,kp as q,xc as r,am as s,Nc as t,um as u,pm as v,mm as w,dm as x,gm as y,hm as z,rt as A,Ap as B,Op as C,cr as D,lr as E,Wt as F,Gp as G,Ut as H,Zp as I,Za as J,Yp as K,em as L,tm as M,rc as N,nm as O,rm as P,om as Q};
127
+ //# sourceMappingURL=chunk-M7LAIM77.js.map
@@ -1,7 +1,7 @@
1
- import{b as k}from"./chunk-OZYRSMSH.js";import{c as D}from"./chunk-7FND7D7N.js";import{m as S}from"./chunk-CVYSU6BX.js";import{f as v,h as L}from"./chunk-C7QOQX32.js";import{d as h,t as y}from"./chunk-FETNQCFO.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
1
+ import{b as k}from"./chunk-MT5W4DUG.js";import{c as D}from"./chunk-NK76RSB6.js";import{m as S}from"./chunk-BH5CE4LN.js";import{f as v,h as L}from"./chunk-JN5LIBT3.js";import{d as h,t as y}from"./chunk-AM5SUGHF.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
4
  JOIN documents d ON d.id = der.document_id
5
5
  WHERE gs.symbol = ?
6
6
  LIMIT 1`,n);return s?y(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=y(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
7
- //# sourceMappingURL=chunk-BVAJLC5A.js.map
7
+ //# sourceMappingURL=chunk-MRGTCMDK.js.map