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
@@ -1,215 +0,0 @@
1
- import{d as _n,p as ie,q as P}from"./chunk-QW7EP6WI.js";import{a as b,b as Ee,c as re,d as ve,e as je,i as Ge}from"./chunk-3IER7Q6H.js";import{a as In,b as Fn}from"./chunk-FM5BPL4V.js";import{a as Ln,b as de,c as kn,d as Rn,e as Ye,g as Pn}from"./chunk-DRENNWRG.js";import{a as Ft,f as Lt,i as kt}from"./chunk-R2NOK63J.js";import{A as v,ba as Cn,ca as Tn,h as Qe}from"./chunk-WE5RZHZ7.js";import{createHash as Ti}from"crypto";import{existsSync as Ii,mkdirSync as Fi}from"fs";import{dirname as Dn,join as Li}from"path";import Rt from"better-sqlite3";var ki="evidence.db";var Ri=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],Pt=new Set(Ri),Pi=25e4,Di=512*1024*1024,wi=6e4,Ce=new WeakMap;Fn({name:"evidence-connections",close:wn});var Ai=b("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),ji=b("evidence-project-fingerprint",{clearGroups:["whole-project"]}),F="evidence-v1",_e="version NOT LIKE 'evidence-%'";function Ze(e){return Ti("sha256").update(e).digest("hex")}function U(e,t,n){return Ai.get(e,t,()=>Ze(n))}function Oe(e){return ji.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=_n(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,r=[...n.indexedLanguages??[]].sort();return Ze(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:r,status:n.status}))}catch(t){return se("project fingerprint unavailable",t),null}})}function se(e,t){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function q(e){if(Ce.has(e))return Ce.get(e)??null;let t=null;try{let n=new Rt(Li(Dn(e.config.dbPath),ki));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
2
- CREATE TABLE IF NOT EXISTS file_evidence (
3
- kind TEXT NOT NULL,
4
- relative_path TEXT NOT NULL,
5
- content_hash TEXT NOT NULL,
6
- version TEXT NOT NULL,
7
- payload TEXT NOT NULL,
8
- PRIMARY KEY (kind, relative_path)
9
- );
10
- CREATE TABLE IF NOT EXISTS project_evidence (
11
- kind TEXT NOT NULL,
12
- cache_key TEXT NOT NULL,
13
- project_fingerprint TEXT NOT NULL,
14
- version TEXT NOT NULL,
15
- payload TEXT NOT NULL,
16
- PRIMARY KEY (kind, cache_key)
17
- );
18
- CREATE TABLE IF NOT EXISTS semantic_callees (
19
- relative_path TEXT NOT NULL,
20
- symbol TEXT NOT NULL,
21
- content_hash TEXT NOT NULL,
22
- deps_digest TEXT NOT NULL,
23
- version TEXT NOT NULL,
24
- payload TEXT NOT NULL,
25
- PRIMARY KEY (relative_path, symbol)
26
- );
27
- CREATE TABLE IF NOT EXISTS semantic_references (
28
- relative_path TEXT NOT NULL,
29
- symbol TEXT NOT NULL,
30
- project_fingerprint TEXT NOT NULL,
31
- version TEXT NOT NULL,
32
- payload TEXT NOT NULL,
33
- PRIMARY KEY (relative_path, symbol)
34
- );
35
- `),t={evidence:n,shared:Oi(e.config.sharedEvidenceDbPath),readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:n.prepare(`SELECT payload FROM file_evidence
36
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${_e}
37
- ORDER BY version DESC
38
- LIMIT 1`),writeFileEvidence:n.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:n.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:n.prepare(`SELECT payload FROM project_evidence
39
- WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${_e}
40
- ORDER BY version DESC
41
- LIMIT 1`),writeProjectEvidence:n.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:n.prepare(`SELECT payload FROM semantic_callees
42
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
43
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${_e}
44
- ORDER BY version DESC
45
- LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
46
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
47
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${_e}
48
- ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
49
- (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:n.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:n.prepare(`SELECT payload FROM semantic_references
50
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
51
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${_e}
52
- ORDER BY version DESC
53
- LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
54
- WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
55
- WHERE relative_path = ? AND project_fingerprint = ? AND ${_e}
56
- ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
57
- (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(n){se("disabled (open failed)",n)}return Ce.set(e,t),t}function K(e,t,n){se(`disabled (${t})`,n);try{wn(e)}catch(r){se("close failed while disabling",r)}Ce.set(e,null)}function wn(e){let t=Ce.get(e);if(Ce.delete(e),!t)return;let n,r;try{t.shared?.evidence.close()}catch(i){n=i}try{t.evidence.close()}catch(i){r=i}if(n!==void 0&&r!==void 0)throw new AggregateError([n,r],"Shared and project evidence connections failed to close.");if(n!==void 0)throw n;if(r!==void 0)throw r}function Oi(e){if(!e)return null;try{Fi(Dn(e),{recursive:!0});let t=new Rt(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
58
- CREATE TABLE IF NOT EXISTS file_evidence (
59
- kind TEXT NOT NULL,
60
- relative_path TEXT NOT NULL,
61
- content_hash TEXT NOT NULL,
62
- version TEXT NOT NULL,
63
- payload TEXT NOT NULL,
64
- last_accessed_at INTEGER NOT NULL,
65
- PRIMARY KEY (kind, relative_path, content_hash, version)
66
- );
67
- CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
68
- ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
69
- `),{evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
70
- VALUES (?, ?, ?, ?, ?, ?)
71
- ON CONFLICT(kind, relative_path, content_hash, version)
72
- DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:t.prepare(`UPDATE file_evidence
73
- SET last_accessed_at = ?
74
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
75
- AND last_accessed_at < ?`)}}catch(t){return se("shared cache disabled (open failed)",t),null}}function Dt(e,t,n){se(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function yu(e,t={}){if(!Ii(e))return null;let n;try{n=new Rt(e),n.pragma("busy_timeout = 50"),n.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
76
- ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),n.pragma("wal_checkpoint(TRUNCATE)");let r=n.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,i=t.maxRows??Pi,s=t.budgetBytes??Di,o=Number(n.pragma("page_size",{simple:!0})),a=Number(n.pragma("page_count",{simple:!0})),c=Number(n.pragma("freelist_count",{simple:!0})),l=Math.max(0,a-c)*o,u=r>0&&l>s?Math.min(r,Math.ceil((l-s)/Math.max(1,l/r))):0,p=Math.max(r-i,u);return p>0&&(n.prepare(`DELETE FROM file_evidence WHERE rowid IN (
77
- SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
78
- )`).run(p),n.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:p,remainingRows:r-p}}catch(r){return se("shared cache maintenance skipped",r),null}finally{try{n?.close()}catch{}}}function An(e,t,n,r){let i=q(e);if(!i)return null;try{let s=i.readFileEvidence.get(t,n,r,F)??i.readLegacyFileEvidence.get(t,n,r);if(s?.payload!==void 0)return s.payload;if(!Pt.has(t)||!i.shared)return null;try{let o=i.shared.readFileEvidence.get(t,n,r,F);return o?.payload!==void 0&&Mi(i.shared,t,n,r),o?.payload??null}catch(o){return Dt(i,"file_evidence read",o),null}}catch(s){return K(e,"file_evidence read",s),null}}function Mi(e,t,n,r){let i=Date.now();try{e.touchFileEvidence.run(i,t,n,r,F,i-wi)}catch(s){se("shared file_evidence recency touch skipped",s)}}function jn(e,t,n,r,i){let s=q(e);if(s)try{if(s.writeFileEvidence.run(t,n,r,F,i),Pt.has(t)&&s.shared)try{s.shared.writeFileEvidence.run(t,n,r,F,i,Date.now())}catch(o){Dt(s,"file_evidence write",o)}}catch(o){K(e,"file_evidence write",o)}}function On(e,t){if(t.length===0)return;let n=q(e);if(n)try{n.evidence.transaction(()=>{for(let i of t)n.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,F,i.payload)})();let r=t.filter(i=>Pt.has(i.kind));if(r.length>0&&n.shared)try{n.shared.evidence.transaction(()=>{for(let i of r)n.shared.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,F,i.payload,Date.now())})()}catch(i){Dt(n,"file_evidence batch write",i)}}catch(r){K(e,"file_evidence batch write",r)}}function Mn(e,t,n,r){let i=q(e);if(!i)return null;try{return(i.readProjectEvidence.get(t,n,r,F)??i.readLegacyProjectEvidence.get(t,n,r))?.payload??null}catch(s){return K(e,"project_evidence read",s),null}}function $n(e,t,n,r,i){let s=q(e);if(s)try{s.writeProjectEvidence.run(t,n,r,F,i)}catch(o){K(e,"project_evidence write",o)}}function Su(e,t,n,r){let i=q(e);if(!i)return new Map;try{let s=i.readCalleesForFile.all(t,n,r,F),o=i.readLegacyCalleesForFile.all(t,n,r);return Bn([...o,...s])}catch(s){return K(e,"semantic_callees bulk read",s),new Map}}function xu(e,t,n){let r=q(e);if(!r)return new Map;try{let i=r.readReferencesForFile.all(t,n,F),s=r.readLegacyReferencesForFile.all(t,n);return Bn([...s,...i])}catch(i){return K(e,"semantic_references bulk read",i),new Map}}function Bn(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function bu(e,t){if(t.length===0)return;let n=q(e);if(n)try{n.evidence.transaction(()=>{let r=new Set;for(let i of t){let s=`${i.relativePath}\0${i.contentHash}`;r.has(s)||(r.add(s),n.dropStaleCallees.run(i.relativePath,i.contentHash)),n.writeCallees.run(i.relativePath,i.symbol,i.contentHash,i.depsDigest,F,i.payload)}})()}catch(r){K(e,"semantic_callees write",r)}}function Nu(e,t){if(t.length===0)return;let n=q(e);if(n)try{n.evidence.transaction(()=>{let r=new Set;for(let i of t){let s=`${i.relativePath}\0${i.projectFingerprint}`;r.has(s)||(r.add(s),n.dropStaleReferences.run(i.relativePath,i.projectFingerprint)),n.writeReferences.run(i.relativePath,i.symbol,i.projectFingerprint,F,i.payload)}})()}catch(r){K(e,"semantic_references write",r)}}var $i=[C("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),C("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),C("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),C("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),C("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),C("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),C("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),C("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),C("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),C("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),C("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),C("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),C("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),C("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),et("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),et("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),et("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),et("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function X(e){let t=new Map;return{kind:e.kind,read(n,r,i){let s=!1,o=0,a;if(Ft()){let c=Oe(n);if(c){let l=`${c}\0${r}\0${i}`;a=t.get(l),a||(a=Lt(["evidence-product-file-read-v1",e.kind,c,r,i]),t.set(l,a))}}return kt("evidence-product.file.read",()=>{let c=An(n,e.kind,r,i);if(c===null)return null;o=c.length;try{let l=e.deserialize(c);return s=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:s,payloadBytes:o}))},write(n,r,i,s){jn(n,e.kind,r,i,e.serialize(s))},writeBatch(n,r){On(n,r.map(i=>({kind:e.kind,relativePath:i.relativePath,contentHash:i.contentHash,payload:e.serialize(i.value)})))}}}function Iu(e){let t=new Map;return{kind:e.kind,read(n,r,i){let s=!1,o=0,a;if(Ft()){let c=`${i}\0${r}`;a=t.get(c),a||(a=Lt(["evidence-product-project-read-v1",e.kind,i,r]),t.set(c,a))}return kt("evidence-product.project.read",()=>{let c=Mn(n,e.kind,r,i);if(c===null)return null;o=c.length;try{let l=e.deserialize(c);return s=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:s,payloadBytes:o}))},write(n,r,i,s){$n(n,e.kind,r,i,e.serialize(s))}}}function J(e){let t=$i.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function C(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function et(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}var Bi=b("source-text",{clearGroups:["whole-project","source-file"]}),Vi=b("source-lines",{clearGroups:["whole-project","source-file"]});function f(e,t){let n=t.replace(/\\/g,"/");return Bi.get(e,n,()=>{try{return Cn(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(r){if(Tn(r))return"";throw r}})}function Me(e,t){let n=t.replace(/\\/g,"/");return Vi.get(e,n,()=>{let r=f(e,n);return r?r.split(`
79
- `):[]})}var Ui=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Wi(e){let t=Ui.exec(e);return t?t[1]??"":null}function Ru(e,t,n){return Vn(e,t,n).length>0}function Pu(e,t,n,r){let i=r.toLowerCase();return Vn(e,t,n).some(s=>s.toLowerCase()===i)}function Vn(e,t,n){if(n<=0)return[];let r=Me(e,t);if(r.length===0)return[];let i=[];for(let s=n-1;s>=0&&s>=n-5;s-=1){let o=(r[s]??"").trim();if(o==="")continue;let a=Wi(o);if(a!==null){i.push(a);continue}if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return i}return i}import{extname as Un}from"path";var zi={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function W(e){return zi[Un(e).toLowerCase()]??null}function oe(e){return Un(e).toLowerCase()===".vue"}import{createRequire as Hi}from"module";var _=Hi(import.meta.url),$e=null,wt=!1;function Wn(){if(wt)return null;if($e)return $e;try{return $e=_("tree-sitter"),$e}catch{return wt=!0,null}}function Ou(e){if(e==="clojure")return"reader";let t=Wn();if(!t)return"unavailable";let n=zn(e);if(!n)return"unavailable";try{return new t().setLanguage(n),"ast"}catch{return Te.add(e),"unavailable"}}var At=new Map,Te=new Set;function zn(e){if(Te.has(e))return null;let t=At.get(e);if(t)return t;let n;try{switch(e){case"rust":n=_("tree-sitter-rust");break;case"typescript":n=_("tree-sitter-typescript").typescript;break;case"tsx":n=_("tree-sitter-typescript").tsx;break;case"javascript":n=_("tree-sitter-javascript");break;case"python":n=_("tree-sitter-python");break;case"java":n=_("tree-sitter-java");break;case"kotlin":n=_("tree-sitter-kotlin");break;case"scala":n=_("tree-sitter-scala");break;case"ruby":n=_("tree-sitter-ruby");break;case"c":n=_("tree-sitter-c");break;case"cpp":n=_("tree-sitter-cpp");break;case"csharp":n=_("tree-sitter-c-sharp");break;case"php":n=_("tree-sitter-php").php;break;case"vb":{let r=_("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Te.add(e),null}}catch{return Te.add(e),null}return At.set(e,n),n}var jt=new Map;function Mu(){$e=null,wt=!1,At.clear(),Te.clear(),jt.clear(),Xi.clear()}function qi(e){let t=jt.get(e);if(t)return t;let n=zn(e);if(!n)return null;let r=Wn();if(!r)return null;let i=new r;try{i.setLanguage(n)}catch{return Te.add(e),null}return jt.set(e,i),i}function Ki(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function me(e,t){let n=qi(e);if(!n)return null;try{return Ki(n,t)}catch{return null}}var Xi=new Map;import{posix as Ot}from"path";import{parse as Ji}from"@vue/compiler-sfc";var Qi=re("vue-sfc-units");function Ie(e,t){let n=Kn(t),r=f(e,n);return Qi.get(e,n,r,()=>Mt(e,n,r))}function Kn(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Gi(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function fe(e){return!e||e.body.length===0?0:e.body.split(`
80
- `).length}function Mt(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let i;try{i=Ji(n,{filename:t})}catch(o){return r.errors.push(qn(o)),r}r.errors.push(...i.errors.map(qn));let{descriptor:s}=i;return s.template&&(r.template=tt(e,t,"template",s.template)),s.script&&r.scripts.push(Hn(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(Hn(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(o=>tt(e,t,"style",o)),r.customBlocks=s.customBlocks.map(o=>tt(e,t,"custom",o)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(o=>o?.errors??[])),r}function Hn(e,t,n,r){let i=tt(e,t,"script",n);return{...i,kind:"script",setup:r,astLanguage:Gi(i.lang)}}function tt(e,t,n,r){let i=Zi(r.attrs),s=typeof i.lang=="string"?i.lang:null,o=typeof i.src=="string"?i.src:typeof r.src=="string"?r.src:void 0;if(o){let c=Yi(t,o);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:o,attrs:i,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${o}`]};let l=f(e,c),u=l?Math.max(0,l.split(`
81
- `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:o,attrs:i,lang:s,body:l,startLine:0,endLine:u,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:i,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function Yi(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Kn(Ot.normalize(Ot.join(Ot.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Zi(e){return{...e}}function qn(e){return e instanceof Error?e.message:String(e)}function Be(e,t,n){let i=Mt(e,t,n).scripts.filter(o=>o.astLanguage&&o.body.length>0),s=i[0]?.astLanguage;return s?{body:i.map(o=>`${`
82
- `.repeat(o.startLine)}${o.body}`).join(`
83
- `),startLine:0,language:s}:null}var Xn=ve("ast-trees",{clearGroups:["whole-project","source-file"]});function $(e,t){if(oe(t))return es(e,t);let n=W(t);if(!n)return null;let r=f(e,t);return r?Xn.get(e,t,r,()=>me(n,r)):null}function Ve(e,t,n){if(oe(t)){let s=Be(e,t,n);if(!s)return null;let o=me(s.language,`
84
- `.repeat(s.startLine)+s.body);return o?{tree:o,language:s.language}:null}let r=W(t);if(!r)return null;let i=me(r,n);return i?{tree:i,language:r}:null}function es(e,t){let n=f(e,t);return n?Xn.get(e,t,n,()=>{let r=Be(e,t,n);if(!r)return null;let i=`
85
- `.repeat(r.startLine)+r.body;return me(r.language,i)}):null}function Fe(e,t){let n=ns(e,t);if(!n)return null;let r=ge(n);if(!r)return null;let i=rs(n);return{calleeLeaf:r,calleeQualifier:i?ts(n):void 0,calleeText:n.text,memberAccess:i,line:e.startPosition.row}}function ts(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function ns(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function rs(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function ge(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?ge(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?ge(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?ge(t):null}case"super":case"self":case"this":return null;default:return null}}function Ue(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var is=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),Jn=new Set(["arrow_function","function_expression","generator_function"]);function nt(e,t){let n=os(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:Zn(n.functionNode),params:Qn(n.functionNode),paramsEndLine:Gn(n.functionNode),isLiteralPassthrough:er(n.functionNode,t)};if(!ss(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:Zn(e),params:Qn(e),paramsEndLine:Gn(e),isLiteralPassthrough:er(e,t)}:null}function tr(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function Qn(e){let t=tr(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(Ue(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!i&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let o=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:o?.text??"",simple:!1})}return n}function Gn(e){let t=tr(e);return t?t.endPosition.row:e.startPosition.row}function ss(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?is.has(e):!1}function os(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let i=Yn(r);return i?{name:n.text,definitionNode:e,functionNode:i}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let i=Yn(r);return i?{name:n.text,definitionNode:e,functionNode:i}:null}return null}function Yn(e){if(Jn.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(i=>i.type==="arguments"))?.namedChildren??[]).filter(i=>Jn.has(i.type));return r.length===1?r[0]:null}function Zn(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)Ue(r)||(n+=1);return n}function er(e,t){let n=e.namedChildren.find(p=>p.type==="block"||p.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(p=>!Ue(p));if(r.length!==1)return!1;let i=r[0],s=null;if(i.type==="return_statement"||i.type==="expression_statement"?s=i.namedChild(0)??null:t==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(s=i),!s)return!1;let o=t==="python"?"call":"call_expression";if(s.type!==o)return!1;let a=s.namedChildren.find(p=>p.type==="arguments"||p.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(p=>!Ue(p)),l=e.namedChildren.find(p=>p.type==="parameters"||p.type==="formal_parameters");if(!l)return!1;let u=[];for(let p of l.namedChildren){if(p.type==="identifier"){u.push(p.text);continue}let d=p.namedChildren.find(m=>m.type==="identifier");d&&u.push(d.text)}if(c.length!==u.length)return!1;for(let p=0;p<u.length;p+=1){let d=c[p];if(d.type!=="identifier"||d.text!==u[p])return!1}return!0}var as=new Set(["identifier","type_identifier","field_identifier"]),cs=new Set(["identifier"]),ls=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),us=new Set(["rust","python"]),ps=/\{([^{}]*)\}/g,ds=/\b([A-Za-z_][\w]*)\b/g;function nr(e,t){return ms(t).has(e.type)}function rr(e,t){return us.has(t)&&e.type==="string_content"}function $t(e){let t=0;for(let r of e.values()){let i=r[r.length-1];i!==void 0&&i>t&&(t=i)}let n=new Array(t+1);for(let r=0;r<=t;r+=1)n[r]=new Set;for(let[r,i]of e)for(let s of i)n[s].add(r);return n}function ms(e){return e==="rust"?as:e==="python"?cs:ls}function ir(e,t){let n=e.startPosition.row;for(let r of e.text.matchAll(ps)){let i=r[1]??"";for(let s of i.matchAll(ds))s[1]&&t(s[1],n)}}var fs=[/\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],gs=/^#!?\[\s*serde\s*\(/,hs=/^#!?\[\s*schemars\s*\(/,ys=/^#!?\[\s*validate\s*\(/,Ss=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function sr(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 i=ge(r);if(!i||!Ss.has(i))return;let s=e.namedChildren.find(c=>c.type==="arguments");if(!s)return;let o=s.namedChild(0);if(!o||o.type!=="string")return;let a=o.namedChildren.find(c=>c.type==="string_fragment");a&&n.add(a.text)}function or(e,t){let n=gs.test(e),r=hs.test(e),i=ys.test(e);if(!(!n&&!r&&!i))for(let s of fs){s.lastIndex=0;let o;for(;(o=s.exec(e))!==null;){let a=o[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 ar(e,t){let n=new Map,r=(o,a)=>{if(o===a)return;let c=n.get(o);c||(c=new Set,n.set(o,c)),c.add(a)},i=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),s=(o,a)=>{let c=l=>{i.has(l.type)&&l.text!==a&&r(l.text,a);for(let u of l.children)c(u)};for(let l of o.children)c(l)};if(t==="rust")for(let o of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=o.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=o.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&s(c,a),o.type==="type_item"&&s(o,a)}else if(t==="python")for(let o of e.rootNode.descendantsOfType("class_definition")){let a=o.namedChildren.find(u=>u.type==="identifier")?.text;if(!a)continue;let c=o.childForFieldName("superclasses");c&&s(c,a);let l=o.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 o of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=o.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&s(o,a)}return n}var xs=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Bt=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 cr(e){let t=[],n=[],r=[],i=new Map,s=[],o=0,a=0,c=(l,u)=>{let p=i.get(l);if(!p){i.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)};for(;a<e.length;){let l=e[a];if(l===`
86
- `){o+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=it(e,a);continue}if(l==='"'){let h=ze(e,a,o);o=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){s.push({kind:l,startLine:o,endLine:o,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=s.pop();h&&(h.endLine=o,bs(h,{callables:t,callSites:n,clojureMembers:r,recordIdentifier:c}),s[s.length-1]?.children.push(h)),a+=1;continue}if(Vt(l)){a+=1;continue}let u=o,p=a;for(;a<e.length&&!Ut(e[a]);)a+=1;let d=e.slice(p,a);if(!d)continue;let m={text:d,line:u};Ns(s[s.length-1],m),c(D(d),u)}return{language:"clojure",callables:t,callSites:n,clojureMembers:r,typeContainerMap:new Map,identifierLineMap:i,identifiersByLine:Ts(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function bs(e,t){if(e.kind!=="("||e.headTokens.length===0)return;let n=e.headTokens[0],r=D(n.text),i=xs.get(n.text);if(i){let o=e.headTokens[1];if(o){let a=D(o.text);t.recordIdentifier(a,o.line),t.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:o.line,isLiteralPassthrough:!1,clojureKind:i})}}if(Es(e,t),!r||Bt.has(n.text)||Bt.has(r)||r.startsWith(":"))return;let s=Cs(n.text);t.callSites.push({calleeLeaf:s.leaf,calleeQualifier:s.qualifier,calleeText:s.text,memberAccess:!1,line:n.line})}function Ns(e,t){e&&(e.headTokens.length<2&&e.headTokens.push(t),e.tokens.length<200&&e.tokens.push(t))}function Es(e,t){let n=D(e.tokens[0]?.text??"");if(n==="defprotocol"){let r=D(e.tokens[1]?.text??"");if(!r)return;for(let i of rt(e))We(t,r,"protocol",i,"protocol-method");return}if(n==="defrecord"||n==="deftype"){let r=D(e.tokens[1]?.text??"");if(!r)return;let i=n==="defrecord"?"record":"type",s=n==="defrecord"?"record-method":"type-method";for(let o of rt(e))We(t,r,i,o,s);return}if(n==="extend-type"){let r=D(e.tokens[1]?.text??"");if(!r)return;for(let i of rt(e))We(t,r,"extension",i,"extension-method");return}if(n==="extend-protocol"){let r=D(e.tokens[1]?.text??"");for(let i of rt(e)){r&&We(t,r,"extension",i,"extension-method");let s=_s(e,i.startLine);s&&s!==r&&We(t,s,"extension",i,"extension-method")}}}function rt(e){return e.children.filter(vs)}function vs(e){if(e.kind!=="(")return!1;let t=D(e.tokens[0]?.text??"");return!!(t&&!Bt.has(t)&&!t.startsWith(":"))}function We(e,t,n,r,i){let s=r.tokens[0],o=D(s?.text??"");!s||!o||(e.recordIdentifier(o,s.line),e.clojureMembers.push({ownerName:t,ownerKind:n,memberName:o,memberKind:i,startLine:r.startLine,endLine:r.endLine}))}function _s(e,t){let n=null;for(let r=2;r<e.tokens.length;r+=1){let i=e.tokens[r];if(i.line>t)break;let s=D(i.text);s&&!s.startsWith(":")&&(n=s)}return n}function D(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Cs(e){let t=e.replace(/^#?['`~@]+/,""),n=t.lastIndexOf("/"),r=D(t);if(n<=0)return{leaf:r,text:t};let i=t.slice(0,n);return{leaf:r,qualifier:i,text:t}}function it(e,t){let n=t;for(;n<e.length&&e[n]!==`
87
- `;)n+=1;return n}function ze(e,t,n){let r=t+1,i=n;for(;r<e.length;){let s=e[r];if(s==="\\"){r+=2;continue}if(s===`
88
- `&&(i+=1),r+=1,s==='"')break}return{index:r,line:i}}function Vt(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ut(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ts(e){let t=[];for(let[n,r]of e)for(let i of r)t[i]??=new Set,t[i].add(n);return t}var lr=6,Is=ve("source-facts",{clearGroups:["whole-project","source-file"]}),Wt=X({kind:"source-facts",invalidation:J("source-facts"),serialize:ks,deserialize:Rs});function Q(e,t){return zt(e,t).facts}function zt(e,t){let n=f(e,t);if(!n)return{facts:null};let r=Fs(e,t,n);return r?Is.get(e,t,n,()=>Ls(e,t,r,n)):{facts:null}}function Fs(e,t,n){return oe(t)?Be(e,t,n)?.language??null:W(t)}function Ls(e,t,n,r){let i=U(e,t,r),s=Wt.read(e,t,i);if(s&&s.language===n)return{facts:s};if(n==="clojure"){let c=cr(r);return Wt.write(e,t,i,c),{facts:c}}let o=$(e,t);if(!o)return{facts:null,unavailable:{language:n,reason:"parser-unavailable"}};let a=As(o,n);return Wt.write(e,t,i,a),{facts:a}}function ks(e){let t={version:lr,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 Rs(e){try{let t=JSON.parse(e);if(t.version!==lr||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,i])=>[r,new Set(i)])),identifierLineMap:n,identifiersByLine:$t(n),fileIdentifiers:new Set(n.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function Ps(e,t,n,r){let i=Q(e,t);return i?ws(i,n,r)?.isLiteralPassthrough??!0:!0}function Ds(e,t){return t.relativePath.includes(".clj-kondo/hooks/")?!0:Q(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine)?.clojureKind==="macro"}function ws(e,t,n){return e.callables.find(r=>r.startLine===t&&r.endLine===n)??null}function As(e,t){let n=[],r=[],i=new Set,s=new Set,o=new Map,a=(l,u)=>{let p=o.get(l);if(!p){o.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)},c=l=>{let u=nt(l,t);u&&n.push(u);let p=Fe(l,t);p&&r.push(p),sr(l,t,s),t==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&or(l.text,i),nr(l,t)&&a(l.text,l.startPosition.row),rr(l,t)&&ir(l,a);for(let d of l.children)c(d)};return c(e.rootNode),{language:t,callables:n,callSites:r,clojureMembers:[],typeContainerMap:ar(e,t),identifierLineMap:o,identifiersByLine:$t(o),fileIdentifiers:new Set(o.keys()),rustAttrReferencedNames:i,crossLanguageDispatchNames:s}}var ur=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function Ht(e,t){let n=Q(e,t);return!n||!ur.has(n.language)?null:n.callables.map(r=>({name:r.name,startLine:r.startLine,endLine:r.endLine}))}function js(e,t){let n=Q(e,t);return!n||!ur.has(n.language)?null:n.callSites}function Os(e,t){return Q(e,t)?.typeContainerMap??new Map}import{ElementTypes as $s,NodeTypes as qt,parse as Bs}from"@vue/compiler-dom";import{parse as Fp}from"@vue/compiler-sfc";var Ms=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 st(e){return e.length<=2||Ms.has(e)}function ot(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var Vs=re("vue-template-facts"),Us=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),Ws=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"]),zs=new Set(["div","span","template"]),Hs=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 at(e,t){let n=t.replace(/\\/g,"/"),r=f(e,n);return Vs.get(e,n,r,()=>qs(n,Ie(e,n).template))}function qs(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=Bs(t.body,{comments:!1})}catch{return n}let i=new Set,s=o=>{o.trim()&&i.add(o)};return dr(r.children,t.startLine,n,s),n.structuralTokens=[...i].sort(),n}function dr(e,t,n,r){for(let i of e)if(i.type===qt.ELEMENT)Ks(i,t,n,r),dr(i.children,t,n,r);else if(i.type===qt.INTERPOLATION){r("interpolation");let s=Kt(i.content);s&&mr(s,t,i.loc.start.line,n,r)}}function Ks(e,t,n,r){let i=eo(e.tag),s={tag:e.tag,normalized:i,kind:Zs(e),startLine:Le(t,e.loc.start.line),endLine:Le(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${i}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${i}`)):(n.nativeTags.push(s),zs.has(e.tag)||r(`native:${e.tag}`));for(let o of e.props)Xs(o,t,n,r)}function Xs(e,t,n,r){if(e.type===qt.ATTRIBUTE){let a=e.value?.content??null,c=pr("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let i=Qs(e),s=Kt(e.exp),o=pr(Js(e.name),i,s,t,e.loc.start.line,e.loc.end.line);switch(o.kind){case"prop":n.props.push(o),r(`prop:${i}`);break;case"event":n.events.push(o),r(`event:${i}`);break;case"slot":n.slots.push(o),r(`slot:${i}`);break;case"directive":n.directives.push(o),r(`directive:${i}`);break}s&&mr(s,t,e.loc.start.line,n,r)}function pr(e,t,n,r,i,s){return{kind:e,name:t,value:n,startLine:Le(r,i),endLine:Le(r,s)}}function Js(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Qs(e){let t=Kt(e.arg);return t||e.name}function Kt(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function mr(e,t,n,r,i){for(let s of Gs(e)){let o={name:s,startLine:Le(t,n),endLine:Le(t,n)};r.expressionIdentifiers.push(o),i(`id:${s}`)}}function Gs(e){let t=new Set,n=Ys(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,i;for(;i=r.exec(n);){let s=i[0];Hs.has(s)||st(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function Ys(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 Zs(e){let t=e.tag;return e.tagType===$s.COMPONENT?"component":Us.has(t)?"builtin":Ws.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function eo(e){return ot(e,/[-_:]/)}function Le(e,t){return e+Math.max(0,t-1)}import{createRequire as po}from"module";import{existsSync as Se}from"fs";import{basename as gr,dirname as L,extname as G,join as w,relative as he,resolve as N,sep as mo}from"path";import{existsSync as Jt,readdirSync as to,statSync as no}from"fs";import{join as ke,relative as ro}from"path";function fr(e){let t=io(e)??co(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let i of t)for(let s of lo(e,i)){if(r.has(s))continue;r.add(s);let o=uo(e,s);o&&n.push(o)}return n}function io(e){let t=ke(e,"pnpm-workspace.yaml");if(!Jt(t))return null;try{return so(Qe(t,"pnpm workspace manifest"))}catch{return null}}function so(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let i=oo(r);if(!n){/^packages\s*:\s*$/.test(i.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(i);if(s){let o=ao(s[1].trim());o&&t.push(o);continue}if(i.trim()!=="")break}return t}function oo(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function ao(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function co(e){let t=ke(e,"package.json");if(!Jt(t))return null;try{let n=JSON.parse(Qe(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function lo(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let o=ke(e,t);return Xt(o)?[o]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),i=t.slice(n+1).replace(/^\//,""),s=ke(e,r||".");return Xt(s)?to(s).map(o=>ke(s,o,i)).filter(Xt):[]}function Xt(e){try{return no(e).isDirectory()}catch{return!1}}function uo(e,t){let n=ke(t,"package.json");if(!Jt(n))return null;try{let r=JSON.parse(Qe(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:ro(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var fo=Ee("indexed-paths",{clearGroups:[]}),go=Ee("indexed-path-digest",{clearGroups:[]}),ho=b("tsconfig-alias-config",{clearGroups:["whole-project"]}),yo=b("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),So=po(import.meta.url),He;function xo(){if(He!==void 0)return He;try{He=So("typescript")}catch{He=null}return He}var bo=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],No=Ee("workspace-packages",{clearGroups:["whole-project"]}),ye=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],ct=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],lt=[".rs"],ut=[".rb"],pt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],ae=[".cs",".vb"],dt=[".dart"],xe=[".php"],Re=[".clj",".cljs",".cljc"],Eo=new Set(ye),Qt=new Set(ct),hr=new Set(k),Gt=new Set(lt),Yt=new Set(ut),yr=new Set(pt),Sr=new Set(ae),Zt=new Set(dt),xr=new Set(xe),br=new Set(Re),vo=[{extensions:ye,lookup:Eo},{extensions:ct,lookup:Qt},{extensions:k,lookup:hr},{extensions:lt,lookup:Gt},{extensions:ut,lookup:Yt},{extensions:pt,lookup:yr},{extensions:ae,lookup:Sr},{extensions:dt,lookup:Zt},{extensions:xe,lookup:xr},{extensions:Re,lookup:br}];function Y(e,t){return t.has(G(e).toLowerCase())}function _o(e){return Y(e,Qt)}function Co(e){return Y(e,hr)}function To(e){return Y(e,Gt)}function Io(e){return Y(e,Yt)}function Fo(e){return Y(e,yr)}function Lo(e){return Y(e,Sr)}function Nr(e){return G(e).toLowerCase()===".vb"}function ko(e){return Y(e,Zt)}function Ro(e){return Y(e,xr)}function Po(e){return Y(e,br)}function en(e){let t=G(e).toLowerCase();for(let n of vo)if(n.lookup.has(t))return n.extensions;return ye}function Do(e){return Co(e)||Lo(e)||Ro(e)}function z(e,t,n){return _o(t)?Pe(e,t,n):To(t)?Z(e,t,n):Io(t)?mt(e,t,n):Fo(t)?ft(e,t,n):Do(t)?S(e,n.replace(/\\/g,"."),en(t)):ko(t)?gt(e,t,n):Po(t)?tn(e,n):wo(e,t,n)}function wo(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return Ao(e,t,n)??Oo(e,n);let r=L(w(e.config.projectRoot,t)),i=N(r,n),s=ee(e);for(let o of rn(i)){let a=v(he(e.config.projectRoot,o));if(s.has(a)||Se(o))return a}return v(he(e.config.projectRoot,i))}function Ao(e,t,n){let r=Wo(e,t);if(!r)return null;let i=ee(e);for(let s of jo(r,n)){let o=N(r.baseUrl,s);for(let a of rn(o)){let c=v(he(e.config.projectRoot,a));if(i.has(c)||Se(a))return c}}return null}function jo(e,t){let n=[];for(let[r,i]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...i);continue}let o=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(o)||!t.endsWith(a)||t.length<o.length+a.length)continue;let c=t.slice(o.length,t.length-a.length);for(let l of i)n.push(l.includes("*")?l.replace("*",c):l)}return n}function Oo(e,t){let n=$o(Mo(e),t);if(!n)return null;let r=ee(e);for(let i of Bo(n)){let s=N(e.config.projectRoot,n.pkg.relativeDir,i);for(let o of rn(s)){let a=v(he(e.config.projectRoot,o));if(r.has(a)||Se(o))return a}}return null}function Mo(e){return No.get(e,()=>fr(e.config.projectRoot))}function $o(e,t){let n=null;for(let r of e){let i=null;t===r.name?i="":t.startsWith(`${r.name}/`)&&(i=t.slice(r.name.length+1)),i!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:i})}return n}function Bo(e){let t=[],n=Vo(e.pkg.exports,e.subpath);if(n){let r=Uo(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function Vo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Er(e[n])}function Er(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=Er(t[n]);if(r)return r}return null}function Uo(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function Wo(e,t){let n=v(L(t));return yo.get(e,n,()=>zo(e,n))}function zo(e,t){let n=xo();if(!n)return null;let r=N(e.config.projectRoot),i=N(r,t);for(;i===r||i.startsWith(r+mo);){for(let o of bo){let a=w(i,o);if(!Se(a))continue;let c=ho.get(e,a,()=>Ho(n,a));if(c)return c}let s=L(i);if(s===i)break;i=s}return null}function Ho(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,L(t)),i=r.options.paths;return!i||Object.keys(i).length===0?null:{baseUrl:r.options.baseUrl?N(L(t),r.options.baseUrl):L(t),paths:i}}catch{return null}}function Pe(e,t,n){let r=ee(e),i;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let o=s[1].length,a=s[2].replace(/^\./,""),c=L(w(e.config.projectRoot,t));for(let l=1;l<o;l++)c=L(c);i=a?N(c,a.replace(/\./g,"/")):c}else i=N(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of qo(i)){let o=v(he(e.config.projectRoot,s));if(r.has(o)||Se(s))return o}return null}function Z(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 i=L(w(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=N(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=N(i,r.slice(6).replace(/::/g,"/")):s=N(L(i),r.slice(7).replace(/::/g,"/")),nn(e,Ko(s))}function mt(e,t,n){let r=L(w(e.config.projectRoot,t)),i=N(r,n);return nn(e,Xo(i))}function ft(e,t,n){let r=L(w(e.config.projectRoot,t)),i=[N(r,n),N(e.config.projectRoot,n),N(e.config.projectRoot,"include",n),N(e.config.projectRoot,"src",n)];return nn(e,i)}function S(e,t,n){let r=ee(e),i=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=i.replace(/\./g,"/"),o=i.split(".").pop()??i;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=>gr(u)===`${o}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(G(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${o}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function gt(e,t,n){let r=ee(e);if(n.startsWith("package:")){let o=n.slice(8),a=o.indexOf("/");if(a<0)return null;let c=o.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let i=L(w(e.config.projectRoot,t)),s=N(i,n);for(let o of Jo(s)){let a=v(he(e.config.projectRoot,o));if(r.has(a)||Se(o))return a}return null}function tn(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=ee(e);for(let i of Re){let s=`${n}${i}`,o=[...r].find(a=>a.endsWith(s));if(o)return o}for(let i of Re){let s=[...r].find(o=>gr(o)===`${n.split("/").pop()}${i}`);if(s)return s}return null}function qo(e){let t=G(e);return Qt.has(t)?[e]:[`${e}.py`,`${e}.pyi`,w(e,"__init__.py"),w(e,"__init__.pyi")]}function nn(e,t){let n=ee(e);for(let r of t){let i=v(he(e.config.projectRoot,r));if(n.has(i)||Se(r))return i}return null}function Ko(e){let t=G(e);return Gt.has(t)?[e]:[`${e}.rs`,w(e,"mod.rs")]}function Xo(e){let t=G(e);return Yt.has(t)?[e]:[`${e}.rb`,w(e,"index.rb")]}function Jo(e){let t=G(e);return Zt.has(t)?[e]:[`${e}.dart`,e]}function rn(e){let t=G(e),n=new Set;if(t){n.add(e);for(let r of ye)n.add(e.slice(0,-t.length)+r)}else for(let r of ye)n.add(`${e}${r}`),n.add(w(e,`index${r}`));return[...n]}function ee(e){return fo.get(e,()=>new Set(je(e,{includeIgnored:!1}).map(v)))}function sn(e){return go.get(e,()=>Ze([...ee(e)].sort().join(`
89
- `)))}var Qo=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),Go=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),Yo=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),Zo=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),ea=new Set(["catch","for","function","if","return","switch","while"]);function yt(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+=fe(n),n.external&&(t.externalLineCount+=fe(n),t.externalScriptPaths.push(n.sourcePath));for(let i of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:i});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(...ia(n));let r=me(n.astLanguage,n.body);r?na(n,r.rootNode,t):ra(n,t)}return ta(t),t.externalScriptPaths=_r(t.externalScriptPaths),t}function ta(e){e.composables=De(e,"composable"),e.stores=De(e,"store"),e.reactivity=De(e,"reactivity"),e.lifecycle=De(e,"lifecycle"),e.requests=De(e,"request"),e.macros=De(e,"macro")}function De(e,t){return _r(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function na(e,t,n){let r=new Set,i=new Set,s=o=>{let a=nt(o,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;i.has(l)||(i.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=Fe(o,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:vr(c.calleeLeaf),setup:e.setup}))}for(let l of o.children)s(l)};s(t)}function ra(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||ea.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+ht(e.body,n.index??0),categories:vr(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 i=e.startLine+ht(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,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 i=e.startLine+ht(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}}function ia(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),i=n[2];if(!r||!i)continue;let s=e.startLine+ht(e.body,n.index??0);for(let o of sa(r))t.push({local:o,source:i,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function sa(e){let t=[],r=e.split(",").map(o=>o.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let i=/\{([^}]*)\}/.exec(e)?.[1];if(i)for(let o of i.split(",")){let a=o.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(o=>/^[A-Za-z_$][\w$]*$/.test(o))}function vr(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),Qo.has(e)&&t.push("reactivity"),Go.has(e)&&t.push("lifecycle"),Yo.has(e)&&t.push("request"),Zo.has(e)&&t.push("macro"),t}function ht(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 _r(e){return[...new Set(e)].sort()}var oa=new Set(["in","key","of"]),aa=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),ca=re("vue-component-behavior-profiles");function Cr(e,t={}){let n=Ge(e,{extensions:[".vue"]}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(i=>on(e,i)).filter(i=>(t.minTemplateTokens===void 0||i.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function on(e,t){let n=t.replace(/\\/g,"/"),r=f(e,n),i=ca.get(e,n,r,()=>la(e,n,r));return pa(i)}function la(e,t,n){let r=Ie(e,t),i=at(e,t),s=yt(r),o=fa(i),a=i.expressionIdentifiers.map(g=>g.name).filter(g=>!o.includes(g)).filter((g,M,pe)=>pe.indexOf(g)===M).sort(),c=i.componentTags.map(g=>g.normalized).filter((g,M,pe)=>pe.indexOf(g)===M).sort(),l=n?n.split(`
90
- `).length:0,u=fe(r.template),p=s.lineCount,d=r.styles.reduce((g,M)=>g+fe(M),0),m=r.customBlocks.reduce((g,M)=>g+fe(M),0),{lines:h,paths:V}=ua(e,t,s);return{file:t,sfc:r,templateFacts:i,scriptFacts:s,templateTokens:new Set(i.structuralTokens),behaviorTokens:ma(i,s,a),templateBindingNames:a,templateLocalNames:o,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:u,scriptLines:p,styleLines:d,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:m,delegatedComposableLines:h,delegatedComposablePaths:V}}function ua(e,t,n){let r=new Set;for(let o of n.composables){let a=n.imports.find(l=>l.local===o);if(!a)continue;let c=z(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let i=[...r].sort();return{lines:i.reduce((o,a)=>{let c=f(e,a);return o+(c?c.split(`
91
- `).length:0)},0),paths:i}}function pa(e){let t=da(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 da(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 ma(e,t,n){let r=new Set;for(let i of t.composables)r.add(`composable:${i}`);for(let i of t.stores)r.add(`store:${i}`);for(let i of t.reactivity)r.add(`reactivity:${i}`);for(let i of t.lifecycle)r.add(`lifecycle:${i}`);for(let i of t.requests)r.add(`request:${i}`);for(let i of t.macros)r.add(`macro:${i}`);for(let i of t.functions){if(aa.has(i.name))continue;r.add(`function:${i.name}`);let s=/^[a-z]+/.exec(i.name)?.[0]??null;s&&s.length>2&&s!==i.name&&r.add(`function-verb:${s}`)}for(let i of e.events)r.add(`template-event:${i.name}`);for(let i of n)r.add(`template-binding:${i}`);return r}function fa(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of ga(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of Tr(n.value))t.add(r);return[...t].sort()}function ga(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?Tr(t[1]??""):[]}function Tr(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];oa.has(r)||t.push(r)}return t}import{extname as ha}from"path";var ya=[".tsx",".jsx"],Ir=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),Sa=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),xa=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),ba=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Na=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Ea=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),va=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),_a=re("react-component-behavior-profiles"),Fr=X({kind:"react-component-behavior-profiles",invalidation:J("react-component-behavior-profiles"),serialize:Fa,deserialize:La});function Pr(e,t={}){let n=Ge(e,{extensions:ya}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(i=>cn(e,i)).filter(i=>(t.minJsxTokens===void 0||i.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function cn(e,t){let n=t.replace(/\\/g,"/"),r=f(e,n);return _a.get(e,n,r,()=>Ca(e,n,r)).map(Ia)}function Ca(e,t,n){let r=U(e,t,n),i=Fr.read(e,t,r);if(i)return i;let s=Ta(e,t);return Fr.write(e,t,r,s),s}function Ta(e,t){let n=Ra(t);if(!n)return[];let r=$(e,t);if(!r)return[];let i=Me(e,t).length;return Pa(r.rootNode,n).filter(o=>o.kind==="hook"||ln(o.bodyNode)).map(o=>{let a=$a(o.bodyNode),c=za(o.bodyNode,n);return{file:t,name:o.name,kind:o.kind,startLine:o.node.startPosition.row,endLine:o.node.endPosition.row,loc:Math.max(1,o.node.endPosition.row-o.node.startPosition.row+1),fileLines:i,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:te(a.componentNames),nativeTags:te(a.nativeTags),propNames:te(a.propNames),eventNames:te(a.eventNames),hookNames:te(c.hookNames),requestNames:te(c.requestNames),stateNames:te(c.stateNames),effectNames:te(c.effectNames),handlerNames:te(c.handlerNames)}})}function Ia(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 Fa(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function La(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let i=ka(r);if(!i)return null;n.push(i)}return n}catch{return null}}function ka(e){if(!ie(e))return null;let{file:t,name:n,kind:r,startLine:i,endLine:s,loc:o,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:u,nativeTags:p,propNames:d,eventNames:m,hookNames:h,requestNames:V,stateNames:g,effectNames:M,handlerNames:pe}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!St(i)||!St(s)||!St(o)||!St(a))return null;let E={jsxTokens:P(c),behaviorTokens:P(l),componentNames:P(u),nativeTags:P(p),propNames:P(d),eventNames:P(m),hookNames:P(h),requestNames:P(V),stateNames:P(g),effectNames:P(M),handlerNames:P(pe)};return Object.values(E).some(Ci=>Ci===null)?null:{file:t,name:n,kind:r,startLine:i,endLine:s,loc:o,fileLines:a,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 St(e){return typeof e=="number"&&Number.isFinite(e)}function Ra(e){let t=ha(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:W(e)}function Pa(e,t){let n=[],r=new Set,i=s=>{let o=Da(s);if(o&&(!Oa(s)||o.kind==="component")){let a=`${o.name}:${o.node.startIndex}:${o.node.endIndex}`;r.has(a)||(r.add(a),n.push(o))}for(let a of s.namedChildren)i(a)};return(t==="tsx"||t==="javascript")&&i(e),n}function Da(e){if(e.type==="class_declaration"){let s=an(e);if(!s||!/^[A-Z]/.test(s))return null;let o=wa(e);return!o||!Aa(e)&&!ln(o)?null:{name:s,kind:"component",node:e,bodyNode:o}}if(e.type==="function_declaration"){let s=an(e);return!s||!Lr(s)?null:{name:s,kind:kr(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=qe(t);if(!r||!n||!Lr(r))return null;let i=ja(n);return i?{name:r,kind:kr(r),node:e,bodyNode:i}:null}function wa(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 Aa(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Lr(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function kr(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function ja(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=Ma(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(i=>i.type==="arguments")?.namedChildren.find(i=>i.type==="arrow_function"||i.type==="function_expression")??null}function Oa(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 an(e){return qe(e.childForFieldName("name")??e.namedChild(0))}function Ma(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function ln(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(ln)}function $a(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"?Ba(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Va(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let i of r.children)n(i)};return n(e),t}function Ba(e,t){let n=Ua(e),r=!1;if(n){let i=Rr(n),s=i==="Fragment"||i==="React.Fragment";r=Ja(i)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(i),t.tokens.add(`component:${i}`)):(t.nativeTags.add(i),t.tokens.add(`native:${i}`))}for(let i of e.namedChildren)if(i.type==="jsx_attribute"){let s=Wa(i);if(!s)continue;let o=Rr(s);if(o.startsWith("on")&&o.length>2){let a=o.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else va.has(o)||(t.propNames.add(o),t.tokens.add(`${r?"prop":"native-prop"}:${o}`))}else i.type==="jsx_spread_attribute"&&t.tokens.add(Dr(i))}function Va(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(Dr(e)),wr(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of Qa(n))st(r)||t.tokens.add(`binding:${r}`)}function Dr(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",i=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return i?`prop:spread:${i}`:"prop:spread"}function wr(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(wr)}function Ua(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 Wa(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 za(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=i=>{if(i.type==="call_expression"){let s=Fe(i,t);s&&Ha(s.calleeLeaf,n)}else if(i.type==="variable_declarator")Ka(i,n);else if(i.type==="function_declaration"){let s=an(i);s&&Ar(s,n)}for(let s of i.namedChildren)r(s)};return r(e),n}function Ha(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Ir.has(e)&&!ba.has(e)&&t.tokens.add(`hook:${e}`)),Ir.has(e)&&t.tokens.add(`react-hook:${e}`),Sa.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),xa.has(e)&&t.tokens.add(`state-hook:${e}`),qa(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function qa(e){if(Na.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Ka(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=>qe(a)),o=qe(s);o&&(t.stateNames.add(o),t.tokens.add(`state:${o}`))}let i=qe(n);i&&Ar(i,t)}function Ar(e,t){let n=Xa(e);!n||!Ea.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Xa(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 Ja(e){return/^[A-Z]/.test(e)||e.includes(".")}function Rr(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function qe(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 Qa(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 te(e){return[...e].sort()}function _d(e){return{capability:(t,n)=>Ga(t,n),reactProfiles:(t={})=>Pr(e,t),reactProfilesForFile:t=>cn(e,t),vueProfiles:(t={})=>Cr(e,t),vueProfileForFile:t=>on(e,t),vueTemplateFacts:t=>at(e,t),vueScriptFacts:t=>yt(Ie(e,t))}}function Ga(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 Ya(e,t,n={}){let r=Q(e,t);if(!r)return[];let i=[];if(n.includeCrossLanguageDispatchNames)for(let s of r.crossLanguageDispatchNames)i.push({name:s,kind:"cross-language-dispatch",occurrences:1});if(n.includeRustAttributeNames&&r.language==="rust")for(let s of r.rustAttrReferencedNames)i.push({name:s,kind:"rust-attribute",occurrences:1});return i}import{basename as Or}from"path";function H(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Za(e){return e.replace(/'''[\s\S]*?'''/g,ce).replace(/"""[\s\S]*?"""/g,ce).replace(/#.*$/gm,ce).replace(/\/\/.*$/gm,ce).replace(/\/\*[\s\S]*?\*\//g,ce).replace(/`(?:\\[\s\S]|[^`])*`/g,ce).replace(/'(?:\\.|[^'\\\r\n])*'/g,ce).replace(/"(?:\\.|[^"\\\r\n])*"/g,ce)}function Bd(e){return jr(e,{maskStrings:!1})}function Vd(e){return jr(e,{maskStrings:!0})}function jr(e,t){let n="",r=0,i=e.length;for(;r<i;){if(e[r]==="/"&&e[r+1]==="/"){let o=e.indexOf(`
92
- `,r),a=o===-1?i:o;n+=un(e,r,a),r=a;continue}if(e[r]==="/"&&e[r+1]==="*"){let o=e.indexOf("*/",r+2),a=o===-1?i:o+2;n+=un(e,r,a),r=a;continue}let s=e[r];if(s==="`"||s==="'"||s==='"'){let o=s,a=r+1;for(;a<i;){if(e[a]==="\\"){a+=2;continue}if(e[a]===o){a+=1;break}if(o!=="`"&&e[a]===`
93
- `)break;a+=1}n+=t.maskStrings?un(e,r,a):e.slice(r,a),r=a;continue}n+=s,r+=1}return n}function un(e,t,n){let r="";for(let i=t;i<n;i+=1)r+=e[i]===`
94
- `?`
95
- `:" ";return r}function ce(e){return e.replace(/[^\r\n]/g," ")}var Ud=ve("stripped-lines",{clearGroups:["whole-project","source-file"]});In({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{xt=null,Ke=""},clearFile:()=>{xt=null,Ke=""}});var xt=null,Ke="";function ec(e){return xt===e||(xt=e,Ke=Za(e)),Ke}function le(e,t,n){let r=ec(e);return`${r.slice(0,t)}${" ".repeat(n-t)}${r.slice(n)}`}function T(e,t){return new RegExp(`\\b${H(t)}\\b`,"m").test(e)}function we(e,t){let n=new Set,r=new RegExp(`\\b${H(t)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let i of e.matchAll(r)){let s=i[1];s&&n.add(s)}return[...n]}function pn(e){let t=0;for(let n of e)n==="("&&(t+=1),n===")"&&(t-=1);return t}var tc=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function I(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let s=e[i];(s==="{"||s==="["||s==="(")&&n++,(s==="}"||s==="]"||s===")")&&n--,s===","&&n===0&&(t.push(e.slice(r,i)),r=i+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 x(e,t){let n=new Set,r=(i,s)=>{let o=s||t.has(i.type);!o&&tc.has(i.type)&&n.add(i.text);for(let a of i.children)r(a,o)};return r(e.rootNode,!1),n}function B(e,t,n,r,i,s,o){return{importedName:i,localName:s,sourcePath:o??S(e,r,en(t)),kind:"named",used:T(n,s),usedMembers:[]}}function y(e,t,n,r,i="named",s={}){return{importedName:e,localName:t,sourcePath:n,kind:i,used:r.has(t),usedMembers:[],isTypeOnly:s.isTypeOnly}}function ne(e,t,n,r,i="named",s=[],o={}){return{importedName:e,localName:t,sourcePath:n,kind:i,used:r,usedMembers:s,isTypeOnly:o.isTypeOnly}}function be(e,t){return{importedName:e,localName:null,sourcePath:t,kind:"side-effect",used:!0,usedMembers:[]}}function Ne(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 A(e,t,n){let r=[];for(let i of e.matchAll(t)){let s=i[0];if(!s||typeof i.index!="number")continue;let o=le(e,i.index,i.index+s.length);for(let a of n(i,o))r.push(a)}return r}function j(e,t,n,r,i){let s=Ve(e,t,i)?.tree??null;if(s){let o=n(s);if(o)return o}return r()}function bt(e,t,n,r,i){let s=Ve(e,t,i)?.tree??null,o=W(t),a=o?n[o]:void 0;return s&&a?a(s):r()}function Mr(e,t,n){return j(e,t,r=>rc(e,t,r),()=>nc(e,t,n),n)}function nc(e,t,n){return A(n,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(r,i)=>{let s=r[1]?.trim();if(!s)return[];let o=Or(s).replace(/\.[^.]+$/,"");return[ne(s,o,ft(e,t,s),T(i,o))]})}function rc(e,t,n){let r=x(n,new Set(["preproc_include"])),i=[];for(let s of n.rootNode.descendantsOfType("preproc_include")){let o=null;for(let c of s.namedChildren){if(c.type==="system_lib_string"){o=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){o=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!o)continue;let a=Or(o).replace(/\.[^.]+$/,"");i.push(y(o,a,ft(e,t,o),r))}return i}var ic=new Set([":require",":require-macros",":use"]),fn=String.raw`A-Za-z0-9_$*+!?.<>=-`;function Br(e,t,n){let r=gc(n);if(!r)return[];let i=fc(n,r.start,r.end),s=[];for(let o of r.children.slice(2)){if(o.type!=="list"||o.children.length===0)continue;let a=O(o.children[0]);if(a){if(ic.has(a)){for(let c of ac(o.children.slice(1)))s.push(...oc(e,c,i));continue}if(a===":import")for(let c of lc(o.children.slice(1)))s.push(c)}}return s}function sc(e){return e.type==="list"&&O(e.children[0])==="ns"}function oc(e,t,n){let r=tn(e,t.namespace),i=t.alias??t.namespace,s=pc(n,i),o=[{importedName:t.namespace,localName:i,sourcePath:r,kind:"namespace",used:t.refers.length>0||t.referAll||s.length>0||dc(n,t.namespace),usedMembers:s}];t.referAll&&o.push({importedName:"*",localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]});for(let a of t.refers)o.push({importedName:a,localName:a,sourcePath:r,kind:"named",used:mc(n,a),usedMembers:[]});return o}function ac(e){return e.flatMap(t=>Nt(t,null))}function Nt(e,t){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:mn(t,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&O(e.children[0])===null?e.children.flatMap(n=>Nt(n,t)):cc(e,t);if(e.type==="list"&&e.children.length>0){let n=O(e.children[0]);return n?!n||n.startsWith(":")?[]:e.children.slice(1).flatMap(r=>Nt(r,mn(t,n))):e.children.flatMap(r=>Nt(r,t))}return[]}function cc(e,t){let n=O(e.children[0]);if(!n||n.startsWith(":"))return[];let r={namespace:mn(t,n),alias:null,refers:[],referAll:!1};for(let i=1;i<e.children.length;i+=1){let s=O(e.children[i]);if(!s?.startsWith(":"))continue;let o=e.children[i+1];if((s===":as"||s===":as-alias")&&o){r.alias=O(o),i+=1;continue}s===":refer"&&o&&(O(o)===":all"?r.referAll=!0:(o.type==="vector"||o.type==="list")&&r.refers.push(...o.children.map(O).filter(uc)),i+=1)}return[r]}function lc(e){let t=[];for(let n of e){if(n.type==="atom"){let i=n.text.split(".").pop()??n.text;t.push(ne(i,i,null,!0));continue}if(n.type!=="vector")continue;let r=O(n.children[0]);if(r)for(let i of n.children.slice(1)){let s=O(i);s&&t.push(ne(`${r}.${s}`,s,null,!0))}}return t}function mn(e,t){return e?`${e}.${t}`:t}function O(e){return e?.type==="atom"?e.text:null}function uc(e){return!!(e&&!e.startsWith(":"))}function pc(e,t){let n=new Set,r=new RegExp(`${gn()}${H(t)}\\s*/\\s*([${fn}]+)`,"g");for(let i of e.matchAll(r)){let s=i[1];s&&n.add(s)}return[...n]}function dc(e,t){return new RegExp(`${gn()}${H(t)}\\s*/`,"m").test(e)}function mc(e,t){return new RegExp(`${gn()}${H(t)}(?![${fn}])`,"m").test(e)}function gn(){return`(?<![${fn}])`}function fc(e,t,n){let r="",i=0;for(;i<e.length;){if(i>=t&&i<n){r+=e[i]===`
96
- `?`
97
- `:" ",i+=1;continue}let s=e[i];if(s===";"){let o=it(e,i);r+=$r(e.slice(i,o)),i=o;continue}if(s==='"'){let o=ze(e,i,0).index;r+=$r(e.slice(i,o)),i=o;continue}r+=s,i+=1}return r}function gc(e){let t=0;for(;t<e.length&&(t=hn(e,t),!(t>=e.length));){let n=Et(e,t);if(!n){t+=1;continue}if(sc(n.form))return n.form;t=n.index}return null}function Et(e,t){let n=hn(e,t);if(e.startsWith("#?@",n)||e.startsWith("#?",n))return hc(e,n);if(e.startsWith("#_",n)){let i=Et(e,n+2);return i?{form:{type:"atom",text:"",start:n,end:i.index},index:i.index}:null}for(;Vt(e[n]);)n+=1;let r=e[n];return r?r==="("?dn(e,n,"list",")"):r==="["?dn(e,n,"vector","]"):r==="{"?dn(e,n,"map","}"):r==='"'?{form:{type:"atom",text:"",start:n,end:ze(e,n,0).index},index:ze(e,n,0).index}:Sc(e,n):null}function hc(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"?yc(r.form.children):[],start:t,end:r.index},index:r.index}:null}function yc(e){let t=[];for(let n=0;n<e.length;n+=2){let r=O(e[n]),i=e[n+1];r?.startsWith(":")&&i&&t.push(i)}return t}function dn(e,t,n,r){let i=[],s=t+1;for(;s<e.length;){if(s=hn(e,s),e[s]===r)return{form:{type:n,children:i,start:t,end:s+1},index:s+1};let o=Et(e,s);if(!o){s+=1;continue}o.form.type==="atom"&&o.form.text===""||i.push(o.form),s=o.index}return{form:{type:n,children:i,start:t,end:e.length},index:e.length}}function Sc(e,t){let n=t;for(;n<e.length&&!Ut(e[n]);)n+=1;return{form:{type:"atom",text:e.slice(t,n),start:t,end:n},index:n}}function hn(e,t){let n=t;for(;n<e.length;){let r=e[n];if(/\s|,/.test(r)){n+=1;continue}if(r===";"){n=it(e,n);continue}break}return n}function $r(e){return e.replace(/[^\r\n]/g," ")}function Vr(e,t,n){let r=[];for(let i of n.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let s=i[1]?.trim(),o=i[2]?.trim()??null,a=i[0];if(!s||!a||typeof i.index!="number")continue;let c=le(n,i.index,i.index+a.length);r.push({importedName:s,localName:o,sourcePath:gt(e,t,s),kind:o?"namespace":"side-effect",used:o?T(c,o):!0,usedMembers:o?we(c,o):[]})}return r}function Ur(e,t,n){let r=[];for(let i of n.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let s=i[1]?.trim();s&&r.push({specifier:s,sourcePath:gt(e,t,s)})}return r}function Wr(e,t,n){return bt(e,t,{csharp:r=>bc(e,t,r),vb:r=>xc(e,t,r)},()=>{let r=Nr(t)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return A(n,r,(i,s)=>{let o=i[1]?.trim();if(!o)return[];let[a,c]=o.split(/\s*=\s*/),l=!!c,u=(l?c:a)?.trim()??o,p=u.split(".").pop()??u,d=l?a?.trim()??p:p;return[B(e,t,s,u,p,d,S(e,u,ae))]})},n)}function xc(e,t,n){let r=x(n,new Set(["imports_statement"])),i=[];for(let s of n.rootNode.descendantsOfType("imports_statement")){let o=s.namedChildren.filter(d=>d.type==="namespace_name");if(o.length===0)continue;let a=o[o.length-1],c=o.length>1?o[0]:null,l=a.text,u=l.split(".").pop()??l,p=c?.text??u;i.push(y(u,p,S(e,l,ae),r,c?"namespace":"named"))}return i}function bc(e,t,n){let r=x(n,new Set(["using_directive"])),i=[];for(let s of n.rootNode.descendantsOfType("using_directive")){let o=s.namedChildren;if(o.length===0)continue;let a=null,c;o.length>=2&&o[0].type==="identifier"&&(o[1].type==="qualified_name"||o[1].type==="identifier")?(a=o[0],c=o[1]):c=o[o.length-1];let l=c.text,u=l.split(".").pop()??l,p=a?.text??u;i.push(y(u,p,S(e,l,ae),r,a?"namespace":"named"))}return i}var Nc=b("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function zr(e,t){return Nc.get(e,t,()=>{let n=new Set,r=f(e,t);if(!r)return n;let s=r.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,o=>o.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,o=>o.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,o=>o.replace(/[^\r\n]/g," "));for(let o of s.matchAll(/[A-Za-z_$][\w$]*/g))n.add(o[0]);return n})}function yn(e,t,n){return j(e,t,r=>vc(e,t,r),()=>Ec(e,t,n),n)}function Ec(e,t,n){return wc(n).flatMap(r=>Ac(e,t,r.clause,r.specifier,r.start,r.end,n))}function vc(e,t,n){let r=_c(e,t,n),i=[];for(let s of n.rootNode.descendantsOfType("import_statement"))i.push(...Cc(e,t,n,s,r));return i}function _c(e,t,n){let r=x(n,new Set(["import_statement"]));if(oe(t))for(let i of zr(e,t))r.add(i);return r}function Cc(e,t,n,r,i){let s=kc(r);if(!s)return[];let o=z(e,t,s),a=R(r,"import_clause");return a?Tc(n,a,o,i,Rc(r.text)):[be("*",o)]}function Tc(e,t,n,r,i){let s=[];for(let o of t.namedChildren)if(o.type==="identifier")s.push(Ic(o.text,n,r,i));else if(o.type==="namespace_import"){let a=Fc(e,o,n,r,i);a&&s.push(a)}else o.type==="named_imports"&&s.push(...Lc(o,n,r,i));return s}function Ic(e,t,n,r){return y("default",e,t,n,"default",{isTypeOnly:r})}function Fc(e,t,n,r,i){let o=R(t,"identifier")?.text??"";if(!o)return null;let a=Dc(e,o);return Ne("*",n,{localName:o,usedMembers:a,isTypeOnly:i,used:a.length>0||r.has(o)})}function Lc(e,t,n,r){let i=[];for(let s of e.namedChildren){if(s.type!=="import_specifier")continue;let o=s.namedChild(0),a=s.namedChild(1);if(!o)continue;let c=o.text,l=a?.text??c;i.push(y(c,l,t,n,"named",{isTypeOnly:r||Pc(s.text)}))}return i}function kc(e){let t=R(e,"string");if(!t)return null;let n=R(t,"string_fragment");return n?n.text:null}function Rc(e){return/^\s*import\s+type\b/.test(e)}function Pc(e){return/^\s*type\b/.test(e.trim())}function Dc(e,t){let n=new Set;for(let r of e.rootNode.descendantsOfType("member_expression")){let i=r.namedChild(0),s=r.namedChild(1);!i||!s||i.type!=="identifier"||i.text!==t||(s.type==="property_identifier"||s.type==="identifier")&&n.add(s.text)}return[...n]}function wc(e){let t=[],n=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(n)){let s=i[0],o=i[1],a=i[2];!s||!a||typeof i.index!="number"||t.push({clause:o,specifier:a,start:i.index,end:i.index+s.length})}let r=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(r)){let s=i[0],o=i[1];!s||!o||typeof i.index!="number"||t.push({clause:null,specifier:o,start:i.index,end:i.index+s.length})}return t.sort((i,s)=>i.start-s.start)}function Ac(e,t,n,r,i,s,o){let a=z(e,t,r),c=le(o,i,s);return n?jc(n).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let p=we(c,u.localName);return Ne(u.importedName,u.sourcePath,{localName:u.localName,usedMembers:p,used:p.length>0||T(c,u.localName),isTypeOnly:u.isTypeOnly})}return u.kind==="side-effect"?be(u.importedName,u.sourcePath):ne(u.importedName,u.localName??"",u.sourcePath,u.localName?T(c,u.localName):!1,u.kind,[],{isTypeOnly:u.isTypeOnly})}):[be("*",a)]}function jc(e){let t=e.trim(),n=/^type\b/.test(t),r=t.replace(/^type\s+/,""),[i,s]=Oc(r),o=[];return i&&o.push(...Hr(i,n)),s&&o.push(...Hr(s,n)),o}function Hr(e,t){let n=e.trim();if(!n)return[];if(n.startsWith("{")){let r=n.slice(1,-1).trim();return r?I(r).map(i=>{let s=i.trim(),o=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:o}}):[]}return n.startsWith("* as ")?[{importedName:"*",localName:n.slice(5).trim(),kind:"namespace",isTypeOnly:t}]:[{importedName:"default",localName:n,kind:"default",isTypeOnly:t}]}function Oc(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 Sn(e,t,n){let r=$(e,t);return r?Wc(e,t,r):Mc(e,t,n)}function Mc(e,t,n){return[...$c(e,t,n),...Bc(e,t,n),...Vc(e,t,n)]}function $c(e,t,n){let r=[],i=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(i)){if(typeof s.index!="number")continue;let o=s[1]??"",a=s[2]??"",c=I(o).map(p=>Uc(p.trim())).filter(p=>!!p),l=Ae(n,s.index),u=Ae(n,s.index+s[0].length-1);r.push({kind:"named",sourcePath:z(e,t,a),names:c,startLine:l,endLine:u})}return r}function Bc(e,t,n){let r=[],i=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(i)){if(typeof s.index!="number")continue;let o=s[2]??"",a=Ae(n,s.index),c=Ae(n,s.index+s[0].length-1);r.push({kind:"star-as",sourcePath:z(e,t,o),names:s[1]?[s[1]]:[],startLine:a,endLine:c})}return r}function Vc(e,t,n){let r=[],i=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(i)){if(typeof s.index!="number")continue;let o=s[1]??"",a=Ae(n,s.index),c=Ae(n,s.index+s[0].length-1);r.push({kind:"star",sourcePath:z(e,t,o),names:[],startLine:a,endLine:c})}return r}function Uc(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 Ae(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)e.charCodeAt(r)===10&&n++;return n}function Wc(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("export_statement")){let s=zc(e,t,i);if(s===void 0)continue;let o=i.startPosition.row,a=i.endPosition.row,c=Hc(i,s,o,a);r.push(c)}return r}function zc(e,t,n){let r=R(n,"string");if(!r)return;let i=R(r,"string_fragment");if(i)return z(e,t,i.text)}function Hc(e,t,n,r){let i=R(e,"export_clause");if(i){let o=[];for(let a of i.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&o.push((l??c).text)}return{kind:"named",sourcePath:t,names:o,startLine:n,endLine:r}}let s=R(e,"namespace_export");if(s){let o=s.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:t,names:o?[o]:[],startLine:n,endLine:r}}return{kind:"star",sourcePath:t,names:[],startLine:n,endLine:r}}function qr(e,t,n){return bt(e,t,{java:r=>qc(e,t,r),kotlin:r=>Kc(e,t,r),scala:r=>Xc(e,t,r)},()=>A(n,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(r,i)=>{let s=r[1]?.trim();return s?Jc(e,t,s,i):[]}),n)}function qc(e,t,n){let r=x(n,new Set(["import_declaration"])),i=[];for(let s of n.rootNode.descendantsOfType("import_declaration")){let o=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(o){i.push(Ne("*",S(e,l,k)));continue}let u=l.split(".").pop()??l;i.push(y(u,u,S(e,l,k),r))}return i}function Kc(e,t,n){let r=x(n,new Set(["import_header","import_list"])),i=[];for(let s of n.rootNode.descendantsOfType("import_header")){let o=s.namedChildren.find(m=>m.type==="identifier");if(!o)continue;let a=s.namedChildren.some(m=>m.type==="wildcard_import"),c=s.namedChildren.find(m=>m.type==="import_alias");if(a){i.push(Ne("*",S(e,o.text,k)));continue}let l=o.text,u=l.split(".").pop()??l,d=c?.namedChild(0)?.text??u;i.push(y(u,d,S(e,l,k),r))}return i}function Xc(e,t,n){let r=x(n,new Set(["import_declaration"])),i=[];for(let s of n.rootNode.descendantsOfType("import_declaration")){let o=s.namedChildren.find(p=>p.type==="namespace_selectors"||p.type==="namespace_wildcard"),a=s.namedChildren.filter(p=>p!==o&&(p.type==="identifier"||p.type==="stable_identifier")),c=a.map(p=>p.text).join(".");if(!c)continue;if(o?.type==="namespace_wildcard"){i.push(Ne("*",S(e,c,k)));continue}if(o?.type==="namespace_selectors"){for(let p of o.namedChildren)if(p.type==="arrow_renamed_identifier"){let[d,m]=p.namedChildren;if(!d)continue;let h=d.text,V=m?.text??h;if(h==="_")continue;i.push(y(h,V,S(e,`${c}.${h}`,k),r))}else if(p.type==="identifier"){let d=p.text;i.push(y(d,d,S(e,`${c}.${d}`,k),r))}continue}let l=a[a.length-1]?.text??c,u=a.slice(0,-1).map(p=>p.text).join(".")||c;i.push(y(l,l,S(e,u&&a.length>1?`${u}.${l}`:c,k),r))}return i}function Jc(e,t,n,r){if(n.includes("{")&&n.includes("}")){let i=n.slice(0,n.indexOf("{")).replace(/\.$/,"").trim(),s=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return I(s).flatMap(o=>{let a=o.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(),d=u==="_"?i:`${i}.${u}`.replace(/\.\./g,".");return[B(e,t,r,d,u,p)]})}return[B(e,t,r,n,n.split(".").pop()??n,n.split(".").pop()??n)]}function Xr(e,t,n){return j(e,t,r=>Qc(e,t,r),()=>A(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,i)=>{let s=r[1]?.trim();return s?I(s).flatMap(o=>{let a=o.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),u=c?.trim()??a,p=u.split("\\").pop()??u,d=(l??p).trim();return[B(e,t,i,u,p,d,S(e,u.replace(/\\/g,"."),xe))]}):[]}),n)}function Qc(e,t,n){let r=x(n,new Set(["namespace_use_declaration"])),i=[],s=(o,a,c)=>{i.push(y(a,c,S(e,o.replace(/\\/g,"."),xe),r))};for(let o of n.rootNode.descendantsOfType("namespace_use_declaration")){let a=o.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=o.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:d}=Kr(l,c);u&&s(d,u,p)}continue}for(let c of o.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:p}=Kr(c,"");l&&s(p,l,u)}}return i}function Kr(e,t){let n=e.namedChildren.find(l=>l.type==="qualified_name"),r=e.namedChildren.filter(l=>l.type==="name"),i="";n?i=n.text:r.length>=1&&(i=r[0].text);let s=n&&r.length>0?r[r.length-1]:null,o=i.split("\\").pop()??i,a=s?.text??o,c=t?`${t}\\${i}`:i;return{importedName:o,localName:a,qualified:c}}function Qr(e,t,n){return j(e,t,r=>Gc(e,t,r),()=>Zc(n).flatMap(r=>tl(e,t,r,n)),n)}function Gc(e,t,n){let r=x(n,new Set(["import_statement","import_from_statement"])),i=[];for(let s of n.rootNode.descendantsOfType("import_statement"))for(let o of s.namedChildren){let a=Jr(o);if(!a)continue;let c=Pe(e,t,a.qualifiedName);i.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 o=s.namedChild(0);if(!o)continue;let a=Yc(o);if(a===null)continue;let c=Pe(e,t,a);for(let l=1;l<s.namedChildCount;l+=1){let u=s.namedChild(l);if(u.type==="wildcard_import"){i.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let p=Jr(u);p&&i.push({importedName:p.qualifiedName,localName:p.localName,sourcePath:c,kind:"named",used:r.has(p.localName),usedMembers:[]})}}return i}function Jr(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 Yc(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 Zc(e){let t=e.split(`
98
- `),n=[],r=0;for(let i=0;i<t.length;i++){let s=t[i],o=s.trimStart(),a=r;if(r+=s.length+1,!o.startsWith("import ")&&!o.startsWith("from "))continue;let c=s,l=a+s.length,u=pn(s);for(;i+1<t.length&&(u>0||c.trimEnd().endsWith("\\"));){i++;let d=t[i];c+=`
99
- ${d}`,l+=1+d.length,u+=pn(d),r+=d.length+1}let p=el(c);p&&n.push({...p,start:a,end:l})}return n}function el(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 tl(e,t,n,r){let i=le(r,n.start,n.end),s=n.clause.replace(/\n/g," ").trim();if(n.kind==="import")return I(s).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[u,p]=l.split(/\s+as\s+/),d=u.trim(),m=(p??d.split(".")[0]??d).trim(),h=Pe(e,t,d),V=we(i,m);return[{importedName:d,localName:m,sourcePath:h,kind:"namespace",used:T(i,m)||V.length>0,usedMembers:V}]});let o=n.module?Pe(e,t,n.module):null,a=[];for(let c of I(s)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:o,kind:"side-effect",used:!0,usedMembers:[]});continue}let[u,p]=l.split(/\s+as\s+/),d=(p??u).trim();a.push({importedName:u.trim(),localName:d,sourcePath:o,kind:"named",used:T(i,d),usedMembers:[]})}return a}import{basename as nl}from"path";function Gr(e,t,n){return j(e,t,r=>il(e,t,r),()=>rl(e,t,n),n)}function rl(e,t,n){return A(n,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(r,i)=>{let s=r[1],o=r[2];if(!s||!o)return[];let a=s==="require_relative"?mt(e,t,o):null;if(a){let c=Yr(o);return[ne(c,c,a,T(i,c))]}return[be(o,a)]})}function il(e,t,n){let r=x(n,new Set([])),i=[],s=new Set(["require","require_relative","load"]);for(let o of n.rootNode.descendantsOfType("call")){let a=o.namedChild(0);if(!a||a.type!=="identifier"||!s.has(a.text))continue;let l=o.namedChildren.find(m=>m.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let p=l.namedChildren.find(m=>m.type==="string_content")?.text;if(!p)continue;let d=a.text==="require_relative"?mt(e,t,p):null;if(d){let m=Yr(p);i.push(y(m,m,d,r))}else i.push(be(p,d))}return i}function Yr(e){return ot(nl(e).replace(/\.[^.]+$/,""),/_/)}function Zr(e,t,n){return j(e,t,r=>sl(e,t,r),()=>A(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,i)=>{let s=r[1]?.trim();return s?ol(e,t,s,i):[]}),n)}function sl(e,t,n){let r=x(n,new Set(["use_declaration"])),i=[];for(let s of n.rootNode.descendantsOfType("use_declaration")){let o=s.namedChild(0);if(o)for(let a of Xe(o,"")){if(!a.importedName||a.importedName==="*")continue;let c=Z(e,t,a.qualifiedName)??Z(e,t,a.qualifiedName.split("::").slice(0,-1).join("::"));i.push(y(a.importedName,a.localName,c,r))}}return i}function Xe(e,t){switch(e.type){case"identifier":case"super":case"crate":{let n=e.text;return[{qualifiedName:vt(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:vt(t,n),importedName:r,localName:r}]}case"scoped_use_list":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=vt(t,n.text),s=[];for(let o of r.namedChildren)s.push(...Xe(o,i));return s}case"use_list":{let n=[];for(let r of e.namedChildren)n.push(...Xe(r,t));return n}case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=Xe(n,t),s=r.text;return i.map(o=>({...o,localName:s}))}case"use_wildcard":{let n=e.namedChild(0),r=n?n.text:"";return[{qualifiedName:vt(t,`${r}::*`),importedName:"*",localName:"*"}]}default:return[]}}function vt(e,t){return e?t?`${e}::${t}`:e:t}function ol(e,t,n,r){let i=n.trim();if(i.includes("{")&&i.includes("}")){let u=i.slice(0,i.indexOf("{")).replace(/::$/,"").trim(),p=i.slice(i.indexOf("{")+1,i.lastIndexOf("}")).trim();return I(p).flatMap(d=>{let m=d.trim();if(!m)return[];if(m==="self"){let E=u.split("::").filter(Boolean).pop();return E?[B(e,t,r,u,E,E)]:[]}let[h,V]=m.split(/\s+as\s+/),g=h?.trim();if(!g)return[];let M=(V??g.split("::").pop()??g).trim(),pe=`${u}::${g}`.replace(/::::/g,"::");return[B(e,t,r,pe,g.split("::").pop()??g,M,Z(e,t,u))]})}let[s,o]=i.split(/\s+as\s+/),a=s?.trim()??i,c=(o??a.split("::").pop()??a).trim(),l=Z(e,t,a)??Z(e,t,a.split("::").slice(0,-1).join("::"));return[B(e,t,r,a,a.split("::").pop()??a,c,l)]}function ei(e,t,n){let r=$(e,t);if(r)return al(e,t,r);let i=[];for(let s of n.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let o=s[1]?.trim();o&&i.push(...ll(e,t,o))}return i}function al(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("use_declaration")){if(!cl(i))continue;let s=i.namedChildren.find(o=>o.type!=="visibility_modifier");if(s)for(let o of Xe(s,""))o.importedName&&r.push(xn(e,t,o.qualifiedName))}return r}function cl(e){for(let t of e.children)if(t.type==="visibility_modifier"&&t.text.startsWith("pub"))return!0;return!1}function ll(e,t,n){let r=n.trim();if(r.includes("{")&&r.includes("}")){let i=r.slice(0,r.indexOf("{")).replace(/::$/,"").trim(),s=r.slice(r.indexOf("{")+1,r.lastIndexOf("}")).trim();return I(s).flatMap(o=>{let a=o.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${i}::${c?.trim()??a}`.replace(/::::/g,"::");return[xn(e,t,l)]})}return[xn(e,t,r)]}function xn(e,t,n){return{specifier:n,sourcePath:Z(e,t,n)??Z(e,t,n.split("::").slice(0,-1).join("::"))}}function ue({language:e,extensions:t,imports:n,parseImports:r}){return{language:e,extensions:t,capabilities:{imports:n},parseImports:r}}function ti(e,t){let n=t.toLowerCase();for(let r of e)for(let i of r.extensions)if(n.endsWith(i))return r;return null}var ul={language:"javascript",extensions:ye,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:yn,parseReExports:Sn},pl=ue({language:"python",extensions:ct,imports:"ast-with-regex-fallback",parseImports:Qr}),dl=ue({language:"jvm",extensions:k,imports:"ast-dispatch-with-regex-fallback",parseImports:qr}),ml={language:"rust",extensions:lt,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Zr,parseExports:ei},fl=ue({language:"ruby",extensions:ut,imports:"ast-with-regex-fallback",parseImports:Gr}),gl=ue({language:"c/cpp",extensions:pt,imports:"ast-with-regex-fallback",parseImports:Mr}),hl=ue({language:"dotnet",extensions:ae,imports:"ast-dispatch-with-regex-fallback",parseImports:Wr}),yl={language:"dart",extensions:dt,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:Vr,parseExports:Ur},Sl=ue({language:"php",extensions:xe,imports:"ast-with-regex-fallback",parseImports:Xr}),xl=ue({language:"clojure",extensions:Re,imports:"regex-only",parseImports:Br}),ni=[ul,pl,dl,ml,fl,gl,hl,yl,Sl,xl];function _t(e){return ti(ni,e)}function af(e){return ni.find(n=>n.language===e)?.capabilities??null}var bn={clearGroups:["whole-project","source-file"]},bl=b("source-imports",bn),Nl=b("source-exports",bn),El=b("source-reexports",bn),ri=X({kind:"source-imports",invalidation:J("source-imports"),serialize:vl,deserialize:_l}),ii=X({kind:"source-reexports",invalidation:J("source-reexports"),serialize:Cl,deserialize:Tl});function si(e,t){let n=v(t);return El.get(e,n,()=>{let r=_t(n);if(!r?.parseReExports)return[];let i=f(e,n);if(!i)return[];let s=U(e,n,i),o=sn(e),a=ii.read(e,n,s);if(a?.resolutionFingerprint===o)return a.reExports;let c=r.parseReExports(e,n,i);return ii.write(e,n,s,{resolutionFingerprint:o,reExports:c}),c})}function oi(e,t){let n=v(t);return bl.get(e,n,()=>{let r=_t(n);if(!r)return[];let i=f(e,n);if(!i)return[];let s=U(e,n,i),o=sn(e),a=ri.read(e,n,s);if(a?.resolutionFingerprint===o)return a.imports;let c=r.parseImports(e,n,i);return ri.write(e,n,s,{resolutionFingerprint:o,imports:c}),c})}function hf(e,t){let n=v(t);return Nl.get(e,n,()=>{let r=_t(n);if(!r?.parseExports)return[];let i=f(e,n);return i?r.parseExports(e,n,i):[]})}function vl(e){return JSON.stringify(e)}function _l(e){try{let t=JSON.parse(e);return!ie(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.imports)?null:{resolutionFingerprint:t.resolutionFingerprint,imports:t.imports}}catch{return null}}function Cl(e){return JSON.stringify(e)}function Tl(e){try{let t=JSON.parse(e);return!ie(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.reExports)?null:{resolutionFingerprint:t.resolutionFingerprint,reExports:t.reExports}}catch{return null}}function Ct(e){return{forFile(t,n){return ai(e,t,n)},forFiles(t,n){let r=new Map;for(let i of t)r.set(i,ai(e,i,n));return r}}}function ai(e,t,n){let r={file:t},i=n.facts||n.identifiers;if(n.text&&(r.text=f(e,t)),n.lines&&(r.lines=Me(e,t)),n.ast&&(r.ast=$(e,t)),n.imports&&(r.imports=oi(e,t)),n.reexports&&(r.reexports=si(e,t)),i){let s=zt(e,t),o=s.facts;n.facts&&(r.facts=o),s.unavailable&&(r.sourceFactsUnavailable=s.unavailable),n.identifiers&&o&&(r.identifiers=o.fileIdentifiers,r.identifierLineMap=o.identifierLineMap)}return r}function vf(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
100
- FROM global_symbols gs
101
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
102
- JOIN documents d ON der.document_id = d.id
103
- WHERE ${t.where}
104
- ${e.pathExclusionsFor("d")}
105
- ${li(t.orderBy)}
106
- ${ui(t.limit)}`,...t.params??[])}function _f(e,t){return e.all(`SELECT
107
- gs.id,
108
- gs.symbol,
109
- c.document_id,
110
- MIN(c.start_line) AS start_line,
111
- 0 AS start_char,
112
- MAX(c.end_line) AS end_line,
113
- 0 AS end_char,
114
- d.relative_path,
115
- gs.display_name,
116
- gs.documentation
117
- FROM global_symbols gs
118
- JOIN mentions m ON m.symbol_id = gs.id
119
- JOIN chunks c ON m.chunk_id = c.id
120
- JOIN documents d ON c.document_id = d.id
121
- WHERE m.role = 1
122
- AND ${t.where}
123
- ${e.pathExclusionsFor("d")}
124
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
125
- ${li(t.orderBy)}
126
- ${ui(t.limit)}`,...t.params??[])}function li(e){return e?`ORDER BY ${e}`:""}function ui(e){return typeof e=="number"?`LIMIT ${e}`:""}function pi(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 di(e){if(!e)return null;let t=ci(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(ci(r)??r).replace(/\n/g," ")}function ci(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function Il(e,t={}){if(de(e.symbol)!==null)return t.includeClassMemberFallbacks===!0;let i=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(i)}function Nn(e,t,n={}){let r=new Map;for(let s of t)e.length>0&&!Il(s,{includeClassMemberFallbacks:n.includeClassMemberFallbacks})||r.set(s.id,s);for(let s of e)r.set(s.id,s);let i=[...r.values()];return n.sort?i.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):i}function $f(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 Fl=b("file-definitions",{clearGroups:["definition-catalog"]}),Ll=Ee("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),kl=b("file-function-like-definitions",{clearGroups:["definition-catalog"]}),mi=new WeakMap;function vn(e,t,n={}){return n.includeClassMemberFallbacks?En(e,t,void 0,{includeClassMemberFallbacks:!0}):Fl.get(e,t,()=>{let r=yi(e,t);if(r)return r;let i=En(e,t),s=Oe(e),o=Ct(e).forFile(t,{text:!0}).text;return s&&o&&hi.write(e,t,U(e,t,o),{projectFingerprint:s,definitions:i.map(a=>({...a}))}),i})}function Rl(e,t){return kl.get(e,t,()=>{let n=yi(e,t);return n?n.filter(r=>r.isFunctionLike):En(e,t,r=>r.isFunctionLike)})}var hi=X({kind:"file-definitions",invalidation:J("file-definitions"),serialize:Pl,deserialize:Dl});function yi(e,t){let n=Oe(e);if(!n)return null;let r=Ct(e).forFile(t,{text:!0}).text;if(!r)return null;let i=hi.read(e,t,U(e,t,r));return i?wl(i,n,t):null}function Pl(e){return JSON.stringify(e)}function Dl(e){try{let t=JSON.parse(e);return!ie(t)||typeof t.projectFingerprint!="string"||!Array.isArray(t.definitions)?null:{projectFingerprint:t.projectFingerprint,definitions:t.definitions}}catch{return null}}function wl(e,t,n){if(e.projectFingerprint!==t)return null;let r=[];for(let i of e.definitions){let s=Al(i,n);if(!s)return null;r.push(s)}return r}function Al(e,t){return!ie(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 En(e,t,n,r={}){let i=Nn(jl(e,t),Ol(e,t),{sort:!0,includeClassMemberFallbacks:r.includeClassMemberFallbacks}).map(Si);return n&&(i=i.filter(n)),bi(e,t,i)}function jl(e,t){return e.all(`SELECT
127
- gs.id,
128
- gs.symbol,
129
- der.document_id,
130
- der.start_line,
131
- der.start_char,
132
- der.end_line,
133
- der.end_char,
134
- d.relative_path,
135
- gs.display_name,
136
- gs.kind,
137
- gs.documentation,
138
- gs.enclosing_symbol
139
- FROM global_symbols gs
140
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
141
- JOIN documents d ON der.document_id = d.id
142
- WHERE d.relative_path = ?
143
- ${e.symbolNoiseFor("gs")}
144
- ORDER BY der.start_line, der.end_line`,t)}function Ol(e,t){return e.all(`SELECT
145
- gs.id,
146
- gs.symbol,
147
- c.document_id,
148
- MIN(c.start_line) AS start_line,
149
- 0 AS start_char,
150
- MAX(c.end_line) AS end_line,
151
- 0 AS end_char,
152
- d.relative_path,
153
- gs.display_name,
154
- gs.kind,
155
- gs.documentation,
156
- gs.enclosing_symbol
157
- FROM global_symbols gs
158
- JOIN mentions m ON m.symbol_id = gs.id
159
- JOIN chunks c ON m.chunk_id = c.id
160
- JOIN documents d ON c.document_id = d.id
161
- WHERE d.relative_path = ?
162
- AND m.role = 1
163
- ${e.symbolNoiseFor("gs")}
164
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
165
- ORDER BY start_line, end_line`,t)}function Si(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:Rn(e.symbol),parentTypeName:de(e.symbol),isFunctionLike:Pn(e.symbol),isTypeLike:Ye(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function Bf(e,t={}){return Ml(e,t.scope)}function Ml(e,t){return je(e,{scope:t,includeIgnored:!1}).flatMap(n=>vn(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function Vf(e,t){return je(e,{scope:t,includeIgnored:!1}).flatMap(n=>Rl(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function Uf(e,t){let n=Ll.get(e,()=>new WeakMap),r=n.get(t.symbolMatches);r||(r=new Map,n.set(t.symbolMatches,r));let i=JSON.stringify({scope:t.scope??null,sqlPrefilter:t.sqlPrefilter??null}),s=r.get(i);if(s)return[...s];let o=fi($l(e,t.scope,t.sqlPrefilter)),a=fi(Bl(e,t.scope,t.sqlPrefilter)),c=new Set([...o.keys(),...a.keys()]),l=[];for(let u of[...c].sort()){if(e.isIgnored(u))continue;let p=Nn(o.get(u)??[],a.get(u)??[],{sort:!0}).filter(d=>t.symbolMatches(d.symbol));p.length!==0&&l.push(...bi(e,u,p.map(Si)))}return r.set(i,l),[...l]}function $l(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${xi("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
166
- gs.id,
167
- gs.symbol,
168
- der.document_id,
169
- der.start_line,
170
- der.start_char,
171
- der.end_line,
172
- der.end_char,
173
- d.relative_path,
174
- gs.display_name,
175
- gs.kind,
176
- gs.documentation,
177
- gs.enclosing_symbol
178
- FROM global_symbols gs
179
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
180
- JOIN documents d ON der.document_id = d.id
181
- WHERE 1 = 1
182
- ${e.pathExclusionsFor("d")}
183
- ${r}
184
- ${i}
185
- ${e.symbolNoiseFor("gs")}
186
- ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function Bl(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${xi("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
187
- gs.id,
188
- gs.symbol,
189
- c.document_id,
190
- MIN(c.start_line) AS start_line,
191
- 0 AS start_char,
192
- MAX(c.end_line) AS end_line,
193
- 0 AS end_char,
194
- d.relative_path,
195
- gs.display_name,
196
- gs.kind,
197
- gs.documentation,
198
- gs.enclosing_symbol
199
- FROM global_symbols gs
200
- JOIN mentions m ON m.symbol_id = gs.id
201
- JOIN chunks c ON m.chunk_id = c.id
202
- JOIN documents d ON c.document_id = d.id
203
- WHERE m.role = 1
204
- AND NOT EXISTS (
205
- SELECT 1
206
- FROM defn_enclosing_ranges existing_der
207
- WHERE existing_der.symbol_id = gs.id
208
- )
209
- ${e.pathExclusionsFor("d")}
210
- ${r}
211
- ${i}
212
- ${e.symbolNoiseFor("gs")}
213
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
214
- ORDER BY d.relative_path, start_line, end_line`,...s)}function Vl(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function xi(e,t){return t==="callable"?Vl(e):Ul(e)}function Ul(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function fi(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 Wf(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(i=>vn(e,i)).filter(i=>!e.isIgnored(i.relativePath));return n.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),n.sort&&(r=r.sort((i,s)=>i.relativePath.localeCompare(s.relativePath)||i.startLine-s.startLine||i.endLine-s.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:kn(i.symbol),signature:pi(di(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function Wl(e){let t=new Map,n=e.map((r,i)=>({definition:r,index:i,span:r.endLine-r.startLine})).sort((r,i)=>r.span-i.span||r.index-i.index);for(let{definition:r}of n)for(let i=r.startLine;i<=r.endLine;i+=1)t.has(i)||t.set(i,r);return t}function zf(e,t){let n=mi.get(e);return n||(n=Wl(e),mi.set(e,n)),n.get(t)??null}function Hf(e,t){let n=vn(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 bi(e,t,n){let r=Ct(e).forFile(t,{text:!0}).text,i=Ht(e,t);return i?Jl(n,i,r):r?zl(n,r):n}function zl(e,t){let n=t.split(/\r?\n/),r=Hl(e,n),i=ql(e,r),s=Kl(i,n);return Xl(e,s)}function Hl(e,t){let n=e.some(i=>Tt(i.symbol))?nu(t):null,r=new Map;for(let i of e)r.set(i.symbolId,tu(t,n,i));return r}function ql(e,t){return e.filter(n=>Tt(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 Kl(e,t){let n=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],s=e[r+1],o=s?Math.max(i.startLine,s.startLine-1):t.length-1;n.set(i.definition.symbolId,{startLine:i.startLine,endLine:ru(t,i.definition,i.startLine,o)})}return n}function Xl(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function Jl(e,t,n=null){let r=new Map;for(let i of t){let s=r.get(i.name);s?s.push(i):r.set(i.name,[i])}return e.map(i=>{if(!eu(i)||!i.leaf)return gi(i,n);let s=r.get(i.leaf);if(!s||s.length===0)return gi(i,n);let o=n?Ql(i,s,n):null;if(o)return{...i,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-i.startLine);for(let l=1;l<s.length;l+=1){let u=s[l],p=Math.abs(u.startLine-i.startLine);p<c&&(a=u,c=p)}return{...i,startLine:a.startLine,endLine:a.endLine}})}function Ql(e,t,n){let r=Gl(e.symbol);if(!r)return null;let i=n.split(/\r?\n/),s=new RegExp(`\\b${H(r)}\\b`);for(let o of t){let a=Yl(i,o.startLine);if(a&&s.test(a))return o}return null}function Gl(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Yl(e,t){for(let n=t;n>=0;n-=1){let r=e[n]?.trim()??"";if(r){if(/^impl\b/.test(r))return Zl(e,n,t);if(/^(?:struct|enum|trait|mod)\b/.test(r))return null}}return null}function Zl(e,t,n){let r=[];for(let i=t;i<=n;i+=1){let s=e[i]??"";if(r.push(s),s.includes("{"))break}return r.join(" ")}function eu(e){return Tt(e.symbol)?!0:Ye(e.symbol)==="term"&&de(e.symbol)===null}function gi(e,t){if(!t||!e.leaf||Ye(e.symbol)!=="term"||de(e.symbol)!==null)return e;let n=H(e.leaf),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),s=t.split(/\r?\n/).findIndex(o=>r.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function tu(e,t,n){if(!Tt(n.symbol))return n.startLine;let r=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return r;let i=t.get(n.leaf);if(!i||i.length===0)return r;let s=null;for(let o of i){let a=Math.abs(o-n.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??r}function nu(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*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let u of c.matchAll(t))u[1]&&o(u[1],a);for(let u of c.matchAll(n))u[1]&&o(u[1],a);let l=c.match(r);l?.[1]&&o(l[1],a);for(let u of c.matchAll(i))u[1]&&o(u[1],a)}return s}function ru(e,t,n,r){let i=Math.max(n,Math.min(e.length-1,r)),s=Math.max(n,Math.min(i,t.endLine)),o=0,a=0,c=!1;for(let l=n;l<=i;l+=1){let u=iu(e[l]??"");for(let p of u)p==="{"?(o+=1,c=!0):p==="}"?o=Math.max(0,o-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function iu(e){let t="",n=null,r=!1;for(let i=0;i<e.length;i+=1){let s=e[i],o=e[i+1];if(!n&&s==="/"&&o==="/"){t+=" ".repeat(e.length-i);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 Tt(e){return e.includes("().")}function qf(e){let t=Ln(e);if("kind"in t)return[];let n=[];for(let r=t.descriptors.length-2;r>=0;r-=1){let i=t.descriptors[r];i?.suffix==="type"&&i.name&&n.push(i.name)}return n}var su=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function Jf(e){let t=e.toLowerCase();return su.some(n=>t.endsWith(n))}import{createRequire as ou}from"module";var Ni=ou(import.meta.url),Je,It;function au(){if(Je!==void 0)return Je;try{Je=Ni("ts-morph")}catch{Je=null}return Je}function Yf(){if(It)return It;let e=au();if(!e)return"ts-morph:unavailable";let t="unknown";try{t=Ni("ts-morph/package.json").version??"unknown"}catch{}return It=`ts-morph:${t}:typescript:${e.ts.version}`,It}function Zf(e,t){return t.map(n=>({tsconfigPath:n,project:new e.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function eg(e,t,n){return{language:"typescript",availability:()=>({available:!1,reason:e,tsconfigPath:t,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function ng(e,t){let n=new Map(e.map(i=>[i.symbol,i])),r=new Map(e.map(i=>[i.symbolId,[]]));for(let i of t.values())for(let s of i){let o=n.get(s.targetSymbol);o&&r.get(o.symbolId).push(s.location)}for(let[i,s]of r)r.set(i,cu(s));return r}function rg(e,t,n){let r=vi(e,t),i=vi(e,n),s=[...r].filter(p=>!i.has(p)).sort(),o=[...i].filter(p=>!r.has(p)).sort(),a=Ei(e,t),c=Ei(e,n),l=[...a].filter(p=>!c.has(p)).sort(),u=[...c].filter(p=>!a.has(p)).sort();return{passed:s.length===0&&o.length===0,expectedCount:r.size,actualCount:i.size,missing:s,extra:o,callerFiles:{passed:l.length===0&&u.length===0,expectedCount:a.size,actualCount:c.size,missing:l,extra:u}}}function Ei(e,t){let n=new Set;for(let r of e)for(let i of t.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function ig(e,t,n){let r=new Set(n),i=new Map(n.map(s=>[s,[]]));for(let s of e)for(let o of t.get(s.symbolId)??[])r.has(o.file)&&i.get(o.file).push({targetSymbol:s.symbol,location:o});for(let[s,o]of i)i.set(s,lu(o));return i}function vi(e,t){let n=new Set;for(let r of e)for(let i of t.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function cu(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(_i)}function lu(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)||_i(n.location,r.location))}function _i(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.column-t.column}export{Ze as a,U as b,Oe as c,yu as d,Su as e,xu as f,bu as g,Nu as h,X as i,Iu as j,J as k,fr as l,lo as m,Re as n,z as o,f as p,Me as q,Wi as r,Ru as s,Pu as t,H as u,Za as v,Bd as w,Vd as x,pn as y,W as z,oe as A,Ou as B,Mu as C,$ as D,ge as E,Q as F,Ps as G,Ds as H,Ht as I,js as J,Os as K,_d as L,Ya as M,vt as N,af as O,si as P,oi as Q,hf as R,su as S,Jf as T,au as U,Yf as V,Zf as W,eg as X,ng as Y,rg as Z,ig as _,Ct as $,vf as aa,_f as ba,pi as ca,di as da,Nn as ea,$f as fa,vn as ga,Bf as ha,Ml as ia,Vf as ja,Uf as ka,Wf as la,Wl as ma,zf as na,Hf as oa,qf as pa};
215
- //# sourceMappingURL=chunk-RU65DDUP.js.map
@@ -1,2 +0,0 @@
1
- import{k as x}from"./chunk-6CS3UQTN.js";import{a as y,e as b}from"./chunk-FETNQCFO.js";import{z as v}from"./chunk-ADTBPVUZ.js";import{e as g,j as D,k as F,r as E,t as I}from"./chunk-BMYOV5GP.js";import{a as _,d as p}from"./chunk-3LCDIREB.js";import{spawnSync as P}from"child_process";import{createHash as U}from"crypto";import{existsSync as k}from"fs";import{dirname as L,join as T}from"path";import{fileURLToPath as j}from"url";var R=g("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]}),M=E({kind:"consumer-file-usage",invalidation:I("consumer-file-usage"),serialize:Q,deserialize:W});function Le(e,n){return{forDefinitions(r,i){return B(e,n,r,i)}}}function Me(e){let n=new Map;for(let[r,i]of e)n.set(r,new Set(i.files.map(t=>t.file)));return n}function Ne(e,n,r){return w(e,n,r).partition}function B(e,n,r,i){let t=h(r.length),s=_()?F(e):null,a=s?V(r,i,s):void 0,o=a?{workIdentity:a,workOutcome:"computed"}:{};return p("consumer-evidence.product",()=>{let l=p("consumer-evidence.provenance",()=>z(e,n,r,i),()=>({...o,definitions:r.length,semantic:i.semantic,sourceFallback:i.sourceFallback!==!1})),u=new Map;t={...t,...l.counters};let c=q(r,l.sources);return p("consumer-evidence.classify",()=>{let f=Y(e,r,l.sources,c);for(let d of r){let m=f.get(d.symbolId)??$();t.realFiles+=m.partition.realConsumers.length,t.reexportOnlyFiles+=m.partition.barrelConsumers,t.importOnlyFiles+=m.partition.importOnlyConsumers,u.set(d.symbolId,{definition:d,files:m.files,semanticIncomplete:l.incompleteSymbolIds.has(d.symbolId),semanticUnavailable:l.unavailableSymbolIds.has(d.symbolId),...m.partition})}},()=>({...o,...c,realFiles:t.realFiles,reexportOnlyFiles:t.reexportOnlyFiles,importOnlyFiles:t.importOnlyFiles})),u},()=>({...o,...t}))}function V(e,n,r){let i=U("sha256").update("consumer-evidence-v3-calibrated-semantic\0").update(r).update("\0").update(n.semantic?"semantic\0":"indexed\0").update(n.sourceFallback===!1?"no-source-fallback":"source-fallback");for(let t of e.map(s=>s.symbol).sort())i.update("\0").update(t);return i.digest("hex").slice(0,24)}function h(e){return{definitions:e,indexedFiles:0,semanticFiles:0,fallbackFiles:0,totalFiles:0,realFiles:0,reexportOnlyFiles:0,importOnlyFiles:0}}function z(e,n,r,i){let t=h(r.length),s=new Map,a=new Set,o=new Set;if(S(s,t,"indexed",n.crossFileCallerMap(r,{semantic:!1})),i.semantic){let l=x(e,r);S(s,t,"semantic",l.callers);for(let u of l.incompleteSymbolIds)a.add(u);for(let u of l.unavailableSymbolIds)o.add(u)}return i.sourceFallback!==!1&&S(s,t,"source-fallback",n.sourceFallbackCallerFiles(r)),t.totalFiles=[...s.values()].reduce((l,u)=>l+u.size,0),{sources:s,counters:t,incompleteSymbolIds:a,unavailableSymbolIds:o}}function q(e,n){return{definitions:e.length,consumerFiles:[...n.values()].reduce((r,i)=>r+i.size,0),nativeAttempted:!1,nativeUsed:!1,nativeReason:"not-attempted"}}function S(e,n,r,i){let t=0;for(let[s,a]of i){let o=e.get(s);o||(o=new Map,e.set(s,o));for(let l of a){t++;let u=o.get(l)??new Set;u.add(r),o.set(l,u)}}r==="indexed"?n.indexedFiles+=t:r==="semantic"?n.semanticFiles+=t:n.fallbackFiles+=t}function Y(e,n,r,i){let t=re(e,n,r,i);return t||H(e,n,r)}function H(e,n,r){let i=new Map;for(let t of n){let s=r.get(t.symbolId)??new Map;i.set(t.symbolId,w(e,t,[...s.keys()],s))}return i}function w(e,n,r,i=new Map){let t=[],s=0,a=0,o=b(n.symbol),l=[];for(let u of r){let c;X(e,u,n.relativePath,o)?(s++,c="reexport-only"):J(e,u,o)?(a++,c="import-only"):(t.push(u),c="real"),l.push({file:u,sources:[...i.get(u)??[]],classification:c})}return{partition:{realConsumers:t,barrelConsumers:s,importOnlyConsumers:a},files:l}}function $(){return{partition:{realConsumers:[],barrelConsumers:0,importOnlyConsumers:0},files:[]}}function J(e,n,r){if(!r)return!1;let i=v(n);if(!i)return!1;let t=R.get(e,n,()=>A(e,n,i));return t.importedLeaves.has(r)&&!t.usedLeaves.has(r)}function A(e,n,r){let i=y(e).forFile(n,{text:!0,ast:!0}),t=i.text;if(!t)return G();let s=D(e,n,t),a=M.read(e,n,s);if(a)return a;let o=K(i.ast,r);return M.write(e,n,s,o),o}function K(e,n){let r=new Set,i=new Set;if(!e)return{importedLeaves:r,usedLeaves:i};let t=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),s=(a,o)=>{let l=o||t.has(a.type);(a.type==="identifier"||a.type==="type_identifier"||a.type==="property_identifier"||a.type==="field_identifier")&&(l?r.add(a.text):i.add(a.text));for(let u of a.children)s(u,l)};return s(e.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function G(){return{importedLeaves:new Set,usedLeaves:new Set}}function Q(e){return JSON.stringify({importedLeaves:[...e.importedLeaves],usedLeaves:[...e.usedLeaves]})}function W(e){try{let n=JSON.parse(e);return!Array.isArray(n.importedLeaves)||!Array.isArray(n.usedLeaves)?null:{importedLeaves:new Set(n.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(n.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function X(e,n,r,i){if(!i)return!1;let t=y(e).forFile(n,{lines:!0,reexports:!0}),s=t.lines??[];if(s.length===0)return!1;let a=t.reexports??[];return O(s,a,i)}function O(e,n,r){if(e.length===0||n.length===0)return!1;let i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`\\b${i}\\b`),s=0;for(let a=0;a<e.length;a++){if(!t.test(e[a]??""))continue;if(s++,!n.find(l=>l.startLine<=a&&a<=l.endLine))return!1}return s>0}var Z="CODEBASEIQ_NATIVE_CONSUMER_CLASSIFY",ee="CODEBASEIQ_NATIVE_KERNELS_BIN",ne="CODEBASEIQ_NATIVE_CONSUMER_CLASSIFY_MIN_FILES",N=1e3,ie=5e3,te=64*1024*1024,C;function re(e,n,r,i){let t=process.env[Z]?.toLowerCase();if(t!=="1"&&t!=="true")return i.nativeReason=t==="0"||t==="false"?"disabled":"opt-in-required",null;if(i.consumerFiles<fe())return i.nativeReason="below-threshold",null;let s=me();if(!s)return i.nativeReason="binary-missing",null;i.nativeAttempted=!0;let a=se(e,n,r),o=P(s,["consumer-classify"],{input:JSON.stringify(a),encoding:"utf8",timeout:ie,maxBuffer:te,windowsHide:!0});if(o.status!==0||o.error)return i.nativeReason=o.error?`spawn-error:${o.error.message}`:`exit-${o.status??"null"}`,null;try{let l=JSON.parse(o.stdout),u=ae(l,n);return u?(i.nativeUsed=!0,i.nativeReason="used",u):(i.nativeReason="invalid-response",null)}catch{return i.nativeReason="invalid-json",null}}function se(e,n,r){let i=new Map,t=[];for(let o of n){let l=b(o.symbol),c=[...(r.get(o.symbolId)??new Map).entries()].map(([f,d])=>{let m=i.get(f)??new Set;return l&&m.add(l),i.set(f,m),{file:f,sources:[...d]}});t.push({symbol_id:o.symbolId,leaf:l,consumer_files:c})}let s={},a={};for(let[o,l]of i){let u=v(o);if(u){let f=R.get(e,o,()=>A(e,o,u));s[o]={imported_leaves:[...f.importedLeaves],used_leaves:[...f.usedLeaves]}}let c=oe(e,o,l);c.length>0&&(a[o]=c)}return{definitions:t,file_usages:s,reexport_only_leaves:a}}function oe(e,n,r){if(r.size===0)return[];let i=y(e).forFile(n,{lines:!0,reexports:!0}),t=i.lines??[],s=i.reexports??[];return t.length===0||s.length===0?[]:[...r].filter(a=>O(t,s,a))}function ae(e,n){if(!Array.isArray(e.entries)||e.entries.length!==n.length)return null;let r=new Set(n.map(t=>t.symbolId)),i=new Map;for(let t of e.entries){let s=le(t);if(!s||!r.has(s.symbol_id))return null;i.set(s.symbol_id,{partition:{realConsumers:s.real_consumers,barrelConsumers:s.barrel_consumers,importOnlyConsumers:s.import_only_consumers},files:s.files})}for(let t of r)if(!i.has(t))return null;return i}function le(e){if(!e||typeof e!="object")return null;let n=e;if(typeof n.symbol_id!="number"||!Array.isArray(n.real_consumers)||typeof n.barrel_consumers!="number"||typeof n.import_only_consumers!="number"||!Array.isArray(n.files)||!n.real_consumers.every(i=>typeof i=="string"))return null;let r=[];for(let i of n.files){if(!i||typeof i!="object")return null;let t=i;if(typeof t.file!="string"||!Array.isArray(t.sources)||!t.sources.every(ue)||!ce(t.classification))return null;r.push({file:t.file,sources:t.sources,classification:t.classification})}return{symbol_id:n.symbol_id,real_consumers:n.real_consumers,barrel_consumers:n.barrel_consumers,import_only_consumers:n.import_only_consumers,files:r}}function ue(e){return e==="indexed"||e==="semantic"||e==="source-fallback"}function ce(e){return e==="real"||e==="reexport-only"||e==="import-only"}function fe(){let e=process.env[ne];if(!e)return N;let n=Number(e);return Number.isFinite(n)&&n>=0?n:N}function me(){if(C!==void 0)return C;let e=process.env[ee],n=process.platform==="win32"?"codebaseiq-kernels.exe":"codebaseiq-kernels";return C=[...e?[e]:[],...de().map(i=>T(i,"target","release",n))].find(i=>k(i))??null,C}function de(){let e=new Set,n=L(j(import.meta.url));for(let r=0;r<5;r++)e.add(n),n=L(n);return[...e]}export{Le as a,Me as b,Ne as c,J as d};
2
- //# sourceMappingURL=chunk-SELM5MER.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{spawnSync as F}from"child_process";import{createHash as W}from"crypto";import{existsSync as N,lstatSync as M,realpathSync as j}from"fs";import{dirname as $,isAbsolute as z,join as U,resolve as g}from"path";var p={run(t,e){let r=I(t,e);return r.kind==="success"?r.output:void 0},runResult:I},K=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],y=/^[0-9a-f]{40,64}$/;function be(t,e,r=p){if(!e||e.startsWith("-")||/[\0\r\n]/.test(e))throw new Error(`Invalid Git revision ${JSON.stringify(e)}.`);let n=r.runResult(t,["rev-parse","--verify","--end-of-options",`${e}^{commit}`]);if(n.kind!=="success"||!y.test(n.output))throw new Error(`Git revision ${JSON.stringify(e)} does not resolve to exactly one commit.`);return n.output}function Ce(t,e=p){let r=e.runResult(t,K);if(r.kind==="success"){let n=Y(r.output);if(n)return H(n,e)}return J(t,e)}function Y(t){let e=t.split(`
3
- `).map(c=>c.trim());if(e.length!==5)return;let[r,n,i,o,s]=e;if(!r||!n||!i||!o||!s||!y.test(o)||!y.test(s))return;let a=u(r);return{root:a,gitDir:u(f(a,n)),commonDir:u(f(a,i)),headCommit:o,treeOid:s}}function H(t,e){let r=e.run(t.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...T(t.root,t.gitDir),commonDir:t.commonDir,repositoryId:x("repository",t.commonDir),headCommit:t.headCommit,treeOid:t.treeOid,clean:r.length===0}}function J(t,e){let r=X(t,e);if(r.kind!=="worktree")return;let n=r.identity,i=n.projectRoot,o=e.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=u(f(i,o)),a=h(e.run(i,["rev-parse","--verify","HEAD"])),c=h(e.run(i,["rev-parse","--verify","HEAD^{tree}"])),l=e.run(i,["status","--porcelain=v1","-z","--untracked-files=all"]);if(l!==void 0)return{...n,commonDir:s,repositoryId:x("repository",s),headCommit:a,treeOid:c,clean:l.length===0}}function X(t,e=p){let r=e.runResult(t,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let i=u(n),o=e.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=u(f(i,o));return{kind:"worktree",identity:T(i,s)}}function T(t,e){return{projectRoot:t,gitDir:e,worktreeId:x("worktree",`${t}\0${e}`)}}function ke(t,e=p){let r=e.run(t,["worktree","list","--porcelain","-z"]);return r===void 0?[]:q(r)}function q(t){let e=[],r;for(let n of t.split("\0")){if(n===""){r&&e.push(r),r=void 0;continue}let i=n.indexOf(" "),o=i<0?n:n.slice(0,i),s=i<0?"":n.slice(i+1);if(o==="worktree"){r&&e.push(r),r={path:u(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}r&&(o==="HEAD"?r.head=s:o==="branch"?r.branch=s:o==="detached"?r.detached=!0:o==="bare"?r.bare=!0:o==="prunable"?r.prunable=!0:o==="locked"&&(r.locked=!0))}return r&&e.push(r),e}function Se(t,e,r=p){return h(r.run(t,e))}function f(t,e){return z(e)?e:g(t,e)}function u(t){try{return j(t)}catch{return g(t)}}function x(t,e){return W("sha256").update(`${t}\0${e}`).digest("hex").slice(0,24)}function h(t){return t?.trim()||void 0}function I(t,e){let r=F("git",["-C",t,...e],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let i=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&N(g(t)))&&!V(t)?{kind:"not-repository"}:{kind:"error",message:i}}function V(t){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let e=g(t);for(;;){try{return M(U(e,".git")),!0}catch(n){let i=n.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let r=$(e);if(r===e)return!1;e=r}}function Pe(t){try{return process.kill(t,0),!0}catch(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EPERM"}}import{closeSync as b,fstatSync as m,openSync as C,readFileSync as Q,readSync as E}from"fs";import{createHash as Z}from"crypto";var v=8*1024*1024,w=64*1024*1024,ee=512*1024*1024,te=256*1024*1024,d=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function A(t,e){P(e.maxBytes);let r=String(t),n=C(t,"r");try{let i=m(n);D(i,e,r);let o=Q(n),s=m(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new d(e.inputKind,r,"changed-during-read",s.size,e.maxBytes);return o}finally{b(n)}}function k(t,e,r="utf8"){return A(t,e).toString(r)}function re(t,e){return k(t,{maxBytes:v,inputKind:e})}function ne(t,e){return k(t,{maxBytes:w,inputKind:e})}function S(t,e){P(e.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=E(t,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>e.maxBytes)throw new d(e.inputKind,`file descriptor ${t}`,"too-large",i,e.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function ie(t,e,r="utf8"){return S(t,e).toString(r)}function B(t,e){let r=C(t,"r");try{return S(r,e)}finally{b(r)}}function R(t,e,r="utf8"){return B(t,e).toString(r)}function O(t,e,r){P(e.maxBytes);let n=String(t),i=C(t,"r");try{let o=m(i);D(o,e,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let l=E(i,s,0,Math.min(s.length,o.size-a),a);if(l===0)break;r(s.subarray(0,l)),a+=l}let c=m(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new d(e.inputKind,n,"changed-during-read",c.size,e.maxBytes);return a}finally{b(i)}}function oe(t,e){let r=Z("sha256");return O(t,e,n=>r.update(n)),r.digest("hex")}function D(t,e,r){if(!t.isFile())throw new d(e.inputKind,r,"not-regular",Number(t.size),e.maxBytes);if(t.size>e.maxBytes)throw new d(e.inputKind,r,"too-large",Number(t.size),e.maxBytes)}function P(t){if(!Number.isSafeInteger(t)||t<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${t}`)}var se=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function ae(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;return e.version!==1||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.platform!="string"||!se.has(e.platform)||typeof e.startToken!="string"||e.startToken.trim()===""?null:{version:1,pid:e.pid,platform:e.platform,startToken:e.startToken}}function ce(t,e){return t.version===e.version&&t.pid===e.pid&&t.platform===e.platform&&t.startToken===e.startToken}import{execFileSync as de}from"child_process";import{platform as ue}from"os";var G=new WeakMap,le=1e3,L=16*1024;function _e(t,e=ge){if(!Number.isSafeInteger(t)||t<=0)return null;if(t===process.pid){let r=G.get(e);if(r)return r}try{let r=pe(t,e);if(!r)return null;let n={version:1,pid:t,platform:e.platform,startToken:r};return t===process.pid&&G.set(e,n),n}catch{return null}}function pe(t,e){if(e.platform==="linux"||e.platform==="android")return fe(e.readFile(`/proc/${t}/stat`));if(e.platform==="win32"){let r=`([DateTimeOffset](Get-Process -Id ${t} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return _(e.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",r]))}return e.platform==="darwin"||e.platform==="freebsd"||e.platform==="openbsd"||e.platform==="netbsd"?_(e.run("ps",["-p",String(t),"-o","lstart="])):null}function fe(t){let e=t.lastIndexOf(")");if(e<0)return null;let n=t.slice(e+1).trim().split(/\s+/)[19];return n&&/^\d+$/.test(n)?n:null}function _(t){let e=t.trim();return e===""?null:e}var ge={platform:ue(),readFile(t){return R(t,{maxBytes:L,inputKind:"process identity pseudo-file"})},run(t,e){return de(t,[...e],{encoding:"utf8",timeout:le,maxBuffer:L,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0})}};var Ne=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"],Me=["entry-surface","generated-code","compatibility-shim","reflection-or-registration","test-fixture","intentional-twin","historical-coupling-ended","detector-counterexample"];function $e(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function ze(t){return typeof t=="string"&&Number.isFinite(Date.parse(t))}function Ue(t){return typeof t=="number"&&Number.isSafeInteger(t)&&t>=0}function Ke(t){return typeof t=="string"&&t.length>0&&t.length<=256&&!/[\0\r\n]/u.test(t)}function Ye(t){return typeof t=="number"&&Number.isFinite(t)&&t>=0}export{p as a,be as b,Ce as c,X as d,ke as e,Se as f,f as g,u as h,Pe as i,v as j,w as k,ee as l,te as m,d as n,A as o,k as p,re as q,ne as r,ie as s,O as t,oe as u,ae as v,ce as w,_e as x,Ne as y,Me as z,$e as A,ze as B,Ue as C,Ke as D,Ye as E};
4
- //# sourceMappingURL=chunk-SNNWPCN7.js.map