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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{Mb as q,Nb as N,Ob as ot,Pb as V,Rb as at,lc as it,nc as U,sc as L,tc as B}from"./chunk-Z67JOKRE.js";import{Aa as I,Ed as j,u as A,ud as et,ue as st,vd as nt,wd as rt,xd as z}from"./chunk-VRJG7N3I.js";import{createHash as T,randomBytes as lt}from"crypto";import{chmodSync as Wt,closeSync as x,fstatSync as ct,lstatSync as Xt,mkdirSync as yt,openSync as W,readSync as Yt,readdirSync as Ot,renameSync as wt,rmSync as X,statSync as Qt,writeSync as St}from"fs";import{tmpdir as Zt}from"os";import{dirname as Kt,join as _,resolve as te}from"path";import{StringDecoder as Y}from"string_decoder";import{InvalidArgumentError as pt}from"commander";var Gt=/^[A-Za-z0-9_@%+=:,./-]+$/u;function ut(t,e={}){return e.omitSafeQuotes&&Gt.test(t)?t:(e.platform??process.platform)==="win32"?`"${t.replaceAll("%","%%").replaceAll('"','\\"')}"`:`'${t.replaceAll("'",`'"'"'`)}'`}var vt="scip-query-output-page",bt=1,ee="continue",S=256,E=1e5,$=4096,l=32e6,Ct=64*1024*1024,ne=256*1024*1024,re=32,Pt=32768,It=16,se=V*It,R=4096,ht=Ct,Et=3600*1e3,oe="scip-query-json-export",ae=1,Tt=3;function xt(){return _(Zt(),`scip-query-output-pages-${typeof process.getuid=="function"?process.getuid():"user"}`)}var Q=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u,_t=/^[A-Za-z0-9_][A-Za-z0-9_-]{11}$/u,ie=/^4\.([A-Za-z0-9_-]{22})\.([0-9a-z]{1,10})$/u,ue=/^([A-Za-z0-9_][A-Za-z0-9_-]{11})(?:\.([0-9a-z]{1,10}))?$/u,At=1,ce="quota.lock",pe=2e3,he=5,dt=1024*1024,de=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)),D,ge=Object.freeze({maxSnapshotBytes:Ct,maxAggregateBytes:ne,maxSnapshotCount:re});var Nt={writeStdout:t=>{process.stdout.write(t)},writeStderr:t=>{process.stderr.write(t)}};async function fe(t,e,n=Nt){return it({command:t.command,cwd:t.cwd,argv:t.argv,json:t.json,sessionEnabled:t.sourceSession,reemit:t.reemitSource},async()=>{try{await me(t,e,n)}finally{U(!1)}})}async function me(t,e,n){let s=t.pageSize??q,r=t.snapshotRoot??xt(),a=Pe(t.snapshotLimits),o=t.maxOutputCharacters??l;if(!Number.isSafeInteger(o)||o<=0)throw new Error("Output character safety limit must be a positive integer.");let i=Math.min(o,l,t.agentOutput?se:l);if(Ut(s),t.cursor!==void 0&&t.cursor.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit. Run the command again without --output-cursor.`);if(t.jsonOutputPath!==void 0){if(!t.json)throw new Error("--json-output requires --json.");if(t.agentOutput||t.pageSize!==void 0||t.cursor!==void 0)throw new Error("--json-output cannot be combined with --agent-output or output pagination.");t.command==="system-map"&&B(t.cwd,t.sourceSession!==!1),await le(t,e,n,i);return}if(t.json&&!t.agentOutput&&t.pageSize===void 0&&t.cursor===void 0){t.command==="system-map"&&B(t.cwd,t.sourceSession!==!1),await Oe(t,e,n);return}let p=jt(t.argv),h=Dt(t.invocationPrefix),d=zt(t.command,t.cwd,h,p),g=t.cursor===void 0?void 0:Re(t.cursor,d);t.command==="system-map"&&!g&&B(t.cwd,t.sourceSession!==!1);let c=g?.snapshotId,u;if(g)try{u=Se(g,d,s,i,r,t.onSnapshotRead)}catch(y){let M=y instanceof Error?y.message:String(y);throw new Error(`${M} Restart with: ${qt(h,p,s)}`,{cause:y})}else{let y=new F(d,h,t.command,t.cwd,p,s,i,Le(t,h),r,a,t.agentOutput?It:Pt,!t.json,Z(i,t.agentOutput===!0)),M=Lt(k=>y.write(k)),tt=!1;try{await e(),tt=!0}finally{M(),tt||y.abort()}let P;try{P=y.complete()}catch(k){throw y.abort(),k}c=P.snapshotId,u={content:P.content,offset:0,pageIndex:0,pageCount:P.pageCount,totalCharacters:P.totalCharacters,outputHash:P.outputHash}}let w=u.offset+u.content.length,f=u.pageIndex+1>=u.pageCount,m=f?void 0:Ue({invocationPrefix:h,nextPageIndex:u.pageIndex+1,snapshotId:Ae(c)});if(L(t.command,t.cwd,f,t.sourceSession!==!1,m?.command),u.offset===0&&f&&t.cursor===void 0){n.writeStdout(u.content),U(!0),c&&b(c,r);return}let C={kind:vt,schemaVersion:bt,producer:{name:"scip-query",version:t.producerVersion},command:t.command,contentType:t.json?"application/json":"text/plain",agentInstruction:m?"INCOMPLETE EVIDENCE: do not draw conclusions or report completion from this partial page. Run page.continuation.command exactly, then repeat until page.complete is true.":"OUTPUT COMPLETE: all rendered characters have been retrieved. Evaluate the command result's own coverage separately.",page:m?{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!1,outputHash:u.outputHash,continuation:m}:{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!0,outputHash:u.outputHash},content:u.content};if(t.json){n.writeStdout(`${JSON.stringify(C)}
2
+ import{Mb as q,Nb as N,Ob as ot,Pb as V,Rb as at,lc as it,nc as U,sc as L,tc as B}from"./chunk-V4NG5OMS.js";import{Ad as z,Ca as I,Hd as j,u as A,xd as et,xe as st,yd as nt,zd as rt}from"./chunk-2BTJALUS.js";import{createHash as T,randomBytes as lt}from"crypto";import{chmodSync as Wt,closeSync as x,fstatSync as ct,lstatSync as Xt,mkdirSync as yt,openSync as W,readSync as Yt,readdirSync as Ot,renameSync as wt,rmSync as X,statSync as Qt,writeSync as St}from"fs";import{tmpdir as Zt}from"os";import{dirname as Kt,join as _,resolve as te}from"path";import{StringDecoder as Y}from"string_decoder";import{InvalidArgumentError as pt}from"commander";var Gt=/^[A-Za-z0-9_@%+=:,./-]+$/u;function ut(t,e={}){return e.omitSafeQuotes&&Gt.test(t)?t:(e.platform??process.platform)==="win32"?`"${t.replaceAll("%","%%").replaceAll('"','\\"')}"`:`'${t.replaceAll("'",`'"'"'`)}'`}var vt="scip-query-output-page",bt=1,ee="continue",S=256,E=1e5,$=4096,l=32e6,Ct=64*1024*1024,ne=256*1024*1024,re=32,Pt=32768,It=16,se=V*It,R=4096,ht=Ct,Et=3600*1e3,oe="scip-query-json-export",ae=1,Tt=3;function xt(){return _(Zt(),`scip-query-output-pages-${typeof process.getuid=="function"?process.getuid():"user"}`)}var Q=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u,_t=/^[A-Za-z0-9_][A-Za-z0-9_-]{11}$/u,ie=/^4\.([A-Za-z0-9_-]{22})\.([0-9a-z]{1,10})$/u,ue=/^([A-Za-z0-9_][A-Za-z0-9_-]{11})(?:\.([0-9a-z]{1,10}))?$/u,At=1,ce="quota.lock",pe=2e3,he=5,dt=1024*1024,de=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)),D,ge=Object.freeze({maxSnapshotBytes:Ct,maxAggregateBytes:ne,maxSnapshotCount:re});var Nt={writeStdout:t=>{process.stdout.write(t)},writeStderr:t=>{process.stderr.write(t)}};async function fe(t,e,n=Nt){return it({command:t.command,cwd:t.cwd,argv:t.argv,json:t.json,sessionEnabled:t.sourceSession,reemit:t.reemitSource},async()=>{try{await me(t,e,n)}finally{U(!1)}})}async function me(t,e,n){let s=t.pageSize??q,r=t.snapshotRoot??xt(),a=Pe(t.snapshotLimits),o=t.maxOutputCharacters??l;if(!Number.isSafeInteger(o)||o<=0)throw new Error("Output character safety limit must be a positive integer.");let i=Math.min(o,l,t.agentOutput?se:l);if(Ut(s),t.cursor!==void 0&&t.cursor.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit. Run the command again without --output-cursor.`);if(t.jsonOutputPath!==void 0){if(!t.json)throw new Error("--json-output requires --json.");if(t.agentOutput||t.pageSize!==void 0||t.cursor!==void 0)throw new Error("--json-output cannot be combined with --agent-output or output pagination.");t.command==="system-map"&&B(t.cwd,t.sourceSession!==!1),await le(t,e,n,i);return}if(t.json&&!t.agentOutput&&t.pageSize===void 0&&t.cursor===void 0){t.command==="system-map"&&B(t.cwd,t.sourceSession!==!1),await Oe(t,e,n);return}let p=jt(t.argv),h=Dt(t.invocationPrefix),d=zt(t.command,t.cwd,h,p),g=t.cursor===void 0?void 0:Re(t.cursor,d);t.command==="system-map"&&!g&&B(t.cwd,t.sourceSession!==!1);let c=g?.snapshotId,u;if(g)try{u=Se(g,d,s,i,r,t.onSnapshotRead)}catch(y){let M=y instanceof Error?y.message:String(y);throw new Error(`${M} Restart with: ${qt(h,p,s)}`,{cause:y})}else{let y=new F(d,h,t.command,t.cwd,p,s,i,Le(t,h),r,a,t.agentOutput?It:Pt,!t.json,Z(i,t.agentOutput===!0)),M=Lt(k=>y.write(k)),tt=!1;try{await e(),tt=!0}finally{M(),tt||y.abort()}let P;try{P=y.complete()}catch(k){throw y.abort(),k}c=P.snapshotId,u={content:P.content,offset:0,pageIndex:0,pageCount:P.pageCount,totalCharacters:P.totalCharacters,outputHash:P.outputHash}}let w=u.offset+u.content.length,f=u.pageIndex+1>=u.pageCount,m=f?void 0:Ue({invocationPrefix:h,nextPageIndex:u.pageIndex+1,snapshotId:Ae(c)});if(L(t.command,t.cwd,f,t.sourceSession!==!1,m?.command),u.offset===0&&f&&t.cursor===void 0){n.writeStdout(u.content),U(!0),c&&b(c,r);return}let C={kind:vt,schemaVersion:bt,producer:{name:"scip-query",version:t.producerVersion},command:t.command,contentType:t.json?"application/json":"text/plain",agentInstruction:m?"INCOMPLETE EVIDENCE: do not draw conclusions or report completion from this partial page. Run page.continuation.command exactly, then repeat until page.complete is true.":"OUTPUT COMPLETE: all rendered characters have been retrieved. Evaluate the command result's own coverage separately.",page:m?{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!1,outputHash:u.outputHash,continuation:m}:{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!0,outputHash:u.outputHash},content:u.content};if(t.json){n.writeStdout(`${JSON.stringify(C)}
3
3
  `),f&&c&&b(c,r);return}n.writeStdout(je(C)),f&&c&&b(c,r)}async function un(t,e,n=xt(),s=Nt){if(t.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit.`);let r=kt(t);if(!r)throw new Error("Invalid output cursor. Run the original command again.");let a=Rt(r.snapshotId,n);await fe({command:a.command,producerVersion:e,invocationPrefix:a.invocationPrefix,argv:[...a.argv,"--output-page-size",String(a.pageSize),"--output-cursor",t],cwd:a.cwd,json:a.argv.some(o=>o==="--json"||o.startsWith("--json=")),sourceSession:!a.argv.some(o=>o==="--no-session"),agentOutput:a.argv.some(o=>o==="--agent-output"),pageSize:a.pageSize,cursor:t,snapshotRoot:n},()=>{throw new Error("Output continuation attempted to rerun the original command.")},s)}async function le(t,e,n,s){let r=t.jsonOutputPath;if(r===void 0||r.length===0||Buffer.byteLength(r)>R||r.includes("\0"))throw new Error(`--json-output requires a path from 1 through ${R} UTF-8 bytes.`);let a=te(t.cwd,r);if(Buffer.byteLength(a)>R)throw new Error(`The resolved --json-output path exceeds ${R} UTF-8 bytes.`);let o=new Y("utf8"),i=T("sha256"),p=0,h=0,d=m=>{if(h+=m.length,!Number.isSafeInteger(h)||h>s)throw new Error(Z(s,!1))};yt(Kt(a),{recursive:!0});let g=`${a}.tmp-${lt(12).toString("hex")}`,c=W(g,"wx",384),u=!0,w=Lt(m=>{let C=p+m.length;if(!Number.isSafeInteger(C)||C>ht)throw new Error(`JSON export exceeds the ${ht}-byte file safety limit. Narrow the query before retrying.`);if(d(o.write(m)),c===void 0)throw new Error("JSON export writer is closed.");ye(c,m),i.update(m),p=C});try{await e(),d(o.end()),w(),x(c),c=void 0,wt(g,a),u=!1}finally{if(w(),c!==void 0)try{x(c)}catch{}u&&X(g,{force:!0})}let f={kind:oe,schemaVersion:ae,producer:{name:"scip-query",version:t.producerVersion},command:t.command,path:a,bytes:p,sha256:i.digest("hex")};n.writeStdout(`${JSON.stringify(f)}
4
4
  `),L(t.command,t.cwd,!0,t.sourceSession!==!1),U(!0)}function ye(t,e){let n=0;for(;n<e.length;){let s=St(t,e,n,e.length-n);if(s<=0)throw new Error("JSON export write made no forward progress.");n+=s}}function Z(t,e){let n=`Command output exceeds the ${t}-character safety limit. Narrow the query before retrying.`;return e?`${n} For the complete machine result, use --json --json-output <path> and inspect the file programmatically.`:n}function cn(t){if(!/^\d+$/u.test(t))throw new pt(`Output page size must be an integer from ${S} through ${E}.`);let e=Number(t);try{Ut(e)}catch{throw new pt(`Output page size must be an integer from ${S} through ${E}.`)}return e}function Ut(t){if(!Number.isSafeInteger(t)||t<S||t>E)throw new Error(`Output page size must be an integer from ${S} through ${E}.`)}async function Oe(t,e,n){let s=new J(N,t.maxOutputCharacters??l),r=process.stdout.write,a=!1,o=`${at(`scip-query: JSON output exceeds the ${N}-byte client-safe budget and may be truncated by the client. Do not use possibly partial client output as evidence. Read every page with: ${qt(Dt(t.invocationPrefix),ke(jt(t.argv)),q)}`)}
5
5
  `;process.stdout.write=((i,p,h)=>{let d=s.push(i,p);return d!==void 0&&(a||(a=!0,n.writeStderr(o)),r.call(process.stdout,d)),Bt(p,h),!0});try{await e();let i=s.finish();i.crossedPageBoundary&&!a&&(a=!0,n.writeStderr(o)),i.bytes.length>0&&r.call(process.stdout,i.bytes),a&&n.writeStderr(o),L(t.command,t.cwd,!0,t.sourceSession!==!1)}finally{process.stdout.write=r}}function Lt(t){let e=process.stdout.write;return process.stdout.write=((n,s,r)=>{let a=we(n,s);return t(a),Bt(s,r),!0}),()=>{process.stdout.write=e}}function we(t,e){return typeof t=="string"?Buffer.from(t,typeof e=="string"?e:"utf8"):Buffer.from(t)}function Bt(t,e){let n=typeof t=="function"?t:e;typeof n=="function"&&n()}var J=class{constructor(e,n){this.byteLimit=e;this.maxOutputCharacters=n}byteLimit;maxOutputCharacters;decoder=new Y("utf8");chunks=[];overflowed=!1;totalCharacters=0;totalBytes=0;push(e,n){let s=typeof e=="string"?Buffer.from(e,typeof n=="string"?n:"utf8"):Buffer.from(e);if(this.totalBytes+=s.length,this.addCharacters(this.decoder.write(s)),this.overflowed)return s;if(this.chunks.push(s),this.totalBytes<=this.byteLimit)return;this.overflowed=!0;let r=Buffer.concat(this.chunks);return this.chunks.length=0,r}finish(){this.addCharacters(this.decoder.end());let e=this.totalBytes>this.byteLimit,n=Buffer.concat(this.chunks);return this.chunks.length=0,{bytes:n,crossedPageBoundary:e}}addCharacters(e){if(this.totalCharacters+=e.length,!Number.isSafeInteger(this.totalCharacters)||this.totalCharacters>this.maxOutputCharacters)throw new Error(`Command output exceeds the ${this.maxOutputCharacters}-character safety limit. Narrow the query before retrying.`)}},F=class{constructor(e,n,s,r,a,o,i,p,h,d,g,c,u=Z(i,!1)){this.invocationHash=e;this.invocationPrefix=n;this.command=s;this.cwd=r;this.argv=a;this.pageSize=o;this.maxOutputCharacters=i;this.pageContentByteLimit=p;this.snapshotRoot=h;this.limits=d;this.maxPages=g;this.preferLineBoundaries=c;this.overflowMessage=u;K(h);do this.snapshotId=lt(9).toString("base64url");while(this.snapshotId.startsWith("-"));this.temporaryPath=O(h,this.snapshotId,"tmp")}invocationHash;invocationPrefix;command;cwd;argv;pageSize;maxOutputCharacters;pageContentByteLimit;snapshotRoot;limits;maxPages;preferLineBoundaries;overflowMessage;snapshotId;temporaryPath;decoder=new Y("utf8");hash=T("sha256");pages=[];descriptor=null;pending="";firstPageContent="";totalCharacters=0;pageCharacterOffset=0;byteLength=0;reservedBytes=0;opened=!1;finished=!1;write(e){if(this.finished)throw new Error("Output snapshot writer is closed.");this.appendDecoded(this.decoder.write(e))}complete(){if(this.finished)throw new Error("Output snapshot writer is closed.");if(this.appendDecoded(this.decoder.end()),this.finished=!0,!this.opened){let r=this.pending,a=Buffer.from(r);return this.assertWithinByteLimit(a.length),this.hash.update(a),this.pending="",{content:r,totalCharacters:this.totalCharacters,outputHash:this.hash.digest("hex"),pageCount:1}}if((this.pending.length>0||this.pages.length===0)&&(this.flushPage(this.pending),this.pending=""),this.descriptor===null)throw new Error("Output snapshot writer is not open.");x(this.descriptor),this.descriptor=null;let e=this.hash.digest("hex"),n=O(this.snapshotRoot,this.snapshotId,"output"),s=O(this.snapshotRoot,this.snapshotId,"json");try{wt(this.temporaryPath,n);let r={version:Tt,snapshotId:this.snapshotId,invocationHash:this.invocationHash,invocationPrefix:[...this.invocationPrefix],command:this.command,cwd:this.cwd,argv:[...this.argv],outputHash:e,pageSize:this.pageSize,pages:this.pages,totalCharacters:this.totalCharacters,byteLength:this.byteLength,createdAtMs:Date.now()};return j(s,r),gt(this.snapshotRoot,this.snapshotId,this.byteLength,"complete",this.limits),this.reservedBytes=this.byteLength,{content:this.firstPageContent,totalCharacters:this.totalCharacters,outputHash:e,pageCount:this.pages.length,snapshotId:this.snapshotId}}catch(r){throw b(this.snapshotId,this.snapshotRoot),r}}abort(){this.descriptor!==null&&(x(this.descriptor),this.descriptor=null),this.finished=!0,b(this.snapshotId,this.snapshotRoot)}appendDecoded(e){if(e.length===0)return;let n=this.totalCharacters+e.length;if(!Number.isSafeInteger(n)||n>this.maxOutputCharacters)throw new Error(this.overflowMessage);for(this.totalCharacters=n,this.pending+=e,this.assertWithinByteLimit(this.byteLength+Buffer.byteLength(this.pending));this.pending.length>this.pageSize||Buffer.byteLength(this.pending)>this.pageContentByteLimit;){this.open();let s=Ne(this.pending,this.pageSize,this.pageContentByteLimit,this.preferLineBoundaries),r=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.flushPage(r)}}open(){if(!this.opened){Ie(this.snapshotRoot,this.snapshotId,0,this.limits);try{this.descriptor=W(this.temporaryPath,"wx",384),this.opened=!0}catch(e){throw Ee(this.snapshotRoot,this.snapshotId),e}}}flushPage(e){if(this.descriptor===null)throw new Error("Output snapshot writer is not open.");if(this.pages.length>=this.maxPages)throw new Error(`Command output requires more than ${this.maxPages} snapshot pages. Retry with a larger --output-page-size, narrow the query, or use --json --json-output <path>.`);let n=Buffer.from(e),s=this.byteLength+n.length;if(this.assertWithinByteLimit(s),s>this.reservedBytes){let o=Math.min(this.limits.maxSnapshotBytes,Math.ceil(s/dt)*dt);gt(this.snapshotRoot,this.snapshotId,o,"active",this.limits),this.reservedBytes=o}let r=0;for(;r<n.length;){let o=St(this.descriptor,n,r,n.length-r);if(o<=0)throw new Error("Output snapshot write made no progress.");r+=o}let a={characterOffset:this.pageCharacterOffset,characterLength:e.length,byteOffset:this.byteLength,byteLength:n.length,hash:T("sha256").update(n).digest("hex")};this.pages.length===0&&(this.firstPageContent=e),this.pages.push(a),this.hash.update(n),this.pageCharacterOffset+=e.length,this.byteLength=s}assertWithinByteLimit(e){if(!Number.isSafeInteger(e)||e>this.limits.maxSnapshotBytes)throw new Error(`Command output exceeds the ${this.limits.maxSnapshotBytes}-byte snapshot limit. Narrow the query before retrying.`)}};function Se(t,e,n,s,r,a){K(r);let o=Rt(t.snapshotId,r);if(o.invocationHash!==e)throw new Error("This output cursor belongs to a different command, working directory, or argument set. Run again without --output-cursor.");if(o.snapshotId!==t.snapshotId||t.version===3&&(o.invocationHash!==t.invocationHash||o.outputHash!==t.outputHash))throw new Error("Output snapshot identity does not match this cursor.");if(o.pageSize!==n||t.version===3&&t.pageSize!==n)throw new Error(`Output page size changed after this cursor was issued; use ${o.pageSize}.`);let i=o.pages[t.pageIndex];if(!i)throw new Error("Output cursor points past the current result.");if(o.totalCharacters>s)throw new Error(`Output snapshot exceeds the ${s}-character safety limit.`);if(Date.now()-o.createdAtMs>Et)throw b(t.snapshotId,r),new Error("Output snapshot expired before all pages were read.");let p=O(r,t.snapshotId,"output"),h=W(p,"r");try{let d=ct(h);if(!d.isFile()||d.size!==o.byteLength)throw new Error("Output snapshot size or type changed.");let g=Buffer.allocUnsafe(i.byteLength),c=0;for(;c<g.length;){let f=Yt(h,g,c,g.length-c,i.byteOffset+c);if(f===0)break;c+=f,a?.(f)}let u=ct(h);if(u.dev!==d.dev||u.ino!==d.ino||u.size!==d.size||c!==i.byteLength)throw new Error("Output snapshot changed while it was being read.");if(T("sha256").update(g).digest("hex")!==i.hash)throw new Error("Output snapshot page no longer matches its metadata.");let w=g.toString("utf8");if(w.length!==i.characterLength)throw new Error("Output snapshot page character count changed.");return{content:w,offset:i.characterOffset,pageIndex:t.pageIndex,pageCount:o.pages.length,totalCharacters:o.totalCharacters,outputHash:o.outputHash}}catch(d){throw b(t.snapshotId,r),d}finally{x(h)}}function Rt(t,e){if(!v(t))throw new Error("Output snapshot identifier is invalid.");let n;try{n=JSON.parse(A(O(e,t,"json"),"output snapshot metadata"))}catch(s){throw new Error("Output snapshot is unavailable.",{cause:s})}if(!ve(n))throw new Error("Output snapshot metadata is invalid.");return n}function ve(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===Tt&&typeof e.snapshotId=="string"&&v(e.snapshotId)&&I(e.invocationHash)&&Jt(e.invocationPrefix)&&typeof e.command=="string"&&e.command.length>0&&e.command.length<=256&&typeof e.cwd=="string"&&e.cwd.length>0&&e.cwd.length<=8192&&ze(e.argv)&&zt(e.command,e.cwd,e.invocationPrefix,e.argv)===e.invocationHash&&I(e.outputHash)&&Number.isSafeInteger(e.pageSize)&&(e.pageSize??0)>=S&&(e.pageSize??0)<=E&&Array.isArray(e.pages)&&e.pages.length>1&&e.pages.length<=Pt&&e.pages.every(be)&&Ce(e.pages)&&Number.isSafeInteger(e.totalCharacters)&&(e.totalCharacters??-1)>=0&&e.pages.reduce((n,s)=>n+s.characterLength,0)===e.totalCharacters&&Number.isSafeInteger(e.byteLength)&&(e.byteLength??-1)>=0&&e.pages.reduce((n,s)=>n+s.byteLength,0)===e.byteLength&&Number.isSafeInteger(e.createdAtMs)&&(e.createdAtMs??-1)>=0}function be(t){if(!t||typeof t!="object")return!1;let e=t;return Number.isSafeInteger(e.characterOffset)&&(e.characterOffset??-1)>=0&&Number.isSafeInteger(e.characterLength)&&(e.characterLength??0)>0&&Number.isSafeInteger(e.byteOffset)&&(e.byteOffset??-1)>=0&&Number.isSafeInteger(e.byteLength)&&(e.byteLength??0)>0&&I(e.hash)}function Ce(t){let e=0,n=0;for(let s of t){if(s.characterOffset!==e||s.byteOffset!==n)return!1;e+=s.characterLength,n+=s.byteLength}return!0}function K(t){yt(t,{recursive:!0,mode:448});let e=Xt(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Output snapshot root is not a private directory: ${t}`);if(typeof process.getuid=="function"&&e.uid!==process.getuid())throw new Error(`Output snapshot root is not owned by the current user: ${t}`);process.platform!=="win32"&&Wt(t,448)}function Pe(t){let e={...ge,...t};for(let[n,s]of Object.entries(e))if(!Number.isSafeInteger(s)||s<=0)throw new Error(`Output snapshot ${n} must be a positive integer.`);if(e.maxSnapshotBytes>e.maxAggregateBytes)throw new Error("Output snapshot maxSnapshotBytes cannot exceed maxAggregateBytes.");return e}function Ie(t,e,n,s){H(t,()=>{xe(t),$t(t,e,n,"active",s)})}function gt(t,e,n,s,r){if(!Number.isSafeInteger(n)||n<0||n>r.maxSnapshotBytes)throw new Error(`Command output exceeds the ${r.maxSnapshotBytes}-byte snapshot limit.`);H(t,()=>{$t(t,e,n,s,r)})}function $t(t,e,n,s,r){if(!Number.isSafeInteger(n)||n<0||n>r.maxSnapshotBytes)throw new Error(`Command output exceeds the ${r.maxSnapshotBytes}-byte snapshot limit.`);let a=Te(t),o=a.find(g=>g.snapshotId===e),i=a.reduce((g,c)=>g+c.reservedBytes,0)-(o?.reservedBytes??0)+n,p=a.length+(o?0:1);if(p>r.maxSnapshotCount||i>r.maxAggregateBytes)throw new Error(`Output snapshot capacity is full (${p}/${r.maxSnapshotCount} snapshots, ${i}/${r.maxAggregateBytes} bytes). Narrow the query or finish an existing pagination sequence before retrying.`);let h=Date.now(),d={version:At,snapshotId:e,pid:process.pid,...G()?{processIdentity:G()}:{},reservedBytes:n,state:s,createdAtMs:o?.createdAtMs??h,updatedAtMs:h};j(O(t,e,"reserve"),d)}function Ee(t,e){H(t,()=>{X(O(t,e,"reserve"),{force:!0})})}function Te(t){let e=[];for(let n of Ot(t,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let s=n.name.slice(0,-8);if(v(s))try{let r=JSON.parse(A(_(t,n.name),"output snapshot reservation"));if(!Ht(r)||r.snapshotId!==s)throw new Error("reservation identity is invalid");e.push(r)}catch(r){throw new Error(`Output snapshot reservation ${n.name} is invalid; retry after its owning process or snapshot expires.`,{cause:r})}}return e}function Ht(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===At&&typeof e.snapshotId=="string"&&v(e.snapshotId)&&Number.isSafeInteger(e.pid)&&(e.pid??0)>0&&(e.processIdentity===void 0||nt(e.processIdentity)!==null&&e.processIdentity.pid===e.pid)&&Number.isSafeInteger(e.reservedBytes)&&(e.reservedBytes??-1)>=0&&(e.state==="active"||e.state==="complete")&&Number.isSafeInteger(e.createdAtMs)&&Number.isSafeInteger(e.updatedAtMs)}function xe(t){let e=Date.now();for(let n of Ot(t,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let s=n.name.slice(0,-8);if(!v(s))continue;let r=null;try{let p=JSON.parse(A(_(t,n.name),"output snapshot reservation"));r=Ht(p)?p:null}catch{r=null}let a=_e(O(t,s,"json")),o=r?.state==="active"&&et(r.pid)&&(r.processIdentity===void 0||(()=>{let p=z(r.pid);return p!==null&&rt(r.processIdentity,p)})()),i=r?e-r.updatedAtMs>Et:!1;o||a&&!i||!a&&r&&!i&&r.state==="complete"||Mt(s,t)}}function _e(t){try{return Qt(t),!0}catch{return!1}}function H(t,e){K(t);let n=_(t,ce),s=Date.now()+pe;for(;;){let r=st(n,{kind:"output-snapshot-quota",processIdentity:G()});if(r.kind==="acquired")try{return e()}finally{r.lock.release()}if(Date.now()>=s)throw new Error("Output snapshot quota is busy. Retry the command.");Atomics.wait(de,0,0,he)}}function G(){return D===void 0&&(D=z(process.pid)),D}function b(t,e){v(t)&&H(e,()=>Mt(t,e))}function Mt(t,e){for(let n of["json","output","tmp","reserve"])X(O(e,t,n),{force:!0})}function O(t,e,n){if(!v(e))throw new Error("Output snapshot identifier is invalid.");return _(t,`${e}.${n}`)}function Ae(t){if(!t)throw new Error("Incomplete output did not create a resumable snapshot.");return t}function ft(t){return t>=55296&&t<=56319}function Ne(t,e,n,s){let r=Math.min(t.length,e);if(ft(t.charCodeAt(r-1))&&(r-=1),Buffer.byteLength(t.slice(0,r))>n){let a=0,o=r;for(;a<o;){let i=Math.ceil((a+o)/2);Buffer.byteLength(t.slice(0,i))<=n?a=i:o=i-1}r=a,ft(t.charCodeAt(r-1))&&(r-=1)}if(r<=0)throw new Error("Output page byte limit cannot contain one UTF-8 character.");if(s){let a=t.lastIndexOf(`
@@ -17,4 +17,4 @@ ${e.command}]
17
17
  `:`
18
18
  [scip-query transport complete; evaluate command coverage separately]
19
19
  `;return`${s}${t.content}${r}`}export{ee as a,fe as b,un as c,cn as d};
20
- //# sourceMappingURL=chunk-N4EFQIRX.js.map
20
+ //# sourceMappingURL=chunk-Q5TA4OY4.js.map
@@ -1,2 +1,2 @@
1
- import{c as r}from"./chunk-WEXQYJY3.js";function _(t){switch(t){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function a(t){let s=r(t);return i(s)?"test":n(s)?"worker":u(s)?"entry":f(s)?"barrel":"source"}function i(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function n(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function u(t){let s=t.split("/"),e=s[s.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:s.length<=2:!1}function f(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}export{_ as a,a as b};
2
- //# sourceMappingURL=chunk-HW7FASEL.js.map
1
+ import{c as r}from"./chunk-GH5YSGZL.js";function _(t){switch(t){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function a(t){let s=r(t);return i(s)?"test":n(s)?"worker":u(s)?"entry":f(s)?"barrel":"source"}function i(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function n(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function u(t){let s=t.split("/"),e=s[s.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:s.length<=2:!1}function f(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}export{_ as a,a as b};
2
+ //# sourceMappingURL=chunk-Q6T2CAJL.js.map
@@ -0,0 +1,81 @@
1
+ import{x,xa as j,ya as M}from"./chunk-GH5YSGZL.js";var V=[];function S(e){e.groups.length>0&&V.push(e)}function He(e,t){let n=new Set(t.groups);for(let i of V)i.groups.some(r=>n.has(r))&&(t.file!==void 0&&i.clearFile?i.clearFile(e,t.file):i.clearAll(e))}var K=256;function U(e){let t=e.maxEntries;if(t!==void 0){if(!Number.isSafeInteger(t)||t<1)throw new Error(`Per-database cache maxEntries must be a positive safe integer; received ${t}.`);return t}return e.clearGroups.includes("source-file")?K:void 0}function H(e,t,n){e.delete(t),e.set(t,n)}function W(e,t){if(t!==void 0)for(;e.size>t;){let n=e.keys().next().value;if(n===void 0)return;e.delete(n)}}function X(){let e=new WeakMap;return{cache:e,ensure(t){let n=e.get(t);return n||(n=new Map,e.set(t,n)),n}}}function v(e,t){let{cache:n,ensure:i}=X(),r=U(t),a={get(s,o,c){let l=i(s);if(l.has(o)){let h=l.get(o);return H(l,o,h),h}let g=c();return l.set(o,g),W(l,r),g},has(s,o){return n.get(s)?.has(o)??!1},invalidate(s,o){n.get(s)?.delete(o)},invalidateAll(s){n.delete(s)},size(s){return n.get(s)?.size??0}};return S({name:e,groups:t.clearGroups,clearAll:s=>a.invalidateAll(s),clearFile:(s,o)=>a.invalidate(s,o)}),a}function Be(e,t){let n=new WeakMap,i={get(r,a){let s=n.get(r);if(s)return s.value;let o=a();return n.set(r,{value:o}),o},invalidate(r){n.delete(r)},has(r){return n.has(r)}};return S({name:e,groups:t.clearGroups,clearAll:r=>i.invalidate(r)}),i}var fe={clearGroups:["whole-project","source-file"],maxEntries:K};function Ye(e){return Ee(e,fe)}function Ee(e,t){let{cache:n,ensure:i}=X(),r=U(t),a={get(s,o,c,l){let g=i(s),h=g.get(o);if(h&&h.source===c)return H(g,o,h),h.value;let A=l();return g.set(o,{source:c,value:A}),W(g,r),A},invalidate(s,o){n.get(s)?.delete(o)},invalidateAll(s){n.delete(s)}};return S({name:e,groups:t.clearGroups,clearAll:s=>a.invalidateAll(s),clearFile:(s,o)=>a.invalidate(s,o)}),a}import{createHash as ge}from"crypto";import{existsSync as Qe,mkdirSync as he}from"fs";import{dirname as B,join as ve}from"path";import Y from"better-sqlite3";var ye="evidence.db";var me=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],R=new Set(me);var tt=512*1024*1024,_e=6e4,D=new WeakMap,Te=v("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Se=v("evidence-project-fingerprint",{clearGroups:["whole-project"]}),p="evidence-v1",y="version NOT LIKE 'evidence-%'";function $(e){return ge("sha256").update(e).digest("hex")}function nt(e,t,n){return Te.get(e,t,()=>$(n))}function G(e){return Se.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=x(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,i=[...n.indexedLanguages??[]].sort();return $(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:i,status:n.status}))}catch(t){return m("project fingerprint unavailable",t),null}})}function m(e,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function u(e){if(D.has(e))return D.get(e)??null;let t=null;try{let n=new Y(e.config.evidenceDbPath??ve(B(e.config.dbPath),ye));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS project_evidence (
11
+ kind TEXT NOT NULL,
12
+ cache_key TEXT NOT NULL,
13
+ project_fingerprint TEXT NOT NULL,
14
+ version TEXT NOT NULL,
15
+ payload TEXT NOT NULL,
16
+ PRIMARY KEY (kind, cache_key)
17
+ );
18
+ CREATE TABLE IF NOT EXISTS semantic_callees (
19
+ relative_path TEXT NOT NULL,
20
+ symbol TEXT NOT NULL,
21
+ content_hash TEXT NOT NULL,
22
+ deps_digest TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS semantic_references (
28
+ relative_path TEXT NOT NULL,
29
+ symbol TEXT NOT NULL,
30
+ project_fingerprint TEXT NOT NULL,
31
+ version TEXT NOT NULL,
32
+ payload TEXT NOT NULL,
33
+ PRIMARY KEY (relative_path, symbol)
34
+ );
35
+ `),t={evidence:n,shared:De(e.config.sharedEvidenceDbPath),readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:n.prepare(`SELECT payload FROM file_evidence
36
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${y}
37
+ ORDER BY version DESC
38
+ LIMIT 1`),writeFileEvidence:n.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:n.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:n.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:n.prepare(`SELECT payload FROM project_evidence
39
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${y}
40
+ ORDER BY version DESC
41
+ LIMIT 1`),writeProjectEvidence:n.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:n.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:n.prepare(`SELECT payload FROM semantic_callees
42
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
43
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${y}
44
+ ORDER BY version DESC
45
+ LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
46
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
47
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${y}
48
+ ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
49
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:n.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:n.prepare(`SELECT payload FROM semantic_references
50
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
51
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${y}
52
+ ORDER BY version DESC
53
+ LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
54
+ WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
55
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${y}
56
+ ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
57
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(n){m("disabled (open failed)",n)}return D.set(e,t),t}function f(e,t,n){m(`disabled (${t})`,n),D.set(e,null)}function De(e){if(!e)return null;try{he(B(e),{recursive:!0});let t=new Y(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
58
+ CREATE TABLE IF NOT EXISTS file_evidence (
59
+ kind TEXT NOT NULL,
60
+ relative_path TEXT NOT NULL,
61
+ content_hash TEXT NOT NULL,
62
+ version TEXT NOT NULL,
63
+ payload TEXT NOT NULL,
64
+ last_accessed_at INTEGER NOT NULL,
65
+ PRIMARY KEY (kind, relative_path, content_hash, version)
66
+ );
67
+ CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
68
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
69
+ `),{evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
70
+ VALUES (?, ?, ?, ?, ?, ?)
71
+ ON CONFLICT(kind, relative_path, content_hash, version)
72
+ DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:t.prepare(`UPDATE file_evidence
73
+ SET last_accessed_at = ?
74
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
75
+ AND last_accessed_at < ?`)}}catch(t){return m("shared cache disabled (open failed)",t),null}}function w(e,t,n){m(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function z(e,t,n,i){let r=u(e);if(!r)return null;try{let a=r.readFileEvidence.get(t,n,i,p)??r.readLegacyFileEvidence.get(t,n,i);if(a?.payload!==void 0)return a.payload;if(!R.has(t)||!r.shared)return null;try{let s=r.shared.readFileEvidence.get(t,n,i,p);return s?.payload!==void 0&&be(r.shared,t,n,i),s?.payload??null}catch(s){return w(r,"file_evidence read",s),null}}catch(a){return f(e,"file_evidence read",a),null}}function be(e,t,n,i){let r=Date.now();try{e.touchFileEvidence.run(r,t,n,i,p,r-_e)}catch(a){m("shared file_evidence recency touch skipped",a)}}function Q(e,t,n,i,r){let a=u(e);if(a)try{if(a.writeFileEvidence.run(t,n,i,p,r),R.has(t)&&a.shared)try{a.shared.writeFileEvidence.run(t,n,i,p,r,Date.now())}catch(s){w(a,"file_evidence write",s)}}catch(s){f(e,"file_evidence write",s)}}function J(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{for(let r of t)n.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload)})();try{n.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let i=t.filter(r=>R.has(r.kind));if(i.length>0&&n.shared)try{n.shared.evidence.transaction(()=>{for(let r of i)n.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload,Date.now())})()}catch(r){w(n,"file_evidence batch write",r)}}catch(i){f(e,"file_evidence batch write",i)}}function q(e,t,n,i){let r=u(e);if(!r)return null;try{return(r.readProjectEvidence.get(t,n,i,p)??r.readLegacyProjectEvidence.get(t,n,i))?.payload??null}catch(a){return f(e,"project_evidence read",a),null}}function Z(e,t,n,i,r){let a=u(e);if(a)try{a.writeProjectEvidence.run(t,n,i,p,r)}catch(s){f(e,"project_evidence write",s)}}function rt(e,t,n,i){if(n===i)return 0;let r=u(e);if(!r)return 0;try{return r.rekeyProjectEvidenceKind.run(i,p,t,n).changes}catch(a){return f(e,"project_evidence kind rekey",a),0}}function it(e,t,n,i){let r=u(e);if(!r)return new Map;try{let a=r.readCalleesForFile.all(t,n,i,p),s=r.readLegacyCalleesForFile.all(t,n,i);return ee([...s,...a])}catch(a){return f(e,"semantic_callees bulk read",a),new Map}}function at(e,t,n){let i=u(e);if(!i)return new Map;try{let r=i.readReferencesForFile.all(t,n,p),a=i.readLegacyReferencesForFile.all(t,n);return ee([...a,...r])}catch(r){return f(e,"semantic_references bulk read",r),new Map}}function ee(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function st(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.contentHash}`;i.has(a)||(i.add(a),n.dropStaleCallees.run(r.relativePath,r.contentHash)),n.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,p,r.payload)}})()}catch(i){f(e,"semantic_callees write",i)}}function ot(e,t){if(t.length===0)return;let n=u(e);if(n)try{n.evidence.transaction(()=>{let i=new Set;for(let r of t){let a=`${r.relativePath}\0${r.projectFingerprint}`;i.has(a)||(i.add(a),n.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),n.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,p,r.payload)}})()}catch(i){f(e,"semantic_references write",i)}}function dt(e){return typeof e=="object"&&e!==null}function lt(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null}import{appendFileSync as Ce,mkdirSync as Pe}from"fs";import{createHash as Ne,randomUUID as Re}from"crypto";import{dirname as we}from"path";import{performance as _}from"perf_hooks";var ie="SCIP_QUERY_PROFILE",ae="SCIP_QUERY_PROFILE_OUT",se="SCIP_QUERY_PROFILE_COMMAND",oe="SCIP_QUERY_PROFILE_CACHE_STATE",F="SCIP_QUERY_PROFILE_RUN_ID",O="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",k="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",ce=[ie,ae,se,oe,F,O,k],ht=new Set(ce),te=new Set,ne=new Map,re=!1;function E(){let e=process.env[ie];return e==="1"||e==="true"}function Fe(){return process.env[ae]}function de(){return process.env[se]}function Oe(){return process.env[oe]}function le(){let e=process.env[F];if(e)return e;if(!E())return;let t=Re();return process.env[F]=t,t}function pe(){return process.env[O]}function ke(e){let t=pe();if(t)return t;if(!E())return;let n=le();if(!n)return;let i=e.projectFingerprint?"published-project":"run-only",r=T(["profile-workload-v1",e.toolVersion,e.command,e.projectFingerprint??n]);return process.env[O]=r,process.env[k]=i,r}function T(e){return Ne("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function vt(){return Object.fromEntries(ce.flatMap(e=>{let t=process.env[e];return t===void 0?[]:[[e,t]]}))}function I(e,t,n){if(!E())return t();let i=_.now();try{let r=t();return b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!0,...C(n)??{}}),r}catch(r){throw b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...C(n)??{}}),r}}async function yt(e,t,n){if(!E())return t();let i=_.now();try{let r=await t();return b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!0,...C(n)??{}}),r}catch(r){throw b({type:"span",name:e,durationMs:Math.round(_.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...C(n)??{}}),r}}function b(e,t=Fe()){let n=Ie(e),i={timestamp:new Date().toISOString(),pid:process.pid,runId:le(),command:de(),cacheState:Oe(),...n,...e},r=`${JSON.stringify(i)}
76
+ `;if(t)try{let a=we(t);te.has(a)||(Pe(a,{recursive:!0}),te.add(a)),Ce(t,r);return}catch(a){re||(re=!0,process.stderr.write(`[profile] failed to write ${t}: ${a instanceof Error?a.message:String(a)}
77
+ `));return}E()&&process.stderr.write(r)}function Ie(e){let t=pe()??ke({command:de()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!t)return{};let n=process.env[k],i=typeof e.name=="string"?e.name:void 0;if(!i)return{workloadIdentity:t,workloadIdentityKind:n};let r=i.split(/[.:]/,1)[0]??i,a=`${t}\0${i}`,s=ne.get(a);return s||(s=T(["profile-subsystem-v1",t,i]),ne.set(a,s)),{workloadIdentity:t,workloadIdentityKind:n,subsystem:r,subsystemWorkIdentity:s}}function C(e){return typeof e=="function"?e():e}var Le=[d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("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"}),d("runtime-boundary-source-hashes",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/analysis/runtime-boundaries.test.ts",owner:"src/analysis/runtime-boundaries/graph.ts"}),d("runtime-boundary-direct-extraction",{dependsOn:["content-hash","direct-deps-digest","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/analysis/runtime-boundaries.test.ts",owner:"src/analysis/runtime-boundaries/graph.ts"}),P("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"}),P("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"}),P("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"}),P("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 bt(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,s=0,o;if(E()){let c=G(n);if(c){let l=`${c}\0${i}\0${r}`;o=t.get(l),o||(o=T(["evidence-product-file-read-v1",e.kind,c,i,r]),t.set(l,o))}}return I("evidence-product.file.read",()=>{let c=z(n,e.kind,i,r);if(c===null)return null;s=c.length;try{let l=e.deserialize(c);return a=l!==null,l}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(n,i,r,a){Q(n,e.kind,i,r,e.serialize(a))},writeBatch(n,i){J(n,i.map(r=>({kind:e.kind,relativePath:r.relativePath,contentHash:r.contentHash,payload:e.serialize(r.value)})))}}}function Ct(e){let t=new Map;return{kind:e.kind,read(n,i,r){let a=!1,s=0,o;if(E()){let c=`${r}\0${i}`;o=t.get(c),o||(o=T(["evidence-product-project-read-v1",e.kind,r,i]),t.set(c,o))}return I("evidence-product.project.read",()=>{let c=q(n,e.kind,i,r);if(c===null)return null;s=c.length;try{let l=e.deserialize(c);return a=l!==null,l}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(n,i,r,a){Z(n,e.kind,i,r,e.serialize(a))}}}function Pt(e){let t=Le.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function d(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function P(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}var N=null;function L(e){N?.(e)}function Rt(e,t){let n=N;N=e;try{return t()}finally{N=n}}var Ae=v("source-text",{clearGroups:["whole-project","source-file"]}),xe=v("source-lines",{clearGroups:["whole-project","source-file"]});function je(e,t){let n=t.replace(/\\/g,"/");return L(n),Ae.get(e,n,()=>Me(e,n))}function Me(e,t){let n=t.replace(/\\/g,"/");L(n);try{return j(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(i){if(M(i))return"";throw i}}function It(e){if(e.length===0)return[];let t=e.split(`
78
+ `);return e.endsWith(`
79
+ `)&&t.pop(),t}function Ve(e,t){let n=t.replace(/\\/g,"/");return xe.get(e,n,()=>{let i=je(e,n);return i?i.split(`
80
+ `):[]})}var Ke=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Ue(e){let t=Ke.exec(e);return t?t[1]??"":null}function Lt(e,t,n){return ue(e,t,n).length>0}function At(e,t,n,i){let r=i.toLowerCase();return ue(e,t,n).some(a=>a.toLowerCase()===r)}function ue(e,t,n){if(n<=0)return[];let i=Ve(e,t);if(i.length===0)return[];let r=[];for(let a=n-1;a>=0&&a>=n-5;a-=1){let s=(i[a]??"").trim();if(s==="")continue;let o=Ue(s);if(o!==null){r.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return r}return r}export{S as a,He as b,v as c,Be as d,Ye as e,Ee as f,ye as g,$ as h,nt as i,G as j,rt as k,it as l,at as m,st as n,ot as o,dt as p,lt as q,E as r,vt as s,I as t,yt as u,b as v,bt as w,Ct as x,Pt as y,L as z,Rt as A,je as B,Me as C,It as D,Ve as E,Ue as F,Lt as G,At as H};
81
+ //# sourceMappingURL=chunk-Q7GBK5T7.js.map
@@ -1,2 +1,2 @@
1
- import{f as T,oa as x,ra as m,sa as P,ta as k,va as b,x as v,xa as j}from"./chunk-WEXQYJY3.js";import{createHash as A}from"crypto";import{isUtf8 as K}from"buffer";import{TextDecoder as _}from"util";var O=new _("utf-8",{fatal:!0});function H(e){return j(e.config.projectRoot)}function V(e,t){let i=T(t),n;try{n=m(e.config.projectRoot,i,{inputKind:"repository text file"})}catch(o){if(b(o)||o instanceof x)return null;throw o}let r=W(n);return r===null?null:w(i,n,r,E(e),L(e))}function X(e,t={}){let i=[],n=C(e,t,r=>i.push(r));return{files:i,candidateFiles:n.candidateFiles,scannedBytes:n.scannedBytes,skippedBinaryPaths:n.skippedBinaryPaths,skippedUnreadablePaths:n.skippedUnreadablePaths,skippedOversizedPaths:n.skippedOversizedPaths}}function C(e,t,i){let n=H(e).filter(s=>!t.scope||s.includes(t.scope)),r=E(e),o=L(e),u=[],S=[],B=[],f=0,d=0,h={aligned:0,stale:0,unavailable:0},l=t.literalBytes?Buffer.isBuffer(t.literalBytes)?[t.literalBytes]:[...t.literalBytes]:[],F=l.length>0?Buffer.allocUnsafe(1024*1024):void 0;for(let s of n){let c,p,g=[],y=o.has(s);try{if(l.length>0){let a=l.length===1?P(e.config.projectRoot,s,l[0],{inputKind:"repository text file",computeSha256:y,scratchBuffer:F}):k(e.config.projectRoot,s,l,{inputKind:"repository text file",computeSha256:y,scratchBuffer:F});if(!a.isUtf8Text){u.push(s);continue}f+=a.byteLength,d+=1,p=a.sha256;let z=R(s,p,r,o);if(h[z.state]+=1,g="matchedLiteralIndexes"in a?a.matchedLiteralIndexes:a.includesLiteral?[0]:[],g.length===0||!a.bytes)continue;c=a.bytes}else c=m(e.config.projectRoot,s,{inputKind:"repository text file"})}catch(a){if(a instanceof x){B.push(s);continue}if(b(a))continue;S.push(s);continue}if(l.length===0&&!I(c)){u.push(s);continue}if(l.length===0){f+=c.byteLength,d+=1,p=y?M(c):void 0;let a=R(s,p,r,o);h[a.state]+=1}if(t.includeBytes&&!t.includeBytes(s,c))continue;let U=O.decode(c);i(w(s,c,U,r,o,p),g)}return{candidateFiles:n.length,scannedTextFiles:d,semanticFiles:h,scannedBytes:f,skippedBinaryPaths:u,skippedUnreadablePaths:S,skippedOversizedPaths:B}}function w(e,t,i,n,r,o){let u=o??M(t);return{relativePath:e,text:i,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:u},semantic:R(e,u,n,r)}}}function R(e,t,i,n){if(!n.has(e))return{state:"unavailable",basis:"no-compiler-document"};let r=i.get(e);return!r||!t?{state:"unavailable",basis:"fingerprint-unavailable"}:{state:r===t?"aligned":"stale",basis:"indexed-input-fingerprint"}}function L(e){return new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path))}function E(e){let t=new Map;if(!e.generation.metadataRaw)return t;let i=v(e.generation.metadataRaw);if(i.kind!=="legacy"&&i.kind!=="supported")return t;let n=i.metadata.fingerprint;if(!D(n)||!Array.isArray(n.files))return t;for(let r of n.files)!D(r)||typeof r.path!="string"||typeof r.hash!="string"||t.set(r.path,r.hash);return t}function W(e){return I(e)?O.decode(e):null}function I(e){return!e.includes(0)&&K(e)}function M(e){return A("sha256").update(e).digest("hex")}function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{H as a,V as b,X as c,C as d};
2
- //# sourceMappingURL=chunk-CXT3GZSQ.js.map
1
+ import{Aa as j,f as T,ra as x,ua as m,va as P,wa as k,x as v,ya as b}from"./chunk-GH5YSGZL.js";import{createHash as A}from"crypto";import{isUtf8 as K}from"buffer";import{TextDecoder as _}from"util";var O=new _("utf-8",{fatal:!0});function H(e){return j(e.config.projectRoot)}function V(e,t){let i=T(t),n;try{n=m(e.config.projectRoot,i,{inputKind:"repository text file"})}catch(o){if(b(o)||o instanceof x)return null;throw o}let r=W(n);return r===null?null:w(i,n,r,E(e),L(e))}function X(e,t={}){let i=[],n=C(e,t,r=>i.push(r));return{files:i,candidateFiles:n.candidateFiles,scannedBytes:n.scannedBytes,skippedBinaryPaths:n.skippedBinaryPaths,skippedUnreadablePaths:n.skippedUnreadablePaths,skippedOversizedPaths:n.skippedOversizedPaths}}function C(e,t,i){let n=H(e).filter(s=>!t.scope||s.includes(t.scope)),r=E(e),o=L(e),u=[],S=[],B=[],f=0,d=0,h={aligned:0,stale:0,unavailable:0},l=t.literalBytes?Buffer.isBuffer(t.literalBytes)?[t.literalBytes]:[...t.literalBytes]:[],F=l.length>0?Buffer.allocUnsafe(1024*1024):void 0;for(let s of n){let c,p,g=[],y=o.has(s);try{if(l.length>0){let a=l.length===1?P(e.config.projectRoot,s,l[0],{inputKind:"repository text file",computeSha256:y,scratchBuffer:F}):k(e.config.projectRoot,s,l,{inputKind:"repository text file",computeSha256:y,scratchBuffer:F});if(!a.isUtf8Text){u.push(s);continue}f+=a.byteLength,d+=1,p=a.sha256;let z=R(s,p,r,o);if(h[z.state]+=1,g="matchedLiteralIndexes"in a?a.matchedLiteralIndexes:a.includesLiteral?[0]:[],g.length===0||!a.bytes)continue;c=a.bytes}else c=m(e.config.projectRoot,s,{inputKind:"repository text file"})}catch(a){if(a instanceof x){B.push(s);continue}if(b(a))continue;S.push(s);continue}if(l.length===0&&!I(c)){u.push(s);continue}if(l.length===0){f+=c.byteLength,d+=1,p=y?M(c):void 0;let a=R(s,p,r,o);h[a.state]+=1}if(t.includeBytes&&!t.includeBytes(s,c))continue;let U=O.decode(c);i(w(s,c,U,r,o,p),g)}return{candidateFiles:n.length,scannedTextFiles:d,semanticFiles:h,scannedBytes:f,skippedBinaryPaths:u,skippedUnreadablePaths:S,skippedOversizedPaths:B}}function w(e,t,i,n,r,o){let u=o??M(t);return{relativePath:e,text:i,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:u},semantic:R(e,u,n,r)}}}function R(e,t,i,n){if(!n.has(e))return{state:"unavailable",basis:"no-compiler-document"};let r=i.get(e);return!r||!t?{state:"unavailable",basis:"fingerprint-unavailable"}:{state:r===t?"aligned":"stale",basis:"indexed-input-fingerprint"}}function L(e){return new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path))}function E(e){let t=new Map;if(!e.generation.metadataRaw)return t;let i=v(e.generation.metadataRaw);if(i.kind!=="legacy"&&i.kind!=="supported")return t;let n=i.metadata.fingerprint;if(!D(n)||!Array.isArray(n.files))return t;for(let r of n.files)!D(r)||typeof r.path!="string"||typeof r.hash!="string"||t.set(r.path,r.hash);return t}function W(e){return I(e)?O.decode(e):null}function I(e){return!e.includes(0)&&K(e)}function M(e){return A("sha256").update(e).digest("hex")}function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{H as a,V as b,X as c,C as d};
2
+ //# sourceMappingURL=chunk-QKT4UI2Y.js.map
@@ -1,3 +1,3 @@
1
- import{c as p}from"./chunk-BYXWXLKM.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BGBBVSH4.js";import{d as g,u as B}from"./chunk-7Z4GMCHM.js";import{b as f}from"./chunk-6LS3IG2I.js";import{C as y,F as d}from"./chunk-JSHDCVUM.js";import{createHash as A}from"crypto";var h=3;function H(e,t={}){let{scope:o,maxLoc:n=15,minLoc:i=h,limit:r,scanLimit:s}=t,l=p(e),u=L(e,{scope:o,maxLoc:n,scanLimit:s}).map(a=>x(e,a,l,i)).filter(a=>a!==null),c=v(u);return r?c.slice(0,r):c}function M(e,t,o={}){let{scope:n,maxLoc:i=15,minLoc:r=h,scanLimit:s}=o,l=p(e),u=L(e,{scope:n,maxLoc:i,scanLimit:s}).map(a=>x(e,a,l,r)).filter(a=>a!==null),c=u.find(a=>a.symbol===t);return c?u.filter(a=>a.symbol!==c.symbol&&a.normalizedBody===c.normalizedBody&&a.file!==c.file).sort(z).map(({normalizedBody:a,...C})=>C):[]}function I(e){let t=S(e);return f(t).replace(/\s+/g,"")}function v(e){let t=new Map;for(let n of e){if(n.normalizedBody.length<8)continue;let i=F(n.normalizedBody),r=t.get(i)??[];r.push(n),t.set(i,r)}let o=[];for(let[n,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let s=[...i].sort(z).map(({normalizedBody:l,...u})=>u);o.push({hash:n,canonical:s[0],functions:s})}return o.sort((n,i)=>{let r=i.functions.length-n.functions.length;if(r!==0)return r;let s=b(i)-b(n);return s!==0?s:n.canonical.file.localeCompare(i.canonical.file)}),o}function L(e,t){let o=B(e,{scope:t.scope}).filter(n=>n.isFunctionLike&&!e.isIgnored(n.relativePath)).filter(n=>!d(e,n.relativePath,n.startLine,"similar")).filter(n=>m(n)<=t.maxLoc);return o.sort((n,i)=>m(i)-m(n)||n.relativePath.localeCompare(i.relativePath)),D(o,t.scanLimit)}function x(e,t,o,n){let i=E(e,t);if(!i||W(i)<n)return null;let r=P(e,t);return r?{symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:o?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function P(e,t){let o=E(e,t);return o&&I(o)||null}function E(e,t){let o=y(e,t.relativePath);return o.length===0?null:o.slice(t.startLine,t.endLine+1).join(`
1
+ import{c as p}from"./chunk-ISWFRGJ6.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BGBBVSH4.js";import{d as g,u as B}from"./chunk-TD7VKJ2Y.js";import{b as f}from"./chunk-42W3LFUK.js";import{E as y,H as d}from"./chunk-Q7GBK5T7.js";import{createHash as A}from"crypto";var h=3;function H(e,t={}){let{scope:o,maxLoc:n=15,minLoc:i=h,limit:r,scanLimit:s}=t,l=p(e),u=L(e,{scope:o,maxLoc:n,scanLimit:s}).map(a=>x(e,a,l,i)).filter(a=>a!==null),c=v(u);return r?c.slice(0,r):c}function M(e,t,o={}){let{scope:n,maxLoc:i=15,minLoc:r=h,scanLimit:s}=o,l=p(e),u=L(e,{scope:n,maxLoc:i,scanLimit:s}).map(a=>x(e,a,l,r)).filter(a=>a!==null),c=u.find(a=>a.symbol===t);return c?u.filter(a=>a.symbol!==c.symbol&&a.normalizedBody===c.normalizedBody&&a.file!==c.file).sort(z).map(({normalizedBody:a,...C})=>C):[]}function I(e){let t=S(e);return f(t).replace(/\s+/g,"")}function v(e){let t=new Map;for(let n of e){if(n.normalizedBody.length<8)continue;let i=F(n.normalizedBody),r=t.get(i)??[];r.push(n),t.set(i,r)}let o=[];for(let[n,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let s=[...i].sort(z).map(({normalizedBody:l,...u})=>u);o.push({hash:n,canonical:s[0],functions:s})}return o.sort((n,i)=>{let r=i.functions.length-n.functions.length;if(r!==0)return r;let s=b(i)-b(n);return s!==0?s:n.canonical.file.localeCompare(i.canonical.file)}),o}function L(e,t){let o=B(e,{scope:t.scope}).filter(n=>n.isFunctionLike&&!e.isIgnored(n.relativePath)).filter(n=>!d(e,n.relativePath,n.startLine,"similar")).filter(n=>m(n)<=t.maxLoc);return o.sort((n,i)=>m(i)-m(n)||n.relativePath.localeCompare(i.relativePath)),D(o,t.scanLimit)}function x(e,t,o,n){let i=E(e,t);if(!i||W(i)<n)return null;let r=P(e,t);return r?{symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:o?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function P(e,t){let o=E(e,t);return o&&I(o)||null}function E(e,t){let o=y(e,t.relativePath);return o.length===0?null:o.slice(t.startLine,t.endLine+1).join(`
2
2
  `)}function S(e){let t=e.indexOf("{"),o=e.lastIndexOf("}");if(t>=0&&o>t)return e.slice(t+1,o);let n=e.indexOf("=>");return n>=0?e.slice(n+2).replace(/;+\s*$/,""):e}function W(e){return S(e).split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0).length}function F(e){return A("sha256").update(e).digest("hex").slice(0,16)}function z(e,t){let o=e.ageCommits??-1;return(t.ageCommits??-1)-o||e.file.localeCompare(t.file)||e.startLine-t.startLine}function b(e){return e.functions.reduce((t,o)=>t+o.loc,0)}export{H as a,M as b,I as c,v as d,P as e,E as f,S as g};
3
- //# sourceMappingURL=chunk-DGM2RJ3I.js.map
3
+ //# sourceMappingURL=chunk-QLBSG7U5.js.map
@@ -0,0 +1,2 @@
1
+ import{B as I,i as Q,q as X,z as P}from"./chunk-WN3TCGJ4.js";import{a as L,b as G,d as R}from"./chunk-K3XFWJI2.js";import{a as d,f as w,g as B,h as p}from"./chunk-H5EXS3HM.js";import{F as U,U as H,V as W,a as V,fa as Y,g as F,h as S,o as O,pa as J,q,ra as K,ua as z}from"./chunk-AK3PYTIK.js";import{existsSync as Re}from"fs";import{randomUUID as ze}from"crypto";import{isAbsolute as Xe,join as Pe,relative as Ze,resolve as et}from"path";var f=1,m=2,ue="./node_modules/scip-query/docs/schemas/project-config.schema.json";function Z(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(c){return{kind:"malformed",reason:`invalid JSON: ${c instanceof Error?c.message:String(c)}`}}if(!d(t))return{kind:"malformed",reason:"project config must be a JSON object"};let n=t.schemaVersion;if(n!==void 0&&!Number.isInteger(n))return{kind:"malformed",reason:"schemaVersion must be an integer"};let r=n===void 0?f:n;if(r!==f&&r!==m)return{kind:"unsupported",schemaVersion:r,direction:r<f?"older":"future"};let s=t.$schema;if(s!==void 0&&(typeof s!="string"||s.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let i=ee(t),a=r!==m||typeof t.$schema!="string";return r===f?{kind:"legacy",sourceVersion:f,config:i,needsMigration:a}:{kind:"supported",sourceVersion:m,config:i,needsMigration:a}}function ee(e){let t=e,{$schema:n,schemaVersion:r,...s}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:ue,schemaVersion:m,...s}}import{createHash as pe}from"crypto";var k=1,te=2,ne=1,_=1,E="sha256";function Be(e,t,n){if(!p(e)||!w(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:ne,canonicalizationVersion:_,hashAlgorithm:E,projection:{name:e,version:t},digest:pe(E).update(le(e,t,n)).digest("hex")}}function le(e,t,n){return`{"canonicalizationVersion":${_},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function fe(e){if(!d(e))return{kind:"malformed",reason:"observation receipt must be an object"};let t=e.schemaVersion;if(!Number.isInteger(t))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(t===k)return ge(e)?{kind:"legacy",schemaVersion:k,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===te)return he(e)?{kind:"supported",schemaVersion:te,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<k?"older":"future"}}function re(e){let t=fe(e);return t.kind==="legacy"||t.kind==="supported"}function me(e,t){return e.schemaVersion===t.schemaVersion&&e.canonicalizationVersion===t.canonicalizationVersion&&e.hashAlgorithm===t.hashAlgorithm&&e.projection.name===t.projection.name&&e.projection.version===t.projection.version}function ge(e){if(!d(e))return!1;let t=e.index,n=e.worktree;return oe(e.observedAt)&&p(e.projectIdentity)&&Oe(e.authorityKind)&&(t===void 0||d(t)&&p(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||d(n)&&p(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||p(n.headCommit))&&(n.treeOid===void 0||p(n.treeOid)))&&Se(e.authorityKind,t,n)}function he(e){if(!d(e))return!1;let t=e.facts,n=e.observedSources,r=e.stabilityProofs;if(!oe(e.observedAt)||!d(t)||!Array.isArray(n)||n.length===0||!n.every(be)||!A(n,o=>o.kind)||!Array.isArray(r)||!r.every(ve)||!A(r,o=>o.source)||r.some(o=>!n.some(u=>u.kind===o.source))||!r.every(o=>xe(o,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(o=>t[o]!==void 0&&!l(t[o])))return!1;let i=t.relevantInputs;if(i!==void 0&&(!Array.isArray(i)||!i.every(ye)||!A(i,o=>`${o.subject}\0${o.identity.projection.name}`)))return!1;let a=t.index;if(a!==void 0&&(!d(a)||!l(a.generation)||a.inputs!==void 0&&!l(a.inputs)||a.source!=="immutable"&&a.source!=="legacy"))return!1;let c=e.diagnostics;return(c===void 0||d(c)&&(c.clean===void 0||typeof c.clean=="boolean")&&(c.headCommit===void 0||p(c.headCommit))&&(c.treeOid===void 0||p(c.treeOid)))&&Ce(t,n)}function l(e){return!d(e)||!d(e.projection)?!1:e.schemaVersion===ne&&e.canonicalizationVersion===_&&e.hashAlgorithm===E&&p(e.projection.name)&&w(e.projection.version)&&B(e.digest)}function ye(e){return d(e)&&p(e.subject)&&l(e.identity)}function be(e){return d(e)&&ie(e.kind)&&(e.identity===void 0||l(e.identity))}function ve(e){return d(e)&&ie(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,t){let n=e.index,r=t.find(o=>o.kind==="index-generation");if(r){if(!d(n)||!l(n.generation)||r.identity&&!j(r.identity,n.generation))return!1}else if(n!==void 0)return!1;let s=e.workspaceInstance,i=t.find(o=>o.kind==="live-workspace");if(i?.identity&&(!l(s)||!j(i.identity,s)))return!1;let a=e.wholeContent,c=t.find(o=>o.kind==="repository-snapshot");return!(c?.identity&&(!l(a)||!j(c.identity,a)))}function xe(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&d(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function j(e,t){return me(e,t)&&e.digest===t.digest}function Se(e,t,n){return e==="index-worktree"?t!==void 0&&n!==void 0:e==="index-only"?t!==void 0&&n===void 0:e==="worktree-only"?t===void 0&&n!==void 0:e==="process-local"&&t===void 0&&n===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function ie(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function oe(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function A(e,t){return new Set(e.map(t)).size===e.length}function He(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.kind==="automated-adjudication"&&t.policyVersion===1&&(t.decidedBy==="agent"||t.decidedBy==="human")&&G.includes(t.reasonCode)&&Array.isArray(t.evidence)&&t.evidence.length>0&&t.evidence.every(we)&&(t.observation===void 0||re(t.observation))&&!!t.invalidateOn&&typeof t.invalidateOn=="object"&&typeof t.invalidateOn.targetContentChange=="boolean"&&typeof t.invalidateOn.detectorMajorChange=="boolean"}function we(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="source"||t.kind==="config"||t.kind==="test"||t.kind==="graph")&&typeof t.referent=="string"&&t.referent.trim()!==""&&typeof t.claim=="string"&&t.claim.trim()!==""&&(t.contentHash===void 0||/^[a-f0-9]{64}$/u.test(t.contentHash))&&(t.generation===void 0||typeof t.generation=="string"&&t.generation.length>0)}var h=".scipquery.json",Ie=2e3,se=5e3,ae=se,ke=15*6e4,ce={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},je={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:Ie,cooldownMs:ae,gitPollMs:2e3,idleTimeoutMs:ke,autoRefresh:!0,ignore:[],resourceBudget:ce};var it=new Set(L);function ot(e){let t=Pe(e,h);if(!Re(t))return{};let n;try{n=F(t,{maxBytes:V,inputKind:"scip-query project config"})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${h} at ${t}: ${s}`,{cause:r})}return Ae(Z(n),t,"read").config}function st(e){return{...je,...e.watch,cooldownMs:Math.max(se,e.watch?.cooldownMs??ae),resourceBudget:{...ce,...e.watch?.resourceBudget}}}function Ae(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let s=n==="read"?`invalid ${h} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${s} The file was left untouched.`)}let r=n==="read"?`invalid ${h} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${f} and current v${m}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as y,lstatSync as Ee}from"fs";import{resolve as _e}from"path";function xt(e,t,n,r={}){let s=new Date().toISOString();if(!y(n.dbPath))return{state:"missing",checkedAt:s,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(n.metaPath))return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let i=R(S(n.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: scip-query reindex"};let a=i.metadata,c=t.languages??Q(e),o=a.fingerprint,u=n.cacheDir&&r.gitContext&&I(r.gitContext,n.cacheDir,o)?o:void 0,g=n.cacheDir&&r.gitContext&&u&&Ne(u,c,t)&&Te(e,u,t)?r.gitObservation?.context===r.gitContext?r.gitContext:H(r.gitContext):void 0,de=r.gitObservation&&r.gitObservation.context===r.gitContext?r.gitObservation.projectFileInventorySequence:void 0,M=g?.clean&&W(e,void 0,{cachedInventoryAfterSequence:de})?g:void 0,b=n.cacheDir&&M&&u&&I(M,n.cacheDir,u)?u:Me(e,c,t),N=[...a.indexedLanguages??[]].sort(),v=i.capabilities.publishableGeneration&&q(O(a.fingerprint),b)&&JSON.stringify(N)===JSON.stringify(b.languages),C=P(n.dbPath,n.metaPath),T=C.state==="invalid"||C.state==="drifted",x=v?X(n.dbPath,b,N):void 0,$=x?.state==="incomplete",D=v&&!T&&!$;return{state:D?"fresh":"stale",checkedAt:s,metaPath:n.metaPath,updatedAt:a.updatedAt,lastRefresh:a.lastRefresh,reason:T?`SQLite generation requires repair: ${C.reason}`:$?`SQLite generation is missing ${x.missingDocumentCount} indexed source document(s): ${x.missingPaths.join(", ")}`:v?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:D?void 0:"Run: scip-query reindex"}}catch(i){return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: scip-query reindex"}}}function St(e){let t=new Date().toISOString();if(!y(e.dbPath))return{state:"missing",checkedAt:t,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(e.metaPath))return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let n=R(S(e.metaPath,"reindex metadata"));if(n.kind==="unsupported")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Reindex metadata version ${n.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(n.kind==="malformed")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${n.reason}`,remedy:"Run: scip-query reindex"};let r=n.metadata,s=[...r.indexedLanguages??[]].sort(),i=O(r.fingerprint),a=[...i?.languages??[]].sort(),c=n.capabilities.publishableGeneration&&i!==null&&JSON.stringify(s)===JSON.stringify(a),o=P(e.dbPath,e.metaPath),u=o.state==="invalid"||o.state==="drifted",g=c&&!u;return{state:g?"fresh":"stale",checkedAt:t,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:u?`SQLite generation requires repair: ${o.reason}`:c?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:g?void 0:"Run: scip-query reindex"}}catch(n){return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${n instanceof Error?n.message:String(n)}`,remedy:"Run: scip-query reindex"}}}function Me(e,t,n){return K(e,t,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}function Ne(e,t,n){let r=$e(t,n);return e.version===r.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(r.languages)&&e.pnpmWorkspaces===r.pnpmWorkspaces&&e.typescriptProjectMode===r.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(r.typescriptProjects)&&e.clojureConfigPath===r.clojureConfigPath}function Te(e,t,n){if(!(t.languages.includes("typescript")||!!t.clojureConfigPath))return!0;let s=J(e);if(t.clojureConfigPath){let i=U(t.clojureConfigPath);if(!s.includes(i))return!1;try{if(!Ee(_e(e,i)).isFile())return!1}catch{return!1}}return!t.languages.includes("typescript")||Y(e,n.indexer?.typescript?.projectMode,n.indexer?.typescript?.projects??[],s)}function $e(e,t){return z(e,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath})}export{te as a,Be as b,He as c,ot as d,st as e,xt as f,St as g};
2
+ //# sourceMappingURL=chunk-QWKHW6VZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-CXT3GZSQ.js";import{f as o}from"./chunk-WEXQYJY3.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
2
- //# sourceMappingURL=chunk-3T5U2EQ2.js.map
1
+ import{a as s}from"./chunk-7KSO2OAP.js";import{F as o}from"./chunk-AK3PYTIK.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
2
+ //# sourceMappingURL=chunk-R6M456QG.js.map
@@ -1,5 +1,5 @@
1
- import{b as L}from"./chunk-GBZCVYWA.js";import{d as S}from"./chunk-CXT3GZSQ.js";import{a as h,b as T}from"./chunk-HW7FASEL.js";import{a as C}from"./chunk-DHEQMPLW.js";import{A as I,d as f,i as w,t as F}from"./chunk-7Z4GMCHM.js";import{l as v}from"./chunk-6LS3IG2I.js";import{I as x}from"./chunk-C7WSQA6A.js";import{B as g}from"./chunk-JSHDCVUM.js";function z(e,t,n){let r=[],o=[],s=new Map;for(let i of[...e].sort(n)){let l=i.channel??"default",d=t[l]??Number.MAX_SAFE_INTEGER,a=s.get(l)??0;if(a>=d){o.push(i);continue}r.push(i),s.set(l,a+1)}return{selected:r,omitted:o}}function k(e,t,n,r,o=!1){let s=[...e],i=[],l=new Set,d=0;for(;s.length>0&&i.length<t;){let a=s.filter(u=>d+u.evidenceCharacters<=n||o&&i.length===0);if(a.length===0)break;let c=a.filter(u=>u.roles.includes("location")||u.roles.includes("definition")).sort(r);a.sort((u,p)=>R(p,l)-R(u,l)||r(u,p));let m=c[0]??a[0];i.push(m),d+=m.evidenceCharacters;for(let u of P(m))l.add(u.key);s.splice(s.indexOf(m),1)}return{selected:i,omitted:s.sort(r)}}function R(e,t){let n=P(e).reduce((s,i)=>s+(t.has(i.key)?0:i.weight),0),r=Math.max(0,8-e.priority)*20,o=Math.min(500,Math.ceil(e.evidenceCharacters/160));return n+r-o}function P(e){return[...e.reasons.map(K),...e.roles.map(t=>({key:`role:${t}`,weight:$(t)})),{key:`file:${e.relativePath}`,weight:180},{key:`scope:${A(e.relativePath)}`,weight:120},{key:`kind:${e.fileKind}`,weight:40},...e.symbols.map(t=>({key:`symbol:${t}`,weight:100})),...e.behaviorSignals.map(t=>({key:`behavior:${t}`,weight:70}))]}function K(e){let t=e.indexOf(":"),n=t<0?e:e.slice(0,t);return n==="dependency"||n==="consumer"?{key:`reason:${n}`,weight:220}:{key:`reason:${e}`,weight:n==="location"||n==="definition"?1400:800}}function $(e){switch(e){case"location":return 1200;case"definition":return 1100;case"reference":return 600;case"caller":case"callee":return 550;case"dependency":case"consumer":return 500;case"search":return 400;default:return 300}}function A(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}var E=64,M=12;function te(e,t,n={}){if(t.length===0)return[];let r=n.context??6;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`context must be a non-negative safe integer; received ${r}`);let o=n.limit??12;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`limit must be a positive safe integer; received ${o}`);let s=t.map(i=>{if(i.length===0)throw new Error("The source search pattern must not be empty.");return{pattern:i,regexp:n.regexp?C(i,"source search pattern",n.ignoreCase?"iu":"u"):null,literal:n.ignoreCase?i.toLocaleLowerCase():i,identities:[],fileCoverage:[],textByPath:new Map}});if(!n.regexp&&!n.ignoreCase){let i=s.map(d=>Buffer.from(d.pattern,"utf8")),l=S(e,{scope:n.scope,literalBytes:i.length===1?i[0]:i},(d,a)=>{let c=g(d.text);if(c.length!==0)for(let m of a){let u=s[m];u&&_(e,u,d,c,n)}});return s.map(d=>B(d,l,r,o,n))}return s.map(i=>{let l=S(e,{scope:n.scope},d=>{let a=g(d.text);a.length>0&&_(e,i,d,a,n)});return B(i,l,r,o,n)})}function _(e,t,n,r,o){let s=[];for(let a=0;a<r.length;a+=1){let c=r[a]??"",m=c.endsWith("\r")?c.slice(0,-1):c;(t.regexp?t.regexp.test(m):(o.ignoreCase?m.toLocaleLowerCase():m).includes(t.literal))&&s.push(a)}if(s.length===0)return;let i=n.relativePath;t.textByPath.set(i,n.text);let l=n.freshness.semantic.state!=="stale"&&n.freshness.semantic.basis!=="no-compiler-document"?F(e,i):[],d=v(e,i)?.callables??[];for(let a of s){let c=I(l,a),m=x(d,a),u=c&&!w(c.symbol)?c:null,p=u?.startLine??m?.startLine??c?.startLine??a,y=u?.endLine??m?.endLine??c?.endLine??a,b=L(e,i,a,p,y);t.identities.push({relativePath:i,focusLine:a,ownerSymbol:u?.symbol??null,ownerShort:u?f(u.symbol):m?.name??(c?f(c.symbol):null),ownerStartLine:b.startLine,ownerEndLine:b.endLine,fileKind:T(i),freshness:n.freshness})}t.fileCoverage.push({relativePath:i,matchingLines:s.length,returnedMatches:0,freshness:n.freshness})}function B(e,t,n,r,o){e.identities.sort(N);let s=e.identities.length>E?O(e.identities,E):e.identities,l=(r===Number.MAX_SAFE_INTEGER?e.identities:o.ranking?O(e.identities,r):e.identities.slice(0,r)).flatMap(c=>{let m=e.textByPath.get(c.relativePath),u=m===void 0?null:D(c.relativePath,m,c.focusLine,n);return u?[{...u,...c}]:[]}),d=new Map;for(let c of l)d.set(c.relativePath,(d.get(c.relativePath)??0)+1);for(let c of e.fileCoverage)c.returnedMatches=d.get(c.relativePath)??0;let a=H(e.fileCoverage);return{pattern:e.pattern,mode:o.regexp?"regexp":"literal",identities:e.identities,...s.length<e.identities.length?{identityManifest:s}:{},identityCoverage:{mode:s.length===e.identities.length?"complete":"bounded",returned:s.length,total:e.identities.length,omitted:e.identities.length-s.length},matches:l,matchingLines:e.identities.length,matchingFiles:e.fileCoverage.length,omittedMatches:Math.max(0,e.identities.length-l.length),fileCoverage:e.fileCoverage,scopeHints:a.slice(0,M),omittedScopeHints:Math.max(0,a.length-M),scannedFiles:t.scannedTextFiles,textCoverage:{basis:"current-project-text-files",candidateFiles:t.candidateFiles,scannedTextFiles:t.scannedTextFiles,scannedBytes:t.scannedBytes,skippedBinaryPaths:t.skippedBinaryPaths,skippedUnreadablePaths:t.skippedUnreadablePaths,skippedOversizedPaths:t.skippedOversizedPaths,semanticFiles:t.semanticFiles}}}function D(e,t,n,r){let o=t.split(`
1
+ import{b as L}from"./chunk-WOOAY3PA.js";import{d as S}from"./chunk-QKT4UI2Y.js";import{a as h,b as T}from"./chunk-Q6T2CAJL.js";import{a as C}from"./chunk-DHEQMPLW.js";import{A as I,d as f,i as w,t as F}from"./chunk-TD7VKJ2Y.js";import{m as v}from"./chunk-42W3LFUK.js";import{J as x}from"./chunk-7JYHQAH2.js";import{D as g}from"./chunk-Q7GBK5T7.js";function z(e,t,n){let r=[],o=[],s=new Map;for(let i of[...e].sort(n)){let l=i.channel??"default",d=t[l]??Number.MAX_SAFE_INTEGER,a=s.get(l)??0;if(a>=d){o.push(i);continue}r.push(i),s.set(l,a+1)}return{selected:r,omitted:o}}function k(e,t,n,r,o=!1){let s=[...e],i=[],l=new Set,d=0;for(;s.length>0&&i.length<t;){let a=s.filter(u=>d+u.evidenceCharacters<=n||o&&i.length===0);if(a.length===0)break;let c=a.filter(u=>u.roles.includes("location")||u.roles.includes("definition")).sort(r);a.sort((u,p)=>R(p,l)-R(u,l)||r(u,p));let m=c[0]??a[0];i.push(m),d+=m.evidenceCharacters;for(let u of P(m))l.add(u.key);s.splice(s.indexOf(m),1)}return{selected:i,omitted:s.sort(r)}}function R(e,t){let n=P(e).reduce((s,i)=>s+(t.has(i.key)?0:i.weight),0),r=Math.max(0,8-e.priority)*20,o=Math.min(500,Math.ceil(e.evidenceCharacters/160));return n+r-o}function P(e){return[...e.reasons.map(K),...e.roles.map(t=>({key:`role:${t}`,weight:$(t)})),{key:`file:${e.relativePath}`,weight:180},{key:`scope:${A(e.relativePath)}`,weight:120},{key:`kind:${e.fileKind}`,weight:40},...e.symbols.map(t=>({key:`symbol:${t}`,weight:100})),...e.behaviorSignals.map(t=>({key:`behavior:${t}`,weight:70}))]}function K(e){let t=e.indexOf(":"),n=t<0?e:e.slice(0,t);return n==="dependency"||n==="consumer"?{key:`reason:${n}`,weight:220}:{key:`reason:${e}`,weight:n==="location"||n==="definition"?1400:800}}function $(e){switch(e){case"location":return 1200;case"definition":return 1100;case"reference":return 600;case"caller":case"callee":return 550;case"dependency":case"consumer":return 500;case"search":return 400;default:return 300}}function A(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}var E=64,M=12;function te(e,t,n={}){if(t.length===0)return[];let r=n.context??6;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`context must be a non-negative safe integer; received ${r}`);let o=n.limit??12;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`limit must be a positive safe integer; received ${o}`);let s=t.map(i=>{if(i.length===0)throw new Error("The source search pattern must not be empty.");return{pattern:i,regexp:n.regexp?C(i,"source search pattern",n.ignoreCase?"iu":"u"):null,literal:n.ignoreCase?i.toLocaleLowerCase():i,identities:[],fileCoverage:[],textByPath:new Map}});if(!n.regexp&&!n.ignoreCase){let i=s.map(d=>Buffer.from(d.pattern,"utf8")),l=S(e,{scope:n.scope,literalBytes:i.length===1?i[0]:i},(d,a)=>{let c=g(d.text);if(c.length!==0)for(let m of a){let u=s[m];u&&_(e,u,d,c,n)}});return s.map(d=>B(d,l,r,o,n))}return s.map(i=>{let l=S(e,{scope:n.scope},d=>{let a=g(d.text);a.length>0&&_(e,i,d,a,n)});return B(i,l,r,o,n)})}function _(e,t,n,r,o){let s=[];for(let a=0;a<r.length;a+=1){let c=r[a]??"",m=c.endsWith("\r")?c.slice(0,-1):c;(t.regexp?t.regexp.test(m):(o.ignoreCase?m.toLocaleLowerCase():m).includes(t.literal))&&s.push(a)}if(s.length===0)return;let i=n.relativePath;t.textByPath.set(i,n.text);let l=n.freshness.semantic.state!=="stale"&&n.freshness.semantic.basis!=="no-compiler-document"?F(e,i):[],d=v(e,i)?.callables??[];for(let a of s){let c=I(l,a),m=x(d,a),u=c&&!w(c.symbol)?c:null,p=u?.startLine??m?.startLine??c?.startLine??a,y=u?.endLine??m?.endLine??c?.endLine??a,b=L(e,i,a,p,y);t.identities.push({relativePath:i,focusLine:a,ownerSymbol:u?.symbol??null,ownerShort:u?f(u.symbol):m?.name??(c?f(c.symbol):null),ownerStartLine:b.startLine,ownerEndLine:b.endLine,fileKind:T(i),freshness:n.freshness})}t.fileCoverage.push({relativePath:i,matchingLines:s.length,returnedMatches:0,freshness:n.freshness})}function B(e,t,n,r,o){e.identities.sort(N);let s=e.identities.length>E?O(e.identities,E):e.identities,l=(r===Number.MAX_SAFE_INTEGER?e.identities:o.ranking?O(e.identities,r):e.identities.slice(0,r)).flatMap(c=>{let m=e.textByPath.get(c.relativePath),u=m===void 0?null:D(c.relativePath,m,c.focusLine,n);return u?[{...u,...c}]:[]}),d=new Map;for(let c of l)d.set(c.relativePath,(d.get(c.relativePath)??0)+1);for(let c of e.fileCoverage)c.returnedMatches=d.get(c.relativePath)??0;let a=H(e.fileCoverage);return{pattern:e.pattern,mode:o.regexp?"regexp":"literal",identities:e.identities,...s.length<e.identities.length?{identityManifest:s}:{},identityCoverage:{mode:s.length===e.identities.length?"complete":"bounded",returned:s.length,total:e.identities.length,omitted:e.identities.length-s.length},matches:l,matchingLines:e.identities.length,matchingFiles:e.fileCoverage.length,omittedMatches:Math.max(0,e.identities.length-l.length),fileCoverage:e.fileCoverage,scopeHints:a.slice(0,M),omittedScopeHints:Math.max(0,a.length-M),scannedFiles:t.scannedTextFiles,textCoverage:{basis:"current-project-text-files",candidateFiles:t.candidateFiles,scannedTextFiles:t.scannedTextFiles,scannedBytes:t.scannedBytes,skippedBinaryPaths:t.skippedBinaryPaths,skippedUnreadablePaths:t.skippedUnreadablePaths,skippedOversizedPaths:t.skippedOversizedPaths,semanticFiles:t.semanticFiles}}}function D(e,t,n,r){let o=t.split(`
2
2
  `),s=t.endsWith(`
3
3
  `)?o.length-1:o.length;if(n<0||n>=s)return null;let i=Math.max(0,n-r),l=Math.min(s-1,n+r);return{relativePath:e,startLine:i,endLine:l,focusLine:n,source:o.slice(i,l+1).join(`
4
4
  `)}}function H(e){let t=new Map;for(let n of e){let r=j(n.relativePath),o=t.get(r)??{matchingLines:0,matchingFiles:0};o.matchingLines+=n.matchingLines,o.matchingFiles+=1,t.set(r,o)}return[...t.entries()].map(([n,r])=>({scope:n,...r})).sort((n,r)=>r.matchingLines-n.matchingLines||r.matchingFiles-n.matchingFiles||n.scope.localeCompare(r.scope))}function j(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}function O(e,t){let n=e.map((o,s)=>({...o,priority:h(o.fileKind),sequence:s,evidenceCharacters:1,roles:["search"],reasons:["search"],symbols:o.ownerSymbol?[o.ownerSymbol]:[],behaviorSignals:[]})),r=[];for(let o of[0,1,2]){let s=t-r.length;if(s===0)break;let i=n.filter(l=>h(l.fileKind)===o);r.push(...k(i,s,Number.MAX_SAFE_INTEGER,N).selected)}return r.map(({priority:o,sequence:s,evidenceCharacters:i,roles:l,reasons:d,symbols:a,behaviorSignals:c,...m})=>m)}function N(e,t){return h(e.fileKind)-h(t.fileKind)||+(t.ownerSymbol!==null)-+(e.ownerSymbol!==null)||e.relativePath.localeCompare(t.relativePath)||e.focusLine-t.focusLine}export{z as a,k as b,te as c};
5
- //# sourceMappingURL=chunk-RZWBTKXO.js.map
5
+ //# sourceMappingURL=chunk-RDULNRSJ.js.map
@@ -1,2 +1,2 @@
1
- import{d as f}from"./chunk-SRIZDEWX.js";import{a as L}from"./chunk-T2PBOVDI.js";import{n as a,z as l}from"./chunk-NP4JFCLE.js";import{c as i,d as b,e as u,k as c}from"./chunk-DRENNWRG.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
2
- //# sourceMappingURL=chunk-YKHL4J3G.js.map
1
+ import{d as f}from"./chunk-SVHTMVA4.js";import{a as L}from"./chunk-EELPBR7E.js";import{B as l,o as a}from"./chunk-C7IJMOFP.js";import{c as i,d as b,e as u,k as c}from"./chunk-DRENNWRG.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
2
+ //# sourceMappingURL=chunk-RHHCLWQ6.js.map
@@ -1,4 +1,4 @@
1
- import{b as be}from"./chunk-EPLE5O5O.js";import{g as ye,j as O,r as M,v as P,z as G}from"./chunk-NP4JFCLE.js";import{e as pe}from"./chunk-FYCH2EYQ.js";var Oe=12,De=20,oe=200,ie=800,Ie=.9,Me=64,ke=pe("behavior-construct-ranges"),ge={if_statement:"branch",conditional_expression:"branch",ternary_expression:"branch",switch_statement:"branch",switch_expression:"branch",switch_case:"branch",case_statement:"branch",match_statement:"branch",match_expression:"branch",match_arm:"branch",for_statement:"loop",for_in_statement:"loop",for_of_statement:"loop",while_statement:"loop",do_statement:"loop",await_expression:"await",return_statement:"return",throw_statement:"throw",raise_statement:"throw",assignment_expression:"mutation",augmented_assignment_expression:"mutation",assignment:"mutation",pair:"shape",field_initializer:"shape",spread_element:"spread",dictionary_splat:"spread",catch_clause:"catch",except_clause:"catch",finally_clause:"finally"},Z=["anchor","signature","binding","branch","loop","call","await","return","throw","mutation","shape","spread","catch","finally"],Ce=[...Z,"lifecycle"],_e=["loop","await","throw","mutation","spread","catch","finally","lifecycle"],Ye=new Set(["onBeforeMount","onBeforeUnmount","onMounted","onUnmounted","useEffect","useInsertionEffect","useLayoutEffect"]);var Ne=new Set(["object","object_pattern","dictionary","field_declaration_list","struct_expression","struct_pattern"]);function Ct(e,n,t,o,r=[],a={}){let s=P(e,n);if(!s)return null;let l=O(e,n),c=ee(e,n,t,o,r),u=ne(e,n,c.startLine,c.endLine),d=u?.startLine??t,p=u?.endLine??o,N=(u?I(s.rootNode,c.startLine,c.endLine):null)??M(s.rootNode,d,p);if(!N)return null;let b=Le(N,l,d,p,r);if(!b||b.lines.length===0||b.lines.some(S=>S.text.length>ie))return null;let h=ot(l,d,p),C=it(b);if((a.requireSavings??!0)&&C>=h*Ie)return null;let x=Z.filter(S=>b.lines.some(v=>v.signals.includes(S)));return{...u?{callable:{name:u.name,startLine:u.startLine,endLine:u.endLine}}:{},representation:"outline",constructKind:b.constructKind,signature:b.signature,lines:b.lines,signals:x,testCases:be(n)==="test"?ut(l,d,p):[],coverage:{sourceStatements:b.sourceStatements,representedStatements:b.sourceStatements,copiedStatements:b.copiedStatements,omittedStatements:0},rawCharacters:h,outlineCharacters:C,candidateLines:b.sourceStatements,omittedLines:0}}function _t(e,n,t,o,r){if(r.length===0)return[];let a=P(e,n);if(!a)return[];let s=O(e,n),l=ee(e,n,t,o,r),c=ne(e,n,l.startLine,l.endLine),u=c?.startLine??t,d=c?.endLine??o,p=(c?I(a.rootNode,l.startLine,l.endLine):null)??M(a.rootNode,u,d);if(!p)return[];let N=Le(p,s,u,d,r);return N?N.lines.filter(b=>b.text.length<=ie&&b.signals.some(h=>["branch","loop","catch","finally"].includes(h))&&r.some(h=>h>=b.line&&h<=b.endLine)):[]}function Nt(e,n,t,o){let r=P(e,n);if(!r)return null;let a=I(r.rootNode,t,o)??M(r.rootNode,t,o);if(!a)return null;let s=[],l=se(a),c=[];return ce(a,a,u=>{if(Y.has(u.type)||je.has(u.type)){ze(s,c,u);return}if(te.has(u.type)){He(s,c,u);return}if(z.has(u.type)){Ue(s,c,u);return}H.has(u.type)&&Ke(s,u)}),{facts:Je(s),terminals:we(l),unsupported:c}}function ee(e,n,t,o,r=[]){let a=r.filter(d=>d>=t&&d<=o),s=ke.get(e,n,ye(e,n)??"",()=>new Map),l=`${t}:${o}:${a.join(",")}`,c=s.get(l);if(c)return s.delete(l),s.set(l,c),{startLine:c[0],endLine:c[1]};let u=$e(e,n,t,o,a);if(s.set(l,[u.startLine,u.endLine]),s.size>Me){let d=s.keys().next().value;d!==void 0&&s.delete(d)}return u}function $e(e,n,t,o,r){let a=P(e,n),s=[];if(r.length>0&&a){let d=[],p=r[0],N=p;for(let h of r)p=Math.min(p,h),N=Math.max(N,h);Ee(a.rootNode,p,N,h=>{Qe(h)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&d.push(h),T.has(h.type)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&s.push(h)});let b=d.sort((h,C)=>h.endPosition.row-h.startPosition.row-(C.endPosition.row-C.startPosition.row)||h.startPosition.row-C.startPosition.row)[0];if(b)return{startLine:b.startPosition.row,endLine:b.endPosition.row}}let l=ne(e,n,t,o);if(l)return{startLine:l.startLine,endLine:l.endLine};if(r.length===0)return{startLine:t,endLine:o};let c=(G(e,n)?.callables??[]).filter(d=>d.startLine>=t&&d.endLine<=o&&r.every(p=>d.startLine<=p&&d.endLine>=p)).sort((d,p)=>d.endLine-d.startLine-(p.endLine-p.startLine)||d.startLine-p.startLine)[0];if(!a)return c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o};let u=s.sort((d,p)=>d.endPosition.row-d.startPosition.row-(p.endPosition.row-p.startPosition.row)||d.startPosition.row-p.startPosition.row)[0];return u?{startLine:u.startPosition.row,endLine:u.endPosition.row}:c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o}}function xt(e,n,t,o,r={}){if(o-t+1<(r.minimumBodyLines??De))return null;let s=Re(e,n,t,o,[],!1);if(!s)return null;let l=s.candidates.map(S=>({...S,signals:S.signals.filter(v=>v!=="anchor"&&v!=="signature")})).filter(S=>S.signals.length>0);if(l.length===0)return null;let c=ct(l),u=l.filter(S=>S.text.length<=oe);if(u.length===0)return null;let d=_e.filter(S=>(c[S]??0)>0),p=d.filter(S=>S!=="await"),N=s.shapes.reduce((S,v)=>S+v.fields.length,0);if(p.length===0&&!((c.await??0)>0&&N>0)&&N<3)return null;let b=lt(u,c),h=new Map;for(let S of d){let v=b.find(m=>m.signals.includes(S));v&&h.set(v.line,v)}if(h.size===0){let S=b.find(v=>v.signals.includes("branch"));S&&h.set(S.line,S)}let C=Math.min(10,Math.max(1,r.maxLines??h.size)),x=new Map;for(let S of h.values()){if(x.size>=C)break;x.set(S.line,S)}return x.size>=l.length&&s.shapes.length===0?null:{owner:s.callable?.name??null,startLine:t,endLine:o,lines:[...x.values()].sort((S,v)=>S.line-v.line),shapes:s.shapes,signalCounts:c,candidateLines:l.length,omittedLines:l.length-x.size}}function vt(e,n,t,o){let r=Re(e,n,t,o,[],!1);return r?new Map(r.candidates.map(a=>[a.line,a.signals.filter(s=>s!=="lifecycle")])):new Map}var T=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),B=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Y=new Set(["if_expression","if_statement","unless","unless_statement"]),je=new Set(["conditional_expression","ternary_expression"]),te=new Set(["do_statement","enhanced_for_statement","for_expression","for_in_statement","for_of_statement","for_statement","loop_expression","while_statement"]),z=new Set(["match_expression","match_statement","switch_expression","switch_statement"]),xe=new Set(["case_statement","match_arm","switch_case","switch_default"]),H=new Set(["try_expression","try_statement"]),X=new Set(["catch_clause","except_clause","rescue"]),j=new Set(["ensure","finally_clause"]),$=new Set(["else","else_clause"]),ve=new Set(["raise_statement","return_statement","throw_statement"]),qe=new Set(["block_comment","comment","line_comment"]);function ze(e,n,t){let o=t.childForFieldName("condition")??ue(t),r=t.childForFieldName("consequence")??t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),a=t.childForFieldName("alternative")??t.namedChildren.find(c=>$.has(c.type));if(!o||!r){n.push(le(t,"conditional-fields-unresolved"));return}let s=F(o,"predicate",o.text),l=F(r,Se(r),"consequence");if(E(e,s,l,"predicate-consequence",{branchRole:"consequence"}),J(e,s,r,"consequence"),a){let c=F(a,Se(a),"alternative");E(e,s,c,"predicate-alternative",{branchRole:"alternative"}),J(e,s,a,"alternative");return}E(e,s,ae(s,"otherwise continue"),"predicate-fallthrough",{branchRole:"fallthrough"})}function He(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(s=>B.has(s.type));if(!o){n.push(le(t,"loop-body-unresolved"));return}let r=t.childForFieldName("condition"),a=F(r??t,"predicate",r?.text??R(t,o));E(e,a,F(o,"outcome","iteration"),"loop-iteration",{branchRole:"iteration"}),J(e,a,o,"iteration"),E(e,a,ae(a,"loop exits"),"loop-exit",{branchRole:"exit"})}function Ue(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),r=t.childForFieldName("value")??t.childForFieldName("condition")??t.childForFieldName("subject")??ue(t),a=We(o??t);if(!r||a.length===0){n.push(le(t,"switch-cases-unresolved"));return}let s=F(r,"predicate",r.text),l=!1;for(let c of a){let u=Xe(c);l||=u;let d=R(c,c.namedChildren.find(p=>Q(p)));E(e,s,F(c,"outcome",d||(u?"default":"case")),u?"predicate-default":"predicate-case",{branchRole:u?"default":"case"}),J(e,s,c,u?"default":"case")}l||E(e,s,ae(s,"no case matched"),"predicate-fallthrough",{branchRole:"fallthrough"})}function Ke(e,n){let t=F(n,"scope","try");for(let o of Ve(n)){let r=j.has(o.type),a=F(o,"handler",r?"finally":R(o,W(o)));E(e,t,a,r?"finally-cleanup":"exception-handler",{branchRole:r?"finally":"catch"}),Ge(e,a,o,r?"finally":"catch")}}function Ge(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"handler-throw":"handler-return",{branchRole:o,terminalKind:a})}}function J(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"predicate-throw":"predicate-return",{branchRole:o,terminalKind:a})}}function E(e,n,t,o,r){e.push({controller:n,outcome:t,subtype:o,attributes:r})}function F(e,n,t){return{kind:n,label:q(t).slice(0,ie),startLine:e.startPosition.row,endLine:e.endPosition.row,implicit:!1}}function ae(e,n){return{...e,kind:"outcome",label:n,implicit:!0}}function Se(e){return ve.has(e.type)?"terminal":"outcome"}function se(e){let n=[];return ce(e,e,t=>{ve.has(t.type)&&n.push(F(t,"terminal",t.text))}),we(n)}function ce(e,n,t){t(n);for(let o of n.namedChildren)o!==e&&T.has(o.type)||ce(e,o,t)}function We(e){let n=[],t=o=>{for(let r of o.namedChildren)z.has(r.type)||(xe.has(r.type)?n.push(r):t(r))};return t(e),n}function Ve(e){let n=[],t=o=>{for(let r of o.namedChildren)H.has(r.type)||(X.has(r.type)||j.has(r.type)?n.push(r):T.has(r.type)||t(r))};return t(e),n}function Xe(e){let n=R(e,e.namedChildren.find(t=>Q(t))).trim();return e.type==="switch_default"||/^(?:default\b|_\s*=>)/u.test(n)}function le(e,n){return{startLine:e.startPosition.row,endLine:e.endPosition.row,reason:n}}function Je(e){let n=new Map;for(let t of e)n.set(`${t.controller.startLine}\0${t.controller.endLine}\0${t.outcome.startLine}\0${t.outcome.endLine}\0${t.subtype}\0${t.outcome.label}`,t);return[...n.values()]}function we(e){let n=new Map;for(let t of e)n.set(`${t.startLine}\0${t.endLine}\0${t.kind}\0${t.label}`,t);return[...n.values()]}function Qe(e){return T.has(e.type)||te.has(e.type)||z.has(e.type)||H.has(e.type)||X.has(e.type)||j.has(e.type)}function Le(e,n,t,o,r){let s=I(e,t,o)??e,l=W(s),c=[],u=0,d=0,p=(i,f,y,g,w=!1,D=!0)=>{let K=w?y.trim():q(y);if(!K)return;let A=Math.max(t,i.startPosition.row),fe=Math.min(o,i.endPosition.row);c.push({line:A,endLine:Math.max(A,fe),depth:f,signals:Z.filter(me=>g.includes(me)||me==="anchor"&&r.some(he=>he>=A&&he<=fe)),text:K,copied:w}),D&&(u+=1,w&&(d+=1))},N=(i,f)=>{for(let y of i.namedChildren)_(y,f)},b=(i,f)=>{if(Y.has(i.type)){h(i,f,"else if");return}if($.has(i.type)){let y=i.namedChildren.find(w=>Y.has(w.type));if(y){h(y,f,"else if");return}p(i,f,"else",["branch"],!1,!1);let g=W(i)??i.namedChildren.find(w=>B.has(w.type));if(g)_(g,f+1);else for(let w of i.namedChildren)_(w,f+1);return}p(i,f,"else",["branch"],!1,!1),_(i,f+1)},h=(i,f,y=i.type.startsWith("unless")?"unless":"if")=>{let g=i.childForFieldName("condition")??ue(i),w=i.childForFieldName("consequence")??i.childForFieldName("body")??i.namedChildren.find(A=>B.has(A.type)),D=i.childForFieldName("alternative")??i.namedChildren.find(A=>$.has(A.type)),K=g?g.text:R(i,w);p(i,f,`${y} ${nt(K)}`,k(g,["branch"])),w&&_(w,f+1),D&&b(D,f)},C=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["loop"])),y&&_(y,f+1)},x=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["branch"])),y&&_(y,f+1)},S=(i,f)=>{let y=i.namedChildren.find(g=>Q(g));p(i,f,R(i,y),["branch"],!1,!1);for(let g of i.namedChildren)(g===y||Q(g))&&_(g,f+1)},v=(i,f)=>{p(i,f,"try",[],!1);for(let y of i.namedChildren)B.has(y.type)?_(y,f+1):(X.has(y.type)||j.has(y.type))&&_(y,f)},m=(i,f,y)=>{let g=i.childForFieldName("body")??i.namedChildren.find(D=>B.has(D.type)),w=y==="finally"?"finally":R(i,g);p(i,f,w,[y],!1,!1),g&&_(g,f+1)},L=(i,f)=>{let y=W(i);p(i,f,R(i,y),k(i,["binding"])),y&&_(y,f+1)},_=(i,f)=>{if(i.startPosition.row>o||i.endPosition.row<t||qe.has(i.type)||i.type==="empty_statement")return;if(B.has(i.type)){N(i,f);return}if(Y.has(i.type)){h(i,f);return}if(te.has(i.type)){C(i,f);return}if(z.has(i.type)){x(i,f);return}if(xe.has(i.type)){S(i,f);return}if(H.has(i.type)){v(i,f);return}if(X.has(i.type)){m(i,f,"catch");return}if(j.has(i.type)){m(i,f,"finally");return}if($.has(i.type)){b(i,f);return}if(T.has(i.type)){L(i,f);return}let g=!Be(i)||rt(i);p(i,f,i.text,k(i),g)};return _(l&&l!==s?l:s,0),u===0?null:{constructKind:tt(s),signature:et(s,l,n,t),lines:c,sourceStatements:u,copiedStatements:d}}function I(e,n,t){let o=e.namedChildren.filter(r=>r.startPosition.row<=n&&r.endPosition.row>=t);for(let r of o.sort(Ze)){let a=I(r,n,t);if(a)return a}return T.has(e.type)&&e.startPosition.row<=n&&e.endPosition.row>=t?e:null}function Ze(e,n){return e.endPosition.row-e.startPosition.row-(n.endPosition.row-n.startPosition.row)||e.startPosition.row-n.startPosition.row}function W(e){return e.childForFieldName("body")??e.childForFieldName("consequence")??e.namedChildren.find(n=>B.has(n.type))??null}function et(e,n,t,o){let r=R(e,n);return r||(t[o]??e.text).trim()}function tt(e){return e.type.includes("constructor")?"constructor":e.type.includes("method")||e.type==="method"?re(e,new Set(["class_body","class_declaration","class_definition"]))?"class method":"object method":e.type==="arrow_function"||e.type==="function_expression"||e.type==="lambda"?re(e,new Set(["object","pair"]))?"object member":"function value":e.type.includes("function")?re(e,T)?"nested function":"module function":"source construct"}function re(e,n){let t=e.parent;for(;t;){if(n.has(t.type))return!0;t=t.parent}return!1}function ue(e){return e.namedChildren.find(n=>!B.has(n.type)&&!$.has(n.type))??null}function R(e,n){if(!n)return q(e.text);let t=Math.max(0,n.startIndex-e.startIndex);return q(e.text.slice(0,t)).replace(/[:{]\s*$/u,"").trim()}function nt(e){let n=q(e);return n.startsWith("(")&&n.endsWith(")")?n.slice(1,-1).trim():n}function q(e){return e.trim().replace(/\r?\n[\t ]*/gu," ")}function k(e,n=[]){let t=new Set(n);return e&&U(e,o=>{let r=ge[o.type];r&&t.add(r),o.type==="call_expression"&&(t.add("call"),Fe(o)&&t.add("shape")),de.has(o.type)&&t.add("binding")}),Z.filter(o=>t.has(o))}function rt(e){let n=!1;return U(e,t=>{n||!t.text.includes(`
1
+ import{b as be}from"./chunk-FELGD32K.js";import{B as G,h as ye,k as O,t as M,x as P}from"./chunk-C7IJMOFP.js";import{e as pe}from"./chunk-IW5XQG5G.js";var Oe=12,De=20,oe=200,ie=800,Ie=.9,Me=64,ke=pe("behavior-construct-ranges"),ge={if_statement:"branch",conditional_expression:"branch",ternary_expression:"branch",switch_statement:"branch",switch_expression:"branch",switch_case:"branch",case_statement:"branch",match_statement:"branch",match_expression:"branch",match_arm:"branch",for_statement:"loop",for_in_statement:"loop",for_of_statement:"loop",while_statement:"loop",do_statement:"loop",await_expression:"await",return_statement:"return",throw_statement:"throw",raise_statement:"throw",assignment_expression:"mutation",augmented_assignment_expression:"mutation",assignment:"mutation",pair:"shape",field_initializer:"shape",spread_element:"spread",dictionary_splat:"spread",catch_clause:"catch",except_clause:"catch",finally_clause:"finally"},Z=["anchor","signature","binding","branch","loop","call","await","return","throw","mutation","shape","spread","catch","finally"],Ce=[...Z,"lifecycle"],_e=["loop","await","throw","mutation","spread","catch","finally","lifecycle"],Ye=new Set(["onBeforeMount","onBeforeUnmount","onMounted","onUnmounted","useEffect","useInsertionEffect","useLayoutEffect"]);var Ne=new Set(["object","object_pattern","dictionary","field_declaration_list","struct_expression","struct_pattern"]);function Ct(e,n,t,o,r=[],a={}){let s=P(e,n);if(!s)return null;let l=O(e,n),c=ee(e,n,t,o,r),u=ne(e,n,c.startLine,c.endLine),d=u?.startLine??t,p=u?.endLine??o,N=(u?I(s.rootNode,c.startLine,c.endLine):null)??M(s.rootNode,d,p);if(!N)return null;let b=Le(N,l,d,p,r);if(!b||b.lines.length===0||b.lines.some(S=>S.text.length>ie))return null;let h=ot(l,d,p),C=it(b);if((a.requireSavings??!0)&&C>=h*Ie)return null;let x=Z.filter(S=>b.lines.some(v=>v.signals.includes(S)));return{...u?{callable:{name:u.name,startLine:u.startLine,endLine:u.endLine}}:{},representation:"outline",constructKind:b.constructKind,signature:b.signature,lines:b.lines,signals:x,testCases:be(n)==="test"?ut(l,d,p):[],coverage:{sourceStatements:b.sourceStatements,representedStatements:b.sourceStatements,copiedStatements:b.copiedStatements,omittedStatements:0},rawCharacters:h,outlineCharacters:C,candidateLines:b.sourceStatements,omittedLines:0}}function _t(e,n,t,o,r){if(r.length===0)return[];let a=P(e,n);if(!a)return[];let s=O(e,n),l=ee(e,n,t,o,r),c=ne(e,n,l.startLine,l.endLine),u=c?.startLine??t,d=c?.endLine??o,p=(c?I(a.rootNode,l.startLine,l.endLine):null)??M(a.rootNode,u,d);if(!p)return[];let N=Le(p,s,u,d,r);return N?N.lines.filter(b=>b.text.length<=ie&&b.signals.some(h=>["branch","loop","catch","finally"].includes(h))&&r.some(h=>h>=b.line&&h<=b.endLine)):[]}function Nt(e,n,t,o){let r=P(e,n);if(!r)return null;let a=I(r.rootNode,t,o)??M(r.rootNode,t,o);if(!a)return null;let s=[],l=se(a),c=[];return ce(a,a,u=>{if(Y.has(u.type)||je.has(u.type)){ze(s,c,u);return}if(te.has(u.type)){He(s,c,u);return}if(z.has(u.type)){Ue(s,c,u);return}H.has(u.type)&&Ke(s,u)}),{facts:Je(s),terminals:we(l),unsupported:c}}function ee(e,n,t,o,r=[]){let a=r.filter(d=>d>=t&&d<=o),s=ke.get(e,n,ye(e,n)??"",()=>new Map),l=`${t}:${o}:${a.join(",")}`,c=s.get(l);if(c)return s.delete(l),s.set(l,c),{startLine:c[0],endLine:c[1]};let u=$e(e,n,t,o,a);if(s.set(l,[u.startLine,u.endLine]),s.size>Me){let d=s.keys().next().value;d!==void 0&&s.delete(d)}return u}function $e(e,n,t,o,r){let a=P(e,n),s=[];if(r.length>0&&a){let d=[],p=r[0],N=p;for(let h of r)p=Math.min(p,h),N=Math.max(N,h);Ee(a.rootNode,p,N,h=>{Qe(h)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&d.push(h),T.has(h.type)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&s.push(h)});let b=d.sort((h,C)=>h.endPosition.row-h.startPosition.row-(C.endPosition.row-C.startPosition.row)||h.startPosition.row-C.startPosition.row)[0];if(b)return{startLine:b.startPosition.row,endLine:b.endPosition.row}}let l=ne(e,n,t,o);if(l)return{startLine:l.startLine,endLine:l.endLine};if(r.length===0)return{startLine:t,endLine:o};let c=(G(e,n)?.callables??[]).filter(d=>d.startLine>=t&&d.endLine<=o&&r.every(p=>d.startLine<=p&&d.endLine>=p)).sort((d,p)=>d.endLine-d.startLine-(p.endLine-p.startLine)||d.startLine-p.startLine)[0];if(!a)return c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o};let u=s.sort((d,p)=>d.endPosition.row-d.startPosition.row-(p.endPosition.row-p.startPosition.row)||d.startPosition.row-p.startPosition.row)[0];return u?{startLine:u.startPosition.row,endLine:u.endPosition.row}:c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o}}function xt(e,n,t,o,r={}){if(o-t+1<(r.minimumBodyLines??De))return null;let s=Re(e,n,t,o,[],!1);if(!s)return null;let l=s.candidates.map(S=>({...S,signals:S.signals.filter(v=>v!=="anchor"&&v!=="signature")})).filter(S=>S.signals.length>0);if(l.length===0)return null;let c=ct(l),u=l.filter(S=>S.text.length<=oe);if(u.length===0)return null;let d=_e.filter(S=>(c[S]??0)>0),p=d.filter(S=>S!=="await"),N=s.shapes.reduce((S,v)=>S+v.fields.length,0);if(p.length===0&&!((c.await??0)>0&&N>0)&&N<3)return null;let b=lt(u,c),h=new Map;for(let S of d){let v=b.find(m=>m.signals.includes(S));v&&h.set(v.line,v)}if(h.size===0){let S=b.find(v=>v.signals.includes("branch"));S&&h.set(S.line,S)}let C=Math.min(10,Math.max(1,r.maxLines??h.size)),x=new Map;for(let S of h.values()){if(x.size>=C)break;x.set(S.line,S)}return x.size>=l.length&&s.shapes.length===0?null:{owner:s.callable?.name??null,startLine:t,endLine:o,lines:[...x.values()].sort((S,v)=>S.line-v.line),shapes:s.shapes,signalCounts:c,candidateLines:l.length,omittedLines:l.length-x.size}}function vt(e,n,t,o){let r=Re(e,n,t,o,[],!1);return r?new Map(r.candidates.map(a=>[a.line,a.signals.filter(s=>s!=="lifecycle")])):new Map}var T=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),B=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Y=new Set(["if_expression","if_statement","unless","unless_statement"]),je=new Set(["conditional_expression","ternary_expression"]),te=new Set(["do_statement","enhanced_for_statement","for_expression","for_in_statement","for_of_statement","for_statement","loop_expression","while_statement"]),z=new Set(["match_expression","match_statement","switch_expression","switch_statement"]),xe=new Set(["case_statement","match_arm","switch_case","switch_default"]),H=new Set(["try_expression","try_statement"]),X=new Set(["catch_clause","except_clause","rescue"]),j=new Set(["ensure","finally_clause"]),$=new Set(["else","else_clause"]),ve=new Set(["raise_statement","return_statement","throw_statement"]),qe=new Set(["block_comment","comment","line_comment"]);function ze(e,n,t){let o=t.childForFieldName("condition")??ue(t),r=t.childForFieldName("consequence")??t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),a=t.childForFieldName("alternative")??t.namedChildren.find(c=>$.has(c.type));if(!o||!r){n.push(le(t,"conditional-fields-unresolved"));return}let s=F(o,"predicate",o.text),l=F(r,Se(r),"consequence");if(E(e,s,l,"predicate-consequence",{branchRole:"consequence"}),J(e,s,r,"consequence"),a){let c=F(a,Se(a),"alternative");E(e,s,c,"predicate-alternative",{branchRole:"alternative"}),J(e,s,a,"alternative");return}E(e,s,ae(s,"otherwise continue"),"predicate-fallthrough",{branchRole:"fallthrough"})}function He(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(s=>B.has(s.type));if(!o){n.push(le(t,"loop-body-unresolved"));return}let r=t.childForFieldName("condition"),a=F(r??t,"predicate",r?.text??R(t,o));E(e,a,F(o,"outcome","iteration"),"loop-iteration",{branchRole:"iteration"}),J(e,a,o,"iteration"),E(e,a,ae(a,"loop exits"),"loop-exit",{branchRole:"exit"})}function Ue(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),r=t.childForFieldName("value")??t.childForFieldName("condition")??t.childForFieldName("subject")??ue(t),a=We(o??t);if(!r||a.length===0){n.push(le(t,"switch-cases-unresolved"));return}let s=F(r,"predicate",r.text),l=!1;for(let c of a){let u=Xe(c);l||=u;let d=R(c,c.namedChildren.find(p=>Q(p)));E(e,s,F(c,"outcome",d||(u?"default":"case")),u?"predicate-default":"predicate-case",{branchRole:u?"default":"case"}),J(e,s,c,u?"default":"case")}l||E(e,s,ae(s,"no case matched"),"predicate-fallthrough",{branchRole:"fallthrough"})}function Ke(e,n){let t=F(n,"scope","try");for(let o of Ve(n)){let r=j.has(o.type),a=F(o,"handler",r?"finally":R(o,W(o)));E(e,t,a,r?"finally-cleanup":"exception-handler",{branchRole:r?"finally":"catch"}),Ge(e,a,o,r?"finally":"catch")}}function Ge(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"handler-throw":"handler-return",{branchRole:o,terminalKind:a})}}function J(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"predicate-throw":"predicate-return",{branchRole:o,terminalKind:a})}}function E(e,n,t,o,r){e.push({controller:n,outcome:t,subtype:o,attributes:r})}function F(e,n,t){return{kind:n,label:q(t).slice(0,ie),startLine:e.startPosition.row,endLine:e.endPosition.row,implicit:!1}}function ae(e,n){return{...e,kind:"outcome",label:n,implicit:!0}}function Se(e){return ve.has(e.type)?"terminal":"outcome"}function se(e){let n=[];return ce(e,e,t=>{ve.has(t.type)&&n.push(F(t,"terminal",t.text))}),we(n)}function ce(e,n,t){t(n);for(let o of n.namedChildren)o!==e&&T.has(o.type)||ce(e,o,t)}function We(e){let n=[],t=o=>{for(let r of o.namedChildren)z.has(r.type)||(xe.has(r.type)?n.push(r):t(r))};return t(e),n}function Ve(e){let n=[],t=o=>{for(let r of o.namedChildren)H.has(r.type)||(X.has(r.type)||j.has(r.type)?n.push(r):T.has(r.type)||t(r))};return t(e),n}function Xe(e){let n=R(e,e.namedChildren.find(t=>Q(t))).trim();return e.type==="switch_default"||/^(?:default\b|_\s*=>)/u.test(n)}function le(e,n){return{startLine:e.startPosition.row,endLine:e.endPosition.row,reason:n}}function Je(e){let n=new Map;for(let t of e)n.set(`${t.controller.startLine}\0${t.controller.endLine}\0${t.outcome.startLine}\0${t.outcome.endLine}\0${t.subtype}\0${t.outcome.label}`,t);return[...n.values()]}function we(e){let n=new Map;for(let t of e)n.set(`${t.startLine}\0${t.endLine}\0${t.kind}\0${t.label}`,t);return[...n.values()]}function Qe(e){return T.has(e.type)||te.has(e.type)||z.has(e.type)||H.has(e.type)||X.has(e.type)||j.has(e.type)}function Le(e,n,t,o,r){let s=I(e,t,o)??e,l=W(s),c=[],u=0,d=0,p=(i,f,y,g,w=!1,D=!0)=>{let K=w?y.trim():q(y);if(!K)return;let A=Math.max(t,i.startPosition.row),fe=Math.min(o,i.endPosition.row);c.push({line:A,endLine:Math.max(A,fe),depth:f,signals:Z.filter(me=>g.includes(me)||me==="anchor"&&r.some(he=>he>=A&&he<=fe)),text:K,copied:w}),D&&(u+=1,w&&(d+=1))},N=(i,f)=>{for(let y of i.namedChildren)_(y,f)},b=(i,f)=>{if(Y.has(i.type)){h(i,f,"else if");return}if($.has(i.type)){let y=i.namedChildren.find(w=>Y.has(w.type));if(y){h(y,f,"else if");return}p(i,f,"else",["branch"],!1,!1);let g=W(i)??i.namedChildren.find(w=>B.has(w.type));if(g)_(g,f+1);else for(let w of i.namedChildren)_(w,f+1);return}p(i,f,"else",["branch"],!1,!1),_(i,f+1)},h=(i,f,y=i.type.startsWith("unless")?"unless":"if")=>{let g=i.childForFieldName("condition")??ue(i),w=i.childForFieldName("consequence")??i.childForFieldName("body")??i.namedChildren.find(A=>B.has(A.type)),D=i.childForFieldName("alternative")??i.namedChildren.find(A=>$.has(A.type)),K=g?g.text:R(i,w);p(i,f,`${y} ${nt(K)}`,k(g,["branch"])),w&&_(w,f+1),D&&b(D,f)},C=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["loop"])),y&&_(y,f+1)},x=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["branch"])),y&&_(y,f+1)},S=(i,f)=>{let y=i.namedChildren.find(g=>Q(g));p(i,f,R(i,y),["branch"],!1,!1);for(let g of i.namedChildren)(g===y||Q(g))&&_(g,f+1)},v=(i,f)=>{p(i,f,"try",[],!1);for(let y of i.namedChildren)B.has(y.type)?_(y,f+1):(X.has(y.type)||j.has(y.type))&&_(y,f)},m=(i,f,y)=>{let g=i.childForFieldName("body")??i.namedChildren.find(D=>B.has(D.type)),w=y==="finally"?"finally":R(i,g);p(i,f,w,[y],!1,!1),g&&_(g,f+1)},L=(i,f)=>{let y=W(i);p(i,f,R(i,y),k(i,["binding"])),y&&_(y,f+1)},_=(i,f)=>{if(i.startPosition.row>o||i.endPosition.row<t||qe.has(i.type)||i.type==="empty_statement")return;if(B.has(i.type)){N(i,f);return}if(Y.has(i.type)){h(i,f);return}if(te.has(i.type)){C(i,f);return}if(z.has(i.type)){x(i,f);return}if(xe.has(i.type)){S(i,f);return}if(H.has(i.type)){v(i,f);return}if(X.has(i.type)){m(i,f,"catch");return}if(j.has(i.type)){m(i,f,"finally");return}if($.has(i.type)){b(i,f);return}if(T.has(i.type)){L(i,f);return}let g=!Be(i)||rt(i);p(i,f,i.text,k(i),g)};return _(l&&l!==s?l:s,0),u===0?null:{constructKind:tt(s),signature:et(s,l,n,t),lines:c,sourceStatements:u,copiedStatements:d}}function I(e,n,t){let o=e.namedChildren.filter(r=>r.startPosition.row<=n&&r.endPosition.row>=t);for(let r of o.sort(Ze)){let a=I(r,n,t);if(a)return a}return T.has(e.type)&&e.startPosition.row<=n&&e.endPosition.row>=t?e:null}function Ze(e,n){return e.endPosition.row-e.startPosition.row-(n.endPosition.row-n.startPosition.row)||e.startPosition.row-n.startPosition.row}function W(e){return e.childForFieldName("body")??e.childForFieldName("consequence")??e.namedChildren.find(n=>B.has(n.type))??null}function et(e,n,t,o){let r=R(e,n);return r||(t[o]??e.text).trim()}function tt(e){return e.type.includes("constructor")?"constructor":e.type.includes("method")||e.type==="method"?re(e,new Set(["class_body","class_declaration","class_definition"]))?"class method":"object method":e.type==="arrow_function"||e.type==="function_expression"||e.type==="lambda"?re(e,new Set(["object","pair"]))?"object member":"function value":e.type.includes("function")?re(e,T)?"nested function":"module function":"source construct"}function re(e,n){let t=e.parent;for(;t;){if(n.has(t.type))return!0;t=t.parent}return!1}function ue(e){return e.namedChildren.find(n=>!B.has(n.type)&&!$.has(n.type))??null}function R(e,n){if(!n)return q(e.text);let t=Math.max(0,n.startIndex-e.startIndex);return q(e.text.slice(0,t)).replace(/[:{]\s*$/u,"").trim()}function nt(e){let n=q(e);return n.startsWith("(")&&n.endsWith(")")?n.slice(1,-1).trim():n}function q(e){return e.trim().replace(/\r?\n[\t ]*/gu," ")}function k(e,n=[]){let t=new Set(n);return e&&U(e,o=>{let r=ge[o.type];r&&t.add(r),o.type==="call_expression"&&(t.add("call"),Fe(o)&&t.add("shape")),de.has(o.type)&&t.add("binding")}),Z.filter(o=>t.has(o))}function rt(e){let n=!1;return U(e,t=>{n||!t.text.includes(`
2
2
  `)||/(?:string|template|heredoc|raw_string)/u.test(t.type)&&(n=!0)}),n}function Q(e){return B.has(e.type)||Y.has(e.type)||te.has(e.type)||z.has(e.type)||H.has(e.type)||T.has(e.type)||Be(e)}function Be(e){return/(?:statement|declaration|expression|assignment|return|throw|raise|break|continue|yield|with_item)$/u.test(e.type)||de.has(e.type)}function ot(e,n,t){let o=0;for(let r=n;r<=t;r+=1)o+=(e[r]?.length??0)+10;return o}function it(e){return e.constructKind.length+e.signature.length+80+e.lines.reduce((n,t)=>n+t.text.length+t.depth*2+10,0)}function Re(e,n,t,o,r,a){let s=P(e,n);if(!s)return null;let l=O(e,n),c=ne(e,n,t,o),u=a?c?.startLine??t:t,d=a?c?.endLine??o:o,N=(c?.startLine===u&&c.endLine===d?I(s.rootNode,u,d):null)??M(s.rootNode,u,d);if(!N)return null;let b=new Map,h=new Map,C=new Map,x=(m,L)=>{if(m<u||m>d)return;let _=b.get(m)??new Set;_.add(L),b.set(m,_)};c&&x(c.startLine,"signature");for(let m of r)x(m,"anchor");U(N,m=>{let L=ge[m.type];if(L&&x(m.startPosition.row,L),L==="shape"&&at(h,m,N,u,d),m.type==="call_expression"){let i=(m.childForFieldName("function")??m.namedChild(0))?.text.split(".").at(-1);if(Fe(m)){x(m.startPosition.row,"shape");let f=V(m.text);f.length<=oe&&C.set(m.startPosition.row,f)}if(i&&Ye.has(i)){x(m.startPosition.row,"lifecycle");let f=V(m.text);f.length<=oe&&C.set(m.startPosition.row,f)}}de.has(m.type)&&x(m.startPosition.row,"binding")});let S=G(e,n);for(let m of S?.callSites??[])m.line<u||m.line>d||(x(m.line,"call"),m.calleeLeaf==="catch"&&x(m.line,"catch"));let v=[...b.entries()].sort(([m],[L])=>m-L).map(([m,L])=>({line:m,signals:Ce.filter(_=>L.has(_)),text:C.get(m)??V(l[m]??"")})).filter(m=>m.text.length>0||m.signals.includes("anchor"));return{...c?{callable:c}:{},rangeStart:u,rangeEnd:d,sourceLines:l,candidates:v,shapes:[...h.values()].sort((m,L)=>m.startLine-L.startLine)}}function at(e,n,t,o,r){if(n.startPosition.row<o||n.endPosition.row>r)return;let a=n.childForFieldName("key")??n.childForFieldName("name")??n.namedChild(0),s=V(a?.text??"");if(!s||s.includes(`
3
3
  `)||s.length>60)return;let l=st(n,t);if(l.startPosition.row<o||l.endPosition.row>r)return;let c=`${l.startPosition.row}:${l.endPosition.row}`,u=e.get(c)??{startLine:l.startPosition.row,endLine:l.endPosition.row,fields:[]};u.fields.some(d=>d.name===s&&d.line===n.startPosition.row)||u.fields.push({name:s,line:n.startPosition.row}),e.set(c,u)}function st(e,n){let t=e.parent;for(;t&&t!==n.parent;){if(Ne.has(t.type))return t;if(t===n)break;t=t.parent}return e.parent??e}function ne(e,n,t,o){return G(e,n)?.callables.filter(r=>r.startLine<=t&&r.endLine>=o).sort((r,a)=>r.endLine-r.startLine-(a.endLine-a.startLine)||r.startLine-a.startLine)[0]}function U(e,n){n(e);for(let t of e.namedChildren)U(t,n)}function Ee(e,n,t,o){o(e);for(let r of e.namedChildren)r.startPosition.row>n||r.endPosition.row<t||Ee(r,n,t,o)}function V(e){return e.trim().replace(/\s+/gu," ")}function Fe(e){if(e.type!=="call_expression")return!1;let n=e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"||o.type==="argument_list");if(!n)return!1;let t=!1;return U(n,o=>{Ne.has(o.type)&&(t=!0)}),t}function ct(e){let n={};for(let t of Ce){let o=e.filter(r=>r.signals.includes(t)).length;o>0&&(n[t]=o)}return n}function lt(e,n){let t=new Map;for(let a of e){let s=a.signals.join(",");t.set(s,(t.get(s)??0)+1)}let o=new Set(_e),r=a=>{let s=t.get(a.signals.join(","))??1,l=Math.min(...a.signals.map(d=>n[d]??1)),c=a.signals.some(d=>o.has(d))?3:1,u=Math.max(0,a.signals.length-1)*1e3;return c*(1e3/s+1e3/l)+u};return[...e].sort((a,s)=>r(s)-r(a)||s.line-a.line)}var de=new Set(["lexical_declaration","variable_declarator","const_item","static_item","let_declaration","assignment"]);function ut(e,n,t){let o=[],r=/\b(?:describe|it|test)(?:\.(?:only|skip|todo))?\s*\(\s*(['"`])([^'"`]+)\1/u;for(let a=n;a<=t;a+=1){let s=r.exec(e[a]??"")?.[2];if(!(!s||o.includes(s))&&(o.push(s),o.length>=Oe))break}return o}var dt=new Set(["arrow_function","class_declaration","constructor_declaration","field_definition","function_declaration","function_definition","function_expression","function_item","generator_function_declaration","generator_function","lexical_declaration","method","method_declaration","method_definition","object_method","variable_declaration"]);function ft(e,n,t){let o=P(e,n)?.rootNode??null,r=mt(o,t);if(!r)return null;let a=O(e,n);if(a.length===0)return null;let s=Math.max(0,r.startPosition.row),l=r.endPosition.column===0?r.endPosition.row-1:r.endPosition.row;return{type:r.type,startLine:s,endLine:Math.min(a.length-1,Math.max(s,l))}}function Et(e,n,t,o,r){let a=ee(e,n,o,r,[t]),s=a.startLine===a.endLine&&/(?:=>|\(|\{|\[|,)\s*$/u.test(O(e,n)[a.startLine]??"");if(!s&&(a.startLine>o||a.endLine<r))return a;let l=ft(e,n,t);return s&&l?{startLine:l.startLine,endLine:l.endLine}:l&&l.startLine>=o&&l.endLine<=r?{startLine:l.startLine,endLine:l.endLine}:{startLine:o,endLine:r}}function mt(e,n){if(!e||!Ae(e,n))return null;let t=Te(e,n);for(;t;){if(dt.has(t.type))return t;t=t.parent}return null}function Te(e,n){let t=e.namedChildren.filter(o=>Ae(o,n)).sort((o,r)=>Pe(o)-Pe(r));return t.length>0?Te(t[0],n):e}function Ae(e,n){return e.startPosition.row<=n&&e.endPosition.row>=n}function Pe(e){return e.endIndex-e.startIndex}export{Ct as a,_t as b,Nt as c,ee as d,xt as e,vt as f,ft as g,Et as h};
4
- //# sourceMappingURL=chunk-YF25RQER.js.map
4
+ //# sourceMappingURL=chunk-RNKPYYYE.js.map
@@ -1,4 +1,4 @@
1
- import{c as g}from"./chunk-NODZYYGC.js";import{a as y}from"./chunk-7MUHSZGN.js";import{d as p}from"./chunk-7Z4GMCHM.js";import{b as h,f as l,h as d}from"./chunk-6LS3IG2I.js";import{C as b}from"./chunk-C7WSQA6A.js";import{ua as u,va as f}from"./chunk-WEXQYJY3.js";function T(t,e,s={}){let n=y(t,e);if(!n)return null;let o=new g(t),a=L(t,n),r=n.endLine-n.startLine+1,m=o.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(B=>B.symbol));return{symbol:n.symbol,shortName:p(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:a.branches,estimateBasis:a.estimateBasis,cyclomaticEstimate:a.branches+1,calleeCount:c.size,fanIn:N(t,n.symbolId),fanOut:w(m,n.relativePath)}}function L(t,e){let s=b(t,e.relativePath);if(s){let n=d(s.rootNode,e.startLine,e.endLine);if(n)return{branches:M(n),estimateBasis:"ast"}}return{branches:E(_(t,e.relativePath,e.startLine,e.endLine),S(t,e.relativePath)),estimateBasis:"regex-fallback"}}function j(t,e){let s=new Map,n=new Map;for(let o of e){let a=n.get(o.relativePath)??[];a.push(o),n.set(o.relativePath,a)}for(let[o,a]of n){let r=b(t,o),i=r===null?[]:a.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});v(r.rootNode,i,s)}for(let c of a)m.has(c.symbolId)||s.set(c.symbolId,P(t,c))}return s}function P(t,e){return{branches:E(_(t,e.relativePath,e.startLine,e.endLine),S(t,e.relativePath)),estimateBasis:"regex-fallback"}}function S(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function _(t,e,s,n){try{return u(t.config.projectRoot,e,{inputKind:"indexed source file"}).split(`
1
+ import{c as g}from"./chunk-PLYUVM4F.js";import{a as y}from"./chunk-5H5WTJSD.js";import{d as p}from"./chunk-TD7VKJ2Y.js";import{b as h,g as l,i as d}from"./chunk-42W3LFUK.js";import{C as b}from"./chunk-7JYHQAH2.js";import{xa as u,ya as f}from"./chunk-GH5YSGZL.js";function T(t,e,s={}){let n=y(t,e);if(!n)return null;let o=new g(t),a=L(t,n),r=n.endLine-n.startLine+1,m=o.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(B=>B.symbol));return{symbol:n.symbol,shortName:p(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:a.branches,estimateBasis:a.estimateBasis,cyclomaticEstimate:a.branches+1,calleeCount:c.size,fanIn:N(t,n.symbolId),fanOut:w(m,n.relativePath)}}function L(t,e){let s=b(t,e.relativePath);if(s){let n=d(s.rootNode,e.startLine,e.endLine);if(n)return{branches:M(n),estimateBasis:"ast"}}return{branches:E(_(t,e.relativePath,e.startLine,e.endLine),S(t,e.relativePath)),estimateBasis:"regex-fallback"}}function j(t,e){let s=new Map,n=new Map;for(let o of e){let a=n.get(o.relativePath)??[];a.push(o),n.set(o.relativePath,a)}for(let[o,a]of n){let r=b(t,o),i=r===null?[]:a.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});v(r.rootNode,i,s)}for(let c of a)m.has(c.symbolId)||s.set(c.symbolId,P(t,c))}return s}function P(t,e){return{branches:E(_(t,e.relativePath,e.startLine,e.endLine),S(t,e.relativePath)),estimateBasis:"regex-fallback"}}function S(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function _(t,e,s,n){try{return u(t.config.projectRoot,e,{inputKind:"indexed source file"}).split(`
2
2
  `).slice(s,n+1).join(`
3
3
  `)}catch(o){if(!f(o))throw o;return""}}function N(t,e){return t.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
4
  FROM mentions m
@@ -13,4 +13,4 @@ import{c as g}from"./chunk-NODZYYGC.js";import{a as y}from"./chunk-7MUHSZGN.js";
13
13
  WHERE m.symbol_id = ?
14
14
  AND m.role != 1
15
15
  AND sym_def.document_id != c.document_id`,e)?.c??0}function w(t,e){return new Set(t.filter(s=>s.file!==e).map(s=>s.symbol)).size}function M(t){let e=0;return l(t,s=>{e+=x(s)}),e}function v(t,e,s){let n=[...e].sort((o,a)=>o.startLine-a.startLine||a.endLine-o.endLine);l(t,o=>{let a=x(o);if(a===0)return;let r=o.startPosition.row,i=o.endPosition.row;for(let m of n){if(m.startLine>r)break;if(m.endLine<i)continue;let c=s.get(m.symbolId);c&&(c.branches+=a)}})}var D=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function x(t){return D.has(t.type)?1:t.type==="binary_expression"&&t.parent?.type!=="binary_expression"&&(t.text.includes("&&")||t.text.includes("||"))?I(t.text):0}function I(t){return(t.match(/&&|\|\|/g)??[]).length}function E(t,e){let s=h(t),n=0,o=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let a of o){let r=s.match(a);r&&(n+=r.length)}if(e==="python"){let a=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(e==="rust"){let a=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(e==="ruby"){let a=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(e==="go"){let a=[/\bselect\b/g,/\bdefer\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}return n}export{T as a,L as b,j as c,M as d};
16
- //# sourceMappingURL=chunk-XKM5D2XS.js.map
16
+ //# sourceMappingURL=chunk-RPL3ARU7.js.map
@@ -1,2 +1,2 @@
1
- import{F as a,P as c}from"./chunk-NP4JFCLE.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
2
- //# sourceMappingURL=chunk-XFRHBAIT.js.map
1
+ import{H as a,R as c}from"./chunk-C7IJMOFP.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
2
+ //# sourceMappingURL=chunk-RYOYJMGF.js.map
@@ -0,0 +1,2 @@
1
+ import{j as i}from"./chunk-AK3PYTIK.js";var c=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function d(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=n;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!c.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function p(n,t){return n.version===t.version&&n.pid===t.pid&&n.platform===t.platform&&n.startToken===t.startToken}import{execFileSync as y}from"child_process";import{platform as P}from"os";var I=1e3,a=16*1024,s;function N(n,t=u){if(!Number.isSafeInteger(n)||n<=0)return null;let e=n===process.pid&&t===u;if(e&&s)return{...s};try{let r=b(n,t);if(!r)return null;let o={version:1,pid:n,platform:t.platform,startToken:r};return e&&(s=o),{...o}}catch{return null}}function b(n,t){if(t.platform==="linux"||t.platform==="android")return T(t.readFile(`/proc/${n}/stat`));if(t.platform==="win32"){let e=`([DateTimeOffset](Get-Process -Id ${n} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return m(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",e]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?m(t.run("ps",["-p",String(n),"-o","lstart="])):null}function T(n){let t=n.lastIndexOf(")");if(t<0)return null;let r=n.slice(t+1).trim().split(/\s+/)[19];return r&&/^\d+$/.test(r)?r:null}function m(n){let t=n.trim();return t===""?null:t}var u={platform:P(),readFile(n){return i(n,{maxBytes:a,inputKind:"process identity pseudo-file"})},run(n,t){return y(n,[...t],{encoding:"utf8",timeout:I,maxBuffer:a,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function h(){return performance.now()}function _(n,t,e,r,o,l){if(n>0)return e;let f=Math.max(0,Math.min(l,t-1));return Math.min(o,r*2**f)}export{d as a,p as b,N as c,h as d,_ as e};
2
+ //# sourceMappingURL=chunk-SB25YMEQ.js.map
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-BGBBVSH4.js";import{d as Pe}from"./chunk-PJBYDCBQ.js";import{a as I}from"./chunk-ZMS4YCY7.js";import{b}from"./chunk-EPLE5O5O.js";import{b as pe,d as me,e as ge,f as be,g as Se,h as ye,i as K,j as he,m as Re}from"./chunk-5J3A6RBZ.js";import{a as de}from"./chunk-WRQXLNYE.js";import{b as F}from"./chunk-YDTK77JP.js";import{c as ie}from"./chunk-4IASLUOP.js";import{C as re,D as P,F as se,J as oe,P as E,Q as le,R as ue,S as fe,T as B,g as ee,j as te,k as w,n as R,o as ne}from"./chunk-NP4JFCLE.js";import{a as h}from"./chunk-5Z2H76VD.js";import{d as k,f as $,g as V,i as ae,j as ce}from"./chunk-DRENNWRG.js";import{a as xe}from"./chunk-DHEQMPLW.js";import{d as g}from"./chunk-FYCH2EYQ.js";import{e as J}from"./chunk-HGFDYOVB.js";import{B as x,ja as T,ka as Q,la as z}from"./chunk-XIPGCT3D.js";import{existsSync as A,readdirSync as Ee}from"fs";import{join as M}from"path";var ze={files:new Set,pathPrefixes:[]};var X=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,et=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,De=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],tt=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),nt=4,rt=g("package-surface",{clearGroups:["whole-project"]}),fn=g("package-operational-surface",{clearGroups:["whole-project"]});function Me(t){return rt.get(t,()=>it(t.config.projectRoot))}function G(t,e){let n=Me(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function ve(t,e){return Me(t).files.has(e)}function it(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of st(t))for(let i of ot(r))at(t,s,i,e,n);return e.size===0&&n.length===0?ze:{files:e,pathPrefixes:n}}function st(t){let e=[],n=Te(t,"");return n&&e.push({manifest:n,packageRoot:""}),Ce(t,"",e,0),e}function Ce(t,e,n,r){if(r>=nt)return;let s=M(t,e);if(A(s))for(let i of Ee(s,{withFileTypes:!0})){if(!i.isDirectory()||tt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name,a=Te(t,o);a&&n.push({manifest:a,packageRoot:o}),Ce(t,o,n,r+1)}}function Te(t,e){let n;try{n=T(t,M(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!Q(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function ot(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return we(t.exports,e),e}function we(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))we(n,e)}function at(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let o=i.indexOf("*");if(o>=0){let l=i.slice(0,o);for(let u of ke(l))u!==""&&s.push(S(e,u));return}let a=i.replace(et,"");for(let l of ke(a)){l===a&&l===i&&r.add(S(e,i));for(let u of De)ct(t,r,e,l+u)}r.add(S(e,i))}function ke(t){let e=[t];return X.test(t)&&(e.push(t.replace(X,"src/")),e.push(t.replace(X,""))),e}function ct(t,e,n,r){let s=S(n,r);if(e.add(s),!r.startsWith("src/")||A(M(t,s)))return;let i=De.find(c=>r.endsWith(c));if(!i)return;let o=r.slice(0,-i.length);lt(t,e,n,o,i);let a=o.lastIndexOf("/");if(a<=4)return;let l=o.slice(0,a),u=o.slice(a+1);for(let c of Fe(t,n,l,`${u}${i}`))e.add(c)}function lt(t,e,n,r,s){let i=S(n,`${r}/index${s}`);A(M(t,i))&&e.add(i)}function Fe(t,e,n,r){let s=M(t,e,n);if(!A(s))return[];let i=[];for(let o of Ee(s,{withFileTypes:!0})){let a=`${n}/${o.name}`;o.isDirectory()?i.push(...Fe(t,e,a,r)):o.isFile()&&o.name===r&&i.push(S(e,a))}return i}function S(t,e){return t?`${t}/${e}`:e}import{existsSync as q,readdirSync as ut}from"fs";import{dirname as ft,join as U}from"path";var dt={rootFiles:new Set,sourcePrefixes:[]},pt=new Set([".git",".scipquery","node_modules","target"]),mt=6,gt=g("rust-library-surface",{clearGroups:["whole-project"]});function Ie(t,e,n){if(!n.endsWith(".rs")||!yt(bt(t),n))return!1;let r=E(t,n).find(s=>s.symbol===e);return r?ht(te(t,n)[r.startLine]??""):!1}function bt(t){return gt.get(t,()=>St(t.config.projectRoot))}function St(t){let e=new Set,n=new Set;for(let r of Rt(t)){let s=T(t,U(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=xt(s),o=S(r,"src/lib.rs"),a=i?S(r,i):!Pt(s)&&z(t,o)?o:null;if(!a)continue;e.add(a);let l=ft(a).replaceAll("\\","/");n.add(l==="."?"":`${l}/`)}return e.size===0?dt:{rootFiles:e,sourcePrefixes:[...n].sort()}}function yt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:kt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function ht(t){return/^\s*pub\s+(?!\()/.test(t)}function Rt(t){if(!q(t))return[];let e=[];return Le(t,"",e,0),e}function Le(t,e,n,r){let s=U(t,e);if(q(s)&&(q(U(s,"Cargo.toml"))&&n.push(e),!(r>=mt)))for(let i of ut(s,{withFileTypes:!0})){if(!i.isDirectory()||pt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name;Le(t,o,n,r+1)}}function xt(t){let e=!1;for(let n of t.split(`
1
+ import{a as L}from"./chunk-BGBBVSH4.js";import{d as Pe}from"./chunk-6NC3YSPY.js";import{a as I}from"./chunk-IXESDH3J.js";import{b}from"./chunk-FELGD32K.js";import{b as pe,d as me,e as ge,f as be,g as Se,h as ye,i as K,j as he,m as Re}from"./chunk-2XCGSDIT.js";import{a as de}from"./chunk-WRQXLNYE.js";import{b as F}from"./chunk-T6QD2ZQB.js";import{c as ie}from"./chunk-BJT7LSPK.js";import{E as re,F as P,H as se,L as oe,R as E,S as le,T as ue,U as fe,V as B,h as ee,k as te,l as w,o as R,p as ne}from"./chunk-C7IJMOFP.js";import{a as h}from"./chunk-YXPUP5G2.js";import{d as k,f as $,g as V,i as ae,j as ce}from"./chunk-DRENNWRG.js";import{a as xe}from"./chunk-DHEQMPLW.js";import{d as g}from"./chunk-IW5XQG5G.js";import{e as J}from"./chunk-HGFDYOVB.js";import{C as x,ma as T,na as Q,oa as z}from"./chunk-AK3PYTIK.js";import{existsSync as A,readdirSync as Ee}from"fs";import{join as M}from"path";var ze={files:new Set,pathPrefixes:[]};var X=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,et=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,De=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],tt=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),nt=4,rt=g("package-surface",{clearGroups:["whole-project"]}),fn=g("package-operational-surface",{clearGroups:["whole-project"]});function Me(t){return rt.get(t,()=>it(t.config.projectRoot))}function G(t,e){let n=Me(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function ve(t,e){return Me(t).files.has(e)}function it(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of st(t))for(let i of ot(r))at(t,s,i,e,n);return e.size===0&&n.length===0?ze:{files:e,pathPrefixes:n}}function st(t){let e=[],n=Te(t,"");return n&&e.push({manifest:n,packageRoot:""}),Ce(t,"",e,0),e}function Ce(t,e,n,r){if(r>=nt)return;let s=M(t,e);if(A(s))for(let i of Ee(s,{withFileTypes:!0})){if(!i.isDirectory()||tt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name,a=Te(t,o);a&&n.push({manifest:a,packageRoot:o}),Ce(t,o,n,r+1)}}function Te(t,e){let n;try{n=T(t,M(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!Q(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function ot(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return we(t.exports,e),e}function we(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))we(n,e)}function at(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let o=i.indexOf("*");if(o>=0){let l=i.slice(0,o);for(let u of ke(l))u!==""&&s.push(S(e,u));return}let a=i.replace(et,"");for(let l of ke(a)){l===a&&l===i&&r.add(S(e,i));for(let u of De)ct(t,r,e,l+u)}r.add(S(e,i))}function ke(t){let e=[t];return X.test(t)&&(e.push(t.replace(X,"src/")),e.push(t.replace(X,""))),e}function ct(t,e,n,r){let s=S(n,r);if(e.add(s),!r.startsWith("src/")||A(M(t,s)))return;let i=De.find(c=>r.endsWith(c));if(!i)return;let o=r.slice(0,-i.length);lt(t,e,n,o,i);let a=o.lastIndexOf("/");if(a<=4)return;let l=o.slice(0,a),u=o.slice(a+1);for(let c of Fe(t,n,l,`${u}${i}`))e.add(c)}function lt(t,e,n,r,s){let i=S(n,`${r}/index${s}`);A(M(t,i))&&e.add(i)}function Fe(t,e,n,r){let s=M(t,e,n);if(!A(s))return[];let i=[];for(let o of Ee(s,{withFileTypes:!0})){let a=`${n}/${o.name}`;o.isDirectory()?i.push(...Fe(t,e,a,r)):o.isFile()&&o.name===r&&i.push(S(e,a))}return i}function S(t,e){return t?`${t}/${e}`:e}import{existsSync as q,readdirSync as ut}from"fs";import{dirname as ft,join as U}from"path";var dt={rootFiles:new Set,sourcePrefixes:[]},pt=new Set([".git",".scipquery","node_modules","target"]),mt=6,gt=g("rust-library-surface",{clearGroups:["whole-project"]});function Ie(t,e,n){if(!n.endsWith(".rs")||!yt(bt(t),n))return!1;let r=E(t,n).find(s=>s.symbol===e);return r?ht(te(t,n)[r.startLine]??""):!1}function bt(t){return gt.get(t,()=>St(t.config.projectRoot))}function St(t){let e=new Set,n=new Set;for(let r of Rt(t)){let s=T(t,U(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=xt(s),o=S(r,"src/lib.rs"),a=i?S(r,i):!Pt(s)&&z(t,o)?o:null;if(!a)continue;e.add(a);let l=ft(a).replaceAll("\\","/");n.add(l==="."?"":`${l}/`)}return e.size===0?dt:{rootFiles:e,sourcePrefixes:[...n].sort()}}function yt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:kt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function ht(t){return/^\s*pub\s+(?!\()/.test(t)}function Rt(t){if(!q(t))return[];let e=[];return Le(t,"",e,0),e}function Le(t,e,n,r){let s=U(t,e);if(q(s)&&(q(U(s,"Cargo.toml"))&&n.push(e),!(r>=mt)))for(let i of ut(s,{withFileTypes:!0})){if(!i.isDirectory()||pt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name;Le(t,o,n,r+1)}}function xt(t){let e=!1;for(let n of t.split(`
2
2
  `)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Pt(t){let e=!1;for(let n of t.split(`
3
3
  `)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function kt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function Et(t){return Dt.get(t,()=>{let n=h(t,{includeIgnored:!1}).filter(o=>{let a=b(o);return a==="entry"||a==="worker"});if(n.length===0)return new Set;let r=F(t),s=new Set,i=new Set;for(;n.length>0;){let o=n.shift();if(!s.has(o)){s.add(o),b(o)==="barrel"&&i.add(o);for(let a of r.get(o)??[])s.has(a)||n.push(a)}}return i})}var Dt=g("live-barrels",{clearGroups:["whole-project"]});function Mt(t,e){return Et(t).has(x(e))}function Ne(t,e){let n=x(e),r=b(e);return r==="entry"||r==="worker"||Gt(n)||Mt(t,n)}function vt(t,e,n){let r=x(n),s=[];G(t,r)&&s.push("package-surface-file"),wt(t,e,r)&&s.push("transitive-package-surface"),Ie(t,e,r)&&s.push("rust-public-library"),Xt(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(o=>x(o)===r)&&s.push("configured-file"),i.pathPrefixes?.some(o=>r.startsWith(x(o)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(o=>Ut(e,o))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(o=>{try{return xe(o,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function _e(t,e,n){return vt(t,e,n).length>0}var Ct=g("package-surface-reachability",{clearGroups:["whole-project"]}),Tt=g("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function wt(t,e,n){let r=Ft(t).get(n);return r===void 0?!1:r===null||r.has(k(e))}function In(t,e,n){let r=It(t).get(n);return r===void 0?!1:r===null||r.has(k(e))}function Ft(t){return Ct.get(t,()=>je(t,e=>G(t,e)))}function It(t){return Tt.get(t,()=>je(t,e=>ve(t,e)))}function je(t,e){let n=new Map,r=[];for(let s of h(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let o of se(t,s)){if(!o.sourcePath||t.isIgnored(o.sourcePath))continue;let a=Lt(i,o);a!==void 0&&At(n,o.sourcePath,a)&&r.push(o.sourcePath)}}return n}function Lt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function At(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Oe=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Nt=new Set(["default","generateMetadata","generateStaticParams"]),_t=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),jt=new Set(["default","middleware","config"]),Ot=new Set(["register","onRequestError"]),$t=new Set(["onRouterTransitionStart"]),Vt=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Bt=new Set(["load","actions","entries",...Oe]),Kt=new Set(["default"]);function Xt(t,e){let n=k(t);return n===""?!1:$e(e)?Oe.has(n):Ve(e)?Nt.has(n):Be(e)?_t.has(n):Ke(e)?jt.has(n):Xe(e)?Ot.has(n):Ge(e)?$t.has(n):qe(e)?Vt.has(n):Ue(e)?Bt.has(n):qt(e)?Kt.has(n):!1}function Gt(t){return $e(t)||Ve(t)||Be(t)||Ke(t)||Xe(t)||Ge(t)||qe(t)||Ue(t)}function $e(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ve(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Be(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ke(t){return W(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function Xe(t){return W(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function Ge(t){return W(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function W(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function qe(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ue(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function qt(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function Ut(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(Ae(r)+"/")&&t.includes(Ae(s)+".")}function Ae(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}function We(t,e,n={}){let r=new Map;if(e&&e.length===0)return r;let s=h(t,{includeIgnored:!1}),i=be(t),o=e??le(t),a=new Set(o.map(u=>u.symbolId)),l=zt(o);return Wt(t,r,s,i,a,l),Ht(t,r,o,a),Qt(t,r,s,i,a,l),n.semantic!==!1&&n.semanticEvidence&&tn(r,n.semanticEvidence.callerMap(t,en(o))),r}function Wt(t,e,n,r,s,i){for(let o of n){if(!R(o))continue;let a=re(t,o);if(a)for(let l of a){if(i&&!i.has(l.calleeLeaf))continue;let u=me(o,r.get(l.calleeLeaf)??[]);if(!u||u.length===0)continue;let c=ge(t,o,u,l.memberAccess,l.calleeQualifier);c&&s.has(c.symbolId)&&c.file!==o&&H(e,c.symbolId,o)}}}function Ht(t,e,n,r){let s=Zt(n);for(let i of Yt(t,r))t.isIgnored(i.relative_path)||Jt(i,s.get(i.symbol_id))||H(e,i.symbol_id,i.relative_path)}function Yt(t,e){return de(t,e?[...e]:void 0)}function Zt(t){let e=new Map;for(let n of t)e.set(n.symbolId,{docId:n.documentId,startLine:n.startLine,endLine:n.endLine});return e}function Jt(t,e){return!!e&&e.docId===t.document_id&&t.chunk_start>=e.startLine&&t.chunk_end<=e.endLine}function Qt(t,e,n,r,s,i){for(let o of n){if(R(o)!=="rust")continue;let a=P(t,o,{includeRustAttributeNames:!0});if(a.length!==0)for(let{name:l}of a){if(i&&!i.has(l))continue;let u=r.get(l);if(u)for(let c of u)s.has(c.symbolId)&&c.file!==o&&H(e,c.symbolId,o)}}}function H(t,e,n){let r=t.get(e);r||(r=new Set,t.set(e,r)),r.add(n)}function zt(t){let e=new Set;for(let n of t){let r="leaf"in n&&typeof n.leaf=="string"?n.leaf:"symbol"in n&&typeof n.symbol=="string"?k(n.symbol):"";r&&e.add(r)}return e.size>0?e:null}function en(t){return t.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function tn(t,e){for(let[n,r]of e){let s=t.get(n);s||(s=new Set,t.set(n,s));for(let i of r)s.add(i)}}function Y(t,e,n={}){return We(t,e,n)}function Z(t,e,n={}){return Re(t,e,n)}function He(t,e,n={}){let r=Y(t,e,{semantic:n.semantic,semanticEvidence:n.semanticEvidence});return n.sourceFallback===!1?r:nn(r,Z(t,e))}function nn(t,e){let n=new Map;for(let[r,s]of t)n.set(r,new Set(s));for(let[r,s]of e){let i=n.get(r)??new Set;for(let o of s)i.add(o);n.set(r,i)}return n}function Ye(t,e,n){let r=e.identifierResolution==="strict"?K:he,s=e.candidateNames?Se(e.candidateNames):null,i=0,o=0,a=0,l=0,u="";for(let c of e.paths)if(i+=1,u=c,!(!R(c)&&!(e.includeVueSfc&&ne(c)))&&!t.isIgnored(c)&&!e.skipPath?.(c))try{if(s&&!ye(ee(t,c),s))continue;o+=1;let v=(d,m,j,D)=>{if(e.candidateNames&&!e.candidateNames.has(d))return;a+=1;let C=e.resolveTargets?e.resolveTargets({sourceFile:c,name:d,kind:m,defaultTargets:D}):D();for(let O of C)l+=1,n({sourceFile:c,name:d,target:O,occurrences:j,kind:m})},_=pe(t,c);for(let[d,m]of _)v(d,"identifier",m.length,()=>r(t,c,d));for(let d of P(t,c,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let m=d.kind==="cross-language-dispatch"?()=>K(t,c,d.name):()=>r(t,c,d.name);v(d.name,d.kind,d.occurrences,m)}}finally{e.afterPath?.(c),i%10===0&&J("source-reference-scan.progress",()=>{},()=>({scannedPaths:i,currentPath:u,candidateMatchedPaths:o,visitedNames:a,visitedHits:l}))}}function Ze(t,e={}){let{scope:n,files:r,minLoc:s=1,maxLoc:i=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:a=!1,excludeTypesFiles:l=!1,excludeRootedSymbols:u=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:N=!1,excludeRustTraitImplMembers:v=!1,includeSuppressed:_=!1,sortByLocDesc:d=!1}=e,m=[],j=rn(t,{scope:n,files:r,requireFunctionLikeSymbol:c,requireCallableSymbol:N}),D=new Map,C=new Map,O=f=>{let p=D.get(f);if(p!==void 0)return p;let y=Ne(t,f);return D.set(f,y),y},Qe=f=>{let p=C.get(f);if(p!==void 0)return p;let y=b(f);return C.set(f,y),y};for(let f of j){let p=f.relativePath;if(t.isIgnored(p)||a&&O(p)||!sn(f,{requireFunctionLikeSymbol:c,requireCallableSymbol:N})||o!==void 0&&f.symbol===o)continue;let y=L(f);y<s||y>i||l&&on(p)||u&&_e(t,f.symbol,p)||v&&ae(f.symbol)||Qe(p)!=="test"&&(ce(f.symbol)||!_&&w(t,p,f.startLine)||m.push(f))}return d?m.sort((f,p)=>L(p)-L(f)):m}function rn(t,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>E(t,r)):e.requireCallableSymbol?B(t,{scope:e.scope,symbolMatches:$,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?B(t,{scope:e.scope,symbolMatches:V,sqlPrefilter:"function-like"}):fe(t,e.scope)}function sn(t,e){return e.requireCallableSymbol?$(t.symbol):e.requireFunctionLikeSymbol?V(t.symbol):t.isFunctionLike}function on(t){return(t.split("/").pop()??"").includes("types")}var Je=class{constructor(e){this.db=e}db;scopedDefinitions(e){return ue(this.db,e)}definitionsForFile(e){return E(this.db,e)}productionCallableDefinitions(e={}){return Ze(this.db,e)}calleeMap(e,n={}){return Pe(this.db,e,{...n,semanticEvidence:I})}crossFileCallerMap(e,n={}){return Y(this.db,e,{...n,semanticEvidence:I})}sourceFallbackCallerFiles(e,n={}){return Z(this.db,e,n)}callerFileMap(e,n={}){return He(this.db,e,{...n,semanticEvidence:I})}frameworkReferencedSymbolIds(e){let n=new Map;for(let s of e){if(!s.leaf)continue;let i=n.get(s.leaf)??[];i.push(s.symbolId),n.set(s.leaf,i)}let r=new Set;for(let s of h(this.db,{includeIgnored:!1}))if(R(s)==="rust")for(let{name:i}of P(this.db,s,{includeRustAttributeNames:!0}))for(let o of n.get(i)??[])r.add(o);return r}symbolsWithNonSelfCallees(e,n={}){if(e.length===0)return new Set;let r=new Map(e.map(i=>[i.symbolId,i.symbol])),s=this.calleeMap(e,n);return new Set([...s.entries()].filter(([i,o])=>{let a=r.get(i);return o.some(l=>l.symbol!==a)}).map(([i])=>i))}fileDependencyGraph(e){return F(this.db,e)}fileKind(e){return b(e)}hasSuppressionComment(e){return w(this.db,e.relativePath,e.startLine)}sourceFiles(){return ie(this.db)}scanSourceReferences(e,n){Ye(this.db,e,n)}callableSignature(e){let n=oe(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return n?{paramCount:n.paramCount}:null}};export{Ne as a,vt as b,In as c,Je as d};
4
- //# sourceMappingURL=chunk-SRIZDEWX.js.map
4
+ //# sourceMappingURL=chunk-SVHTMVA4.js.map