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
package/dist/runtime.js CHANGED
@@ -1,4 +1,4 @@
1
- import{b as Ke,c as qe,e as sn,f as an,g as cn,l as Ye,o as Qe}from"./chunk-6X4KO5A7.js";import{c as Me,t as We,w as He}from"./chunk-LGVTIZPV.js";import{c as je,e as G,g as De,h as Le}from"./chunk-FOP7HD6H.js";import"./chunk-DHEQMPLW.js";import{C as _e,Ca as Ue,D as Te,I as Ae,J as O,K as Ne,S as Ve,W as $e,Z as ne,_ as Fe,ca as Ge,da as Je,g as te,ga as Be,i as we,la as J,n as p,p as g,q as w,r as j,s as Pe,t as m,v as M,x as ke}from"./chunk-WEXQYJY3.js";import{existsSync as Vn}from"fs";import{randomUUID as Dn}from"crypto";import{isAbsolute as br,join as ft,relative as vr,resolve as Rr}from"path";var x=1,P=2,dn="./node_modules/scip-query/docs/schemas/project-config.schema.json";function ie(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(a){return{kind:"malformed",reason:`invalid JSON: ${a instanceof Error?a.message:String(a)}`}}if(!p(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 i=n===void 0?x:n;if(i!==x&&i!==P)return{kind:"unsupported",schemaVersion:i,direction:i<x?"older":"future"};let r=t.$schema;if(r!==void 0&&(typeof r!="string"||r.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let o=B(t),s=i!==P||typeof t.$schema!="string";return i===x?{kind:"legacy",sourceVersion:x,config:o,needsMigration:s}:{kind:"supported",sourceVersion:P,config:o,needsMigration:s}}function B(e){let t=e,{$schema:n,schemaVersion:i,...r}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:dn,schemaVersion:P,...r}}function re(e){return`${JSON.stringify(B(e),null,2)}
1
+ import{b as Ke,c as qe,e as sn,f as an,g as cn,l as Ye,o as Qe}from"./chunk-AMIMMNA4.js";import{c as Me,t as We,w as He}from"./chunk-ISIQLPJ2.js";import{c as je,e as G,g as De,h as Le}from"./chunk-HG722PO7.js";import"./chunk-DHEQMPLW.js";import{$ as Fe,C as _e,D as Te,Fa as Ue,I as Ae,J as O,L as Ne,T as Ve,X as $e,_ as ne,da as Ge,g as te,ga as Je,i as we,ja as Be,n as p,oa as J,p as g,q as w,r as j,s as Pe,t as m,v as M,x as ke}from"./chunk-GH5YSGZL.js";import{existsSync as Vn}from"fs";import{randomUUID as Dn}from"crypto";import{isAbsolute as br,join as ft,relative as vr,resolve as Rr}from"path";var x=1,P=2,dn="./node_modules/scip-query/docs/schemas/project-config.schema.json";function ie(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(a){return{kind:"malformed",reason:`invalid JSON: ${a instanceof Error?a.message:String(a)}`}}if(!p(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 i=n===void 0?x:n;if(i!==x&&i!==P)return{kind:"unsupported",schemaVersion:i,direction:i<x?"older":"future"};let r=t.$schema;if(r!==void 0&&(typeof r!="string"||r.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let o=B(t),s=i!==P||typeof t.$schema!="string";return i===x?{kind:"legacy",sourceVersion:x,config:o,needsMigration:s}:{kind:"supported",sourceVersion:P,config:o,needsMigration:s}}function B(e){let t=e,{$schema:n,schemaVersion:i,...r}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:dn,schemaVersion:P,...r}}function re(e){return`${JSON.stringify(B(e),null,2)}
2
2
  `}import{createHash as un}from"crypto";var f=1,I=2,U=1,D=1,V="sha256",ae=1;function tt(e,t,n){if(!m(e)||!j(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:U,canonicalizationVersion:D,hashAlgorithm:V,projection:{name:e,version:t},digest:un(V).update(ln(e,t,n)).digest("hex")}}function ln(e,t,n){return`{"canonicalizationVersion":${D},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function ce(e){if(!p(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===f)return yn(e)?{kind:"legacy",schemaVersion:f,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===I)return Cn(e)?{kind:"supported",schemaVersion:I,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<f?"older":"future"}}function H(e){let t=ce(e);return t.kind==="legacy"||t.kind==="supported"}function de(e,t){return{collaborationDomain:E(y(e,n=>n.facts.collaborationDomain),y(t,n=>n.facts.collaborationDomain)),repositoryLineage:E(y(e,n=>n.facts.repositoryLineage),y(t,n=>n.facts.repositoryLineage)),workspaceInstance:E(y(e,n=>n.facts.workspaceInstance),y(t,n=>n.facts.workspaceInstance)),wholeContent:E(y(e,n=>n.facts.wholeContent),y(t,n=>n.facts.wholeContent)),relevantInputs:pn(e,t),indexInput:E(y(e,n=>n.facts.index?.inputs),y(t,n=>n.facts.index?.inputs)),indexGeneration:hn(e,t),observationStability:mn(e,t)}}function K(e,t,n=de(e,t)){let i=[["collaborationDomain",n.collaborationDomain],["wholeContent",n.wholeContent],["observationStability",n.observationStability]],r=[];for(let[s,a]of i)a.state!=="established"&&r.push(`${s}:${a.state}`);for(let[s,a]of[["left",e],["right",t]]){let c=gn(a);c!=="not-applicable"&&c!=="established"&&r.push(`${s}IndexAlignment:${c}`)}let o=i.some(([,s])=>s.state==="disproven")||r.some(s=>s.endsWith(":disproven"));return{policyVersion:ae,authority:r.length===0?"completion":o?"none":"advisory",requiredRelationships:["collaborationDomain","wholeContent","observationStability"],reasons:r}}function nt(e){return e.schemaVersion===f?e.index?.generationIdentity:e.facts.index?.generation.digest}function it(e){return e.schemaVersion===f?void 0:e.facts.workspaceInstance?.digest}function rt(e){if(e.schemaVersion===f)return e.index?.alignment??"not-established";let t=e.stabilityProofs.filter(n=>n.source!=="process");return t.some(n=>n.kind==="invalidated")?"invalidated":t.length>0&&t.every(n=>n.kind==="immutable"||n.kind==="fixed-snapshot")?"fixed":t.some(n=>n.kind==="bracketed")?"bracketed":"not-established"}function pn(e,t){let n=Xe(e),i=Xe(t);return[...new Set([...n.keys(),...i.keys()])].sort().map(o=>{let s=n.get(o),a=i.get(o),c=s?.subject??a?.subject??o,d=s?.identity.projection.name??a?.identity.projection.name??o;return{subject:c,projection:d,judgment:E(s?.identity,a?.identity)}})}function Xe(e){return e.schemaVersion!==I?new Map:new Map((e.facts.relevantInputs??[]).map(t=>[`${t.subject}\0${t.identity.projection.name}`,t]))}function hn(e,t){return e.schemaVersion===f&&t.schemaVersion===f?fn(e.index?.generationIdentity,t.index?.generationIdentity):e.schemaVersion===f||t.schemaVersion===f?b("unknown",["legacy-fact-not-comparable"],Ze(e),Ze(t)):E(e.facts.index?.generation,t.facts.index?.generation)}function fn(e,t){let n=e?[{kind:"legacy-index-generation",value:e}]:[],i=t?[{kind:"legacy-index-generation",value:t}]:[];return e===void 0||t===void 0?ot(n,i):b(e===t?"established":"disproven",[e===t?"identities-equal":"identities-different"],n,i)}function E(e,t){let n=e?[{kind:"identity",identity:e}]:[],i=t?[{kind:"identity",identity:t}]:[];return!e||!t?ot(n,i):ue(e,t)?b(e.digest===t.digest?"established":"disproven",[e.digest===t.digest?"identities-equal":"identities-different"],n,i):b("unknown",["identity-projections-not-comparable"],n,i)}function mn(e,t){if(e.schemaVersion===f||t.schemaVersion===f)return b("unknown",["legacy-fact-not-comparable"],[],[]);let n=et(e),i=et(t),r=ze(e),o=ze(t);return r==="invalidated"||o==="invalidated"?b("disproven",[...r==="invalidated"?["left-observation-invalidated"]:[],...o==="invalidated"?["right-observation-invalidated"]:[]],n,i):r!=="fixed"||o!=="fixed"?b("unknown",[...r==="no-repository-source"?["left-observation-has-no-repository-source"]:r!=="fixed"?["left-observation-not-fixed"]:[],...o==="no-repository-source"?["right-observation-has-no-repository-source"]:o!=="fixed"?["right-observation-not-fixed"]:[]],n,i):b("established",["all-observed-sources-fixed"],n,i)}function ze(e){let t=e.observedSources.filter(i=>i.kind!=="process");if(t.length===0)return"no-repository-source";let n=new Map(e.stabilityProofs.map(i=>[i.source,i.kind]));return t.some(i=>n.get(i.kind)==="invalidated")?"invalidated":t.every(i=>{let r=n.get(i.kind);return r==="immutable"||r==="fixed-snapshot"})?"fixed":"unknown"}function gn(e){if(e.schemaVersion!==I)return e.index?"unknown":"not-applicable";if(!e.observedSources.some(i=>i.kind==="index-generation"))return"not-applicable";let t=e.facts.index?.inputs;if(!t)return"unknown";let n=(e.facts.relevantInputs??[]).find(i=>ue(i.identity,t))?.identity;return n?n.digest===t.digest?"established":"disproven":"unknown"}function y(e,t){return e.schemaVersion===I?t(e):void 0}function Ze(e){return e.schemaVersion===f&&e.index?[{kind:"legacy-index-generation",value:e.index.generationIdentity}]:e.schemaVersion===I&&e.facts.index?[{kind:"identity",identity:e.facts.index.generation}]:[]}function et(e){return e.stabilityProofs.map(t=>({kind:"stability",proof:t}))}function ot(e,t){let n=e.length===0&&t.length===0?"both-facts-missing":e.length===0?"left-fact-missing":"right-fact-missing";return b("unknown",[n],e,t)}function b(e,t,n,i){return{state:e,reasons:t,facts:{left:n,right:i}}}function ue(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 yn(e){if(!p(e))return!1;let t=e.index,n=e.worktree;return at(e.observedAt)&&m(e.projectIdentity)&&xn(e.authorityKind)&&(t===void 0||p(t)&&m(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||p(n)&&m(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||m(n.headCommit))&&(n.treeOid===void 0||m(n.treeOid)))&&On(e.authorityKind,t,n)}function Cn(e){if(!p(e))return!1;let t=e.facts,n=e.observedSources,i=e.stabilityProofs;if(!at(e.observedAt)||!p(t)||!Array.isArray(n)||n.length===0||!n.every(vn)||!se(n,c=>c.kind)||!Array.isArray(i)||!i.every(Rn)||!se(i,c=>c.source)||i.some(c=>!n.some(d=>d.kind===c.source))||!i.every(c=>In(c,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(c=>t[c]!==void 0&&!S(t[c])))return!1;let o=t.relevantInputs;if(o!==void 0&&(!Array.isArray(o)||!o.every(bn)||!se(o,c=>`${c.subject}\0${c.identity.projection.name}`)))return!1;let s=t.index;if(s!==void 0&&(!p(s)||!S(s.generation)||s.inputs!==void 0&&!S(s.inputs)||s.source!=="immutable"&&s.source!=="legacy"))return!1;let a=e.diagnostics;return(a===void 0||p(a)&&(a.clean===void 0||typeof a.clean=="boolean")&&(a.headCommit===void 0||m(a.headCommit))&&(a.treeOid===void 0||m(a.treeOid)))&&Sn(t,n)}function S(e){return!p(e)||!p(e.projection)?!1:e.schemaVersion===U&&e.canonicalizationVersion===D&&e.hashAlgorithm===V&&m(e.projection.name)&&j(e.projection.version)&&Pe(e.digest)}function bn(e){return p(e)&&m(e.subject)&&S(e.identity)}function vn(e){return p(e)&&st(e.kind)&&(e.identity===void 0||S(e.identity))}function Rn(e){return p(e)&&st(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Sn(e,t){let n=e.index,i=t.find(c=>c.kind==="index-generation");if(i){if(!p(n)||!S(n.generation)||i.identity&&!oe(i.identity,n.generation))return!1}else if(n!==void 0)return!1;let r=e.workspaceInstance,o=t.find(c=>c.kind==="live-workspace");if(o?.identity&&(!S(r)||!oe(o.identity,r)))return!1;let s=e.wholeContent,a=t.find(c=>c.kind==="repository-snapshot");return!(a?.identity&&(!S(s)||!oe(a.identity,s)))}function In(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&p(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function oe(e,t){return ue(e,t)&&e.digest===t.digest}function On(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 xn(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function st(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function at(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function se(e,t){return new Set(e.map(t)).size===e.length}import{createHash as ct}from"crypto";import{closeSync as En,fstatSync as dt,openSync as wn,rmSync as Pn}from"fs";import{dirname as kn}from"path";var _n=2e3,Tn=10,An=3,Y=class extends Error{constructor(n,i,r){super(`Concurrent edit detected for ${n}; expected revision ${lt(i)}, but found ${lt(r)}. The latest file was left untouched.`);this.path=n;this.original=i;this.latest=r;this.name="FileRevisionConflictError"}path;original;latest};function pt(e,t,n={}){let i=Nn(e,n.lockTimeoutMs??_n,n.monotonicNow??G);try{let r=Math.max(0,Math.floor(n.maxRetries??An));for(let o=0;;o+=1){let s=q(e),a=t(s,o);if(a.kind==="unchanged")return{changed:!1,attempts:o+1,previous:s,current:s};n.onBeforeCommit?.({attempt:o,snapshot:s,mutation:a});let c=q(e);if(!Mn(s.revision,c.revision)){if(o<r)continue;throw new Y(e,s.revision,c.revision)}try{jn(e,a,s.revision)}catch(d){if(d.code==="EEXIST"){let l=q(e);if(o<r)continue;throw new Y(e,s.revision,l.revision)}throw d}return{changed:!0,attempts:o+1,previous:s,current:q(e)}}}finally{i.release()}}function q(e){for(let t=0;t<4;t+=1){let n;try{n=wn(e,"r");let i=ut(dt(n)),r=Ne(n,{maxBytes:Te,inputKind:"revisioned text file"}),o=ut(dt(n));if(!ht(i,o))continue;return{path:e,text:r,revision:{exists:!0,hash:ct("sha256").update(r).digest("hex"),identity:o}}}catch(i){if(i.code==="ENOENT")return{path:e,text:"",revision:{exists:!1,hash:ct("sha256").update("").digest("hex")}};throw i}finally{n!==void 0&&En(n)}}throw new Error(`Could not read a stable revision of ${e}; the file is changing continuously.`)}function Nn(e,t,n){let i=`${e}.scip-query-write.lock`,r=n()+Math.max(0,t);for(;;){let o=Me(i,{kind:"revisioned-file-mutation",detail:{target:e}});if(o.kind==="acquired")return o.lock;if(n()>=r)throw new Error(`Timed out after ${t}ms waiting to update ${e}; the file was left untouched.`);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,Tn)}}function jn(e,t,n){if(t.kind==="delete"){if(!n.exists)return;Pn(e),Ve(kn(e));return}let i=t.mode??n.identity?.mode;n.exists?De(e,t.text,{durability:"durable",mode:i}):Le(e,t.text,{durability:"durable",mode:i})}function Mn(e,t){return e.exists===t.exists&&e.hash===t.hash&&(e.identity===void 0?t.identity===void 0:t.identity!==void 0&&ht(e.identity,t.identity))}function ut(e){return{dev:e.dev,ino:e.ino,size:e.size,mtimeMs:e.mtimeMs,mode:e.mode&511}}function ht(e,t){return e.dev===t.dev&&e.ino===t.ino&&e.size===t.size&&e.mtimeMs===t.mtimeMs&&e.mode===t.mode}function lt(e){return e.exists?e.hash.slice(0,12):"<absent>"}var L=".scipquery.json",mt=2e3,gt=5e3,le=gt,yt=15*6e4,pe={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},Ln={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:mt,cooldownMs:le,gitPollMs:2e3,idleTimeoutMs:yt,autoRefresh:!0,ignore:[],resourceBudget:pe};var Er=new Set(M);function Q(e){let t=ft(e,L);if(!Vn(t))return{};let n;try{n=Ae(t,{maxBytes:_e,inputKind:"scip-query project config"})}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(`unable to read ${L} at ${t}: ${r}`,{cause:i})}return bt(ie(n),t,"read").config}function Ct(e){return{...Ln,...e.watch,cooldownMs:Math.max(gt,e.watch?.cooldownMs??le),resourceBudget:{...pe,...e.watch?.resourceBudget}}}function Wn(e,t){return $n(e,t).configPath}function $n(e,t){let n=ft(e,L),i=Dn(),r={collaborationDomainId:i,languages:t,watch:{enabled:!0,debounceMs:mt,cooldownMs:le,gitPollMs:2e3,idleTimeoutMs:yt,autoRefresh:!0,resourceBudget:{...pe}}},o=pt(n,s=>{if(!s.revision.exists)return{kind:"write",text:re(r)};let a=Fn(s,r);return a.config.collaborationDomainId?{kind:"unchanged"}:{kind:"write",text:re({...a.config,collaborationDomainId:i})}});return{configPath:n,changed:o.changed}}function Fn(e,t){if(!e.revision.exists)return{config:B(t),needsMigration:!0};let n=bt(ie(e.text),e.path,"update");return{config:n.config,needsMigration:n.needsMigration}}function bt(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let r=n==="read"?`invalid ${L} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${r} The file was left untouched.`)}let i=n==="read"?`invalid ${L} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${i} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${x} and current v${P}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as Ce,lstatSync as Jn,statSync as _t,watch as Bn}from"fs";import{EventEmitter as Un}from"events";import{basename as Hn,dirname as Kn,isAbsolute as be,join as C,relative as Tt,resolve as At}from"path";import{watch as qn}from"chokidar";import Yn from"ignore";function he(e){let t=JSON.stringify(e);return Buffer.byteLength(t)<=65536?t:void 0}var Nt=5e3,ge=class{projectRoot;config;watchConfig;outputDb;languages;pnpmWorkspaces;typescriptProjectMode;typescriptProjects;clojureConfigPath;indexerConcurrency;onStatus;onReindexComplete;onReindexError;onRefreshSuppressed;onError;reindexRunner;subscriptionFactory;budgetInspector;clock;activeOperation=null;stopPromise=null;stopInProgress=!1;status={state:"idle"};debounceTimer=null;cooldownTimer=null;budgetTimer=null;dirty=!1;changedFiles=0;pendingTrigger=null;pendingChanges=new Map;pendingChangesComplete=!0;pendingChangesIncompleteReason;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];sourcePollingFallbackStarted=!1;gitPollTimer=null;lastGitState=null;preferFilesystemGitState=!0;watchGitLayout=null;localCacheWatchPath;gitignoreFilter;extraIgnore;stopped=!1;constructor(t){this.projectRoot=t.projectRoot,this.config=t.config,this.watchConfig=Ct(t.config),this.outputDb=t.outputDb??C(Be(this.projectRoot,t.config),"index.db"),this.preferFilesystemGitState=t.gitReader===void 0,this.localCacheWatchPath=yi(this.projectRoot,Kn(this.outputDb)),this.languages=t.languages,this.pnpmWorkspaces=t.config.indexer?.typescript?.pnpmWorkspaces??!1,this.typescriptProjectMode=t.config.indexer?.typescript?.projectMode,this.typescriptProjects=t.config.indexer?.typescript?.projects,this.clojureConfigPath=t.config.indexer?.clojure?.configPath,this.indexerConcurrency=t.config.indexerConcurrency,this.onStatus=t.onStatus??(()=>{}),this.onReindexComplete=t.onReindexComplete??(()=>{}),this.onReindexError=t.onReindexError??(()=>{}),this.onRefreshSuppressed=t.onRefreshSuppressed??(()=>{}),this.onError=t.onError??(n=>console.error(n.message)),this.clock=t.clock??Zn,jt.set(this,Ci(t.stopTimeoutMs??Nt,"watcher stop timeout")),this.reindexRunner=t.reindexRunner??Lt(),this.subscriptionFactory=t.subscriptionFactory??ei,this.budgetInspector=t.budgetInspector??Qe,Mt.set(this,{projectRoot:t.projectRoot,config:t.config,gitReader:t.gitReader??$e,languages:Wt(t.languages??t.config.languages),typeScriptInputPaths:null,stagedIndexEntries:null}),this.gitignoreFilter=He(t.projectRoot),this.extraIgnore=Yn(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore),Pt(this)}start(){if(this.stopInProgress)throw new Error("Cannot restart a watcher while its previous ownership is still draining.");this.stopped=!1,this.stopPromise=null,z(this).errors=[],this.sourcePollingFallbackStarted=!1,this.setStatus({state:"idle"}),this.startGitStatePolling();try{this.startSourceWatcher()}catch(t){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(t)}`))}}stop(){if(this.stopPromise)return this.stopPromise;this.stopped=!0,this.stopInProgress=!0;let t=this.fsWatchers;this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.clearBudgetTimer(),this.clearGitPollTimer();let n=this.activeOperation;n&&this.setStatus({state:"draining",startedAt:this.wallNow(),reason:"waiting for the active reindex worker to exit"});let i=[...z(this).closures],r=Xn(this),o=this.clock.now()+r;return this.stopPromise=this.finishStop(t,i,n,o,r).catch(s=>{throw this.stopInProgress=!1,s}),this.stopPromise}requestRefresh(t,n={}){if(!this.stopped){if(this.markPendingChangesIncomplete(`unstructured-trigger:${t.kind}`),!n.immediate||this.reindexInFlight||this.status.state==="cooldown"||this.status.state==="budget-paused"){this.scheduleReindex(t);return}this.pendingTrigger=fe(this.pendingTrigger,t),this.changedFiles+=1,this.clearDebounceTimer(),this.triggerReindex()}}startSourceWatcher(t=!1){let n=this.subscriptionFactory(this.projectRoot,{ignoreInitial:!0,ignored:(i,r)=>this.isIgnoredWatchPath(i,r?.isDirectory()??!1),usePolling:t,ignorePermissionErrors:!0,...t?{interval:5e3,binaryInterval:1e4}:{}});n.on("all",(i,r)=>{!this.stopped&&i!=="addDir"&&i!=="unlinkDir"&&this.handleFileChange(i,r)}),n.on("error",i=>this.handleSourceWatcherError(n,i,t)),this.fsWatchers.push(n)}handleSourceWatcherError(t,n,i){if(this.markPendingChangesIncomplete("source-watcher-error"),i||this.sourcePollingFallbackStarted||!pi(n)||this.stopped){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(n)}`));return}this.sourcePollingFallbackStarted=!0,this.fsWatchers=this.fsWatchers.filter(r=>r!==t),zn(z(this),t,r=>this.onError(r));try{this.startSourceWatcher(!0)}catch(r){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(r)}`))}}isIgnoredWatchPath(t,n){let i=this.relativeWatchPath(t);if(!i)return!1;if(It(i,this.localCacheWatchPath))return!0;let r=n?`${i}/`:i;return this.gitignoreFilter.isIgnored(r)||this.extraIgnore.ignores(r)}handleFileChange(t,n){let i=this.relativeWatchPath(n);if(!i||i===".."||i.startsWith("../")||It(i,this.localCacheWatchPath)||this.gitignoreFilter.isIgnored(i)||this.extraIgnore.ignores(i)||i.endsWith("index.db")||i.endsWith("index.scip")||i.endsWith("index.db.tmp")||Hn(i).startsWith(Ye))return;i===".scipquery.json"&&Et(this,this.projectRoot);let r=wt(this,t,i);r!==null&&(r||this.markPendingChangesIncomplete(`unsupported-source-event:${t}`),this.scheduleReindex({kind:"watch-source",detail:i},r?[{path:i,kind:r}]:void 0,r!==void 0))}relativeWatchPath(t){let n=be(t)?t:C(this.projectRoot,t);return Tt(this.projectRoot,n).replaceAll("\\","/")}scheduleReindex(t,n,i=!1){this.pendingTrigger=fe(this.pendingTrigger,t),i||this.markPendingChangesIncomplete(`unstructured-trigger:${t.kind}`);for(let o of n??[])this.recordPendingChange(o);if(this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});let o=this.activeOperation;o&&k.get(this)!==o&&(k.set(this,o),o.cancel().then(s=>{s.state==="degraded"&&!this.stopped&&this.onError(new Error(s.reason))},s=>{this.stopped||this.onError(s instanceof Error?s:new Error(String(s)))}));return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}if(this.status.state==="budget-paused"){this.dirty=!0,this.setStatus({...this.status,dirty:!0});return}this.clearDebounceTimer();let r=this.wallNow()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:r}),this.debounceTimer=this.clock.setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let t=this.inspectBudget(),n=this.watchConfig.allowExpensiveRebuild&&t.state!=="paused";if(t.state==="paused"&&t.reason!=="rebuild-count"){this.dirty=!0;let c=Math.max(this.wallNow()+1,t.until);this.setStatus({state:"budget-paused",until:c,dirty:!0,reason:t.detail,rebuilt:t.rebuilt,estimatedWriteBytes:t.estimatedWriteBytes}),this.clearBudgetTimer(),this.budgetTimer=this.clock.setTimeout(()=>{this.budgetTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},Math.min(2147483647,Math.max(1,c-this.wallNow())));return}let i=this.clock.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&i<this.watchConfig.cooldownMs){let c=this.watchConfig.cooldownMs-i;this.dirty=!0;let d=this.wallNow()+c;this.setStatus({state:"cooldown",until:d,dirty:!0}),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},c);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let r=this.pendingTrigger??{kind:"watch-source"};this.pendingTrigger=null;let o=this.consumePendingChangeJournal(),s=this.wallNow();this.setStatus({state:"indexing",startedAt:s});let a=this.reindexRunner.start(this.reindexRequest(r,n,o));this.activeOperation=a,a.completion.then(c=>{if(this.reindexInFlight=!1,this.lastReindexEnd=this.clock.now(),X.set(this,0),this.stopped)return;if(k.get(this)===a){if(this.restorePendingChangeJournal(o),this.dirty){let l=this.wallNow()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:l,dirty:!0}),this.clearCooldownTimer(),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"});return}Pt(this);let d=!1;try{d=this.onReindexComplete(c,r,{pendingChanges:this.dirty})===!0}catch(l){this.onError(l instanceof Error?l:new Error(String(l)))}if(this.dirty&&!this.stopped){if(d){let u=this.pendingTrigger??{kind:"unknown"};this.dirty=!1,this.changedFiles=0,this.pendingTrigger=null,this.resetPendingChanges(),this.onRefreshSuppressed(u),this.setStatus({state:"idle"});return}let l=this.wallNow()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:l,dirty:!0}),this.clearCooldownTimer(),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(c=>{if(this.reindexInFlight=!1,this.lastReindexEnd=this.clock.now(),this.stopped)return;let d=c instanceof Error?c:new Error(String(c));this.restorePendingChangeJournal(o);let l=Dt(d),u=0;if(l?(u=(X.get(this)??0)+1,X.set(this,u),this.dirty=!0,this.pendingTrigger=fe(this.pendingTrigger,r)):X.set(this,0),!l&&k.get(this)!==a&&(this.onReindexError(d,r),this.onError(d)),this.dirty){let h=l?ci(this.watchConfig.cooldownMs,u):this.watchConfig.cooldownMs,R=this.wallNow()+h;this.setStatus({state:"cooldown",until:R,dirty:!0}),this.clearCooldownTimer(),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},h);return}this.setStatus({state:"idle"})}).finally(()=>{this.activeOperation===a&&(this.activeOperation=null),k.get(this)===a&&k.delete(this)})}async finishStop(t,n,i,r,o){let s=[],a=t.map(async h=>{try{await h.close()}catch(R){s.push(`watch subscription close failed: ${String(R)}`)}});a.push(...n),i&&a.push((async()=>{try{let h=await i.cancel();h.state==="degraded"&&s.push(h.reason)}catch(h){s.push(`reindex cancellation failed: ${h instanceof Error?h.message:String(h)}`)}})());let c=a.length,d=a.map(h=>h.finally(()=>{c-=1})),l=await Qn(d,r,this.clock),u=z(this);return s.push(...u.errors),u.errors=[],l?this.stopInProgress=!1:(s.push(`watch shutdown exceeded the ${o}ms deadline with ${c} operation(s) still pending`),Promise.all(d).then(()=>{this.stopInProgress=!1})),s.length>0?(this.setStatus({state:"draining",startedAt:this.wallNow(),reason:s.join("; ")}),{state:"degraded",reasons:s}):(this.setStatus({state:"idle"}),{state:"stopped"})}wallNow(){return this.clock.wallNow?.()??this.clock.now()}inspectBudget(){try{return this.budgetInspector(this.outputDb,this.watchConfig.resourceBudget,new Date(this.wallNow()))}catch(t){return{state:"paused",reason:"activity-evidence",until:this.wallNow()+this.watchConfig.resourceBudget.windowMs,rebuilt:0,estimatedWriteBytes:0,detail:`reindex activity evidence could not be read: ${t instanceof Error?t.message:String(t)}`}}}reindexRequest(t,n=!0,i){return{projectRoot:this.projectRoot,config:this.config,languages:this.languages,pnpmWorkspaces:this.pnpmWorkspaces,typescriptProjectMode:this.typescriptProjectMode,typescriptProjects:this.typescriptProjects,clojureConfigPath:this.clojureConfigPath,indexerConcurrency:this.indexerConcurrency,trigger:t,changeJournal:i,allowExpensiveRebuild:n}}setStatus(t){this.status=t,this.onStatus(t)}recordPendingChange(t){if(this.pendingChanges.size>=1024&&!this.pendingChanges.has(t.path)){this.pendingChanges.clear(),this.markPendingChangesIncomplete("change-entry-limit");return}let n=this.pendingChanges.get(t.path),i=ui(n,t.kind);i===null?this.pendingChanges.delete(t.path):this.pendingChanges.set(t.path,i)}markPendingChangesIncomplete(t){this.pendingChangesComplete=!1,this.pendingChangesIncompleteReason??=t}consumePendingChangeJournal(){let t=We(this.outputDb),n=[...this.pendingChanges.entries()].map(([s,a])=>({path:s,kind:a})).sort((s,a)=>s.path.localeCompare(a.path)),i=this.pendingChangesComplete,r=this.pendingChangesIncompleteReason;t||(i=!1,r??="accepted-generation-unavailable");let o={version:1,baseGeneration:t,complete:i,...r?{incompleteReason:r}:{},entries:n};return he(o)||(o={version:1,baseGeneration:t,complete:!1,incompleteReason:"change-journal-byte-limit",entries:[]}),this.resetPendingChanges(),o}restorePendingChangeJournal(t){let n=[...this.pendingChanges.entries()].map(([o,s])=>({path:o,kind:s})),i=this.pendingChangesComplete,r=this.pendingChangesIncompleteReason;this.resetPendingChanges(),t.complete||this.markPendingChangesIncomplete(t.incompleteReason??"failed-reindex");for(let o of t.entries)this.recordPendingChange(o);i||this.markPendingChangesIncomplete(r??"failed-reindex");for(let o of n)this.recordPendingChange(o)}resetPendingChanges(){this.pendingChanges.clear(),this.pendingChangesComplete=!0,this.pendingChangesIncompleteReason=void 0}clearDebounceTimer(){this.debounceTimer&&(this.clock.clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(this.clock.clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}clearBudgetTimer(){this.budgetTimer&&(this.clock.clearTimeout(this.budgetTimer),this.budgetTimer=null)}startGitStatePolling(){this.lastGitState=this.readGitState(),this.lastGitState&&(v(this).stagedIndexEntries=kt(this.projectRoot,v(this).gitReader),this.gitPollTimer=this.clock.setInterval(()=>this.pollGitState(),this.watchConfig.gitPollMs),this.gitPollTimer.unref?.())}pollGitState(){if(this.reindexInFlight||this.stopped)return;let t=this.lastGitState,n=this.readGitState();if(!t||!n||this.stopped){this.lastGitState=n;return}this.lastGitState=n;let i=t.head!==n.head,r=t.indexPath!==n.indexPath||t.indexMtimeMs!==n.indexMtimeMs||t.indexSize!==n.indexSize;if(!i&&!r)return;let o=v(this),s=o.stagedIndexEntries,a=kt(this.projectRoot,o.gitReader);o.stagedIndexEntries=a;let c=Si(this.projectRoot,o.gitReader,t,n,s,a,i,r),d=null;if(c!==null&&(c.includes(".scipquery.json")&&Et(this,this.projectRoot),d=c.filter(u=>wt(this,"add",u)!==null),d.length===0))return;let l=d?.map(u=>({path:u,kind:Ce(C(this.projectRoot,u))?"change":"delete"}));i&&r?this.scheduleReindex({kind:"watch-git-state",detail:me("HEAD and index changed",d)},l,l!==void 0):i?this.scheduleReindex({kind:"watch-git-head",detail:me("HEAD changed",d)},l,l!==void 0):r&&this.scheduleReindex({kind:"watch-git-index",detail:me(n.indexPath??"index changed",d)},l,l!==void 0)}readGitState(){if(this.preferFilesystemGitState){let t=this.readFilesystemGitState();if(t)return t}return this.readGitStateFromGit()}readFilesystemGitState(){let t=this.watchGitLayout??hi(this.projectRoot);if(!t)return null;this.watchGitLayout=t;let n=fi(t.gitDir);return n?xt(n,t.indexPath):null}readGitStateFromGit(){let t=v(this).gitReader,n=ne(this.projectRoot,["rev-parse","--git-path","index"],t);if(!n)return null;let i=Fe(this.projectRoot,n);return xt(ne(this.projectRoot,["rev-parse","--verify","HEAD"],t),i)}clearGitPollTimer(){this.gitPollTimer&&(this.clock.clearInterval(this.gitPollTimer),this.gitPollTimer=null)}};async function Qn(e,t,n){if(e.length===0)return!0;let i=Promise.all(e).then(()=>!0),r=Math.max(0,t-n.now()),o=null,s=new Promise(c=>{o=n.setTimeout(()=>c(!1),r)}),a=await Promise.race([i,s]);return a&&o&&n.clearTimeout(o),a}var Rt=new WeakMap,jt=new WeakMap,Mt=new WeakMap,k=new WeakMap,X=new WeakMap;function z(e){let t=Rt.get(e);if(t)return t;let n={closures:new Set,errors:[]};return Rt.set(e,n),n}function Xn(e){return jt.get(e)??Nt}function v(e){let t=Mt.get(e);if(!t)throw new Error("Watcher input state was not initialized.");return t}function zn(e,t,n){let i=Promise.resolve().then(()=>t.close()).catch(r=>{let o=`watch subscription close failed during polling fallback: ${String(r)}`;e.errors.push(o),n(new Error(o))});e.closures.add(i),i.then(()=>e.closures.delete(i))}function Vt(e,t=je){let{projectRoot:n,config:i,languages:r,pnpmWorkspaces:o,typescriptProjectMode:s,typescriptProjects:a,clojureConfigPath:c,indexerConcurrency:d,trigger:l}=e,u=Q(n),h=Object.keys(u).length>0?u:i,R=J(n,h),F=h.indexer?.typescript,on=h.indexer?.clojure,Ee=t(process.pid);if(!Ee)throw new Error(`Could not establish watcher process identity for reindex worker ownership (pid ${process.pid}).`);return{workerPath:new URL("./reindex-worker.js",import.meta.url).pathname,env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:n,SCIP_REINDEX_OUTPUT_SCIP:R.indexPath,SCIP_REINDEX_OUTPUT_DB:R.dbPath,SCIP_REINDEX_LANGUAGES:(h.languages??r)?.join(",")??"",SCIP_REINDEX_INDEXER_CONCURRENCY:String(h.indexerConcurrency??d??""),SCIP_REINDEX_PNPM_WORKSPACES:F?.pnpmWorkspaces??o?"1":"",SCIP_REINDEX_TYPESCRIPT_CONFIG:JSON.stringify({projectMode:F?.projectMode??s,projects:F?.projects??a??[],maxHeapMb:F?.maxHeapMb}),SCIP_REINDEX_CLOJURE_CONFIG_PATH:on?.configPath??c??"",SCIP_REINDEX_TRIGGER_KIND:l.kind,SCIP_REINDEX_TRIGGER_DETAIL:l.detail??"",SCIP_REINDEX_CHANGE_JOURNAL:e.changeJournal?he(e.changeJournal)??"":"",SCIP_REINDEX_ALLOW_EXPENSIVE:e.allowExpensiveRebuild===!1?"0":"1",SCIP_REINDEX_PROCESS_GROUP_LEADER:"1",SCIP_REINDEX_PARENT_IDENTITY:JSON.stringify(Ee)}}}var Zn={now:G,wallNow:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ei=(e,t)=>ti(process.platform,t.usePolling)?new ye(e):qn(e,t);function ti(e,t){return e==="darwin"&&t!==!0}var W=class extends Error{constructor(t,n){super(t,n===void 0?void 0:{cause:n}),this.name="RecursiveSourceWatchError"}},ye=class{events=new Un;watcher;constructor(t){this.watcher=Bn(t,{recursive:!0},(n,i)=>{if(i===null){this.events.emit("error",new W("Recursive source watcher omitted the changed path."));return}let r=C(t,i.toString());this.events.emit("all",ni(n,r),r)}),this.watcher.on("error",n=>{this.events.emit("error",new W(`Recursive source watcher failed: ${n.message}`,n))})}on=(t,n)=>(this.events.on(t,n),this);close(){this.watcher.close()}};function ni(e,t){return e==="change"?"change":Ce(t)?_t(t).isDirectory()?"addDir":"add":"unlink"}var ii=15*6e4,ri=1e3,oi=64*1024;function si(){return{stdoutTail:"",stderrTail:"",stdoutTruncated:!1,stderrTruncated:!1}}function St(e,t){let n=e instanceof Error?e.message:String(e),i=t.stderrTail.trim()||t.stdoutTail.trim();return i?`${n}
3
3
  ${i}`:n}function ai(e,t){return Object.assign(new Error(e,t===void 0?void 0:{cause:t}),{retryable:!0})}function Dt(e){return e instanceof Error&&"retryable"in e&&e.retryable===!0}function ci(e,t){let n=e*2**Math.min(5,Math.max(0,t-1));return Math.max(e,Math.min(3e4,n))}function Lt(e={}){let t=e.timeoutMs??ii,n=e.terminationGraceMs??ri,i=e.maxOutputBytes??oi,r=e.resolveLaunch??Vt;return{start(o){let s=r(o),a=new AbortController,c=si(),d=!1,l=qe({command:process.execPath,args:[...process.execArgv,s.workerPath],label:"watch reindex worker",env:s.env,timeoutMs:t,terminationGraceMs:n,maxStdoutBytes:i,maxStderrBytes:i,outputLimitBehavior:"truncate-tail",signal:a.signal,detached:!0}).then(u=>{if(c={stdoutTail:u.stdout,stderrTail:u.stderr,stdoutTruncated:u.stdoutTruncated,stderrTruncated:u.stderrTruncated},u.status!==0){let h=St(new Error(`Reindex worker exited with ${u.signal?`signal ${u.signal}`:`code ${u.status}`}`),c);throw u.status===75?ai(h):new Error(h)}return u.durationMs}).catch(u=>{throw Dt(u)?u:(u instanceof Ke&&(c={stdoutTail:u.stdout,stderrTail:u.stderr,stdoutTruncated:u.stdoutTruncated,stderrTruncated:u.stderrTruncated}),new Error(St(u,c),{cause:u}))}).finally(()=>{d=!0});return{completion:l,async cancel(){d||a.abort();try{await l}catch{}return{state:"exited",diagnostics:c}},diagnostics:()=>c}}}}function fe(e,t){return e?e.kind===t.kind?e.detail===t.detail?e:{kind:e.kind,detail:"multiple changes"}:{kind:"watch-git-state",detail:`${e.kind}, ${t.kind}`}:t}function di(e){if(e==="add")return"add";if(e==="change")return"change";if(e==="unlink")return"delete"}function ui(e,t){return e?e==="add"?t==="delete"?null:"add":e==="delete"&&t==="add"?"change":t:t}function li(e){return e instanceof Error&&"code"in e&&e.code==="EMFILE"||String(e).includes("EMFILE: too many open files")}function pi(e){return e instanceof W||li(e)}var ve=/^[0-9a-f]{40,64}$/i;function It(e,t){return e===".git"||e.startsWith(".git/")||e==="node_modules"||e.startsWith("node_modules/")||e.endsWith("/node_modules")||e.includes("/node_modules/")?!0:t!==void 0&&(e===t||e.startsWith(`${t}/`))}function hi(e){let t=C(e,".git");try{let n=Jn(t),i;if(n.isDirectory())i=t;else if(n.isFile()){let r=/^gitdir:\s*(.+)\s*$/m.exec(O(t,"Git directory marker"));if(!r?.[1])return null;let o=r[1].trim();i=be(o)?o:At(e,o)}else return null;return Ce(i)?{gitDir:i,indexPath:C(i,"index")}:null}catch{return null}}function fi(e){let t;try{t=O(C(e,"HEAD"),"Git HEAD").trim()}catch{return}if(ve.test(t))return t.toLowerCase();let n=/^ref:\s*(.+)$/.exec(t)?.[1]?.trim();if(!n)return;let i=mi(e);return Ot(e,n)??Ot(i,n)??gi(i,n)}function mi(e){try{let t=O(C(e,"commondir"),"Git common-directory marker").trim();return t?be(t)?t:At(e,t):e}catch{return e}}function Ot(e,t){try{let n=O(C(e,t),"Git reference").trim();return ve.test(n)?n.toLowerCase():void 0}catch{return}}function gi(e,t){try{for(let n of O(C(e,"packed-refs"),"Git packed references").split(`
4
4
  `)){if(n.startsWith("#")||n.startsWith("^"))continue;let i=n.indexOf(" ");if(i===-1)continue;let r=n.slice(0,i);if(n.slice(i+1).trim()===t&&ve.test(r))return r.toLowerCase()}}catch{return}}function xt(e,t){let n={head:e,indexPath:t};try{let i=_t(t);n.indexMtimeMs=i.mtimeMs,n.indexSize=i.size}catch{n.indexMtimeMs=void 0,n.indexSize=void 0}return n}function yi(e,t){let n=Tt(e,t).replaceAll("\\","/");if(!(!n||n===".."||n.startsWith("../")))return n}function Ci(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive integer.`);return e}function Wt(e){return e&&e.length>0?[...e]:M}function Et(e,t){try{let n=v(e);n.config=Q(t),n.languages=Wt(n.config.languages)}catch{v(e).languages=M}}function wt(e,t,n){let i=v(e);if(te(n,i.languages)==="other")return null;let o=di(t);if(n===".scipquery.json"||Ge(n))return i.typeScriptInputPaths=null,o;if(!bi(n,i.languages))return o;let s=i.typeScriptInputPaths;if(!s)return o;let a=s.has(n);if(o!=="add")return a?o:null;if(a)return"change";let c=$t(e);return c?c.has(n)?"add":null:o}function Pt(e){let t=v(e);if(!t.languages.includes("typescript")){t.typeScriptInputPaths=null;return}let n=vi(t.projectRoot,t.config,t.languages);t.typeScriptInputPaths=n??$t(e)}function $t(e){let t=v(e);if(!t.languages.includes("typescript"))return t.typeScriptInputPaths=null,null;try{let n=t.config.indexer?.typescript,i=Je(t.projectRoot,n?.projectMode,n?.projects);return t.typeScriptInputPaths=i,i}catch{return t.typeScriptInputPaths=null,null}}function bi(e,t){if(!t.includes("typescript"))return!1;let n=te(e,["typescript","javascript"]);return n==="source"||n==="ambient"}function vi(e,t,n){try{let i=ke(O(J(e,t).metaPath,"reindex metadata"));if(i.kind!=="supported"&&i.kind!=="legacy")return null;let r=we(i.metadata.fingerprint);return!r||!Ri(r,n,t)?null:new Set(r.files.map(o=>o.path))}catch{return null}}function Ri(e,t,n){let i=Ue(t,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath});return e.version===i.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(i.languages)&&e.pnpmWorkspaces===i.pnpmWorkspaces&&e.typescriptProjectMode===i.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(i.typescriptProjects)&&e.clojureConfigPath===i.clojureConfigPath}function Si(e,t,n,i,r,o,s,a){let c=new Set;if(s){if(!n.head||!i.head)return null;let d=t.runResult(e,["diff","--name-only","-z","--no-renames","--relative",n.head,i.head,"--"]);if(d.kind!=="success")return null;for(let l of Ii(d.output))c.add(l)}if(a){if(r===null||o===null)return null;for(let d of xi(r,o))c.add(d)}return[...c].sort()}function kt(e,t){let n=t.runResult(e,["diff","--cached","--raw","-z","--no-renames","--relative","--"]);return n.kind==="success"?Oi(n.output):null}function Ii(e){return e.split("\0").filter(t=>t.length>0)}function Oi(e){let t=e.split("\0");if(t.at(-1)===""&&t.pop(),t.length%2!==0)return null;let n=new Map;for(let i=0;i<t.length;i+=2){let r=t[i],o=t[i+1];if(!r.startsWith(":")||!o)return null;n.set(o,r)}return n}function xi(e,t){return[...new Set([...e.keys(),...t.keys()])].filter(i=>e.get(i)!==t.get(i))}function me(e,t){return t===null?`${e}; changed paths unavailable`:t.length===0?e:t.length===1?t[0]:`${t.length} compiler inputs changed`}import{existsSync as Re,mkdirSync as Ei,symlinkSync as wi,readlinkSync as Ft,unlinkSync as Gt,readdirSync as Pi}from"fs";import{join as _,dirname as Se,resolve as T,relative as ki,isAbsolute as _i}from"path";import{homedir as Ti,platform as Ai}from"os";import{fileURLToPath as Ni}from"url";var ji=Ai()==="win32";var Jt=["scip-query","scip-plan","scip-setup","scip-integrity-audit","scip-explore","concrete-plan"];function Mi(e={}){let t=e.quiet?()=>{}:console.log,n=Ni(import.meta.url),i=T(Se(n),"..","skills"),r=e.homeDir??process.env.SCIP_QUERY_SKILLS_HOME??Ti(),o=[_(r,".claude","skills"),_(r,".codex","skills"),_(r,".agents","skills")],s={installed:[],skipped:[],alreadyLinked:[],pruned:[]};for(let a of o){let c=Se(a);if(!Re(c))continue;Ei(a,{recursive:!0});let d=Li(a);Vi(a,i,d,s,t);for(let l of Jt){let u=_(i,l),h=_(a,l);if(!Re(u)){s.skipped.push(`${d}/${l}`);continue}if(Re(h)){try{let R=Ft(h);if(T(R)===T(u)){s.alreadyLinked.push(`${d}/${l}`),t(` ok: ${l} \u2192 ${d} (already linked)`);continue}}catch{s.skipped.push(`${d}/${l}`),t(` skip: ${l} \u2192 ${d} (exists, not a symlink)`);continue}Gt(h)}wi(u,h,ji?"junction":"dir"),s.installed.push(`${d}/${l}`),t(` done: ${l} \u2192 ${d}`)}}return s}function Vi(e,t,n,i,r){let o=new Set(Jt);for(let s of Pi(e)){if(o.has(s))continue;let a=_(e,s),c;try{c=T(Se(a),Ft(a))}catch{continue}Di(c,t)&&(Gt(a),i.pruned.push(`${n}/${s}`),r(` prune: ${s} \u2192 ${n} (removed stale scip-query skill link)`))}}function Di(e,t){let n=ki(T(t),T(e));return n===""||!n.startsWith("..")&&!_i(n)}function Li(e){return e.includes(".codex")?"Codex":e.includes(".agents")?"Agents":"Claude"}var Bt=["repository-observation","repository-preview","mutation","composite","environment-observation","tool-information"];function Wi(e,t=[]){return{defaultRole:e,...t.length>0?{rules:t}:{}}}function $i(e,t){for(let n of e.rules??[]){if(n.when.kind==="option-present"){let r=t.options[n.when.name];if(r!==void 0&&r!==!1)return n.role;continue}if((n.when.kind==="argument"?t.args[n.when.index]:t.options[n.when.name])===n.when.equals)return n.role}return e.defaultRole}function Fi(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(t=>t.role)])]}function Z(e){return Bt.includes(e)}function Gi(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}var Ie=1,Oe=1,ee=["compiler-graph","semantic-analysis","repository-source","change-history","runtime-measurement","heuristic","mixed","unknown"],Ut=["complete","partial","unknown"],Ht=["validated","failed","not-evaluated","not-applicable"],Kt=["observe","advise","require-adjudication","block","not-established"],qt={policyId:"scip-query:unresolved-repository-policy",policyVersion:Oe,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function Ji(e){return{schemaVersion:Ie,origin:e.contract.origin,coverage:Yt(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:K(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??qt,...e.contract.families?{families:e.contract.families}:{}}}function Yt(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}function Bi(e,t){let n=[];return $(n,"origin",t.origins,e.origin),$(n,"coverage",t.coverage,e.coverage.state),$(n,"producer-validation",t.producerValidation,e.producerValidation.status),$(n,"state-authority",t.stateAuthority,e.stateAuthority.authority),$(n,"action-permission",t.actionPermission,e.repositoryPolicy.permission),{satisfied:n.every(i=>i.satisfied),predicates:n}}function $(e,t,n,i){n&&e.push({predicate:t,satisfied:n.includes(i),required:n,actual:i})}function xe(e){return!p(e)||e.schemaVersion!==Ie||!A(e.origin,ee)||!Ui(e.coverage)||!Hi(e.producerValidation)||!Ki(e.stateAuthority)||!qi(e.repositoryPolicy)?!1:e.families===void 0||Yi(e.families)}function Ui(e){return!p(e)||!A(e.state,Ut)||!w(e.returned)||typeof e.totalKnown!="boolean"||e.total!==void 0&&!w(e.total)||e.omitted!==void 0&&!w(e.omitted)?!1:e.state==="complete"?e.totalKnown===!0&&e.total===e.returned&&e.omitted===0:e.state==="partial"?e.totalKnown===!0&&w(e.total)&&w(e.omitted)&&e.total===Number(e.returned)+Number(e.omitted):e.totalKnown===!1}function Hi(e){if(!p(e)||!A(e.status,Ht))return!1;let t=e.certification;return e.status==="validated"||e.status==="failed"?p(t)&&g(t.id)&&Number.isSafeInteger(t.version)&&Number(t.version)>0&&g(t.corpus):t===void 0}function Ki(e){return p(e)&&Number.isSafeInteger(e.policyVersion)&&(e.authority==="completion"||e.authority==="advisory"||e.authority==="none")&&Array.isArray(e.requiredRelationships)&&e.requiredRelationships.every(g)&&Array.isArray(e.reasons)&&e.reasons.every(g)}function qi(e){return p(e)&&g(e.policyId)&&e.policyVersion===Oe&&A(e.permission,Kt)&&Array.isArray(e.reasons)&&e.reasons.every(g)}function Yi(e){return Array.isArray(e)&&e.every(t=>p(t)&&g(t.id)&&g(t.selector)&&Qi(t.origin))}function Qi(e){return p(e)?e.kind==="fixed"?A(e.origin,ee)&&e.origin!=="mixed":e.kind!=="result-field"||!g(e.field)||!p(e.values)?!1:Object.values(e.values).every(t=>A(t,ee)&&t!=="mixed"):!1}function A(e,t){return typeof e=="string"&&t.includes(e)}var zt="scip-query-result",Zt=0,N=1,Xi=1,en=1,tn=1;function nn(e){if(!p(e))return{kind:"malformed",reason:"CLI JSON output must be an object."};let t=Object.hasOwn(e,"kind"),n=Object.hasOwn(e,"schemaVersion");if(!t&&!n){let s=Qt(e);return s?{kind:"malformed",reason:`Legacy CLI JSON envelope: ${s}`}:{kind:"legacy",schemaVersion:Zt,envelope:e}}if(!t||!n)return{kind:"malformed",reason:"CLI JSON envelope must contain both kind and schemaVersion."};if(e.kind!==zt)return{kind:"malformed",reason:`Unsupported CLI JSON envelope kind: ${tr(e.kind)}.`};let i=e.schemaVersion;if(!Number.isSafeInteger(i)||Number(i)<1)return{kind:"malformed",reason:"CLI JSON envelope schemaVersion must be a positive safe integer."};if(i!==N)return{kind:"unsupported",schemaVersion:Number(i),direction:Number(i)<N?"older":"future",...Xt(e.producer)?{producer:e.producer}:{}};let r=Qt(e);if(r)return{kind:"malformed",reason:`CLI JSON envelope v1: ${r}`};if(!Xt(e.producer))return{kind:"malformed",reason:"CLI JSON envelope v1: producer must identify scip-query and its non-empty version."};if(!j(e.resultSchemaVersion))return{kind:"malformed",reason:"CLI JSON envelope v1: resultSchemaVersion must be a positive safe integer."};if(e.resultProjection!==void 0&&e.resultProjection!=="agent")return{kind:"malformed",reason:'CLI JSON envelope v1: resultProjection must be "agent" when present.'};let o=rn(e.command);return o.includes(e.resultSchemaVersion)?e.evidenceContext!==void 0&&!er(e.evidenceContext)?{kind:"malformed",reason:"CLI JSON envelope v1: evidenceContext must contain a supported receipt and analysis manifest."}:e.operationRole!==void 0&&!Z(e.operationRole)?{kind:"malformed",reason:"CLI JSON envelope v1: operationRole must be a supported command operation role."}:p(e.evidenceContext)&&e.operationRole!==void 0&&e.evidenceContext.operationRole!==void 0&&e.operationRole!==e.evidenceContext.operationRole?{kind:"malformed",reason:"CLI JSON envelope v1: top-level and evidence-context operation roles must agree."}:{kind:"supported",schemaVersion:N,envelope:e}:{kind:"unsupported-result",schemaVersion:N,command:e.command,resultSchemaVersion:e.resultSchemaVersion,supportedResultSchemaVersions:o}}function zi(e){let t=nn(e);if(t.kind==="legacy"||t.kind==="supported")return t;if(t.kind==="unsupported"){let n=t.producer?` from ${t.producer.name}@${t.producer.version}`:"";throw new Error(`Unsupported scip-query CLI JSON schemaVersion ${t.schemaVersion}${n}; this consumer supports the legacy unversioned envelope and schemaVersion ${N}.`)}throw t.kind==="unsupported-result"?new Error(`Unsupported resultSchemaVersion ${t.resultSchemaVersion} for scip-query command ${JSON.stringify(t.command)}; this consumer supports ${t.supportedResultSchemaVersions.join(", ")}.`):new Error(`Malformed scip-query CLI JSON envelope: ${t.reason}`)}function rn(e){return Zi[e]??[Xi]}var Zi={};function Qt(e){return typeof e.command!="string"||e.command.length===0?"command must be a non-empty string.":Array.isArray(e.args)?p(e.options)?Object.hasOwn(e,"result")?null:"result is required.":"options must be an object.":"args must be an array."}function Xt(e){return p(e)&&e.name==="scip-query"&&typeof e.version=="string"&&e.version.length>0}function er(e){if(!p(e)||e.schemaVersion!==en||e.operationRole!==void 0&&!Z(e.operationRole)||!H(e.receipt))return!1;let t=e.analysisManifest;return p(t)&&t.schemaVersion===tn&&(t.evidence===void 0||t.evidence==="graph-fact"||t.evidence==="heuristic"||t.evidence==="mixed")&&(t.claimQualification===void 0||xe(t.claimQualification))}function tr(e){return typeof e=="string"?JSON.stringify(e):String(e)}export{Kt as CLAIM_ACTION_PERMISSIONS,Oe as CLAIM_ACTION_POLICY_VERSION,Ut as CLAIM_COVERAGE_STATES,ee as CLAIM_ORIGINS,Ie as CLAIM_QUALIFICATION_SCHEMA_VERSION,tn as CLI_ANALYSIS_MANIFEST_SCHEMA_VERSION,en as CLI_EVIDENCE_CONTEXT_SCHEMA_VERSION,zt as CLI_JSON_ENVELOPE_KIND,Bt as COMMAND_OPERATION_ROLES,N as CURRENT_CLI_JSON_ENVELOPE_SCHEMA_VERSION,qt as DEFAULT_REPOSITORY_POLICY_ACTION,Zt as LEGACY_CLI_JSON_ENVELOPE_SCHEMA_VERSION,f as LEGACY_OBSERVATION_RECEIPT_SCHEMA_VERSION,D as OBSERVATION_IDENTITY_CANONICALIZATION_VERSION,V as OBSERVATION_IDENTITY_HASH_ALGORITHM,U as OBSERVATION_IDENTITY_SCHEMA_VERSION,I as OBSERVATION_RECEIPT_SCHEMA_VERSION,ae as OBSERVATION_STATE_AUTHORITY_POLICY_VERSION,Ht as PRODUCER_VALIDATION_STATUSES,ge as Watcher,Wi as commandOperation,Fi as commandOperationRoles,de as compareObservationReceipts,tt as createObservationIdentity,Lt as createReindexRunner,nn as decodeCliJsonEnvelope,ce as decodeObservationReceipt,Yt as deriveClaimCoverage,Ji as deriveClaimQualification,K as deriveObservationStateAuthority,Bi as evaluateClaimQualification,an as getScipVersion,Wn as initProjectConfig,Mi as installSkills,xe as isClaimQualificationV1,Z as isCommandOperationRole,H as isObservationReceipt,sn as isScipInstalled,Q as loadProjectConfig,nt as observationReceiptGenerationIdentity,rt as observationReceiptStabilityLabel,it as observationReceiptWorkspaceIdentity,Gi as operationObservesRepository,cn as printScipInstallInstructions,zi as requireCompatibleCliJsonEnvelope,$i as resolveCommandOperationRole,J as resolveIndexStoragePaths,Vt as resolveReindexWorkerLaunch,rn as supportedCliResultSchemaVersions};
@@ -1,2 +1,2 @@
1
- import{j as O}from"./chunk-ND3BWIVN.js";import{e as E,f as A,g as C,h as V,m as F}from"./chunk-FLSVYEPL.js";import"./chunk-CTO3TRX7.js";import"./chunk-F4FNK44D.js";import"./chunk-67FK5KGV.js";import"./chunk-DRENNWRG.js";import"./chunk-4SZJF4GK.js";import{b as h}from"./chunk-O4PZFAXA.js";import{a as x,c as q,d as N,i as _,j as T,n as g,o as k,p as P,q as B,s as U}from"./chunk-NQXWWE6S.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import{c as L,d as b,e as v}from"./chunk-Z2KGMIL4.js";import"./chunk-XIPGCT3D.js";import n from"process";import{randomUUID as J}from"crypto";import{rmSync as W}from"fs";import{resolve as S}from"path";import{pathToFileURL as X}from"url";var G=10*6e4,j=10,z=250,Y=1e3;function $(e,t,o={}){let M=_(e),d=o.now??(o.nowMs===void 0?Date.now:()=>o.nowMs),f=d(),y=A(e),w=g(M,{ownerId:o.ownerId??re,nowMs:f,limits:o.limits,owner:ne,liveness:ie}),p=0;for(let i of w){let s=null,c,m="handler-error";try{let a=k(i,o.limits),u;try{u=JSON.parse(a)}catch{throw m="malformed-request",new Error("Durable Rust semantic helper received malformed request JSON.")}let r=C(u,{claimRequestId:i.requestId,sessionIdentity:y,nowMs:d()});if(!r.ok)throw m=r.code,c=r.responseIdentity,new Error(r.error);s=r.value,c={id:s.id,sessionIdentity:s.sessionIdentity,deadlineAtMs:s.deadlineAtMs};let l=K(s.request,o.monotonicNowMs??b());o.beforeRequest?.(l);let R=t.handle(l),I=d();if(s.deadlineAtMs<I)throw m="expired-request",new Error("Durable Rust semantic request expired while the helper was processing it.");P(M,i,{ok:!0,protocolVersion:E,id:s.id,sessionIdentity:s.sessionIdentity,deadlineAtMs:s.deadlineAtMs,...R},{nowMs:I,limits:o.limits})}catch(a){let u=d(),r=c??(s?{id:s.id,sessionIdentity:s.sessionIdentity,deadlineAtMs:s.deadlineAtMs}:void 0),l=a instanceof Error?a.message:String(a);B(M,i,{ok:!1,protocolVersion:E,id:r?.id??i.requestId,...r?{sessionIdentity:r.sessionIdentity,deadlineAtMs:r.deadlineAtMs}:{},errorCode:m,error:l},l,{nowMs:u,limits:o.limits})}p+=1}return p}function K(e,t){let o=t+Math.max(1,e.timeoutMs-1e3);return{...e,request:{...e.request,readinessDeadlineMs:o}}}async function Q(e,t){let o=_(e);T(o);let M=S(e,"server.lock"),d=te(M);if(!d)return;let f=new V(()=>F({semanticWorkerPath:t,shareEnvironment:!0})),y=!1,w=b(),p=Number.NEGATIVE_INFINITY,i,s=0,c=L(n.pid),m=A(e),a=()=>{y=!0};n.once("SIGINT",a),n.once("SIGTERM",a);let u=(r=!1,l=r?"durable":"visibility")=>{let R=Date.now(),I=b();if(!r&&I-p<Y)return;p=I;let D={protocolVersion:E,sessionIdentity:m,pid:n.pid,...c?{processIdentity:c}:{},heartbeatAtMs:R,...i===void 0?{}:{busyUntilMs:i},mailbox:U(o)};l==="durable"?N(S(e,"server.json"),D):q(S(e,"server.json"),D)};try{u(!0);let r=se();for(;!y&&b()-w<r;){let l=$(e,f,{beforeRequest(R){i=Date.now()+R.timeoutMs+5e3,u(!0,"visibility")}});l>0?(s=0,w=b(),i=void 0,u(!0,"visibility")):(s+=1,u()),await O(Z(l,s))}}finally{f.shutdown(),W(S(e,"server.json"),{force:!0}),d.release()}}function Z(e,t=1){return v(e,t,j,j,z,5)}var ee=e=>{let t=Number(e);return Number.isInteger(t)&&t>0?{pid:t}:null};function te(e){let t=h(e,{kind:"rust-durable-session-server",parseLegacy:ee});return t.kind==="acquired"?t.lock:null}function se(){let e=Number(n.env.SCIP_RUST_SEMANTIC_DURABLE_IDLE_MS);return Number.isInteger(e)&&e>=0?e:G}var oe=n.argv[1]?X(S(n.argv[1])).href:null;if(oe===import.meta.url){let e=n.argv[2],t=n.argv[3];!e||!t?(console.error("durable-rust-session: expected <session-dir> <semantic-worker-path>"),n.exitCode=1):await Q(e,t)}var re=`rust-semantic-${n.pid}-${J()}`,H=L(n.pid),ne={pid:n.pid,...H?{processIdentity:H}:{}},ie={isProcessAlive:x,readProcessIdentity:L};export{te as acquireDurableRustSessionServerLock,Z as durableSessionLoopDelayMs,$ as processDurableRustSessionRequests};
1
+ import{j as O}from"./chunk-KQHJEU6V.js";import{e as E,f as A,g as C,h as V,m as F}from"./chunk-WSLEJSFR.js";import"./chunk-VUSKPCUB.js";import"./chunk-F4FNK44D.js";import"./chunk-HCVJR2V4.js";import"./chunk-DRENNWRG.js";import"./chunk-JHH5SCZ3.js";import{b as h}from"./chunk-57N6LN2A.js";import{a as x,c as q,d as N,i as _,j as T,n as g,o as k,p as P,q as B,s as U}from"./chunk-JT6XX7QY.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import{c as L,d as b,e as v}from"./chunk-SB25YMEQ.js";import"./chunk-AK3PYTIK.js";import n from"process";import{randomUUID as J}from"crypto";import{rmSync as W}from"fs";import{resolve as S}from"path";import{pathToFileURL as X}from"url";var G=10*6e4,j=10,z=250,Y=1e3;function $(e,t,o={}){let M=_(e),d=o.now??(o.nowMs===void 0?Date.now:()=>o.nowMs),f=d(),y=A(e),w=g(M,{ownerId:o.ownerId??re,nowMs:f,limits:o.limits,owner:ne,liveness:ie}),p=0;for(let i of w){let s=null,c,m="handler-error";try{let a=k(i,o.limits),u;try{u=JSON.parse(a)}catch{throw m="malformed-request",new Error("Durable Rust semantic helper received malformed request JSON.")}let r=C(u,{claimRequestId:i.requestId,sessionIdentity:y,nowMs:d()});if(!r.ok)throw m=r.code,c=r.responseIdentity,new Error(r.error);s=r.value,c={id:s.id,sessionIdentity:s.sessionIdentity,deadlineAtMs:s.deadlineAtMs};let l=K(s.request,o.monotonicNowMs??b());o.beforeRequest?.(l);let R=t.handle(l),I=d();if(s.deadlineAtMs<I)throw m="expired-request",new Error("Durable Rust semantic request expired while the helper was processing it.");P(M,i,{ok:!0,protocolVersion:E,id:s.id,sessionIdentity:s.sessionIdentity,deadlineAtMs:s.deadlineAtMs,...R},{nowMs:I,limits:o.limits})}catch(a){let u=d(),r=c??(s?{id:s.id,sessionIdentity:s.sessionIdentity,deadlineAtMs:s.deadlineAtMs}:void 0),l=a instanceof Error?a.message:String(a);B(M,i,{ok:!1,protocolVersion:E,id:r?.id??i.requestId,...r?{sessionIdentity:r.sessionIdentity,deadlineAtMs:r.deadlineAtMs}:{},errorCode:m,error:l},l,{nowMs:u,limits:o.limits})}p+=1}return p}function K(e,t){let o=t+Math.max(1,e.timeoutMs-1e3);return{...e,request:{...e.request,readinessDeadlineMs:o}}}async function Q(e,t){let o=_(e);T(o);let M=S(e,"server.lock"),d=te(M);if(!d)return;let f=new V(()=>F({semanticWorkerPath:t,shareEnvironment:!0})),y=!1,w=b(),p=Number.NEGATIVE_INFINITY,i,s=0,c=L(n.pid),m=A(e),a=()=>{y=!0};n.once("SIGINT",a),n.once("SIGTERM",a);let u=(r=!1,l=r?"durable":"visibility")=>{let R=Date.now(),I=b();if(!r&&I-p<Y)return;p=I;let D={protocolVersion:E,sessionIdentity:m,pid:n.pid,...c?{processIdentity:c}:{},heartbeatAtMs:R,...i===void 0?{}:{busyUntilMs:i},mailbox:U(o)};l==="durable"?N(S(e,"server.json"),D):q(S(e,"server.json"),D)};try{u(!0);let r=se();for(;!y&&b()-w<r;){let l=$(e,f,{beforeRequest(R){i=Date.now()+R.timeoutMs+5e3,u(!0,"visibility")}});l>0?(s=0,w=b(),i=void 0,u(!0,"visibility")):(s+=1,u()),await O(Z(l,s))}}finally{f.shutdown(),W(S(e,"server.json"),{force:!0}),d.release()}}function Z(e,t=1){return v(e,t,j,j,z,5)}var ee=e=>{let t=Number(e);return Number.isInteger(t)&&t>0?{pid:t}:null};function te(e){let t=h(e,{kind:"rust-durable-session-server",parseLegacy:ee});return t.kind==="acquired"?t.lock:null}function se(){let e=Number(n.env.SCIP_RUST_SEMANTIC_DURABLE_IDLE_MS);return Number.isInteger(e)&&e>=0?e:G}var oe=n.argv[1]?X(S(n.argv[1])).href:null;if(oe===import.meta.url){let e=n.argv[2],t=n.argv[3];!e||!t?(console.error("durable-rust-session: expected <session-dir> <semantic-worker-path>"),n.exitCode=1):await Q(e,t)}var re=`rust-semantic-${n.pid}-${J()}`,H=L(n.pid),ne={pid:n.pid,...H?{processIdentity:H}:{}},ie={isProcessAlive:x,readProcessIdentity:L};export{te as acquireDurableRustSessionServerLock,Z as durableSessionLoopDelayMs,$ as processDurableRustSessionRequests};
2
2
  //# sourceMappingURL=rust-semantic-session-server.js.map
@@ -1,2 +1,2 @@
1
- import{b as H,c as U,d as K,e as W,f as le,i as ce,j as ue,k as de,l as fe,m as D,o as me,p as pe}from"./chunk-Y2S4YNLH.js";import{a as P,b as ne}from"./chunk-ILMHV3KM.js";import{b as te,c as ie,d as C,e as N,f as G,h as E,i as B,j as S}from"./chunk-ND3BWIVN.js";import{d as F,e as se,f as re,g as oe,h as ae}from"./chunk-67FK5KGV.js";import"./chunk-4SZJF4GK.js";import{a as j,f as d,g as M}from"./chunk-HGFDYOVB.js";import"./chunk-Z2KGMIL4.js";import{ja as q,ka as ee}from"./chunk-XIPGCT3D.js";import k from"process";import{existsSync as Te,writeFileSync as ve}from"fs";import{dirname as Ae,isAbsolute as Ie,resolve as Ce}from"path";import{performance as L}from"perf_hooks";import{parentPort as Ee}from"worker_threads";import{resolve as he}from"path";var ze=4,x=class{constructor(n=ze){this.capacity=n;if(!Number.isSafeInteger(n)||n<=0)throw new Error("Rust analyzer session capacity must be a positive safe integer.")}capacity;entries=new Map;get(n){let i=this.entries.get(n);if(i)return this.entries.delete(n),this.entries.set(n,i),i}async acquire(n,i,t){let s=this.get(n);if(s)return s;if(this.entries.size>=this.capacity){let o=this.entries.entries().next().value;if(!o)throw new Error("Rust analyzer session registry capacity accounting is inconsistent.");this.entries.delete(o[0]);try{await t(o[1])}catch(l){throw this.restoreOldest(o),l}}let r=await i();if(r.key!==n){try{await t(r)}catch(o){throw new AggregateError([o],`Rust analyzer session factory returned '${r.key}' for reserved key '${n}', and the mismatched session could not be reaped.`,{cause:o})}throw new Error(`Rust analyzer session factory returned '${r.key}' for reserved key '${n}'.`)}return this.entries.set(n,r),r}deleteIfSame(n){return this.entries.get(n.key)!==n?!1:this.entries.delete(n.key)}async shutdownAll(n){let i=[...this.entries.values()];this.entries.clear();let t=await Promise.allSettled(i.map(n)),s=[];for(let r=0;r<t.length;r+=1){let o=t[r];if(o.status==="fulfilled")continue;let l=i[r];s.push({session:l,reason:o.reason}),this.entries.set(l.key,l)}if(s.length>0)throw new AggregateError(s.map(r=>r.reason),`Failed to shut down ${s.length} retained rust-analyzer session(s).`)}get size(){return this.entries.size}restoreOldest(n){let i=[...this.entries.entries()];this.entries.clear(),this.entries.set(n[0],n[1]);for(let[t,s]of i)this.entries.set(t,s)}};function Re(e,n){let i=he(e);return[...new Set(n.map(t=>he(i,t)))].sort((t,s)=>t<s?-1:t>s?1:0)}function ye(e,n,i){return JSON.stringify({binary:e,sessionRoot:n,linkedProjects:i})}var Fe="SCIP_RUST_SEMANTIC_REFERENCE_TASK_PROFILE_MS",We="SCIP_RUST_SEMANTIC_CALLEE_TASK_PROFILE_MS",_=new x,ge=Promise.resolve(),Me;Ee?.on("message",e=>{ge=ge.then(()=>xe(e)).catch(()=>{})});async function xe(e){if(Me??=Ae(e.responsePath),e.kind==="shutdown"){await He(),g(e.responsePath,{ok:!0},e.sharedBuffer);return}if(e.kind==="import-definitions"){try{let n=await Le(e.request);g(e.responsePath,{ok:!0,response:n},e.sharedBuffer)}catch(n){let i=B(n);if(i){g(e.responsePath,i,e.sharedBuffer);return}let t={available:!1,reason:n instanceof Error?n.message:String(n),sourcePaths:e.request.positions.map(s=>[s.id,null])};g(e.responsePath,{ok:!0,response:t},e.sharedBuffer)}return}try{let n=await _e(e.request);g(e.responsePath,{ok:!0,response:n},e.sharedBuffer)}catch(n){let i=B(n);if(i){g(e.responsePath,i,e.sharedBuffer);return}let t=De(e.request,n instanceof Error?n.message:String(n));g(e.responsePath,{ok:!0,response:t},e.sharedBuffer)}}async function Le(e){let n={timeoutMs:e.requestTimeoutMs,deadlineMs:e.readinessDeadlineMs},i=await d("rust.semantic.worker.session",()=>Pe(e.projectRoot,e.rustAnalyzerBinary,[e.file],{requestTimeoutMs:e.requestTimeoutMs,readinessDeadlineMs:e.readinessDeadlineMs}),()=>({kind:"import-definitions",files:1,positions:e.positions.length}));if(!i.capabilities.definitionProvider)return{available:!1,reason:"rust-analyzer initialized without textDocument/definition support.",sourcePaths:e.positions.map(o=>[o.id,null])};let t=0;await E(()=>d("rust.semantic.worker.open-source-documents",async()=>{t=await Ne(i,e.projectRoot,[e.file],{diagnosticsTimeoutMs:e.diagnosticsTimeoutMs,settleDelayMs:e.settleDelayMs,readinessDeadlineMs:e.readinessDeadlineMs})},()=>({files:1,openedDocuments:t,positions:e.positions.length})),()=>ke(_,i,e.readinessDeadlineMs));let s=0;return{available:!0,sourcePaths:await d("rust.semantic.worker.import-definitions",()=>P(e.positions,e.concurrency??8,async o=>{let l=await i.client.definition({textDocument:{uri:F(e.projectRoot,o.file)},position:{line:o.line,character:o.column}},n),u=Ge(e.projectRoot,l);return u&&(s+=1),[o.id,u]}),()=>({positions:e.positions.length,resolvedPositions:s,concurrency:e.concurrency??8}))}}async function _e(e){let n={timeoutMs:e.requestTimeoutMs,deadlineMs:e.readinessDeadlineMs},i=e.includeReferences!==!1,t=e.includeCallees===!0,s=e.includeSignatures===!0,r=H(e),o=U(e),l=K(e),u=W(e),c=await d("rust.semantic.worker.session",()=>Oe(e),()=>({kind:"semantic",definitions:u.length,referenceDefinitions:r.length,calleeDefinitions:o.length,signatureDefinitions:l.length,references:i,callees:t,signatures:s})),p=Be(c.capabilities,{references:i,callees:t,signatures:s});if(p)return De(e,p);let f=0;await E(()=>d("rust.semantic.worker.open-definition-documents",async()=>{f=await je(c,e)},()=>({definitions:u.length,openedDocuments:f})),()=>ke(_,c,e.readinessDeadlineMs));let m=0,b=0,y=j(),$=y?new Map:null,z=y?we(k.env[Fe]):null,J=()=>i?d("rust.semantic.worker.references",()=>P(r,e.concurrency??8,async a=>{let w=y?L.now():0,R=await me(c.client,re(e.projectRoot,a,!1),{requestTimeoutMs:e.requestTimeoutMs,retryTimeoutMs:e.referenceRetryTimeoutMs,deadlineMs:e.readinessDeadlineMs}),h=ae(oe(e.projectRoot,R.locations)),I=y?Math.round(L.now()-w):0;return Ue($,a.relativePath,{durationMs:I,references:h.length,hasReferences:h.length>0,slow:z!==null&&I>=z}),z!==null&&I>=z&&M({type:"span",name:"rust.semantic.worker.reference-task",durationMs:I,ok:!0,symbolId:a.symbolId,relativePath:a.relativePath,leaf:a.leaf,kind:a.kind,startLine:a.startLine,endLine:a.endLine,references:h.length,complete:R.complete}),h.length>0&&(b+=1),m+=h.length,{symbolId:a.symbolId,references:h,complete:R.complete}}),()=>({definitions:r.length,concurrency:e.concurrency??8,definitionsWithReferences:b,references:m})):Promise.resolve(r.map(a=>({symbolId:a.symbolId,references:[],complete:!0}))),V=0,Y=0,T=j(),Z=T?new Map:null,v=T?we(k.env[We]):null,Q=()=>t?d("rust.semantic.worker.callees",()=>P(o,e.concurrency??8,async a=>{let w=T?L.now():0,R=await pe(c.client,e.projectRoot,a,n),h=T?Math.round(L.now()-w):0;return Je(Z,a.relativePath,{durationMs:h,callees:R.length,hasCallees:R.length>0,slow:v!==null&&h>=v}),v!==null&&h>=v&&M({type:"span",name:"rust.semantic.worker.callee-task",durationMs:h,ok:!0,symbolId:a.symbolId,relativePath:a.relativePath,leaf:a.leaf,kind:a.kind,startLine:a.startLine,endLine:a.endLine,callees:R.length}),R.length>0&&(Y+=1),V+=R.length,{symbolId:a.symbolId,callees:R}}),()=>({definitions:o.length,concurrency:e.concurrency??8,definitionsWithCallees:Y,callees:V})):Promise.resolve([]),A,O;i&&t&&r.length>0&&o.length>0&&Ze()?[A,O]=await ne([J(),Q()]):(A=await J(),O=await Q()),Ke($),Ve(Z);let X=0,be=s?await d("rust.semantic.worker.signatures",()=>P(l,e.concurrency??8,async a=>{let w=await le(c.client,e.projectRoot,a,n);return w&&(X+=1),{symbolId:a.symbolId,signature:w}}),()=>({definitions:l.length,concurrency:e.concurrency??8,signaturesFound:X})):[];return{available:!0,references:A.filter(a=>a.complete).map(a=>[a.symbolId,a.references]),incompleteReferenceSymbolIds:A.filter(a=>!a.complete).map(a=>a.symbolId),...t?{callees:O.map(a=>[a.symbolId,a.callees])}:{},...s?{signatures:be.map(a=>[a.symbolId,a.signature])}:{}}}async function Oe(e){return Pe(e.projectRoot,e.rustAnalyzerBinary,W(e).map(n=>n.relativePath),{requestTimeoutMs:e.requestTimeoutMs,readinessDeadlineMs:e.readinessDeadlineMs})}async function Pe(e,n,i,t){let s=Re(e,de(e,i.map(l=>({relativePath:l})))),r=ue(e,s),o=ye(n,r,s);return _.acquire(o,async()=>{let l=ce(s),u=new te(ie(n,r,k.env,Me),{requestTimeoutMs:t.requestTimeoutMs,configuration:l}),c=t.readinessDeadlineMs===void 0?null:{afterGeneration:u.serverStatusGeneration(),deadlineMs:t.readinessDeadlineMs},p=await E(()=>d("rust.semantic.worker.initialize",()=>u.initialize({processId:k.pid,rootUri:F(r,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},definition:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:l},{timeoutMs:t.requestTimeoutMs,deadlineMs:t.readinessDeadlineMs}),()=>({linkedProjects:s.length,relativePaths:i.length})),()=>u.shutdownAndReap({deadlineMs:t.readinessDeadlineMs}));return{key:o,client:u,capabilities:p.capabilities,openedPaths:new Set,initializationReadiness:c}},l=>l.client.shutdownAndReap({deadlineMs:t.readinessDeadlineMs}))}async function je(e,n){let i=W(n).filter(c=>e.openedPaths.has(c.relativePath)?!1:Te(Ce(n.projectRoot,c.relativePath)));if(i.length===0)return await Se(e),0;let t=e.initializationReadiness,s=n.readinessDeadlineMs===void 0?null:{statusSnapshot:t?null:e.client.serverStatusSnapshot(),initializationGeneration:t?.afterGeneration,deadlineMs:n.readinessDeadlineMs},r=fe(e.client,n.projectRoot,i);for(let c of i)e.openedPaths.add(c.relativePath);let o=n.diagnosticsTimeoutMs??1e4,l=o;await d("rust.semantic.worker.diagnostics",()=>s?G(c=>(l=c,D(e.client,r,c)),o,s.deadlineMs):D(e.client,r,o),()=>({openedDocuments:r.length,timeoutMs:l}));let u=n.settleDelayMs??5e3;if(!s)await d("rust.semantic.worker.settle",()=>S(u),()=>({openedDocuments:r.length,settleDelayMs:u}));else{let c;await d("rust.semantic.worker.readiness",async()=>{let p=m=>d("rust.semantic.worker.settle",()=>S(m),()=>({openedDocuments:r.length,settleDelayMs:m})),f=s.initializationGeneration===void 0?await N(e.client,s.statusSnapshot,r.length,s.deadlineMs,u,Date.now,p):await C(e.client,s.initializationGeneration,r.length,s.deadlineMs,u,Date.now,p);s.initializationGeneration!==void 0&&(e.initializationReadiness=null),c=f?.health},()=>({phase:s.initializationGeneration===void 0?"didOpen":"initialize+didOpen",openedDocuments:r.length,health:c}))}return r.length}async function Ne(e,n,i,t){let s=i.filter(f=>!e.openedPaths.has(f));if(s.length===0)return await Se(e),0;let r=e.initializationReadiness,o=t.readinessDeadlineMs===void 0?null:{statusSnapshot:r?null:e.client.serverStatusSnapshot(),initializationGeneration:r?.afterGeneration,deadlineMs:t.readinessDeadlineMs},l=[];for(let f of s)try{let m=F(n,f);e.client.didOpenTextDocument({uri:m,languageId:"rust",version:1,text:q(n,f,{inputKind:"indexed Rust source file"})}),e.openedPaths.add(f),l.push(m)}catch(m){if(!ee(m))throw m}let u=t.diagnosticsTimeoutMs??1e4,c=u;await d("rust.semantic.worker.diagnostics",()=>o?G(f=>(c=f,D(e.client,l,f)),u,o.deadlineMs):D(e.client,l,u),()=>({openedDocuments:l.length,timeoutMs:c}));let p=t.settleDelayMs??5e3;if(!o)await d("rust.semantic.worker.settle",()=>S(p),()=>({openedDocuments:l.length,settleDelayMs:p}));else{let f;await d("rust.semantic.worker.readiness",async()=>{let m=y=>d("rust.semantic.worker.settle",()=>S(y),()=>({openedDocuments:l.length,settleDelayMs:y})),b=o.initializationGeneration===void 0?await N(e.client,o.statusSnapshot,l.length,o.deadlineMs,p,Date.now,m):await C(e.client,o.initializationGeneration,l.length,o.deadlineMs,p,Date.now,m);o.initializationGeneration!==void 0&&(e.initializationReadiness=null),f=b?.health},()=>({phase:o.initializationGeneration===void 0?"didOpen":"initialize+didOpen",openedDocuments:l.length,health:f}))}return l.length}async function Se(e){let n=e.initializationReadiness;if(!n)return;let i;await d("rust.semantic.worker.readiness",async()=>{i=(await C(e.client,n.afterGeneration,0,n.deadlineMs,0)).health,e.initializationReadiness=null},()=>({phase:"initialize",openedDocuments:0,health:i}))}function Ge(e,n){for(let i of n){let t=se(e,i.uri);if(!(!t||t===".."||t.startsWith("../")||Ie(t)))return t}return null}function Be(e,n){return n.references&&!e.referencesProvider?"rust-analyzer initialized without textDocument/references support.":n.callees&&!e.callHierarchyProvider?"rust-analyzer initialized without call hierarchy support.":n.signatures&&!e.hoverProvider?"rust-analyzer initialized without hover support.":null}function De(e,n){let i=H(e),t=U(e),s=K(e);return{available:!1,reason:n,references:i.map(r=>[r.symbolId,[]]),...e.includeCallees?{callees:t.map(r=>[r.symbolId,[]])}:{},...e.includeSignatures?{signatures:s.map(r=>[r.symbolId,null])}:{}}}async function He(){await _.shutdownAll(e=>e.client.shutdownAndReap())}async function ke(e,n,i){e.deleteIfSame(n),await n.client.shutdownAndReap({deadlineMs:i})}function Ue(e,n,i){if(!e)return;let t=$e(e,n);t.definitions+=1,i.hasReferences&&(t.definitionsWithReferences+=1),t.references+=i.references,t.durationMs+=i.durationMs,t.maxDurationMs=Math.max(t.maxDurationMs,i.durationMs),i.slow&&(t.slowTasks+=1)}function Ke(e){if(!e)return;let n=[...e.entries()].sort(([i,t],[s,r])=>r.durationMs-t.durationMs||i.localeCompare(s));for(let[i,t]of n)M({type:"span",name:"rust.semantic.worker.references.by-file",durationMs:t.durationMs,ok:!0,relativePath:i,definitions:t.definitions,definitionsWithReferences:t.definitionsWithReferences,references:t.references,maxDurationMs:t.maxDurationMs,slowTasks:t.slowTasks,aggregate:"sum-task-duration"})}function $e(e,n){let i=e.get(n);if(i)return i;let t={definitions:0,definitionsWithReferences:0,references:0,durationMs:0,maxDurationMs:0,slowTasks:0};return e.set(n,t),t}function Je(e,n,i){if(!e)return;let t=Ye(e,n);t.definitions+=1,i.hasCallees&&(t.definitionsWithCallees+=1),t.callees+=i.callees,t.durationMs+=i.durationMs,t.maxDurationMs=Math.max(t.maxDurationMs,i.durationMs),i.slow&&(t.slowTasks+=1)}function Ve(e){if(!e)return;let n=[...e.entries()].sort(([i,t],[s,r])=>r.durationMs-t.durationMs||i.localeCompare(s));for(let[i,t]of n)M({type:"span",name:"rust.semantic.worker.callees.by-file",durationMs:t.durationMs,ok:!0,relativePath:i,definitions:t.definitions,definitionsWithCallees:t.definitionsWithCallees,callees:t.callees,maxDurationMs:t.maxDurationMs,slowTasks:t.slowTasks,aggregate:"sum-task-duration"})}function Ye(e,n){let i=e.get(n);if(i)return i;let t={definitions:0,definitionsWithCallees:0,callees:0,durationMs:0,maxDurationMs:0,slowTasks:0};return e.set(n,t),t}function we(e){if(e===void 0||e==="")return null;let n=Number(e);return Number.isInteger(n)&&n>=0?n:null}function Ze(){let e=k.env.SCIP_RUST_SEMANTIC_PARALLEL_OPERATIONS;return e!=="0"&&e!=="false"}function g(e,n,i){ve(e,JSON.stringify(n));let t=new Int32Array(i);Atomics.store(t,0,1),Atomics.notify(t,0)}export{ke as discardRustAnalyzerSession};
1
+ import{b as H,c as U,d as K,e as W,f as le,i as ce,j as ue,k as de,l as fe,m as D,o as me,p as pe}from"./chunk-HXOU4XNH.js";import{a as P,b as ne}from"./chunk-ILMHV3KM.js";import{b as te,c as ie,d as C,e as N,f as G,h as E,i as B,j as S}from"./chunk-KQHJEU6V.js";import{d as F,e as se,f as re,g as oe,h as ae}from"./chunk-HCVJR2V4.js";import"./chunk-JHH5SCZ3.js";import{a as j,f as d,g as M}from"./chunk-HGFDYOVB.js";import"./chunk-SB25YMEQ.js";import{ma as q,na as ee}from"./chunk-AK3PYTIK.js";import k from"process";import{existsSync as Te,writeFileSync as ve}from"fs";import{dirname as Ae,isAbsolute as Ie,resolve as Ce}from"path";import{performance as L}from"perf_hooks";import{parentPort as Ee}from"worker_threads";import{resolve as he}from"path";var ze=4,x=class{constructor(n=ze){this.capacity=n;if(!Number.isSafeInteger(n)||n<=0)throw new Error("Rust analyzer session capacity must be a positive safe integer.")}capacity;entries=new Map;get(n){let i=this.entries.get(n);if(i)return this.entries.delete(n),this.entries.set(n,i),i}async acquire(n,i,t){let s=this.get(n);if(s)return s;if(this.entries.size>=this.capacity){let o=this.entries.entries().next().value;if(!o)throw new Error("Rust analyzer session registry capacity accounting is inconsistent.");this.entries.delete(o[0]);try{await t(o[1])}catch(l){throw this.restoreOldest(o),l}}let r=await i();if(r.key!==n){try{await t(r)}catch(o){throw new AggregateError([o],`Rust analyzer session factory returned '${r.key}' for reserved key '${n}', and the mismatched session could not be reaped.`,{cause:o})}throw new Error(`Rust analyzer session factory returned '${r.key}' for reserved key '${n}'.`)}return this.entries.set(n,r),r}deleteIfSame(n){return this.entries.get(n.key)!==n?!1:this.entries.delete(n.key)}async shutdownAll(n){let i=[...this.entries.values()];this.entries.clear();let t=await Promise.allSettled(i.map(n)),s=[];for(let r=0;r<t.length;r+=1){let o=t[r];if(o.status==="fulfilled")continue;let l=i[r];s.push({session:l,reason:o.reason}),this.entries.set(l.key,l)}if(s.length>0)throw new AggregateError(s.map(r=>r.reason),`Failed to shut down ${s.length} retained rust-analyzer session(s).`)}get size(){return this.entries.size}restoreOldest(n){let i=[...this.entries.entries()];this.entries.clear(),this.entries.set(n[0],n[1]);for(let[t,s]of i)this.entries.set(t,s)}};function Re(e,n){let i=he(e);return[...new Set(n.map(t=>he(i,t)))].sort((t,s)=>t<s?-1:t>s?1:0)}function ye(e,n,i){return JSON.stringify({binary:e,sessionRoot:n,linkedProjects:i})}var Fe="SCIP_RUST_SEMANTIC_REFERENCE_TASK_PROFILE_MS",We="SCIP_RUST_SEMANTIC_CALLEE_TASK_PROFILE_MS",_=new x,ge=Promise.resolve(),Me;Ee?.on("message",e=>{ge=ge.then(()=>xe(e)).catch(()=>{})});async function xe(e){if(Me??=Ae(e.responsePath),e.kind==="shutdown"){await He(),g(e.responsePath,{ok:!0},e.sharedBuffer);return}if(e.kind==="import-definitions"){try{let n=await Le(e.request);g(e.responsePath,{ok:!0,response:n},e.sharedBuffer)}catch(n){let i=B(n);if(i){g(e.responsePath,i,e.sharedBuffer);return}let t={available:!1,reason:n instanceof Error?n.message:String(n),sourcePaths:e.request.positions.map(s=>[s.id,null])};g(e.responsePath,{ok:!0,response:t},e.sharedBuffer)}return}try{let n=await _e(e.request);g(e.responsePath,{ok:!0,response:n},e.sharedBuffer)}catch(n){let i=B(n);if(i){g(e.responsePath,i,e.sharedBuffer);return}let t=De(e.request,n instanceof Error?n.message:String(n));g(e.responsePath,{ok:!0,response:t},e.sharedBuffer)}}async function Le(e){let n={timeoutMs:e.requestTimeoutMs,deadlineMs:e.readinessDeadlineMs},i=await d("rust.semantic.worker.session",()=>Pe(e.projectRoot,e.rustAnalyzerBinary,[e.file],{requestTimeoutMs:e.requestTimeoutMs,readinessDeadlineMs:e.readinessDeadlineMs}),()=>({kind:"import-definitions",files:1,positions:e.positions.length}));if(!i.capabilities.definitionProvider)return{available:!1,reason:"rust-analyzer initialized without textDocument/definition support.",sourcePaths:e.positions.map(o=>[o.id,null])};let t=0;await E(()=>d("rust.semantic.worker.open-source-documents",async()=>{t=await Ne(i,e.projectRoot,[e.file],{diagnosticsTimeoutMs:e.diagnosticsTimeoutMs,settleDelayMs:e.settleDelayMs,readinessDeadlineMs:e.readinessDeadlineMs})},()=>({files:1,openedDocuments:t,positions:e.positions.length})),()=>ke(_,i,e.readinessDeadlineMs));let s=0;return{available:!0,sourcePaths:await d("rust.semantic.worker.import-definitions",()=>P(e.positions,e.concurrency??8,async o=>{let l=await i.client.definition({textDocument:{uri:F(e.projectRoot,o.file)},position:{line:o.line,character:o.column}},n),u=Ge(e.projectRoot,l);return u&&(s+=1),[o.id,u]}),()=>({positions:e.positions.length,resolvedPositions:s,concurrency:e.concurrency??8}))}}async function _e(e){let n={timeoutMs:e.requestTimeoutMs,deadlineMs:e.readinessDeadlineMs},i=e.includeReferences!==!1,t=e.includeCallees===!0,s=e.includeSignatures===!0,r=H(e),o=U(e),l=K(e),u=W(e),c=await d("rust.semantic.worker.session",()=>Oe(e),()=>({kind:"semantic",definitions:u.length,referenceDefinitions:r.length,calleeDefinitions:o.length,signatureDefinitions:l.length,references:i,callees:t,signatures:s})),p=Be(c.capabilities,{references:i,callees:t,signatures:s});if(p)return De(e,p);let f=0;await E(()=>d("rust.semantic.worker.open-definition-documents",async()=>{f=await je(c,e)},()=>({definitions:u.length,openedDocuments:f})),()=>ke(_,c,e.readinessDeadlineMs));let m=0,b=0,y=j(),$=y?new Map:null,z=y?we(k.env[Fe]):null,J=()=>i?d("rust.semantic.worker.references",()=>P(r,e.concurrency??8,async a=>{let w=y?L.now():0,R=await me(c.client,re(e.projectRoot,a,!1),{requestTimeoutMs:e.requestTimeoutMs,retryTimeoutMs:e.referenceRetryTimeoutMs,deadlineMs:e.readinessDeadlineMs}),h=ae(oe(e.projectRoot,R.locations)),I=y?Math.round(L.now()-w):0;return Ue($,a.relativePath,{durationMs:I,references:h.length,hasReferences:h.length>0,slow:z!==null&&I>=z}),z!==null&&I>=z&&M({type:"span",name:"rust.semantic.worker.reference-task",durationMs:I,ok:!0,symbolId:a.symbolId,relativePath:a.relativePath,leaf:a.leaf,kind:a.kind,startLine:a.startLine,endLine:a.endLine,references:h.length,complete:R.complete}),h.length>0&&(b+=1),m+=h.length,{symbolId:a.symbolId,references:h,complete:R.complete}}),()=>({definitions:r.length,concurrency:e.concurrency??8,definitionsWithReferences:b,references:m})):Promise.resolve(r.map(a=>({symbolId:a.symbolId,references:[],complete:!0}))),V=0,Y=0,T=j(),Z=T?new Map:null,v=T?we(k.env[We]):null,Q=()=>t?d("rust.semantic.worker.callees",()=>P(o,e.concurrency??8,async a=>{let w=T?L.now():0,R=await pe(c.client,e.projectRoot,a,n),h=T?Math.round(L.now()-w):0;return Je(Z,a.relativePath,{durationMs:h,callees:R.length,hasCallees:R.length>0,slow:v!==null&&h>=v}),v!==null&&h>=v&&M({type:"span",name:"rust.semantic.worker.callee-task",durationMs:h,ok:!0,symbolId:a.symbolId,relativePath:a.relativePath,leaf:a.leaf,kind:a.kind,startLine:a.startLine,endLine:a.endLine,callees:R.length}),R.length>0&&(Y+=1),V+=R.length,{symbolId:a.symbolId,callees:R}}),()=>({definitions:o.length,concurrency:e.concurrency??8,definitionsWithCallees:Y,callees:V})):Promise.resolve([]),A,O;i&&t&&r.length>0&&o.length>0&&Ze()?[A,O]=await ne([J(),Q()]):(A=await J(),O=await Q()),Ke($),Ve(Z);let X=0,be=s?await d("rust.semantic.worker.signatures",()=>P(l,e.concurrency??8,async a=>{let w=await le(c.client,e.projectRoot,a,n);return w&&(X+=1),{symbolId:a.symbolId,signature:w}}),()=>({definitions:l.length,concurrency:e.concurrency??8,signaturesFound:X})):[];return{available:!0,references:A.filter(a=>a.complete).map(a=>[a.symbolId,a.references]),incompleteReferenceSymbolIds:A.filter(a=>!a.complete).map(a=>a.symbolId),...t?{callees:O.map(a=>[a.symbolId,a.callees])}:{},...s?{signatures:be.map(a=>[a.symbolId,a.signature])}:{}}}async function Oe(e){return Pe(e.projectRoot,e.rustAnalyzerBinary,W(e).map(n=>n.relativePath),{requestTimeoutMs:e.requestTimeoutMs,readinessDeadlineMs:e.readinessDeadlineMs})}async function Pe(e,n,i,t){let s=Re(e,de(e,i.map(l=>({relativePath:l})))),r=ue(e,s),o=ye(n,r,s);return _.acquire(o,async()=>{let l=ce(s),u=new te(ie(n,r,k.env,Me),{requestTimeoutMs:t.requestTimeoutMs,configuration:l}),c=t.readinessDeadlineMs===void 0?null:{afterGeneration:u.serverStatusGeneration(),deadlineMs:t.readinessDeadlineMs},p=await E(()=>d("rust.semantic.worker.initialize",()=>u.initialize({processId:k.pid,rootUri:F(r,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},definition:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:l},{timeoutMs:t.requestTimeoutMs,deadlineMs:t.readinessDeadlineMs}),()=>({linkedProjects:s.length,relativePaths:i.length})),()=>u.shutdownAndReap({deadlineMs:t.readinessDeadlineMs}));return{key:o,client:u,capabilities:p.capabilities,openedPaths:new Set,initializationReadiness:c}},l=>l.client.shutdownAndReap({deadlineMs:t.readinessDeadlineMs}))}async function je(e,n){let i=W(n).filter(c=>e.openedPaths.has(c.relativePath)?!1:Te(Ce(n.projectRoot,c.relativePath)));if(i.length===0)return await Se(e),0;let t=e.initializationReadiness,s=n.readinessDeadlineMs===void 0?null:{statusSnapshot:t?null:e.client.serverStatusSnapshot(),initializationGeneration:t?.afterGeneration,deadlineMs:n.readinessDeadlineMs},r=fe(e.client,n.projectRoot,i);for(let c of i)e.openedPaths.add(c.relativePath);let o=n.diagnosticsTimeoutMs??1e4,l=o;await d("rust.semantic.worker.diagnostics",()=>s?G(c=>(l=c,D(e.client,r,c)),o,s.deadlineMs):D(e.client,r,o),()=>({openedDocuments:r.length,timeoutMs:l}));let u=n.settleDelayMs??5e3;if(!s)await d("rust.semantic.worker.settle",()=>S(u),()=>({openedDocuments:r.length,settleDelayMs:u}));else{let c;await d("rust.semantic.worker.readiness",async()=>{let p=m=>d("rust.semantic.worker.settle",()=>S(m),()=>({openedDocuments:r.length,settleDelayMs:m})),f=s.initializationGeneration===void 0?await N(e.client,s.statusSnapshot,r.length,s.deadlineMs,u,Date.now,p):await C(e.client,s.initializationGeneration,r.length,s.deadlineMs,u,Date.now,p);s.initializationGeneration!==void 0&&(e.initializationReadiness=null),c=f?.health},()=>({phase:s.initializationGeneration===void 0?"didOpen":"initialize+didOpen",openedDocuments:r.length,health:c}))}return r.length}async function Ne(e,n,i,t){let s=i.filter(f=>!e.openedPaths.has(f));if(s.length===0)return await Se(e),0;let r=e.initializationReadiness,o=t.readinessDeadlineMs===void 0?null:{statusSnapshot:r?null:e.client.serverStatusSnapshot(),initializationGeneration:r?.afterGeneration,deadlineMs:t.readinessDeadlineMs},l=[];for(let f of s)try{let m=F(n,f);e.client.didOpenTextDocument({uri:m,languageId:"rust",version:1,text:q(n,f,{inputKind:"indexed Rust source file"})}),e.openedPaths.add(f),l.push(m)}catch(m){if(!ee(m))throw m}let u=t.diagnosticsTimeoutMs??1e4,c=u;await d("rust.semantic.worker.diagnostics",()=>o?G(f=>(c=f,D(e.client,l,f)),u,o.deadlineMs):D(e.client,l,u),()=>({openedDocuments:l.length,timeoutMs:c}));let p=t.settleDelayMs??5e3;if(!o)await d("rust.semantic.worker.settle",()=>S(p),()=>({openedDocuments:l.length,settleDelayMs:p}));else{let f;await d("rust.semantic.worker.readiness",async()=>{let m=y=>d("rust.semantic.worker.settle",()=>S(y),()=>({openedDocuments:l.length,settleDelayMs:y})),b=o.initializationGeneration===void 0?await N(e.client,o.statusSnapshot,l.length,o.deadlineMs,p,Date.now,m):await C(e.client,o.initializationGeneration,l.length,o.deadlineMs,p,Date.now,m);o.initializationGeneration!==void 0&&(e.initializationReadiness=null),f=b?.health},()=>({phase:o.initializationGeneration===void 0?"didOpen":"initialize+didOpen",openedDocuments:l.length,health:f}))}return l.length}async function Se(e){let n=e.initializationReadiness;if(!n)return;let i;await d("rust.semantic.worker.readiness",async()=>{i=(await C(e.client,n.afterGeneration,0,n.deadlineMs,0)).health,e.initializationReadiness=null},()=>({phase:"initialize",openedDocuments:0,health:i}))}function Ge(e,n){for(let i of n){let t=se(e,i.uri);if(!(!t||t===".."||t.startsWith("../")||Ie(t)))return t}return null}function Be(e,n){return n.references&&!e.referencesProvider?"rust-analyzer initialized without textDocument/references support.":n.callees&&!e.callHierarchyProvider?"rust-analyzer initialized without call hierarchy support.":n.signatures&&!e.hoverProvider?"rust-analyzer initialized without hover support.":null}function De(e,n){let i=H(e),t=U(e),s=K(e);return{available:!1,reason:n,references:i.map(r=>[r.symbolId,[]]),...e.includeCallees?{callees:t.map(r=>[r.symbolId,[]])}:{},...e.includeSignatures?{signatures:s.map(r=>[r.symbolId,null])}:{}}}async function He(){await _.shutdownAll(e=>e.client.shutdownAndReap())}async function ke(e,n,i){e.deleteIfSame(n),await n.client.shutdownAndReap({deadlineMs:i})}function Ue(e,n,i){if(!e)return;let t=$e(e,n);t.definitions+=1,i.hasReferences&&(t.definitionsWithReferences+=1),t.references+=i.references,t.durationMs+=i.durationMs,t.maxDurationMs=Math.max(t.maxDurationMs,i.durationMs),i.slow&&(t.slowTasks+=1)}function Ke(e){if(!e)return;let n=[...e.entries()].sort(([i,t],[s,r])=>r.durationMs-t.durationMs||i.localeCompare(s));for(let[i,t]of n)M({type:"span",name:"rust.semantic.worker.references.by-file",durationMs:t.durationMs,ok:!0,relativePath:i,definitions:t.definitions,definitionsWithReferences:t.definitionsWithReferences,references:t.references,maxDurationMs:t.maxDurationMs,slowTasks:t.slowTasks,aggregate:"sum-task-duration"})}function $e(e,n){let i=e.get(n);if(i)return i;let t={definitions:0,definitionsWithReferences:0,references:0,durationMs:0,maxDurationMs:0,slowTasks:0};return e.set(n,t),t}function Je(e,n,i){if(!e)return;let t=Ye(e,n);t.definitions+=1,i.hasCallees&&(t.definitionsWithCallees+=1),t.callees+=i.callees,t.durationMs+=i.durationMs,t.maxDurationMs=Math.max(t.maxDurationMs,i.durationMs),i.slow&&(t.slowTasks+=1)}function Ve(e){if(!e)return;let n=[...e.entries()].sort(([i,t],[s,r])=>r.durationMs-t.durationMs||i.localeCompare(s));for(let[i,t]of n)M({type:"span",name:"rust.semantic.worker.callees.by-file",durationMs:t.durationMs,ok:!0,relativePath:i,definitions:t.definitions,definitionsWithCallees:t.definitionsWithCallees,callees:t.callees,maxDurationMs:t.maxDurationMs,slowTasks:t.slowTasks,aggregate:"sum-task-duration"})}function Ye(e,n){let i=e.get(n);if(i)return i;let t={definitions:0,definitionsWithCallees:0,callees:0,durationMs:0,maxDurationMs:0,slowTasks:0};return e.set(n,t),t}function we(e){if(e===void 0||e==="")return null;let n=Number(e);return Number.isInteger(n)&&n>=0?n:null}function Ze(){let e=k.env.SCIP_RUST_SEMANTIC_PARALLEL_OPERATIONS;return e!=="0"&&e!=="false"}function g(e,n,i){ve(e,JSON.stringify(n));let t=new Int32Array(i);Atomics.store(t,0,1),Atomics.notify(t,0)}export{ke as discardRustAnalyzerSession};
2
2
  //# sourceMappingURL=rust-semantic-session-worker.js.map
@@ -1,2 +1,2 @@
1
- import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q}from"./chunk-Y2S4YNLH.js";import{a}from"./chunk-ILMHV3KM.js";import"./chunk-ND3BWIVN.js";import"./chunk-67FK5KGV.js";import"./chunk-4SZJF4GK.js";import"./chunk-Z2KGMIL4.js";import"./chunk-XIPGCT3D.js";export{q as calleesForDefinition,l as cargoManifestsForDefinitions,i as hoverToRustSignature,h as hoverWithRetry,m as openDefinitionDocuments,p as referencesWithCompletion,o as referencesWithRetry,b as runRustAnalyzerReferenceBatch,a as runWithConcurrency,j as rustAnalyzerInitializationOptions,k as rustAnalyzerSessionRoot,d as rustRequestCalleeDefinitions,c as rustRequestReferenceDefinitions,f as rustRequestSessionDefinitions,e as rustRequestSignatureDefinitions,g as signatureForDefinition,n as waitForOpenedDocuments};
1
+ import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q}from"./chunk-HXOU4XNH.js";import{a}from"./chunk-ILMHV3KM.js";import"./chunk-KQHJEU6V.js";import"./chunk-HCVJR2V4.js";import"./chunk-JHH5SCZ3.js";import"./chunk-SB25YMEQ.js";import"./chunk-AK3PYTIK.js";export{q as calleesForDefinition,l as cargoManifestsForDefinitions,i as hoverToRustSignature,h as hoverWithRetry,m as openDefinitionDocuments,p as referencesWithCompletion,o as referencesWithRetry,b as runRustAnalyzerReferenceBatch,a as runWithConcurrency,j as rustAnalyzerInitializationOptions,k as rustAnalyzerSessionRoot,d as rustRequestCalleeDefinitions,c as rustRequestReferenceDefinitions,f as rustRequestSessionDefinitions,e as rustRequestSignatureDefinitions,g as signatureForDefinition,n as waitForOpenedDocuments};
2
2
  //# sourceMappingURL=rust-semantic-worker.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-XFMVKFSF.js";import"./chunk-SVHTMVA4.js";import"./chunk-BGBBVSH4.js";import"./chunk-6NC3YSPY.js";import"./chunk-MTDBHTSF.js";import"./chunk-IXESDH3J.js";import"./chunk-OXYAWIEA.js";import"./chunk-FKGQOTKD.js";import"./chunk-FELGD32K.js";import"./chunk-2XCGSDIT.js";import"./chunk-WRQXLNYE.js";import"./chunk-T6QD2ZQB.js";import"./chunk-EELPBR7E.js";import"./chunk-YUKYB54I.js";import"./chunk-BJT7LSPK.js";import"./chunk-WSLEJSFR.js";import"./chunk-VUSKPCUB.js";import"./chunk-F4FNK44D.js";import"./chunk-HCVJR2V4.js";import"./chunk-EETGXQY7.js";import"./chunk-TQZV7KV4.js";import"./chunk-C7IJMOFP.js";import"./chunk-YXPUP5G2.js";import"./chunk-DRENNWRG.js";import"./chunk-BVFYEEBH.js";import"./chunk-JHH5SCZ3.js";import"./chunk-DHEQMPLW.js";import"./chunk-ENWQWA2R.js";import"./chunk-DKM723YF.js";import"./chunk-K3XFWJI2.js";import"./chunk-IW5XQG5G.js";import"./chunk-JT6XX7QY.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import"./chunk-SB25YMEQ.js";import"./chunk-AK3PYTIK.js";export{a as referenceReachability,b as slice};
2
+ //# sourceMappingURL=slice-YOB5YFAM.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-DPWKKNKI.js";import"./chunk-56NQAEPJ.js";import"./chunk-SVHTMVA4.js";import"./chunk-BGBBVSH4.js";import"./chunk-6NC3YSPY.js";import"./chunk-MTDBHTSF.js";import"./chunk-IXESDH3J.js";import"./chunk-OXYAWIEA.js";import"./chunk-FKGQOTKD.js";import"./chunk-FELGD32K.js";import"./chunk-2XCGSDIT.js";import"./chunk-WRQXLNYE.js";import"./chunk-T6QD2ZQB.js";import"./chunk-EELPBR7E.js";import"./chunk-YUKYB54I.js";import"./chunk-BJT7LSPK.js";import"./chunk-WSLEJSFR.js";import"./chunk-VUSKPCUB.js";import"./chunk-F4FNK44D.js";import"./chunk-HCVJR2V4.js";import"./chunk-EETGXQY7.js";import"./chunk-TQZV7KV4.js";import"./chunk-C7IJMOFP.js";import"./chunk-YXPUP5G2.js";import"./chunk-DRENNWRG.js";import"./chunk-BVFYEEBH.js";import"./chunk-JHH5SCZ3.js";import"./chunk-DHEQMPLW.js";import"./chunk-ENWQWA2R.js";import"./chunk-DKM723YF.js";import"./chunk-K3XFWJI2.js";import"./chunk-IW5XQG5G.js";import"./chunk-JT6XX7QY.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import"./chunk-SB25YMEQ.js";import"./chunk-AK3PYTIK.js";export{b as consumerSurface,a as surface};
2
+ //# sourceMappingURL=surface-VY5EFWTW.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-YLNCTPOI.js";import{a as c}from"./chunk-26CT72HM.js";import{b as i,e as m}from"./chunk-T2PBOVDI.js";import"./chunk-NP4JFCLE.js";import"./chunk-5Z2H76VD.js";import{c as l}from"./chunk-DRENNWRG.js";import"./chunk-MXNGIEPU.js";import"./chunk-PRLU3I7G.js";import"./chunk-DXYMTQZ4.js";import"./chunk-FYCH2EYQ.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import"./chunk-XIPGCT3D.js";function g(o,t){let s=i(o,t),e=f(s);for(let n of e)console.log(n)}function R(o,t,s="No results found for resolved symbol."){return i(o,t).match?s:p(t,m(o,t,5))}function S(o,t,s,e){return{...a(o,t),[e]:s}}function p(o,t){let s=`No definition matched '${o}'.`;return t.length>0?`${s} Suggestions: ${t.join(", ")}`:s}function f(o){if(!o.match||o.total<=1)return[];let t=o.match,s=Math.max(0,o.total-1),e=[`Resolved: ${l(t.symbol)} (${t.relativePath}) -- ${s} other definition(s) share this name; qualify as <dir/leaf> to target another.`],n=o.candidates.slice(0,3);return n.length>0&&e.push(`Alternates: ${n.map(r=>`${r.shortName} (${r.relativePath}:${c(r.startLine)})`).join("; ")}`),e.push(""),e}export{p as noMatchMessage,g as symbolResolutionBefore,R as symbolResolutionEmptyMessage,a as symbolResolutionJson,S as withSymbolResolutionJson};
2
- //# sourceMappingURL=symbol-resolution-SVSMX4RN.js.map
1
+ import{a}from"./chunk-CLG6DWVS.js";import{a as c}from"./chunk-26CT72HM.js";import{b as i,e as m}from"./chunk-EELPBR7E.js";import"./chunk-C7IJMOFP.js";import"./chunk-YXPUP5G2.js";import{c as l}from"./chunk-DRENNWRG.js";import"./chunk-MXNGIEPU.js";import"./chunk-DKM723YF.js";import"./chunk-K3XFWJI2.js";import"./chunk-IW5XQG5G.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import"./chunk-AK3PYTIK.js";function g(o,t){let s=i(o,t),e=f(s);for(let n of e)console.log(n)}function R(o,t,s="No results found for resolved symbol."){return i(o,t).match?s:p(t,m(o,t,5))}function S(o,t,s,e){return{...a(o,t),[e]:s}}function p(o,t){let s=`No definition matched '${o}'.`;return t.length>0?`${s} Suggestions: ${t.join(", ")}`:s}function f(o){if(!o.match||o.total<=1)return[];let t=o.match,s=Math.max(0,o.total-1),e=[`Resolved: ${l(t.symbol)} (${t.relativePath}) -- ${s} other definition(s) share this name; qualify as <dir/leaf> to target another.`],n=o.candidates.slice(0,3);return n.length>0&&e.push(`Alternates: ${n.map(r=>`${r.shortName} (${r.relativePath}:${c(r.startLine)})`).join("; ")}`),e.push(""),e}export{p as noMatchMessage,g as symbolResolutionBefore,R as symbolResolutionEmptyMessage,a as symbolResolutionJson,S as withSymbolResolutionJson};
2
+ //# sourceMappingURL=symbol-resolution-DGQN4XIV.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-F24QUEQP.js";import"./chunk-56NQAEPJ.js";import"./chunk-T6QD2ZQB.js";import"./chunk-EELPBR7E.js";import"./chunk-C7IJMOFP.js";import"./chunk-YXPUP5G2.js";import"./chunk-DRENNWRG.js";import"./chunk-DKM723YF.js";import"./chunk-K3XFWJI2.js";import"./chunk-IW5XQG5G.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import"./chunk-AK3PYTIK.js";export{b as moduleMap,a as system};
2
+ //# sourceMappingURL=system-2KQ3QD2P.js.map
@@ -0,0 +1,2 @@
1
+ import{a,b,c}from"./chunk-Q55NF3ZG.js";import"./chunk-5YRQIE2B.js";import"./chunk-RNKPYYYE.js";import"./chunk-IXESDH3J.js";import"./chunk-OXYAWIEA.js";import"./chunk-FKGQOTKD.js";import"./chunk-FELGD32K.js";import"./chunk-2XCGSDIT.js";import"./chunk-WRQXLNYE.js";import"./chunk-T6QD2ZQB.js";import"./chunk-EELPBR7E.js";import"./chunk-BJT7LSPK.js";import"./chunk-WSLEJSFR.js";import"./chunk-VUSKPCUB.js";import"./chunk-F4FNK44D.js";import"./chunk-HCVJR2V4.js";import"./chunk-EETGXQY7.js";import"./chunk-TQZV7KV4.js";import"./chunk-C7IJMOFP.js";import"./chunk-YXPUP5G2.js";import"./chunk-DRENNWRG.js";import"./chunk-BVFYEEBH.js";import"./chunk-JHH5SCZ3.js";import"./chunk-ENWQWA2R.js";import"./chunk-DKM723YF.js";import"./chunk-K3XFWJI2.js";import"./chunk-IW5XQG5G.js";import"./chunk-JT6XX7QY.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import"./chunk-SB25YMEQ.js";import"./chunk-AK3PYTIK.js";export{c as qualifiedTraceEvidence,a as trace,b as traceEvidence};
2
+ //# sourceMappingURL=trace-HTIPTXAE.js.map
@@ -1,2 +1,2 @@
1
- import{b as T}from"./chunk-UEQORB2A.js";import{a as M}from"./chunk-IM23CSG5.js";import{a as P,c as j}from"./chunk-PAZSBPJR.js";import"./chunk-P3UFF22M.js";import{c as b,e as v,f as l}from"./chunk-UAQQR55F.js";import"./chunk-NP4JFCLE.js";import"./chunk-5Z2H76VD.js";import"./chunk-DRENNWRG.js";import{d as g}from"./chunk-3KXFB2FM.js";import"./chunk-WOPZX5GM.js";import"./chunk-DHEQMPLW.js";import{a as w}from"./chunk-DUDUIT5P.js";import"./chunk-SIGVQT43.js";import"./chunk-PRLU3I7G.js";import{d as f}from"./chunk-DXYMTQZ4.js";import"./chunk-DK6MB565.js";import"./chunk-FYCH2EYQ.js";import"./chunk-O4PZFAXA.js";import"./chunk-NQXWWE6S.js";import"./chunk-H5EXS3HM.js";import{c as y,d}from"./chunk-HGFDYOVB.js";import{c as m}from"./chunk-Z2KGMIL4.js";import{n as h,q as S}from"./chunk-XIPGCT3D.js";import{parentPort as c,workerData as O}from"worker_threads";import{randomUUID as C}from"crypto";import{resolve as R}from"path";var a=class{loadModule;discoverTsconfigs;createProjects;createProvider;db;module=null;projects=null;provider=null;stats={providerRequests:0,sessionsCreated:0,sessionsReused:0,sessionsRefreshed:0,sessionsReplaced:0,projectsCreated:0};constructor(e,t={}){this.db=e,this.loadModule=t.loadModule??b,this.discoverTsconfigs=t.discoverTsconfigs??P,this.createProjects=t.createProjects??v,this.createProvider=t.createProvider??((i,s,o)=>j(i,s,o,{reusedProjects:!0}))}semanticProvider(){return this.stats.providerRequests+=1,this.provider?(this.stats.sessionsReused+=1,this.provider):this.createSession()}advanceGeneration(e,t){let i=q(t);return this.provider?.dispose?.(),this.provider=null,this.db=e,this.projects?i.mode==="replace"?(this.projects=null,this.module=null,this.stats.sessionsReplaced+=1,i):(i.mode==="refresh"&&(D(this.projects,e.config.projectRoot,i),this.stats.sessionsRefreshed+=1),i):i}snapshotStats(){return{...this.stats}}dispose(){this.provider?.dispose?.(),this.provider=null,this.projects=null,this.module=null}createSession(){let e=this.module??this.loadModule();if(!e)return this.provider=l("ts-morph is not installed"),this.provider;if(this.module=e,!this.projects){let t=this.discoverTsconfigs(this.db);if(t.length===0)return this.provider=l("no tsconfig found"),this.provider;this.projects=this.createProjects(e,t),this.stats.projectsCreated+=this.projects.length}return this.provider=this.createProvider(this.db,e,this.projects),this.stats.sessionsCreated+=1,this.provider}};function q(r){let e=new Set;r.projectIdentityChanged&&e.add("project-identity-changed");for(let o of r.uncertainty)e.add(o);for(let o of r.changes)o.inputKind!=="source"&&e.add(`${o.inputKind}-input-changed`);if(e.size>0)return{mode:"replace",addedFiles:[],modifiedFiles:[],deletedFiles:[],reasons:[...e].sort()};let t=u(r.changes,"added"),i=u(r.changes,"modified"),s=u(r.changes,"deleted");return{mode:t.length+i.length+s.length===0?"reuse":"refresh",addedFiles:t,modifiedFiles:i,deletedFiles:s,reasons:[]}}function u(r,e){return r.filter(t=>t.kind===e).map(t=>t.path).sort()}function D(r,e,t){for(let i of r){for(let s of t.deletedFiles)i.project.getSourceFile(R(e,s))?.forget();for(let s of t.modifiedFiles){let o=i.project.getSourceFile(R(e,s));o&&o.refreshFromFileSystemSync()}t.addedFiles.length>0&&i.project.addSourceFilesFromTsConfig(i.tsconfigPath)}}var p=class{openDb;createHost;generationIdentity;readSnapshot;now;db=null;host=null;generation=null;snapshot=null;requests=0;lastRequestAtMs=null;lastError=null;available=null;constructor(e){this.openDb=e.openDb,this.createHost=e.createHost??(t=>new a(t)),this.generationIdentity=e.generationIdentity?t=>e.generationIdentity(t.config.dbPath):t=>t.generation.identity,this.readSnapshot=e.readSnapshot?t=>e.readSnapshot(t.config.dbPath):H,this.now=e.now??Date.now}handle(e,t){try{this.syncGeneration(e);let i=this.host.semanticProvider();switch(this.available=i.availability().available,this.requests+=1,this.lastRequestAtMs=this.now(),this.lastError=null,t.kind){case"availability":return i.availability();case"import-usage":return i.importUsage(t.file);case"references":return[...F(i,t.definitions,{exact:t.exact===!0})];case"reference-fragments":if(!i.referenceFragmentsForFiles)throw new Error("TypeScript provider does not support reference fragments.");return[...i.referenceFragmentsForFiles(t.files)];case"callees":return[...A(i,t.definitions)];case"signature":return i.signatureFor(t.definition);default:return B(t)}}catch(i){throw this.lastError=i instanceof Error?i.message:String(i),i}}status(e){let t=this.host?.snapshotStats();return{protocolVersion:w,state:this.lastError?"error":this.host?this.available?"ready":"unavailable":"idle",requests:this.requests,...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastError?{lastError:this.lastError}:{},sessionsCreated:t?.sessionsCreated??0,sessionsReused:t?.sessionsReused??0,sessionsRefreshed:t?.sessionsRefreshed??0,sessionsReplaced:t?.sessionsReplaced??0,projectsCreated:t?.projectsCreated??0,...e?{mailbox:e}:{}}}closeTypeScriptService(){this.host?.dispose(),this.db?.close(),this.host=null,this.db=null,this.generation=null,this.snapshot=null,this.available=null}syncGeneration(e){if(this.generation===e&&this.host&&this.db)return;let t=this.openDb(),i=this.generationIdentity(t);if(!i||i!==e)throw t.close(),new Error("TypeScript semantic request does not match the currently published index generation.");let s=this.readSnapshot(t);if(!this.host||!this.db)this.db=t,this.host=this.createHost(t);else{let o=this.db;this.host.advanceGeneration(t,N(this.snapshot,s)),this.db=t,o.close()}this.generation=i,this.snapshot=s,this.available=null}};function F(r,e,t){return r.referencesForDefinitions?.(e,t)??new Map(e.map(i=>[i.symbolId,r.referencesFor(i)]))}function A(r,e){return r.calleesForDefinitions?.(e)??new Map(e.map(t=>[t.symbolId,r.calleesFor(t)]))}function H(r){if(!r.generation.metadataRaw)return null;let e=f(r.generation.metadataRaw);return e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache?null:h(e.metadata.fingerprint)}function N(r,e){return e?S(r,e):{version:1,changes:[],projectIdentityChanged:!0,uncertainty:["prior-snapshot-unavailable"]}}function B(r){throw new Error(`Unhandled TypeScript semantic request: ${JSON.stringify(r)}`)}var Z=`typescript-semantic-${process.pid}-${C()}`,x=m(process.pid),ee={pid:process.pid,...x?{processIdentity:x}:{}};var n=L(O);if(!c)throw new Error("TypeScript mailbox worker requires a parent port.");if(n.kind==="index"){let r=new T({projectRoot:n.projectRoot,currentGeneration:()=>g(n.dbPath),...n.maxActiveSessions===void 0?{}:{maxActiveSessions:n.maxActiveSessions},...n.softMemoryLimitMb===void 0?{}:{softMemoryLimitMb:n.softMemoryLimitMb}});c.on("message",e=>{let t=k(e);I(t,()=>r.handle(t.payload.baseGeneration,t.payload.request),()=>r.status())})}else{let r=new p({openDb:()=>M(n.projectRoot)});c.on("message",e=>{let t=k(e),i=y();d(t.payload.profileEnvironment??{});try{I(t,()=>r.handle(t.payload.generation,t.payload.request),()=>r.status())}finally{d(i)}})}function I(r,e,t){let i;try{if(Date.now()>r.deadlineAtMs)throw new Error("TypeScript mailbox request expired before processing.");let s=e();if(Date.now()>r.deadlineAtMs)throw new Error("TypeScript mailbox request expired while the worker was processing it.");i={kind:"response",requestId:r.requestId,ok:!0,result:s,status:t()}}catch(s){i={kind:"response",requestId:r.requestId,ok:!1,error:s instanceof Error?s.message:String(s),status:t()}}c.postMessage(i)}function L(r){if(!r||typeof r!="object")throw new Error("TypeScript mailbox worker data is missing.");let e=r;if(e.kind==="index"&&typeof e.projectRoot=="string"&&typeof e.dbPath=="string"&&E(e.maxActiveSessions)&&E(e.softMemoryLimitMb))return{kind:"index",projectRoot:e.projectRoot,dbPath:e.dbPath,...e.maxActiveSessions===void 0?{}:{maxActiveSessions:e.maxActiveSessions},...e.softMemoryLimitMb===void 0?{}:{softMemoryLimitMb:e.softMemoryLimitMb}};if(e.kind==="semantic"&&typeof e.projectRoot=="string")return{kind:"semantic",projectRoot:e.projectRoot};throw new Error("TypeScript mailbox worker data is invalid.")}function E(r){return r===void 0||Number.isInteger(r)&&r>0}function k(r){if(!r||typeof r!="object")throw new Error("TypeScript mailbox worker request is missing.");let e=r;if(e.kind!=="request"||typeof e.requestId!="string"||!Number.isSafeInteger(e.deadlineAtMs)||typeof e.payload!="object"||e.payload===null)throw new Error("TypeScript mailbox worker request is invalid.");return e}
1
+ import{b as T}from"./chunk-GRX7JOXQ.js";import{a as M}from"./chunk-CBBHFNLX.js";import{a as P,c as j}from"./chunk-EETGXQY7.js";import"./chunk-C76O5MDS.js";import{c as b,e as v,f as l}from"./chunk-TQZV7KV4.js";import"./chunk-C7IJMOFP.js";import"./chunk-YXPUP5G2.js";import"./chunk-DRENNWRG.js";import{d as g}from"./chunk-7YQOCABQ.js";import"./chunk-QWKHW6VZ.js";import"./chunk-DHEQMPLW.js";import{a as w}from"./chunk-ENWQWA2R.js";import"./chunk-WN3TCGJ4.js";import"./chunk-DKM723YF.js";import{d as f}from"./chunk-K3XFWJI2.js";import"./chunk-NRBNAECH.js";import"./chunk-IW5XQG5G.js";import"./chunk-57N6LN2A.js";import"./chunk-JT6XX7QY.js";import"./chunk-H5EXS3HM.js";import{c as y,d}from"./chunk-HGFDYOVB.js";import{c as m}from"./chunk-SB25YMEQ.js";import{o as h,r as S}from"./chunk-AK3PYTIK.js";import{parentPort as c,workerData as O}from"worker_threads";import{randomUUID as C}from"crypto";import{resolve as R}from"path";var a=class{loadModule;discoverTsconfigs;createProjects;createProvider;db;module=null;projects=null;provider=null;stats={providerRequests:0,sessionsCreated:0,sessionsReused:0,sessionsRefreshed:0,sessionsReplaced:0,projectsCreated:0};constructor(e,t={}){this.db=e,this.loadModule=t.loadModule??b,this.discoverTsconfigs=t.discoverTsconfigs??P,this.createProjects=t.createProjects??v,this.createProvider=t.createProvider??((i,s,o)=>j(i,s,o,{reusedProjects:!0}))}semanticProvider(){return this.stats.providerRequests+=1,this.provider?(this.stats.sessionsReused+=1,this.provider):this.createSession()}advanceGeneration(e,t){let i=q(t);return this.provider?.dispose?.(),this.provider=null,this.db=e,this.projects?i.mode==="replace"?(this.projects=null,this.module=null,this.stats.sessionsReplaced+=1,i):(i.mode==="refresh"&&(D(this.projects,e.config.projectRoot,i),this.stats.sessionsRefreshed+=1),i):i}snapshotStats(){return{...this.stats}}dispose(){this.provider?.dispose?.(),this.provider=null,this.projects=null,this.module=null}createSession(){let e=this.module??this.loadModule();if(!e)return this.provider=l("ts-morph is not installed"),this.provider;if(this.module=e,!this.projects){let t=this.discoverTsconfigs(this.db);if(t.length===0)return this.provider=l("no tsconfig found"),this.provider;this.projects=this.createProjects(e,t),this.stats.projectsCreated+=this.projects.length}return this.provider=this.createProvider(this.db,e,this.projects),this.stats.sessionsCreated+=1,this.provider}};function q(r){let e=new Set;r.projectIdentityChanged&&e.add("project-identity-changed");for(let o of r.uncertainty)e.add(o);for(let o of r.changes)o.inputKind!=="source"&&e.add(`${o.inputKind}-input-changed`);if(e.size>0)return{mode:"replace",addedFiles:[],modifiedFiles:[],deletedFiles:[],reasons:[...e].sort()};let t=u(r.changes,"added"),i=u(r.changes,"modified"),s=u(r.changes,"deleted");return{mode:t.length+i.length+s.length===0?"reuse":"refresh",addedFiles:t,modifiedFiles:i,deletedFiles:s,reasons:[]}}function u(r,e){return r.filter(t=>t.kind===e).map(t=>t.path).sort()}function D(r,e,t){for(let i of r){for(let s of t.deletedFiles)i.project.getSourceFile(R(e,s))?.forget();for(let s of t.modifiedFiles){let o=i.project.getSourceFile(R(e,s));o&&o.refreshFromFileSystemSync()}t.addedFiles.length>0&&i.project.addSourceFilesFromTsConfig(i.tsconfigPath)}}var p=class{openDb;createHost;generationIdentity;readSnapshot;now;db=null;host=null;generation=null;snapshot=null;requests=0;lastRequestAtMs=null;lastError=null;available=null;constructor(e){this.openDb=e.openDb,this.createHost=e.createHost??(t=>new a(t)),this.generationIdentity=e.generationIdentity?t=>e.generationIdentity(t.config.dbPath):t=>t.generation.identity,this.readSnapshot=e.readSnapshot?t=>e.readSnapshot(t.config.dbPath):H,this.now=e.now??Date.now}handle(e,t){try{this.syncGeneration(e);let i=this.host.semanticProvider();switch(this.available=i.availability().available,this.requests+=1,this.lastRequestAtMs=this.now(),this.lastError=null,t.kind){case"availability":return i.availability();case"import-usage":return i.importUsage(t.file);case"references":return[...F(i,t.definitions,{exact:t.exact===!0})];case"reference-fragments":if(!i.referenceFragmentsForFiles)throw new Error("TypeScript provider does not support reference fragments.");return[...i.referenceFragmentsForFiles(t.files)];case"callees":return[...A(i,t.definitions)];case"signature":return i.signatureFor(t.definition);default:return B(t)}}catch(i){throw this.lastError=i instanceof Error?i.message:String(i),i}}status(e){let t=this.host?.snapshotStats();return{protocolVersion:w,state:this.lastError?"error":this.host?this.available?"ready":"unavailable":"idle",requests:this.requests,...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastError?{lastError:this.lastError}:{},sessionsCreated:t?.sessionsCreated??0,sessionsReused:t?.sessionsReused??0,sessionsRefreshed:t?.sessionsRefreshed??0,sessionsReplaced:t?.sessionsReplaced??0,projectsCreated:t?.projectsCreated??0,...e?{mailbox:e}:{}}}closeTypeScriptService(){this.host?.dispose(),this.db?.close(),this.host=null,this.db=null,this.generation=null,this.snapshot=null,this.available=null}syncGeneration(e){if(this.generation===e&&this.host&&this.db)return;let t=this.openDb(),i=this.generationIdentity(t);if(!i||i!==e)throw t.close(),new Error("TypeScript semantic request does not match the currently published index generation.");let s=this.readSnapshot(t);if(!this.host||!this.db)this.db=t,this.host=this.createHost(t);else{let o=this.db;this.host.advanceGeneration(t,N(this.snapshot,s)),this.db=t,o.close()}this.generation=i,this.snapshot=s,this.available=null}};function F(r,e,t){return r.referencesForDefinitions?.(e,t)??new Map(e.map(i=>[i.symbolId,r.referencesFor(i)]))}function A(r,e){return r.calleesForDefinitions?.(e)??new Map(e.map(t=>[t.symbolId,r.calleesFor(t)]))}function H(r){if(!r.generation.metadataRaw)return null;let e=f(r.generation.metadataRaw);return e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache?null:h(e.metadata.fingerprint)}function N(r,e){return e?S(r,e):{version:1,changes:[],projectIdentityChanged:!0,uncertainty:["prior-snapshot-unavailable"]}}function B(r){throw new Error(`Unhandled TypeScript semantic request: ${JSON.stringify(r)}`)}var Z=`typescript-semantic-${process.pid}-${C()}`,x=m(process.pid),ee={pid:process.pid,...x?{processIdentity:x}:{}};var n=L(O);if(!c)throw new Error("TypeScript mailbox worker requires a parent port.");if(n.kind==="index"){let r=new T({projectRoot:n.projectRoot,currentGeneration:()=>g(n.dbPath),...n.maxActiveSessions===void 0?{}:{maxActiveSessions:n.maxActiveSessions},...n.softMemoryLimitMb===void 0?{}:{softMemoryLimitMb:n.softMemoryLimitMb}});c.on("message",e=>{let t=k(e);I(t,()=>r.handle(t.payload.baseGeneration,t.payload.request),()=>r.status())})}else{let r=new p({openDb:()=>M(n.projectRoot)});c.on("message",e=>{let t=k(e),i=y();d(t.payload.profileEnvironment??{});try{I(t,()=>r.handle(t.payload.generation,t.payload.request),()=>r.status())}finally{d(i)}})}function I(r,e,t){let i;try{if(Date.now()>r.deadlineAtMs)throw new Error("TypeScript mailbox request expired before processing.");let s=e();if(Date.now()>r.deadlineAtMs)throw new Error("TypeScript mailbox request expired while the worker was processing it.");i={kind:"response",requestId:r.requestId,ok:!0,result:s,status:t()}}catch(s){i={kind:"response",requestId:r.requestId,ok:!1,error:s instanceof Error?s.message:String(s),status:t()}}c.postMessage(i)}function L(r){if(!r||typeof r!="object")throw new Error("TypeScript mailbox worker data is missing.");let e=r;if(e.kind==="index"&&typeof e.projectRoot=="string"&&typeof e.dbPath=="string"&&E(e.maxActiveSessions)&&E(e.softMemoryLimitMb))return{kind:"index",projectRoot:e.projectRoot,dbPath:e.dbPath,...e.maxActiveSessions===void 0?{}:{maxActiveSessions:e.maxActiveSessions},...e.softMemoryLimitMb===void 0?{}:{softMemoryLimitMb:e.softMemoryLimitMb}};if(e.kind==="semantic"&&typeof e.projectRoot=="string")return{kind:"semantic",projectRoot:e.projectRoot};throw new Error("TypeScript mailbox worker data is invalid.")}function E(r){return r===void 0||Number.isInteger(r)&&r>0}function k(r){if(!r||typeof r!="object")throw new Error("TypeScript mailbox worker request is missing.");let e=r;if(e.kind!=="request"||typeof e.requestId!="string"||!Number.isSafeInteger(e.deadlineAtMs)||typeof e.payload!="object"||e.payload===null)throw new Error("TypeScript mailbox worker request is invalid.");return e}
2
2
  //# sourceMappingURL=typescript-mailbox-worker.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-GPGRZJ3R.js";import"./chunk-D2MVJSP4.js";import"./chunk-3TNRNKAT.js";import"./chunk-7KCZELVM.js";import"./chunk-XN22RGSR.js";import"./chunk-RNKPYYYE.js";import"./chunk-SVHTMVA4.js";import"./chunk-BGBBVSH4.js";import"./chunk-6NC3YSPY.js";import"./chunk-MTDBHTSF.js";import"./chunk-IXESDH3J.js";import"./chunk-OXYAWIEA.js";import"./chunk-BYDAFMSR.js";import"./chunk-RYOYJMGF.js";import"./chunk-FKGQOTKD.js";import"./chunk-FELGD32K.js";import"./chunk-2XCGSDIT.js";import"./chunk-WRQXLNYE.js";import"./chunk-T6QD2ZQB.js";import"./chunk-EELPBR7E.js";import"./chunk-YUKYB54I.js";import"./chunk-BJT7LSPK.js";import"./chunk-WSLEJSFR.js";import"./chunk-VUSKPCUB.js";import"./chunk-F4FNK44D.js";import"./chunk-HCVJR2V4.js";import"./chunk-EETGXQY7.js";import"./chunk-TQZV7KV4.js";import"./chunk-C7IJMOFP.js";import"./chunk-YXPUP5G2.js";import"./chunk-DRENNWRG.js";import"./chunk-BVFYEEBH.js";import"./chunk-JHH5SCZ3.js";import"./chunk-DHEQMPLW.js";import"./chunk-ENWQWA2R.js";import"./chunk-DKM723YF.js";import"./chunk-K3XFWJI2.js";import"./chunk-IW5XQG5G.js";import"./chunk-JT6XX7QY.js";import"./chunk-H5EXS3HM.js";import"./chunk-HGFDYOVB.js";import"./chunk-SB25YMEQ.js";import"./chunk-AK3PYTIK.js";export{a as valueFlow};
2
+ //# sourceMappingURL=value-flow-5FV3VQI7.js.map