scip-query 0.21.1 → 0.22.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 (354) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/by-kind-4IYG2SKW.js +2 -0
  4. package/dist/call-graph-WQNXMNNN.js +2 -0
  5. package/dist/{chunk-5QM7QT5B.js → chunk-25GWKRUZ.js} +2 -2
  6. package/dist/chunk-2BTJALUS.js +454 -0
  7. package/dist/{chunk-4ZCLDH6T.js → chunk-2KVU55CW.js} +2 -2
  8. package/dist/{chunk-CQVDALWQ.js → chunk-2OXVP5U5.js} +2 -2
  9. package/dist/{chunk-I2LY3KN7.js → chunk-2RE5OCHZ.js} +2 -2
  10. package/dist/{chunk-5J3A6RBZ.js → chunk-2XCGSDIT.js} +2 -2
  11. package/dist/{chunk-4KIPF45P.js → chunk-2YC7YNKT.js} +2 -2
  12. package/dist/{chunk-ZNW5A5VX.js → chunk-3QXC54FQ.js} +2 -2
  13. package/dist/{chunk-SGSPCEFC.js → chunk-3TJY6M3B.js} +2 -2
  14. package/dist/chunk-42W3LFUK.js +13 -0
  15. package/dist/chunk-44T4DUAA.js +2 -0
  16. package/dist/{chunk-YBWE6J32.js → chunk-4GAQ6FI4.js} +2 -2
  17. package/dist/{chunk-OU6SDWAM.js → chunk-4HE7MVWD.js} +2 -2
  18. package/dist/{chunk-QN2AI3D2.js → chunk-4TQU4TX2.js} +2 -2
  19. package/dist/{chunk-OMVNRPST.js → chunk-56NQAEPJ.js} +2 -2
  20. package/dist/{chunk-O4PZFAXA.js → chunk-57N6LN2A.js} +2 -2
  21. package/dist/{chunk-7MUHSZGN.js → chunk-5H5WTJSD.js} +2 -2
  22. package/dist/{chunk-J4HUBIVF.js → chunk-5YRQIE2B.js} +2 -2
  23. package/dist/{chunk-3XQLJG7V.js → chunk-5ZMBRQFC.js} +2 -2
  24. package/dist/{chunk-H2RBDP5S.js → chunk-6HRZQLOI.js} +2 -2
  25. package/dist/{chunk-PJBYDCBQ.js → chunk-6NC3YSPY.js} +2 -2
  26. package/dist/{chunk-MLTSTKXD.js → chunk-6VEFRPTD.js} +2 -2
  27. package/dist/{chunk-JLZWYDCZ.js → chunk-7C26EKLZ.js} +2 -2
  28. package/dist/{chunk-LXMW6ZAX.js → chunk-7IQXARSQ.js} +2 -2
  29. package/dist/chunk-7JYHQAH2.js +22 -0
  30. package/dist/{chunk-YA72ZUKO.js → chunk-7KSO2OAP.js} +2 -2
  31. package/dist/{chunk-YT4IQBET.js → chunk-7U2YQSDE.js} +2 -2
  32. package/dist/{chunk-XDOEHEET.js → chunk-7XA3OM44.js} +2 -2
  33. package/dist/{chunk-BCTCADNB.js → chunk-7XZGZBSQ.js} +2 -2
  34. package/dist/{chunk-3KXFB2FM.js → chunk-7YQOCABQ.js} +2 -2
  35. package/dist/chunk-A77SCPW2.js +3 -0
  36. package/dist/chunk-AK3PYTIK.js +5 -0
  37. package/dist/{chunk-6X4KO5A7.js → chunk-AMIMMNA4.js} +2 -2
  38. package/dist/{chunk-PWEQ6CZZ.js → chunk-AQ2PORIO.js} +2 -2
  39. package/dist/{chunk-E6N6YTVM.js → chunk-ARVO6TTW.js} +2 -2
  40. package/dist/{chunk-U7DOYZDH.js → chunk-AUY5BL74.js} +2 -2
  41. package/dist/{chunk-B3AREUQK.js → chunk-AYPDH2LU.js} +2 -2
  42. package/dist/{chunk-HR5JYLVV.js → chunk-AZS7YPCB.js} +2 -2
  43. package/dist/{chunk-ZQUNCTEZ.js → chunk-BDGTPN27.js} +2 -2
  44. package/dist/{chunk-DZNWXJN2.js → chunk-BDHFVH2M.js} +2 -2
  45. package/dist/{chunk-743MEVFJ.js → chunk-BECZLYNU.js} +2 -2
  46. package/dist/{chunk-4IASLUOP.js → chunk-BJT7LSPK.js} +2 -2
  47. package/dist/{chunk-X5MWO4DM.js → chunk-BTVKZGWT.js} +2 -2
  48. package/dist/{chunk-HYU4W353.js → chunk-BUTEIZKP.js} +2 -2
  49. package/dist/{chunk-UXNXOMXJ.js → chunk-BVFYEEBH.js} +2 -2
  50. package/dist/{chunk-UM56ZET4.js → chunk-BWVQP3LB.js} +2 -2
  51. package/dist/chunk-BYDAFMSR.js +57 -0
  52. package/dist/{chunk-P3UFF22M.js → chunk-C76O5MDS.js} +2 -2
  53. package/dist/chunk-C7IJMOFP.js +134 -0
  54. package/dist/{chunk-IM23CSG5.js → chunk-CBBHFNLX.js} +2 -2
  55. package/dist/{chunk-IZKJQQCQ.js → chunk-CKRWA452.js} +2 -2
  56. package/dist/{chunk-YLNCTPOI.js → chunk-CLG6DWVS.js} +2 -2
  57. package/dist/{chunk-DXEJ4FLZ.js → chunk-D2MVJSP4.js} +8 -8
  58. package/dist/chunk-D35XIZGN.js +2 -0
  59. package/dist/{chunk-AQF35NGT.js → chunk-DEAB5TGT.js} +2 -2
  60. package/dist/{chunk-7G2WIVIX.js → chunk-DJAO2OZJ.js} +2 -2
  61. package/dist/{chunk-PRLU3I7G.js → chunk-DKM723YF.js} +4 -4
  62. package/dist/{chunk-RSUH7G5T.js → chunk-DPWKKNKI.js} +2 -2
  63. package/dist/chunk-E44IVWIJ.js +367 -0
  64. package/dist/{chunk-W7HN6V4E.js → chunk-EDMB6SSO.js} +2 -2
  65. package/dist/{chunk-YCXQQ3YB.js → chunk-EELG7D3Q.js} +2 -2
  66. package/dist/{chunk-T2PBOVDI.js → chunk-EELPBR7E.js} +2 -2
  67. package/dist/{chunk-PAZSBPJR.js → chunk-EETGXQY7.js} +2 -2
  68. package/dist/{chunk-DUDUIT5P.js → chunk-ENWQWA2R.js} +2 -2
  69. package/dist/{chunk-QH5Q6M5C.js → chunk-ERCYGVAM.js} +2 -2
  70. package/dist/{chunk-ZGDHC5AT.js → chunk-EWWY2ZFL.js} +2 -2
  71. package/dist/{chunk-LJMWILX6.js → chunk-F24G5NBE.js} +2 -2
  72. package/dist/{chunk-XNF5T4T2.js → chunk-F24QUEQP.js} +2 -2
  73. package/dist/{chunk-IH3K5J6K.js → chunk-FBCVASUG.js} +2 -2
  74. package/dist/{chunk-EPLE5O5O.js → chunk-FELGD32K.js} +2 -2
  75. package/dist/{chunk-PU6XDQ2X.js → chunk-FFJQZG6J.js} +5 -5
  76. package/dist/{chunk-JGMD6JGB.js → chunk-FGNCOQUX.js} +2 -2
  77. package/dist/chunk-FKGQOTKD.js +2 -0
  78. package/dist/{chunk-27OUNZW5.js → chunk-GDRJB3SB.js} +2 -2
  79. package/dist/chunk-GH5YSGZL.js +5 -0
  80. package/dist/{chunk-IHGK3SZ7.js → chunk-GIQ6CSL4.js} +2 -2
  81. package/dist/{chunk-ITF3CWS5.js → chunk-GPGRZJ3R.js} +2 -2
  82. package/dist/{chunk-EJHNTAEE.js → chunk-GQIDEID3.js} +2 -2
  83. package/dist/{chunk-UEQORB2A.js → chunk-GRX7JOXQ.js} +2 -2
  84. package/dist/{chunk-6QN4FYQW.js → chunk-GVOMSPGL.js} +2 -2
  85. package/dist/{chunk-NT4NVEHU.js → chunk-GY7CCCEZ.js} +2 -2
  86. package/dist/{chunk-BVR44XXB.js → chunk-H7CG6LOE.js} +2 -2
  87. package/dist/{chunk-67FK5KGV.js → chunk-HCVJR2V4.js} +2 -2
  88. package/dist/{chunk-FOP7HD6H.js → chunk-HG722PO7.js} +2 -2
  89. package/dist/{chunk-YR7VRWNX.js → chunk-HISEUIL2.js} +2 -2
  90. package/dist/{chunk-Y2S4YNLH.js → chunk-HXOU4XNH.js} +2 -2
  91. package/dist/{chunk-DZA7MQMU.js → chunk-I6UTXNHU.js} +2 -2
  92. package/dist/{chunk-QZCACNV5.js → chunk-IJMD6BRI.js} +2 -2
  93. package/dist/{chunk-QGVUPYBC.js → chunk-IKVNEGTW.js} +2 -2
  94. package/dist/chunk-IMKZEXZG.js +2 -0
  95. package/dist/{chunk-LGVTIZPV.js → chunk-ISIQLPJ2.js} +2 -2
  96. package/dist/{chunk-BYXWXLKM.js → chunk-ISWFRGJ6.js} +2 -2
  97. package/dist/chunk-IW5XQG5G.js +2 -0
  98. package/dist/{chunk-ZMS4YCY7.js → chunk-IXESDH3J.js} +2 -2
  99. package/dist/{chunk-K63CAPS2.js → chunk-JAT6C3VX.js} +2 -2
  100. package/dist/{chunk-U2MNECDU.js → chunk-JFQBRL3J.js} +2 -2
  101. package/dist/{chunk-4SZJF4GK.js → chunk-JHH5SCZ3.js} +2 -2
  102. package/dist/{chunk-AAOEROT3.js → chunk-JJ62MTQH.js} +2 -2
  103. package/dist/chunk-JT6XX7QY.js +8 -0
  104. package/dist/{chunk-OY7PCALC.js → chunk-JUN5DOAK.js} +2 -2
  105. package/dist/{chunk-DXYMTQZ4.js → chunk-K3XFWJI2.js} +2 -2
  106. package/dist/{chunk-ZP2WUVZ5.js → chunk-KFVSJX25.js} +2 -2
  107. package/dist/{chunk-ND3BWIVN.js → chunk-KQHJEU6V.js} +2 -2
  108. package/dist/{chunk-KGKCJFWZ.js → chunk-KZYID5KV.js} +2 -2
  109. package/dist/{chunk-2LJLEM5B.js → chunk-LO5JSW2C.js} +2 -2
  110. package/dist/{chunk-CNT4ND5O.js → chunk-LRI5OMPE.js} +2 -2
  111. package/dist/{chunk-FCGMQETU.js → chunk-LXQUF2RP.js} +2 -2
  112. package/dist/{chunk-FSPENGSU.js → chunk-MHIEP7EG.js} +2 -2
  113. package/dist/{chunk-LIWIV26I.js → chunk-MSR2QRUE.js} +2 -2
  114. package/dist/chunk-N7FP5H5U.js +57 -0
  115. package/dist/{chunk-527HV7JY.js → chunk-NEIQPFBI.js} +2 -2
  116. package/dist/chunk-NK3JMP22.js +2 -0
  117. package/dist/{chunk-DK6MB565.js → chunk-NRBNAECH.js} +2 -2
  118. package/dist/{chunk-4HQYNZ3P.js → chunk-NVSZNESQ.js} +2 -2
  119. package/dist/{chunk-QLWZUFDT.js → chunk-OJNK5ALA.js} +2 -2
  120. package/dist/{chunk-MRXBLYRE.js → chunk-OPSAW5DT.js} +2 -2
  121. package/dist/{chunk-4TOU7HHQ.js → chunk-OTSPRVNW.js} +2 -2
  122. package/dist/{chunk-IQMGNIGY.js → chunk-OXYAWIEA.js} +2 -2
  123. package/dist/chunk-OZETODHH.js +2 -0
  124. package/dist/chunk-PBUH2P5S.js +3 -0
  125. package/dist/{chunk-5BJPJUXF.js → chunk-PIFTZEEM.js} +2 -2
  126. package/dist/{chunk-C52Q3JEQ.js → chunk-PLJUQFQN.js} +2 -2
  127. package/dist/{chunk-NODZYYGC.js → chunk-PLYUVM4F.js} +2 -2
  128. package/dist/{chunk-47WX6UC4.js → chunk-PXXYQK55.js} +2 -2
  129. package/dist/{chunk-SBFDPHKH.js → chunk-Q55NF3ZG.js} +2 -2
  130. package/dist/{chunk-N4EFQIRX.js → chunk-Q5TA4OY4.js} +2 -2
  131. package/dist/{chunk-HW7FASEL.js → chunk-Q6T2CAJL.js} +2 -2
  132. package/dist/chunk-Q7GBK5T7.js +81 -0
  133. package/dist/{chunk-CXT3GZSQ.js → chunk-QKT4UI2Y.js} +2 -2
  134. package/dist/{chunk-DGM2RJ3I.js → chunk-QLBSG7U5.js} +2 -2
  135. package/dist/chunk-QWKHW6VZ.js +2 -0
  136. package/dist/{chunk-3T5U2EQ2.js → chunk-R6M456QG.js} +2 -2
  137. package/dist/{chunk-RZWBTKXO.js → chunk-RDULNRSJ.js} +2 -2
  138. package/dist/{chunk-YKHL4J3G.js → chunk-RHHCLWQ6.js} +2 -2
  139. package/dist/{chunk-YF25RQER.js → chunk-RNKPYYYE.js} +2 -2
  140. package/dist/{chunk-XKM5D2XS.js → chunk-RPL3ARU7.js} +2 -2
  141. package/dist/{chunk-XFRHBAIT.js → chunk-RYOYJMGF.js} +2 -2
  142. package/dist/chunk-SB25YMEQ.js +2 -0
  143. package/dist/{chunk-SRIZDEWX.js → chunk-SVHTMVA4.js} +2 -2
  144. package/dist/{chunk-AFRS7WJU.js → chunk-SWK4XPUS.js} +2 -2
  145. package/dist/{chunk-YDTK77JP.js → chunk-T6QD2ZQB.js} +2 -2
  146. package/dist/{chunk-Z2QB75BS.js → chunk-TAYD3AE7.js} +2 -2
  147. package/dist/chunk-TD7VKJ2Y.js +117 -0
  148. package/dist/{chunk-K2DZCH2K.js → chunk-TH6IC56G.js} +2 -2
  149. package/dist/{chunk-FIO44MVK.js → chunk-TKDNDQA7.js} +2 -2
  150. package/dist/{chunk-Q4MRRB3C.js → chunk-TNG2FYS5.js} +2 -2
  151. package/dist/chunk-TQZV7KV4.js +2 -0
  152. package/dist/{chunk-NSDPPUDY.js → chunk-TUQIPUDS.js} +2 -2
  153. package/dist/chunk-TUSPIVZ3.js +4 -0
  154. package/dist/{chunk-RNKRYK6B.js → chunk-U2N2KE7A.js} +2 -2
  155. package/dist/{chunk-G47MFF47.js → chunk-UAQ4T73O.js} +2 -2
  156. package/dist/{chunk-5KIJMEPC.js → chunk-UDY7MIAW.js} +2 -2
  157. package/dist/{chunk-MLTKGHD2.js → chunk-URSGGIZX.js} +2 -2
  158. package/dist/{chunk-IGBQVEHE.js → chunk-UT7TADJX.js} +2 -2
  159. package/dist/{chunk-Z67JOKRE.js → chunk-V4NG5OMS.js} +105 -105
  160. package/dist/{chunk-OA2BO4DR.js → chunk-VMWUV6WB.js} +2 -2
  161. package/dist/{chunk-PX6QNUYF.js → chunk-VTCIYFEK.js} +2 -2
  162. package/dist/{chunk-6DO3VBLV.js → chunk-VU6LIWHT.js} +2 -2
  163. package/dist/{chunk-CTO3TRX7.js → chunk-VUSKPCUB.js} +2 -2
  164. package/dist/{chunk-V6XENWOF.js → chunk-VXJJTQYE.js} +2 -2
  165. package/dist/{chunk-BM4OTGSY.js → chunk-VZ7NXSHV.js} +2 -2
  166. package/dist/{chunk-ARGPDW2Y.js → chunk-WHADK6OS.js} +2 -2
  167. package/dist/chunk-WN3TCGJ4.js +2 -0
  168. package/dist/{chunk-GBZCVYWA.js → chunk-WOOAY3PA.js} +2 -2
  169. package/dist/{chunk-FLSVYEPL.js → chunk-WSLEJSFR.js} +2 -2
  170. package/dist/{chunk-BMKTDJI6.js → chunk-WYZIHUPZ.js} +2 -2
  171. package/dist/{chunk-WZ7V4BQV.js → chunk-XE33FV5W.js} +2 -2
  172. package/dist/{chunk-JO6FK3Q5.js → chunk-XFMVKFSF.js} +2 -2
  173. package/dist/{chunk-3YETOKNO.js → chunk-XGGBK66W.js} +2 -2
  174. package/dist/{chunk-BZCRHP46.js → chunk-XJX6LGHL.js} +2 -2
  175. package/dist/{chunk-OFZVFIDF.js → chunk-XN22RGSR.js} +2 -2
  176. package/dist/{chunk-VJAD5WX5.js → chunk-XSWYJCAK.js} +2 -2
  177. package/dist/{chunk-WV6R37XV.js → chunk-XU75YQN4.js} +2 -2
  178. package/dist/{chunk-UBETC3Q2.js → chunk-Y2VM4CJC.js} +2 -2
  179. package/dist/{chunk-7YZGSLW6.js → chunk-Y334QQU5.js} +2 -2
  180. package/dist/{chunk-TP2X2C2Y.js → chunk-YAGYMBEX.js} +2 -2
  181. package/dist/{chunk-KBIC6JHJ.js → chunk-YIHNPKWD.js} +2 -2
  182. package/dist/{chunk-5Z2H76VD.js → chunk-YXPUP5G2.js} +2 -2
  183. package/dist/{chunk-G6VV7ROY.js → chunk-Z2AWCTN6.js} +2 -2
  184. package/dist/{chunk-O3EX5STE.js → chunk-Z2PZVKPR.js} +2 -2
  185. package/dist/{chunk-OG5UK2K7.js → chunk-ZAZGGSM3.js} +2 -2
  186. package/dist/{chunk-GTZFKDP3.js → chunk-ZGW4HLPD.js} +2 -2
  187. package/dist/chunk-ZOXKSQQB.js +2 -0
  188. package/dist/{chunk-KFFQURUZ.js → chunk-ZPASRBLF.js} +2 -2
  189. package/dist/{chunk-WZRNEVYC.js → chunk-ZYM4HOFA.js} +2 -2
  190. package/dist/{chunk-FUUDUAKM.js → chunk-ZZ3Z7D56.js} +2 -2
  191. package/dist/cli-main.js +2 -2
  192. package/dist/code-EQJFDT6I.js +2 -0
  193. package/dist/code-result-json-7UWIWBOO.js +2 -0
  194. package/dist/{command-descriptors-6INSCKLW.js → command-descriptors-ORNTVNYV.js} +89 -89
  195. package/dist/dataflow-6VL54GX5.js +2 -0
  196. package/dist/dependence-slice-DT2NUHD2.js +2 -0
  197. package/dist/deps-DB7H5IKC.js +2 -0
  198. package/dist/direct-navigation-O3LUAYWQ.js +3 -0
  199. package/dist/entry-map-6K62RV3D.js +2 -0
  200. package/dist/files-MSLD7MO6.js +2 -0
  201. package/dist/hierarchy-IVBXAKFA.js +2 -0
  202. package/dist/imports-FRAVZ3Y2.js +2 -0
  203. package/dist/index.js +1 -1
  204. package/dist/members-KJOJDYGO.js +2 -0
  205. package/dist/methods-2AYABBT3.js +2 -0
  206. package/dist/output-continuation-command-JHMPH6NC.js +3 -0
  207. package/dist/project-reindex-HYO4WD7Z.js +3 -0
  208. package/dist/queries/affected.js +1 -1
  209. package/dist/queries/anchors.js +1 -1
  210. package/dist/queries/architecture.js +1 -1
  211. package/dist/queries/bottlenecks.js +1 -1
  212. package/dist/queries/by-kind.js +1 -1
  213. package/dist/queries/call-graph.js +1 -1
  214. package/dist/queries/change-surface.js +1 -1
  215. package/dist/queries/cleanup-plan.js +1 -1
  216. package/dist/queries/co-change.js +1 -1
  217. package/dist/queries/code.js +1 -1
  218. package/dist/queries/complexity-hotspots.js +1 -1
  219. package/dist/queries/complexity.d.ts +11 -0
  220. package/dist/queries/complexity.js +1 -1
  221. package/dist/queries/context.js +1 -1
  222. package/dist/queries/convergence.js +1 -1
  223. package/dist/queries/coupling.js +1 -1
  224. package/dist/queries/cycles.js +1 -1
  225. package/dist/queries/dataflow.js +1 -1
  226. package/dist/queries/dead.js +1 -1
  227. package/dist/queries/decorative-checkers.js +1 -1
  228. package/dist/queries/deep-chains.js +1 -1
  229. package/dist/queries/dependence-slice.js +1 -1
  230. package/dist/queries/dependency-depth.js +1 -1
  231. package/dist/queries/deps.js +1 -1
  232. package/dist/queries/diff-impact.js +1 -1
  233. package/dist/queries/doc-drift.js +1 -1
  234. package/dist/queries/drift.js +1 -1
  235. package/dist/queries/duplicate-bodies.js +1 -1
  236. package/dist/queries/entry-map.js +1 -1
  237. package/dist/queries/evidence.js +1 -1
  238. package/dist/queries/extract-candidates.js +1 -1
  239. package/dist/queries/fan.js +1 -1
  240. package/dist/queries/files.js +1 -1
  241. package/dist/queries/health.js +1 -1
  242. package/dist/queries/hierarchy.js +1 -1
  243. package/dist/queries/hotspots.js +1 -1
  244. package/dist/queries/imports.js +1 -1
  245. package/dist/queries/incomplete-migration.js +1 -1
  246. package/dist/queries/index.js +1 -1
  247. package/dist/queries/isolated.js +1 -1
  248. package/dist/queries/locality-candidates.js +1 -1
  249. package/dist/queries/members.js +1 -1
  250. package/dist/queries/methods.js +1 -1
  251. package/dist/queries/not-implemented.js +1 -1
  252. package/dist/queries/outline.js +1 -1
  253. package/dist/queries/passthrough-candidates.js +1 -1
  254. package/dist/queries/plan-context.js +1 -1
  255. package/dist/queries/react-component-duplicates.js +1 -1
  256. package/dist/queries/react-hook-candidates.js +1 -1
  257. package/dist/queries/react-large-component-pressure.js +1 -1
  258. package/dist/queries/recent-duplicates.js +1 -1
  259. package/dist/queries/redundant-reexports.js +1 -1
  260. package/dist/queries/reference-neighborhood.js +1 -1
  261. package/dist/queries/reference-reachability.js +1 -1
  262. package/dist/queries/refs.js +1 -1
  263. package/dist/queries/self-audit.js +1 -1
  264. package/dist/queries/similar-chains.js +1 -1
  265. package/dist/queries/similar-files.js +1 -1
  266. package/dist/queries/similar-signatures.js +1 -1
  267. package/dist/queries/similar.js +1 -1
  268. package/dist/queries/slice.js +1 -1
  269. package/dist/queries/source-inspection.js +1 -1
  270. package/dist/queries/source-search.js +1 -1
  271. package/dist/queries/stale-abstractions.js +1 -1
  272. package/dist/queries/surface.js +1 -1
  273. package/dist/queries/symbols.js +1 -1
  274. package/dist/queries/system-map.js +1 -1
  275. package/dist/queries/system.js +1 -1
  276. package/dist/queries/test-quality.js +1 -1
  277. package/dist/queries/trace.js +1 -1
  278. package/dist/queries/twin-ab.js +1 -1
  279. package/dist/queries/twin-drift.js +1 -1
  280. package/dist/queries/unused-imports.js +1 -1
  281. package/dist/queries/unused-params.js +1 -1
  282. package/dist/queries/value-flow.js +1 -1
  283. package/dist/queries/vue-component-duplicates.js +1 -1
  284. package/dist/queries/vue-composable-candidates.js +1 -1
  285. package/dist/queries/vue-large-view-pressure.js +1 -1
  286. package/dist/queries/wrapper-candidates.js +1 -1
  287. package/dist/query-service-fastpath.js +5 -5
  288. package/dist/query-service-server.js +2 -2
  289. package/dist/refs-ARMA6XUJ.js +2 -0
  290. package/dist/{refs-pagination-SRCUOYRD.js → refs-pagination-VUGIWN6U.js} +2 -2
  291. package/dist/reindex-worker.js +64 -22
  292. package/dist/reindex.js +74 -32
  293. package/dist/runtime.js +1 -1
  294. package/dist/rust-semantic-session-server.js +1 -1
  295. package/dist/rust-semantic-session-worker.js +1 -1
  296. package/dist/rust-semantic-worker.js +1 -1
  297. package/dist/slice-YOB5YFAM.js +2 -0
  298. package/dist/surface-VY5EFWTW.js +2 -0
  299. package/dist/{symbol-resolution-SVSMX4RN.js → symbol-resolution-DGQN4XIV.js} +2 -2
  300. package/dist/system-2KQ3QD2P.js +2 -0
  301. package/dist/trace-HTIPTXAE.js +2 -0
  302. package/dist/typescript-mailbox-worker.js +1 -1
  303. package/dist/value-flow-5FV3VQI7.js +2 -0
  304. package/dist/watch-server.js +3 -3
  305. package/package.json +1 -1
  306. package/dist/by-kind-XXGZGNZ6.js +0 -2
  307. package/dist/call-graph-VGY3R4L3.js +0 -2
  308. package/dist/chunk-3XZELASU.js +0 -2
  309. package/dist/chunk-63TFRBMB.js +0 -2
  310. package/dist/chunk-6LS3IG2I.js +0 -13
  311. package/dist/chunk-7Z4GMCHM.js +0 -117
  312. package/dist/chunk-ANCHW2R4.js +0 -57
  313. package/dist/chunk-C7WSQA6A.js +0 -21
  314. package/dist/chunk-DNPETNXT.js +0 -2
  315. package/dist/chunk-E7CJ6O72.js +0 -2
  316. package/dist/chunk-FYCH2EYQ.js +0 -2
  317. package/dist/chunk-GSHTVE56.js +0 -3
  318. package/dist/chunk-JSHDCVUM.js +0 -81
  319. package/dist/chunk-L7WRUNKJ.js +0 -2
  320. package/dist/chunk-LFWB7TOJ.js +0 -2
  321. package/dist/chunk-MFBVUQJZ.js +0 -2
  322. package/dist/chunk-MR4ZKWO6.js +0 -57
  323. package/dist/chunk-NP4JFCLE.js +0 -133
  324. package/dist/chunk-NQXWWE6S.js +0 -8
  325. package/dist/chunk-O2VY47Y5.js +0 -325
  326. package/dist/chunk-SIGVQT43.js +0 -2
  327. package/dist/chunk-UAQQR55F.js +0 -2
  328. package/dist/chunk-VRJG7N3I.js +0 -453
  329. package/dist/chunk-WCIKJ2E3.js +0 -3
  330. package/dist/chunk-WEXQYJY3.js +0 -5
  331. package/dist/chunk-WOPZX5GM.js +0 -2
  332. package/dist/chunk-XDQX6LDT.js +0 -4
  333. package/dist/chunk-XIPGCT3D.js +0 -5
  334. package/dist/chunk-Z2KGMIL4.js +0 -2
  335. package/dist/code-AXLJBZ6T.js +0 -2
  336. package/dist/code-result-json-CTZHAQXJ.js +0 -2
  337. package/dist/dataflow-AFXY423Q.js +0 -2
  338. package/dist/dependence-slice-2G4X6VSJ.js +0 -2
  339. package/dist/deps-LMCAV5DO.js +0 -2
  340. package/dist/direct-navigation-2ONV22Y2.js +0 -3
  341. package/dist/entry-map-ZOC3VXO5.js +0 -2
  342. package/dist/files-WJQJLHMH.js +0 -2
  343. package/dist/hierarchy-ASNIHAX4.js +0 -2
  344. package/dist/imports-JICEKDKK.js +0 -2
  345. package/dist/members-C5H2K3MS.js +0 -2
  346. package/dist/methods-KZOZHSD4.js +0 -2
  347. package/dist/output-continuation-command-NX3RH3TP.js +0 -3
  348. package/dist/project-reindex-A2SXUH2H.js +0 -3
  349. package/dist/refs-ZOORVRQC.js +0 -2
  350. package/dist/slice-NOTBWA7S.js +0 -2
  351. package/dist/surface-BTBCLKNA.js +0 -2
  352. package/dist/system-2EIUFP6B.js +0 -2
  353. package/dist/trace-BB2GHQPG.js +0 -2
  354. package/dist/value-flow-OA7AHSUG.js +0 -2
@@ -1,57 +0,0 @@
1
- import{a as Z}from"./chunk-XFRHBAIT.js";import{b as mt}from"./chunk-EPLE5O5O.js";import{q as yt}from"./chunk-5J3A6RBZ.js";import{a as ft}from"./chunk-WRQXLNYE.js";import{c as ye}from"./chunk-4IASLUOP.js";import{A as ct,B as dt,F as pt,G as j,P as T,W as he,a as nt,c as rt,g as pe,h as it,l as me,n as fe,o as at,p as k,q as D,s as M,t as ot,u as X,v as O,w as st,x as lt,z as ut}from"./chunk-NP4JFCLE.js";import{c as tt}from"./chunk-PRLU3I7G.js";import{c as Q}from"./chunk-FYCH2EYQ.js";function ge(e){let t=e.replaceAll("\\","/");return mt(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import{createHash as de}from"crypto";import{createRequire as Mr}from"module";import{createHash as In}from"crypto";var ve=8;function ee(e,t,n){return De(ht(e,t,Oe(n),0,new Set))}function Ae(e,t,n){return Le(e,t,n,0,new Set)}function ht(e,t,n,r,i){if(r>ve)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?gt(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?vt(e,t,n,r,i):[]}function gt(e,t,n,r,i,a){let s=[];for(let o of Le(e,t,n,i+1,new Set(a))){let l=M(o.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let c=u.childForFieldName("key")??u.namedChild(0);if(fn(c)!==r)continue;let d=u.childForFieldName("value")??u.namedChild(1);d&&s.push(...ht(e,o.definition.relativePath,Oe(d.text),i+1,new Set(a)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let d=pn(e,o.definition.relativePath,r,u);s.push(...d.length>0?d:[cn(o.definition,r,u)]);continue}if(u.type==="spread_element"){let c=u.namedChild(0);if(!c)continue;for(let d of Le(e,o.definition.relativePath,Oe(c.text),i+1,new Set(a)))s.push(...gt(e,d.definition.relativePath,d.definition.leaf,r,i+1,new Set(a)))}}}return De(s)}function cn(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function Le(e,t,n,r,i){return r>ve||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:vt(e,t,n,r,i).flatMap(a=>{let s=O(e,a.relativePath)?.rootNode,o=s?mn(s,a.leaf):null;return o?[{definition:a,initializer:o}]:[]})}function vt(e,t,n,r,i){if(r>ve)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let s=T(e,t).filter(u=>u.leaf===n);if(s.length>0)return s;let o=dn(e,t,n);if(o.length>0)return o;let l=j(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return ke(e,l.sourcePath,u,r+1,new Set(i))}return ke(e,t,n,r+1,new Set(i))}function dn(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(ut(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function ke(e,t,n,r,i){if(r>ve)return[];let a=T(e,t).filter(s=>s.leaf===n);return a.length>0?a:De(pt(e,t).flatMap(s=>s.sourcePath?s.kind==="named"&&!s.names.includes(n)?[]:ke(e,s.sourcePath,n,r+1,new Set(i)):[]))}function pn(e,t,n,r){return T(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function mn(e,t){let n=null;return k(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function fn(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Oe(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function De(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}var yn=8;function V(e,t){return t?te(e,t,0,new Set):null}function te(e,t,n,r){if(n>yn)return U(t,"value-evaluation-depth");let i=M(t),a=xn(i);if(a)return Rn(e.file,i,a.term,a.value,a.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>te(e,u,n+1,new Set(r)));if(l.length>=2&&l.every(u=>u!==null)){let u={kind:"concat",parts:l.map(d=>d.term)},c=l.map(d=>d.value).join("");return Cn(e.file,i,u,c,l.some(d=>d.precision!=="literal")?"constrained-pattern":"literal",l)}}let s=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))return bn(e,s,i,n,r);let o=Nn(i);return o?Sn(e,o.base,o.properties,i,n,r):i.type==="call_expression"||i.type==="call"?hn(e,i,n,r):U(i,`unsupported-expression:${i.type}`)}function hn(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",s=gn(e,a);if(s.length!==1)return U(t,s.length===0?"call-target-unresolved":"call-target-ambiguous");let o=s[0],l=`${o.relativePath}\0${o.symbol}`;if(r.has(l))return U(t,"call-return-cycle");let u=O(e.db,o.relativePath)?.rootNode;if(!u)return U(t,"call-target-unparsed");let c=D(u,o.startLine,o.endLine);if(!c)return U(t,"call-target-syntax-unavailable");let d=vn(c);if(!d)return U(t,"call-return-not-single-expression");let p=new Set(r);p.add(l);let m=te({db:e.db,file:o.relativePath,root:u},d,n+1,p);return m?be(t,"bounded-call-return",m,o.symbol):U(t,"call-return-unresolved")}function gn(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=T(e.db,e.file).filter(s=>s.isFunctionLike&&s.leaf===t);if(i.length>0)return i;let a=j(e.db,e.file).find(s=>s.localName===t&&s.sourcePath&&s.kind!=="namespace");return a?.sourcePath?Z(e.db,a.sourcePath,a.importedName==="default"?t:a.importedName).filter(s=>s.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=j(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?Z(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function vn(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return bt(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function bt(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)bt(e,r,n)}}function bn(e,t,n,r,i){let a=`${e.file}\0${t}`;if(i.has(a))return U(n,"value-cycle");i.add(a);let s=Me(e.root,t);if(s){let y=te(e,s,r+1,i);return y?be(n,"local-constant",y):U(n,"non-foldable-local")}let o=j(e.db,e.file).find(y=>y.localName===t&&y.sourcePath);if(!o?.sourcePath)return H(n,t,"unresolved-identifier");if(o.kind==="namespace")return H(n,t,"namespace-import-requires-property");let l=o.importedName==="default"?t:o.importedName,u=Z(e.db,o.sourcePath,l);if(u.length!==1)return H(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let c=u[0],d=O(e.db,c.relativePath)?.rootNode;if(!d)return H(n,c.symbol,"import-definition-unparsed");let p=Me(d,c.leaf);if(!p)return H(n,c.symbol,"import-definition-non-value");let m=te({db:e.db,file:c.relativePath,root:d},p,r+1,i);return m?be(n,"imported-constant",m,c.symbol):H(n,c.symbol,"import-value-unresolved")}function Sn(e,t,n,r,i,a){let s=j(e.db,e.file).find(m=>m.localName===t&&m.sourcePath),o=e.file,l=t,u;if(s?.sourcePath){s.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=s.importedName==="default"?t:s.importedName;let m=Z(e.db,s.sourcePath,l);if(m.length!==1)return H(r,`${t}.${n.join(".")}`,m.length===0?"member-definition-missing":"member-definition-ambiguous");o=m[0].relativePath,l=m[0].leaf,u=m[0].symbol}let c=o===e.file?e.root:O(e.db,o)?.rootNode;if(!c)return H(r,u??t,"member-definition-unparsed");let d=Me(c,l);if(!d)return H(r,u??t,"member-base-non-value");for(let m of n){let y=M(d);if(d=Bn(y,m),!d)return H(r,u??`${t}.${n.join(".")}`,`member-property-missing:${m}`)}let p=te({db:e.db,file:o,root:c},d,i+1,a);return p?be(r,"member-constant",p,u):H(r,u??t,"member-value-unresolved")}function xn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],a=0,s=/\$\{([^}]*)\}/gu;for(let o of r.matchAll(s)){let l=o.index??0;l>a&&i.push({kind:"literal",value:r.slice(a,l)}),i.push({kind:"unknown",reason:`template-hole:${o[1]?.trim()||"expression"}`}),a=l+o[0].length}return a<r.length&&i.push({kind:"literal",value:r.slice(a)}),{term:{kind:"pattern",language:"template",value:r.replace(s,"{}")},value:r.replace(s,"{}"),precision:"constrained-pattern"}}function Rn(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:Se("direct-literal","direct",e,t)}}function Cn(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...Se("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(s=>s.derivation.inputFactIds),sourceSpans:a.flatMap(s=>s.derivation.sourceSpans)}}}function be(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function H(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:Se(n,"heuristic","",e)}}function U(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:Se(t,"heuristic","",e)}}function Se(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function Nn(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}function Me(e,t){let n=null;return k(e,r=>{if(n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t)return;let a=r.parent;!a||a.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(a.text)||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Bn(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}var Pn=new WeakMap,Pt=new Set(["delete","get","head","options","patch","post","put"]),wn=/(?:^|\.)(?:app|router|server)$/u,En=new Set(["findFirst","findMany","findUnique","from","get","select"]),Fn=new Set(["create","delete","insert","remove","update","upsert"]),Tn=new Set(["execute","query","raw"]),St=/(?:\b(?:name|id)|['"`](?:name|id)['"`])\s*:/u,xt=/(?:^\s*|[,{]\s*)(?:async\s+)?['"`]?(?:execute|handler|invoke|run)['"`]?\s*(?::|\([^)]*\)\s*\{)/mu,Rt=/\b[A-Za-z_$][\w$-]*[_-][\w$-]*\s*\(/u,Ct=/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s+[A-Za-z_$][\w$-]*\s*\(/iu,Ue=[kn(),Ln(),$n(),On(),Dn(),Mn(),Vn()],Ve=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function $n(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=_n(e.source),n=[];return q(e.root,"call_expression",r=>{let i=oe(r);if(!i)return;let a=t.direct.get(i),s=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),o=s&&t.namespaces.has(s[1])?s[2]:null,l=a??o;if(!l||!Ve.has(l))return;let u=W(r),c=A(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},d=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(E(e,r,"builtin.node-child-process",d,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...c}],"exact","node-child-process-import"))}),n}}}function _n(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let l of e.matchAll(i))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Ve.has(c[1])&&t.set(c[2]??c[1],c[1])}let a=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(a))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Ve.has(c[1])&&t.set(c[2]??c[1],c[1])}let s=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(s))n.add(l[1]);let o=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(o))n.add(l[1]);return{direct:t,namespaces:n}}function L(e,t,n,r){let i=re(r,"runtime-boundaries.context.ast",t,()=>n===void 0?O(e,t):st(e,t,n)?.tree);if(!i)return null;let a=i.rootNode;n!==void 0&&Pn.set(a,i);let s=n??pe(e,t),o,l,u,c=()=>(l!==void 0||(l=re(r,"runtime-boundaries.context.callable-sites",t,()=>{let d=fe(t);return(d?dt(a,d):null)??ct(e,t)})),l);return{db:e,file:t,source:s,root:a,get constants(){return u??=re(r,"runtime-boundaries.context.constants",t,()=>Kn(a)),u},ownerAt:d=>{let m=(o??=re(r,"runtime-boundaries.context.definitions",t,()=>T(e,t,{rangeCorrectionEvidence:{source:s,callables:c()}},(f,h)=>re(r,`runtime-boundaries.context.definitions.${f}`,t,h)))).filter(f=>f.startLine<=d&&f.endLine>=d).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];if(m)return{file:t,symbol:m.symbol,name:m.leaf,startLine:m.startLine,endLine:m.endLine};let v=(c()??[]).filter(f=>f.startLine<=d&&f.endLine>=d).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];return{file:t,symbol:null,name:v?.name??null,startLine:v?.startLine??d,endLine:v?.endLine??d}}}}function re(e,t,n,r){return e?e(t,r,{file:n}):r()}function Ln(){return{id:"builtin.effect-httpapi",supports:e=>ie(e,"HttpApiEndpoint").size>0||ie(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=ie(e.source,"HttpApiEndpoint"),r=ie(e.source,"HttpApiGroup"),i=ie(e.source,"HttpApiBuilder");return q(e.root,"call_expression",a=>{let s=wt(a);if(!s)return;let o=W(a);if(n.has(s.receiver)&&Pt.has(s.member)){let v=A(o[0],e),f=A(o[1],e),h=Bt(a,r,"make",0,e);if(!v||!f||!h)return;let g=s.member.toUpperCase();t.push(E(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:g,evidence:"literal"},{name:"path",...f}],G([{name:"path",...f}]),"effect-httpapi-endpoint-declaration")),t.push(E(e,a,"builtin.effect-httpapi","framework.declare",He(h,v),G(He(h,v)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(s.member))return;let l=Bt(a,i,"group",1,e),u=A(o[0],e),c=o[1];if(!l||!u||!c)return;let d=He(l,u),p=ee(e.db,e.file,c.text),m=E(e,a,"builtin.effect-httpapi","framework.handle",d,p.length===1?G(d):"candidate","effect-httpapi-handler-registration"),y=p[0];p.length===1&&y&&(m.owner={file:y.relativePath,symbol:y.symbol,name:y.leaf,startLine:y.startLine,endLine:y.endLine}),t.push(m)}),t}}}function He(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function ie(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(r)){let s=a[2]??"";if(Nt(s))for(let o of(a[1]??"").split(",")){let l=o.trim().replace(/^type\s+/u,""),u=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(l);u?.[1]===t&&n.add(u[2]??u[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(i)){let s=a[2]??"";s.endsWith(`/${t}`)&&Nt(s)&&n.add(a[1])}return n}function Nt(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function Bt(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let s=It(a,t,n,r,i);if(s)return s;let o=a.childForFieldName("function")??a.namedChild(0),l=null;if(o&&je(o,u=>{!l&&u.type==="call_expression"&&(l=It(u,t,n,r,i))}),l)return l}a=a.parent}return null}function It(e,t,n,r,i){let a=wt(e);return!a||a.member!==n||!t.has(a.receiver)?null:A(W(e)[r],i)}function wt(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function kn(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||ae(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return q(e.root,["decorator","call_expression"],n=>{if(n.type==="decorator"){let p=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!p||!ae(e.source,["fastapi","flask"]))return;t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:p[1].toUpperCase(),evidence:"literal"},{name:"path",value:p[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=oe(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",a=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",s=W(n);if(i==="route"&&ae(e.source,["axum"])){let p=A(s[0],e),m=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(s[1]?.text??"")?.[1];if(!p||!m)return;t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:m.toUpperCase(),evidence:"literal"},{name:"path",...p}],G([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=A(s[0],e);if(!p)return;let y=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(s[1]?.text??"")?.[1]?.toUpperCase()??(s[1]?null:"GET"),v=[...y?[{name:"method",value:y,evidence:"literal"}]:[],{name:"path",...p}];t.push(E(e,n,"builtin.http","http.request",v,y?G(v):"candidate","call-expression"));return}if(!Pt.has(i))return;let o=A(s[0],e);if(!o)return;let l=i.toUpperCase();if(wn.test(a)&&ae(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],G([{name:"path",...o}]),"framework-adapter"));return}let c=jn(e.source,["axios"]),d=a.split(".")[0]??"";c.has(d)&&t.push(E(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],G([{name:"path",...o}]),"client-adapter"))}),t}}}function On(){return{id:"builtin.capability-registry",supports:e=>St.test(e)&&xt.test(e)||Rt.test(e)||Ct.test(e),extract:e=>{let t=[],n=new Set,r=[];return St.test(e.source)&&xt.test(e.source)&&r.push("pair"),(Rt.test(e.source)||Ct.test(e.source))&&r.push("string","string_literal","template_string"),q(e.root,r,i=>{if(i.type==="pair"){let s=i.childForFieldName("key")??i.namedChild(0),o=i.childForFieldName("value")??i.namedChild(1),l=s?.text.replace(/^['"`]|['"`]$/gu,"");if(l!=="name"&&l!=="id")return;let u=Et(o,e),c=Zn(i);if(!u||u.evidence!=="literal"||!c)return;let d=`handle\0${u.value}\0${c.startPosition.row}`;if(n.has(d))return;n.add(d),t.push(E(e,c,"builtin.capability-registry","registry.handle",[{name:"key",...u}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(i.type))return;let a=i.text.replace(/^['"`]|['"`]$/gu,"");for(let s of a.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let o=s[1];if(!An(a,o,s.index))continue;let l=`reference\0${o}\0${i.startPosition.row}`;n.has(l)||(n.add(l),t.push(E(e,i,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function An(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function Dn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return q(e.root,["pair","call_expression"],n=>{if(n.type==="pair"){let a=Xn(n);if(!a)return;let s=n.childForFieldName("key")??n.namedChild(0),o=n.childForFieldName("value")??n.namedChild(1),l=Et(s,e);if(!l||!o||!Ft(o))return;let u=Ge(o)?"exact":"candidate";t.push(E(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],G([{name:"key",...l}],u),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(E(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function Mn(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=Yn(e.root);return q(e.root,"call_expression",r=>{let i=oe(r);if(!i)return;let a=i.split("."),s=a.at(-1)??"",o=W(r),l=o[0]?.text??"",u=Wn(s,l);if(!u)return;let c=Tt(a,n);if(!c)return;let d=Hn(o[0],e)??Jn(l),p=Qn(c,a,s,d);if(!p)return;let m=s==="insert"?"persistence-insert":u==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(l)?"persistence-skip-locked-claim":"persistence-adapter";t.push(E(e,r,"builtin.persistence",u,[{name:"resource",...p}],G([{name:"resource",...p}]),m))}),t}}}function Hn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:A(e,t)}function Vn(){return{id:"builtin.queue",supports:e=>ae(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return q(e.root,"call_expression",n=>{let r=oe(n);if(!r)return;let i=r.split(".").at(-1)??"",a=W(n),s=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!s)return;let o=i==="send"||i==="subscribe"?zn(a[0],"topic",e):A(a[0],e);o&&t.push(E(e,n,"builtin.queue",s,[{name:"address",...o}],G([{name:"address",...o}]),"framework-adapter"))}),t}}}function E(e,t,n,r,i,a,s){let o=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${In("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:o,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:s,strength:a,protocol:r.split(".")[0]??r,role:Un(r),executionDomain:Gn(e.file),derivation:{kind:a==="candidate"?"heuristic":a==="derived"?"mechanically-derived":"direct",rule:s,ruleVersion:"1",inputFactIds:i.flatMap(u=>u.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(u=>u.derivation?.sourceSpans??[])]},valuePrecision:i.some(u=>u.evidence==="expression")?"unknown":i.some(u=>u.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:ge(e.file)}}function Un(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function Gn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function ae(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function jn(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),a=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let s of e.matchAll(a)){let o=s[1]??s[2];o&&n.add(o)}}return n}function xe(e,t,n,r,i,a,s){return E(e,t,n,r,i,a,s)}function oe(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function W(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function A(e,t){let n=V(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function zn(e,t,n){if(!e)return null;let r=e.namedChildren.find(a=>a.type!=="pair"?!1:(a.childForFieldName("key")??a.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return A(i,n)}function Et(e,t){if(!e)return null;let n=A(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function G(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function qn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function Kn(e){let t=new Map;return je(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let a=qn(i);a!==null&&t.set(r.text,a)}),t}function Xn(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function Ge(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function Ft(e){return Ge(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function Zn(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),s=i?.text.replace(/^['"`]|['"`]$/gu,"");if(s&&["execute","handler","invoke","run"].includes(s)&&a&&Ft(a))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function Tt(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function Wn(e,t){if(En.has(e))return"database.read";if(Fn.has(e))return"database.write";if(!Tn.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function Yn(e){let t=new Set;return q(e,"call_expression",n=>{let r=oe(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!Tt(i)))for(let a of W(n)){if(!Ge(a))continue;let o=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=o?ot(o):null;l&&t.add(l)}}),t}function Jn(e){let t=$t(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function Qn(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let a=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return a?{value:a,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=$t(r.value);return i?{value:i,evidence:r.evidence}:null}function $t(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function je(e,t){t(e);for(let n of e.namedChildren)je(n,t)}function q(e,t,n){for(let r of e.descendantsOfType(t))n(r)}var er=Q("resolved-call-syntax",{clearGroups:[]}),ze=Q("resolved-call-sites",{clearGroups:[]}),tr=Q("resolved-call-sites-reference-evidence",{clearGroups:[]});function qe(e,t){return ze.get(e,t.symbolId,()=>Lt(e,t,nr(e,t)))}function _t(e,t){let n=[...new Map(t.map(a=>[a.symbolId,a])).values()],r=n.filter(a=>!ze.has(e,a.symbolId)),i=kt(e,r);return new Map(n.map(a=>[a.symbolId,ze.get(e,a.symbolId,()=>Lt(e,a,i.get(a.symbolId)??[]))]))}function Lt(e,t,n){let r=[],i=[],a=new Set,s=new Set;for(let o of n){a.add(o.file);let l=er.get(e,o.file,()=>ir(e,o.file));if(!l){i.push({callee:t,file:o.file,line:o.startLine,reason:"ast-unavailable",candidates:0,referenceProvenance:o.provenance});continue}let u=(l.byLeaf.get(t.leaf)??[]).filter(({callNode:p})=>p.startPosition.row<=o.endLine&&p.endPosition.row>=o.startLine);if(u.length!==1){i.push({callee:t,file:o.file,line:o.startLine,reason:u.length===0?"call-not-found":"ambiguous-call",candidates:u.length,referenceProvenance:o.provenance});continue}let c=u[0],d=`${o.file}\0${c.callNode.startIndex}\0${c.callNode.endIndex}`;s.has(d)||(s.add(d),r.push({callee:t,caller:he(T(e,o.file),c.callNode.startPosition.row),file:o.file,line:c.callNode.startPosition.row,startLine:c.callNode.startPosition.row,endLine:c.callNode.endPosition.row,targetText:c.targetNode.text,callNode:c.callNode,targetNode:c.targetNode,arguments:c.arguments,referenceProvenance:o.provenance}))}return{sites:r,unresolved:i,filesVisited:a.size}}function nr(e,t){return kt(e,[t]).get(t.symbolId)??[]}function kt(e,t){if(!rr(e))return new Map(t.map(r=>[r.symbolId,yt(e,r,{semantic:!1}).map(i=>({file:i.file,startLine:i.line,endLine:i.line,provenance:i.provenance}))]));let n=new Map;for(let r of ft(e,t.map(i=>i.symbolId))){let i=n.get(r.symbol_id)??[];i.push({file:r.relative_path,startLine:r.chunk_start,endLine:r.chunk_end,provenance:"scip-reference-chunk"}),n.set(r.symbol_id,i)}return new Map(t.map(r=>[r.symbolId,n.get(r.symbolId)??[]]))}function rr(e){return tr.get(e,"project",()=>!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))}function ir(e,t){let n=O(e,t)?.rootNode;if(!n)return null;let r=new Map;return Ot(n,i=>{if(i.type!=="call_expression"&&i.type!=="call")return;let a=i.childForFieldName("function")??i.namedChild(0);if(!a)return;let s=lt(a);if(!s)return;let o=i.childForFieldName("arguments")??i.namedChildren.find(c=>c.type==="arguments"),l={callNode:i,targetNode:a,arguments:o?.namedChildren??[]},u=r.get(s);u?u.push(l):r.set(s,[l])}),{byLeaf:r}}function Ot(e,t){t(e);for(let n of e.namedChildren)Ot(n,t)}var ar=Q("call-parameter-value-flow",{clearGroups:[]});function se(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return ar.get(e,n,()=>or(e,t))}function le(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function or(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-unavailable",proof:n}))};let r=O(e,t.caller.relativePath)?.rootNode,i=r?D(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let a=X(i),s=[],o=[];return t.arguments.forEach((l,u)=>{let c=l.text.trim(),d=a.indexOf(c);d>=0?s.push({calleePosition:u,callerPosition:d,argumentText:c,proof:n}):o.push({calleePosition:u,argumentText:c,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:s,unknown:o}}var sr=8,lr=8;function Dt(e,t,n=[]){let r=[],i=ur(e,n,r),a=i.summaries,s=cr(e,t,a,r),o=dr(e,t,r);return{observations:xr([...s.observations,...o]),bodySummaries:a.size,discriminatorSummaries:s.summaries,filesInspected:i.filesInspected,errors:r}}function ur(e,t,n){let r=new Map,i=[],a=new Map,s=o=>{if(a.has(o))return a.get(o)??null;let l=L(e,o);return a.set(o,l),l};for(let o of t){let l={...o,depth:0,proofSpans:[{file:o.definition.relativePath,startLine:o.definition.startLine,endLine:o.definition.endLine}]};r.set(o.definition.symbol,l),i.push(l)}for(;i.length>0;){let o=i.shift();if(!(o.depth>=sr))try{for(let l of qe(e,o.definition).sites){if(!s(l.file))continue;let c=l.caller;if(!c)continue;let d=le(se(e,l),o.parameterIndexes);if(d.length===0)continue;let p={definition:c,parameterIndexes:jt(d),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]};yr(r,p)&&i.push(r.get(c.symbol))}}catch(l){n.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${Ze(l)}`)}}return{summaries:r,filesInspected:new Set(t.map(o=>o.definition.relativePath)).size}}function cr(e,t,n,r){let i=new Map,a=[],s=[];for(let o of t){if(o.action!=="http.request"||o.strength==="candidate"||o.sourceScope!=="production")continue;let l=Ht(o);if(!l)continue;let u=L(e,o.source.file);if(!u)continue;let c=Vt(u.root,o.source.startLine),d=c.find(g=>g.startPosition.row===o.source.startLine)??c[0];if(!d)continue;let p=Xe(d);if(!p)continue;let m=ee(e,o.source.file,p.text);if(m.length!==1)continue;let y=n.get(m[0].symbol);if(!y)continue;let v=o.owner.symbol?T(e,o.owner.file).find(g=>g.symbol===o.owner.symbol):null;if(!v)continue;let f=hr(u,v),h=Re(d);for(let g of y.parameterIndexes){let R=vr(u,h[g]);if(R)for(let x of br(R)){let b=Ut(x),C=Gt(x);if(!b||!C)continue;let P=f.indexOf(C.text.trim());if(P>=0){let F={definition:v,carrier:l,field:b,parameterIndex:P,depth:0,proofObservationIds:[o.id],proofSpans:[o.source,{file:o.source.file,startLine:x.startPosition.row,endLine:x.endPosition.row}]},$=At(F);i.has($)||(i.set($,F),a.push(F));continue}let w=V(u,C);!w||w.evidence==="expression"||s.push(Ke(u,x,"carrier.publish",l,b,w.value,[o.id]))}}}for(;a.length>0;){let o=a.shift();if(!(o.depth>=lr))try{for(let l of qe(e,o.definition).sites){let u=L(e,l.file);if(!u)continue;let c=l.callNode,d=Re(c)[o.parameterIndex];if(!d)continue;let p=V(u,d);p&&p.evidence!=="expression"&&s.push(Ke(u,c,"carrier.publish",o.carrier,o.field,p.value,o.proofObservationIds));let m=l.caller;if(!m)continue;let y=se(e,l).transfers.find(h=>h.calleePosition===o.parameterIndex)?.callerPosition;if(y===void 0)continue;let v={...o,definition:m,parameterIndex:y,depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},f=At(v);i.has(f)||(i.set(f,v),a.push(v))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${o.definition.relativePath}: ${Ze(l)}`)}}return{observations:s,summaries:i.size}}function dr(e,t,n){let r=[],i=t.filter(a=>a.action==="registry.handle"&&a.strength!=="candidate"&&a.sourceScope==="production");for(let a of t){if(a.action!=="http.handle"||a.strength==="candidate"||a.sourceScope!=="production")continue;let s=Ht(a);if(!s)continue;let o=L(e,a.source.file);if(!o)continue;let l=Vt(o.root,a.source.startLine)[0];if(l)for(let u of Re(l).slice(1)){let c=ee(e,a.source.file,u.text);for(let d of c)try{let p=L(e,d.relativePath);if(!p)continue;let m=D(p.root,d.startLine,d.endLine);if(!m)continue;k(m,y=>{if(y.type!=="call_expression")return;let v=Xe(y);if(!v)return;let f=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(v.text.trim());if(!f)return;let h=f[1],g=f[2],R=mr(e,p,d,g);if(!R)return;let x=fr(e,d.relativePath,h);for(let b of i){let C=b.keyParts.find($=>$.name==="registry")?.value,P=b.keyParts.find($=>$.name==="key")?.value;if(!C||!P||!x.some($=>$.file===b.source.file&&$.binding===C))continue;let w=L(e,b.source.file),F=w?gr(w.root,b.source.startLine):null;!w||!F||r.push(Ke(w,F,"carrier.consume",s,R,P,[a.id,b.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${d.relativePath}: ${Ze(p)}`)}}}return r}function Mt(e){let t=T(e.db,e.file),n=new Map;return k(e.root,r=>{if(r.type!=="pair"||Ut(r)?.toLowerCase()!=="body")return;let i=Gt(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=he(t,r.startPosition.row),s=pr(r);if(!a||!s)return;let o=X(s),l=new Set;Sr(i,o,l);let u=n.get(a.symbol)??new Set;o.forEach((c,d)=>{c&&l.has(c)&&u.add(d)}),u.size>0&&n.set(a.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[{definition:r,parameterIndexes:[...i].sort((a,s)=>a-s)}]:[]})}function pr(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function mr(e,t,n,r){let i=D(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${me(r)}\\b`,"u");if(a.test(i.text))return r;let s=null;if(k(i,c=>{if(s||c.type!=="variable_declarator")return;let d=c.childForFieldName("name")??c.namedChild(0),p=c.childForFieldName("value")??c.namedChild(1);!d||!p||!new RegExp(`(?:^|[,{}])\\s*${me(r)}\\s*(?:[,}]|$)`,"u").test(d.text)||p.type==="call_expression"&&(s=Xe(p)?.text??null)}),!s)return null;let o=ee(e,n.relativePath,s);if(o.length!==1)return null;let l=L(e,o[0].relativePath),u=l?D(l.root,o[0].startLine,o[0].endLine):null;return u&&a.test(u.text)&&new RegExp(`\\b${me(r)}\\s*[,}]`,"u").test(u.text)?r:null}function fr(e,t,n){let r=[];for(let i of Ae(e,t,n)){let a=M(i.initializer);if(a.type==="call_expression")for(let s of Re(a)){let o=s.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))for(let l of Ae(e,i.definition.relativePath,o))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Ke(e,t,n,r,i,a,s){let l=xe(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:a,evidence:"constant",term:{kind:"literal",value:a}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...s],sourceSpans:[l.source]},l}function Ht(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function yr(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=jt([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function At(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function hr(e,t){let n=D(e.root,t.startLine,t.endLine);return n?X(n):[]}function gr(e,t){let n=null;return k(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function Vt(e,t){let n=[];return k(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function Xe(e){return e.childForFieldName("function")??e.namedChild(0)}function Re(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function vr(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return M(t);let r=null;return k(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),r?M(r):M(t)}function br(e){let t=M(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function Ut(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Gt(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function Sr(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function jt(e){return[...new Set(e)].sort((t,n)=>t-n)}function xr(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Ze(e){return e instanceof Error?e.message:String(e)}import{createHash as Rr}from"crypto";function zt(e,t){let n=new Map;for(let a of t){if(a.action!=="http.handle"||a.sourceScope!=="production")continue;let s=n.get(a.source.file)??[];s.push(a),n.set(a.source.file,s)}let r=[],i=Cr(e);for(let a of i.mounts)for(let s of a.targetFiles)for(let o of n.get(s)??[]){let l=o.keyParts.find(p=>p.name==="path");if(!l||l.evidence==="expression")continue;let u=Br(a.prefix.value,l.value),c=o.keyParts.map(p=>p.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[a.prefix.term??{kind:"literal",value:a.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line},...a.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:p),d=`${o.id}\0${a.file}\0${a.line}\0${u}`;r.push({...o,id:`boundary:${Rr("sha256").update(d).digest("hex").slice(0,16)}`,keyParts:c,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line}]},resolution:"unresolved"}),o.strength="candidate",o.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function Cr(e){let t=[],n=ye(e);for(let r of n){let i=pe(e,r);if(!Ir(i))continue;let a=L(e,r);a&&qt(a.root,s=>{if(s.type!=="call_expression")return;let o=s.childForFieldName("function")??s.namedChild(0);if(!o||!o.text.replace(/\s+/gu,"").endsWith(".use"))return;let l=Pr(s);if(l.length<2)return;let u=V(a,l[0]);if(!u||u.evidence==="expression")return;let c=Nr(e,r,l[1]);c.length!==0&&t.push({file:r,line:s.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:c})})}return{mounts:t,filesInspected:n.length}}function Nr(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let a=j(e,t).find(l=>l.localName===i&&l.sourcePath);if(!a?.sourcePath)return[t];if(a.kind==="namespace")return[a.sourcePath];let s=a.importedName==="default"?i:a.importedName,o=Z(e,a.sourcePath,s);return[...new Set(o.map(l=>l.relativePath))]}function Br(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function Ir(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function Pr(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function qt(e,t){t(e);for(let n of e.namedChildren)qt(n,t)}import{createHash as wr}from"crypto";function Ce(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}var Be=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),Er=8,Kt=nt({kind:"runtime-boundary-http-roles",invalidation:rt("runtime-boundary-http-roles"),serialize:_r,deserialize:Lr});function Wt(e,t,n){let r=n??((f,h)=>h()),i=new Map,a=[],s=[],o=new Set,l=[],u=[],c=new Map,d=new Map,p=new Map,m=f=>{if(c.has(f))return c.get(f)??null;let h=L(e,f);return c.set(f,h),h},y=f=>{let h=d.get(f);if(h)return h;let g=T(e,f);return d.set(f,g),g},v=(f,h)=>{let g=p.get(f.file);if(!g){let b=tt(e,f.file,f.source),C=Kt.read(e,f.file,b)??[];g={contentHash:b,roles:new Map(C.map(P=>[P.symbol,P])),dirty:!1},p.set(f.file,g)}let R=g.roles.get(h.symbol);if(R)return R;let x=$r(f,h);return g.roles.set(h.symbol,{symbol:h.symbol,...x}),g.dirty=!0,x};for(r("runtime-boundaries.http-summary.seed",()=>{for(let f of t){if(f.action!=="http.request"||!f.owner.symbol||f.evidence!=="call-expression"&&f.evidence!=="client-adapter")continue;let h=y(f.owner.file).find(b=>b.symbol===f.owner.symbol);if(!h)continue;let g=m(h.relativePath);if(!g)continue;let R=v(g,h),x={definition:h,...R,constantMethods:f.keyParts.flatMap(b=>b.name==="method"&&b.evidence!=="expression"&&Be.has(b.value.toUpperCase())?[b.value.toUpperCase()]:[]),depth:0,proofObservationIds:[f.id],proofSpans:[f.source]};Zt(i,x)&&a.push(i.get(h.symbol))}});a.length>0;){let f=a.splice(0,a.length),h=r("runtime-boundaries.http-summary.resolve-call-sites",()=>_t(e,f.map(g=>g.definition)),{batchSize:f.length});r("runtime-boundaries.http-summary.process-call-sites",()=>{for(let g of f)if(!(g.depth>=Er))try{let R=h.get(g.definition.symbolId);if(!R)continue;u.push(...R.unresolved.map(x=>Fr(g,x)));for(let x of R.sites){let b=m(x.file);if(!b)continue;o.add(x.file);let C=x.callNode,P=Tr(g,C,b);P&&s.push(P);let w=x.caller;if(!w)continue;let F=v(b,w),$=kr(e,g,x),_={definition:w,pathParameterIndexes:Ne([...F.pathParameterIndexes,...$.pathParameterIndexes]),methodParameterIndexes:Ne([...F.methodParameterIndexes,...$.methodParameterIndexes]),constantMethods:ne([...g.constantMethods,...F.constantMethods]),depth:g.depth+1,proofObservationIds:ne([...g.proofObservationIds,...P?[P.id]:[]]),proofSpans:[...g.proofSpans,{file:x.file,startLine:x.startLine,endLine:x.endLine}]};Zt(i,_)&&a.push(i.get(w.symbol))}}catch(R){l.push(`builtin.http-summary failed for ${g.definition.relativePath}:${g.definition.startLine+1}: ${R instanceof Error?R.message:String(R)}`)}},{batchSize:f.length})}return Kt.writeBatch(e,[...p.entries()].flatMap(([f,h])=>h.dirty?[{relativePath:f,contentHash:h.contentHash,value:[...h.roles.values()].sort((g,R)=>g.symbol.localeCompare(R.symbol))}]:[])),{observations:s,frontiers:Ce(u),summaries:i.size,filesInspected:o.size,errors:l}}function Fr(e,t){let n=ne([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${wr("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:ge(t.file)}}function Tr(e,t,n){let r=Yt(t),i=e.pathParameterIndexes.flatMap(d=>{let p=V(n,r[d]);return p&&p.evidence!=="expression"&&Ar(p.value)?[{index:d,value:p}]:[]}),a=e.methodParameterIndexes.flatMap(d=>{let p=V(n,r[d]),m=p?.value.toUpperCase();return p&&m&&p.evidence!=="expression"&&Be.has(m)?[{index:d,value:{...p,value:m}}]:[]}),s=ne([...e.constantMethods,...a.map(d=>d.value.value)]);if(i.length!==1||s.length!==1)return null;let o=i[0].value,l=a.find(d=>d.value.value===s[0])?.value,u=[{name:"method",value:s[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:s[0]},derivation:l?.derivation},{name:"path",value:o.value,evidence:"constant",term:o.term,derivation:o.derivation}],c=xe(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return c.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,c.source]},c}function $r(e,t){let n=D(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=X(n),i=new Set,a=new Set,s=new Set;return k(n,o=>{if(o.type==="call_expression"&&((o.childForFieldName("function")??o.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let m=Yt(o);ue(m[0],r,i);let y=Or(m[1],"method");if(y){ue(y,r,a);let v=V(e,y),f=v?.value.toUpperCase();f&&v?.evidence!=="expression"&&Be.has(f)&&s.add(f)}else ue(m[1],r,a)}if(o.type!=="pair")return;let l=o.childForFieldName("key")??o.namedChild(0),u=o.childForFieldName("value")??o.namedChild(1),c=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(c==="url"||c==="path"||c==="endpoint")&&ue(u,r,i),(c==="init"||c==="requestinit"||c==="options")&&ue(u,r,a)}),{pathParameterIndexes:r.flatMap((o,l)=>o&&i.has(o)?[l]:[]),methodParameterIndexes:r.flatMap((o,l)=>o&&a.has(o)?[l]:[]),constantMethods:[...s].sort()}}function _r(e){return e.map(t=>[encodeURIComponent(t.symbol),t.pathParameterIndexes.join(","),t.methodParameterIndexes.join(","),t.constantMethods.join(",")].join(" ")).join(`
2
- `)}function Lr(e){if(!e)return[];let t=[];for(let n of e.split(`
3
- `)){let r=n.split(" ");if(r.length!==4)return null;let i=Xt(r[1]),a=Xt(r[2]),s=r[3]?r[3].split(","):[];if(i===null||a===null||s.some(o=>!Be.has(o)))return null;t.push({symbol:decodeURIComponent(r[0]),pathParameterIndexes:i,methodParameterIndexes:a,constantMethods:s})}return t}function Xt(e){if(!e)return[];let t=e.split(",").map(Number);return t.every(n=>Number.isSafeInteger(n)&&n>=0)?t:null}function kr(e,t,n){let r=se(e,n);return{pathParameterIndexes:le(r,t.pathParameterIndexes),methodParameterIndexes:le(r,t.methodParameterIndexes)}}function Zt(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=Ne([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=Ne([...n.methodParameterIndexes,...t.methodParameterIndexes]),a=ne([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||a.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:a,depth:Math.min(n.depth,t.depth),proofObservationIds:ne([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function Or(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function ue(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function Yt(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Ar(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function Ne(e){return[...new Set(e)].sort((t,n)=>t-n)}function ne(e){return[...new Set(e)].sort()}import{createHash as Dr}from"crypto";function en(e){let t=Jt(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=Jt(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?We(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[Qt(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?We(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[Qt(r,a,i,"queue.consume")]:[]}):[])}function Jt(e){let t=new Map;for(let n of e)for(let r of We(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function We(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function Qt(e,t,n,r){let i=`database:${n}`,a=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",s=[e.id,r,i,a].join("\0");return{...e,id:`boundary:${Dr("sha256").update(s).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:a,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var Ye="runtime-boundaries-v19",Hr=Mr(import.meta.url),B=Hr("typescript"),Vr=new Set([B.SyntaxKind.WhitespaceTrivia,B.SyntaxKind.NewLineTrivia,B.SyntaxKind.SingleLineCommentTrivia,B.SyntaxKind.MultiLineCommentTrivia]),Ur=new Set([B.SyntaxKind.NoSubstitutionTemplateLiteral,B.SyntaxKind.TemplateHead,B.SyntaxKind.TemplateMiddle,B.SyntaxKind.TemplateTail]),we=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],Gr=64,an="builtin.http-summary",Ee={HTTP_HANDLE:"http.handle",HTTP_REQUEST:"http.request",REGISTRY_HANDLE:"registry.handle"},Je=new Set(Object.values(Ee));function jr(e,t={}){let n=ye(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(ci)),a=t.previousGraph?.fileCoverage,s=i.size>0&&t.previousGraph?.extractorVersion===Ye&&a!==void 0&&a.length===t.previousGraph.coverage.filesScanned,o=s?a.filter(S=>r.has(S.file)&&!i.has(S.file)):[],l=new Set(o.flatMap(S=>S.observationIds)),u=s?t.previousGraph.observations.filter(S=>l.has(S.id)&&r.has(S.source.file)):[],c=s?n.filter(S=>i.has(S)):n,d=[],p=a?.reduce((S,N)=>S+N.observationIds.length,0)??0,m=performance.now(),y=ii(e,c,t.profileSpan);z(d,"direct-extraction",m,c.length,y.observations.length,{filesVisited:c.length,filesReused:o.length,factsReused:u.length,factsInvalidated:Math.max(0,p-u.length)});let v=[...o,...y.fileCoverage].sort((S,N)=>S.file.localeCompare(N.file)),f=ui(v),h=v.flatMap(S=>S.extractionErrors),g=ce([...u,...y.observations]);if(s&&!t.forceDerivedRebuild&&t.previousGraph&&zr(a,y.fileCoverage,i)&&(!Yr(e,t.previousGraph,i)||ei(a,y.fileCoverage,i)&&!ti(t.previousGraph,i))){for(let N of t.previousGraph.coverage.extractors)f.has(N.id)||f.set(N.id,N);let S=ri(t.previousGraph.coverage.phases);return d.push(...S),{...t.previousGraph,observations:t.previousGraph.observations,relationGroups:t.previousGraph.relationGroups,links:t.previousGraph.links,frontiers:t.previousGraph.frontiers,coverage:{filesScanned:n.length,filesWithAst:v.filter(N=>N.hasAst).length,filesWithoutAst:v.filter(N=>!N.hasAst).length,filesReused:o.length,extractors:[...f.values()],extractionErrors:t.previousGraph.coverage.extractionErrors,phases:d},fileCoverage:v}}let R=ce([...g,...en(g)]),x=s&&t.previousGraph!==void 0?qr(t.previousGraph,a,y.fileCoverage,i,g):{reuse:!1,shapeUnchanged:!1,proofFilesUnchanged:!1,seedUnchanged:!1},b=x.reuse;t.profileSpan?.("runtime-boundaries.http-summary.reuse-decision",()=>{},x),m=performance.now();let C;if(b){let S=t.previousGraph.coverage.phases?.find(I=>I.id==="http-summary"),N=t.previousGraph.coverage.extractors.find(I=>I.id==="builtin.wrapper");C={observations:t.previousGraph.observations.filter(I=>I.extractor===an),frontiers:t.previousGraph.frontiers.filter(I=>I.kind==="call-resolution"&&I.action===Ee.HTTP_REQUEST),summaries:0,filesInspected:S?.filesVisited??N?.applicableFiles??0,errors:t.previousGraph.coverage.extractionErrors.filter(I=>I.startsWith("builtin.http-summary failed"))},z(d,"http-summary",m,R.length,C.observations.length,{filesVisited:0,filesReused:C.filesInspected,factsReused:C.observations.length+C.frontiers.length,factsInvalidated:0}),N&&f.set(N.id,N)}else C=Wt(e,R,t.profileSpan),z(d,"http-summary",m,R.length,C.observations.length,{filesVisited:C.filesInspected}),f.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:C.filesInspected,observations:C.observations.length,errors:C.errors.length});h.push(...C.errors);let P=ce([...R,...C.observations]);m=performance.now();let w=zt(e,P);z(d,"http-mount",m,P.length,w.observations.length,{filesVisited:w.filesInspected});let F=ce([...P,...w.observations]);m=performance.now();let $=b&&t.previousGraph!==void 0&&Kr(t.previousGraph,a,y.fileCoverage,i),_;if($){let S=t.previousGraph.coverage.phases?.find(I=>I.id==="carrier"),N=t.previousGraph.coverage.extractors.find(I=>I.id==="builtin.carrier");_={observations:t.previousGraph.observations.filter(I=>I.extractor==="builtin.carrier"),bodySummaries:N?.applicableFiles??0,discriminatorSummaries:0,filesInspected:S?.filesVisited??0,errors:t.previousGraph.coverage.extractionErrors.filter(I=>I.startsWith("builtin.carrier"))},z(d,"carrier",m,F.length,_.observations.length,{filesVisited:0,filesReused:_.filesInspected,factsReused:_.observations.length,factsInvalidated:0}),N&&f.set(N.id,N)}else _=Dt(e,F,v.flatMap(S=>S.bodySummaries??[])),z(d,"carrier",m,F.length,_.observations.length,{filesVisited:_.filesInspected}),f.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:_.bodySummaries,observations:_.observations.length,errors:_.errors.length});h.push(..._.errors);let K=ce([...F,..._.observations]);m=performance.now();let J=di(K);z(d,"relations",m,K.length,J.length),m=performance.now();let Qe=mi(K,J);z(d,"links",m,J.length,Qe.length),fi(K,J),m=performance.now();let et=Ce([...yi(K,J),...C.frontiers]);return z(d,"frontiers",m,K.length,et.length),{schemaVersion:2,extractorVersion:Ye,observations:K,relationGroups:J,links:Qe,frontiers:et,coverage:{filesScanned:n.length,filesWithAst:v.filter(S=>S.hasAst).length,filesWithoutAst:v.filter(S=>!S.hasAst).length,...s?{filesReused:o.length}:{},extractors:[...f.values()],extractionErrors:h,phases:d},fileCoverage:v}}function zr(e,t,n){if(!e)return!1;let r=e.filter(a=>n.has(a.file)).filter(tn).map(nn).sort((a,s)=>a.file.localeCompare(s.file)),i=t.filter(tn).map(nn).sort((a,s)=>a.file.localeCompare(s.file));return JSON.stringify(r)===JSON.stringify(i)}function tn(e){return e.observationIds.length>0||e.extractionErrors.length>0}function nn(e){let{syntaxHash:t,shapeHash:n,bodySummaries:r,...i}=e;return i}function qr(e,t,n,r,i){let a=Zr(t,n,r),s=Wr(e),l=![...on(t,n)].some(p=>s.has(p)),u=new Set((t??[]).filter(p=>r.has(p.file)).flatMap(p=>p.observationIds)),c=new Set(n.flatMap(p=>p.observationIds)),d=rn(e.observations,u)===rn(i,c);return{reuse:a&&l&&d,shapeUnchanged:a,proofFilesUnchanged:l,seedUnchanged:d}}function on(e,t){let n=new Map(e?.map(r=>[r.file,r.syntaxHash])??[]);return new Set(t.filter(r=>r.syntaxHash===void 0||n.get(r.file)!==r.syntaxHash).map(r=>r.file))}function Kr(e,t,n,r){if(!t)return!1;let i=t.filter(l=>r.has(l.file)).map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file)),a=n.map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file));if(JSON.stringify(i)!==JSON.stringify(a))return!1;let s=on(t,n),o=Xr(e,"builtin.carrier");return![...s].some(l=>o.has(l))}function Xr(e,t){let n=new Set;for(let r of e.observations)if(r.extractor===t){n.add(r.source.file);for(let i of r.derivation.sourceSpans)n.add(i.file)}return n}function Zr(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.shapeHash]));return t.length===n.size&&t.every(i=>i.shapeHash!==void 0&&r.get(i.file)===i.shapeHash)}function Wr(e){let t=new Set;for(let n of e.observations)if(n.extractor===an){t.add(n.source.file);for(let r of n.derivation.sourceSpans)t.add(r.file)}for(let n of e.frontiers)n.kind==="call-resolution"&&n.action===Ee.HTTP_REQUEST&&n.source&&t.add(n.source.file);return t}function rn(e,t){return JSON.stringify(e.filter(n=>t.has(n.id)&&n.action===Ee.HTTP_REQUEST&&n.owner.symbol!==null&&(n.evidence==="call-expression"||n.evidence==="client-adapter")).map(n=>({ownerSymbol:n.owner.symbol,evidence:n.evidence,methods:n.keyParts.filter(r=>r.name==="method"&&r.evidence!=="expression").map(r=>r.value.toUpperCase()).sort()})).sort((n,r)=>`${n.ownerSymbol}\0${n.evidence}\0${n.methods.join(",")}`.localeCompare(`${r.ownerSymbol}\0${r.evidence}\0${r.methods.join(",")}`)))}function Yr(e,t,n){let r=Jr(t),i=Qr(t);if([...n].some(o=>r.has(o)))return!0;if(i.size===0||n.size===0)return!1;if(!!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))return!0;let s=[...n];for(let o=0;o<s.length;o+=750){let l=s.slice(o,o+750),u=l.map(()=>"?").join(",");if(e.all(`SELECT DISTINCT global_symbol.symbol
4
- FROM mentions mention
5
- JOIN chunks reference_chunk ON reference_chunk.id = mention.chunk_id
6
- JOIN documents reference_document ON reference_document.id = reference_chunk.document_id
7
- JOIN global_symbols global_symbol ON global_symbol.id = mention.symbol_id
8
- WHERE mention.role != 1
9
- AND reference_document.relative_path IN (${u})`,...l).some(d=>i.has(d.symbol)))return!0}return!1}function Jr(e){let t=new Set;for(let n of e.observations)if(Je.has(n.action)){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)!n.action||!Je.has(n.action)||!n.source||t.add(n.source.file);return t}function Qr(e){return new Set(e.observations.flatMap(t=>Je.has(t.action)&&t.owner.symbol?[t.owner.symbol]:[]))}function ei(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.syntaxHash]));return t.length===n.size&&t.every(i=>i.syntaxHash!==void 0&&r.get(i.file)===i.syntaxHash)}function ti(e,t){let n=ni(e);return[...t].some(r=>n.has(r))}function ni(e){let t=new Set;for(let n of e.observations){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)n.source&&t.add(n.source.file);return t}function ri(e){return(e??[]).filter(t=>t.id!=="direct-extraction").map(t=>({...t,durationMs:0,filesVisited:0,filesReused:t.filesVisited??0,factsReused:t.outputFacts,factsInvalidated:0}))}function z(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}function ii(e,t,n){let r=[],i=[];for(let a of t){let s=it(e,a),o=Ue.filter(p=>p.supports(s)),l=/\bJSON\.stringify\s*\(/u.test(s)&&/\bbody\s*:/u.test(s),u=o.length>0||l?L(e,a,s,n):null,c=ai(a,s),d={file:a,hasAst:u!==null||li(a,s),syntaxHash:c.syntaxHash,shapeHash:c.shapeHash,bodySummaries:u&&l?Mt(u):[],observationIds:[],extractors:[],extractionErrors:[]};if(u)for(let p of o){let m={id:p.id,applicableFiles:1,observations:0,errors:0};try{let y=si(n,`runtime-boundaries.extractor.${p.id}`,a,()=>p.extract(u));m.observations=y.length,r.push(...y),d.observationIds.push(...y.map(v=>v.id))}catch(y){m.errors=1,d.extractionErrors.push(`${p.id} failed for ${a}: ${y instanceof Error?y.message:String(y)}`)}d.extractors.push(m)}i.push(d)}return{observations:r,fileCoverage:i}}function ai(e,t){if(!/\.(?:[cm]?[jt]sx?)$/iu.test(e)){let u=de("sha256").update(t).digest("hex");return{syntaxHash:u,shapeHash:u}}let n=/\.[jt]sx$/iu.test(e)?B.LanguageVariant.JSX:B.LanguageVariant.Standard,r=B.createScanner(B.ScriptTarget.Latest,!1,n,t),i=de("sha256"),a=de("sha256"),s=[],o=[0];for(let u=0;u<t.length;u+=1)t.charCodeAt(u)===10&&o.push(u+1);let l=0;for(let u=r.scan();u!==B.SyntaxKind.EndOfFileToken;u=r.scan()){if(u===B.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)===0&&(u=r.reScanTemplateToken(!1)),Vr.has(u))continue;let c=r.getTokenText();for(;o[l+1]!==void 0&&o[l+1]<=r.getTokenPos();)l+=1;i.update(String(u)),i.update("\0"),i.update(c),i.update("\0"),i.update(String(l)),i.update("\0"),a.update(String(u)),a.update("\0"),!Ur.has(u)&&!oi(u,c)&&a.update(c),a.update("\0"),a.update(String(l)),a.update("\0"),u===B.SyntaxKind.TemplateHead?s.push(0):u===B.SyntaxKind.TemplateTail?s.pop():u===B.SyntaxKind.OpenBraceToken&&s.length>0?s[s.length-1]+=1:u===B.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)>0&&(s[s.length-1]-=1)}return{syntaxHash:i.digest("hex"),shapeHash:a.digest("hex")}}function oi(e,t){if(e!==B.SyntaxKind.StringLiteral||t.length<2)return!1;let n=t.slice(1,-1);return n.startsWith("/")||n.includes("://")}function si(e,t,n,r){return e?e(t,r,{file:n}):r()}function li(e,t){return t?at(e)?/<script\b/iu.test(t):fe(e)!==null:!1}function ui(e){let t=new Map(Ue.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function ci(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function di(e){let t=new Map;for(let n of we){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let a=gi(i,n.keyNames);if(!a)continue;let s=a.map(d=>`${d.name}=${ln(d.name,d.value)}`).join("\0"),o=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${o}\0${s}`,u=`boundary-group:${de("sha256").update(l).digest("hex").slice(0,16)}`,c=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:s,keyParts:a,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&c.producerIds.push(i.id),n.consumerActions.includes(i.action)&&c.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&c.declarationIds.push(i.id),c.derivation.inputFactIds.push(i.id),c.derivation.sourceSpans.push(i.source),t.set(u,c)}}return[...t.values()].map(pi).sort(bi)}function pi(e){return{...e,producerIds:Ie(e.producerIds),consumerIds:Ie(e.consumerIds),declarationIds:Ie(e.declarationIds),derivation:{...e.derivation,inputFactIds:Ie(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function mi(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=we.find(o=>o.id===i.joinRule);if(!a?.traversable)continue;let s=a.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(s.length===0||i.consumerIds.length===0)&&!(a.requireUniquePair&&(s.length!==1||i.consumerIds.length!==1))&&!(a.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(s.length*i.consumerIds.length>Gr))for(let o of s)for(let l of i.consumerIds){let u=n.get(o),c=n.get(l);if(!u||!c||vi(u,c))continue;let d=u.strength==="derived"||c.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${o}\0${l}`,m={id:`boundary-link:${de("sha256").update(p).digest("hex").slice(0,16)}`,from:o,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:d,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[o,l],sourceSpans:[u.source,c.source]}};r.set(m.id,m)}}return[...r.values()].sort(Si)}function fi(e,t){let n=new Set(t.filter(sn).flatMap(Pe)),r=new Set(t.filter(hi).flatMap(Pe));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function yi(e,t){let n=new Set(e.filter(a=>a.strength!=="candidate").map(a=>`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)),r=new Set(t.flatMap(Pe)),i=new Set(t.filter(sn).flatMap(Pe));return e.filter(a=>a.sourceScope==="production").filter(a=>a.strength!=="candidate"||!n.has(`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)).filter(a=>!i.has(a.id)).map(a=>{let s=a.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),o=s.length>0?`${a.extractor} observed ${a.action}, but ${s.join(", ")} remained symbolic or unknown.`:a.resolution==="ambiguous"?`${a.extractor} established the address for ${a.action}, but more than one indexed peer has the same runtime key.`:r.has(a.id)?`${a.extractor} established the address for ${a.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${a.extractor} observed ${a.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:a.id,reason:o,missingKeyParts:s,sourceScope:a.sourceScope}}).sort((a,s)=>a.observationId.localeCompare(s.observationId))}function Pe(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function sn(e){let t=we.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function hi(e){let t=we.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function gi(e,t){let n=[];for(let r of t){let i=e.keyParts.find(a=>a.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:ln(r,i.value)})}return n}function ln(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function vi(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function ce(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function Ie(e){return[...new Set(e)].sort()}function bi(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function Si(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}import xi from"better-sqlite3";var Te="scip_query_runtime_boundaries",Y="scip_query_runtime_observations",$e="scip_query_runtime_relation_groups",_e="scip_query_runtime_relation_participants";function Ri(e,t){let n=new xi(e);try{n.exec(`
10
- CREATE TABLE IF NOT EXISTS ${Te} (
11
- singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
12
- schema_version INTEGER NOT NULL,
13
- extractor_version TEXT NOT NULL,
14
- payload TEXT NOT NULL
15
- )
16
- `),Ni(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${Te} (singleton, schema_version, extractor_version, payload) VALUES (1, ?, ?, ?)`).run(t.schemaVersion,t.extractorVersion,JSON.stringify(t)),n.prepare(`DELETE FROM ${Y}`).run(),n.prepare(`DELETE FROM ${_e}`).run(),n.prepare(`DELETE FROM ${$e}`).run();let r=n.prepare(`INSERT INTO ${Y}
17
- (id, protocol, action, role, strength, source_scope, resolution, file, start_line, end_line, owner_symbol, payload)
18
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let s of t.observations)r.run(s.id,s.protocol,s.action,s.role,s.strength,s.sourceScope,s.resolution,s.source.file,s.source.startLine,s.source.endLine,s.owner.symbol,JSON.stringify(s));let i=n.prepare(`INSERT INTO ${$e} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),a=n.prepare(`INSERT INTO ${_e} (group_id, observation_id, participant_role) VALUES (?, ?, ?)`);for(let s of t.relationGroups){i.run(s.id,s.protocol,s.joinRule,s.normalizedKey,JSON.stringify(s));for(let o of s.producerIds)a.run(s.id,o,"producer");for(let o of s.consumerIds)a.run(s.id,o,"consumer");for(let o of s.declarationIds)a.run(s.id,o,"declaration")}})()}finally{n.close()}}function Ci(e,t={}){if(!Bi(e,Y))return un(e)?.observations??[];let n=[],r=[];return Fe(n,r,"protocol",t.protocols),Fe(n,r,"action",t.actions),Fe(n,r,"source_scope",t.sourceScopes),Fe(n,r,"file",t.files),e.all(`SELECT payload FROM ${Y}${n.length>0?` WHERE ${n.join(" AND ")}`:""} ORDER BY file, start_line, id`,...r).flatMap(a=>Ii(a.payload))}function Ni(e){e.exec(`
19
- CREATE TABLE IF NOT EXISTS ${Y} (
20
- id TEXT PRIMARY KEY,
21
- protocol TEXT NOT NULL,
22
- action TEXT NOT NULL,
23
- role TEXT NOT NULL,
24
- strength TEXT NOT NULL,
25
- source_scope TEXT NOT NULL,
26
- resolution TEXT NOT NULL,
27
- file TEXT NOT NULL,
28
- start_line INTEGER NOT NULL,
29
- end_line INTEGER NOT NULL,
30
- owner_symbol TEXT,
31
- payload TEXT NOT NULL
32
- );
33
- CREATE INDEX IF NOT EXISTS idx_runtime_observations_protocol_action_scope
34
- ON ${Y}(protocol, action, source_scope);
35
- CREATE INDEX IF NOT EXISTS idx_runtime_observations_file_line
36
- ON ${Y}(file, start_line);
37
-
38
- CREATE TABLE IF NOT EXISTS ${$e} (
39
- id TEXT PRIMARY KEY,
40
- protocol TEXT NOT NULL,
41
- join_rule TEXT NOT NULL,
42
- normalized_key TEXT NOT NULL,
43
- payload TEXT NOT NULL
44
- );
45
- CREATE INDEX IF NOT EXISTS idx_runtime_groups_protocol_key
46
- ON ${$e}(protocol, join_rule, normalized_key);
47
-
48
- CREATE TABLE IF NOT EXISTS ${_e} (
49
- group_id TEXT NOT NULL,
50
- observation_id TEXT NOT NULL,
51
- participant_role TEXT NOT NULL,
52
- PRIMARY KEY (group_id, observation_id, participant_role)
53
- );
54
- CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
55
- ON ${_e}(observation_id, participant_role);
56
- `)}function Bi(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function Fe(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function Ii(e){try{return[JSON.parse(e)]}catch{return[]}}function un(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",Te))return null;let n=e.get(`SELECT schema_version, payload FROM ${Te} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}export{ge as a,V as b,qe as c,se as d,Ye as e,jr as f,Ri as g,Ci as h,un as i};
57
- //# sourceMappingURL=chunk-MR4ZKWO6.js.map
@@ -1,133 +0,0 @@
1
- import{a as xe}from"./chunk-5Z2H76VD.js";import{b as H,c as Zt,d as en,e as Re,g as ot}from"./chunk-DRENNWRG.js";import{b as Qt,c as U,d as Se,f as Jt,g as Kt,h as Xt,i as Gt,j as Yt,p as pe}from"./chunk-PRLU3I7G.js";import{a as zt,c as b,d as le,e as qt,f as ue}from"./chunk-FYCH2EYQ.js";import{a as rt,b as st,e as it}from"./chunk-HGFDYOVB.js";import{B as x,h as Te,ja as Fe,ka as De}from"./chunk-XIPGCT3D.js";var _r=b("source-text",{clearGroups:["whole-project","source-file"]}),Cr=b("source-lines",{clearGroups:["whole-project","source-file"]});function N(e,t){let n=t.replace(/\\/g,"/");return _r.get(e,n,()=>Er(e,n))}function Er(e,t){let n=t.replace(/\\/g,"/");try{return Fe(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(r){if(De(r))return"";throw r}}function Ma(e){if(e.length===0)return[];let t=e.split(`
2
- `);return e.endsWith(`
3
- `)&&t.pop(),t}function at(e,t){let n=t.replace(/\\/g,"/");return Cr.get(e,n,()=>{let r=N(e,n);return r?r.split(`
4
- `):[]})}var kr=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Pr(e){let t=kr.exec(e);return t?t[1]??"":null}function $a(e,t,n){return Lr(e,t,n).length>0}function Lr(e,t,n){if(n<=0)return[];let r=at(e,t);if(r.length===0)return[];let s=[];for(let i=n-1;i>=0&&i>=n-5;i-=1){let o=(r[i]??"").trim();if(o==="")continue;let a=Pr(o);if(a!==null){s.push(a);continue}if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return s}return s}import{extname as tn}from"path";var Tr={".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 Tr[tn(e).toLowerCase()]??null}function q(e){return tn(e).toLowerCase()===".vue"}var Fr=[I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("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"}),I("runtime-boundary-http-roles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/analysis/runtime-boundaries.test.ts",owner:"src/analysis/runtime-boundaries/http-summaries.ts"}),ve("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"}),ve("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"}),ve("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"}),ve("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 Y(e){let t=new Map;return{kind:e.kind,read(n,r,s){let i=!1,o=0,a;if(rt()){let c=Se(n);if(c){let l=`${c}\0${r}\0${s}`;a=t.get(l),a||(a=st(["evidence-product-file-read-v1",e.kind,c,r,s]),t.set(l,a))}}return it("evidence-product.file.read",()=>{let c=Jt(n,e.kind,r,s);if(c===null)return null;o=c.length;try{let l=e.deserialize(c);return i=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:i,payloadBytes:o}))},write(n,r,s,i){Kt(n,e.kind,r,s,e.serialize(i))},writeBatch(n,r){Xt(n,r.map(s=>({kind:e.kind,relativePath:s.relativePath,contentHash:s.contentHash,payload:e.serialize(s.value)})))}}}function Qa(e){let t=new Map;return{kind:e.kind,read(n,r,s){let i=!1,o=0,a;if(rt()){let c=`${s}\0${r}`;a=t.get(c),a||(a=st(["evidence-product-project-read-v1",e.kind,s,r]),t.set(c,a))}return it("evidence-product.project.read",()=>{let c=Gt(n,e.kind,r,s);if(c===null)return null;o=c.length;try{let l=e.deserialize(c);return i=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:i,payloadBytes:o}))},write(n,r,s,i){Yt(n,e.kind,r,s,e.serialize(i))}}}function Z(e){let t=Fr.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function I(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function ve(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}import{createRequire as Dr}from"module";var _=Dr(import.meta.url),we=null,nn=!1;function Rr(){if(nn)return null;if(we)return we;try{return we=_("tree-sitter"),we}catch{return nn=!0,null}}var rn=new Map,Ae=new Set;function vr(e){if(Ae.has(e))return null;let t=rn.get(e);if(t)return t;let n;try{switch(e){case"rust":n=_("tree-sitter-rust");break;case"typescript":n=_("tree-sitter-typescript").typescript;break;case"tsx":n=_("tree-sitter-typescript").tsx;break;case"javascript":n=_("tree-sitter-javascript");break;case"python":n=_("tree-sitter-python");break;case"java":n=_("tree-sitter-java");break;case"kotlin":n=_("tree-sitter-kotlin");break;case"scala":n=_("tree-sitter-scala");break;case"ruby":n=_("tree-sitter-ruby");break;case"c":n=_("tree-sitter-c");break;case"cpp":n=_("tree-sitter-cpp");break;case"csharp":n=_("tree-sitter-c-sharp");break;case"php":n=_("tree-sitter-php").php;break;case"vb":{let r=_("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Ae.add(e),null}}catch{return Ae.add(e),null}return rn.set(e,n),n}var sn=new Map;function wr(e){let t=sn.get(e);if(t)return t;let n=vr(e);if(!n)return null;let r=Rr();if(!r)return null;let s=new r;try{s.setLanguage(n)}catch{return Ae.add(e),null}return sn.set(e,s),s}function Ar(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function be(e,t){let n=wr(e);if(!n)return null;try{return Ar(n,t)}catch{return null}}import{createRequire as jr}from"module";import{posix as ct}from"path";var tc=qt("vue-sfc-units"),Or=jr(import.meta.url),Mr;function $r(){return Mr??=Or("@vue/compiler-sfc")}function Br(...e){return $r().parse(...e)}function Vr(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Wr(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function cn(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let s;try{s=Br(n,{filename:t})}catch(o){return r.errors.push(an(o)),r}r.errors.push(...s.errors.map(an));let{descriptor:i}=s;return i.template&&(r.template=je(e,t,"template",i.template)),i.script&&r.scripts.push(on(e,t,i.script,!1)),i.scriptSetup&&r.scripts.push(on(e,t,i.scriptSetup,!0)),r.styles=i.styles.map(o=>je(e,t,"style",o)),r.customBlocks=i.customBlocks.map(o=>je(e,t,"custom",o)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(o=>o?.errors??[])),r}function on(e,t,n,r){let s=je(e,t,"script",n);return{...s,kind:"script",setup:r,astLanguage:Wr(s.lang)}}function je(e,t,n,r){let s=Hr(r.attrs),i=typeof s.lang=="string"?s.lang:null,o=typeof s.src=="string"?s.src:typeof r.src=="string"?r.src:void 0;if(o){let c=Ur(t,o);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:o,attrs:s,lang:i,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${o}`]};let l=N(e,c),u=l?Math.max(0,l.split(`
5
- `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:o,attrs:s,lang:i,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:s,lang:i,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function Ur(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Vr(ct.normalize(ct.join(ct.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Hr(e){return{...e}}function an(e){return e instanceof Error?e.message:String(e)}function Ne(e,t,n){let s=cn(e,t,n).scripts.filter(o=>o.astLanguage&&o.body.length>0),i=s[0]?.astLanguage;return i?{body:s.map(o=>`${`
6
- `.repeat(o.startLine)}${o.body}`).join(`
7
- `),startLine:0,language:i}:null}var ln=ue("ast-trees",{clearGroups:["whole-project","source-file"]});function O(e,t){if(q(t))return zr(e,t);let n=z(t);if(!n)return null;let r=N(e,t);return r?ln.get(e,t,r,()=>be(n,r)):null}function Ie(e,t,n){if(q(t)){let i=Ne(e,t,n);if(!i)return null;let o=be(i.language,`
8
- `.repeat(i.startLine)+i.body);return o?{tree:o,language:i.language}:null}let r=z(t);if(!r)return null;let s=be(r,n);return s?{tree:s,language:r}:null}function zr(e,t){let n=N(e,t);return n?ln.get(e,t,n,()=>{let r=Ne(e,t,n);if(!r)return null;let s=`
9
- `.repeat(r.startLine)+r.body;return be(r.language,s)}):null}function _e(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var yn=["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"],qr=new Set(yn),Qr=[...yn,"variable_declarator","public_field_definition"],Jr=["function_item","function_signature_item"],Kr=["function_definition"],Xr=[],un=new Set(["arrow_function","function_expression","generator_function"]);function hn(e){return e==="rust"?Jr:e==="python"?Kr:e==="typescript"||e==="tsx"||e==="javascript"?Qr:Xr}function Oe(e,t){let n=Yr(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:mn(n.functionNode),params:pn(n.functionNode),paramsEndLine:dn(n.functionNode),isLiteralPassthrough:gn(n.functionNode,t)};if(!Gr(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(s=>s.type==="identifier"||s.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:mn(e),params:pn(e),paramsEndLine:dn(e),isLiteralPassthrough:gn(e,t)}:null}function Sn(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function pn(e){let t=Sn(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(_e(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let s=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),i=r.childForFieldName("pattern");if(!s&&i&&i.type==="identifier"){n.push({name:i.text,simple:!0});continue}let o=r.namedChildren.find(a=>a.type==="identifier");n.push({name:i?.type==="identifier"?i.text:o?.text??"",simple:!1})}return n}function dn(e){let t=Sn(e);return t?t.endPosition.row:e.startPosition.row}function Gr(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?qr.has(e):!1}function Yr(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 s=fn(r);return s?{name:n.text,definitionNode:e,functionNode:s}: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 s=fn(r);return s?{name:n.text,definitionNode:e,functionNode:s}:null}return null}function fn(e){if(un.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(s=>s.type==="arguments"))?.namedChildren??[]).filter(s=>un.has(s.type));return r.length===1?r[0]:null}function mn(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)_e(r)||(n+=1);return n}function gn(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=>!_e(p));if(r.length!==1)return!1;let s=r[0],i=null;if(s.type==="return_statement"||s.type==="expression_statement"?i=s.namedChild(0)??null:t==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(i=s),!i)return!1;let o=t==="python"?"call":"call_expression";if(i.type!==o)return!1;let a=i.namedChildren.find(p=>p.type==="arguments"||p.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(p=>!_e(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 fc(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 xn(e,t){let n=es(e,t);if(!n)return null;let r=ee(n);if(!r)return null;let s=ts(n);return{calleeLeaf:r,calleeQualifier:s?Zr(n):void 0,calleeText:n.text,memberAccess:s,line:e.startPosition.row}}function Zr(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function es(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 ts(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function ee(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?ee(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?ee(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?ee(t):null}case"super":case"self":case"this":return null;default:return null}}var ns=new Set(["identifier","type_identifier","field_identifier"]),rs=new Set(["identifier"]),ss=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),is=new Set(["rust","python"]),os=/\{([^{}]*)\}/g,as=/\b([A-Za-z_][\w]*)\b/g;function bn(e,t){return cs(t).has(e.type)}function Nn(e,t){return is.has(t)&&e.type==="string_content"}function lt(e){let t=0;for(let r of e.values()){let s=r[r.length-1];s!==void 0&&s>t&&(t=s)}let n=new Array(t+1);for(let r=0;r<=t;r+=1)n[r]=new Set;for(let[r,s]of e)for(let i of s)n[i].add(r);return n}function cs(e){return e==="rust"?ns:e==="python"?rs:ss}function In(e,t){let n=e.startPosition.row;for(let r of e.text.matchAll(os)){let s=r[1]??"";for(let i of s.matchAll(as))i[1]&&t(i[1],n)}}var ls=[/\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],us=/^#!?\[\s*serde\s*\(/,ps=/^#!?\[\s*schemars\s*\(/,ds=/^#!?\[\s*validate\s*\(/,fs=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function _n(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 s=ee(r);if(!s||!fs.has(s))return;let i=e.namedChildren.find(c=>c.type==="arguments");if(!i)return;let o=i.namedChild(0);if(!o||o.type!=="string")return;let a=o.namedChildren.find(c=>c.type==="string_fragment");a&&n.add(a.text)}function Cn(e,t){let n=us.test(e),r=ps.test(e),s=ds.test(e);if(!(!n&&!r&&!s))for(let i of ls){i.lastIndex=0;let o;for(;(o=i.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 En(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)},s=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),i=(o,a)=>{let c=l=>{s.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&&i(c,a),o.type==="type_item"&&i(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&&i(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&&i(o,a)}return n}var ms=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),ut=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function kn(e){let t=[],n=[],r=[],s=new Map,i=[],o=0,a=0,c=(l,u)=>{let p=s.get(l);if(!p){s.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)};for(;a<e.length;){let l=e[a];if(l===`
10
- `){o+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=$e(e,a);continue}if(l==='"'){let S=Ee(e,a,o);o=S.line,a=S.index;continue}if(l==="("||l==="["||l==="{"){i.push({kind:l,startLine:o,endLine:o,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let S=i.pop();S&&(S.endLine=o,gs(S,{callables:t,callSites:n,clojureMembers:r,recordIdentifier:c}),i[i.length-1]?.children.push(S)),a+=1;continue}if(pt(l)){a+=1;continue}let u=o,p=a;for(;a<e.length&&!dt(e[a]);)a+=1;let d=e.slice(p,a);if(!d)continue;let f={text:d,line:u};ys(i[i.length-1],f),c(T(d),u)}return{language:"clojure",callables:t,callSites:n,clojureMembers:r,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:Ns(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function gs(e,t){if(e.kind!=="("||e.headTokens.length===0)return;let n=e.headTokens[0],r=T(n.text),s=ms.get(n.text);if(s){let o=e.headTokens[1];if(o){let a=T(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:s})}}if(hs(e,t),!r||ut.has(n.text)||ut.has(r)||r.startsWith(":"))return;let i=bs(n.text);t.callSites.push({calleeLeaf:i.leaf,calleeQualifier:i.qualifier,calleeText:i.text,memberAccess:!1,line:n.line})}function ys(e,t){e&&(e.headTokens.length<2&&e.headTokens.push(t),e.tokens.length<200&&e.tokens.push(t))}function hs(e,t){let n=T(e.tokens[0]?.text??"");if(n==="defprotocol"){let r=T(e.tokens[1]?.text??"");if(!r)return;for(let s of Me(e))Ce(t,r,"protocol",s,"protocol-method");return}if(n==="defrecord"||n==="deftype"){let r=T(e.tokens[1]?.text??"");if(!r)return;let s=n==="defrecord"?"record":"type",i=n==="defrecord"?"record-method":"type-method";for(let o of Me(e))Ce(t,r,s,o,i);return}if(n==="extend-type"){let r=T(e.tokens[1]?.text??"");if(!r)return;for(let s of Me(e))Ce(t,r,"extension",s,"extension-method");return}if(n==="extend-protocol"){let r=T(e.tokens[1]?.text??"");for(let s of Me(e)){r&&Ce(t,r,"extension",s,"extension-method");let i=xs(e,s.startLine);i&&i!==r&&Ce(t,i,"extension",s,"extension-method")}}}function Me(e){return e.children.filter(Ss)}function Ss(e){if(e.kind!=="(")return!1;let t=T(e.tokens[0]?.text??"");return!!(t&&!ut.has(t)&&!t.startsWith(":"))}function Ce(e,t,n,r,s){let i=r.tokens[0],o=T(i?.text??"");!i||!o||(e.recordIdentifier(o,i.line),e.clojureMembers.push({ownerName:t,ownerKind:n,memberName:o,memberKind:s,startLine:r.startLine,endLine:r.endLine}))}function xs(e,t){let n=null;for(let r=2;r<e.tokens.length;r+=1){let s=e.tokens[r];if(s.line>t)break;let i=T(s.text);i&&!i.startsWith(":")&&(n=i)}return n}function T(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function bs(e){let t=e.replace(/^#?['`~@]+/,""),n=t.lastIndexOf("/"),r=T(t);if(n<=0)return{leaf:r,text:t};let s=t.slice(0,n);return{leaf:r,qualifier:s,text:t}}function $e(e,t){let n=t;for(;n<e.length&&e[n]!==`
11
- `;)n+=1;return n}function Ee(e,t,n){let r=t+1,s=n;for(;r<e.length;){let i=e[r];if(i==="\\"){r+=2;continue}if(i===`
12
- `&&(s+=1),r+=1,i==='"')break}return{index:r,line:s}}function pt(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function dt(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ns(e){let t=[];for(let[n,r]of e)for(let s of r)t[s]??=new Set,t[s].add(n);return t}var Pn=6,Is=ue("source-facts",{clearGroups:["whole-project","source-file"]}),ft=Y({kind:"source-facts",invalidation:Z("source-facts"),serialize:Es,deserialize:ks});function de(e,t){return mt(e,t).facts}function mt(e,t){let n=N(e,t);if(!n)return{facts:null};let r=_s(e,t,n);return r?Is.get(e,t,n,()=>Cs(e,t,r,n)):{facts:null}}function _s(e,t,n){return q(t)?Ne(e,t,n)?.language??null:z(t)}function Cs(e,t,n,r){let s=U(e,t,r),i=ft.read(e,t,s);if(i&&i.language===n)return{facts:i};if(n==="clojure"){let c=kn(r);return ft.write(e,t,s,c),{facts:c}}let o=O(e,t);if(!o)return{facts:null,unavailable:{language:n,reason:"parser-unavailable"}};let a=Ps(o,n);return ft.write(e,t,s,a),{facts:a}}function Es(e){let t={version:Pn,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 ks(e){try{let t=JSON.parse(e);if(t.version!==Pn||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,s])=>[r,new Set(s)])),identifierLineMap:n,identifiersByLine:lt(n),fileIdentifiers:new Set(n.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function Ps(e,t){let n=[],r=[],s=new Set,i=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=Oe(l,t);u&&n.push(u);let p=xn(l,t);p&&r.push(p),_n(l,t,i),t==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&Cn(l.text,s),bn(l,t)&&a(l.text,l.startPosition.row),Nn(l,t)&&In(l,a);for(let d of l.children)c(d)};return c(e.rootNode),{language:t,callables:n,callSites:r,clojureMembers:[],typeContainerMap:En(e,t),identifierLineMap:o,identifiersByLine:lt(o),fileIdentifiers:new Set(o.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:i}}function gt(e,t){t(e);for(let n of e.namedChildren)gt(n,t)}function Ls(e,t,n){let r=null;return gt(e,s=>{!/(?:function|method|lambda)/u.test(s.type)&&s.type!=="arrow_function"||s.startPosition.row>t||s.endPosition.row<n||(!r||s.endIndex-s.startIndex<r.endIndex-r.startIndex)&&(r=s)}),r}function Ln(e,t,n){if(e.startPosition.row>t||e.endPosition.row<n)return null;for(let r of e.namedChildren){let s=Ln(r,t,n);if(s)return s}return e}function Ts(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 yt(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?yt(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function Fs(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(yt)??[]}var Tn=new Set(["rust","typescript","tsx","javascript","python","clojure"]),Ds=new Set(["rust","typescript","tsx","javascript","python"]);function ht(e,t){let n=de(e,t);return!n||!Tn.has(n.language)?null:n.callables.map(r=>({name:r.name,startLine:r.startLine,endLine:r.endLine}))}function Rs(e,t){if(!Ds.has(t))return null;let n=[];for(let r of e.descendantsOfType([...hn(t)])){let s=Oe(r,t);s&&n.push({name:s.name,startLine:s.startLine,endLine:s.endLine})}return n}function vs(e,t){let n=de(e,t);return!n||!Tn.has(n.language)?null:n.callSites}function Fn(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}import{createRequire as Hs}from"module";import{existsSync as re}from"fs";import{basename as Rn,dirname as k,extname as M,join as F,relative as te,resolve as h,sep as zs}from"path";import{existsSync as xt,readdirSync as ws,statSync as As}from"fs";import{join as fe,relative as js}from"path";function Dn(e){let t=Os(e)??Vs(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let s of t)for(let i of Ws(e,s)){if(r.has(i))continue;r.add(i);let o=Us(e,i);o&&n.push(o)}return n}function Os(e){let t=fe(e,"pnpm-workspace.yaml");if(!xt(t))return null;try{return Ms(Te(t,"pnpm workspace manifest"))}catch{return null}}function Ms(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let s=$s(r);if(!n){/^packages\s*:\s*$/.test(s.trim())&&(n=!0);continue}let i=/^\s+-\s*(.+)$/.exec(s);if(i){let o=Bs(i[1].trim());o&&t.push(o);continue}if(s.trim()!=="")break}return t}function $s(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Bs(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Vs(e){let t=fe(e,"package.json");if(!xt(t))return null;try{let n=JSON.parse(Te(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Ws(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let o=fe(e,t);return St(o)?[o]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),s=t.slice(n+1).replace(/^\//,""),i=fe(e,r||".");return St(i)?ws(i).map(o=>fe(i,o,s)).filter(St):[]}function St(e){try{return As(e).isDirectory()}catch{return!1}}function Us(e,t){let n=fe(t,"package.json");if(!xt(n))return null;try{let r=JSON.parse(Te(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:js(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var qs=le("indexed-paths",{clearGroups:[]}),Qs=le("indexed-path-digest",{clearGroups:[]}),Js=b("tsconfig-alias-config",{clearGroups:["whole-project"]}),Ks=b("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Xs=Hs(import.meta.url),ke;function Gs(){if(ke!==void 0)return ke;try{ke=Xs("typescript")}catch{ke=null}return ke}var Ys=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Zs=le("workspace-packages",{clearGroups:["whole-project"]}),ne=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],Be=[".py",".pyi"],P=[".java",".scala",".kt",".kts"],Ve=[".rs"],We=[".rb"],Ue=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Q=[".cs",".vb"],He=[".dart"],se=[".php"],me=[".clj",".cljs",".cljc"],ei=new Set(ne),bt=new Set(Be),vn=new Set(P),Nt=new Set(Ve),It=new Set(We),wn=new Set(Ue),An=new Set(Q),_t=new Set(He),jn=new Set(se),On=new Set(me),ti=[{extensions:ne,lookup:ei},{extensions:Be,lookup:bt},{extensions:P,lookup:vn},{extensions:Ve,lookup:Nt},{extensions:We,lookup:It},{extensions:Ue,lookup:wn},{extensions:Q,lookup:An},{extensions:He,lookup:_t},{extensions:se,lookup:jn},{extensions:me,lookup:On}];function $(e,t){return t.has(M(e).toLowerCase())}function ni(e){return $(e,bt)}function ri(e){return $(e,vn)}function si(e){return $(e,Nt)}function ii(e){return $(e,It)}function oi(e){return $(e,wn)}function ai(e){return $(e,An)}function Mn(e){return M(e).toLowerCase()===".vb"}function ci(e){return $(e,_t)}function li(e){return $(e,jn)}function ui(e){return $(e,On)}function Ct(e){let t=M(e).toLowerCase();for(let n of ti)if(n.lookup.has(t))return n.extensions;return ne}function pi(e){return ri(e)||ai(e)||li(e)}function J(e,t,n){return ni(t)?ge(e,t,n):si(t)?B(e,t,n):ii(t)?ze(e,t,n):oi(t)?qe(e,t,n):pi(t)?g(e,n.replace(/\\/g,"."),Ct(t)):ci(t)?Qe(e,t,n):ui(t)?Et(e,n):di(e,t,n)}function di(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return fi(e,t,n)??gi(e,n);let r=k(F(e.config.projectRoot,t)),s=h(r,n),i=V(e);for(let o of Pt(s)){let a=x(te(e.config.projectRoot,o));if(i.has(a)||re(o))return a}return x(te(e.config.projectRoot,s))}function fi(e,t,n){let r=Ni(e,t);if(!r)return null;let s=V(e);for(let i of mi(r,n)){let o=h(r.baseUrl,i);for(let a of Pt(o)){let c=x(te(e.config.projectRoot,a));if(s.has(c)||re(a))return c}}return null}function mi(e,t){let n=[];for(let[r,s]of Object.entries(e.paths)){let i=r.indexOf("*");if(i===-1){if(t!==r)continue;n.push(...s);continue}let o=r.slice(0,i),a=r.slice(i+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 s)n.push(l.includes("*")?l.replace("*",c):l)}return n}function gi(e,t){let n=hi(yi(e),t);if(!n)return null;let r=V(e);for(let s of Si(n)){let i=h(e.config.projectRoot,n.pkg.relativeDir,s);for(let o of Pt(i)){let a=x(te(e.config.projectRoot,o));if(r.has(a)||re(o))return a}}return null}function yi(e){return Zs.get(e,()=>Dn(e.config.projectRoot))}function hi(e,t){let n=null;for(let r of e){let s=null;t===r.name?s="":t.startsWith(`${r.name}/`)&&(s=t.slice(r.name.length+1)),s!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:s})}return n}function Si(e){let t=[],n=xi(e.pkg.exports,e.subpath);if(n){let r=bi(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function xi(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return $n(e[n])}function $n(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=$n(t[n]);if(r)return r}return null}function bi(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function Ni(e,t){let n=x(k(t));return Ks.get(e,n,()=>Ii(e,n))}function Ii(e,t){let n=Gs();if(!n)return null;let r=h(e.config.projectRoot),s=h(r,t);for(;s===r||s.startsWith(r+zs);){for(let o of Ys){let a=F(s,o);if(!re(a))continue;let c=Js.get(e,a,()=>_i(n,a));if(c)return c}let i=k(s);if(i===s)break;s=i}return null}function _i(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,k(t)),s=r.options.paths;return!s||Object.keys(s).length===0?null:{baseUrl:r.options.baseUrl?h(k(t),r.options.baseUrl):k(t),paths:s}}catch{return null}}function ge(e,t,n){let r=V(e),s;if(n.startsWith(".")){let i=n.match(/^(\.+)(.*)$/);if(!i)return null;let o=i[1].length,a=i[2].replace(/^\./,""),c=k(F(e.config.projectRoot,t));for(let l=1;l<o;l++)c=k(c);s=a?h(c,a.replace(/\./g,"/")):c}else s=h(e.config.projectRoot,n.replace(/\./g,"/"));for(let i of Ci(s)){let o=x(te(e.config.projectRoot,i));if(r.has(o)||re(i))return o}return null}function B(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 s=k(F(e.config.projectRoot,t)),i;return r.startsWith("crate::")?i=h(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?i=h(s,r.slice(6).replace(/::/g,"/")):i=h(k(s),r.slice(7).replace(/::/g,"/")),kt(e,Ei(i))}function ze(e,t,n){let r=k(F(e.config.projectRoot,t)),s=h(r,n);return kt(e,ki(s))}function qe(e,t,n){let r=k(F(e.config.projectRoot,t)),s=[h(r,n),h(e.config.projectRoot,n),h(e.config.projectRoot,"include",n),h(e.config.projectRoot,"src",n)];return kt(e,s)}function g(e,t,n){let r=V(e),s=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),i=s.replace(/\./g,"/"),o=s.split(".").pop()??s;for(let c of n){let l=`${i}${c}`,u=[...r].find(p=>p.endsWith(l));if(u)return u}for(let c of n){let l=[...r].find(u=>Rn(u)===`${o}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(M(c).toLowerCase())).filter(c=>c.includes(`/${i}/`)||c.includes(`/${o}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Qe(e,t,n){let r=V(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=x(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let s=k(F(e.config.projectRoot,t)),i=h(s,n);for(let o of Pi(i)){let a=x(te(e.config.projectRoot,o));if(r.has(a)||re(o))return a}return null}function Et(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=V(e);for(let s of me){let i=`${n}${s}`,o=[...r].find(a=>a.endsWith(i));if(o)return o}for(let s of me){let i=[...r].find(o=>Rn(o)===`${n.split("/").pop()}${s}`);if(i)return i}return null}function Ci(e){let t=M(e);return bt.has(t)?[e]:[`${e}.py`,`${e}.pyi`,F(e,"__init__.py"),F(e,"__init__.pyi")]}function kt(e,t){let n=V(e);for(let r of t){let s=x(te(e.config.projectRoot,r));if(n.has(s)||re(r))return s}return null}function Ei(e){let t=M(e);return Nt.has(t)?[e]:[`${e}.rs`,F(e,"mod.rs")]}function ki(e){let t=M(e);return It.has(t)?[e]:[`${e}.rb`,F(e,"index.rb")]}function Pi(e){let t=M(e);return _t.has(t)?[e]:[`${e}.dart`,e]}function Pt(e){let t=M(e),n=new Set;if(t){n.add(e);for(let r of ne)n.add(e.slice(0,-t.length)+r)}else for(let r of ne)n.add(`${e}${r}`),n.add(F(e,`index${r}`));return[...n]}function V(e){return qs.get(e,()=>new Set(xe(e,{includeIgnored:!1}).map(x)))}function Lt(e){return Qs.get(e,()=>Qt([...V(e)].sort().join(`
13
- `)))}function Li(e,t,n={}){let r=de(e,t);if(!r)return[];let s=[];if(n.includeCrossLanguageDispatchNames)for(let i of r.crossLanguageDispatchNames)s.push({name:i,kind:"cross-language-dispatch",occurrences:1});if(n.includeRustAttributeNames&&r.language==="rust")for(let i of r.rustAttrReferencedNames)s.push({name:i,kind:"rust-attribute",occurrences:1});return s}import{basename as Bn}from"path";function A(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ti(e){return e.replace(/'''[\s\S]*?'''/g,K).replace(/"""[\s\S]*?"""/g,K).replace(/#.*$/gm,K).replace(/\/\/.*$/gm,K).replace(/\/\*[\s\S]*?\*\//g,K).replace(/`(?:\\[\s\S]|[^`])*`/g,K).replace(/'(?:\\.|[^'\\\r\n])*'/g,K).replace(/"(?:\\.|[^"\\\r\n])*"/g,K)}function K(e){return e.replace(/[^\r\n]/g," ")}var Sl=ue("stripped-lines",{clearGroups:["whole-project","source-file"]});zt({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{Je=null,Pe=""},clearFile:()=>{Je=null,Pe=""}});var Je=null,Pe="";function Fi(e){return Je===e||(Je=e,Pe=Ti(e)),Pe}function X(e,t,n){let r=Fi(e);return`${r.slice(0,t)}${" ".repeat(n-t)}${r.slice(n)}`}function C(e,t){return new RegExp(`\\b${A(t)}\\b`,"m").test(e)}function ye(e,t){let n=new Set,r=new RegExp(`\\b${A(t)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(r)){let i=s[1];i&&n.add(i)}return[...n]}function Tt(e){let t=0;for(let n of e)n==="("&&(t+=1),n===")"&&(t-=1);return t}var Di=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function E(e){let t=[],n=0,r=0;for(let s=0;s<e.length;s++){let i=e[s];(i==="{"||i==="["||i==="(")&&n++,(i==="}"||i==="]"||i===")")&&n--,i===","&&n===0&&(t.push(e.slice(r,s)),r=s+1)}return t.push(e.slice(r)),t}function L(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=(s,i)=>{let o=i||t.has(s.type);!o&&Di.has(s.type)&&n.add(s.text);for(let a of s.children)r(a,o)};return r(e.rootNode,!1),n}function w(e,t,n,r,s,i,o){return{importedName:s,localName:i,sourcePath:o??g(e,r,Ct(t)),kind:"named",used:C(n,i),usedMembers:[]}}function m(e,t,n,r,s="named",i={}){return{importedName:e,localName:t,sourcePath:n,kind:s,used:r.has(t),usedMembers:[],isTypeOnly:i.isTypeOnly}}function W(e,t,n,r,s="named",i=[],o={}){return{importedName:e,localName:t,sourcePath:n,kind:s,used:r,usedMembers:i,isTypeOnly:o.isTypeOnly}}function ie(e,t){return{importedName:e,localName:null,sourcePath:t,kind:"side-effect",used:!0,usedMembers:[]}}function oe(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 D(e,t,n){let r=[];for(let s of e.matchAll(t)){let i=s[0];if(!i||typeof s.index!="number")continue;let o=X(e,s.index,s.index+i.length);for(let a of n(s,o))r.push(a)}return r}function R(e,t,n,r,s){let i=Ie(e,t,s)?.tree??null;if(i){let o=n(i);if(o)return o}return r()}function Ke(e,t,n,r,s){let i=Ie(e,t,s)?.tree??null,o=z(t),a=o?n[o]:void 0;return i&&a?a(i):r()}function Vn(e,t,n){return R(e,t,r=>vi(e,t,r),()=>Ri(e,t,n),n)}function Ri(e,t,n){return D(n,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(r,s)=>{let i=r[1]?.trim();if(!i)return[];let o=Bn(i).replace(/\.[^.]+$/,"");return[W(i,o,qe(e,t,i),C(s,o))]})}function vi(e,t,n){let r=y(n,new Set(["preproc_include"])),s=[];for(let i of n.rootNode.descendantsOfType("preproc_include")){let o=null;for(let c of i.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=Bn(o).replace(/\.[^.]+$/,"");s.push(m(o,a,qe(e,t,o),r))}return s}var wi=new Set([":require",":require-macros",":use"]),Rt=String.raw`A-Za-z0-9_$*+!?.<>=-`;function Un(e,t,n){let r=zi(n);if(!r)return[];let s=Hi(n,r.start,r.end),i=[];for(let o of r.children.slice(2)){if(o.type!=="list"||o.children.length===0)continue;let a=v(o.children[0]);if(a){if(wi.has(a)){for(let c of Oi(o.children.slice(1)))i.push(...ji(e,c,s));continue}if(a===":import")for(let c of $i(o.children.slice(1)))i.push(c)}}return i}function Ai(e){return e.type==="list"&&v(e.children[0])==="ns"}function ji(e,t,n){let r=Et(e,t.namespace),s=t.alias??t.namespace,i=Vi(n,s),o=[{importedName:t.namespace,localName:s,sourcePath:r,kind:"namespace",used:t.refers.length>0||t.referAll||i.length>0||Wi(n,t.namespace),usedMembers:i}];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:Ui(n,a),usedMembers:[]});return o}function Oi(e){return e.flatMap(t=>Xe(t,null))}function Xe(e,t){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:Dt(t,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&v(e.children[0])===null?e.children.flatMap(n=>Xe(n,t)):Mi(e,t);if(e.type==="list"&&e.children.length>0){let n=v(e.children[0]);return n?!n||n.startsWith(":")?[]:e.children.slice(1).flatMap(r=>Xe(r,Dt(t,n))):e.children.flatMap(r=>Xe(r,t))}return[]}function Mi(e,t){let n=v(e.children[0]);if(!n||n.startsWith(":"))return[];let r={namespace:Dt(t,n),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let i=v(e.children[s]);if(!i?.startsWith(":"))continue;let o=e.children[s+1];if((i===":as"||i===":as-alias")&&o){r.alias=v(o),s+=1;continue}i===":refer"&&o&&(v(o)===":all"?r.referAll=!0:(o.type==="vector"||o.type==="list")&&r.refers.push(...o.children.map(v).filter(Bi)),s+=1)}return[r]}function $i(e){let t=[];for(let n of e){if(n.type==="atom"){let s=n.text.split(".").pop()??n.text;t.push(W(s,s,null,!0));continue}if(n.type!=="vector")continue;let r=v(n.children[0]);if(r)for(let s of n.children.slice(1)){let i=v(s);i&&t.push(W(`${r}.${i}`,i,null,!0))}}return t}function Dt(e,t){return e?`${e}.${t}`:t}function v(e){return e?.type==="atom"?e.text:null}function Bi(e){return!!(e&&!e.startsWith(":"))}function Vi(e,t){let n=new Set,r=new RegExp(`${vt()}${A(t)}\\s*/\\s*([${Rt}]+)`,"g");for(let s of e.matchAll(r)){let i=s[1];i&&n.add(i)}return[...n]}function Wi(e,t){return new RegExp(`${vt()}${A(t)}\\s*/`,"m").test(e)}function Ui(e,t){return new RegExp(`${vt()}${A(t)}(?![${Rt}])`,"m").test(e)}function vt(){return`(?<![${Rt}])`}function Hi(e,t,n){let r="",s=0;for(;s<e.length;){if(s>=t&&s<n){r+=e[s]===`
14
- `?`
15
- `:" ",s+=1;continue}let i=e[s];if(i===";"){let o=$e(e,s);r+=Wn(e.slice(s,o)),s=o;continue}if(i==='"'){let o=Ee(e,s,0).index;r+=Wn(e.slice(s,o)),s=o;continue}r+=i,s+=1}return r}function zi(e){let t=0;for(;t<e.length&&(t=wt(e,t),!(t>=e.length));){let n=Ge(e,t);if(!n){t+=1;continue}if(Ai(n.form))return n.form;t=n.index}return null}function Ge(e,t){let n=wt(e,t);if(e.startsWith("#?@",n)||e.startsWith("#?",n))return qi(e,n);if(e.startsWith("#_",n)){let s=Ge(e,n+2);return s?{form:{type:"atom",text:"",start:n,end:s.index},index:s.index}:null}for(;pt(e[n]);)n+=1;let r=e[n];return r?r==="("?Ft(e,n,"list",")"):r==="["?Ft(e,n,"vector","]"):r==="{"?Ft(e,n,"map","}"):r==='"'?{form:{type:"atom",text:"",start:n,end:Ee(e,n,0).index},index:Ee(e,n,0).index}:Ji(e,n):null}function qi(e,t){let n=e.startsWith("#?@",t)?3:2,r=Ge(e,t+n);return r?{form:{type:"list",children:r.form.type==="list"||r.form.type==="vector"||r.form.type==="map"?Qi(r.form.children):[],start:t,end:r.index},index:r.index}:null}function Qi(e){let t=[];for(let n=0;n<e.length;n+=2){let r=v(e[n]),s=e[n+1];r?.startsWith(":")&&s&&t.push(s)}return t}function Ft(e,t,n,r){let s=[],i=t+1;for(;i<e.length;){if(i=wt(e,i),e[i]===r)return{form:{type:n,children:s,start:t,end:i+1},index:i+1};let o=Ge(e,i);if(!o){i+=1;continue}o.form.type==="atom"&&o.form.text===""||s.push(o.form),i=o.index}return{form:{type:n,children:s,start:t,end:e.length},index:e.length}}function Ji(e,t){let n=t;for(;n<e.length&&!dt(e[n]);)n+=1;return{form:{type:"atom",text:e.slice(t,n),start:t,end:n},index:n}}function wt(e,t){let n=t;for(;n<e.length;){let r=e[n];if(/\s|,/.test(r)){n+=1;continue}if(r===";"){n=$e(e,n);continue}break}return n}function Wn(e){return e.replace(/[^\r\n]/g," ")}function Hn(e,t,n){let r=[];for(let s of n.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let i=s[1]?.trim(),o=s[2]?.trim()??null,a=s[0];if(!i||!a||typeof s.index!="number")continue;let c=X(n,s.index,s.index+a.length);r.push({importedName:i,localName:o,sourcePath:Qe(e,t,i),kind:o?"namespace":"side-effect",used:o?C(c,o):!0,usedMembers:o?ye(c,o):[]})}return r}function zn(e,t,n){let r=[];for(let s of n.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let i=s[1]?.trim();i&&r.push({specifier:i,sourcePath:Qe(e,t,i)})}return r}function qn(e,t,n){return Ke(e,t,{csharp:r=>Xi(e,t,r),vb:r=>Ki(e,t,r)},()=>{let r=Mn(t)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return D(n,r,(s,i)=>{let o=s[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,i,u,p,d,g(e,u,Q))]})},n)}function Ki(e,t,n){let r=y(n,new Set(["imports_statement"])),s=[];for(let i of n.rootNode.descendantsOfType("imports_statement")){let o=i.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;s.push(m(u,p,g(e,l,Q),r,c?"namespace":"named"))}return s}function Xi(e,t,n){let r=y(n,new Set(["using_directive"])),s=[];for(let i of n.rootNode.descendantsOfType("using_directive")){let o=i.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;s.push(m(u,p,g(e,l,Q),r,a?"namespace":"named"))}return s}var Gi=b("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Qn(e,t){return Gi.get(e,t,()=>{let n=new Set,r=N(e,t);if(!r)return n;let i=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 i.matchAll(/[A-Za-z_$][\w$]*/g))n.add(o[0]);return n})}function At(e,t,n){return R(e,t,r=>Zi(e,t,r),()=>Yi(e,t,n),n)}function Yi(e,t,n){return uo(n).flatMap(r=>po(e,t,r.clause,r.specifier,r.start,r.end,n))}function Zi(e,t,n){let r=eo(e,t,n),s=[];for(let i of n.rootNode.descendantsOfType("import_statement"))s.push(...to(e,t,n,i,r));return s}function eo(e,t,n){let r=y(n,new Set(["import_statement"]));if(q(t))for(let s of Qn(e,t))r.add(s);return r}function to(e,t,n,r,s){let i=oo(r);if(!i)return[];let o=J(e,t,i),a=L(r,"import_clause");return a?no(n,a,o,s,ao(r.text)):[ie("*",o)]}function no(e,t,n,r,s){let i=[];for(let o of t.namedChildren)if(o.type==="identifier")i.push(ro(o.text,n,r,s));else if(o.type==="namespace_import"){let a=so(e,o,n,r,s);a&&i.push(a)}else o.type==="named_imports"&&i.push(...io(o,n,r,s));return i}function ro(e,t,n,r){return m("default",e,t,n,"default",{isTypeOnly:r})}function so(e,t,n,r,s){let o=L(t,"identifier")?.text??"";if(!o)return null;let a=lo(e,o);return oe("*",n,{localName:o,usedMembers:a,isTypeOnly:s,used:a.length>0||r.has(o)})}function io(e,t,n,r){let s=[];for(let i of e.namedChildren){if(i.type!=="import_specifier")continue;let o=i.namedChild(0),a=i.namedChild(1);if(!o)continue;let c=o.text,l=a?.text??c;s.push(m(c,l,t,n,"named",{isTypeOnly:r||co(i.text)}))}return s}function oo(e){let t=L(e,"string");if(!t)return null;let n=L(t,"string_fragment");return n?n.text:null}function ao(e){return/^\s*import\s+type\b/.test(e)}function co(e){return/^\s*type\b/.test(e.trim())}function lo(e,t){let n=new Set;for(let r of e.rootNode.descendantsOfType("member_expression")){let s=r.namedChild(0),i=r.namedChild(1);!s||!i||s.type!=="identifier"||s.text!==t||(i.type==="property_identifier"||i.type==="identifier")&&n.add(i.text)}return[...n]}function uo(e){let t=[],n=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let i=s[0],o=s[1],a=s[2];!i||!a||typeof s.index!="number"||t.push({clause:o,specifier:a,start:s.index,end:s.index+i.length})}let r=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(r)){let i=s[0],o=s[1];!i||!o||typeof s.index!="number"||t.push({clause:null,specifier:o,start:s.index,end:s.index+i.length})}return t.sort((s,i)=>s.start-i.start)}function po(e,t,n,r,s,i,o){let a=J(e,t,r),c=X(o,s,i);return n?fo(n).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let p=ye(c,u.localName);return oe(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"?ie(u.importedName,u.sourcePath):W(u.importedName,u.localName??"",u.sourcePath,u.localName?C(c,u.localName):!1,u.kind,[],{isTypeOnly:u.isTypeOnly})}):[ie("*",a)]}function fo(e){let t=e.trim(),n=/^type\b/.test(t),r=t.replace(/^type\s+/,""),[s,i]=mo(r),o=[];return s&&o.push(...Jn(s,n)),i&&o.push(...Jn(i,n)),o}function Jn(e,t){let n=e.trim();if(!n)return[];if(n.startsWith("{")){let r=n.slice(1,-1).trim();return r?E(r).map(s=>{let i=s.trim(),o=t||/^type\b/.test(i),a=i.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 mo(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 jt(e,t,n){let r=O(e,t);return r?bo(e,t,r):go(e,t,n)}function go(e,t,n){return[...yo(e,t,n),...ho(e,t,n),...So(e,t,n)]}function yo(e,t,n){let r=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of n.matchAll(s)){if(typeof i.index!="number")continue;let o=i[1]??"",a=i[2]??"",c=E(o).map(p=>xo(p.trim())).filter(p=>!!p),l=he(n,i.index),u=he(n,i.index+i[0].length-1);r.push({kind:"named",sourcePath:J(e,t,a),names:c,startLine:l,endLine:u})}return r}function ho(e,t,n){let r=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of n.matchAll(s)){if(typeof i.index!="number")continue;let o=i[2]??"",a=he(n,i.index),c=he(n,i.index+i[0].length-1);r.push({kind:"star-as",sourcePath:J(e,t,o),names:i[1]?[i[1]]:[],startLine:a,endLine:c})}return r}function So(e,t,n){let r=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of n.matchAll(s)){if(typeof i.index!="number")continue;let o=i[1]??"",a=he(n,i.index),c=he(n,i.index+i[0].length-1);r.push({kind:"star",sourcePath:J(e,t,o),names:[],startLine:a,endLine:c})}return r}function xo(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 he(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)e.charCodeAt(r)===10&&n++;return n}function bo(e,t,n){let r=[];for(let s of n.rootNode.descendantsOfType("export_statement")){let i=No(e,t,s);if(i===void 0)continue;let o=s.startPosition.row,a=s.endPosition.row,c=Io(s,i,o,a);r.push(c)}return r}function No(e,t,n){let r=L(n,"string");if(!r)return;let s=L(r,"string_fragment");if(s)return J(e,t,s.text)}function Io(e,t,n,r){let s=L(e,"export_clause");if(s){let o=[];for(let a of s.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 i=L(e,"namespace_export");if(i){let o=i.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 Kn(e,t,n){return Ke(e,t,{java:r=>_o(e,t,r),kotlin:r=>Co(e,t,r),scala:r=>Eo(e,t,r)},()=>D(n,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(r,s)=>{let i=r[1]?.trim();return i?ko(e,t,i,s):[]}),n)}function _o(e,t,n){let r=y(n,new Set(["import_declaration"])),s=[];for(let i of n.rootNode.descendantsOfType("import_declaration")){let o=i.children.some(p=>p.type==="asterisk"),c=i.namedChildren.find(p=>p.type==="scoped_identifier")??i.namedChildren.find(p=>p.type==="identifier");if(!c)continue;let l=c.text;if(o){s.push(oe("*",g(e,l,P)));continue}let u=l.split(".").pop()??l;s.push(m(u,u,g(e,l,P),r))}return s}function Co(e,t,n){let r=y(n,new Set(["import_header","import_list"])),s=[];for(let i of n.rootNode.descendantsOfType("import_header")){let o=i.namedChildren.find(f=>f.type==="identifier");if(!o)continue;let a=i.namedChildren.some(f=>f.type==="wildcard_import"),c=i.namedChildren.find(f=>f.type==="import_alias");if(a){s.push(oe("*",g(e,o.text,P)));continue}let l=o.text,u=l.split(".").pop()??l,d=c?.namedChild(0)?.text??u;s.push(m(u,d,g(e,l,P),r))}return s}function Eo(e,t,n){let r=y(n,new Set(["import_declaration"])),s=[];for(let i of n.rootNode.descendantsOfType("import_declaration")){let o=i.namedChildren.find(p=>p.type==="namespace_selectors"||p.type==="namespace_wildcard"),a=i.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"){s.push(oe("*",g(e,c,P)));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 S=d.text,ae=f?.text??S;if(S==="_")continue;s.push(m(S,ae,g(e,`${c}.${S}`,P),r))}else if(p.type==="identifier"){let d=p.text;s.push(m(d,d,g(e,`${c}.${d}`,P),r))}continue}let l=a[a.length-1]?.text??c,u=a.slice(0,-1).map(p=>p.text).join(".")||c;s.push(m(l,l,g(e,u&&a.length>1?`${u}.${l}`:c,P),r))}return s}function ko(e,t,n,r){if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/\.$/,"").trim(),i=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return E(i).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==="_"?s:`${s}.${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 Gn(e,t,n){return R(e,t,r=>Po(e,t,r),()=>D(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,s)=>{let i=r[1]?.trim();return i?E(i).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,s,u,p,d,g(e,u.replace(/\\/g,"."),se))]}):[]}),n)}function Po(e,t,n){let r=y(n,new Set(["namespace_use_declaration"])),s=[],i=(o,a,c)=>{s.push(m(a,c,g(e,o.replace(/\\/g,"."),se),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}=Xn(l,c);u&&i(d,u,p)}continue}for(let c of o.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:p}=Xn(c,"");l&&i(p,l,u)}}return s}function Xn(e,t){let n=e.namedChildren.find(l=>l.type==="qualified_name"),r=e.namedChildren.filter(l=>l.type==="name"),s="";n?s=n.text:r.length>=1&&(s=r[0].text);let i=n&&r.length>0?r[r.length-1]:null,o=s.split("\\").pop()??s,a=i?.text??o,c=t?`${t}\\${s}`:s;return{importedName:o,localName:a,qualified:c}}function Zn(e,t,n){return R(e,t,r=>Lo(e,t,r),()=>Fo(n).flatMap(r=>Ro(e,t,r,n)),n)}function Lo(e,t,n){let r=y(n,new Set(["import_statement","import_from_statement"])),s=[];for(let i of n.rootNode.descendantsOfType("import_statement"))for(let o of i.namedChildren){let a=Yn(o);if(!a)continue;let c=ge(e,t,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:r.has(a.localName),usedMembers:[]})}for(let i of n.rootNode.descendantsOfType("import_from_statement")){let o=i.namedChild(0);if(!o)continue;let a=To(o);if(a===null)continue;let c=ge(e,t,a);for(let l=1;l<i.namedChildCount;l+=1){let u=i.namedChild(l);if(u.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let p=Yn(u);p&&s.push({importedName:p.qualifiedName,localName:p.localName,sourcePath:c,kind:"named",used:r.has(p.localName),usedMembers:[]})}}return s}function Yn(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 To(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let t=L(e,"import_prefix")?.text??"",n=L(e,"dotted_name")?.text??"";return`${t}${n}`}return null}function Fo(e){let t=e.split(`
16
- `),n=[],r=0;for(let s=0;s<t.length;s++){let i=t[s],o=i.trimStart(),a=r;if(r+=i.length+1,!o.startsWith("import ")&&!o.startsWith("from "))continue;let c=i,l=a+i.length,u=Tt(i);for(;s+1<t.length&&(u>0||c.trimEnd().endsWith("\\"));){s++;let d=t[s];c+=`
17
- ${d}`,l+=1+d.length,u+=Tt(d),r+=d.length+1}let p=Do(c);p&&n.push({...p,start:a,end:l})}return n}function Do(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 Ro(e,t,n,r){let s=X(r,n.start,n.end),i=n.clause.replace(/\n/g," ").trim();if(n.kind==="import")return E(i).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(),S=ge(e,t,d),ae=ye(s,f);return[{importedName:d,localName:f,sourcePath:S,kind:"namespace",used:C(s,f)||ae.length>0,usedMembers:ae}]});let o=n.module?ge(e,t,n.module):null,a=[];for(let c of E(i)){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(s,d),usedMembers:[]})}return a}import{basename as vo}from"path";function er(e,t,n){return R(e,t,r=>Ao(e,t,r),()=>wo(e,t,n),n)}function wo(e,t,n){return D(n,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(r,s)=>{let i=r[1],o=r[2];if(!i||!o)return[];let a=i==="require_relative"?ze(e,t,o):null;if(a){let c=tr(o);return[W(c,c,a,C(s,c))]}return[ie(o,a)]})}function Ao(e,t,n){let r=y(n,new Set([])),s=[],i=new Set(["require","require_relative","load"]);for(let o of n.rootNode.descendantsOfType("call")){let a=o.namedChild(0);if(!a||a.type!=="identifier"||!i.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"?ze(e,t,p):null;if(d){let f=tr(p);s.push(m(f,f,d,r))}else s.push(ie(p,d))}return s}function tr(e){return Fn(vo(e).replace(/\.[^.]+$/,""),/_/)}function nr(e,t,n){return R(e,t,r=>jo(e,t,r),()=>D(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,s)=>{let i=r[1]?.trim();return i?Oo(e,t,i,s):[]}),n)}function jo(e,t,n){let r=y(n,new Set(["use_declaration"])),s=[];for(let i of n.rootNode.descendantsOfType("use_declaration")){let o=i.namedChild(0);if(o)for(let a of Le(o,"")){if(!a.importedName||a.importedName==="*")continue;let c=B(e,t,a.qualifiedName)??B(e,t,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(m(a.importedName,a.localName,c,r))}}return s}function Le(e,t){switch(e.type){case"identifier":case"super":case"crate":{let n=e.text;return[{qualifiedName:Ye(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:Ye(t,n),importedName:r,localName:r}]}case"scoped_use_list":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let s=Ye(t,n.text),i=[];for(let o of r.namedChildren)i.push(...Le(o,s));return i}case"use_list":{let n=[];for(let r of e.namedChildren)n.push(...Le(r,t));return n}case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let s=Le(n,t),i=r.text;return s.map(o=>({...o,localName:i}))}case"use_wildcard":{let n=e.namedChild(0),r=n?n.text:"";return[{qualifiedName:Ye(t,`${r}::*`),importedName:"*",localName:"*"}]}default:return[]}}function Ye(e,t){return e?t?`${e}::${t}`:e:t}function Oo(e,t,n,r){let s=n.trim();if(s.includes("{")&&s.includes("}")){let u=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),p=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return E(p).flatMap(d=>{let f=d.trim();if(!f)return[];if(f==="self"){let nt=u.split("::").filter(Boolean).pop();return nt?[w(e,t,r,u,nt,nt)]:[]}let[S,ae]=f.split(/\s+as\s+/),ce=S?.trim();if(!ce)return[];let Nr=(ae??ce.split("::").pop()??ce).trim(),Ir=`${u}::${ce}`.replace(/::::/g,"::");return[w(e,t,r,Ir,ce.split("::").pop()??ce,Nr,B(e,t,u))]})}let[i,o]=s.split(/\s+as\s+/),a=i?.trim()??s,c=(o??a.split("::").pop()??a).trim(),l=B(e,t,a)??B(e,t,a.split("::").slice(0,-1).join("::"));return[w(e,t,r,a,a.split("::").pop()??a,c,l)]}function rr(e,t,n){let r=O(e,t);if(r)return Mo(e,t,r);let s=[];for(let i of n.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let o=i[1]?.trim();o&&s.push(...Bo(e,t,o))}return s}function Mo(e,t,n){let r=[];for(let s of n.rootNode.descendantsOfType("use_declaration")){if(!$o(s))continue;let i=s.namedChildren.find(o=>o.type!=="visibility_modifier");if(i)for(let o of Le(i,""))o.importedName&&r.push(Ot(e,t,o.qualifiedName))}return r}function $o(e){for(let t of e.children)if(t.type==="visibility_modifier"&&t.text.startsWith("pub"))return!0;return!1}function Bo(e,t,n){let r=n.trim();if(r.includes("{")&&r.includes("}")){let s=r.slice(0,r.indexOf("{")).replace(/::$/,"").trim(),i=r.slice(r.indexOf("{")+1,r.lastIndexOf("}")).trim();return E(i).flatMap(o=>{let a=o.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[Ot(e,t,l)]})}return[Ot(e,t,r)]}function Ot(e,t,n){return{specifier:n,sourcePath:B(e,t,n)??B(e,t,n.split("::").slice(0,-1).join("::"))}}function G({language:e,extensions:t,imports:n,parseImports:r}){return{language:e,extensions:t,capabilities:{imports:n},parseImports:r}}function sr(e,t){let n=t.toLowerCase();for(let r of e)for(let s of r.extensions)if(n.endsWith(s))return r;return null}var Vo={language:"javascript",extensions:ne,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:At,parseReExports:jt},Wo=G({language:"python",extensions:Be,imports:"ast-with-regex-fallback",parseImports:Zn}),Uo=G({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:Kn}),Ho={language:"rust",extensions:Ve,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:nr,parseExports:rr},zo=G({language:"ruby",extensions:We,imports:"ast-with-regex-fallback",parseImports:er}),qo=G({language:"c/cpp",extensions:Ue,imports:"ast-with-regex-fallback",parseImports:Vn}),Qo=G({language:"dotnet",extensions:Q,imports:"ast-dispatch-with-regex-fallback",parseImports:qn}),Jo={language:"dart",extensions:He,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:Hn,parseExports:zn},Ko=G({language:"php",extensions:se,imports:"ast-with-regex-fallback",parseImports:Gn}),Xo=G({language:"clojure",extensions:me,imports:"regex-only",parseImports:Un}),Go=[Vo,Wo,Uo,Ho,zo,qo,Qo,Jo,Ko,Xo];function Ze(e){return sr(Go,e)}var Mt={clearGroups:["whole-project","source-file"]},Yo=b("source-imports",Mt),zu=b("source-exports",Mt),Zo=b("source-reexports",Mt),ir=Y({kind:"source-imports",invalidation:Z("source-imports"),serialize:ea,deserialize:ta}),or=Y({kind:"source-reexports",invalidation:Z("source-reexports"),serialize:na,deserialize:ra});function ar(e,t){let n=x(t);return Zo.get(e,n,()=>{let r=Ze(n);if(!r?.parseReExports)return[];let s=N(e,n);if(!s)return[];let i=U(e,n,s),o=Lt(e),a=or.read(e,n,i);if(a?.resolutionFingerprint===o)return a.reExports;let c=r.parseReExports(e,n,s);return or.write(e,n,i,{resolutionFingerprint:o,reExports:c}),c})}function $t(e,t){let n=x(t);return Yo.get(e,n,()=>{let r=Ze(n);if(!r)return[];let s=N(e,n);return s?cr(e,n,s,r):[]})}function qu(e,t){let n=x(t),r=Ze(n);if(!r)return[];let s;try{s=Fe(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(i){if(De(i))return[];throw i}return cr(e,n,s,r)}function cr(e,t,n,r){let s=U(e,t,n),i=Lt(e),o=ir.read(e,t,s);if(o?.resolutionFingerprint===i)return o.imports;let a=r.parseImports(e,t,n);return ir.write(e,t,s,{parserVersion:2,resolutionFingerprint:i,imports:a}),a}function Qu(e,t,n){let r=$t(e,t).filter(s=>s.kind==="named"&&s.isTypeOnly!==!0&&s.localName===n&&s.sourcePath!==null);return r.length===1?r[0]:null}function ea(e){return JSON.stringify(e)}function ta(e){try{let t=JSON.parse(e);return!pe(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 na(e){return JSON.stringify(e)}function ra(e){try{let t=JSON.parse(e);return!pe(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.reExports)?null:{resolutionFingerprint:t.resolutionFingerprint,reExports:t.reExports}}catch{return null}}function Ku(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
18
- FROM global_symbols gs
19
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
20
- JOIN documents d ON der.document_id = d.id
21
- WHERE ${t.where}
22
- ${e.pathExclusionsFor("d")}
23
- ${ur(t.orderBy)}
24
- ${pr(t.limit)}`,...t.params??[])}function Xu(e,t){return e.all(`SELECT
25
- gs.id,
26
- gs.symbol,
27
- c.document_id,
28
- MIN(c.start_line) AS start_line,
29
- 0 AS start_char,
30
- MAX(c.end_line) AS end_line,
31
- 0 AS end_char,
32
- d.relative_path,
33
- gs.display_name,
34
- gs.documentation
35
- FROM global_symbols gs
36
- JOIN mentions m ON m.symbol_id = gs.id
37
- JOIN chunks c ON m.chunk_id = c.id
38
- JOIN documents d ON c.document_id = d.id
39
- WHERE m.role = 1
40
- AND ${t.where}
41
- ${e.pathExclusionsFor("d")}
42
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
43
- ${ur(t.orderBy)}
44
- ${pr(t.limit)}`,...t.params??[])}function ur(e){return e?`ORDER BY ${e}`:""}function pr(e){return typeof e=="number"?`LIMIT ${e}`:""}function dr(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 fr(e){if(!e)return null;let t=lr(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(lr(r)??r).replace(/\n/g," ")}function lr(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function et(e){return{forFile(t,n){return mr(e,t,n)},forFiles(t,n){let r=new Map;for(let s of t)r.set(s,mr(e,s,n));return r}}}function mr(e,t,n){let r={file:t},s=n.facts||n.identifiers;if(n.text&&(r.text=N(e,t)),n.lines&&(r.lines=at(e,t)),n.ast&&(r.ast=O(e,t)),n.imports&&(r.imports=$t(e,t)),n.reexports&&(r.reexports=ar(e,t)),s){let i=mt(e,t),o=i.facts;n.facts&&(r.facts=o),i.unavailable&&(r.sourceFactsUnavailable=i.unavailable),n.identifiers&&o&&(r.identifiers=o.fileIdentifiers,r.identifierLineMap=o.identifierLineMap)}return r}function sa(e,t={}){if(H(e.symbol)!==null)return t.includeClassMemberFallbacks===!0;let s=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(s)}function Bt(e,t,n={}){let r=new Map;for(let i of t)e.length>0&&!sa(i,{includeClassMemberFallbacks:n.includeClassMemberFallbacks})||r.set(i.id,i);for(let i of e)r.set(i.id,i);let s=[...r.values()];return n.sort?s.sort((i,o)=>i.start_line-o.start_line||i.end_line-o.end_line||i.symbol.localeCompare(o.symbol)):s}var ia=b("file-definitions",{clearGroups:["definition-catalog"]}),oa=le("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),aa=b("file-function-like-definitions",{clearGroups:["definition-catalog"]}),gr=new WeakMap;function Wt(e,t,n={},r){return n.includeClassMemberFallbacks?Vt(e,t,void 0,{includeClassMemberFallbacks:!0},r):ia.get(e,t,()=>{let s=j(r,"evidence-read",()=>xr(e,t));if(s)return s;let i=Vt(e,t,void 0,n,r);return j(r,"evidence-write",()=>{let o=Se(e),a=et(e).forFile(t,{text:!0}).text;o&&a&&Sr.write(e,t,U(e,t,a),{projectFingerprint:o,definitions:i.map(c=>({...c}))})}),i})}function ca(e,t){return aa.get(e,t,()=>{let n=xr(e,t);return n?n.filter(r=>r.isFunctionLike):Vt(e,t,r=>r.isFunctionLike)})}var Sr=Y({kind:"file-definitions",invalidation:Z("file-definitions"),serialize:la,deserialize:ua});function xr(e,t){let n=Se(e);if(!n)return null;let r=et(e).forFile(t,{text:!0}).text;if(!r)return null;let s=Sr.read(e,t,U(e,t,r));return s?pa(s,n,t):null}function la(e){return JSON.stringify(e)}function ua(e){try{let t=JSON.parse(e);return!pe(t)||typeof t.projectFingerprint!="string"||!Array.isArray(t.definitions)?null:{projectFingerprint:t.projectFingerprint,definitions:t.definitions}}catch{return null}}function pa(e,t,n){if(e.projectFingerprint!==t)return null;let r=[];for(let s of e.definitions){let i=da(s,n);if(!i)return null;r.push(i)}return r}function da(e,t){return!pe(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 Vt(e,t,n,r={},s){let i=j(s,"primary-rows",()=>fa(e,t)),o=j(s,"fallback-rows",()=>ma(e,t)),a=j(s,"merge-rows",()=>Bt(i,o,{sort:!0,includeClassMemberFallbacks:r.includeClassMemberFallbacks}).map(Ut));return n&&(a=a.filter(n)),j(s,"range-correction",()=>Ht(e,t,a,s,r.rangeCorrectionEvidence))}function j(e,t,n){return e?e(t,n):n()}function fa(e,t){return e.all(`SELECT
45
- gs.id,
46
- gs.symbol,
47
- der.document_id,
48
- der.start_line,
49
- der.start_char,
50
- der.end_line,
51
- der.end_char,
52
- d.relative_path,
53
- gs.display_name,
54
- gs.kind,
55
- gs.documentation,
56
- gs.enclosing_symbol
57
- FROM global_symbols gs
58
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
59
- JOIN documents d ON der.document_id = d.id
60
- WHERE d.relative_path = ?
61
- ${e.symbolNoiseFor("gs")}
62
- ORDER BY der.start_line, der.end_line`,t)}function ma(e,t){return e.all(`SELECT
63
- gs.id,
64
- gs.symbol,
65
- c.document_id,
66
- MIN(c.start_line) AS start_line,
67
- 0 AS start_char,
68
- MAX(c.end_line) AS end_line,
69
- 0 AS end_char,
70
- d.relative_path,
71
- gs.display_name,
72
- gs.kind,
73
- gs.documentation,
74
- gs.enclosing_symbol
75
- FROM global_symbols gs
76
- JOIN mentions m ON m.symbol_id = gs.id
77
- JOIN chunks c ON m.chunk_id = c.id
78
- JOIN documents d ON c.document_id = d.id
79
- WHERE d.relative_path = ?
80
- AND m.role = 1
81
- ${e.symbolNoiseFor("gs")}
82
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
83
- ORDER BY start_line, end_line`,t)}function Ut(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:en(e.symbol),parentTypeName:H(e.symbol),isFunctionLike:ot(e.symbol),isTypeLike:Re(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function hp(e,t={}){return ga(e,t.scope)}function ga(e,t){return xe(e,{scope:t,includeIgnored:!1}).flatMap(n=>Wt(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function Sp(e,t){return xe(e,{scope:t,includeIgnored:!1}).flatMap(n=>ca(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function xp(e,t){let n=oa.get(e,()=>new WeakMap),r=n.get(t.symbolMatches);r||(r=new Map,n.set(t.symbolMatches,r));let s=JSON.stringify({scope:t.scope??null,sqlPrefilter:t.sqlPrefilter??null}),i=r.get(s);if(i)return[...i];let o=yr(ya(e,t.scope,t.sqlPrefilter)),a=yr(ha(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=Bt(o.get(u)??[],a.get(u)??[],{sort:!0}).filter(d=>t.symbolMatches(d.symbol));p.length!==0&&l.push(...Ht(e,u,p.map(Ut)))}return r.set(s,l),[...l]}function ya(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",s=n?`AND ${br("gs",n)}`:"",i=t?[`%${t}%`]:[];return e.all(`SELECT
84
- gs.id,
85
- gs.symbol,
86
- der.document_id,
87
- der.start_line,
88
- der.start_char,
89
- der.end_line,
90
- der.end_char,
91
- d.relative_path,
92
- gs.display_name,
93
- gs.kind,
94
- gs.documentation,
95
- gs.enclosing_symbol
96
- FROM global_symbols gs
97
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
98
- JOIN documents d ON der.document_id = d.id
99
- WHERE 1 = 1
100
- ${e.pathExclusionsFor("d")}
101
- ${r}
102
- ${s}
103
- ${e.symbolNoiseFor("gs")}
104
- ORDER BY d.relative_path, der.start_line, der.end_line`,...i)}function ha(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",s=n?`AND ${br("gs",n)}`:"",i=t?[`%${t}%`]:[];return e.all(`SELECT
105
- gs.id,
106
- gs.symbol,
107
- c.document_id,
108
- MIN(c.start_line) AS start_line,
109
- 0 AS start_char,
110
- MAX(c.end_line) AS end_line,
111
- 0 AS end_char,
112
- d.relative_path,
113
- gs.display_name,
114
- gs.kind,
115
- gs.documentation,
116
- gs.enclosing_symbol
117
- FROM global_symbols gs
118
- JOIN mentions m ON m.symbol_id = gs.id
119
- JOIN chunks c ON m.chunk_id = c.id
120
- JOIN documents d ON c.document_id = d.id
121
- WHERE m.role = 1
122
- AND NOT EXISTS (
123
- SELECT 1
124
- FROM defn_enclosing_ranges existing_der
125
- WHERE existing_der.symbol_id = gs.id
126
- )
127
- ${e.pathExclusionsFor("d")}
128
- ${r}
129
- ${s}
130
- ${e.symbolNoiseFor("gs")}
131
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
132
- ORDER BY d.relative_path, start_line, end_line`,...i)}function Sa(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function br(e,t){return t==="callable"?Sa(e):xa(e)}function xa(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function yr(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 bp(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(s=>Wt(e,s)).filter(s=>!e.isIgnored(s.relativePath));return n.onlyDocumented&&(r=r.filter(s=>s.documentation!==null&&s.documentation!=="")),n.sort&&(r=r.sort((s,i)=>s.relativePath.localeCompare(i.relativePath)||s.startLine-i.startLine||s.endLine-i.endLine)),r.map(s=>({startLine:s.startLine,endLine:s.endLine,symbol:s.symbol,shortName:Zt(s.symbol),signature:dr(fr(s.documentation)),relativePath:s.relativePath,enclosingSymbol:s.enclosingSymbol}))}function ba(e){let t=new Map,n=e.map((r,s)=>({definition:r,index:s,span:r.endLine-r.startLine})).sort((r,s)=>r.span-s.span||r.index-s.index);for(let{definition:r}of n)for(let s=r.startLine;s<=r.endLine;s+=1)t.has(s)||t.set(s,r);return t}function Np(e,t){let n=gr.get(e);return n||(n=ba(e),gr.set(e,n)),n.get(t)??null}function Ip(e,t){let n=Wt(e,t.relative_path).find(r=>r.symbolId===t.id)??(H(t.symbol)===null||!ot(t.symbol)?void 0:Ht(e,t.relative_path,[Ut(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 Ht(e,t,n,r,s){let i=j(r,"range-correction.source-text",()=>s?s.source:et(e).forFile(t,{text:!0}).text),o=j(r,"range-correction.callable-sites",()=>s?s.callables:ht(e,t));return o?j(r,"range-correction.ast-correction",()=>ka(n,o,i)):i?j(r,"range-correction.regex-fallback",()=>Na(n,i)):n}function Na(e,t){let n=t.split(/\r?\n/),r=Ia(e,n),s=_a(e,r),i=Ca(s,n);return Ea(e,i)}function Ia(e,t){let n=e.some(s=>tt(s.symbol))?va(t):null,r=new Map;for(let s of e)r.set(s.symbolId,Ra(t,n,s));return r}function _a(e,t){return e.filter(n=>tt(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,r)=>n.startLine-r.startLine||n.definition.startLine-r.definition.startLine||n.definition.symbol.localeCompare(r.definition.symbol))}function Ca(e,t){let n=new Map;for(let r=0;r<e.length;r+=1){let s=e[r],i=e[r+1],o=i?Math.max(s.startLine,i.startLine-1):t.length-1;n.set(s.definition.symbolId,{startLine:s.startLine,endLine:wa(t,s.definition,s.startLine,o)})}return n}function Ea(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function ka(e,t,n=null){let r=new Map;for(let s of t){let i=r.get(s.name);i?i.push(s):r.set(s.name,[s])}return e.map(s=>{if(!Da(s)||!s.leaf)return hr(s,n);let i=r.get(s.leaf);if(!i||i.length===0)return hr(s,n);let o=n?Pa(s,i,n):null;if(o)return{...s,startLine:o.startLine,endLine:o.endLine};let a=i[0],c=Math.abs(a.startLine-s.startLine);for(let l=1;l<i.length;l+=1){let u=i[l],p=Math.abs(u.startLine-s.startLine);p<c&&(a=u,c=p)}return{...s,startLine:a.startLine,endLine:a.endLine}})}function Pa(e,t,n){let r=La(e.symbol);if(!r)return null;let s=n.split(/\r?\n/),i=new RegExp(`\\b${A(r)}\\b`);for(let o of t){let a=Ta(s,o.startLine);if(a&&i.test(a))return o}return null}function La(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Ta(e,t){for(let n=t;n>=0;n-=1){let r=e[n]?.trim()??"";if(r){if(/^impl\b/.test(r))return Fa(e,n,t);if(/^(?:struct|enum|trait|mod)\b/.test(r))return null}}return null}function Fa(e,t,n){let r=[];for(let s=t;s<=n;s+=1){let i=e[s]??"";if(r.push(i),i.includes("{"))break}return r.join(" ")}function Da(e){return tt(e.symbol)?!0:Re(e.symbol)==="term"&&H(e.symbol)===null}function hr(e,t){if(!t||!e.leaf||Re(e.symbol)!=="term"||H(e.symbol)!==null)return e;let n=A(e.leaf),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),i=t.split(/\r?\n/).findIndex(o=>r.test(o));return i>=0?{...e,startLine:i,endLine:i}:e}function Ra(e,t,n){if(!tt(n.symbol))return n.startLine;let r=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return r;let s=t.get(n.leaf);if(!s||s.length===0)return r;let i=null;for(let o of s){let a=Math.abs(o-n.startLine);(!i||a<i.distance)&&(i={line:o,distance:a})}return i?.line??r}function va(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*\(/,s=/\b([A-Za-z_$][\w$]*)\s*\(/g,i=new Map,o=(a,c)=>{let l=i.get(a);if(!l){i.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(s))u[1]&&o(u[1],a)}return i}function wa(e,t,n,r){let s=Math.max(n,Math.min(e.length-1,r)),i=Math.max(n,Math.min(s,t.endLine)),o=0,a=0,c=!1;for(let l=n;l<=s;l+=1){let u=Aa(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>=i)return l}return i}function Aa(e){let t="",n=null,r=!1;for(let s=0;s<e.length;s+=1){let i=e[s],o=e[s+1];if(!n&&i==="/"&&o==="/"){t+=" ".repeat(e.length-s);break}if(n){if(r){r=!1,t+=" ";continue}if(i==="\\"){r=!0,t+=" ";continue}i===n&&(n=null),t+=" ";continue}if(i==='"'||i==="'"||i==="`"){n=i,t+=" ";continue}t+=i}return t}function tt(e){return e.includes("().")}export{Y as a,Qa as b,Z as c,Dn as d,Ws as e,J as f,N as g,Er as h,Ma as i,at as j,$a as k,A as l,Ti as m,z as n,q as o,gt as p,Ls as q,Ln as r,Ts as s,yt as t,Fs as u,O as v,Ie as w,ee as x,fc as y,de as z,ht as A,Rs as B,vs as C,Li as D,Ye as E,ar as F,$t as G,qu as H,Qu as I,et as J,Ku as K,Xu as L,dr as M,fr as N,Bt as O,Wt as P,hp as Q,ga as R,Sp as S,xp as T,bp as U,ba as V,Np as W,Ip as X};
133
- //# sourceMappingURL=chunk-NP4JFCLE.js.map