scip-query 0.20.0 → 0.21.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 (586) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +255 -884
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-CI3O6PQG.js +2 -0
  5. package/dist/call-graph-6QTUTXH7.js +2 -0
  6. package/dist/call-graph-evidence-lZa2dwQA.d.ts +11 -0
  7. package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
  8. package/dist/chunk-26CT72HM.js +2 -0
  9. package/dist/{chunk-7PIO7NKH.js → chunk-2COFMIVK.js} +2 -2
  10. package/dist/chunk-2H4IAJHO.js +2 -0
  11. package/dist/chunk-2I3RSUWX.js +16 -0
  12. package/dist/chunk-2RP27XLR.js +2 -0
  13. package/dist/chunk-2ZBMOQGG.js +3 -0
  14. package/dist/{chunk-HX4GQPZP.js → chunk-32A42O5B.js} +3 -3
  15. package/dist/chunk-35ELD3RM.js +2 -0
  16. package/dist/chunk-35IW3P4H.js +2 -0
  17. package/dist/{chunk-DQGFVPUV.js → chunk-3653GTR7.js} +3 -3
  18. package/dist/chunk-3EX7DNBC.js +2 -0
  19. package/dist/chunk-3FQ3KMCD.js +2 -0
  20. package/dist/{chunk-5E4WNAVD.js → chunk-3PII3JI5.js} +2 -2
  21. package/dist/chunk-3TNRNKAT.js +2 -0
  22. package/dist/chunk-3VLJ2DCA.js +2 -0
  23. package/dist/{chunk-XSRF6Q77.js → chunk-46JLFIGA.js} +2 -2
  24. package/dist/chunk-4DCKBY6T.js +5 -0
  25. package/dist/chunk-4EXFZP6H.js +2 -0
  26. package/dist/chunk-4IIMPWMR.js +29 -0
  27. package/dist/chunk-4ILHWBYF.js +2 -0
  28. package/dist/chunk-4N6QSEMZ.js +10 -0
  29. package/dist/chunk-4OE2JO6I.js +2 -0
  30. package/dist/{chunk-7BAVHKMJ.js → chunk-4S4DF62J.js} +9 -9
  31. package/dist/chunk-4UUCUASK.js +554 -0
  32. package/dist/chunk-5236NQV3.js +2 -0
  33. package/dist/chunk-54EOGFBR.js +2 -0
  34. package/dist/{chunk-LY4WC4AD.js → chunk-5H7IWVXJ.js} +2 -2
  35. package/dist/chunk-5IZTXSOL.js +117 -0
  36. package/dist/{chunk-AZJQQKDD.js → chunk-5SE323LF.js} +2 -2
  37. package/dist/chunk-5ZJH6DDE.js +2 -0
  38. package/dist/chunk-63MBA7EG.js +3 -0
  39. package/dist/chunk-6BJ7SOY7.js +2 -0
  40. package/dist/chunk-6GJAP4OE.js +2 -0
  41. package/dist/chunk-6IEVHGWG.js +26 -0
  42. package/dist/chunk-6SWA6B24.js +7 -0
  43. package/dist/chunk-6T7H2AFY.js +3 -0
  44. package/dist/chunk-73Z33VFI.js +4 -0
  45. package/dist/chunk-7COHFNJK.js +38 -0
  46. package/dist/chunk-7HU2IJ2T.js +3 -0
  47. package/dist/chunk-7IOAZRVL.js +60 -0
  48. package/dist/chunk-7KCZELVM.js +2 -0
  49. package/dist/chunk-7PPYXENX.js +2 -0
  50. package/dist/chunk-7TWP3MCP.js +2 -0
  51. package/dist/chunk-AA7K3XLM.js +21 -0
  52. package/dist/chunk-AJVMVE7X.js +7 -0
  53. package/dist/chunk-ANWGXPPN.js +4 -0
  54. package/dist/chunk-APLKXICZ.js +3 -0
  55. package/dist/{chunk-JDOEX4E6.js → chunk-AQDWTCDC.js} +2 -2
  56. package/dist/chunk-AUP6YI5M.js +2 -0
  57. package/dist/chunk-B7ECWJAZ.js +2 -0
  58. package/dist/{chunk-ZHXX42OH.js → chunk-BATIVRU2.js} +4 -4
  59. package/dist/chunk-BBEDPVPB.js +4 -0
  60. package/dist/chunk-BBWPOMGU.js +2 -0
  61. package/dist/chunk-BD6CV7PN.js +2 -0
  62. package/dist/{chunk-XKWKXZKW.js → chunk-BHE44MHT.js} +2 -2
  63. package/dist/chunk-BOJ5SVE2.js +2 -0
  64. package/dist/chunk-BZYSGZRK.js +2 -0
  65. package/dist/chunk-CA5RE6H7.js +2 -0
  66. package/dist/chunk-CKDOY6JA.js +2 -0
  67. package/dist/chunk-CN2WGM7D.js +2 -0
  68. package/dist/chunk-COTMS5KM.js +3 -0
  69. package/dist/chunk-CSDDOUA4.js +3 -0
  70. package/dist/chunk-CT5SI2I4.js +2 -0
  71. package/dist/chunk-D5EKVZPI.js +2 -0
  72. package/dist/{chunk-FKSELJQF.js → chunk-D5W4UZY5.js} +2 -2
  73. package/dist/{chunk-RUJURYSV.js → chunk-DEUGHURX.js} +2 -2
  74. package/dist/chunk-DHKBIOXF.js +7 -0
  75. package/dist/chunk-DMQ7ZKJG.js +81 -0
  76. package/dist/chunk-DMUGTKMD.js +2 -0
  77. package/dist/chunk-DOPCR5BY.js +2 -0
  78. package/dist/chunk-DRENNWRG.js +2 -0
  79. package/dist/chunk-E4EJBGDZ.js +2 -0
  80. package/dist/chunk-E7BJXRNV.js +2 -0
  81. package/dist/chunk-EA4SH4U5.js +5 -0
  82. package/dist/{chunk-L7AW2QB5.js → chunk-EKZRF57O.js} +2 -2
  83. package/dist/chunk-ELNRLMC5.js +29 -0
  84. package/dist/chunk-F4FNK44D.js +2 -0
  85. package/dist/chunk-F7WQ337U.js +308 -0
  86. package/dist/chunk-FEQIQ26E.js +2 -0
  87. package/dist/chunk-FGB567HK.js +23 -0
  88. package/dist/chunk-FHV7NMFU.js +29 -0
  89. package/dist/chunk-FN6EJM6Q.js +2 -0
  90. package/dist/chunk-FTSQNONX.js +2 -0
  91. package/dist/chunk-FUG6RPYY.js +6 -0
  92. package/dist/chunk-G2F6T5BV.js +2 -0
  93. package/dist/chunk-G6OGPXJW.js +9 -0
  94. package/dist/chunk-GFLTPNWV.js +3 -0
  95. package/dist/chunk-GTDP2SKQ.js +2 -0
  96. package/dist/chunk-H46QMB7E.js +2 -0
  97. package/dist/chunk-H5EXS3HM.js +2 -0
  98. package/dist/chunk-HEOMG7IM.js +8 -0
  99. package/dist/chunk-HG5YI7PV.js +2 -0
  100. package/dist/{chunk-7SQQWSY3.js → chunk-HGKEAP7F.js} +2 -2
  101. package/dist/chunk-HUZNZ3H2.js +2 -0
  102. package/dist/chunk-HWLCBKFE.js +2 -0
  103. package/dist/chunk-I3U2FN2T.js +13 -0
  104. package/dist/{chunk-JAYYFEQY.js → chunk-I7PFL5P3.js} +2 -2
  105. package/dist/{chunk-2HPVVXM5.js → chunk-ICHBVITH.js} +2 -2
  106. package/dist/chunk-ICUQONOG.js +38 -0
  107. package/dist/chunk-IDPLC3FI.js +5 -0
  108. package/dist/{chunk-A73XVBCR.js → chunk-IGKKTHJR.js} +2 -2
  109. package/dist/chunk-IOKWFRFQ.js +4 -0
  110. package/dist/chunk-IPAL6DP2.js +3 -0
  111. package/dist/chunk-IUJ3ZFEE.js +7 -0
  112. package/dist/chunk-IXJ26KJJ.js +16 -0
  113. package/dist/chunk-IYV2YBHM.js +2 -0
  114. package/dist/chunk-JVZNWJBH.js +2 -0
  115. package/dist/chunk-K5MZYZV7.js +3 -0
  116. package/dist/{chunk-3G66UZBH.js → chunk-KFK7GF5C.js} +2 -2
  117. package/dist/chunk-KTRGJLY7.js +18 -0
  118. package/dist/chunk-KW6B5OL4.js +2 -0
  119. package/dist/chunk-KWARB5FZ.js +2 -0
  120. package/dist/chunk-LHTT5C3Z.js +2 -0
  121. package/dist/chunk-LPGDO2XA.js +3 -0
  122. package/dist/chunk-LXLD46LH.js +21 -0
  123. package/dist/chunk-MEI3PTUK.js +2 -0
  124. package/dist/chunk-MJNV7OCG.js +5 -0
  125. package/dist/chunk-MO226P4Q.js +4 -0
  126. package/dist/{chunk-3CLX5EOX.js → chunk-MOBF2GH6.js} +2 -2
  127. package/dist/chunk-MXNGIEPU.js +3 -0
  128. package/dist/chunk-MYUKI5VN.js +4 -0
  129. package/dist/{chunk-TFRAYKN6.js → chunk-N5C65OFK.js} +2 -2
  130. package/dist/{chunk-PXY7F6Y4.js → chunk-O2RM7E7L.js} +5 -5
  131. package/dist/chunk-OFUBXBYX.js +3 -0
  132. package/dist/chunk-OFY4HTMI.js +2 -0
  133. package/dist/chunk-OIRWZIYL.js +38 -0
  134. package/dist/chunk-OIVZ7PW6.js +438 -0
  135. package/dist/chunk-ORBKAUCH.js +4 -0
  136. package/dist/chunk-OUB4J26T.js +2 -0
  137. package/dist/chunk-OVPS2ILI.js +20 -0
  138. package/dist/chunk-PHSPBQM6.js +5 -0
  139. package/dist/{chunk-JVYA47YU.js → chunk-PIZY2GX6.js} +2 -2
  140. package/dist/chunk-PNISDVYC.js +3 -0
  141. package/dist/chunk-PQOL42AW.js +2 -0
  142. package/dist/chunk-PUVZNFVY.js +11 -0
  143. package/dist/chunk-PZEI2TVL.js +4 -0
  144. package/dist/{chunk-ZK26BAQL.js → chunk-Q2J2VZZT.js} +2 -2
  145. package/dist/chunk-Q7HB7BFJ.js +2 -0
  146. package/dist/{chunk-ZTETIQ35.js → chunk-QBANU5BQ.js} +2 -2
  147. package/dist/chunk-QD7IFBCR.js +10 -0
  148. package/dist/chunk-QDCCHMVZ.js +2 -0
  149. package/dist/chunk-QLQBZOJH.js +3 -0
  150. package/dist/{chunk-PQCI4SQX.js → chunk-QXR5QPSF.js} +2 -2
  151. package/dist/chunk-R2MOKIVO.js +2 -0
  152. package/dist/{chunk-EN3O7VJA.js → chunk-RFWAUHVW.js} +2 -2
  153. package/dist/chunk-RGCJ4646.js +16 -0
  154. package/dist/{chunk-BPAPWKP6.js → chunk-S3RTPPLQ.js} +8 -8
  155. package/dist/chunk-S73HBCGI.js +11 -0
  156. package/dist/chunk-SDPA5DKN.js +210 -0
  157. package/dist/chunk-SEUJVWT2.js +3 -0
  158. package/dist/chunk-SF7X6QNW.js +2 -0
  159. package/dist/chunk-SKUMCCC5.js +2 -0
  160. package/dist/chunk-SSSJO4RG.js +2 -0
  161. package/dist/chunk-SWFAFA4G.js +49 -0
  162. package/dist/chunk-SYUNTKO2.js +2 -0
  163. package/dist/chunk-T6FRID7Y.js +3 -0
  164. package/dist/chunk-TGWNNMPF.js +3 -0
  165. package/dist/chunk-TM5XEDDR.js +4 -0
  166. package/dist/chunk-TNOHGHZQ.js +2 -0
  167. package/dist/chunk-U2GPTA5U.js +3 -0
  168. package/dist/{chunk-SXP2MBJH.js → chunk-U7DR7MJD.js} +2 -2
  169. package/dist/chunk-U7LRSQG6.js +3 -0
  170. package/dist/chunk-UL4VJUMD.js +2 -0
  171. package/dist/chunk-UNORWZIJ.js +16 -0
  172. package/dist/chunk-UQ7XPRWU.js +2 -0
  173. package/dist/{chunk-6SHPK5ZE.js → chunk-URMZLV2N.js} +2 -2
  174. package/dist/chunk-URTX2BEA.js +6 -0
  175. package/dist/chunk-UZFCZ7SJ.js +2 -0
  176. package/dist/{chunk-KMKTIO2G.js → chunk-V7LQZTTZ.js} +2 -2
  177. package/dist/chunk-VETXXOYU.js +3 -0
  178. package/dist/chunk-VGRUM7JI.js +3 -0
  179. package/dist/{chunk-WXZLAAWK.js → chunk-VNKYRJKN.js} +2 -2
  180. package/dist/chunk-VWLIOEEF.js +11 -0
  181. package/dist/chunk-WB6LGCFB.js +6 -0
  182. package/dist/{chunk-W4ETQAXM.js → chunk-WK4FD4PG.js} +2 -2
  183. package/dist/{chunk-O64IZ6UX.js → chunk-WKPZCQLI.js} +2 -2
  184. package/dist/chunk-WSG3DK5H.js +2 -0
  185. package/dist/chunk-WULAPQUD.js +38 -0
  186. package/dist/chunk-WZQFY5S7.js +4 -0
  187. package/dist/chunk-X434XZAI.js +2 -0
  188. package/dist/chunk-X7PJJYKX.js +29 -0
  189. package/dist/chunk-XDAUYDFT.js +2 -0
  190. package/dist/chunk-XITQLISP.js +2 -0
  191. package/dist/chunk-XRXCANFQ.js +4 -0
  192. package/dist/chunk-XVDMJMES.js +3 -0
  193. package/dist/chunk-XXJ7WL3F.js +35 -0
  194. package/dist/chunk-Y4XQ7LES.js +9 -0
  195. package/dist/chunk-YIEFEPG6.js +16 -0
  196. package/dist/chunk-YRVERHJR.js +49 -0
  197. package/dist/{chunk-CJST5ETY.js → chunk-YUFWLWIC.js} +2 -2
  198. package/dist/chunk-YUKYB54I.js +1 -0
  199. package/dist/chunk-Z3GCK3PD.js +3 -0
  200. package/dist/chunk-ZBNL3QCY.js +4 -0
  201. package/dist/chunk-ZD3Z54IW.js +2 -0
  202. package/dist/chunk-ZDVDSDFG.js +4 -0
  203. package/dist/{chunk-32LVLCLN.js → chunk-ZHSARYVS.js} +3 -3
  204. package/dist/{chunk-BDCC2NPY.js → chunk-ZW44MCJM.js} +2 -2
  205. package/dist/{chunk-N5W4YZMK.js → chunk-ZYREOING.js} +2 -2
  206. package/dist/cli-main.js +8 -0
  207. package/dist/cli.js +1 -3
  208. package/dist/code-CczEvHui.d.ts +121 -0
  209. package/dist/code-EQL6ZBLH.js +2 -0
  210. package/dist/code-result-json-6E4J6LGZ.js +2 -0
  211. package/dist/command-descriptors-QH3G2OVD.js +346 -0
  212. package/dist/{config-types-jVM3D7MA.d.ts → config-types-Cm-VSEBb.d.ts} +189 -23
  213. package/dist/dataflow-2BLMUZBP.js +2 -0
  214. package/dist/{db-B5PM5yNk.d.ts → db-LKJXAlNS.d.ts} +1 -1
  215. package/dist/dependence-slice-MGAJDZXB.js +2 -0
  216. package/dist/deps-GQMUYVKW.js +2 -0
  217. package/dist/direct-navigation-6RUJKLAV.js +3 -0
  218. package/dist/entry-map-V2NQP5JU.js +2 -0
  219. package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
  220. package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
  221. package/dist/file-kind-BKCVMNUf.d.ts +10 -0
  222. package/dist/files-VM53I4IU.js +2 -0
  223. package/dist/graph-evidence-CbUPCSKV.d.ts +126 -0
  224. package/dist/graph-exploration-contract-CqDsnPQL.d.ts +7 -0
  225. package/dist/{health-Do5TKSJI.d.ts → health-Wl5G_LRt.d.ts} +33 -34
  226. package/dist/hierarchy-D553WRSZ.js +2 -0
  227. package/dist/imports-DOZAJWLW.js +2 -0
  228. package/dist/index.d.ts +4 -31
  229. package/dist/index.js +1 -1
  230. package/dist/members-HE67475K.js +2 -0
  231. package/dist/methods-K5JK4PPH.js +2 -0
  232. package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
  233. package/dist/output-continuation-command-LKBUTNRL.js +3 -0
  234. package/dist/output-pagination-VAWOGX4R.js +19 -0
  235. package/dist/postinstall.js +1 -1
  236. package/dist/project-reindex-4ARU6QCM.js +3 -0
  237. package/dist/queries/affected.d.ts +22 -4
  238. package/dist/queries/affected.js +1 -1
  239. package/dist/queries/anchors.d.ts +123 -0
  240. package/dist/queries/anchors.js +2 -0
  241. package/dist/queries/architecture.d.ts +3 -2
  242. package/dist/queries/architecture.js +1 -1
  243. package/dist/queries/bottlenecks.d.ts +26 -7
  244. package/dist/queries/bottlenecks.js +1 -1
  245. package/dist/queries/by-kind.d.ts +2 -2
  246. package/dist/queries/by-kind.js +1 -1
  247. package/dist/queries/call-graph.d.ts +17 -3
  248. package/dist/queries/call-graph.js +1 -1
  249. package/dist/queries/change-surface.d.ts +2 -2
  250. package/dist/queries/change-surface.js +1 -1
  251. package/dist/queries/cleanup-plan.d.ts +2 -2
  252. package/dist/queries/cleanup-plan.js +1 -1
  253. package/dist/queries/co-change.d.ts +2 -2
  254. package/dist/queries/co-change.js +1 -1
  255. package/dist/queries/code.d.ts +5 -26
  256. package/dist/queries/code.js +1 -1
  257. package/dist/queries/complexity-hotspots.d.ts +2 -2
  258. package/dist/queries/complexity-hotspots.js +1 -1
  259. package/dist/queries/complexity.d.ts +2 -2
  260. package/dist/queries/complexity.js +1 -1
  261. package/dist/queries/context.d.ts +145 -0
  262. package/dist/queries/context.js +2 -0
  263. package/dist/queries/convergence.d.ts +2 -2
  264. package/dist/queries/convergence.js +1 -1
  265. package/dist/queries/coupling.d.ts +8 -3
  266. package/dist/queries/coupling.js +1 -1
  267. package/dist/queries/cycles.d.ts +34 -7
  268. package/dist/queries/cycles.js +1 -1
  269. package/dist/queries/dataflow.d.ts +40 -14
  270. package/dist/queries/dataflow.js +1 -1
  271. package/dist/queries/dead.d.ts +2 -2
  272. package/dist/queries/dead.js +1 -1
  273. package/dist/queries/decorative-checkers.d.ts +3 -3
  274. package/dist/queries/decorative-checkers.js +1 -1
  275. package/dist/queries/deep-chains.d.ts +4 -38
  276. package/dist/queries/deep-chains.js +1 -1
  277. package/dist/queries/dependence-slice.d.ts +47 -0
  278. package/dist/queries/dependence-slice.js +2 -0
  279. package/dist/queries/dependency-depth.d.ts +49 -0
  280. package/dist/queries/dependency-depth.js +2 -0
  281. package/dist/queries/deps.d.ts +4 -2
  282. package/dist/queries/deps.js +1 -1
  283. package/dist/queries/diff-impact.d.ts +3 -3
  284. package/dist/queries/diff-impact.js +1 -1
  285. package/dist/queries/doc-drift.d.ts +4 -4
  286. package/dist/queries/doc-drift.js +1 -1
  287. package/dist/queries/drift.d.ts +2 -2
  288. package/dist/queries/drift.js +1 -1
  289. package/dist/queries/duplicate-bodies.d.ts +2 -2
  290. package/dist/queries/duplicate-bodies.js +1 -1
  291. package/dist/queries/entry-map.d.ts +121 -0
  292. package/dist/queries/entry-map.js +2 -0
  293. package/dist/queries/evidence.d.ts +70 -0
  294. package/dist/queries/evidence.js +2 -0
  295. package/dist/queries/extract-candidates.d.ts +2 -2
  296. package/dist/queries/extract-candidates.js +1 -1
  297. package/dist/queries/fan.d.ts +18 -5
  298. package/dist/queries/fan.js +1 -1
  299. package/dist/queries/files.d.ts +2 -2
  300. package/dist/queries/files.js +1 -1
  301. package/dist/queries/health.d.ts +4 -3
  302. package/dist/queries/health.js +1 -1
  303. package/dist/queries/hierarchy.d.ts +5 -3
  304. package/dist/queries/hierarchy.js +1 -1
  305. package/dist/queries/hotspots.d.ts +11 -5
  306. package/dist/queries/hotspots.js +1 -1
  307. package/dist/queries/imports.d.ts +2 -2
  308. package/dist/queries/imports.js +1 -1
  309. package/dist/queries/incomplete-migration.d.ts +4 -4
  310. package/dist/queries/incomplete-migration.js +1 -1
  311. package/dist/queries/index.d.ts +56 -136
  312. package/dist/queries/index.js +1 -1
  313. package/dist/queries/isolated.d.ts +2 -2
  314. package/dist/queries/isolated.js +1 -1
  315. package/dist/queries/locality-candidates.d.ts +2 -2
  316. package/dist/queries/locality-candidates.js +1 -1
  317. package/dist/queries/members.d.ts +2 -2
  318. package/dist/queries/members.js +1 -1
  319. package/dist/queries/methods.d.ts +2 -2
  320. package/dist/queries/methods.js +1 -1
  321. package/dist/queries/not-implemented.d.ts +3 -3
  322. package/dist/queries/not-implemented.js +1 -1
  323. package/dist/queries/outline.d.ts +2 -2
  324. package/dist/queries/outline.js +1 -1
  325. package/dist/queries/passthrough-candidates.d.ts +5 -9
  326. package/dist/queries/passthrough-candidates.js +1 -1
  327. package/dist/queries/plan-context.d.ts +27 -64
  328. package/dist/queries/plan-context.js +1 -1
  329. package/dist/queries/react-component-duplicates.d.ts +2 -2
  330. package/dist/queries/react-component-duplicates.js +1 -1
  331. package/dist/queries/react-hook-candidates.d.ts +2 -2
  332. package/dist/queries/react-hook-candidates.js +1 -1
  333. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  334. package/dist/queries/react-large-component-pressure.js +1 -1
  335. package/dist/queries/recent-duplicates.d.ts +2 -2
  336. package/dist/queries/recent-duplicates.js +1 -1
  337. package/dist/queries/redundant-reexports.d.ts +2 -2
  338. package/dist/queries/redundant-reexports.js +1 -1
  339. package/dist/queries/reference-neighborhood.d.ts +4 -0
  340. package/dist/queries/reference-neighborhood.js +2 -0
  341. package/dist/queries/reference-reachability.d.ts +48 -0
  342. package/dist/queries/reference-reachability.js +2 -0
  343. package/dist/queries/refs.d.ts +2 -2
  344. package/dist/queries/refs.js +1 -1
  345. package/dist/queries/self-audit.d.ts +2 -2
  346. package/dist/queries/self-audit.js +1 -1
  347. package/dist/queries/similar-chains.d.ts +2 -2
  348. package/dist/queries/similar-chains.js +1 -1
  349. package/dist/queries/similar-files.d.ts +2 -2
  350. package/dist/queries/similar-files.js +1 -1
  351. package/dist/queries/similar-signatures.d.ts +2 -2
  352. package/dist/queries/similar-signatures.js +1 -1
  353. package/dist/queries/similar.d.ts +2 -2
  354. package/dist/queries/similar.js +1 -1
  355. package/dist/queries/slice.d.ts +3 -36
  356. package/dist/queries/slice.js +1 -1
  357. package/dist/queries/source-inspection.d.ts +209 -0
  358. package/dist/queries/source-inspection.js +2 -0
  359. package/dist/queries/source-search.d.ts +13 -0
  360. package/dist/queries/source-search.js +2 -0
  361. package/dist/queries/stale-abstractions.d.ts +2 -2
  362. package/dist/queries/stale-abstractions.js +1 -1
  363. package/dist/queries/stats.d.ts +2 -2
  364. package/dist/queries/surface.d.ts +13 -4
  365. package/dist/queries/surface.js +1 -1
  366. package/dist/queries/symbols.d.ts +2 -2
  367. package/dist/queries/symbols.js +1 -1
  368. package/dist/queries/system-map.d.ts +449 -0
  369. package/dist/queries/system-map.js +2 -0
  370. package/dist/queries/system.d.ts +5 -3
  371. package/dist/queries/system.js +1 -1
  372. package/dist/queries/test-quality.d.ts +2 -2
  373. package/dist/queries/test-quality.js +1 -1
  374. package/dist/queries/trace.d.ts +47 -3
  375. package/dist/queries/trace.js +1 -1
  376. package/dist/queries/twin-ab.d.ts +3 -3
  377. package/dist/queries/twin-ab.js +1 -1
  378. package/dist/queries/twin-drift.d.ts +3 -3
  379. package/dist/queries/twin-drift.js +1 -1
  380. package/dist/queries/unused-imports.d.ts +2 -2
  381. package/dist/queries/unused-imports.js +1 -1
  382. package/dist/queries/unused-params.d.ts +2 -2
  383. package/dist/queries/unused-params.js +1 -1
  384. package/dist/queries/value-flow.d.ts +43 -0
  385. package/dist/queries/value-flow.js +2 -0
  386. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  387. package/dist/queries/vue-component-duplicates.js +1 -1
  388. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  389. package/dist/queries/vue-composable-candidates.js +1 -1
  390. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  391. package/dist/queries/vue-large-view-pressure.js +1 -1
  392. package/dist/queries/wrapper-candidates.d.ts +2 -2
  393. package/dist/queries/wrapper-candidates.js +1 -1
  394. package/dist/query-service-fastpath.js +6 -0
  395. package/dist/query-service-server.js +5 -0
  396. package/dist/refs-NBHKL4UQ.js +2 -0
  397. package/dist/refs-pagination-BBVTIHMH.js +2 -0
  398. package/dist/reindex-worker.js +27 -45
  399. package/dist/reindex.d.ts +62 -42
  400. package/dist/reindex.js +32 -33
  401. package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
  402. package/dist/runtime.d.ts +286 -7
  403. package/dist/runtime.js +4 -3
  404. package/dist/rust-semantic-session-server.js +1 -1
  405. package/dist/rust-semantic-session-worker.js +1 -1
  406. package/dist/rust-semantic-worker.js +1 -1
  407. package/dist/{scip-cli-BnEwZRLJ.d.ts → scip-cli-CppzF5MK.d.ts} +33 -2
  408. package/dist/slice-U6S6LBSB.js +2 -0
  409. package/dist/source-search-types-Dwz8KeuW.d.ts +79 -0
  410. package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
  411. package/dist/stats-OOJ74B32.js +2 -0
  412. package/dist/surface-C7SS5CDQ.js +2 -0
  413. package/dist/symbol-resolution-3FVEKDTJ.js +2 -0
  414. package/dist/system-6K2NOO5C.js +2 -0
  415. package/dist/trace-II5K2TMH.js +2 -0
  416. package/dist/typescript-mailbox-worker.js +1 -1
  417. package/dist/value-flow-MKFUUE5B.js +2 -0
  418. package/dist/watch-server.js +3 -2
  419. package/docs/AGENT_GUIDE.md +133 -476
  420. package/docs/AI_FAILURE_MODES.md +30 -301
  421. package/docs/API.md +1 -1
  422. package/docs/API_EVOLUTION.md +6 -0
  423. package/docs/CLI_JSON_OUTPUT.md +207 -29
  424. package/docs/COMMAND_REFERENCE.md +255 -154
  425. package/docs/CONFIGURATION_WRITE_SAFETY.md +14 -13
  426. package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +84 -0
  427. package/docs/DETECTOR_GUIDE.md +46 -138
  428. package/docs/DURABILITY.md +7 -1
  429. package/docs/INDEX_GENERATIONS.md +6 -0
  430. package/docs/LOCK_PROTOCOL.md +8 -0
  431. package/docs/REINDEX_METADATA_COMPATIBILITY.md +13 -3
  432. package/docs/SECURITY_MODEL.md +39 -42
  433. package/docs/accuracy-audit-checklist.md +4 -0
  434. package/docs/accuracy-hardening-goal.md +9 -2
  435. package/docs/analyzer-inventory.md +59 -264
  436. package/docs/analyzer-validation-protocol.md +62 -170
  437. package/docs/architecture-coherence-vision.md +18 -12
  438. package/docs/locality-analyzer-design.md +1 -1
  439. package/docs/schemas/cli-json-envelope.schema.json +212 -27
  440. package/docs/schemas/cli-json-export-receipt.schema.json +25 -0
  441. package/docs/schemas/cli-output-page.schema.json +1 -1
  442. package/docs/schemas/observation-receipt.schema.json +164 -0
  443. package/docs/schemas/project-config.schema.json +27 -45
  444. package/docs/schemas/suppression-record.schema.json +1 -34
  445. package/package.json +65 -8
  446. package/skills/concrete-plan/SKILL.md +8 -0
  447. package/skills/concrete-plan/agents/openai.yaml +4 -0
  448. package/skills/scip-explore/SKILL.md +3 -85
  449. package/skills/scip-explore/agents/openai.yaml +3 -3
  450. package/skills/scip-integrity-audit/SKILL.md +185 -0
  451. package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
  452. package/skills/scip-plan/SKILL.md +67 -49
  453. package/skills/scip-plan/agents/openai.yaml +3 -3
  454. package/skills/scip-query/SKILL.md +77 -77
  455. package/skills/scip-query/agents/openai.yaml +3 -3
  456. package/skills/scip-setup/SKILL.md +10 -102
  457. package/skills/scip-setup/agents/openai.yaml +3 -3
  458. package/dist/chunk-26QA6FAI.js +0 -8
  459. package/dist/chunk-2KAZEZ6M.js +0 -2
  460. package/dist/chunk-3ORVDL3H.js +0 -2
  461. package/dist/chunk-46XGSFNI.js +0 -2
  462. package/dist/chunk-4MAK2HOY.js +0 -6
  463. package/dist/chunk-4TURLRL5.js +0 -16
  464. package/dist/chunk-4UQVNCQE.js +0 -2
  465. package/dist/chunk-55Q3WLZX.js +0 -2
  466. package/dist/chunk-5I5G2QOX.js +0 -3
  467. package/dist/chunk-6LDJQXAH.js +0 -2
  468. package/dist/chunk-6O5TICIZ.js +0 -3
  469. package/dist/chunk-7O5IKBTZ.js +0 -16
  470. package/dist/chunk-7S5E7KWT.js +0 -2
  471. package/dist/chunk-7WPLAODU.js +0 -5
  472. package/dist/chunk-AFHORGLH.js +0 -42
  473. package/dist/chunk-AIE7TFJW.js +0 -9
  474. package/dist/chunk-AQOFWNQJ.js +0 -1
  475. package/dist/chunk-B2PX5I6M.js +0 -2
  476. package/dist/chunk-B75HZHUP.js +0 -2
  477. package/dist/chunk-B7PBSLZN.js +0 -2
  478. package/dist/chunk-BBW6JFHN.js +0 -2
  479. package/dist/chunk-BNXCIFVY.js +0 -2
  480. package/dist/chunk-BS2NMXQZ.js +0 -4
  481. package/dist/chunk-C3KV2II6.js +0 -2
  482. package/dist/chunk-C43RDDP4.js +0 -20
  483. package/dist/chunk-DAFAHMNB.js +0 -42
  484. package/dist/chunk-DQLPXMH6.js +0 -8
  485. package/dist/chunk-EKZTZXHZ.js +0 -117
  486. package/dist/chunk-EW2NTSFA.js +0 -18
  487. package/dist/chunk-F3Z4OUDS.js +0 -8
  488. package/dist/chunk-FJH2NW7J.js +0 -66
  489. package/dist/chunk-FTFP6O3L.js +0 -11
  490. package/dist/chunk-FYLK2DEJ.js +0 -2
  491. package/dist/chunk-GH74ASD6.js +0 -11
  492. package/dist/chunk-GMXWZP2B.js +0 -2
  493. package/dist/chunk-GOUBFH5O.js +0 -3
  494. package/dist/chunk-HLF2TX6R.js +0 -2
  495. package/dist/chunk-HX7M4BDI.js +0 -30
  496. package/dist/chunk-HZ72SESS.js +0 -128
  497. package/dist/chunk-IB2N4FIY.js +0 -10
  498. package/dist/chunk-IZYYAFN5.js +0 -2
  499. package/dist/chunk-JFGGXWQF.js +0 -947
  500. package/dist/chunk-JN4NMBEX.js +0 -8
  501. package/dist/chunk-JW56N3KI.js +0 -4
  502. package/dist/chunk-JZ2OXNWB.js +0 -2
  503. package/dist/chunk-KFZNKUNT.js +0 -2
  504. package/dist/chunk-L5GJNV2T.js +0 -8
  505. package/dist/chunk-L7JDSCDF.js +0 -4
  506. package/dist/chunk-LU47HG23.js +0 -14
  507. package/dist/chunk-LVY7NPF7.js +0 -2
  508. package/dist/chunk-MKCDWWGV.js +0 -4
  509. package/dist/chunk-MNE7YG56.js +0 -2
  510. package/dist/chunk-MRXBEXSY.js +0 -26
  511. package/dist/chunk-MV7OWDUX.js +0 -2
  512. package/dist/chunk-NGEXCJJW.js +0 -11
  513. package/dist/chunk-NIW6JDC5.js +0 -29
  514. package/dist/chunk-PBUQFCNB.js +0 -16
  515. package/dist/chunk-POAVPHH7.js +0 -2
  516. package/dist/chunk-QZ4JVECJ.js +0 -2
  517. package/dist/chunk-RDO52JGY.js +0 -2
  518. package/dist/chunk-RJT3TUUZ.js +0 -2
  519. package/dist/chunk-RVLDN63O.js +0 -4
  520. package/dist/chunk-RXOXSKY3.js +0 -2
  521. package/dist/chunk-S7OYBOCK.js +0 -2
  522. package/dist/chunk-SMNXQT5Z.js +0 -3
  523. package/dist/chunk-SRAFT254.js +0 -2
  524. package/dist/chunk-T7YQSHPQ.js +0 -3
  525. package/dist/chunk-UJCOIXDY.js +0 -2
  526. package/dist/chunk-UJPRPGCO.js +0 -13
  527. package/dist/chunk-WCCFZ7V7.js +0 -113
  528. package/dist/chunk-WUPW3UN3.js +0 -3
  529. package/dist/chunk-X54AGLVX.js +0 -2
  530. package/dist/chunk-Y2MVPNKY.js +0 -5
  531. package/dist/chunk-YKUU5AIC.js +0 -3
  532. package/dist/chunk-YLCJLTPL.js +0 -2
  533. package/dist/chunk-YTQVETEO.js +0 -2
  534. package/dist/chunk-Z4N3MZYA.js +0 -38
  535. package/dist/chunk-ZJOOT3BG.js +0 -2
  536. package/dist/command-descriptors-DSS46KXI.js +0 -642
  537. package/dist/diff-gate-types-B0QYpDv1.d.ts +0 -11
  538. package/dist/direct-navigation-6YHV6IB5.js +0 -3
  539. package/dist/queries/diff-gate.d.ts +0 -253
  540. package/dist/queries/diff-gate.js +0 -2
  541. package/docs/COMMITTED_RECORD_COMPATIBILITY.md +0 -154
  542. package/docs/analyzer-validation-ledger.md +0 -516
  543. package/docs/schemas/outcome-event-record.schema.json +0 -95
  544. package/skills/_shared/SKILL.md +0 -101
  545. package/skills/_shared/agents/openai.yaml +0 -4
  546. package/skills/_shared/references/agent-contract-catalog.md +0 -105
  547. package/skills/_shared/references/command-catalog.md +0 -118
  548. package/skills/_shared/references/detector-precision-and-diffgate.md +0 -59
  549. package/skills/_shared/references/evidence-and-dead-code.md +0 -25
  550. package/skills/scip-audit/SKILL.md +0 -77
  551. package/skills/scip-audit/agents/openai.yaml +0 -4
  552. package/skills/scip-audit/references/claims.md +0 -98
  553. package/skills/scip-audit/references/cleanup.md +0 -100
  554. package/skills/scip-audit/references/directory.md +0 -222
  555. package/skills/scip-audit/references/frontend.md +0 -130
  556. package/skills/scip-audit/references/integrity.md +0 -154
  557. package/skills/scip-audit/references/maintainability.md +0 -162
  558. package/skills/scip-audit/references/twin-drift.md +0 -104
  559. package/skills/scip-diagnose/SKILL.md +0 -52
  560. package/skills/scip-diagnose/agents/openai.yaml +0 -4
  561. package/skills/scip-diagnose/references/debug.md +0 -117
  562. package/skills/scip-diagnose/references/probe-reachability.md +0 -77
  563. package/skills/scip-diagnose/references/root-cause.md +0 -145
  564. package/skills/scip-diagnose/references/triage.md +0 -119
  565. package/skills/scip-explore/references/diagrams.md +0 -40
  566. package/skills/scip-explore/references/language-playbook.md +0 -49
  567. package/skills/scip-improve/SKILL.md +0 -56
  568. package/skills/scip-improve/agents/openai.yaml +0 -4
  569. package/skills/scip-improve/references/cleanup-batches.md +0 -53
  570. package/skills/scip-improve/references/directory-moves.md +0 -53
  571. package/skills/scip-improve/references/doc-reconcile.md +0 -30
  572. package/skills/scip-improve/references/frontend-extraction.md +0 -39
  573. package/skills/scip-improve/references/maintainability-mechanism.md +0 -43
  574. package/skills/scip-improve/references/twin-drift.md +0 -35
  575. package/skills/scip-plan/references/api-impact.md +0 -19
  576. package/skills/scip-plan/references/conductor.md +0 -41
  577. package/skills/scip-plan/references/high-assurance.md +0 -43
  578. package/skills/scip-plan/references/hyper-optimization.md +0 -50
  579. package/skills/scip-plan/references/tla-model.md +0 -88
  580. package/skills/scip-setup/references/bootstrap-workflow.md +0 -119
  581. package/skills/scip-setup/references/language-verification.md +0 -61
  582. package/skills/scip-setup/references/lifecycle-commands.md +0 -119
  583. package/skills/scip-setup/references/per-repo-triage.md +0 -24
  584. package/skills/scip-verify/SKILL.md +0 -229
  585. package/skills/scip-verify/agents/openai.yaml +0 -4
  586. package/skills/scip-verify/references/calibrate-detectors.md +0 -170
@@ -0,0 +1,11 @@
1
+ import{G as w,I as H,J as Q,K as Z,e as X,h as Y}from"./chunk-MYUKI5VN.js";import{D as A,E as D,F as K,H as j,m as V,o as M,s as x,t as $}from"./chunk-MO226P4Q.js";import{spawn as Be}from"child_process";import{platform as ee}from"os";import{performance as te}from"perf_hooks";var lt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},h=class extends Error{constructor(n,r,s,a={}){super(s,a.cause===void 0?void 0:{cause:a.cause});this.kind=n;this.label=r;this.name="BoundedProcessError",this.timedOut=a.timedOut??!1,this.reaped=a.reaped??!1,this.stdout=a.stdout??"",this.stderr=a.stderr??"",this.stdoutTruncated=a.stdoutTruncated??!1,this.stderrTruncated=a.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function B(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function ne(e,t,n,r){let s=Math.max(0,r-n);s>0&&e.push(t.subarray(0,s))}function re(e,t,n){let r=Buffer.concat([...e,t]);e.length=0,e.push(r.subarray(Math.max(0,r.length-n)))}function ct(e){B(e.timeoutMs,"timeoutMs"),B(e.maxStdoutBytes,"maxStdoutBytes"),B(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;B(t,"terminationGraceMs");let n=e.terminationForceMs??t;return B(n,"terminationForceMs"),new Promise((r,s)=>{let a=te.now(),i=ee()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",c=ee()!=="win32"&&!i,o;try{o=Be(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:c?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(l){s(new h("spawn",e.label,`${e.label} could not start.`,{cause:l,reaped:!0}));return}let u=[],g=[],d=0,m=0,y=!1,R=!1,p=null,b=!1,z=o.pid===void 0?null:Q(o.pid,c),P=()=>{clearTimeout(U),e.signal?.removeEventListener("abort",I)},E=l=>{if(b||!p)return;b=!0,P();let f=Buffer.concat(u).toString("utf8"),N=Buffer.concat(g).toString("utf8"),_=l.reaped||!l.detail?"":` Process-tree cleanup failed: ${l.detail}`;s(new h(p.kind,e.label,`${p.message}${_}`,{timedOut:p.timedOut,reaped:l.reaped,stdout:f,stderr:N,stdoutTruncated:y,stderrTruncated:R}))},v=l=>{if(!(p||b)){if(p=l,!z){E({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}Z(z,{gracefulMs:t,forceMs:n}).then(E,f=>{E({reaped:!1,reason:"signal-failed",detail:f instanceof Error?f.message:String(f)})})}},U=setTimeout(()=>{v({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);U.unref();let I=()=>{v({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",I,{once:!0}),e.signal?.aborted&&I(),o.stdout.on("data",l=>{let f=Buffer.isBuffer(l)?l:Buffer.from(l);e.outputLimitBehavior==="truncate-tail"?re(u,f,e.maxStdoutBytes):ne(u,f,d,e.maxStdoutBytes),d+=f.length,d>e.maxStdoutBytes&&(y=!0,e.outputLimitBehavior!=="truncate-tail"&&v({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),o.stderr.on("data",l=>{let f=Buffer.isBuffer(l)?l:Buffer.from(l);e.outputLimitBehavior==="truncate-tail"?re(g,f,e.maxStderrBytes):ne(g,f,m,e.maxStderrBytes),m+=f.length,m>e.maxStderrBytes&&(R=!0,e.outputLimitBehavior!=="truncate-tail"&&v({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),o.on("error",l=>{if(!b&&!p){if(o.pid===void 0){P(),b=!0,s(new h("spawn",e.label,`${e.label} could not start: ${l.message}`,{cause:l,reaped:!0}));return}v({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${l.message}`})}}),o.on("close",(l,f)=>{if(b||p)return;b=!0,P();let N=Buffer.concat(u).toString("utf8"),_=Buffer.concat(g).toString("utf8");r({status:l,signal:f,stdout:N,stderr:_,timedOut:!1,durationMs:te.now()-a,stdoutTruncated:y,stderrTruncated:R})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}import{execFileSync as ie}from"child_process";import{createRequire as he}from"module";import{existsSync as Se}from"fs";import{platform as S,arch as se}from"os";var L="v0.8.1",J="https://github.com/sourcegraph/scip",T=`github.com/sourcegraph/scip/cmd/scip@${L}`,ae=he(import.meta.url),oe="SCIP_QUERY_SCIP_BIN";function Le(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let t=e.env[oe];if(t&&e.fileExists(t))return{source:"env",path:t};if(e.platform==="win32"){let n=e.resolveSidecar(e.arch);if(n&&e.fileExists(n))return{source:"sidecar",path:n}}return null}function Ae(e){for(let t of e==="arm64"?["arm64","x64"]:[e])try{return ae.resolve(`scip-query-scip-windows/scip-win32-${t}.exe`)}catch{}return null}function C(e=process.env){let t=Le({platform:S(),arch:se(),env:e,isOnPath:w,fileExists:Se,resolveSidecar:Ae});return t?.source==="path"?H("scip")??t.path:t?.path??null}function bt(){return C()!==null}function we(){let e=C();if(!e)return null;try{return ie(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function Te(){let e=S(),t=se(),n,r,s;switch(e){case"darwin":n="darwin",s="tar.gz";break;case"linux":n="linux",s="tar.gz";break;default:return null}switch(t){case"arm64":r="arm64";break;case"x64":r="amd64";break;default:return null}let a=`scip-${n}-${r}.${s}`;return{url:`${J}/releases/download/${L}/${a}`,filename:a}}function xt(){let e=Te();if(console.log("\nThe `scip` CLI is required but not found on PATH.\n"),S()==="darwin"||S()==="linux")console.log("Install the reviewed version with Go:"),console.log(` go install ${T}
2
+ `),console.log("Or download that exact release manually:");else if(S()==="win32"){let t=Oe();console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(` npm install -g ${t}`),console.log(`Or set ${oe} to a local scip.exe path.
3
+ `),console.log("Upstream release page:")}else console.log("Download from:");console.log(e?` ${e.url}
4
+ `:` ${J}/releases/tag/${L}
5
+ `),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function Oe(){let t=ae("../../package.json").optionalDependencies?.["scip-query-scip-windows"];if(!t||!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(t))throw new Error("scip-query package metadata does not declare an exact Windows sidecar version.");return`scip-query-scip-windows@${t}`}function vt(e){if(w("go")){e(`Installing immutable ${T} via go install into the Go bin directory (GOBIN or GOPATH/bin); expected executable: scip.`);try{if(ie("go",["install",T],{stdio:"inherit",timeout:3e5,env:process.env}),w("scip")){let t=C(),n=we();if(t&&n&&n.includes(L))return e(`Successfully installed ${T}; resolved executable: ${t}; reported version: ${n}.`),!0;e(`go install completed, but the resolved scip executable did not report ${L} (executable: ${t??"unresolved"}; version: ${n??"unavailable"}).`)}}catch(t){let n=t instanceof Error?t.message:String(t);e(`go install failed: ${n}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${J}/releases`),!1}import{existsSync as fe,statSync as qe}from"fs";import{dirname as Re,join as be}from"path";import{appendFileSync as ke,existsSync as Pe,mkdirSync as Ee,renameSync as Ie,rmSync as Ne,statSync as _e,truncateSync as Me}from"fs";import{basename as $e,dirname as De}from"path";var O=".previous",Je=".rotation.lock",Ce=2e3,W=class extends Error{constructor(n,r){super(`Timed out after ${r}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=r;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},F=class extends Error{constructor(n){super(`Rotating JSONL lock ownership changed before release: ${n}`);this.lockPath=n;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},ue=Object.freeze({monotonicNow:X,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=Y(e,{kind:"rotating-jsonl",detail:{target:$e(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){Ee(e,{recursive:!0})},exists:Pe,readBytes(e){return K(e,{maxBytes:A,inputKind:"rotating JSONL segment"})},size(e){return _e(e).size},truncate:Me,remove(e){Ne(e,{force:!0})},rename:Ie,append:ke});function de(e,t,n){let r=n.runtime??ue,s=JSON.stringify(t);if(s===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let a=Buffer.from(`${s}
6
+ `),i=Math.max(1,Math.floor(n.maxSegmentBytes),a.length);return ce(e,n.lockTimeoutMs,r,()=>{r.makeDirectory(De(e));let c=We(e,A,r);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??O}`,u=!1,g=!1;return r.exists(e)&&r.size(e)+a.length>i&&(r.exists(o)&&(r.remove(o),g=!0),n.onPhase?.("previous-pruned"),r.rename(e,o),u=!0,n.onPhase?.("current-rotated")),r.append(e,a),n.onPhase?.("record-appended"),{lineBytes:a.length,segmentLimitBytes:i,repairedTailBytes:c,rotated:u,prunedPrevious:g}})}function le(e,t={}){let n=t.runtime??ue,r=Fe(t.maxSegmentBytes);return ce(e,t.lockTimeoutMs,n,()=>{let s=[],a=0,i=`${e}${t.previousSuffix??O}`;for(let c of[i,e]){if(!n.exists(c))continue;let o=Ge(ge(c,r,n));s.push(...o.lines),a+=o.partialTailBytes}return{lines:s,ignoredPartialTailBytes:a}})}function ce(e,t,n,r){let s=`${e}${Je}`,a=Math.max(0,t??Ce),i=n.monotonicNow()+a,c;for(;;){let m=n.tryAcquireLock(s,e);if(m.kind==="acquired"){c=m.lock;break}let y=i-n.monotonicNow();if(y<=0)throw new W(s,a);n.wait(Math.min(5,y))}let o=!1,u,g;try{g=r()}catch(m){o=!0,u=m}let d=!1;try{d=c.release()}catch(m){if(!o)throw m}if(o)throw u;if(!d)throw new F(s);return g}function We(e,t,n){if(!n.exists(e))return 0;let r=ge(e,t,n);if(r.length===0||r[r.length-1]===10)return 0;let s=r.lastIndexOf(10),a=s<0?0:s+1;return n.truncate(e,a),r.length-a}function Fe(e){let t=e??A;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function ge(e,t,n){let r=n.size(e);if(r>t)throw new D("rotating JSONL segment",e,"too-large",r,t);let s=n.readBytes(e),a=n.size(e);if(a!==r||s.byteLength!==r)throw new D("rotating JSONL segment",e,"changed-during-read",a,t);return s}function Ge(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
7
+ `).filter(s=>s.length>0),partialTailBytes:e.length-n}}var ze="reindex-activity.jsonl",k=O,Ue=1024*1024,Ve=1440*60*1e3,me=e=>j(e,"reindex activity segment");function q(e){return be(Re(e),ze)}function Ke(e){if(e.reused)return 0;let n=(e.shards?.some(r=>!r.reused&&r.strategy==="incremental")??!1?0:G(e.indexPath))+G(e.dbPath);for(let r of e.shards??[]){if(r.reused)continue;let s=r.producedOutputBytes??r.outputBytes;s!==null&&(n+=s)}return n}function _t(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let r=Ke(t);return xe(q(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:r,estimatedWriteBytes:r+(t.writeTelemetry?.fallbackCopiedBytes??0),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,byLanguage:Ze(t)})}function Mt(e,t){return xe(q(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function je(e,t,n=Ue,r){de(e,t,{maxSegmentBytes:n,previousSuffix:k,...r?{runtime:r}:{}})}function Xe(e,t=new Date,n=Ve,r=me){let s=t.getTime(),a=s-n,i={confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(a).toISOString(),windowEndedAt:t.toISOString(),runs:0,rebuilt:0,fullRebuilds:0,reused:0,failed:0,suppressed:0,estimatedLogicalOutputBytes:0,estimatedWriteBytes:0,reflinkedBytes:0,fallbackCopiedBytes:0,languageAttribution:"complete",attributedRuns:0,unattributedRuns:0,invalidLanguageDetails:0,byLanguage:{},byTrigger:{}},c=q(e),o=[];if(r===me){if(!fe(c)&&!fe(`${c}${k}`))return i;try{let u=le(c,{previousSuffix:k});o=u.lines,i.ignoredPartialTailBytes=u.ignoredPartialTailBytes}catch{i.readErrors+=1,i.confidence="unavailable"}}else{let u=0;for(let g of[`${c}${k}`,c])try{o.push(...st(r(g))),u+=1}catch{i.readErrors+=1}u===0?i.confidence="unavailable":i.readErrors>0&&(i.confidence="partial")}for(let u of o){i.recordsRead+=1;let g=Ye(u);if(!g){i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial");continue}let{record:d}=g,m=Date.parse(d.recordedAt);if(m<a||m>s){i.skippedRecords+=1;continue}if(i.invalidLanguageDetails=(i.invalidLanguageDetails??0)+g.invalidLanguageDetails,i.byTrigger[d.trigger.kind]=(i.byTrigger[d.trigger.kind]??0)+1,d.event==="suppressed"){i.suppressed+=1;continue}i.runs+=1,i[d.result]+=1,i.estimatedLogicalOutputBytes+=d.estimatedLogicalOutputBytes,i.estimatedWriteBytes=(i.estimatedWriteBytes??0)+(d.estimatedWriteBytes??d.estimatedLogicalOutputBytes),i.reflinkedBytes=(i.reflinkedBytes??0)+(d.reflinkedBytes??0),i.fallbackCopiedBytes=(i.fallbackCopiedBytes??0)+(d.fallbackCopiedBytes??0),d.result!=="failed"&&(g.hasLanguageDetails?i.attributedRuns=(i.attributedRuns??0)+1:i.unattributedRuns=(i.unattributedRuns??0)+1);for(let[y,R]of ve(d.byLanguage)){let p=(i.byLanguage??={})[y]??=rt();p.runs+=1,p[R.result]+=1,p.producedOutputBytes+=R.producedOutputBytes,p.durationMs+=R.durationMs}pe(d)&&i.oldestRebuildAt===void 0&&(i.oldestRebuildAt=d.recordedAt),pe(d)&&(i.fullRebuilds=(i.fullRebuilds??0)+1),(d.estimatedWriteBytes??d.estimatedLogicalOutputBytes)>0&&i.oldestWriteAt===void 0&&(i.oldestWriteAt=d.recordedAt)}return i.ignoredPartialTailBytes>0&&i.confidence!=="unavailable"&&(i.confidence="partial"),i.languageAttribution=it(i),i}function xe(e,t){try{return je(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function Ye(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(n.version!==1||!V(n.recordedAt)||!n.trigger||!Qe(n.trigger.kind))return null;if(n.event==="suppressed")return n.reason==="completed-index-is-fresh"?{record:n,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(n.event!=="run"||n.result!=="rebuilt"&&n.result!=="reused"&&n.result!=="failed"||!x(n.durationMs)||!x(n.estimatedLogicalOutputBytes)||n.estimatedWriteBytes!==void 0&&!x(n.estimatedWriteBytes)||n.reflinkedBytes!==void 0&&!x(n.reflinkedBytes)||n.fallbackCopiedBytes!==void 0&&!x(n.fallbackCopiedBytes))return null;let r=n,{byLanguage:s,...a}=r,i=et(s);return{record:{...a,...i.byLanguage?{byLanguage:i.byLanguage}:{}},hasLanguageDetails:i.hasLanguageDetails,invalidLanguageDetails:i.invalidLanguageDetails}}catch{return null}}function $t(e,t,n=new Date){return t.enabled?He(Xe(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function He(e,t,n){let r=e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,s=e.fullRebuilds??e.rebuilt,a={rebuilt:s,estimatedWriteBytes:r};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...a,detail:`reindex activity evidence is ${e.confidence}`}:s>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:ye(e.oldestRebuildAt,t.windowMs,n),...a,detail:`${s}/${t.maxRebuilds} expensive full rebuild slots consumed`}:r>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:ye(e.oldestWriteAt,t.windowMs,n),...a,detail:`${r}/${t.maxEstimatedWriteBytes} estimated write bytes consumed`}:{state:"allowed",...a}:{state:"allowed",...a}}function pe(e){if(e.result!=="rebuilt")return!1;let t=ve(e.byLanguage);return t.length===0?!0:t.some(([,n])=>n.result==="rebuilt"&&n.strategy!=="incremental"&&n.strategy!=="reused")}function ye(e,t,n){let r=e?Date.parse(e):Number.NaN;return Number.isFinite(r)&&r+t>n?r+t:n+t}function Qe(e){return e==="manual-cli"||e==="setup"||e==="watch-source"||e==="watch-startup"||e==="watch-demand"||e==="watch-git-head"||e==="watch-git-index"||e==="watch-git-state"||e==="unknown"}function G(e){try{return qe(e).size}catch{return 0}}function Ze(e){let t={};for(let n of e.languages){let r=(e.shards??[]).filter(u=>u.language===n),s=r.find(u=>u.id===n),a=e.reused||(s?s.reused:r.length>0&&r.every(u=>u.reused)),i=G(be(Re(e.dbPath),"language-indexes",`${n}.scip`)),c=i>0?i:s?.outputBytes??i,o=a?0:s?.durationMs??r.filter(u=>!u.reused).reduce((u,g)=>u+g.durationMs,0);t[n]={result:a?"reused":"rebuilt",strategy:a?"reused":s?.strategy??"full",...s?.strategy==="full"&&(s.fallbackReason??s.missReason)?{fallbackReason:s.fallbackReason??s.missReason}:{},outputBytes:c,producedOutputBytes:a?0:s?.producedOutputBytes??c,durationMs:o}}return t}function et(e){if(e===void 0)return{hasLanguageDetails:!1,invalidLanguageDetails:0};if(!e||typeof e!="object"||Array.isArray(e))return{hasLanguageDetails:!1,invalidLanguageDetails:1};let t={},n=0;for(let[s,a]of Object.entries(e)){if(!nt(s)||!tt(a)){n+=1;continue}t[s]=a}let r=Object.keys(t).length>0;return{...r?{byLanguage:t}:{},hasLanguageDetails:r,invalidLanguageDetails:n}}function tt(e){if(!e||typeof e!="object")return!1;let t=e;return(t.result==="rebuilt"||t.result==="reused")&&(t.strategy===void 0||t.strategy==="reused"||t.strategy==="incremental"||t.strategy==="full")&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")&&M(t.outputBytes)&&M(t.producedOutputBytes)&&x(t.durationMs)&&(t.result!=="reused"||t.producedOutputBytes===0&&t.durationMs===0)&&t.producedOutputBytes<=t.outputBytes}function nt(e){return $.includes(e)}function ve(e){return e?$.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function rt(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function it(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function st(e){return e.endsWith(`
8
+ `)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
9
+ `)+1))),e.split(`
10
+ `).filter(t=>t.length>0)}export{lt as a,h as b,ct as c,C as d,bt as e,we as f,xt as g,vt as h,O as i,de as j,ze as k,_t as l,Mt as m,$t as n};
11
+ //# sourceMappingURL=chunk-S73HBCGI.js.map
@@ -0,0 +1,210 @@
1
+ import{d as Zt}from"./chunk-DOPCR5BY.js";import{a as nn,b as h,c as fe,d as rn,e as me,f as _e}from"./chunk-VWLIOEEF.js";import{b as K,c as sn,d as on,e as we,g as ut}from"./chunk-DRENNWRG.js";import{a as at,b as ct,e as lt}from"./chunk-HGFDYOVB.js";import{da as en,ea as tn,h as Ae,z as N}from"./chunk-4DCKBY6T.js";var Ar=h("source-text",{clearGroups:["whole-project","source-file"]}),wr=h("source-lines",{clearGroups:["whole-project","source-file"]});function b(e,t){let n=t.replace(/\\/g,"/");return Ar.get(e,n,()=>{try{return en(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(r){if(tn(r))return"";throw r}})}function ac(e){if(e.length===0)return[];let t=e.split(`
2
+ `);return e.endsWith(`
3
+ `)&&t.pop(),t}function pt(e,t){let n=t.replace(/\\/g,"/");return wr.get(e,n,()=>{let r=b(e,n);return r?r.split(`
4
+ `):[]})}var Or=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function jr(e){let t=Or.exec(e);return t?t[1]??"":null}function cc(e,t,n){return Mr(e,t,n).length>0}function Mr(e,t,n){if(n<=0)return[];let r=pt(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=jr(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 an}from"path";var $r={".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 z(e){return $r[an(e).toLowerCase()]??null}function q(e){return an(e).toLowerCase()===".vue"}import{createHash as Br}from"crypto";import{existsSync as Vr,mkdirSync as Ur}from"fs";import{dirname as cn,join as Wr}from"path";import dt from"better-sqlite3";var Hr="evidence.db";var Xr=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],ft=new Set(Xr),Kr=25e4,zr=512*1024*1024,qr=6e4,Oe=new WeakMap,Jr=h("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Qr=h("evidence-project-fingerprint",{clearGroups:["whole-project"]}),T="evidence-v1",ge="version NOT LIKE 'evidence-%'";function je(e){return Br("sha256").update(e).digest("hex")}function J(e,t,n){return Jr.get(e,t,()=>je(n))}function Ce(e){return Qr.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=Zt(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,r=[...n.indexedLanguages??[]].sort();return je(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:r,status:n.status}))}catch(t){return te("project fingerprint unavailable",t),null}})}function te(e,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function M(e){if(Oe.has(e))return Oe.get(e)??null;let t=null;try{let n=new dt(Wr(cn(e.config.dbPath),Hr));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
5
+ CREATE TABLE IF NOT EXISTS file_evidence (
6
+ kind TEXT NOT NULL,
7
+ relative_path TEXT NOT NULL,
8
+ content_hash TEXT NOT NULL,
9
+ version TEXT NOT NULL,
10
+ payload TEXT NOT NULL,
11
+ PRIMARY KEY (kind, relative_path)
12
+ );
13
+ CREATE TABLE IF NOT EXISTS project_evidence (
14
+ kind TEXT NOT NULL,
15
+ cache_key TEXT NOT NULL,
16
+ project_fingerprint TEXT NOT NULL,
17
+ version TEXT NOT NULL,
18
+ payload TEXT NOT NULL,
19
+ PRIMARY KEY (kind, cache_key)
20
+ );
21
+ CREATE TABLE IF NOT EXISTS semantic_callees (
22
+ relative_path TEXT NOT NULL,
23
+ symbol TEXT NOT NULL,
24
+ content_hash TEXT NOT NULL,
25
+ deps_digest TEXT NOT NULL,
26
+ version TEXT NOT NULL,
27
+ payload TEXT NOT NULL,
28
+ PRIMARY KEY (relative_path, symbol)
29
+ );
30
+ CREATE TABLE IF NOT EXISTS semantic_references (
31
+ relative_path TEXT NOT NULL,
32
+ symbol TEXT NOT NULL,
33
+ project_fingerprint TEXT NOT NULL,
34
+ version TEXT NOT NULL,
35
+ payload TEXT NOT NULL,
36
+ PRIMARY KEY (relative_path, symbol)
37
+ );
38
+ `),t={evidence:n,shared:Yr(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
39
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${ge}
40
+ ORDER BY version DESC
41
+ 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
42
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${ge}
43
+ ORDER BY version DESC
44
+ 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
45
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
46
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${ge}
47
+ ORDER BY version DESC
48
+ LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
49
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
50
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${ge}
51
+ ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
52
+ (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
53
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
54
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${ge}
55
+ ORDER BY version DESC
56
+ LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
57
+ WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
58
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${ge}
59
+ ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
60
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(n){te("disabled (open failed)",n)}return Oe.set(e,t),t}function $(e,t,n){te(`disabled (${t})`,n),Oe.set(e,null)}function Yr(e){if(!e)return null;try{Ur(cn(e),{recursive:!0});let t=new dt(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
61
+ CREATE TABLE IF NOT EXISTS file_evidence (
62
+ kind TEXT NOT NULL,
63
+ relative_path TEXT NOT NULL,
64
+ content_hash TEXT NOT NULL,
65
+ version TEXT NOT NULL,
66
+ payload TEXT NOT NULL,
67
+ last_accessed_at INTEGER NOT NULL,
68
+ PRIMARY KEY (kind, relative_path, content_hash, version)
69
+ );
70
+ CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
71
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
72
+ `),{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)
73
+ VALUES (?, ?, ?, ?, ?, ?)
74
+ ON CONFLICT(kind, relative_path, content_hash, version)
75
+ DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:t.prepare(`UPDATE file_evidence
76
+ SET last_accessed_at = ?
77
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
78
+ AND last_accessed_at < ?`)}}catch(t){return te("shared cache disabled (open failed)",t),null}}function mt(e,t,n){te(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function Sc(e,t={}){if(!Vr(e))return null;let n;try{n=new dt(e),n.pragma("busy_timeout = 50"),n.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
79
+ 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??Kr,s=t.budgetBytes??zr,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 (
80
+ SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
81
+ )`).run(p),n.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:p,remainingRows:r-p}}catch(r){return te("shared cache maintenance skipped",r),null}finally{try{n?.close()}catch{}}}function ln(e,t,n,r){let i=M(e);if(!i)return null;try{let s=i.readFileEvidence.get(t,n,r,T)??i.readLegacyFileEvidence.get(t,n,r);if(s?.payload!==void 0)return s.payload;if(!ft.has(t)||!i.shared)return null;try{let o=i.shared.readFileEvidence.get(t,n,r,T);return o?.payload!==void 0&&Gr(i.shared,t,n,r),o?.payload??null}catch(o){return mt(i,"file_evidence read",o),null}}catch(s){return $(e,"file_evidence read",s),null}}function Gr(e,t,n,r){let i=Date.now();try{e.touchFileEvidence.run(i,t,n,r,T,i-qr)}catch(s){te("shared file_evidence recency touch skipped",s)}}function un(e,t,n,r,i){let s=M(e);if(s)try{if(s.writeFileEvidence.run(t,n,r,T,i),ft.has(t)&&s.shared)try{s.shared.writeFileEvidence.run(t,n,r,T,i,Date.now())}catch(o){mt(s,"file_evidence write",o)}}catch(o){$(e,"file_evidence write",o)}}function pn(e,t){if(t.length===0)return;let n=M(e);if(n)try{n.evidence.transaction(()=>{for(let i of t)n.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,T,i.payload)})();let r=t.filter(i=>ft.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,T,i.payload,Date.now())})()}catch(i){mt(n,"file_evidence batch write",i)}}catch(r){$(e,"file_evidence batch write",r)}}function dn(e,t,n,r){let i=M(e);if(!i)return null;try{return(i.readProjectEvidence.get(t,n,r,T)??i.readLegacyProjectEvidence.get(t,n,r))?.payload??null}catch(s){return $(e,"project_evidence read",s),null}}function fn(e,t,n,r,i){let s=M(e);if(s)try{s.writeProjectEvidence.run(t,n,r,T,i)}catch(o){$(e,"project_evidence write",o)}}function xc(e,t,n,r){let i=M(e);if(!i)return new Map;try{let s=i.readCalleesForFile.all(t,n,r,T),o=i.readLegacyCalleesForFile.all(t,n,r);return mn([...o,...s])}catch(s){return $(e,"semantic_callees bulk read",s),new Map}}function bc(e,t,n){let r=M(e);if(!r)return new Map;try{let i=r.readReferencesForFile.all(t,n,T),s=r.readLegacyReferencesForFile.all(t,n);return mn([...s,...i])}catch(i){return $(e,"semantic_references bulk read",i),new Map}}function mn(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function Ec(e,t){if(t.length===0)return;let n=M(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,T,i.payload)}})()}catch(r){$(e,"semantic_callees write",r)}}function Nc(e,t){if(t.length===0)return;let n=M(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,T,i.payload)}})()}catch(r){$(e,"semantic_references write",r)}}var Zr=[_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),_("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"}),Me("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"}),Me("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"}),Me("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"}),Me("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 ne(e){let t=new Map;return{kind:e.kind,read(n,r,i){let s=!1,o=0,a;if(at()){let c=Ce(n);if(c){let l=`${c}\0${r}\0${i}`;a=t.get(l),a||(a=ct(["evidence-product-file-read-v1",e.kind,c,r,i]),t.set(l,a))}}return lt("evidence-product.file.read",()=>{let c=ln(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){un(n,e.kind,r,i,e.serialize(s))},writeBatch(n,r){pn(n,r.map(i=>({kind:e.kind,relativePath:i.relativePath,contentHash:i.contentHash,payload:e.serialize(i.value)})))}}}function vc(e){let t=new Map;return{kind:e.kind,read(n,r,i){let s=!1,o=0,a;if(at()){let c=`${i}\0${r}`;a=t.get(c),a||(a=ct(["evidence-product-project-read-v1",e.kind,i,r]),t.set(c,a))}return lt("evidence-product.project.read",()=>{let c=dn(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){fn(n,e.kind,r,i,e.serialize(s))}}}function re(e){let t=Zr.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function _(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function Me(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}import{createRequire as ei}from"module";var E=ei(import.meta.url),$e=null,gn=!1;function ti(){if(gn)return null;if($e)return $e;try{return $e=E("tree-sitter"),$e}catch{return gn=!0,null}}var yn=new Map,Be=new Set;function ni(e){if(Be.has(e))return null;let t=yn.get(e);if(t)return t;let n;try{switch(e){case"rust":n=E("tree-sitter-rust");break;case"typescript":n=E("tree-sitter-typescript").typescript;break;case"tsx":n=E("tree-sitter-typescript").tsx;break;case"javascript":n=E("tree-sitter-javascript");break;case"python":n=E("tree-sitter-python");break;case"java":n=E("tree-sitter-java");break;case"kotlin":n=E("tree-sitter-kotlin");break;case"scala":n=E("tree-sitter-scala");break;case"ruby":n=E("tree-sitter-ruby");break;case"c":n=E("tree-sitter-c");break;case"cpp":n=E("tree-sitter-cpp");break;case"csharp":n=E("tree-sitter-c-sharp");break;case"php":n=E("tree-sitter-php").php;break;case"vb":{let r=E("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Be.add(e),null}}catch{return Be.add(e),null}return yn.set(e,n),n}var hn=new Map;function ri(e){let t=hn.get(e);if(t)return t;let n=ni(e);if(!n)return null;let r=ti();if(!r)return null;let i=new r;try{i.setLanguage(n)}catch{return Be.add(e),null}return hn.set(e,i),i}function ii(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function Ie(e,t){let n=ri(e);if(!n)return null;try{return ii(n,t)}catch{return null}}import{createRequire as si}from"module";import{posix as gt}from"path";var Oc=rn("vue-sfc-units"),oi=si(import.meta.url),ai;function ci(){return ai??=oi("@vue/compiler-sfc")}function li(...e){return ci().parse(...e)}function ui(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function pi(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function bn(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let i;try{i=li(n,{filename:t})}catch(o){return r.errors.push(xn(o)),r}r.errors.push(...i.errors.map(xn));let{descriptor:s}=i;return s.template&&(r.template=Ve(e,t,"template",s.template)),s.script&&r.scripts.push(Sn(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(Sn(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(o=>Ve(e,t,"style",o)),r.customBlocks=s.customBlocks.map(o=>Ve(e,t,"custom",o)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(o=>o?.errors??[])),r}function Sn(e,t,n,r){let i=Ve(e,t,"script",n);return{...i,kind:"script",setup:r,astLanguage:pi(i.lang)}}function Ve(e,t,n,r){let i=fi(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=di(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=b(e,c),u=l?Math.max(0,l.split(`
82
+ `).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 di(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=ui(gt.normalize(gt.join(gt.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function fi(e){return{...e}}function xn(e){return e instanceof Error?e.message:String(e)}function Te(e,t,n){let i=bn(e,t,n).scripts.filter(o=>o.astLanguage&&o.body.length>0),s=i[0]?.astLanguage;return s?{body:i.map(o=>`${`
83
+ `.repeat(o.startLine)}${o.body}`).join(`
84
+ `),startLine:0,language:s}:null}var En=me("ast-trees",{clearGroups:["whole-project","source-file"]});function B(e,t){if(q(t))return mi(e,t);let n=z(t);if(!n)return null;let r=b(e,t);return r?En.get(e,t,r,()=>Ie(n,r)):null}function Le(e,t,n){if(q(t)){let s=Te(e,t,n);if(!s)return null;let o=Ie(s.language,`
85
+ `.repeat(s.startLine)+s.body);return o?{tree:o,language:s.language}:null}let r=z(t);if(!r)return null;let i=Ie(r,n);return i?{tree:i,language:r}:null}function mi(e,t){let n=b(e,t);return n?En.get(e,t,n,()=>{let r=Te(e,t,n);if(!r)return null;let i=`
86
+ `.repeat(r.startLine)+r.body;return Ie(r.language,i)}):null}function ve(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var vn=["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"],gi=new Set(vn),yi=[...vn,"variable_declarator","public_field_definition"],hi=["function_item","function_signature_item"],Si=["function_definition"],xi=[],Nn=new Set(["arrow_function","function_expression","generator_function"]);function Dn(e){return e==="rust"?hi:e==="python"?Si:e==="typescript"||e==="tsx"||e==="javascript"?yi:xi}function Ue(e,t){let n=Ei(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:Tn(n.functionNode),params:_n(n.functionNode),paramsEndLine:Cn(n.functionNode),isLiteralPassthrough:Ln(n.functionNode,t)};if(!bi(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:Tn(e),params:_n(e),paramsEndLine:Cn(e),isLiteralPassthrough:Ln(e,t)}:null}function Rn(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function _n(e){let t=Rn(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(ve(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 Cn(e){let t=Rn(e);return t?t.endPosition.row:e.startPosition.row}function bi(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?gi.has(e):!1}function Ei(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=In(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=In(r);return i?{name:n.text,definitionNode:e,functionNode:i}:null}return null}function In(e){if(Nn.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=>Nn.has(i.type));return r.length===1?r[0]:null}function Tn(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)ve(r)||(n+=1);return n}function Ln(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=>!ve(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=>!ve(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(f=>f.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}function qc(e,t){return e.filter(n=>n.startLine<=t&&n.endLine>=t).sort((n,r)=>n.endLine-n.startLine-(r.endLine-r.startLine)||n.startLine-r.startLine)[0]??null}function kn(e,t){let n=_i(e,t);if(!n)return null;let r=ie(n);if(!r)return null;let i=Ci(n);return{calleeLeaf:r,calleeQualifier:i?Ni(n):void 0,calleeText:n.text,memberAccess:i,line:e.startPosition.row}}function Ni(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function _i(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 Ci(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function ie(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?ie(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?ie(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?ie(t):null}case"super":case"self":case"this":return null;default:return null}}var Ii=new Set(["identifier","type_identifier","field_identifier"]),Ti=new Set(["identifier"]),Li=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),vi=new Set(["rust","python"]),Di=/\{([^{}]*)\}/g,Ri=/\b([A-Za-z_][\w]*)\b/g;function Fn(e,t){return ki(t).has(e.type)}function Pn(e,t){return vi.has(t)&&e.type==="string_content"}function yt(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 ki(e){return e==="rust"?Ii:e==="python"?Ti:Li}function An(e,t){let n=e.startPosition.row;for(let r of e.text.matchAll(Di)){let i=r[1]??"";for(let s of i.matchAll(Ri))s[1]&&t(s[1],n)}}var Fi=[/\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],Pi=/^#!?\[\s*serde\s*\(/,Ai=/^#!?\[\s*schemars\s*\(/,wi=/^#!?\[\s*validate\s*\(/,Oi=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function wn(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=ie(r);if(!i||!Oi.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 On(e,t){let n=Pi.test(e),r=Ai.test(e),i=wi.test(e);if(!(!n&&!r&&!i))for(let s of Fi){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 jn(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 ji=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),ht=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 Mn(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===`
87
+ `){o+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=He(e,a);continue}if(l==='"'){let x=Re(e,a,o);o=x.line,a=x.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 x=s.pop();x&&(x.endLine=o,Mi(x,{callables:t,callSites:n,clojureMembers:r,recordIdentifier:c}),s[s.length-1]?.children.push(x)),a+=1;continue}if(St(l)){a+=1;continue}let u=o,p=a;for(;a<e.length&&!xt(e[a]);)a+=1;let d=e.slice(p,a);if(!d)continue;let f={text:d,line:u};$i(s[s.length-1],f),c(R(d),u)}return{language:"clojure",callables:t,callSites:n,clojureMembers:r,typeContainerMap:new Map,identifierLineMap:i,identifiersByLine:Hi(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Mi(e,t){if(e.kind!=="("||e.headTokens.length===0)return;let n=e.headTokens[0],r=R(n.text),i=ji.get(n.text);if(i){let o=e.headTokens[1];if(o){let a=R(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(Bi(e,t),!r||ht.has(n.text)||ht.has(r)||r.startsWith(":"))return;let s=Wi(n.text);t.callSites.push({calleeLeaf:s.leaf,calleeQualifier:s.qualifier,calleeText:s.text,memberAccess:!1,line:n.line})}function $i(e,t){e&&(e.headTokens.length<2&&e.headTokens.push(t),e.tokens.length<200&&e.tokens.push(t))}function Bi(e,t){let n=R(e.tokens[0]?.text??"");if(n==="defprotocol"){let r=R(e.tokens[1]?.text??"");if(!r)return;for(let i of We(e))De(t,r,"protocol",i,"protocol-method");return}if(n==="defrecord"||n==="deftype"){let r=R(e.tokens[1]?.text??"");if(!r)return;let i=n==="defrecord"?"record":"type",s=n==="defrecord"?"record-method":"type-method";for(let o of We(e))De(t,r,i,o,s);return}if(n==="extend-type"){let r=R(e.tokens[1]?.text??"");if(!r)return;for(let i of We(e))De(t,r,"extension",i,"extension-method");return}if(n==="extend-protocol"){let r=R(e.tokens[1]?.text??"");for(let i of We(e)){r&&De(t,r,"extension",i,"extension-method");let s=Ui(e,i.startLine);s&&s!==r&&De(t,s,"extension",i,"extension-method")}}}function We(e){return e.children.filter(Vi)}function Vi(e){if(e.kind!=="(")return!1;let t=R(e.tokens[0]?.text??"");return!!(t&&!ht.has(t)&&!t.startsWith(":"))}function De(e,t,n,r,i){let s=r.tokens[0],o=R(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 Ui(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=R(i.text);s&&!s.startsWith(":")&&(n=s)}return n}function R(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Wi(e){let t=e.replace(/^#?['`~@]+/,""),n=t.lastIndexOf("/"),r=R(t);if(n<=0)return{leaf:r,text:t};let i=t.slice(0,n);return{leaf:r,qualifier:i,text:t}}function He(e,t){let n=t;for(;n<e.length&&e[n]!==`
88
+ `;)n+=1;return n}function Re(e,t,n){let r=t+1,i=n;for(;r<e.length;){let s=e[r];if(s==="\\"){r+=2;continue}if(s===`
89
+ `&&(i+=1),r+=1,s==='"')break}return{index:r,line:i}}function St(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function xt(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Hi(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 $n=6,Xi=me("source-facts",{clearGroups:["whole-project","source-file"]}),bt=ne({kind:"source-facts",invalidation:re("source-facts"),serialize:qi,deserialize:Ji});function ye(e,t){return Et(e,t).facts}function Et(e,t){let n=b(e,t);if(!n)return{facts:null};let r=Ki(e,t,n);return r?Xi.get(e,t,n,()=>zi(e,t,r,n)):{facts:null}}function Ki(e,t,n){return q(t)?Te(e,t,n)?.language??null:z(t)}function zi(e,t,n,r){let i=J(e,t,r),s=bt.read(e,t,i);if(s&&s.language===n)return{facts:s};if(n==="clojure"){let c=Mn(r);return bt.write(e,t,i,c),{facts:c}}let o=B(e,t);if(!o)return{facts:null,unavailable:{language:n,reason:"parser-unavailable"}};let a=Qi(o,n);return bt.write(e,t,i,a),{facts:a}}function qi(e){let t={version:$n,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 Ji(e){try{let t=JSON.parse(e);if(t.version!==$n||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:yt(n),fileIdentifiers:new Set(n.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function Qi(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=Ue(l,t);u&&n.push(u);let p=kn(l,t);p&&r.push(p),wn(l,t,s),t==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&On(l.text,i),Fn(l,t)&&a(l.text,l.startPosition.row),Pn(l,t)&&An(l,a);for(let d of l.children)c(d)};return c(e.rootNode),{language:t,callables:n,callSites:r,clojureMembers:[],typeContainerMap:jn(e,t),identifierLineMap:o,identifiersByLine:yt(o),fileIdentifiers:new Set(o.keys()),rustAttrReferencedNames:i,crossLanguageDispatchNames:s}}function Nt(e,t){t(e);for(let n of e.namedChildren)Nt(n,t)}function Yi(e,t,n){let r=null;return Nt(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function Bn(e,t,n){if(e.startPosition.row>t||e.endPosition.row<n)return null;for(let r of e.namedChildren){let i=Bn(r,t,n);if(i)return i}return e}function Gi(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function _t(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?_t(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function Zi(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(_t)??[]}var Vn=new Set(["rust","typescript","tsx","javascript","python","clojure"]),es=new Set(["rust","typescript","tsx","javascript","python"]);function Ct(e,t){let n=ye(e,t);return!n||!Vn.has(n.language)?null:n.callables.map(r=>({name:r.name,startLine:r.startLine,endLine:r.endLine}))}function ts(e,t){if(!es.has(t))return null;let n=[];for(let r of e.descendantsOfType([...Dn(t)])){let i=Ue(r,t);i&&n.push({name:i.name,startLine:i.startLine,endLine:i.endLine})}return n}function ns(e,t){let n=ye(e,t);return!n||!Vn.has(n.language)?null:n.callSites}function Un(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}import{createRequire as fs}from"module";import{existsSync as ae}from"fs";import{basename as Hn,dirname as L,extname as V,join as k,relative as se,resolve as S,sep as ms}from"path";import{existsSync as Tt,readdirSync as rs,statSync as is}from"fs";import{join as he,relative as ss}from"path";function Wn(e){let t=os(e)??us(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let i of t)for(let s of ps(e,i)){if(r.has(s))continue;r.add(s);let o=ds(e,s);o&&n.push(o)}return n}function os(e){let t=he(e,"pnpm-workspace.yaml");if(!Tt(t))return null;try{return as(Ae(t,"pnpm workspace manifest"))}catch{return null}}function as(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let i=cs(r);if(!n){/^packages\s*:\s*$/.test(i.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(i);if(s){let o=ls(s[1].trim());o&&t.push(o);continue}if(i.trim()!=="")break}return t}function cs(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function ls(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function us(e){let t=he(e,"package.json");if(!Tt(t))return null;try{let n=JSON.parse(Ae(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function ps(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let o=he(e,t);return It(o)?[o]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),i=t.slice(n+1).replace(/^\//,""),s=he(e,r||".");return It(s)?rs(s).map(o=>he(s,o,i)).filter(It):[]}function It(e){try{return is(e).isDirectory()}catch{return!1}}function ds(e,t){let n=he(t,"package.json");if(!Tt(n))return null;try{let r=JSON.parse(Ae(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:ss(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var gs=fe("indexed-paths",{clearGroups:[]}),ys=fe("indexed-path-digest",{clearGroups:[]}),hs=h("tsconfig-alias-config",{clearGroups:["whole-project"]}),Ss=h("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),xs=fs(import.meta.url),ke;function bs(){if(ke!==void 0)return ke;try{ke=xs("typescript")}catch{ke=null}return ke}var Es=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Ns=fe("workspace-packages",{clearGroups:["whole-project"]}),oe=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],Xe=[".py",".pyi"],v=[".java",".scala",".kt",".kts"],Ke=[".rs"],ze=[".rb"],qe=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Q=[".cs",".vb"],Je=[".dart"],ce=[".php"],Se=[".clj",".cljs",".cljc"],_s=new Set(oe),Lt=new Set(Xe),Xn=new Set(v),vt=new Set(Ke),Dt=new Set(ze),Kn=new Set(qe),zn=new Set(Q),Rt=new Set(Je),qn=new Set(ce),Jn=new Set(Se),Cs=[{extensions:oe,lookup:_s},{extensions:Xe,lookup:Lt},{extensions:v,lookup:Xn},{extensions:Ke,lookup:vt},{extensions:ze,lookup:Dt},{extensions:qe,lookup:Kn},{extensions:Q,lookup:zn},{extensions:Je,lookup:Rt},{extensions:ce,lookup:qn},{extensions:Se,lookup:Jn}];function U(e,t){return t.has(V(e).toLowerCase())}function Is(e){return U(e,Lt)}function Ts(e){return U(e,Xn)}function Ls(e){return U(e,vt)}function vs(e){return U(e,Dt)}function Ds(e){return U(e,Kn)}function Rs(e){return U(e,zn)}function Qn(e){return V(e).toLowerCase()===".vb"}function ks(e){return U(e,Rt)}function Fs(e){return U(e,qn)}function Ps(e){return U(e,Jn)}function kt(e){let t=V(e).toLowerCase();for(let n of Cs)if(n.lookup.has(t))return n.extensions;return oe}function As(e){return Ts(e)||Rs(e)||Fs(e)}function Y(e,t,n){return Is(t)?xe(e,t,n):Ls(t)?W(e,t,n):vs(t)?Qe(e,t,n):Ds(t)?Ye(e,t,n):As(t)?g(e,n.replace(/\\/g,"."),kt(t)):ks(t)?Ge(e,t,n):Ps(t)?Ft(e,n):ws(e,t,n)}function ws(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return Os(e,t,n)??Ms(e,n);let r=L(k(e.config.projectRoot,t)),i=S(r,n),s=H(e);for(let o of At(i)){let a=N(se(e.config.projectRoot,o));if(s.has(a)||ae(o))return a}return N(se(e.config.projectRoot,i))}function Os(e,t,n){let r=Hs(e,t);if(!r)return null;let i=H(e);for(let s of js(r,n)){let o=S(r.baseUrl,s);for(let a of At(o)){let c=N(se(e.config.projectRoot,a));if(i.has(c)||ae(a))return c}}return null}function js(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 Ms(e,t){let n=Bs($s(e),t);if(!n)return null;let r=H(e);for(let i of Vs(n)){let s=S(e.config.projectRoot,n.pkg.relativeDir,i);for(let o of At(s)){let a=N(se(e.config.projectRoot,o));if(r.has(a)||ae(o))return a}}return null}function $s(e){return Ns.get(e,()=>Wn(e.config.projectRoot))}function Bs(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 Vs(e){let t=[],n=Us(e.pkg.exports,e.subpath);if(n){let r=Ws(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function Us(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Yn(e[n])}function Yn(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=Yn(t[n]);if(r)return r}return null}function Ws(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function Hs(e,t){let n=N(L(t));return Ss.get(e,n,()=>Xs(e,n))}function Xs(e,t){let n=bs();if(!n)return null;let r=S(e.config.projectRoot),i=S(r,t);for(;i===r||i.startsWith(r+ms);){for(let o of Es){let a=k(i,o);if(!ae(a))continue;let c=hs.get(e,a,()=>Ks(n,a));if(c)return c}let s=L(i);if(s===i)break;i=s}return null}function Ks(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?S(L(t),r.options.baseUrl):L(t),paths:i}}catch{return null}}function xe(e,t,n){let r=H(e),i;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let o=s[1].length,a=s[2].replace(/^\./,""),c=L(k(e.config.projectRoot,t));for(let l=1;l<o;l++)c=L(c);i=a?S(c,a.replace(/\./g,"/")):c}else i=S(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of zs(i)){let o=N(se(e.config.projectRoot,s));if(r.has(o)||ae(s))return o}return null}function W(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(k(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=S(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=S(i,r.slice(6).replace(/::/g,"/")):s=S(L(i),r.slice(7).replace(/::/g,"/")),Pt(e,qs(s))}function Qe(e,t,n){let r=L(k(e.config.projectRoot,t)),i=S(r,n);return Pt(e,Js(i))}function Ye(e,t,n){let r=L(k(e.config.projectRoot,t)),i=[S(r,n),S(e.config.projectRoot,n),S(e.config.projectRoot,"include",n),S(e.config.projectRoot,"src",n)];return Pt(e,i)}function g(e,t,n){let r=H(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=>Hn(u)===`${o}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(V(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${o}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Ge(e,t,n){let r=H(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=N(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let i=L(k(e.config.projectRoot,t)),s=S(i,n);for(let o of Qs(s)){let a=N(se(e.config.projectRoot,o));if(r.has(a)||ae(o))return a}return null}function Ft(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=H(e);for(let i of Se){let s=`${n}${i}`,o=[...r].find(a=>a.endsWith(s));if(o)return o}for(let i of Se){let s=[...r].find(o=>Hn(o)===`${n.split("/").pop()}${i}`);if(s)return s}return null}function zs(e){let t=V(e);return Lt.has(t)?[e]:[`${e}.py`,`${e}.pyi`,k(e,"__init__.py"),k(e,"__init__.pyi")]}function Pt(e,t){let n=H(e);for(let r of t){let i=N(se(e.config.projectRoot,r));if(n.has(i)||ae(r))return i}return null}function qs(e){let t=V(e);return vt.has(t)?[e]:[`${e}.rs`,k(e,"mod.rs")]}function Js(e){let t=V(e);return Dt.has(t)?[e]:[`${e}.rb`,k(e,"index.rb")]}function Qs(e){let t=V(e);return Rt.has(t)?[e]:[`${e}.dart`,e]}function At(e){let t=V(e),n=new Set;if(t){n.add(e);for(let r of oe)n.add(e.slice(0,-t.length)+r)}else for(let r of oe)n.add(`${e}${r}`),n.add(k(e,`index${r}`));return[...n]}function H(e){return gs.get(e,()=>new Set(_e(e,{includeIgnored:!1}).map(N)))}function wt(e){return ys.get(e,()=>je([...H(e)].sort().join(`
90
+ `)))}function be(e){return typeof e=="object"&&e!==null}function Al(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null}function Ys(e,t,n={}){let r=ye(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 Gn}from"path";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gs(e){return e.replace(/'''[\s\S]*?'''/g,G).replace(/"""[\s\S]*?"""/g,G).replace(/#.*$/gm,G).replace(/\/\/.*$/gm,G).replace(/\/\*[\s\S]*?\*\//g,G).replace(/`(?:\\[\s\S]|[^`])*`/g,G).replace(/'(?:\\.|[^'\\\r\n])*'/g,G).replace(/"(?:\\.|[^"\\\r\n])*"/g,G)}function G(e){return e.replace(/[^\r\n]/g," ")}var tu=me("stripped-lines",{clearGroups:["whole-project","source-file"]});nn({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{Ze=null,Fe=""},clearFile:()=>{Ze=null,Fe=""}});var Ze=null,Fe="";function Zs(e){return Ze===e||(Ze=e,Fe=Gs(e)),Fe}function Z(e,t,n){let r=Zs(e);return`${r.slice(0,t)}${" ".repeat(n-t)}${r.slice(n)}`}function C(e,t){return new RegExp(`\\b${O(t)}\\b`,"m").test(e)}function Ee(e,t){let n=new Set,r=new RegExp(`\\b${O(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 Ot(e){let t=0;for(let n of e)n==="("&&(t+=1),n===")"&&(t-=1);return t}var eo=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 D(e,t){for(let n of e.namedChildren)if(n.type===t)return n;return null}function y(e,t){let n=new Set,r=(i,s)=>{let o=s||t.has(i.type);!o&&eo.has(i.type)&&n.add(i.text);for(let a of i.children)r(a,o)};return r(e.rootNode,!1),n}function w(e,t,n,r,i,s,o){return{importedName:i,localName:s,sourcePath:o??g(e,r,kt(t)),kind:"named",used:C(n,s),usedMembers:[]}}function m(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 X(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 le(e,t){return{importedName:e,localName:null,sourcePath:t,kind:"side-effect",used:!0,usedMembers:[]}}function ue(e,t,n={}){return{importedName:e,localName:n.localName??null,sourcePath:t,kind:"namespace",used:n.used??!0,usedMembers:n.usedMembers??[],isTypeOnly:n.isTypeOnly}}function F(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=Z(e,i.index,i.index+s.length);for(let a of n(i,o))r.push(a)}return r}function P(e,t,n,r,i){let s=Le(e,t,i)?.tree??null;if(s){let o=n(s);if(o)return o}return r()}function et(e,t,n,r,i){let s=Le(e,t,i)?.tree??null,o=z(t),a=o?n[o]:void 0;return s&&a?a(s):r()}function Zn(e,t,n){return P(e,t,r=>no(e,t,r),()=>to(e,t,n),n)}function to(e,t,n){return F(n,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(r,i)=>{let s=r[1]?.trim();if(!s)return[];let o=Gn(s).replace(/\.[^.]+$/,"");return[X(s,o,Ye(e,t,s),C(i,o))]})}function no(e,t,n){let r=y(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=Gn(o).replace(/\.[^.]+$/,"");i.push(m(o,a,Ye(e,t,o),r))}return i}var ro=new Set([":require",":require-macros",":use"]),$t=String.raw`A-Za-z0-9_$*+!?.<>=-`;function tr(e,t,n){let r=go(n);if(!r)return[];let i=mo(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=A(o.children[0]);if(a){if(ro.has(a)){for(let c of oo(o.children.slice(1)))s.push(...so(e,c,i));continue}if(a===":import")for(let c of co(o.children.slice(1)))s.push(c)}}return s}function io(e){return e.type==="list"&&A(e.children[0])==="ns"}function so(e,t,n){let r=Ft(e,t.namespace),i=t.alias??t.namespace,s=uo(n,i),o=[{importedName:t.namespace,localName:i,sourcePath:r,kind:"namespace",used:t.refers.length>0||t.referAll||s.length>0||po(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:fo(n,a),usedMembers:[]});return o}function oo(e){return e.flatMap(t=>tt(t,null))}function tt(e,t){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:Mt(t,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&A(e.children[0])===null?e.children.flatMap(n=>tt(n,t)):ao(e,t);if(e.type==="list"&&e.children.length>0){let n=A(e.children[0]);return n?!n||n.startsWith(":")?[]:e.children.slice(1).flatMap(r=>tt(r,Mt(t,n))):e.children.flatMap(r=>tt(r,t))}return[]}function ao(e,t){let n=A(e.children[0]);if(!n||n.startsWith(":"))return[];let r={namespace:Mt(t,n),alias:null,refers:[],referAll:!1};for(let i=1;i<e.children.length;i+=1){let s=A(e.children[i]);if(!s?.startsWith(":"))continue;let o=e.children[i+1];if((s===":as"||s===":as-alias")&&o){r.alias=A(o),i+=1;continue}s===":refer"&&o&&(A(o)===":all"?r.referAll=!0:(o.type==="vector"||o.type==="list")&&r.refers.push(...o.children.map(A).filter(lo)),i+=1)}return[r]}function co(e){let t=[];for(let n of e){if(n.type==="atom"){let i=n.text.split(".").pop()??n.text;t.push(X(i,i,null,!0));continue}if(n.type!=="vector")continue;let r=A(n.children[0]);if(r)for(let i of n.children.slice(1)){let s=A(i);s&&t.push(X(`${r}.${s}`,s,null,!0))}}return t}function Mt(e,t){return e?`${e}.${t}`:t}function A(e){return e?.type==="atom"?e.text:null}function lo(e){return!!(e&&!e.startsWith(":"))}function uo(e,t){let n=new Set,r=new RegExp(`${Bt()}${O(t)}\\s*/\\s*([${$t}]+)`,"g");for(let i of e.matchAll(r)){let s=i[1];s&&n.add(s)}return[...n]}function po(e,t){return new RegExp(`${Bt()}${O(t)}\\s*/`,"m").test(e)}function fo(e,t){return new RegExp(`${Bt()}${O(t)}(?![${$t}])`,"m").test(e)}function Bt(){return`(?<![${$t}])`}function mo(e,t,n){let r="",i=0;for(;i<e.length;){if(i>=t&&i<n){r+=e[i]===`
91
+ `?`
92
+ `:" ",i+=1;continue}let s=e[i];if(s===";"){let o=He(e,i);r+=er(e.slice(i,o)),i=o;continue}if(s==='"'){let o=Re(e,i,0).index;r+=er(e.slice(i,o)),i=o;continue}r+=s,i+=1}return r}function go(e){let t=0;for(;t<e.length&&(t=Vt(e,t),!(t>=e.length));){let n=nt(e,t);if(!n){t+=1;continue}if(io(n.form))return n.form;t=n.index}return null}function nt(e,t){let n=Vt(e,t);if(e.startsWith("#?@",n)||e.startsWith("#?",n))return yo(e,n);if(e.startsWith("#_",n)){let i=nt(e,n+2);return i?{form:{type:"atom",text:"",start:n,end:i.index},index:i.index}:null}for(;St(e[n]);)n+=1;let r=e[n];return r?r==="("?jt(e,n,"list",")"):r==="["?jt(e,n,"vector","]"):r==="{"?jt(e,n,"map","}"):r==='"'?{form:{type:"atom",text:"",start:n,end:Re(e,n,0).index},index:Re(e,n,0).index}:So(e,n):null}function yo(e,t){let n=e.startsWith("#?@",t)?3:2,r=nt(e,t+n);return r?{form:{type:"list",children:r.form.type==="list"||r.form.type==="vector"||r.form.type==="map"?ho(r.form.children):[],start:t,end:r.index},index:r.index}:null}function ho(e){let t=[];for(let n=0;n<e.length;n+=2){let r=A(e[n]),i=e[n+1];r?.startsWith(":")&&i&&t.push(i)}return t}function jt(e,t,n,r){let i=[],s=t+1;for(;s<e.length;){if(s=Vt(e,s),e[s]===r)return{form:{type:n,children:i,start:t,end:s+1},index:s+1};let o=nt(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 So(e,t){let n=t;for(;n<e.length&&!xt(e[n]);)n+=1;return{form:{type:"atom",text:e.slice(t,n),start:t,end:n},index:n}}function Vt(e,t){let n=t;for(;n<e.length;){let r=e[n];if(/\s|,/.test(r)){n+=1;continue}if(r===";"){n=He(e,n);continue}break}return n}function er(e){return e.replace(/[^\r\n]/g," ")}function nr(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=Z(n,i.index,i.index+a.length);r.push({importedName:s,localName:o,sourcePath:Ge(e,t,s),kind:o?"namespace":"side-effect",used:o?C(c,o):!0,usedMembers:o?Ee(c,o):[]})}return r}function rr(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:Ge(e,t,s)})}return r}function ir(e,t,n){return et(e,t,{csharp:r=>bo(e,t,r),vb:r=>xo(e,t,r)},()=>{let r=Qn(t)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return F(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[w(e,t,s,u,p,d,g(e,u,Q))]})},n)}function xo(e,t,n){let r=y(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(m(u,p,g(e,l,Q),r,c?"namespace":"named"))}return i}function bo(e,t,n){let r=y(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(m(u,p,g(e,l,Q),r,a?"namespace":"named"))}return i}var Eo=h("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function sr(e,t){return Eo.get(e,t,()=>{let n=new Set,r=b(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 Ut(e,t,n){return P(e,t,r=>_o(e,t,r),()=>No(e,t,n),n)}function No(e,t,n){return Ao(n).flatMap(r=>wo(e,t,r.clause,r.specifier,r.start,r.end,n))}function _o(e,t,n){let r=Co(e,t,n),i=[];for(let s of n.rootNode.descendantsOfType("import_statement"))i.push(...Io(e,t,n,s,r));return i}function Co(e,t,n){let r=y(n,new Set(["import_statement"]));if(q(t))for(let i of sr(e,t))r.add(i);return r}function Io(e,t,n,r,i){let s=Ro(r);if(!s)return[];let o=Y(e,t,s),a=D(r,"import_clause");return a?To(n,a,o,i,ko(r.text)):[le("*",o)]}function To(e,t,n,r,i){let s=[];for(let o of t.namedChildren)if(o.type==="identifier")s.push(Lo(o.text,n,r,i));else if(o.type==="namespace_import"){let a=vo(e,o,n,r,i);a&&s.push(a)}else o.type==="named_imports"&&s.push(...Do(o,n,r,i));return s}function Lo(e,t,n,r){return m("default",e,t,n,"default",{isTypeOnly:r})}function vo(e,t,n,r,i){let o=D(t,"identifier")?.text??"";if(!o)return null;let a=Po(e,o);return ue("*",n,{localName:o,usedMembers:a,isTypeOnly:i,used:a.length>0||r.has(o)})}function Do(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(m(c,l,t,n,"named",{isTypeOnly:r||Fo(s.text)}))}return i}function Ro(e){let t=D(e,"string");if(!t)return null;let n=D(t,"string_fragment");return n?n.text:null}function ko(e){return/^\s*import\s+type\b/.test(e)}function Fo(e){return/^\s*type\b/.test(e.trim())}function Po(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 Ao(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 wo(e,t,n,r,i,s,o){let a=Y(e,t,r),c=Z(o,i,s);return n?Oo(n).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let p=Ee(c,u.localName);return ue(u.importedName,u.sourcePath,{localName:u.localName,usedMembers:p,used:p.length>0||C(c,u.localName),isTypeOnly:u.isTypeOnly})}return u.kind==="side-effect"?le(u.importedName,u.sourcePath):X(u.importedName,u.localName??"",u.sourcePath,u.localName?C(c,u.localName):!1,u.kind,[],{isTypeOnly:u.isTypeOnly})}):[le("*",a)]}function Oo(e){let t=e.trim(),n=/^type\b/.test(t),r=t.replace(/^type\s+/,""),[i,s]=jo(r),o=[];return i&&o.push(...or(i,n)),s&&o.push(...or(s,n)),o}function or(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 jo(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 Wt(e,t,n){let r=B(e,t);return r?Wo(e,t,r):Mo(e,t,n)}function Mo(e,t,n){return[...$o(e,t,n),...Bo(e,t,n),...Vo(e,t,n)]}function $o(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=>Uo(p.trim())).filter(p=>!!p),l=Ne(n,s.index),u=Ne(n,s.index+s[0].length-1);r.push({kind:"named",sourcePath:Y(e,t,a),names:c,startLine:l,endLine:u})}return r}function Bo(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=Ne(n,s.index),c=Ne(n,s.index+s[0].length-1);r.push({kind:"star-as",sourcePath:Y(e,t,o),names:s[1]?[s[1]]:[],startLine:a,endLine:c})}return r}function Vo(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=Ne(n,s.index),c=Ne(n,s.index+s[0].length-1);r.push({kind:"star",sourcePath:Y(e,t,o),names:[],startLine:a,endLine:c})}return r}function Uo(e){if(!e)return null;let t=e.replace(/^type\s+/,"").trim();if(!t)return null;let n=t.match(/^(\w+)\s+as\s+(\w+)$/);if(n)return n[2]??null;let r=t.match(/^(\w+)$/);return r?r[1]??null:null}function Ne(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)e.charCodeAt(r)===10&&n++;return n}function Wo(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("export_statement")){let s=Ho(e,t,i);if(s===void 0)continue;let o=i.startPosition.row,a=i.endPosition.row,c=Xo(i,s,o,a);r.push(c)}return r}function Ho(e,t,n){let r=D(n,"string");if(!r)return;let i=D(r,"string_fragment");if(i)return Y(e,t,i.text)}function Xo(e,t,n,r){let i=D(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=D(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 ar(e,t,n){return et(e,t,{java:r=>Ko(e,t,r),kotlin:r=>zo(e,t,r),scala:r=>qo(e,t,r)},()=>F(n,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(r,i)=>{let s=r[1]?.trim();return s?Jo(e,t,s,i):[]}),n)}function Ko(e,t,n){let r=y(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(ue("*",g(e,l,v)));continue}let u=l.split(".").pop()??l;i.push(m(u,u,g(e,l,v),r))}return i}function zo(e,t,n){let r=y(n,new Set(["import_header","import_list"])),i=[];for(let s of n.rootNode.descendantsOfType("import_header")){let o=s.namedChildren.find(f=>f.type==="identifier");if(!o)continue;let a=s.namedChildren.some(f=>f.type==="wildcard_import"),c=s.namedChildren.find(f=>f.type==="import_alias");if(a){i.push(ue("*",g(e,o.text,v)));continue}let l=o.text,u=l.split(".").pop()??l,d=c?.namedChild(0)?.text??u;i.push(m(u,d,g(e,l,v),r))}return i}function qo(e,t,n){let r=y(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(ue("*",g(e,c,v)));continue}if(o?.type==="namespace_selectors"){for(let p of o.namedChildren)if(p.type==="arrow_renamed_identifier"){let[d,f]=p.namedChildren;if(!d)continue;let x=d.text,pe=f?.text??x;if(x==="_")continue;i.push(m(x,pe,g(e,`${c}.${x}`,v),r))}else if(p.type==="identifier"){let d=p.text;i.push(m(d,d,g(e,`${c}.${d}`,v),r))}continue}let l=a[a.length-1]?.text??c,u=a.slice(0,-1).map(p=>p.text).join(".")||c;i.push(m(l,l,g(e,u&&a.length>1?`${u}.${l}`:c,v),r))}return i}function Jo(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[w(e,t,r,d,u,p)]})}return[w(e,t,r,n,n.split(".").pop()??n,n.split(".").pop()??n)]}function lr(e,t,n){return P(e,t,r=>Qo(e,t,r),()=>F(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[w(e,t,i,u,p,d,g(e,u.replace(/\\/g,"."),ce))]}):[]}),n)}function Qo(e,t,n){let r=y(n,new Set(["namespace_use_declaration"])),i=[],s=(o,a,c)=>{i.push(m(a,c,g(e,o.replace(/\\/g,"."),ce),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}=cr(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}=cr(c,"");l&&s(p,l,u)}}return i}function cr(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 pr(e,t,n){return P(e,t,r=>Yo(e,t,r),()=>Zo(n).flatMap(r=>ta(e,t,r,n)),n)}function Yo(e,t,n){let r=y(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=ur(o);if(!a)continue;let c=xe(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=Go(o);if(a===null)continue;let c=xe(e,t,a);for(let l=1;l<s.namedChildCount;l+=1){let u=s.namedChild(l);if(u.type==="wildcard_import"){i.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let p=ur(u);p&&i.push({importedName:p.qualifiedName,localName:p.localName,sourcePath:c,kind:"named",used:r.has(p.localName),usedMembers:[]})}}return i}function ur(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 Go(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let t=D(e,"import_prefix")?.text??"",n=D(e,"dotted_name")?.text??"";return`${t}${n}`}return null}function Zo(e){let t=e.split(`
93
+ `),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=Ot(s);for(;i+1<t.length&&(u>0||c.trimEnd().endsWith("\\"));){i++;let d=t[i];c+=`
94
+ ${d}`,l+=1+d.length,u+=Ot(d),r+=d.length+1}let p=ea(c);p&&n.push({...p,start:a,end:l})}return n}function ea(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 ta(e,t,n,r){let i=Z(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(),f=(p??d.split(".")[0]??d).trim(),x=xe(e,t,d),pe=Ee(i,f);return[{importedName:d,localName:f,sourcePath:x,kind:"namespace",used:C(i,f)||pe.length>0,usedMembers:pe}]});let o=n.module?xe(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:C(i,d),usedMembers:[]})}return a}import{basename as na}from"path";function dr(e,t,n){return P(e,t,r=>ia(e,t,r),()=>ra(e,t,n),n)}function ra(e,t,n){return F(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"?Qe(e,t,o):null;if(a){let c=fr(o);return[X(c,c,a,C(i,c))]}return[le(o,a)]})}function ia(e,t,n){let r=y(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(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let p=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!p)continue;let d=a.text==="require_relative"?Qe(e,t,p):null;if(d){let f=fr(p);i.push(m(f,f,d,r))}else i.push(le(p,d))}return i}function fr(e){return Un(na(e).replace(/\.[^.]+$/,""),/_/)}function mr(e,t,n){return P(e,t,r=>sa(e,t,r),()=>F(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,i)=>{let s=r[1]?.trim();return s?oa(e,t,s,i):[]}),n)}function sa(e,t,n){let r=y(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 Pe(o,"")){if(!a.importedName||a.importedName==="*")continue;let c=W(e,t,a.qualifiedName)??W(e,t,a.qualifiedName.split("::").slice(0,-1).join("::"));i.push(m(a.importedName,a.localName,c,r))}}return i}function Pe(e,t){switch(e.type){case"identifier":case"super":case"crate":{let n=e.text;return[{qualifiedName:rt(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:rt(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=rt(t,n.text),s=[];for(let o of r.namedChildren)s.push(...Pe(o,i));return s}case"use_list":{let n=[];for(let r of e.namedChildren)n.push(...Pe(r,t));return n}case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=Pe(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:rt(t,`${r}::*`),importedName:"*",localName:"*"}]}default:return[]}}function rt(e,t){return e?t?`${e}::${t}`:e:t}function oa(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 f=d.trim();if(!f)return[];if(f==="self"){let ot=u.split("::").filter(Boolean).pop();return ot?[w(e,t,r,u,ot,ot)]:[]}let[x,pe]=f.split(/\s+as\s+/),de=x?.trim();if(!de)return[];let Fr=(pe??de.split("::").pop()??de).trim(),Pr=`${u}::${de}`.replace(/::::/g,"::");return[w(e,t,r,Pr,de.split("::").pop()??de,Fr,W(e,t,u))]})}let[s,o]=i.split(/\s+as\s+/),a=s?.trim()??i,c=(o??a.split("::").pop()??a).trim(),l=W(e,t,a)??W(e,t,a.split("::").slice(0,-1).join("::"));return[w(e,t,r,a,a.split("::").pop()??a,c,l)]}function gr(e,t,n){let r=B(e,t);if(r)return aa(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(...la(e,t,o))}return i}function aa(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("use_declaration")){if(!ca(i))continue;let s=i.namedChildren.find(o=>o.type!=="visibility_modifier");if(s)for(let o of Pe(s,""))o.importedName&&r.push(Ht(e,t,o.qualifiedName))}return r}function ca(e){for(let t of e.children)if(t.type==="visibility_modifier"&&t.text.startsWith("pub"))return!0;return!1}function la(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[Ht(e,t,l)]})}return[Ht(e,t,r)]}function Ht(e,t,n){return{specifier:n,sourcePath:W(e,t,n)??W(e,t,n.split("::").slice(0,-1).join("::"))}}function ee({language:e,extensions:t,imports:n,parseImports:r}){return{language:e,extensions:t,capabilities:{imports:n},parseImports:r}}function yr(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 ua={language:"javascript",extensions:oe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Ut,parseReExports:Wt},pa=ee({language:"python",extensions:Xe,imports:"ast-with-regex-fallback",parseImports:pr}),da=ee({language:"jvm",extensions:v,imports:"ast-dispatch-with-regex-fallback",parseImports:ar}),fa={language:"rust",extensions:Ke,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:mr,parseExports:gr},ma=ee({language:"ruby",extensions:ze,imports:"ast-with-regex-fallback",parseImports:dr}),ga=ee({language:"c/cpp",extensions:qe,imports:"ast-with-regex-fallback",parseImports:Zn}),ya=ee({language:"dotnet",extensions:Q,imports:"ast-dispatch-with-regex-fallback",parseImports:ir}),ha={language:"dart",extensions:Je,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:nr,parseExports:rr},Sa=ee({language:"php",extensions:ce,imports:"ast-with-regex-fallback",parseImports:lr}),xa=ee({language:"clojure",extensions:Se,imports:"regex-only",parseImports:tr}),ba=[ua,pa,da,fa,ma,ga,ya,ha,Sa,xa];function Xt(e){return yr(ba,e)}var Kt={clearGroups:["whole-project","source-file"]},Ea=h("source-imports",Kt),Lp=h("source-exports",Kt),Na=h("source-reexports",Kt),hr=ne({kind:"source-imports",invalidation:re("source-imports"),serialize:_a,deserialize:Ca}),Sr=ne({kind:"source-reexports",invalidation:re("source-reexports"),serialize:Ia,deserialize:Ta});function xr(e,t){let n=N(t);return Na.get(e,n,()=>{let r=Xt(n);if(!r?.parseReExports)return[];let i=b(e,n);if(!i)return[];let s=J(e,n,i),o=wt(e),a=Sr.read(e,n,s);if(a?.resolutionFingerprint===o)return a.reExports;let c=r.parseReExports(e,n,i);return Sr.write(e,n,s,{resolutionFingerprint:o,reExports:c}),c})}function zt(e,t){let n=N(t);return Ea.get(e,n,()=>{let r=Xt(n);if(!r)return[];let i=b(e,n);if(!i)return[];let s=J(e,n,i),o=wt(e),a=hr.read(e,n,s);if(a?.resolutionFingerprint===o)return a.imports;let c=r.parseImports(e,n,i);return hr.write(e,n,s,{parserVersion:2,resolutionFingerprint:o,imports:c}),c})}function vp(e,t,n){let r=zt(e,t).filter(i=>i.kind==="named"&&i.isTypeOnly!==!0&&i.localName===n&&i.sourcePath!==null);return r.length===1?r[0]:null}function _a(e){return JSON.stringify(e)}function Ca(e){try{let t=JSON.parse(e);return!be(t)||t.parserVersion!==2||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.imports)?null:{parserVersion:2,resolutionFingerprint:t.resolutionFingerprint,imports:t.imports}}catch{return null}}function Ia(e){return JSON.stringify(e)}function Ta(e){try{let t=JSON.parse(e);return!be(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.reExports)?null:{resolutionFingerprint:t.resolutionFingerprint,reExports:t.reExports}}catch{return null}}function Rp(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
95
+ FROM global_symbols gs
96
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
97
+ JOIN documents d ON der.document_id = d.id
98
+ WHERE ${t.where}
99
+ ${e.pathExclusionsFor("d")}
100
+ ${Er(t.orderBy)}
101
+ ${Nr(t.limit)}`,...t.params??[])}function kp(e,t){return e.all(`SELECT
102
+ gs.id,
103
+ gs.symbol,
104
+ c.document_id,
105
+ MIN(c.start_line) AS start_line,
106
+ 0 AS start_char,
107
+ MAX(c.end_line) AS end_line,
108
+ 0 AS end_char,
109
+ d.relative_path,
110
+ gs.display_name,
111
+ gs.documentation
112
+ FROM global_symbols gs
113
+ JOIN mentions m ON m.symbol_id = gs.id
114
+ JOIN chunks c ON m.chunk_id = c.id
115
+ JOIN documents d ON c.document_id = d.id
116
+ WHERE m.role = 1
117
+ AND ${t.where}
118
+ ${e.pathExclusionsFor("d")}
119
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
120
+ ${Er(t.orderBy)}
121
+ ${Nr(t.limit)}`,...t.params??[])}function Er(e){return e?`ORDER BY ${e}`:""}function Nr(e){return typeof e=="number"?`LIMIT ${e}`:""}function _r(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 Cr(e){if(!e)return null;let t=br(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(br(r)??r).replace(/\n/g," ")}function br(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function it(e){return{forFile(t,n){return Ir(e,t,n)},forFiles(t,n){let r=new Map;for(let i of t)r.set(i,Ir(e,i,n));return r}}}function Ir(e,t,n){let r={file:t},i=n.facts||n.identifiers;if(n.text&&(r.text=b(e,t)),n.lines&&(r.lines=pt(e,t)),n.ast&&(r.ast=B(e,t)),n.imports&&(r.imports=zt(e,t)),n.reexports&&(r.reexports=xr(e,t)),i){let s=Et(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 La(e,t={}){if(K(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 qt(e,t,n={}){let r=new Map;for(let s of t)e.length>0&&!La(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}var va=h("file-definitions",{clearGroups:["definition-catalog"]}),Da=fe("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),Ra=h("file-function-like-definitions",{clearGroups:["definition-catalog"]}),Tr=new WeakMap;function Qt(e,t,n={},r){return n.includeClassMemberFallbacks?Jt(e,t,void 0,{includeClassMemberFallbacks:!0},r):va.get(e,t,()=>{let i=j(r,"evidence-read",()=>Rr(e,t));if(i)return i;let s=Jt(e,t,void 0,n,r);return j(r,"evidence-write",()=>{let o=Ce(e),a=it(e).forFile(t,{text:!0}).text;o&&a&&Dr.write(e,t,J(e,t,a),{projectFingerprint:o,definitions:s.map(c=>({...c}))})}),s})}function ka(e,t){return Ra.get(e,t,()=>{let n=Rr(e,t);return n?n.filter(r=>r.isFunctionLike):Jt(e,t,r=>r.isFunctionLike)})}var Dr=ne({kind:"file-definitions",invalidation:re("file-definitions"),serialize:Fa,deserialize:Pa});function Rr(e,t){let n=Ce(e);if(!n)return null;let r=it(e).forFile(t,{text:!0}).text;if(!r)return null;let i=Dr.read(e,t,J(e,t,r));return i?Aa(i,n,t):null}function Fa(e){return JSON.stringify(e)}function Pa(e){try{let t=JSON.parse(e);return!be(t)||typeof t.projectFingerprint!="string"||!Array.isArray(t.definitions)?null:{projectFingerprint:t.projectFingerprint,definitions:t.definitions}}catch{return null}}function Aa(e,t,n){if(e.projectFingerprint!==t)return null;let r=[];for(let i of e.definitions){let s=wa(i,n);if(!s)return null;r.push(s)}return r}function wa(e,t){return!be(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 Jt(e,t,n,r={},i){let s=j(i,"primary-rows",()=>Oa(e,t)),o=j(i,"fallback-rows",()=>ja(e,t)),a=j(i,"merge-rows",()=>qt(s,o,{sort:!0,includeClassMemberFallbacks:r.includeClassMemberFallbacks}).map(Yt));return n&&(a=a.filter(n)),j(i,"range-correction",()=>Gt(e,t,a,i,r.rangeCorrectionEvidence))}function j(e,t,n){return e?e(t,n):n()}function Oa(e,t){return e.all(`SELECT
122
+ gs.id,
123
+ gs.symbol,
124
+ der.document_id,
125
+ der.start_line,
126
+ der.start_char,
127
+ der.end_line,
128
+ der.end_char,
129
+ d.relative_path,
130
+ gs.display_name,
131
+ gs.kind,
132
+ gs.documentation,
133
+ gs.enclosing_symbol
134
+ FROM global_symbols gs
135
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
136
+ JOIN documents d ON der.document_id = d.id
137
+ WHERE d.relative_path = ?
138
+ ${e.symbolNoiseFor("gs")}
139
+ ORDER BY der.start_line, der.end_line`,t)}function ja(e,t){return e.all(`SELECT
140
+ gs.id,
141
+ gs.symbol,
142
+ c.document_id,
143
+ MIN(c.start_line) AS start_line,
144
+ 0 AS start_char,
145
+ MAX(c.end_line) AS end_line,
146
+ 0 AS end_char,
147
+ d.relative_path,
148
+ gs.display_name,
149
+ gs.kind,
150
+ gs.documentation,
151
+ gs.enclosing_symbol
152
+ FROM global_symbols gs
153
+ JOIN mentions m ON m.symbol_id = gs.id
154
+ JOIN chunks c ON m.chunk_id = c.id
155
+ JOIN documents d ON c.document_id = d.id
156
+ WHERE d.relative_path = ?
157
+ AND m.role = 1
158
+ ${e.symbolNoiseFor("gs")}
159
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
160
+ ORDER BY start_line, end_line`,t)}function Yt(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:on(e.symbol),parentTypeName:K(e.symbol),isFunctionLike:ut(e.symbol),isTypeLike:we(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function Gp(e,t={}){return Ma(e,t.scope)}function Ma(e,t){return _e(e,{scope:t,includeIgnored:!1}).flatMap(n=>Qt(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function Zp(e,t){return _e(e,{scope:t,includeIgnored:!1}).flatMap(n=>ka(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function ed(e,t){let n=Da.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=Lr($a(e,t.scope,t.sqlPrefilter)),a=Lr(Ba(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=qt(o.get(u)??[],a.get(u)??[],{sort:!0}).filter(d=>t.symbolMatches(d.symbol));p.length!==0&&l.push(...Gt(e,u,p.map(Yt)))}return r.set(i,l),[...l]}function $a(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${kr("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
161
+ gs.id,
162
+ gs.symbol,
163
+ der.document_id,
164
+ der.start_line,
165
+ der.start_char,
166
+ der.end_line,
167
+ der.end_char,
168
+ d.relative_path,
169
+ gs.display_name,
170
+ gs.kind,
171
+ gs.documentation,
172
+ gs.enclosing_symbol
173
+ FROM global_symbols gs
174
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
175
+ JOIN documents d ON der.document_id = d.id
176
+ WHERE 1 = 1
177
+ ${e.pathExclusionsFor("d")}
178
+ ${r}
179
+ ${i}
180
+ ${e.symbolNoiseFor("gs")}
181
+ ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function Ba(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${kr("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
182
+ gs.id,
183
+ gs.symbol,
184
+ c.document_id,
185
+ MIN(c.start_line) AS start_line,
186
+ 0 AS start_char,
187
+ MAX(c.end_line) AS end_line,
188
+ 0 AS end_char,
189
+ d.relative_path,
190
+ gs.display_name,
191
+ gs.kind,
192
+ gs.documentation,
193
+ gs.enclosing_symbol
194
+ FROM global_symbols gs
195
+ JOIN mentions m ON m.symbol_id = gs.id
196
+ JOIN chunks c ON m.chunk_id = c.id
197
+ JOIN documents d ON c.document_id = d.id
198
+ WHERE m.role = 1
199
+ AND NOT EXISTS (
200
+ SELECT 1
201
+ FROM defn_enclosing_ranges existing_der
202
+ WHERE existing_der.symbol_id = gs.id
203
+ )
204
+ ${e.pathExclusionsFor("d")}
205
+ ${r}
206
+ ${i}
207
+ ${e.symbolNoiseFor("gs")}
208
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
209
+ ORDER BY d.relative_path, start_line, end_line`,...s)}function Va(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function kr(e,t){return t==="callable"?Va(e):Ua(e)}function Ua(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function Lr(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 td(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(i=>Qt(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:sn(i.symbol),signature:_r(Cr(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function Wa(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 nd(e,t){let n=Tr.get(e);return n||(n=Wa(e),Tr.set(e,n)),n.get(t)??null}function rd(e,t){let n=Qt(e,t.relative_path).find(r=>r.symbolId===t.id)??(K(t.symbol)===null||!ut(t.symbol)?void 0:Gt(e,t.relative_path,[Yt(t)])[0]);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 Gt(e,t,n,r,i){let s=j(r,"range-correction.source-text",()=>i?i.source:it(e).forFile(t,{text:!0}).text),o=j(r,"range-correction.callable-sites",()=>i?i.callables:Ct(e,t));return o?j(r,"range-correction.ast-correction",()=>Ja(n,o,s)):s?j(r,"range-correction.regex-fallback",()=>Ha(n,s)):n}function Ha(e,t){let n=t.split(/\r?\n/),r=Xa(e,n),i=Ka(e,r),s=za(i,n);return qa(e,s)}function Xa(e,t){let n=e.some(i=>st(i.symbol))?nc(t):null,r=new Map;for(let i of e)r.set(i.symbolId,tc(t,n,i));return r}function Ka(e,t){return e.filter(n=>st(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 za(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:rc(t,i.definition,i.startLine,o)})}return n}function qa(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function Ja(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(!ec(i)||!i.leaf)return vr(i,n);let s=r.get(i.leaf);if(!s||s.length===0)return vr(i,n);let o=n?Qa(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 Qa(e,t,n){let r=Ya(e.symbol);if(!r)return null;let i=n.split(/\r?\n/),s=new RegExp(`\\b${O(r)}\\b`);for(let o of t){let a=Ga(i,o.startLine);if(a&&s.test(a))return o}return null}function Ya(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Ga(e,t){for(let n=t;n>=0;n-=1){let r=e[n]?.trim()??"";if(r){if(/^impl\b/.test(r))return Za(e,n,t);if(/^(?:struct|enum|trait|mod)\b/.test(r))return null}}return null}function Za(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 ec(e){return st(e.symbol)?!0:we(e.symbol)==="term"&&K(e.symbol)===null}function vr(e,t){if(!t||!e.leaf||we(e.symbol)!=="term"||K(e.symbol)!==null)return e;let n=O(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 tc(e,t,n){if(!st(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 nc(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 rc(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=ic(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 ic(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 st(e){return e.includes("().")}export{je as a,J as b,Ce as c,Sc as d,xc as e,bc as f,Ec as g,Nc as h,ne as i,vc as j,re as k,Wn as l,ps as m,Y as n,Al as o,b as p,ac as q,pt as r,cc as s,O as t,Gs as u,z as v,q as w,Nt as x,Yi as y,Bn as z,Gi as A,_t as B,Zi as C,B as D,ie as E,qc as F,ye as G,Ct as H,ts as I,ns as J,Ys as K,rt as L,xr as M,zt as N,vp as O,it as P,Rp as Q,kp as R,_r as S,Cr as T,qt as U,Qt as V,Gp as W,Ma as X,Zp as Y,ed as Z,td as _,Wa as $,nd as aa,rd as ba};
210
+ //# sourceMappingURL=chunk-SDPA5DKN.js.map
@@ -0,0 +1,3 @@
1
+ import{B as ye,q as ae,t as O,u as B,v as ue,x as me,y as U}from"./chunk-SF7X6QNW.js";import{V as v,W as he,l as le,m as fe,n as K,o as pe,t as de}from"./chunk-SDPA5DKN.js";import{b as ce,f as j}from"./chunk-VWLIOEEF.js";import{k as V,l as Se,n as $,o as be}from"./chunk-G6OGPXJW.js";import{d as w,e as ge}from"./chunk-DRENNWRG.js";import{c as oe}from"./chunk-H5EXS3HM.js";import{a as A,e as F}from"./chunk-HGFDYOVB.js";import{$ as se,ea as _,h as re}from"./chunk-4DCKBY6T.js";import{join as _e}from"path";var Me=3,Ke=2,Ve="typescript-semantic";function Mt(o){let e=_e(o,Ve),n=Se(e);return{...n,requestDir:n.legacyRequestDir}}function It(o){return ae(o)}function xt(o){let e=JSON.parse(o),n=e.protocolVersion,t=n===Ke;if(!t&&n!==Me||typeof e.id!="string"||typeof e.generation!="string"||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.profileEnvironment!==void 0&&!oe(e.profileEnvironment)||!e.request||!$e(e.request)||!t&&(e.mailboxVersion!==V||typeof e.operationKey!="string"||!/^[a-f0-9]{64}$/.test(e.operationKey)||e.id!==be(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||e.deadlineAtMs<e.enqueuedAtMs))throw new Error("TypeScript semantic service received an invalid mailbox request.");if(!t){let r=e,s=$("typescript-semantic-v3",{generation:r.generation,profileEnvironment:r.profileEnvironment,request:r.request});if(r.operationKey!==s)throw new Error("TypeScript semantic service received a mismatched mailbox operation identity.");return r}let i=$("typescript-semantic-v2",{id:e.id,generation:e.generation,request:e.request});return{protocolVersion:Me,mailboxVersion:V,id:e.id,operationKey:i,clientId:"legacy-v2",enqueuedAtMs:e.deadlineAtMs,deadlineAtMs:e.deadlineAtMs,generation:e.generation,...e.profileEnvironment?{profileEnvironment:e.profileEnvironment}:{},request:e.request}}function $e(o){if(!o||typeof o!="object"||!("kind"in o))return!1;let e=o;switch(e.kind){case"availability":return!0;case"import-usage":return typeof e.file=="string";case"reference-fragments":return pe(e.files)!==null;case"references":return Ie(e.definitions)&&(e.exact===void 0||typeof e.exact=="boolean");case"callees":return Ie(e.definitions);case"signature":return xe(e.definition);default:return!1}}function Ie(o){return Array.isArray(o)&&o.every(xe)}function xe(o){if(!o||typeof o!="object")return!1;let e=o;return typeof e.symbolId=="number"&&typeof e.documentId=="number"&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&typeof e.startLine=="number"&&typeof e.endLine=="number"}import{existsSync as E}from"fs";import b from"path";var W=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function z(o,e){let t=e?b.dirname(b.join(o,e)):o,i=b.resolve(o);for(;t.startsWith(i);){for(let s of W){let a=b.join(t,s);if(E(a))return a}let r=b.dirname(t);if(r===t)break;t=r}for(let r of W){let s=b.join(o,r);if(E(s))return s}return null}function Fe(o){let e=o.config.projectRoot,n=new Set(We(e,o.config.semantic?.typescript?.tsconfigs)),t=j(o,{includeIgnored:!1,extensions:O});for(let i of t){let r=z(e,i);r&&n.add(b.resolve(r))}if(n.size===0){let i=z(e);i&&n.add(b.resolve(i))}return[...n].filter(i=>!Te(e,i)).sort((i,r)=>i.localeCompare(r))}function We(o,e=[]){let n=new Set;for(let t of e){let i=b.isAbsolute(t)?t:b.join(o,t);E(i)&&n.add(b.resolve(i))}for(let t of ze(o))for(let i of W){let r=b.join(t,i);E(r)&&n.add(b.resolve(r))}if(n.size===0){let t=z(o);t&&n.add(b.resolve(t))}return[...n].filter(t=>!Te(o,t)).sort((t,i)=>t.localeCompare(i))}function ze(o){let e=b.join(o,"package.json");if(!E(e))return[];let n;try{n=JSON.parse(re(e,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(i=>fe(o,i))}function Te(o,e){let n=b.relative(o,e).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as m}from"perf_hooks";function I(o,e,n){if(o.has(e))return o.get(e);let t=n();return o.set(e,t),t}import Re from"path";import{realpathSync as ke}from"fs";function Ye(o,e){return o.getReferences().map(n=>{let t=n.getNode();return q(t,e)})}function Ge(o){let e=o;return typeof e.findReferences=="function"?e.findReferences():[]}function Ce(o,e,n,t){let i=[];for(let r of Ge(o))for(let s of Ye(r,t))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||i.push(s);for(let r of n)i.push(r);return P(i)}function Ne(o,e,n,t){let i=[],r=n?.getStart();for(let s of o.getReferences()){let a=s.getNode();L(t,a.getSourceFile().getFilePath())===e&&(r!==void 0&&a.getStart()===r||i.push({location:q(a,t),node:a}))}return i}function q(o,e){let n=o.getSourceFile(),t=n.getLineAndColumnAtPos(o.getStart());return{file:L(e,n.getFilePath())??n.getBaseName(),line:t.line-1,column:t.column-1}}function ve(o,e,n){let t=o.getSourceFile(),i=G(t,o),r=o.getText(),s=new RegExp(`\\b${de(r)}\\b`,"g"),a=t.getFullText().split(`
2
+ `),c=[];for(let l=0;l<a.length;l++){if(l===i)continue;let f=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(f))!==null;)c.push({file:e,line:l,column:p.index})}return P(c.filter(l=>L(n,Re.join(n,l.file))===e))}function Y(o){for(let e=o;e;e=e.getParent()){let n=e.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function G(o,e){return o.getLineAndColumnAtPos(e.getStart()).line-1}function P(o){let e=new Set,n=[];for(let t of o){let i=`${t.file}:${t.line}:${t.column}`;e.has(i)||(e.add(i),n.push(t))}return n}function L(o,e){let n=o||process.cwd(),t=De(n,e);if(t)return t;try{return De(ke(n),ke(e))}catch{return null}}function De(o,e){let n=Re.relative(o,e).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function Pe(o,e,n,t){let i=Xe(e,t);return i.size===0?new Map:Je(o,n,i)}function Xe(o,e){let n=new Map;for(let t of v(o,e)){let i=w(t.symbol)??t.leaf;if(!i)continue;let r=n.get(i);r||(r=[],n.set(i,r)),r.push(t)}return n}function Je(o,e,n){let t=new Map,i=new Map;return e.forEachDescendant(r=>{for(let s of Qe(o,r)){let a=n.get(s);if(!a)continue;let c=G(e,r);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let f=Math.abs(c-l.startLine),p=i.get(l.symbolId);p!==void 0&&p<=f||(i.set(l.symbolId,f),t.set(l.symbolId,r))}}}),t}function Qe(o,e){let n=[],t=i=>{i&&!n.includes(i)&&n.push(i)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let i=e.getNameNode();t(i?.getText())}if("getName"in e&&typeof e.getName=="function"){let i=e.getName();t(i)}return o.Node.isIdentifier(e)&&t(e.getText()),n}var Ze=ce("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function Le(o,e,n,t){let i=Q(o,e),r=X(i.get(t)??[],n);if(r)return r;let s=[];for(let a of i.values())for(let c of a)((c.leaf||w(c.symbol)||"").includes(t)||c.symbol.includes(t))&&s.push(c);return X(s,n)}function J(o,e,n,t){return X(Q(o,e).get(t)??[],n)}function we(o,e){let n=new Map;for(let[t,i]of Q(o,e)){let r=i[0];r&&n.set(t,r)}return n}function Q(o,e){return Ze.get(o,e,()=>{let n=new Map;for(let t of v(o,e)){let i=t.leaf||w(t.symbol);if(!i)continue;let r=n.get(i);r||(r=[],n.set(i,r)),r.push({...t,leaf:i})}for(let t of n.values())t.sort((i,r)=>i.startLine-r.startLine||i.endLine-r.endLine||i.symbolId-r.symbolId);return n})}function X(o,e){let n=null,t=Number.POSITIVE_INFINITY;for(let i of o){let r=Math.abs(i.startLine-e);(r<t||r===t&&n&&i.startLine<n.startLine)&&(n=i,t=r)}return n}import et from"path";import{realpathSync as tt}from"fs";function Ee(o,e){let n=new Map,t=null,i=null,r=()=>(i??=j(o,{extensions:O}),i),s=()=>(t??=F("typescript.source-file-index",()=>nt(o.config.projectRoot,e,r()),()=>({projects:e.length,indexedDocuments:r().length})),t),a=c=>B(c)?I(n,c,()=>{let l=Ae(o.config.projectRoot,c);if(!l)return null;for(let{project:f,sourceFiles:p}of s()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&Z(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:r}}function nt(o,e,n){let t=e.map(({project:i})=>{let r=new Map;for(let s of i.getSourceFiles())Z(r,s);return{project:i,sourceFiles:r}});for(let i of n){let r=Ae(o,i);if(r)for(let s of t){if(s.sourceFiles.has(r))break;let a=s.project.addSourceFileAtPathIfExists(r)??null;if(a){Z(s.sourceFiles,a);break}}}return t}function Z(o,e){let n=ee(e.getFilePath());o.set(n,e);try{o.set(ee(tt(n)),e)}catch(t){if(!_(t))throw t}}function Ae(o,e){try{return ee(se(o,e,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!_(n))throw n;return null}}function ee(o){return et.resolve(o)}function te(o,e){for(let n of o)if(e===n.name||e.startsWith(`${n.name}/`))return n.name;return null}function je(o){let e=`${o.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}var it=32;function gn(o,e){let n=F("typescript.provider.load",()=>ue());if(!n)return U("ts-morph is not installed");let t=F("typescript.provider.tsconfig-discovery",()=>Fe(o));if(t.length===0)return U("no tsconfig found");try{let i=F("typescript.provider.project-bundles",()=>me(n,t),()=>({tsconfigs:t.length}));return rt(o,n,i)}catch(i){return U(i instanceof Error?i.message:String(i),t[0],t)}}function rt(o,e,n,t={}){return F("typescript.provider.construct",()=>new ne(o,e,n),()=>({tsconfigs:n.length,reusedProjects:t.reusedProjects===!0}))}var ne=class{constructor(e,n,t){this.db=e;this.tsMorph=n;this.projects=t;this.workspacePackages=le(e.config.projectRoot),this.sourceFiles=Ee(e,t)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return I(this.importUsageCache,e,()=>{let n=this.sourceFiles.sourceFile(e);if(!n)return[];let t=st();return F("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,n,t),()=>({file:e,...t}))})}referencesFor(e){return I(this.referencesCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,n)})}referencesForDefinitions(e,n={}){let t=new Map,i=A(),r=[];for(let f of e){let p=this.referencesCache.get(f.symbolId);p?t.set(f.symbolId,p):r.push(f)}if(r.length===0)return t;let s=r,a=n.exact?[]:r.filter(f=>!Be(f));if(a.length>=it){let f=this.referencesForDefinitionsBySymbolScan(a);for(let p of a){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}if(s=r.filter(p=>Be(p)),s.length===0)return t}let c=new Map;for(let f of s){let p=c.get(f.relativePath);p?p.push(f):c.set(f.relativePath,[f])}let l=[];for(let[f,p]of c){let d=Ue();F("typescript.references-map.file",()=>{let S=this.definitionNodesForFile(f);for(let y of p){i&&(d.cacheMisses+=1);let h=S.get(y.symbolId)??null;i&&(h?d.nodeHits+=1:d.nodeMisses+=1);try{let u=this.referencesForDefinitionNode(y,h,i?d:void 0);this.referencesCache.set(y.symbolId,u),t.set(y.symbolId,u)}catch{d.preciseSearchFailures+=1,l.push(y)}}},()=>({relativePath:f,definitions:p.length,...qe(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);for(let p of l){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}}return t}referenceFragmentsForFiles(e){let n=he(this.db).filter(r=>B(r.relativePath)),t=e.filter(r=>this.sourceFiles.sourceFile(r)!==null),i=this.referencesForDefinitionsBySymbolScan(n,t);return ye(n,i,t)}referencesForDefinitionsBySymbolScan(e,n){let t=A(),i=Ue(),r=new Map,s=new Set(e.map(c=>c.symbolId)),a=new Map(e.map(c=>[c.symbolId,c]));for(let c of e)r.set(c.symbolId,[]);return F("typescript.references-map.inverted-scan",()=>{let c=t?m.now():0,l=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let u of e){let g=l.get(u.symbolId)??[];if(g.length>0){let T=r.get(u.symbolId)??[];T.push(...g),r.set(u.symbolId,T)}t&&(i.packageReferenceCount+=g.length)}t&&(i.packageRefsMs+=m.now()-c);let f=new Map,p=new Map,d=this.hierarchyTargetsForDefinitions(e),S=new Set(e.map(u=>u.leaf).filter(Boolean)),y=t?m.now():0;for(let u of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(u))continue;let g=this.sourceFiles.sourceFile(u);g&&(t&&(i.scanFiles+=1),this.addReferencesFromSourceFileScan(g,u,s,a,d,S,f,p,r,t?i:void 0))}t&&(i.scanMs+=m.now()-y);let h=t?m.now():0;this.addHierarchyMemberReferences(e,r,t?i:void 0),t&&(i.hierarchyMs+=m.now()-h);for(let[u,g]of r){let T=P(g);r.set(u,T),t&&(i.referenceCount+=T.length)}},()=>({definitions:e.length,...qe(i)})),r}addReferencesFromSourceFileScan(e,n,t,i,r,s,a,c,l,f){let p=this.compilerCheckerForSourceFile(e),d=e.compilerNode,S=lt(e),y=h=>{if(this.tsMorph.ts.isIdentifier(h)){if(f&&(f.identifiers+=1),!s.has(h.text)&&!S.has(h.text)){this.tsMorph.ts.forEachChild(h,y);return}let u=this.compilerReferenceSymbol(p,h,f);if(u){let g;a.has(u)?g=a.get(u)??null:(g=this.referenceDefinitionFromCompilerSymbol(u),a.set(u,g)),f&&(g?f.targetHits+=1:f.targetMisses+=1);let T=I(c,u,()=>this.compilerSymbolKeys(u)),C=null,k=null,N=g&&t.has(g.symbolId)?i.get(g.symbolId):void 0;if(N&&(C=H(d,h),!Oe(N,n,C))){let R=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:R.line,column:R.character};let D=l.get(N.symbolId)??[];D.push(k),l.set(N.symbolId,D),f&&(f.requestedHits+=1)}for(let R of T)for(let D of r.get(R)?.values()??[]){if(C??=H(d,h),Oe(D,n,C))continue;if(!k){let x=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:x.line,column:x.character}}let M=l.get(D.symbolId)??[];M.push(k),l.set(D.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(h,y)};y(d)}hierarchyTargetsForDefinitions(e){let n=new Map;for(let t of e){let i=this.nodeForDefinition(t),r=i?.compilerNode;if(!r||!this.isHierarchyMethod(r))continue;let s=r.parent;if(!this.isHierarchyContainer(s))continue;let a=this.compilerCheckerForSourceFile(i.getSourceFile()),c=a.getSymbolAtLocation(r.name);if(c)for(let l of this.hierarchyMemberSymbols(a,s,c))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(t.symbolId,t),n.set(f,p)}}return n}hierarchyMemberSymbols(e,n,t){let i=new Set,r=new Set,s=(a,c,l)=>{if(!r.has(a)){r.add(a),i.add(c);for(let f of l){let p=f.getProperty(t.name);p&&s(f,p,this.hierarchyAncestorTypesForType(e,f))}}};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),i}addHierarchyMemberReferences(e,n,t){let i=new Map;for(let r of e){let s=this.nodeForDefinition(r),a=s?.compilerNode;if(!a||!this.isHierarchyMethod(a))continue;let c=a.parent;if(!this.isHierarchyContainer(c))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),f=l.getSymbolAtLocation(a.name);if(!f)continue;let p=a.getSourceFile(),d=p.getLineAndCharacterOfPosition(a.name.getStart(p)),S={definition:r,location:{file:r.relativePath,line:d.line,column:d.character}},y=n.get(r.symbolId)??[];for(let u of this.hierarchyMemberSymbols(l,c,f))if(u!==f)for(let g of this.compilerSymbolLocations(u))y.push(g),t&&(t.hierarchyReferences+=1);n.set(r.symbolId,y);let h=this.hierarchyRootMemberSymbols(l,c,f);for(let u of h){let g=i.get(u)??new Map;g.set(r.symbolId,S),i.set(u,g)}t&&(t.hierarchyDefinitions+=1)}for(let r of i.values())if(!(r.size<2)){t&&(t.hierarchyFamilies+=1);for(let{definition:s}of r.values()){let a=n.get(s.symbolId)??[];for(let c of r.values())c.definition.symbolId!==s.symbolId&&(a.push(c.location),t&&(t.hierarchyReferences+=1));n.set(s.symbolId,a)}}}hierarchyRootMemberSymbols(e,n,t){let i=new Set,r=new Set,s=(a,c,l)=>{if(r.has(a))return;r.add(a);let f=!1;for(let p of l){let d=p.getProperty(t.name);d&&(f=!0,s(p,d,this.hierarchyAncestorTypesForType(e,p)))}if(!f)for(let p of this.compilerSymbolKeys(c))i.add(p)};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),i}compilerSymbolKeys(e){return(e.declarations??[]).map(n=>{let t=n.getSourceFile();return`${t.fileName}\0${n.getStart(t)}\0${e.name}`})}compilerSymbolLocations(e){let n=[];for(let t of e.declarations??[]){let i=t.getSourceFile(),r=L(this.db.config.projectRoot,i.fileName);if(!r)continue;let s=t.name,a=i.getLineAndCharacterOfPosition((s??t).getStart(i));n.push({file:r,line:a.line,column:a.character})}return n}baseTypes(e,n){try{return e.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(e,n){let t=new Set(this.hierarchyAncestorTypesForType(e,e.getTypeAtLocation(n)));for(let i of n.heritageClauses??[])for(let r of i.types)t.add(e.getTypeAtLocation(r));return[...t]}hierarchyAncestorTypesForType(e,n){let t=new Set(this.baseTypes(e,n));for(let i of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(i))for(let r of i.heritageClauses??[])for(let s of r.types)t.add(e.getTypeAtLocation(s));return[...t]}isHierarchyMethod(e){return this.tsMorph.ts.isMethodDeclaration(e)||this.tsMorph.ts.isMethodSignature(e)}isHierarchyContainer(e){return this.tsMorph.ts.isClassDeclaration(e)||this.tsMorph.ts.isClassExpression(e)||this.tsMorph.ts.isInterfaceDeclaration(e)}compilerReferenceSymbol(e,n,t){t&&(t.symbolLookups+=1);let i=e.getSymbolAtLocation(n);if(i){if((i.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return i;try{return t&&(t.aliasResolutions+=1),e.getAliasedSymbol(i)}catch{return i}}}calleesFor(e){return I(this.calleesCache,e.symbolId,()=>I(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let n=new Map,t=new Map;for(let i of e){let r=t.get(i.relativePath);r?r.push(i):t.set(i.relativePath,[i])}for(let[i,r]of t){let s=this.fileCalleesCache.get(i),a=new Set(r.map(l=>l.symbolId)),c=s??this.calleeMapForFile(i,a);for(let l of r){let f=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(e,n,t){let i=t?m.now():0,r=this.packageImportReferencesForDefinition(e);if(t&&(t.packageRefsMs+=m.now()-i,t.packageReferenceCount+=r.length),!n)return r;let s=t?m.now():0,a=Ce(n,e,r,this.db.config.projectRoot);return t&&(t.semanticRefsMs+=m.now()-s,t.referenceCount+=a.length),a}signatureFor(e){return I(this.signatureCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let t=n.getType().getCallSignatures()[0];if(!t)return null;let i=t.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return He(c)}),r=t.getReturnType().getText(n);return`(${i.join(",")})=>${He(r)}`})}importUsageForSourceFile(e,n,t){let i=[],r=new Map;for(let s of n.getImportDeclarations()){t.declarations+=1;let a=K(this.db,e,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of ie(s)){t.entries+=1;let f=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(f?t.bindingSymbols+=1:t.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:f,references:[]};if(i.push(p),c||!l.localName||!f)continue;let d=r.get(l.localName);d?d.push(p):r.set(l.localName,[p])}}return r.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=r.get(s.getText());if(!a||at(s))return;t.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(t.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:q(s,this.db.config.projectRoot),node:s}),t.matchedReferences+=1;break}}}),i.map(s=>s.typeOnlyDeclaration?ot(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(t.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,n,t){let i=t.identifier?t.identifier.findReferences():[],r=[];for(let s of i)for(let a of Ne(s,e,t.identifier,this.db.config.projectRoot))r.push(a);return this.valueImportUsageFromLocations(e,n,t,r)}valueImportUsageFromLocations(e,n,t,i){let r=i.some(c=>!Y(c.node)),s=i.some(c=>Y(c.node)),a=t.isTypeOnly;return{importer:e,sourcePath:n,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:a,isUsed:a||i.length>0,isTypeUsed:a||s,isValueUsed:r,references:i.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferencesForFiles(e){let n=new Map,t=new Set;for(let r of e){let s=this.sourceFiles.sourceFile(r);if(s)for(let a of s.getImportDeclarations()){let c=te(this.workspacePackages,a.getModuleSpecifierValue());c&&t.add(c)}}if(t.size===0)return n;let i=this.packageExportsForNames(t);for(let r of e)this.addPackageImportReferencesForDocument(n,i,r);for(let[r,s]of n)n.set(r,P(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,n=this.packageExports();for(let t of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,n,t);for(let[t,i]of e)e.set(t,P(i));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,n,t){if(this.db.isIgnored(t))return;let i=this.sourceFiles.sourceFileMatch(t);if(i)for(let r of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,n,t,r)}addPackageImportReferencesForDeclaration(e,n,t,i){let r=te(this.workspacePackages,i.getModuleSpecifierValue());if(!r)return;let s=n.get(r);if(s)for(let a of ie(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=ve(a.identifier,t,this.db.config.projectRoot);l.length>0&&ut(e,c,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(e=>e.name))),this.packageExportIndex)}packageExportsForNames(e){let n=new Map;for(let t of this.workspacePackages){if(!e.has(t.name))continue;let i=new Map;for(let r of je(t))this.collectPackageExports(t,r,i,new Set);i.size>0&&n.set(t.name,i)}return n}collectPackageExports(e,n,t,i){if(i.has(n))return;i.add(n);let r=this.sourceFiles.sourceFile(n);if(r)for(let s of r.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?K(this.db,n,a):n;if(!c||!c.startsWith(`${e.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,t,i);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,S=this.indexedDefinitionByLeaf(c,p);if(!S)continue;let y=t.get(d);y||(y=new Set,t.set(d,y)),y.add(S.symbolId)}}}indexedDefinitionByLeaf(e,n){return I(this.indexedDefinitionLeafCache,e,()=>we(this.db,e)).get(n)??null}nodeForDefinition(e){return I(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return I(this.fileDefinitionNodeCache,e,()=>{let n=this.sourceFiles.sourceFile(e);return n?Pe(this.tsMorph,this.db,n,e):new Map})}referenceDefinitionFromCompilerSymbol(e){return this.definitionFromCompilerSymbol(e,void 0,!0)}definitionFromCompilerSymbol(e,n,t=!1){let i=e.name,r=n?m.now():0,s=e.declarations??[];n&&(n.declarationsMs+=m.now()-r,n.declarationChecks+=s.length);for(let a of s){let c=n?m.now():0,l=a.getSourceFile(),f=L(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(a.getStart(l)).line;if(n&&(n.declarationLocationMs+=m.now()-c),!f||this.db.isIgnored(f))continue;let d=n?m.now():0,S=this.compilerDeclarationName(a),y=t?J(this.db,f,p,i)??(S&&S!==i?J(this.db,f,p,S):null):Le(this.db,f,p,i);if(n&&(n.indexedLookupMs+=m.now()-d),y)return{symbolId:y.symbolId,symbol:y.symbol,file:y.relativePath,line:y.startLine}}return null}compilerDeclarationName(e){let n=e.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(e,n){let t=A(),i=0,r=0,s=0,a=0,c=0,l=0,f=0,p=0,d=t?pt():void 0;return F("typescript.callee-map.file",()=>{let S=t?m.now():0,y=this.sourceFiles.sourceFile(e);if(t&&(c=Math.round(m.now()-S)),!y)return new Map;let h=t?m.now():0,u=v(this.db,e).sort((M,x)=>M.startLine-x.startLine||x.endLine-M.endLine);if(t&&(l=Math.round(m.now()-h)),i=u.length,u.length===0)return new Map;let g=new Map,T=t?m.now():0,C=this.compilerCheckerForSourceFile(y),k=y.compilerNode;t&&(f=Math.round(m.now()-T));let N=new Map,R=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){t&&(r+=1);let x=this.semanticCalleeForCallNode(C,k,u,M,N,n,d);x&&(t&&(s+=1),ct(g,x.callerId,x.target))}this.tsMorph.ts.forEachChild(M,R)},D=t?m.now():0;R(k),t&&(p=Math.round(m.now()-D));for(let[M,x]of g)g.set(M,mt(x));return a=g.size,g},()=>({relativePath:e,definitions:i,callNodes:r,resolvedCallees:s,outputRows:a,requestedDefinitions:n?.size??i,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?dt(d):{}}))}semanticCalleeForCallNode(e,n,t,i,r,s,a){let c=a?m.now():0,l=ft(t,H(n,i));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let f=i.expression,p=this.compilerSymbolForExpression(e,f,a),d=null;if(p)if(a&&(a.targetSymbolHits+=1),r.has(p))a&&(a.compilerSymbolCacheHits+=1),d=r.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let S=a?m.now():0;d=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-S),r.set(p,d)}else a&&(a.targetMisses+=1);return d?{callerId:l.symbolId,target:{symbol:d.symbol,file:d.file,line:d.line,callsiteLine:H(n,i)}}:null}compilerSymbolForExpression(e,n,t){let i=t?m.now():0,r=e.getSymbolAtLocation(n);if(t&&(t.expressionSymbolMs+=m.now()-i),r)return r;t&&(t.typeFallbacks+=1);let s=t?m.now():0,a=e.getTypeAtLocation(n).getSymbol();return t&&(t.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(e){let n=e.getProject(),t=this.compilerCheckerCache.get(n);return t||(t=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,t)),t}};function ie(o){let e=[],n=o.getDefaultImport();n&&e.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});let t=o.getNamespaceImport();t&&e.push({identifier:t,importedName:"*",localName:t.getText(),kind:"namespace",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});for(let i of o.getNamedImports()){let r=i.getNameNode(),a=i.getAliasNode()??(r.getKindName()==="Identifier"?r:null);e.push({identifier:a,importedName:r.getText(),localName:a?.getText()??r.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(o.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function ot(o,e,n){return{importer:o,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function st(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function at(o){for(let e=o;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function ct(o,e,n){let t=o.get(e);t||(t=[],o.set(e,t)),t.push(n)}function lt(o){let e=new Set;for(let n of o.getImportDeclarations())for(let t of ie(n))t.localName&&e.add(t.localName);return e}function ft(o,e){let n=null;for(let t of o)e<t.startLine||e>t.endLine||(!n||t.startLine>=n.startLine)&&(n=t);return n}function H(o,e){return o.getLineAndCharacterOfPosition(e.getStart(o)).line}function Oe(o,e,n){return e===o.relativePath&&n>=o.startLine&&n<=o.endLine}function Be(o){return o.symbol.includes("#")?ge(o.symbol)==="type"&&o.relativePath.endsWith(".d.ts"):!1}function pt(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function dt(o){return{...o,callerLookupMs:Math.round(o.callerLookupMs),expressionSymbolMs:Math.round(o.expressionSymbolMs),typeSymbolMs:Math.round(o.typeSymbolMs),targetLookupMs:Math.round(o.targetLookupMs),declarationsMs:Math.round(o.declarationsMs),declarationLocationMs:Math.round(o.declarationLocationMs),indexedLookupMs:Math.round(o.indexedLookupMs)}}function Ue(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function qe(o){return{...o,scanMs:Math.round(o.scanMs),packageRefsMs:Math.round(o.packageRefsMs),semanticRefsMs:Math.round(o.semanticRefsMs),hierarchyMs:Math.round(o.hierarchyMs)}}function ut(o,e,n){for(let t of e){let i=o.get(t)??[];i.push(...n),o.set(t,i)}}function mt(o){let e=new Set,n=[];for(let t of o){let i=`${t.symbol}|${t.file}|${t.line}|${t.callsiteLine??""}`;e.has(i)||(e.add(i),n.push(t))}return n}function He(o){return o.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{Me as a,Mt as b,It as c,xt as d,Fe as e,gn as f,rt as g};
3
+ //# sourceMappingURL=chunk-SEUJVWT2.js.map
@@ -0,0 +1,2 @@
1
+ import{d as w,f as E}from"./chunk-DOPCR5BY.js";import{a as A,c as k,g as v}from"./chunk-G6OGPXJW.js";import{a as G,b as L,c as q,d as F}from"./chunk-3VLJ2DCA.js";import{h as u,k as M}from"./chunk-4DCKBY6T.js";function K(t,e){return t.reason instanceof Error?t.reason:new Error(e)}function Ee(t,e){if(t?.aborted)throw K(t,e)}import{join as J}from"path";var U=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t.pid;return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{pid:e}:null};function Te(t,e={}){return h(J(t,"gc.lock"),e)}function h(t,e={}){let n=e.waitMs??0,r=e.pollMs??10,i=e.now??F,o=i()+n;do{let a=Y(t,e.directoryDurability);if(a)return W(a);let l=o-i();if(l<=0)return null;X(Math.min(r,l))}while(i()<=o);return null}function Y(t,e){let n=k(t,{kind:"generic",parseLegacy:U,...e?{directoryDurability:e}:{}});return n.kind==="acquired"?n.lock:null}function W(t){return{release:()=>{t.release()}}}function X(t){let e=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(e,0,0,t)}import{createHash as Z,randomUUID as ee}from"crypto";import{existsSync as m,mkdirSync as te,readdirSync as ne,rmSync as D,statSync as C}from"fs";import{basename as re,dirname as S,join as c}from"path";var ie=1,oe=1,ae=".scipquery-generations",se="manifest.json",N="readers",ce="gc.lock",le=128,g=new Map,_={pid:process.pid,now:()=>new Date,randomToken:()=>ee(),isProcessAlive:A,readProcessIdentity:q};function p(t){return c(S(t),ae)}function de(t){return c(p(t),ce)}function Ve(t,e=_){let n=h(de(t.dbPath),{waitMs:5e3,directoryDurability:"recoverable"});if(!n)throw new Error("SQLite generation retention is busy; retry opening the index.");let r;try{let i=ye(t);if(i.source!=="immutable")return{generation:i,release(){}};let o=e.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(o))throw new Error("SQLite generation reader token is unsafe.");let a=c(p(t.dbPath),N);te(a,{recursive:!0}),r=c(a,`${e.pid}-${o}.json`);let l=e.readProcessIdentity(e.pid);v(r,{version:1,token:o,generationIdentity:i.identity,pid:e.pid,...l?{processIdentity:l}:{},acquiredAt:e.now().toISOString()},{spacing:2,trailingNewline:!0});let d=!1;return{generation:i,release(){d||!r||(d=!0,D(r,{force:!0}))}}}finally{n.release()}}function Ke(t,e,n=_,r={}){let i=c(p(t),N);if(!m(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,a=0,l=0,d=0;for(let f of ne(i,{withFileTypes:!0})){if(!f.isFile()||!f.name.endsWith(".json"))continue;let y=c(i,f.name),s;try{s=ue(JSON.parse(u(y,"SQLite generation reader lease")))}catch{s=null}if(!s){d+=1;for(let V of e)o.add(V);continue}if(!fe(s,n)){r.removeStale!==!1&&(D(y,{force:!0}),l+=1);continue}a+=1,o.add(s.generationIdentity)}return{protectedGenerations:o,activeLeases:a,staleLeasesRemoved:l,malformedLeases:d}}function ue(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=e.processIdentity===void 0?null:G(e.processIdentity);return e.version!==1||typeof e.token!="string"||e.token.trim()===""||typeof e.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(e.generationIdentity)||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.acquiredAt!="string"||!Number.isFinite(Date.parse(e.acquiredAt))||e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,token:e.token,generationIdentity:e.generationIdentity,pid:e.pid,...n?{processIdentity:n}:{},acquiredAt:e.acquiredAt}}function fe(t,e){if(!e.isProcessAlive(t.pid))return!1;if(!t.processIdentity)return!0;let n=e.readProcessIdentity(t.pid);return n===null||L(t.processIdentity,n)}function $(t){try{let e=JSON.parse(u(c(p(t),"state.json"),"SQLite generation state"));return he(e)?e:null}catch{return null}}function me(t,e){return pe(p(t),e)}function pe(t,e){try{let n=JSON.parse(u(c(t,e,se),"SQLite generation manifest"));return Re(n,e)?n:null}catch{return null}}function ye(t){let e=$(t.dbPath);if(e){let n=be(t,e.currentGeneration);if(n)return n;if(e.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${e.currentGeneration} is missing or invalid.`)}if(m(c(S(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return Se(t,e?.currentGeneration)}function Je(t){let e=$(t);if(e)return e.currentGeneration;try{let n=c(S(t),"meta.json"),r=m(n)?u(n,"reindex metadata"):void 0;return O(t,r)}catch{return null}}function ge(t){return E(w(t))??t}function be(t,e){try{let n=c(p(t.dbPath),e),r=me(t.dbPath,e);if(!r)return null;let i=I(n,r.database),o=r.index?I(n,r.index):void 0,a=r.metadata?I(n,r.metadata):void 0;return!P(i,r.database)||r.index&&(!o||!P(o,r.index))||r.metadata&&(!a||!P(a,r.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...a?{metadataPath:a,metadataRaw:u(a,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function Se(t,e){let n=j(t.dbPath),r=c(S(t.dbPath),"meta.json"),i=m(r)?u(r,"reindex metadata"):void 0,o=m(t.indexPath)?t.indexPath:void 0;return{identity:e??O(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:r,metadataRaw:i},source:"legacy",databaseFileIdentity:n}}function O(t,e){let n=Z("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&n.update(ge(e)),n.update(`\0${j(t)}`),n.digest("hex")}function j(t){let e=C(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function I(t,e){if(re(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return c(t,e.file)}function P(t,e){if(!m(t))return!1;let n=T(t);if(!n||n.size!==e.size)return!1;let r=`${t}\0${e.sha256}\0${n.identity}`;if(g.has(r))return!0;let i=M(t,{inputKind:"immutable SQLite generation artifact",maxBytes:e.size}),o=T(t);if(!o||o.identity!==n.identity||i!==e.sha256)return!1;for(g.set(r,!0);g.size>le;){let a=g.keys().next().value;if(a===void 0)break;g.delete(a)}return!0}function T(t){let e=C(t,{bigint:!0});return e.isFile()?{identity:`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`,size:Number(e.size)}:null}function Re(t,e){return t.version===oe&&t.identity===e&&x(t.database)&&(t.index===void 0||x(t.index))&&(t.metadata===void 0||x(t.metadata))}function x(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.file=="string"&&!!e.file&&Number.isSafeInteger(e.size)&&(e.size??-1)>=0&&typeof e.sha256=="string"&&/^[a-f0-9]{64}$/.test(e.sha256)}function he(t){return t.version===ie&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&Ie(t.stableMirrors)&&Pe(t.previousGeneration)&&xe(t.publication)}function Ie(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.databaseFileIdentity=="string"&&!!e.databaseFileIdentity&&(e.indexFileIdentity===void 0||typeof e.indexFileIdentity=="string"&&!!e.indexFileIdentity)}function Pe(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.generationIdentity=="string"&&!!e.generationIdentity&&typeof e.databasePath=="string"&&!!e.databasePath&&(e.metadataPath===void 0||typeof e.metadataPath=="string"&&!!e.metadataPath)}function xe(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t,n=[e.converterDurationMs,e.affectedDocumentCount,e.changedDocumentCount,e.producerDurationMs,e.materializationDurationMs,e.patchDurationMs].filter(r=>r!==void 0);return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&n.every(r=>typeof r=="number"&&Number.isFinite(r)&&r>=0)&&(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}var Me=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function Ye(t){let e=t.toLowerCase();return Me.some(n=>e.endsWith(n))}import{createRequire as Ge}from"module";var Q=Ge(import.meta.url),b,R;function Le(){if(b!==void 0)return b;try{b=Q("ts-morph")}catch{b=null}return b}function Ze(){if(R)return R;let t=Le();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=Q("ts-morph/package.json").version??"unknown"}catch{}return R=`ts-morph:${e}:typescript:${t.ts.version}`,R}function et(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function tt(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function rt(t,e){let n=new Map(t.map(i=>[i.symbol,i])),r=new Map(t.map(i=>[i.symbolId,[]]));for(let i of e.values())for(let o of i){let a=n.get(o.targetSymbol);a&&r.get(a.symbolId).push(o.location)}for(let[i,o]of r)r.set(i,qe(o));return r}function it(t,e,n){let r=B(t,e),i=B(t,n),o=[...r].filter(s=>!i.has(s)).sort(),a=[...i].filter(s=>!r.has(s)).sort(),l=z(t,e),d=z(t,n),f=[...l].filter(s=>!d.has(s)).sort(),y=[...d].filter(s=>!l.has(s)).sort();return{passed:o.length===0&&a.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:a,callerFiles:{passed:f.length===0&&y.length===0,expectedCount:l.size,actualCount:d.size,missing:f,extra:y}}}function z(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function ot(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let a of e.get(o.symbolId)??[])r.has(a.file)&&i.get(a.file).push({targetSymbol:o.symbol,location:a});for(let[o,a]of i)i.set(o,we(a));return i}function B(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function qe(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort(H)}function we(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||H(n.location,r.location))}function H(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}export{K as a,Ee as b,Te as c,h as d,ie as e,oe as f,ae as g,se as h,p as i,de as j,Ve as k,Ke as l,$ as m,me as n,pe as o,ye as p,Je as q,ge as r,j as s,Me as t,Ye as u,Le as v,Ze as w,et as x,tt as y,rt as z,it as A,ot as B};
2
+ //# sourceMappingURL=chunk-SF7X6QNW.js.map
@@ -0,0 +1,2 @@
1
+ import{a as u}from"./chunk-VGRUM7JI.js";import{g as i}from"./chunk-VWLIOEEF.js";import{existsSync as h}from"fs";import{isAbsolute as p,join as g}from"path";function D(e,n){let t=l(e,n,{allowMultiple:!1})[0]?.relativePath;return t||d(e,n)}function P(e,n){return l(e,n,{allowMultiple:!0}).map(t=>t.relativePath)}function S(e,n){let t=l(e,n,{allowMultiple:!0});return t.length===1?t[0].relativePath:null}function d(e,n){if(!n)return null;let t=n.replace(/\\/g,"/").replace(/^\.\//,""),r=p(t)&&t.startsWith(e.config.projectRoot)?t.slice(e.config.projectRoot.length).replace(/^\/+/,""):t,o=g(e.config.projectRoot,r);return h(o)?r:null}function l(e,n,t){let r=d(e,n);if(r)return i(e,r,t).filter(a=>a.relativePath===r);let o=n.replace(/\\/g,"/").replace(/^\.\//,""),s=p(o)||o.includes("/"),c=i(e,n,{...t,requirePathMatch:s});if(c.length===0){if(s)return[];let a=u(e,n);return!a||e.isIgnored(a.relativePath)?[]:[{relativePath:a.relativePath,score:700}]}return c}export{D as a,P as b,S as c};
2
+ //# sourceMappingURL=chunk-SKUMCCC5.js.map