scip-query 0.22.0 → 0.24.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 (470) hide show
  1. package/CHANGELOG.md +500 -0
  2. package/README.md +13 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-H3P6BR5G.js +2 -0
  5. package/dist/call-graph-VTG2CUOQ.js +2 -0
  6. package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
  7. package/dist/chunk-2BMSSRBH.js +2 -0
  8. package/dist/{chunk-TAYD3AE7.js → chunk-2GJSD5GY.js} +2 -2
  9. package/dist/{chunk-TUQIPUDS.js → chunk-2M2LSIMY.js} +3 -3
  10. package/dist/{chunk-GIQ6CSL4.js → chunk-2N6WBNDC.js} +2 -2
  11. package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
  12. package/dist/{chunk-EELPBR7E.js → chunk-2USA3S3P.js} +2 -2
  13. package/dist/chunk-2VAHDDLM.js +133 -0
  14. package/dist/chunk-2XWIUW5Z.js +455 -0
  15. package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
  16. package/dist/chunk-3D4BOXW6.js +20 -0
  17. package/dist/{chunk-FFJQZG6J.js → chunk-3LO4FST5.js} +2 -2
  18. package/dist/{chunk-HXOU4XNH.js → chunk-3WTY4LP2.js} +2 -2
  19. package/dist/{chunk-DPWKKNKI.js → chunk-3Z5AMSK6.js} +2 -2
  20. package/dist/{chunk-F24G5NBE.js → chunk-44IETFOU.js} +2 -2
  21. package/dist/chunk-4FR6GQIT.js +2 -0
  22. package/dist/chunk-4KBTHJLP.js +2 -0
  23. package/dist/chunk-5BIKR67W.js +2 -0
  24. package/dist/{chunk-DJAO2OZJ.js → chunk-5PROPLHI.js} +2 -2
  25. package/dist/chunk-5V7EPTII.js +2 -0
  26. package/dist/{chunk-VZ7NXSHV.js → chunk-62LPZCBQ.js} +2 -2
  27. package/dist/{chunk-LXQUF2RP.js → chunk-64O2JHQA.js} +2 -2
  28. package/dist/chunk-6D4F5VWG.js +10 -0
  29. package/dist/{chunk-NEIQPFBI.js → chunk-6ERFBC3X.js} +2 -2
  30. package/dist/{chunk-4HE7MVWD.js → chunk-6ILKOOGH.js} +2 -2
  31. package/dist/chunk-6MFXCMZC.js +2 -0
  32. package/dist/chunk-6O7FACKB.js +2 -0
  33. package/dist/{chunk-R6M456QG.js → chunk-6TS3KOXR.js} +2 -2
  34. package/dist/{chunk-7U2YQSDE.js → chunk-76QOU4PK.js} +2 -2
  35. package/dist/{chunk-25GWKRUZ.js → chunk-7DUI77BN.js} +2 -2
  36. package/dist/chunk-7F45LJKI.js +2 -0
  37. package/dist/{chunk-DEAB5TGT.js → chunk-7F7T6DCR.js} +2 -2
  38. package/dist/chunk-7H6VHWWJ.js +2 -0
  39. package/dist/chunk-7HXT6YLU.js +5 -0
  40. package/dist/{chunk-KZYID5KV.js → chunk-7R4V5ES6.js} +4 -4
  41. package/dist/chunk-7RIRIADH.js +7 -0
  42. package/dist/chunk-7ZLWLOGT.js +2 -0
  43. package/dist/{chunk-WHADK6OS.js → chunk-A4WEAK35.js} +2 -2
  44. package/dist/chunk-AADQLOQ4.js +38 -0
  45. package/dist/{chunk-XFMVKFSF.js → chunk-AN76MGUE.js} +2 -2
  46. package/dist/chunk-ANLNLY66.js +2 -0
  47. package/dist/chunk-ATXPTSEI.js +81 -0
  48. package/dist/{chunk-EELG7D3Q.js → chunk-AX7IDVFT.js} +2 -2
  49. package/dist/chunk-B3PYOSCX.js +2 -0
  50. package/dist/chunk-B7MPDEAK.js +3 -0
  51. package/dist/chunk-BBB5FBX4.js +2 -0
  52. package/dist/{chunk-Y2VM4CJC.js → chunk-BHKK5RJY.js} +2 -2
  53. package/dist/chunk-BJWFVAA5.js +2 -0
  54. package/dist/chunk-BKVWUP7Y.js +2 -0
  55. package/dist/{chunk-7XA3OM44.js → chunk-BKZYTLGE.js} +2 -2
  56. package/dist/chunk-BL6DCHQP.js +2 -0
  57. package/dist/chunk-BOW7SSQH.js +43 -0
  58. package/dist/{chunk-KQHJEU6V.js → chunk-C4RHHCKL.js} +2 -2
  59. package/dist/chunk-C7C6AKAT.js +117 -0
  60. package/dist/chunk-CD6M6LS2.js +16 -0
  61. package/dist/chunk-CFE6PSG6.js +2 -0
  62. package/dist/{chunk-GPGRZJ3R.js → chunk-CFNIGQMT.js} +2 -2
  63. package/dist/{chunk-K3XFWJI2.js → chunk-CKBUBRYD.js} +2 -2
  64. package/dist/chunk-CZW5MZ5B.js +2 -0
  65. package/dist/chunk-DBBZ63ZX.js +2 -0
  66. package/dist/chunk-DBN7DMJB.js +18 -0
  67. package/dist/{chunk-CKRWA452.js → chunk-DUULLZHZ.js} +2 -2
  68. package/dist/{chunk-6HRZQLOI.js → chunk-DV5Y5NOS.js} +2 -2
  69. package/dist/chunk-DZOIKCTM.js +3 -0
  70. package/dist/chunk-E4PKTOL3.js +2 -0
  71. package/dist/{chunk-GVOMSPGL.js → chunk-E65ELFKU.js} +2 -2
  72. package/dist/{chunk-VXJJTQYE.js → chunk-E7QR35ST.js} +2 -2
  73. package/dist/{chunk-2RE5OCHZ.js → chunk-EFSXAINW.js} +2 -2
  74. package/dist/{chunk-GY7CCCEZ.js → chunk-EHVEIEQN.js} +2 -2
  75. package/dist/{chunk-BVFYEEBH.js → chunk-EHYDXE3Z.js} +2 -2
  76. package/dist/{chunk-HISEUIL2.js → chunk-EP63Y6LD.js} +2 -2
  77. package/dist/chunk-EPX6NQN6.js +4 -0
  78. package/dist/chunk-ETC674NS.js +5 -0
  79. package/dist/{chunk-5H5WTJSD.js → chunk-F5GSBHC6.js} +2 -2
  80. package/dist/chunk-FH3DGXC6.js +2 -0
  81. package/dist/{chunk-2XCGSDIT.js → chunk-FI7VGOR4.js} +2 -2
  82. package/dist/chunk-FJF6VO2P.js +2 -0
  83. package/dist/{chunk-FELGD32K.js → chunk-FLMTCX5R.js} +2 -2
  84. package/dist/chunk-FVFDOIM3.js +2 -0
  85. package/dist/{chunk-AQ2PORIO.js → chunk-G2HU5WRN.js} +2 -2
  86. package/dist/{chunk-7YQOCABQ.js → chunk-G4ALYS4J.js} +2 -2
  87. package/dist/{chunk-SWK4XPUS.js → chunk-G56I7K4W.js} +2 -2
  88. package/dist/{chunk-JFQBRL3J.js → chunk-GC4DG2V5.js} +2 -2
  89. package/dist/chunk-GG45PK4S.js +4 -0
  90. package/dist/{chunk-XN22RGSR.js → chunk-GHNPACNP.js} +2 -2
  91. package/dist/{chunk-XU75YQN4.js → chunk-GINH3YQU.js} +2 -2
  92. package/dist/chunk-GTZZVLKJ.js +2 -0
  93. package/dist/chunk-GXXW5ZHH.js +2 -0
  94. package/dist/{chunk-RNKPYYYE.js → chunk-HAXXKRTD.js} +2 -2
  95. package/dist/chunk-HEZWBAZY.js +2 -0
  96. package/dist/chunk-HMEWLMML.js +2 -0
  97. package/dist/{chunk-2KVU55CW.js → chunk-HOBOVYPO.js} +2 -2
  98. package/dist/{chunk-2YC7YNKT.js → chunk-HRFQ6GW5.js} +2 -2
  99. package/dist/{chunk-RYOYJMGF.js → chunk-HX4X7KG3.js} +2 -2
  100. package/dist/{chunk-AZS7YPCB.js → chunk-HYT2R7LX.js} +2 -2
  101. package/dist/chunk-IKQVBVQL.js +40 -0
  102. package/dist/chunk-J6GLBBRK.js +4 -0
  103. package/dist/{chunk-TNG2FYS5.js → chunk-J7A4PWFX.js} +2 -2
  104. package/dist/chunk-JCSAZ35V.js +2 -0
  105. package/dist/{chunk-EWWY2ZFL.js → chunk-JDU2IV3A.js} +2 -2
  106. package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
  107. package/dist/chunk-JFMI5SGB.js +4 -0
  108. package/dist/chunk-JJP37RGX.js +57 -0
  109. package/dist/chunk-JZ2A7LDM.js +5 -0
  110. package/dist/chunk-KNLQGXVH.js +80 -0
  111. package/dist/chunk-KVQCECPR.js +2 -0
  112. package/dist/{chunk-F24QUEQP.js → chunk-KXXORBZ2.js} +2 -2
  113. package/dist/{chunk-IKVNEGTW.js → chunk-L5KYH6U3.js} +2 -2
  114. package/dist/chunk-L6XHYJPZ.js +21 -0
  115. package/dist/chunk-L7KTFEAV.js +43 -0
  116. package/dist/{chunk-UAQ4T73O.js → chunk-LDXHR5EL.js} +2 -2
  117. package/dist/chunk-LEECKFCJ.js +2 -0
  118. package/dist/{chunk-LO5JSW2C.js → chunk-MHGDSBFX.js} +2 -2
  119. package/dist/{chunk-JUN5DOAK.js → chunk-MLQVVDG3.js} +2 -2
  120. package/dist/chunk-MOKUWRHO.js +3 -0
  121. package/dist/{chunk-44T4DUAA.js → chunk-MPYAPMNE.js} +2 -2
  122. package/dist/{chunk-ARVO6TTW.js → chunk-MV6SPXCR.js} +2 -2
  123. package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
  124. package/dist/{chunk-TH6IC56G.js → chunk-MZPXPSUJ.js} +2 -2
  125. package/dist/{chunk-FBCVASUG.js → chunk-N55KIE46.js} +2 -2
  126. package/dist/{chunk-VMWUV6WB.js → chunk-NB4D3BNM.js} +2 -2
  127. package/dist/{chunk-JAT6C3VX.js → chunk-NGKBOT6G.js} +2 -2
  128. package/dist/{chunk-Q6T2CAJL.js → chunk-NJGKXKQF.js} +2 -2
  129. package/dist/chunk-NJQISBL4.js +8 -0
  130. package/dist/chunk-NJT3ZEKY.js +16 -0
  131. package/dist/{chunk-KFVSJX25.js → chunk-NKMKZP6A.js} +2 -2
  132. package/dist/chunk-NODFZ6ED.js +2 -0
  133. package/dist/{chunk-ERCYGVAM.js → chunk-NSM5IEVW.js} +2 -2
  134. package/dist/{chunk-YAGYMBEX.js → chunk-NTGUVNR2.js} +2 -2
  135. package/dist/{chunk-N7FP5H5U.js → chunk-NU3KFF2O.js} +8 -8
  136. package/dist/chunk-NWLVNU66.js +557 -0
  137. package/dist/{chunk-Q55NF3ZG.js → chunk-NYKZMCRC.js} +2 -2
  138. package/dist/{chunk-I6UTXNHU.js → chunk-O6BUXZEH.js} +2 -2
  139. package/dist/chunk-ODPDP7A4.js +3 -0
  140. package/dist/{chunk-ZAZGGSM3.js → chunk-OHIV323X.js} +2 -2
  141. package/dist/chunk-OIAPEKMT.js +3 -0
  142. package/dist/chunk-OIOC5EHF.js +3 -0
  143. package/dist/{chunk-YIHNPKWD.js → chunk-ONPPQM4G.js} +2 -2
  144. package/dist/{chunk-RHHCLWQ6.js → chunk-OUHEZBYI.js} +2 -2
  145. package/dist/{chunk-MSR2QRUE.js → chunk-OVGYW7UD.js} +2 -2
  146. package/dist/{chunk-OPSAW5DT.js → chunk-OYKU4B3Y.js} +2 -2
  147. package/dist/{chunk-5YRQIE2B.js → chunk-POBJ6FR2.js} +2 -2
  148. package/dist/{chunk-ZGW4HLPD.js → chunk-PSZPMMWN.js} +2 -2
  149. package/dist/chunk-PXTRBKRK.js +3 -0
  150. package/dist/{chunk-U2N2KE7A.js → chunk-Q5JRIHT3.js} +2 -2
  151. package/dist/{chunk-GRX7JOXQ.js → chunk-Q7ATHARX.js} +2 -2
  152. package/dist/{chunk-5ZMBRQFC.js → chunk-Q7CSKIDM.js} +2 -2
  153. package/dist/{chunk-HG722PO7.js → chunk-QBQE7ZJ5.js} +2 -2
  154. package/dist/{chunk-Z2PZVKPR.js → chunk-QH22UIXP.js} +2 -2
  155. package/dist/chunk-QXCKQTKR.js +60 -0
  156. package/dist/chunk-RBAD4GJ2.js +13 -0
  157. package/dist/chunk-RMDPFPNW.js +2 -0
  158. package/dist/chunk-ROPJDEJZ.js +4 -0
  159. package/dist/{chunk-56NQAEPJ.js → chunk-RVZC6TJE.js} +2 -2
  160. package/dist/{chunk-XJX6LGHL.js → chunk-S4QZBKSR.js} +2 -2
  161. package/dist/chunk-SCPMZ73U.js +2 -0
  162. package/dist/{chunk-7IQXARSQ.js → chunk-SIAP5RGI.js} +2 -2
  163. package/dist/{chunk-4TQU4TX2.js → chunk-SIX4RFR3.js} +2 -2
  164. package/dist/{chunk-AYPDH2LU.js → chunk-SKKXTABJ.js} +2 -2
  165. package/dist/{chunk-ZYM4HOFA.js → chunk-SSRFUQBD.js} +2 -2
  166. package/dist/chunk-SYVJEEUJ.js +3 -0
  167. package/dist/chunk-T3CZAZSI.js +8 -0
  168. package/dist/chunk-T3I6NHBH.js +2 -0
  169. package/dist/{chunk-GDRJB3SB.js → chunk-T6DWDI5E.js} +2 -2
  170. package/dist/chunk-T6HRIROJ.js +7 -0
  171. package/dist/{chunk-OTSPRVNW.js → chunk-TAA7HXHE.js} +2 -2
  172. package/dist/{chunk-IJMD6BRI.js → chunk-TJ2JQYT3.js} +2 -2
  173. package/dist/chunk-TULNMD5T.js +368 -0
  174. package/dist/chunk-U2FPY5XA.js +3 -0
  175. package/dist/chunk-U3SXIMII.js +38 -0
  176. package/dist/{chunk-ENWQWA2R.js → chunk-U6KCHXJ4.js} +2 -2
  177. package/dist/chunk-UH3XSKS5.js +9 -0
  178. package/dist/{chunk-UDY7MIAW.js → chunk-UIFUZVCC.js} +2 -2
  179. package/dist/{chunk-BDGTPN27.js → chunk-UXKURIVI.js} +2 -2
  180. package/dist/{chunk-FGNCOQUX.js → chunk-V2RBODHL.js} +2 -2
  181. package/dist/chunk-VBKUWB6N.js +2 -0
  182. package/dist/{chunk-PIFTZEEM.js → chunk-VBV6ALJE.js} +2 -2
  183. package/dist/{chunk-2OXVP5U5.js → chunk-VDGFWCQV.js} +2 -2
  184. package/dist/chunk-VDSDOEWF.js +2 -0
  185. package/dist/{chunk-C76O5MDS.js → chunk-VZPWVCLN.js} +2 -2
  186. package/dist/chunk-WDSFQDPN.js +2 -0
  187. package/dist/{chunk-BTVKZGWT.js → chunk-WFA35BGR.js} +2 -2
  188. package/dist/{chunk-H7CG6LOE.js → chunk-WLMP3OCW.js} +2 -2
  189. package/dist/{chunk-WOOAY3PA.js → chunk-WSA52GOR.js} +2 -2
  190. package/dist/chunk-WYPL7GF7.js +2 -0
  191. package/dist/{chunk-RDULNRSJ.js → chunk-X3YVZAKZ.js} +2 -2
  192. package/dist/chunk-X6OGVFIT.js +2 -0
  193. package/dist/{chunk-ISWFRGJ6.js → chunk-XKXTR6ZI.js} +2 -2
  194. package/dist/chunk-Y5DFAW5W.js +4 -0
  195. package/dist/chunk-YSYPDRD5.js +3 -0
  196. package/dist/chunk-ZFVPWH62.js +5 -0
  197. package/dist/chunk-ZGIHTH27.js +2 -0
  198. package/dist/{chunk-QKT4UI2Y.js → chunk-ZGIQN2SX.js} +2 -2
  199. package/dist/chunk-ZHG4WAHR.js +12 -0
  200. package/dist/{chunk-CLG6DWVS.js → chunk-ZKB2XUEN.js} +2 -2
  201. package/dist/chunk-ZLMXIQLC.js +21 -0
  202. package/dist/chunk-ZMCQIHI4.js +2 -0
  203. package/dist/cli-main.js +2 -2
  204. package/dist/code-TAVIKWJI.js +2 -0
  205. package/dist/code-result-json-5FEFQCAQ.js +2 -0
  206. package/dist/command-descriptors-7BKH53Y3.js +343 -0
  207. package/dist/dataflow-GFBTVDH3.js +2 -0
  208. package/dist/dependence-slice-GWGQCODG.js +2 -0
  209. package/dist/deps-4QHVDPYA.js +2 -0
  210. package/dist/direct-navigation-4UBC6HNW.js +3 -0
  211. package/dist/entry-map-QCTF4RVY.js +2 -0
  212. package/dist/files-M2UBF5HJ.js +2 -0
  213. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  214. package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
  215. package/dist/hierarchy-2UIHRLW4.js +2 -0
  216. package/dist/imports-WIE3YZOB.js +2 -0
  217. package/dist/index.d.ts +1 -1
  218. package/dist/index.js +1 -1
  219. package/dist/members-YKD636DA.js +2 -0
  220. package/dist/methods-VDF4IMYG.js +2 -0
  221. package/dist/output-continuation-command-4UMDOOLO.js +3 -0
  222. package/dist/output-pagination-2GME6OPY.js +19 -0
  223. package/dist/postinstall.js +1 -1
  224. package/dist/project-reindex-XEQTRCV5.js +3 -0
  225. package/dist/queries/affected.js +1 -1
  226. package/dist/queries/anchors.d.ts +1 -1
  227. package/dist/queries/anchors.js +1 -1
  228. package/dist/queries/architecture.js +1 -1
  229. package/dist/queries/bottlenecks.js +1 -1
  230. package/dist/queries/by-kind.js +1 -1
  231. package/dist/queries/call-graph.d.ts +2 -0
  232. package/dist/queries/call-graph.js +1 -1
  233. package/dist/queries/change-surface.js +1 -1
  234. package/dist/queries/cleanup-plan.js +1 -1
  235. package/dist/queries/co-change.d.ts +20 -2
  236. package/dist/queries/co-change.js +1 -1
  237. package/dist/queries/code.js +1 -1
  238. package/dist/queries/complexity-hotspots.js +1 -1
  239. package/dist/queries/complexity.js +1 -1
  240. package/dist/queries/context.js +1 -1
  241. package/dist/queries/convergence.js +1 -1
  242. package/dist/queries/coupling.js +1 -1
  243. package/dist/queries/cycles.js +1 -1
  244. package/dist/queries/dataflow.js +1 -1
  245. package/dist/queries/dead.d.ts +2 -0
  246. package/dist/queries/dead.js +1 -1
  247. package/dist/queries/decorative-checkers.js +1 -1
  248. package/dist/queries/deep-chains.js +1 -1
  249. package/dist/queries/dependence-slice.js +1 -1
  250. package/dist/queries/dependency-depth.js +1 -1
  251. package/dist/queries/deps.js +1 -1
  252. package/dist/queries/diff-impact.d.ts +9 -0
  253. package/dist/queries/diff-impact.js +1 -1
  254. package/dist/queries/doc-drift.js +1 -1
  255. package/dist/queries/drift.js +1 -1
  256. package/dist/queries/duplicate-bodies.d.ts +28 -1
  257. package/dist/queries/duplicate-bodies.js +1 -1
  258. package/dist/queries/entry-map.d.ts +1 -1
  259. package/dist/queries/entry-map.js +1 -1
  260. package/dist/queries/evidence.js +1 -1
  261. package/dist/queries/extract-candidates.d.ts +50 -23
  262. package/dist/queries/extract-candidates.js +1 -1
  263. package/dist/queries/fan.js +1 -1
  264. package/dist/queries/files.js +1 -1
  265. package/dist/queries/health.d.ts +1 -1
  266. package/dist/queries/health.js +1 -1
  267. package/dist/queries/hierarchy.js +1 -1
  268. package/dist/queries/hotspots.js +1 -1
  269. package/dist/queries/imports.js +1 -1
  270. package/dist/queries/incomplete-migration.js +1 -1
  271. package/dist/queries/index.d.ts +4 -3
  272. package/dist/queries/index.js +1 -1
  273. package/dist/queries/isolated.js +1 -1
  274. package/dist/queries/locality-candidates.js +1 -1
  275. package/dist/queries/members.js +1 -1
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.js +1 -1
  278. package/dist/queries/outline.js +1 -1
  279. package/dist/queries/passthrough-candidates.d.ts +9 -1
  280. package/dist/queries/passthrough-candidates.js +1 -1
  281. package/dist/queries/plan-context.js +1 -1
  282. package/dist/queries/react-component-duplicates.d.ts +19 -3
  283. package/dist/queries/react-component-duplicates.js +1 -1
  284. package/dist/queries/react-hook-candidates.d.ts +22 -3
  285. package/dist/queries/react-hook-candidates.js +1 -1
  286. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  287. package/dist/queries/react-large-component-pressure.js +1 -1
  288. package/dist/queries/recent-duplicates.js +1 -1
  289. package/dist/queries/redundant-reexports.js +1 -1
  290. package/dist/queries/reference-neighborhood.js +1 -1
  291. package/dist/queries/reference-reachability.js +1 -1
  292. package/dist/queries/refs.js +1 -1
  293. package/dist/queries/self-audit.d.ts +7 -1
  294. package/dist/queries/self-audit.js +1 -1
  295. package/dist/queries/similar-chains.js +1 -1
  296. package/dist/queries/similar-files.js +1 -1
  297. package/dist/queries/similar-signatures.js +1 -1
  298. package/dist/queries/similar.js +1 -1
  299. package/dist/queries/slice.js +1 -1
  300. package/dist/queries/source-inspection.js +1 -1
  301. package/dist/queries/source-search.js +1 -1
  302. package/dist/queries/stale-abstractions.js +1 -1
  303. package/dist/queries/surface.js +1 -1
  304. package/dist/queries/symbols.js +1 -1
  305. package/dist/queries/system-map.d.ts +1 -1
  306. package/dist/queries/system-map.js +1 -1
  307. package/dist/queries/system.js +1 -1
  308. package/dist/queries/test-quality.js +1 -1
  309. package/dist/queries/trace.js +1 -1
  310. package/dist/queries/twin-ab.js +1 -1
  311. package/dist/queries/twin-drift.d.ts +22 -6
  312. package/dist/queries/twin-drift.js +1 -1
  313. package/dist/queries/unused-imports.js +1 -1
  314. package/dist/queries/unused-params.js +1 -1
  315. package/dist/queries/value-flow.js +1 -1
  316. package/dist/queries/vue-component-duplicates.js +1 -1
  317. package/dist/queries/vue-composable-candidates.js +1 -1
  318. package/dist/queries/vue-large-view-pressure.js +1 -1
  319. package/dist/queries/wrapper-candidates.d.ts +16 -1
  320. package/dist/queries/wrapper-candidates.js +1 -1
  321. package/dist/query-service-fastpath.js +5 -5
  322. package/dist/query-service-server.js +3 -3
  323. package/dist/refs-JNK5CLM7.js +2 -0
  324. package/dist/refs-pagination-6BLRYGMV.js +2 -0
  325. package/dist/reindex-worker.js +25 -25
  326. package/dist/reindex.d.ts +3 -2
  327. package/dist/reindex.js +35 -35
  328. package/dist/runtime.d.ts +34 -2
  329. package/dist/runtime.js +4 -4
  330. package/dist/rust-semantic-session-server.js +1 -1
  331. package/dist/rust-semantic-session-worker.js +1 -1
  332. package/dist/rust-semantic-worker.js +1 -1
  333. package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
  334. package/dist/slice-PHPVNCWX.js +2 -0
  335. package/dist/surface-MQX5MPIV.js +2 -0
  336. package/dist/symbol-resolution-DBLVXLBC.js +2 -0
  337. package/dist/system-JOPKV4OG.js +2 -0
  338. package/dist/trace-I2P2YFH4.js +2 -0
  339. package/dist/typescript-mailbox-worker.js +1 -1
  340. package/dist/value-flow-JJVMF7NP.js +2 -0
  341. package/dist/watch-server.js +3 -3
  342. package/docs/COMMAND_REFERENCE.md +2 -2
  343. package/docs/DETECTOR_GUIDE.md +51 -12
  344. package/docs/accuracy-audit-checklist.md +36 -13
  345. package/docs/locality-analyzer-design.md +9 -9
  346. package/package.json +2 -2
  347. package/skills/conductor/SKILL.md +110 -0
  348. package/skills/conductor/agents/openai.yaml +4 -0
  349. package/skills/principal-maintainability-review/SKILL.md +273 -0
  350. package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
  351. package/skills/scip-calibrate/SKILL.md +102 -0
  352. package/skills/scip-calibrate/agents/openai.yaml +4 -0
  353. package/skills/scip-claim-audit/SKILL.md +113 -0
  354. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  355. package/skills/scip-probe-reachability/SKILL.md +93 -0
  356. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  357. package/skills/scip-root-cause/SKILL.md +160 -0
  358. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  359. package/skills/scip-system-compression/SKILL.md +252 -0
  360. package/skills/scip-system-compression/agents/openai.yaml +4 -0
  361. package/skills/scip-system-compression/references/compression-atlas.md +116 -0
  362. package/skills/scip-system-compression/references/compression-patterns.md +87 -0
  363. package/skills/scip-twin-drift/SKILL.md +109 -0
  364. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  365. package/dist/by-kind-4IYG2SKW.js +0 -2
  366. package/dist/call-graph-WQNXMNNN.js +0 -2
  367. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  368. package/dist/chunk-2BTJALUS.js +0 -454
  369. package/dist/chunk-3QXC54FQ.js +0 -3
  370. package/dist/chunk-3TJY6M3B.js +0 -7
  371. package/dist/chunk-42W3LFUK.js +0 -13
  372. package/dist/chunk-4GAQ6FI4.js +0 -43
  373. package/dist/chunk-6NC3YSPY.js +0 -38
  374. package/dist/chunk-6VEFRPTD.js +0 -5
  375. package/dist/chunk-7C26EKLZ.js +0 -4
  376. package/dist/chunk-7JYHQAH2.js +0 -22
  377. package/dist/chunk-7KSO2OAP.js +0 -2
  378. package/dist/chunk-7XZGZBSQ.js +0 -2
  379. package/dist/chunk-A77SCPW2.js +0 -3
  380. package/dist/chunk-AK3PYTIK.js +0 -5
  381. package/dist/chunk-AMIMMNA4.js +0 -11
  382. package/dist/chunk-AUY5BL74.js +0 -2
  383. package/dist/chunk-BDHFVH2M.js +0 -18
  384. package/dist/chunk-BECZLYNU.js +0 -8
  385. package/dist/chunk-BUTEIZKP.js +0 -10
  386. package/dist/chunk-BWVQP3LB.js +0 -38
  387. package/dist/chunk-BYDAFMSR.js +0 -57
  388. package/dist/chunk-BZYSGZRK.js +0 -2
  389. package/dist/chunk-C7IJMOFP.js +0 -134
  390. package/dist/chunk-CBBHFNLX.js +0 -2
  391. package/dist/chunk-D2MVJSP4.js +0 -21
  392. package/dist/chunk-D35XIZGN.js +0 -2
  393. package/dist/chunk-DKM723YF.js +0 -79
  394. package/dist/chunk-DRENNWRG.js +0 -2
  395. package/dist/chunk-E44IVWIJ.js +0 -367
  396. package/dist/chunk-EDMB6SSO.js +0 -7
  397. package/dist/chunk-EETGXQY7.js +0 -3
  398. package/dist/chunk-FKGQOTKD.js +0 -2
  399. package/dist/chunk-GH5YSGZL.js +0 -5
  400. package/dist/chunk-GQIDEID3.js +0 -2
  401. package/dist/chunk-HCVJR2V4.js +0 -3
  402. package/dist/chunk-IMKZEXZG.js +0 -2
  403. package/dist/chunk-ISIQLPJ2.js +0 -61
  404. package/dist/chunk-IXESDH3J.js +0 -2
  405. package/dist/chunk-JJ62MTQH.js +0 -40
  406. package/dist/chunk-JT6XX7QY.js +0 -8
  407. package/dist/chunk-KFOYCQAJ.js +0 -9
  408. package/dist/chunk-LRI5OMPE.js +0 -2
  409. package/dist/chunk-MHIEP7EG.js +0 -4
  410. package/dist/chunk-NK3JMP22.js +0 -2
  411. package/dist/chunk-NVSZNESQ.js +0 -2
  412. package/dist/chunk-OJNK5ALA.js +0 -2
  413. package/dist/chunk-OXYAWIEA.js +0 -2
  414. package/dist/chunk-OZETODHH.js +0 -2
  415. package/dist/chunk-PBUH2P5S.js +0 -3
  416. package/dist/chunk-PLJUQFQN.js +0 -2
  417. package/dist/chunk-PLYUVM4F.js +0 -2
  418. package/dist/chunk-PXXYQK55.js +0 -2
  419. package/dist/chunk-Q5TA4OY4.js +0 -20
  420. package/dist/chunk-Q7GBK5T7.js +0 -81
  421. package/dist/chunk-QLBSG7U5.js +0 -3
  422. package/dist/chunk-QWKHW6VZ.js +0 -2
  423. package/dist/chunk-RPL3ARU7.js +0 -16
  424. package/dist/chunk-SVHTMVA4.js +0 -4
  425. package/dist/chunk-T6QD2ZQB.js +0 -43
  426. package/dist/chunk-TD7VKJ2Y.js +0 -117
  427. package/dist/chunk-TKDNDQA7.js +0 -3
  428. package/dist/chunk-TQZV7KV4.js +0 -2
  429. package/dist/chunk-TUSPIVZ3.js +0 -4
  430. package/dist/chunk-URSGGIZX.js +0 -2
  431. package/dist/chunk-UT7TADJX.js +0 -2
  432. package/dist/chunk-V4NG5OMS.js +0 -554
  433. package/dist/chunk-VTCIYFEK.js +0 -2
  434. package/dist/chunk-VU6LIWHT.js +0 -2
  435. package/dist/chunk-VUSKPCUB.js +0 -2
  436. package/dist/chunk-WN3TCGJ4.js +0 -2
  437. package/dist/chunk-WSLEJSFR.js +0 -2
  438. package/dist/chunk-WYZIHUPZ.js +0 -16
  439. package/dist/chunk-XE33FV5W.js +0 -2
  440. package/dist/chunk-XGGBK66W.js +0 -4
  441. package/dist/chunk-XSWYJCAK.js +0 -2
  442. package/dist/chunk-Y334QQU5.js +0 -3
  443. package/dist/chunk-Z2AWCTN6.js +0 -2
  444. package/dist/chunk-ZOXKSQQB.js +0 -2
  445. package/dist/chunk-ZPASRBLF.js +0 -2
  446. package/dist/chunk-ZZ3Z7D56.js +0 -2
  447. package/dist/code-EQJFDT6I.js +0 -2
  448. package/dist/code-result-json-7UWIWBOO.js +0 -2
  449. package/dist/command-descriptors-ORNTVNYV.js +0 -342
  450. package/dist/dataflow-6VL54GX5.js +0 -2
  451. package/dist/dependence-slice-DT2NUHD2.js +0 -2
  452. package/dist/deps-DB7H5IKC.js +0 -2
  453. package/dist/direct-navigation-O3LUAYWQ.js +0 -3
  454. package/dist/entry-map-6K62RV3D.js +0 -2
  455. package/dist/files-MSLD7MO6.js +0 -2
  456. package/dist/hierarchy-IVBXAKFA.js +0 -2
  457. package/dist/imports-FRAVZ3Y2.js +0 -2
  458. package/dist/members-KJOJDYGO.js +0 -2
  459. package/dist/methods-2AYABBT3.js +0 -2
  460. package/dist/output-continuation-command-JHMPH6NC.js +0 -3
  461. package/dist/output-pagination-3OFL2MJV.js +0 -19
  462. package/dist/project-reindex-HYO4WD7Z.js +0 -3
  463. package/dist/refs-ARMA6XUJ.js +0 -2
  464. package/dist/refs-pagination-VUGIWN6U.js +0 -2
  465. package/dist/slice-YOB5YFAM.js +0 -2
  466. package/dist/surface-VY5EFWTW.js +0 -2
  467. package/dist/symbol-resolution-DGQN4XIV.js +0 -2
  468. package/dist/system-2KQ3QD2P.js +0 -2
  469. package/dist/trace-HTIPTXAE.js +0 -2
  470. package/dist/value-flow-5FV3VQI7.js +0 -2
@@ -1,4 +1,4 @@
1
- import{b as be}from"./chunk-FELGD32K.js";import{B as G,h as ye,k as O,t as M,x as P}from"./chunk-C7IJMOFP.js";import{e as pe}from"./chunk-IW5XQG5G.js";var Oe=12,De=20,oe=200,ie=800,Ie=.9,Me=64,ke=pe("behavior-construct-ranges"),ge={if_statement:"branch",conditional_expression:"branch",ternary_expression:"branch",switch_statement:"branch",switch_expression:"branch",switch_case:"branch",case_statement:"branch",match_statement:"branch",match_expression:"branch",match_arm:"branch",for_statement:"loop",for_in_statement:"loop",for_of_statement:"loop",while_statement:"loop",do_statement:"loop",await_expression:"await",return_statement:"return",throw_statement:"throw",raise_statement:"throw",assignment_expression:"mutation",augmented_assignment_expression:"mutation",assignment:"mutation",pair:"shape",field_initializer:"shape",spread_element:"spread",dictionary_splat:"spread",catch_clause:"catch",except_clause:"catch",finally_clause:"finally"},Z=["anchor","signature","binding","branch","loop","call","await","return","throw","mutation","shape","spread","catch","finally"],Ce=[...Z,"lifecycle"],_e=["loop","await","throw","mutation","spread","catch","finally","lifecycle"],Ye=new Set(["onBeforeMount","onBeforeUnmount","onMounted","onUnmounted","useEffect","useInsertionEffect","useLayoutEffect"]);var Ne=new Set(["object","object_pattern","dictionary","field_declaration_list","struct_expression","struct_pattern"]);function Ct(e,n,t,o,r=[],a={}){let s=P(e,n);if(!s)return null;let l=O(e,n),c=ee(e,n,t,o,r),u=ne(e,n,c.startLine,c.endLine),d=u?.startLine??t,p=u?.endLine??o,N=(u?I(s.rootNode,c.startLine,c.endLine):null)??M(s.rootNode,d,p);if(!N)return null;let b=Le(N,l,d,p,r);if(!b||b.lines.length===0||b.lines.some(S=>S.text.length>ie))return null;let h=ot(l,d,p),C=it(b);if((a.requireSavings??!0)&&C>=h*Ie)return null;let x=Z.filter(S=>b.lines.some(v=>v.signals.includes(S)));return{...u?{callable:{name:u.name,startLine:u.startLine,endLine:u.endLine}}:{},representation:"outline",constructKind:b.constructKind,signature:b.signature,lines:b.lines,signals:x,testCases:be(n)==="test"?ut(l,d,p):[],coverage:{sourceStatements:b.sourceStatements,representedStatements:b.sourceStatements,copiedStatements:b.copiedStatements,omittedStatements:0},rawCharacters:h,outlineCharacters:C,candidateLines:b.sourceStatements,omittedLines:0}}function _t(e,n,t,o,r){if(r.length===0)return[];let a=P(e,n);if(!a)return[];let s=O(e,n),l=ee(e,n,t,o,r),c=ne(e,n,l.startLine,l.endLine),u=c?.startLine??t,d=c?.endLine??o,p=(c?I(a.rootNode,l.startLine,l.endLine):null)??M(a.rootNode,u,d);if(!p)return[];let N=Le(p,s,u,d,r);return N?N.lines.filter(b=>b.text.length<=ie&&b.signals.some(h=>["branch","loop","catch","finally"].includes(h))&&r.some(h=>h>=b.line&&h<=b.endLine)):[]}function Nt(e,n,t,o){let r=P(e,n);if(!r)return null;let a=I(r.rootNode,t,o)??M(r.rootNode,t,o);if(!a)return null;let s=[],l=se(a),c=[];return ce(a,a,u=>{if(Y.has(u.type)||je.has(u.type)){ze(s,c,u);return}if(te.has(u.type)){He(s,c,u);return}if(z.has(u.type)){Ue(s,c,u);return}H.has(u.type)&&Ke(s,u)}),{facts:Je(s),terminals:we(l),unsupported:c}}function ee(e,n,t,o,r=[]){let a=r.filter(d=>d>=t&&d<=o),s=ke.get(e,n,ye(e,n)??"",()=>new Map),l=`${t}:${o}:${a.join(",")}`,c=s.get(l);if(c)return s.delete(l),s.set(l,c),{startLine:c[0],endLine:c[1]};let u=$e(e,n,t,o,a);if(s.set(l,[u.startLine,u.endLine]),s.size>Me){let d=s.keys().next().value;d!==void 0&&s.delete(d)}return u}function $e(e,n,t,o,r){let a=P(e,n),s=[];if(r.length>0&&a){let d=[],p=r[0],N=p;for(let h of r)p=Math.min(p,h),N=Math.max(N,h);Ee(a.rootNode,p,N,h=>{Qe(h)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&d.push(h),T.has(h.type)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&s.push(h)});let b=d.sort((h,C)=>h.endPosition.row-h.startPosition.row-(C.endPosition.row-C.startPosition.row)||h.startPosition.row-C.startPosition.row)[0];if(b)return{startLine:b.startPosition.row,endLine:b.endPosition.row}}let l=ne(e,n,t,o);if(l)return{startLine:l.startLine,endLine:l.endLine};if(r.length===0)return{startLine:t,endLine:o};let c=(G(e,n)?.callables??[]).filter(d=>d.startLine>=t&&d.endLine<=o&&r.every(p=>d.startLine<=p&&d.endLine>=p)).sort((d,p)=>d.endLine-d.startLine-(p.endLine-p.startLine)||d.startLine-p.startLine)[0];if(!a)return c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o};let u=s.sort((d,p)=>d.endPosition.row-d.startPosition.row-(p.endPosition.row-p.startPosition.row)||d.startPosition.row-p.startPosition.row)[0];return u?{startLine:u.startPosition.row,endLine:u.endPosition.row}:c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o}}function xt(e,n,t,o,r={}){if(o-t+1<(r.minimumBodyLines??De))return null;let s=Re(e,n,t,o,[],!1);if(!s)return null;let l=s.candidates.map(S=>({...S,signals:S.signals.filter(v=>v!=="anchor"&&v!=="signature")})).filter(S=>S.signals.length>0);if(l.length===0)return null;let c=ct(l),u=l.filter(S=>S.text.length<=oe);if(u.length===0)return null;let d=_e.filter(S=>(c[S]??0)>0),p=d.filter(S=>S!=="await"),N=s.shapes.reduce((S,v)=>S+v.fields.length,0);if(p.length===0&&!((c.await??0)>0&&N>0)&&N<3)return null;let b=lt(u,c),h=new Map;for(let S of d){let v=b.find(m=>m.signals.includes(S));v&&h.set(v.line,v)}if(h.size===0){let S=b.find(v=>v.signals.includes("branch"));S&&h.set(S.line,S)}let C=Math.min(10,Math.max(1,r.maxLines??h.size)),x=new Map;for(let S of h.values()){if(x.size>=C)break;x.set(S.line,S)}return x.size>=l.length&&s.shapes.length===0?null:{owner:s.callable?.name??null,startLine:t,endLine:o,lines:[...x.values()].sort((S,v)=>S.line-v.line),shapes:s.shapes,signalCounts:c,candidateLines:l.length,omittedLines:l.length-x.size}}function vt(e,n,t,o){let r=Re(e,n,t,o,[],!1);return r?new Map(r.candidates.map(a=>[a.line,a.signals.filter(s=>s!=="lifecycle")])):new Map}var T=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),B=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Y=new Set(["if_expression","if_statement","unless","unless_statement"]),je=new Set(["conditional_expression","ternary_expression"]),te=new Set(["do_statement","enhanced_for_statement","for_expression","for_in_statement","for_of_statement","for_statement","loop_expression","while_statement"]),z=new Set(["match_expression","match_statement","switch_expression","switch_statement"]),xe=new Set(["case_statement","match_arm","switch_case","switch_default"]),H=new Set(["try_expression","try_statement"]),X=new Set(["catch_clause","except_clause","rescue"]),j=new Set(["ensure","finally_clause"]),$=new Set(["else","else_clause"]),ve=new Set(["raise_statement","return_statement","throw_statement"]),qe=new Set(["block_comment","comment","line_comment"]);function ze(e,n,t){let o=t.childForFieldName("condition")??ue(t),r=t.childForFieldName("consequence")??t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),a=t.childForFieldName("alternative")??t.namedChildren.find(c=>$.has(c.type));if(!o||!r){n.push(le(t,"conditional-fields-unresolved"));return}let s=F(o,"predicate",o.text),l=F(r,Se(r),"consequence");if(E(e,s,l,"predicate-consequence",{branchRole:"consequence"}),J(e,s,r,"consequence"),a){let c=F(a,Se(a),"alternative");E(e,s,c,"predicate-alternative",{branchRole:"alternative"}),J(e,s,a,"alternative");return}E(e,s,ae(s,"otherwise continue"),"predicate-fallthrough",{branchRole:"fallthrough"})}function He(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(s=>B.has(s.type));if(!o){n.push(le(t,"loop-body-unresolved"));return}let r=t.childForFieldName("condition"),a=F(r??t,"predicate",r?.text??R(t,o));E(e,a,F(o,"outcome","iteration"),"loop-iteration",{branchRole:"iteration"}),J(e,a,o,"iteration"),E(e,a,ae(a,"loop exits"),"loop-exit",{branchRole:"exit"})}function Ue(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),r=t.childForFieldName("value")??t.childForFieldName("condition")??t.childForFieldName("subject")??ue(t),a=We(o??t);if(!r||a.length===0){n.push(le(t,"switch-cases-unresolved"));return}let s=F(r,"predicate",r.text),l=!1;for(let c of a){let u=Xe(c);l||=u;let d=R(c,c.namedChildren.find(p=>Q(p)));E(e,s,F(c,"outcome",d||(u?"default":"case")),u?"predicate-default":"predicate-case",{branchRole:u?"default":"case"}),J(e,s,c,u?"default":"case")}l||E(e,s,ae(s,"no case matched"),"predicate-fallthrough",{branchRole:"fallthrough"})}function Ke(e,n){let t=F(n,"scope","try");for(let o of Ve(n)){let r=j.has(o.type),a=F(o,"handler",r?"finally":R(o,W(o)));E(e,t,a,r?"finally-cleanup":"exception-handler",{branchRole:r?"finally":"catch"}),Ge(e,a,o,r?"finally":"catch")}}function Ge(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"handler-throw":"handler-return",{branchRole:o,terminalKind:a})}}function J(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"predicate-throw":"predicate-return",{branchRole:o,terminalKind:a})}}function E(e,n,t,o,r){e.push({controller:n,outcome:t,subtype:o,attributes:r})}function F(e,n,t){return{kind:n,label:q(t).slice(0,ie),startLine:e.startPosition.row,endLine:e.endPosition.row,implicit:!1}}function ae(e,n){return{...e,kind:"outcome",label:n,implicit:!0}}function Se(e){return ve.has(e.type)?"terminal":"outcome"}function se(e){let n=[];return ce(e,e,t=>{ve.has(t.type)&&n.push(F(t,"terminal",t.text))}),we(n)}function ce(e,n,t){t(n);for(let o of n.namedChildren)o!==e&&T.has(o.type)||ce(e,o,t)}function We(e){let n=[],t=o=>{for(let r of o.namedChildren)z.has(r.type)||(xe.has(r.type)?n.push(r):t(r))};return t(e),n}function Ve(e){let n=[],t=o=>{for(let r of o.namedChildren)H.has(r.type)||(X.has(r.type)||j.has(r.type)?n.push(r):T.has(r.type)||t(r))};return t(e),n}function Xe(e){let n=R(e,e.namedChildren.find(t=>Q(t))).trim();return e.type==="switch_default"||/^(?:default\b|_\s*=>)/u.test(n)}function le(e,n){return{startLine:e.startPosition.row,endLine:e.endPosition.row,reason:n}}function Je(e){let n=new Map;for(let t of e)n.set(`${t.controller.startLine}\0${t.controller.endLine}\0${t.outcome.startLine}\0${t.outcome.endLine}\0${t.subtype}\0${t.outcome.label}`,t);return[...n.values()]}function we(e){let n=new Map;for(let t of e)n.set(`${t.startLine}\0${t.endLine}\0${t.kind}\0${t.label}`,t);return[...n.values()]}function Qe(e){return T.has(e.type)||te.has(e.type)||z.has(e.type)||H.has(e.type)||X.has(e.type)||j.has(e.type)}function Le(e,n,t,o,r){let s=I(e,t,o)??e,l=W(s),c=[],u=0,d=0,p=(i,f,y,g,w=!1,D=!0)=>{let K=w?y.trim():q(y);if(!K)return;let A=Math.max(t,i.startPosition.row),fe=Math.min(o,i.endPosition.row);c.push({line:A,endLine:Math.max(A,fe),depth:f,signals:Z.filter(me=>g.includes(me)||me==="anchor"&&r.some(he=>he>=A&&he<=fe)),text:K,copied:w}),D&&(u+=1,w&&(d+=1))},N=(i,f)=>{for(let y of i.namedChildren)_(y,f)},b=(i,f)=>{if(Y.has(i.type)){h(i,f,"else if");return}if($.has(i.type)){let y=i.namedChildren.find(w=>Y.has(w.type));if(y){h(y,f,"else if");return}p(i,f,"else",["branch"],!1,!1);let g=W(i)??i.namedChildren.find(w=>B.has(w.type));if(g)_(g,f+1);else for(let w of i.namedChildren)_(w,f+1);return}p(i,f,"else",["branch"],!1,!1),_(i,f+1)},h=(i,f,y=i.type.startsWith("unless")?"unless":"if")=>{let g=i.childForFieldName("condition")??ue(i),w=i.childForFieldName("consequence")??i.childForFieldName("body")??i.namedChildren.find(A=>B.has(A.type)),D=i.childForFieldName("alternative")??i.namedChildren.find(A=>$.has(A.type)),K=g?g.text:R(i,w);p(i,f,`${y} ${nt(K)}`,k(g,["branch"])),w&&_(w,f+1),D&&b(D,f)},C=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["loop"])),y&&_(y,f+1)},x=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["branch"])),y&&_(y,f+1)},S=(i,f)=>{let y=i.namedChildren.find(g=>Q(g));p(i,f,R(i,y),["branch"],!1,!1);for(let g of i.namedChildren)(g===y||Q(g))&&_(g,f+1)},v=(i,f)=>{p(i,f,"try",[],!1);for(let y of i.namedChildren)B.has(y.type)?_(y,f+1):(X.has(y.type)||j.has(y.type))&&_(y,f)},m=(i,f,y)=>{let g=i.childForFieldName("body")??i.namedChildren.find(D=>B.has(D.type)),w=y==="finally"?"finally":R(i,g);p(i,f,w,[y],!1,!1),g&&_(g,f+1)},L=(i,f)=>{let y=W(i);p(i,f,R(i,y),k(i,["binding"])),y&&_(y,f+1)},_=(i,f)=>{if(i.startPosition.row>o||i.endPosition.row<t||qe.has(i.type)||i.type==="empty_statement")return;if(B.has(i.type)){N(i,f);return}if(Y.has(i.type)){h(i,f);return}if(te.has(i.type)){C(i,f);return}if(z.has(i.type)){x(i,f);return}if(xe.has(i.type)){S(i,f);return}if(H.has(i.type)){v(i,f);return}if(X.has(i.type)){m(i,f,"catch");return}if(j.has(i.type)){m(i,f,"finally");return}if($.has(i.type)){b(i,f);return}if(T.has(i.type)){L(i,f);return}let g=!Be(i)||rt(i);p(i,f,i.text,k(i),g)};return _(l&&l!==s?l:s,0),u===0?null:{constructKind:tt(s),signature:et(s,l,n,t),lines:c,sourceStatements:u,copiedStatements:d}}function I(e,n,t){let o=e.namedChildren.filter(r=>r.startPosition.row<=n&&r.endPosition.row>=t);for(let r of o.sort(Ze)){let a=I(r,n,t);if(a)return a}return T.has(e.type)&&e.startPosition.row<=n&&e.endPosition.row>=t?e:null}function Ze(e,n){return e.endPosition.row-e.startPosition.row-(n.endPosition.row-n.startPosition.row)||e.startPosition.row-n.startPosition.row}function W(e){return e.childForFieldName("body")??e.childForFieldName("consequence")??e.namedChildren.find(n=>B.has(n.type))??null}function et(e,n,t,o){let r=R(e,n);return r||(t[o]??e.text).trim()}function tt(e){return e.type.includes("constructor")?"constructor":e.type.includes("method")||e.type==="method"?re(e,new Set(["class_body","class_declaration","class_definition"]))?"class method":"object method":e.type==="arrow_function"||e.type==="function_expression"||e.type==="lambda"?re(e,new Set(["object","pair"]))?"object member":"function value":e.type.includes("function")?re(e,T)?"nested function":"module function":"source construct"}function re(e,n){let t=e.parent;for(;t;){if(n.has(t.type))return!0;t=t.parent}return!1}function ue(e){return e.namedChildren.find(n=>!B.has(n.type)&&!$.has(n.type))??null}function R(e,n){if(!n)return q(e.text);let t=Math.max(0,n.startIndex-e.startIndex);return q(e.text.slice(0,t)).replace(/[:{]\s*$/u,"").trim()}function nt(e){let n=q(e);return n.startsWith("(")&&n.endsWith(")")?n.slice(1,-1).trim():n}function q(e){return e.trim().replace(/\r?\n[\t ]*/gu," ")}function k(e,n=[]){let t=new Set(n);return e&&U(e,o=>{let r=ge[o.type];r&&t.add(r),o.type==="call_expression"&&(t.add("call"),Fe(o)&&t.add("shape")),de.has(o.type)&&t.add("binding")}),Z.filter(o=>t.has(o))}function rt(e){let n=!1;return U(e,t=>{n||!t.text.includes(`
1
+ import{b as be}from"./chunk-NJGKXKQF.js";import{C as G,i as ye,l as O,u as M,y as P}from"./chunk-2VAHDDLM.js";import{e as pe}from"./chunk-IW5XQG5G.js";var Oe=12,De=20,oe=200,ie=800,Ie=.9,Me=64,ke=pe("behavior-construct-ranges"),ge={if_statement:"branch",conditional_expression:"branch",ternary_expression:"branch",switch_statement:"branch",switch_expression:"branch",switch_case:"branch",case_statement:"branch",match_statement:"branch",match_expression:"branch",match_arm:"branch",for_statement:"loop",for_in_statement:"loop",for_of_statement:"loop",while_statement:"loop",do_statement:"loop",await_expression:"await",return_statement:"return",throw_statement:"throw",raise_statement:"throw",assignment_expression:"mutation",augmented_assignment_expression:"mutation",assignment:"mutation",pair:"shape",field_initializer:"shape",spread_element:"spread",dictionary_splat:"spread",catch_clause:"catch",except_clause:"catch",finally_clause:"finally"},Z=["anchor","signature","binding","branch","loop","call","await","return","throw","mutation","shape","spread","catch","finally"],Ce=[...Z,"lifecycle"],_e=["loop","await","throw","mutation","spread","catch","finally","lifecycle"],Ye=new Set(["onBeforeMount","onBeforeUnmount","onMounted","onUnmounted","useEffect","useInsertionEffect","useLayoutEffect"]);var Ne=new Set(["object","object_pattern","dictionary","field_declaration_list","struct_expression","struct_pattern"]);function Ct(e,n,t,o,r=[],a={}){let s=P(e,n);if(!s)return null;let l=O(e,n),c=ee(e,n,t,o,r),u=ne(e,n,c.startLine,c.endLine),d=u?.startLine??t,p=u?.endLine??o,N=(u?I(s.rootNode,c.startLine,c.endLine):null)??M(s.rootNode,d,p);if(!N)return null;let b=Le(N,l,d,p,r);if(!b||b.lines.length===0||b.lines.some(S=>S.text.length>ie))return null;let h=ot(l,d,p),C=it(b);if((a.requireSavings??!0)&&C>=h*Ie)return null;let x=Z.filter(S=>b.lines.some(v=>v.signals.includes(S)));return{...u?{callable:{name:u.name,startLine:u.startLine,endLine:u.endLine}}:{},representation:"outline",constructKind:b.constructKind,signature:b.signature,lines:b.lines,signals:x,testCases:be(n)==="test"?ut(l,d,p):[],coverage:{sourceStatements:b.sourceStatements,representedStatements:b.sourceStatements,copiedStatements:b.copiedStatements,omittedStatements:0},rawCharacters:h,outlineCharacters:C,candidateLines:b.sourceStatements,omittedLines:0}}function _t(e,n,t,o,r){if(r.length===0)return[];let a=P(e,n);if(!a)return[];let s=O(e,n),l=ee(e,n,t,o,r),c=ne(e,n,l.startLine,l.endLine),u=c?.startLine??t,d=c?.endLine??o,p=(c?I(a.rootNode,l.startLine,l.endLine):null)??M(a.rootNode,u,d);if(!p)return[];let N=Le(p,s,u,d,r);return N?N.lines.filter(b=>b.text.length<=ie&&b.signals.some(h=>["branch","loop","catch","finally"].includes(h))&&r.some(h=>h>=b.line&&h<=b.endLine)):[]}function Nt(e,n,t,o){let r=P(e,n);if(!r)return null;let a=I(r.rootNode,t,o)??M(r.rootNode,t,o);if(!a)return null;let s=[],l=se(a),c=[];return ce(a,a,u=>{if(Y.has(u.type)||je.has(u.type)){ze(s,c,u);return}if(te.has(u.type)){He(s,c,u);return}if(z.has(u.type)){Ue(s,c,u);return}H.has(u.type)&&Ke(s,u)}),{facts:Je(s),terminals:we(l),unsupported:c}}function ee(e,n,t,o,r=[]){let a=r.filter(d=>d>=t&&d<=o),s=ke.get(e,n,ye(e,n)??"",()=>new Map),l=`${t}:${o}:${a.join(",")}`,c=s.get(l);if(c)return s.delete(l),s.set(l,c),{startLine:c[0],endLine:c[1]};let u=$e(e,n,t,o,a);if(s.set(l,[u.startLine,u.endLine]),s.size>Me){let d=s.keys().next().value;d!==void 0&&s.delete(d)}return u}function $e(e,n,t,o,r){let a=P(e,n),s=[];if(r.length>0&&a){let d=[],p=r[0],N=p;for(let h of r)p=Math.min(p,h),N=Math.max(N,h);Ee(a.rootNode,p,N,h=>{Qe(h)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&d.push(h),T.has(h.type)&&h.startPosition.row>=t&&h.endPosition.row<=o&&r.every(C=>h.startPosition.row<=C&&h.endPosition.row>=C)&&s.push(h)});let b=d.sort((h,C)=>h.endPosition.row-h.startPosition.row-(C.endPosition.row-C.startPosition.row)||h.startPosition.row-C.startPosition.row)[0];if(b)return{startLine:b.startPosition.row,endLine:b.endPosition.row}}let l=ne(e,n,t,o);if(l)return{startLine:l.startLine,endLine:l.endLine};if(r.length===0)return{startLine:t,endLine:o};let c=(G(e,n)?.callables??[]).filter(d=>d.startLine>=t&&d.endLine<=o&&r.every(p=>d.startLine<=p&&d.endLine>=p)).sort((d,p)=>d.endLine-d.startLine-(p.endLine-p.startLine)||d.startLine-p.startLine)[0];if(!a)return c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o};let u=s.sort((d,p)=>d.endPosition.row-d.startPosition.row-(p.endPosition.row-p.startPosition.row)||d.startPosition.row-p.startPosition.row)[0];return u?{startLine:u.startPosition.row,endLine:u.endPosition.row}:c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o}}function xt(e,n,t,o,r={}){if(o-t+1<(r.minimumBodyLines??De))return null;let s=Re(e,n,t,o,[],!1);if(!s)return null;let l=s.candidates.map(S=>({...S,signals:S.signals.filter(v=>v!=="anchor"&&v!=="signature")})).filter(S=>S.signals.length>0);if(l.length===0)return null;let c=ct(l),u=l.filter(S=>S.text.length<=oe);if(u.length===0)return null;let d=_e.filter(S=>(c[S]??0)>0),p=d.filter(S=>S!=="await"),N=s.shapes.reduce((S,v)=>S+v.fields.length,0);if(p.length===0&&!((c.await??0)>0&&N>0)&&N<3)return null;let b=lt(u,c),h=new Map;for(let S of d){let v=b.find(m=>m.signals.includes(S));v&&h.set(v.line,v)}if(h.size===0){let S=b.find(v=>v.signals.includes("branch"));S&&h.set(S.line,S)}let C=Math.min(10,Math.max(1,r.maxLines??h.size)),x=new Map;for(let S of h.values()){if(x.size>=C)break;x.set(S.line,S)}return x.size>=l.length&&s.shapes.length===0?null:{owner:s.callable?.name??null,startLine:t,endLine:o,lines:[...x.values()].sort((S,v)=>S.line-v.line),shapes:s.shapes,signalCounts:c,candidateLines:l.length,omittedLines:l.length-x.size}}function vt(e,n,t,o){let r=Re(e,n,t,o,[],!1);return r?new Map(r.candidates.map(a=>[a.line,a.signals.filter(s=>s!=="lifecycle")])):new Map}var T=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),B=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Y=new Set(["if_expression","if_statement","unless","unless_statement"]),je=new Set(["conditional_expression","ternary_expression"]),te=new Set(["do_statement","enhanced_for_statement","for_expression","for_in_statement","for_of_statement","for_statement","loop_expression","while_statement"]),z=new Set(["match_expression","match_statement","switch_expression","switch_statement"]),xe=new Set(["case_statement","match_arm","switch_case","switch_default"]),H=new Set(["try_expression","try_statement"]),X=new Set(["catch_clause","except_clause","rescue"]),j=new Set(["ensure","finally_clause"]),$=new Set(["else","else_clause"]),ve=new Set(["raise_statement","return_statement","throw_statement"]),qe=new Set(["block_comment","comment","line_comment"]);function ze(e,n,t){let o=t.childForFieldName("condition")??ue(t),r=t.childForFieldName("consequence")??t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),a=t.childForFieldName("alternative")??t.namedChildren.find(c=>$.has(c.type));if(!o||!r){n.push(le(t,"conditional-fields-unresolved"));return}let s=F(o,"predicate",o.text),l=F(r,Se(r),"consequence");if(E(e,s,l,"predicate-consequence",{branchRole:"consequence"}),J(e,s,r,"consequence"),a){let c=F(a,Se(a),"alternative");E(e,s,c,"predicate-alternative",{branchRole:"alternative"}),J(e,s,a,"alternative");return}E(e,s,ae(s,"otherwise continue"),"predicate-fallthrough",{branchRole:"fallthrough"})}function He(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(s=>B.has(s.type));if(!o){n.push(le(t,"loop-body-unresolved"));return}let r=t.childForFieldName("condition"),a=F(r??t,"predicate",r?.text??R(t,o));E(e,a,F(o,"outcome","iteration"),"loop-iteration",{branchRole:"iteration"}),J(e,a,o,"iteration"),E(e,a,ae(a,"loop exits"),"loop-exit",{branchRole:"exit"})}function Ue(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),r=t.childForFieldName("value")??t.childForFieldName("condition")??t.childForFieldName("subject")??ue(t),a=We(o??t);if(!r||a.length===0){n.push(le(t,"switch-cases-unresolved"));return}let s=F(r,"predicate",r.text),l=!1;for(let c of a){let u=Xe(c);l||=u;let d=R(c,c.namedChildren.find(p=>Q(p)));E(e,s,F(c,"outcome",d||(u?"default":"case")),u?"predicate-default":"predicate-case",{branchRole:u?"default":"case"}),J(e,s,c,u?"default":"case")}l||E(e,s,ae(s,"no case matched"),"predicate-fallthrough",{branchRole:"fallthrough"})}function Ke(e,n){let t=F(n,"scope","try");for(let o of Ve(n)){let r=j.has(o.type),a=F(o,"handler",r?"finally":R(o,W(o)));E(e,t,a,r?"finally-cleanup":"exception-handler",{branchRole:r?"finally":"catch"}),Ge(e,a,o,r?"finally":"catch")}}function Ge(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"handler-throw":"handler-return",{branchRole:o,terminalKind:a})}}function J(e,n,t,o){for(let r of se(t)){let a=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,a==="throw"?"predicate-throw":"predicate-return",{branchRole:o,terminalKind:a})}}function E(e,n,t,o,r){e.push({controller:n,outcome:t,subtype:o,attributes:r})}function F(e,n,t){return{kind:n,label:q(t).slice(0,ie),startLine:e.startPosition.row,endLine:e.endPosition.row,implicit:!1}}function ae(e,n){return{...e,kind:"outcome",label:n,implicit:!0}}function Se(e){return ve.has(e.type)?"terminal":"outcome"}function se(e){let n=[];return ce(e,e,t=>{ve.has(t.type)&&n.push(F(t,"terminal",t.text))}),we(n)}function ce(e,n,t){t(n);for(let o of n.namedChildren)o!==e&&T.has(o.type)||ce(e,o,t)}function We(e){let n=[],t=o=>{for(let r of o.namedChildren)z.has(r.type)||(xe.has(r.type)?n.push(r):t(r))};return t(e),n}function Ve(e){let n=[],t=o=>{for(let r of o.namedChildren)H.has(r.type)||(X.has(r.type)||j.has(r.type)?n.push(r):T.has(r.type)||t(r))};return t(e),n}function Xe(e){let n=R(e,e.namedChildren.find(t=>Q(t))).trim();return e.type==="switch_default"||/^(?:default\b|_\s*=>)/u.test(n)}function le(e,n){return{startLine:e.startPosition.row,endLine:e.endPosition.row,reason:n}}function Je(e){let n=new Map;for(let t of e)n.set(`${t.controller.startLine}\0${t.controller.endLine}\0${t.outcome.startLine}\0${t.outcome.endLine}\0${t.subtype}\0${t.outcome.label}`,t);return[...n.values()]}function we(e){let n=new Map;for(let t of e)n.set(`${t.startLine}\0${t.endLine}\0${t.kind}\0${t.label}`,t);return[...n.values()]}function Qe(e){return T.has(e.type)||te.has(e.type)||z.has(e.type)||H.has(e.type)||X.has(e.type)||j.has(e.type)}function Le(e,n,t,o,r){let s=I(e,t,o)??e,l=W(s),c=[],u=0,d=0,p=(i,f,y,g,w=!1,D=!0)=>{let K=w?y.trim():q(y);if(!K)return;let A=Math.max(t,i.startPosition.row),fe=Math.min(o,i.endPosition.row);c.push({line:A,endLine:Math.max(A,fe),depth:f,signals:Z.filter(me=>g.includes(me)||me==="anchor"&&r.some(he=>he>=A&&he<=fe)),text:K,copied:w}),D&&(u+=1,w&&(d+=1))},N=(i,f)=>{for(let y of i.namedChildren)_(y,f)},b=(i,f)=>{if(Y.has(i.type)){h(i,f,"else if");return}if($.has(i.type)){let y=i.namedChildren.find(w=>Y.has(w.type));if(y){h(y,f,"else if");return}p(i,f,"else",["branch"],!1,!1);let g=W(i)??i.namedChildren.find(w=>B.has(w.type));if(g)_(g,f+1);else for(let w of i.namedChildren)_(w,f+1);return}p(i,f,"else",["branch"],!1,!1),_(i,f+1)},h=(i,f,y=i.type.startsWith("unless")?"unless":"if")=>{let g=i.childForFieldName("condition")??ue(i),w=i.childForFieldName("consequence")??i.childForFieldName("body")??i.namedChildren.find(A=>B.has(A.type)),D=i.childForFieldName("alternative")??i.namedChildren.find(A=>$.has(A.type)),K=g?g.text:R(i,w);p(i,f,`${y} ${nt(K)}`,k(g,["branch"])),w&&_(w,f+1),D&&b(D,f)},C=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["loop"])),y&&_(y,f+1)},x=(i,f)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,f,R(i,y),k(i,["branch"])),y&&_(y,f+1)},S=(i,f)=>{let y=i.namedChildren.find(g=>Q(g));p(i,f,R(i,y),["branch"],!1,!1);for(let g of i.namedChildren)(g===y||Q(g))&&_(g,f+1)},v=(i,f)=>{p(i,f,"try",[],!1);for(let y of i.namedChildren)B.has(y.type)?_(y,f+1):(X.has(y.type)||j.has(y.type))&&_(y,f)},m=(i,f,y)=>{let g=i.childForFieldName("body")??i.namedChildren.find(D=>B.has(D.type)),w=y==="finally"?"finally":R(i,g);p(i,f,w,[y],!1,!1),g&&_(g,f+1)},L=(i,f)=>{let y=W(i);p(i,f,R(i,y),k(i,["binding"])),y&&_(y,f+1)},_=(i,f)=>{if(i.startPosition.row>o||i.endPosition.row<t||qe.has(i.type)||i.type==="empty_statement")return;if(B.has(i.type)){N(i,f);return}if(Y.has(i.type)){h(i,f);return}if(te.has(i.type)){C(i,f);return}if(z.has(i.type)){x(i,f);return}if(xe.has(i.type)){S(i,f);return}if(H.has(i.type)){v(i,f);return}if(X.has(i.type)){m(i,f,"catch");return}if(j.has(i.type)){m(i,f,"finally");return}if($.has(i.type)){b(i,f);return}if(T.has(i.type)){L(i,f);return}let g=!Be(i)||rt(i);p(i,f,i.text,k(i),g)};return _(l&&l!==s?l:s,0),u===0?null:{constructKind:tt(s),signature:et(s,l,n,t),lines:c,sourceStatements:u,copiedStatements:d}}function I(e,n,t){let o=e.namedChildren.filter(r=>r.startPosition.row<=n&&r.endPosition.row>=t);for(let r of o.sort(Ze)){let a=I(r,n,t);if(a)return a}return T.has(e.type)&&e.startPosition.row<=n&&e.endPosition.row>=t?e:null}function Ze(e,n){return e.endPosition.row-e.startPosition.row-(n.endPosition.row-n.startPosition.row)||e.startPosition.row-n.startPosition.row}function W(e){return e.childForFieldName("body")??e.childForFieldName("consequence")??e.namedChildren.find(n=>B.has(n.type))??null}function et(e,n,t,o){let r=R(e,n);return r||(t[o]??e.text).trim()}function tt(e){return e.type.includes("constructor")?"constructor":e.type.includes("method")||e.type==="method"?re(e,new Set(["class_body","class_declaration","class_definition"]))?"class method":"object method":e.type==="arrow_function"||e.type==="function_expression"||e.type==="lambda"?re(e,new Set(["object","pair"]))?"object member":"function value":e.type.includes("function")?re(e,T)?"nested function":"module function":"source construct"}function re(e,n){let t=e.parent;for(;t;){if(n.has(t.type))return!0;t=t.parent}return!1}function ue(e){return e.namedChildren.find(n=>!B.has(n.type)&&!$.has(n.type))??null}function R(e,n){if(!n)return q(e.text);let t=Math.max(0,n.startIndex-e.startIndex);return q(e.text.slice(0,t)).replace(/[:{]\s*$/u,"").trim()}function nt(e){let n=q(e);return n.startsWith("(")&&n.endsWith(")")?n.slice(1,-1).trim():n}function q(e){return e.trim().replace(/\r?\n[\t ]*/gu," ")}function k(e,n=[]){let t=new Set(n);return e&&U(e,o=>{let r=ge[o.type];r&&t.add(r),o.type==="call_expression"&&(t.add("call"),Fe(o)&&t.add("shape")),de.has(o.type)&&t.add("binding")}),Z.filter(o=>t.has(o))}function rt(e){let n=!1;return U(e,t=>{n||!t.text.includes(`
2
2
  `)||/(?:string|template|heredoc|raw_string)/u.test(t.type)&&(n=!0)}),n}function Q(e){return B.has(e.type)||Y.has(e.type)||te.has(e.type)||z.has(e.type)||H.has(e.type)||T.has(e.type)||Be(e)}function Be(e){return/(?:statement|declaration|expression|assignment|return|throw|raise|break|continue|yield|with_item)$/u.test(e.type)||de.has(e.type)}function ot(e,n,t){let o=0;for(let r=n;r<=t;r+=1)o+=(e[r]?.length??0)+10;return o}function it(e){return e.constructKind.length+e.signature.length+80+e.lines.reduce((n,t)=>n+t.text.length+t.depth*2+10,0)}function Re(e,n,t,o,r,a){let s=P(e,n);if(!s)return null;let l=O(e,n),c=ne(e,n,t,o),u=a?c?.startLine??t:t,d=a?c?.endLine??o:o,N=(c?.startLine===u&&c.endLine===d?I(s.rootNode,u,d):null)??M(s.rootNode,u,d);if(!N)return null;let b=new Map,h=new Map,C=new Map,x=(m,L)=>{if(m<u||m>d)return;let _=b.get(m)??new Set;_.add(L),b.set(m,_)};c&&x(c.startLine,"signature");for(let m of r)x(m,"anchor");U(N,m=>{let L=ge[m.type];if(L&&x(m.startPosition.row,L),L==="shape"&&at(h,m,N,u,d),m.type==="call_expression"){let i=(m.childForFieldName("function")??m.namedChild(0))?.text.split(".").at(-1);if(Fe(m)){x(m.startPosition.row,"shape");let f=V(m.text);f.length<=oe&&C.set(m.startPosition.row,f)}if(i&&Ye.has(i)){x(m.startPosition.row,"lifecycle");let f=V(m.text);f.length<=oe&&C.set(m.startPosition.row,f)}}de.has(m.type)&&x(m.startPosition.row,"binding")});let S=G(e,n);for(let m of S?.callSites??[])m.line<u||m.line>d||(x(m.line,"call"),m.calleeLeaf==="catch"&&x(m.line,"catch"));let v=[...b.entries()].sort(([m],[L])=>m-L).map(([m,L])=>({line:m,signals:Ce.filter(_=>L.has(_)),text:C.get(m)??V(l[m]??"")})).filter(m=>m.text.length>0||m.signals.includes("anchor"));return{...c?{callable:c}:{},rangeStart:u,rangeEnd:d,sourceLines:l,candidates:v,shapes:[...h.values()].sort((m,L)=>m.startLine-L.startLine)}}function at(e,n,t,o,r){if(n.startPosition.row<o||n.endPosition.row>r)return;let a=n.childForFieldName("key")??n.childForFieldName("name")??n.namedChild(0),s=V(a?.text??"");if(!s||s.includes(`
3
3
  `)||s.length>60)return;let l=st(n,t);if(l.startPosition.row<o||l.endPosition.row>r)return;let c=`${l.startPosition.row}:${l.endPosition.row}`,u=e.get(c)??{startLine:l.startPosition.row,endLine:l.endPosition.row,fields:[]};u.fields.some(d=>d.name===s&&d.line===n.startPosition.row)||u.fields.push({name:s,line:n.startPosition.row}),e.set(c,u)}function st(e,n){let t=e.parent;for(;t&&t!==n.parent;){if(Ne.has(t.type))return t;if(t===n)break;t=t.parent}return e.parent??e}function ne(e,n,t,o){return G(e,n)?.callables.filter(r=>r.startLine<=t&&r.endLine>=o).sort((r,a)=>r.endLine-r.startLine-(a.endLine-a.startLine)||r.startLine-a.startLine)[0]}function U(e,n){n(e);for(let t of e.namedChildren)U(t,n)}function Ee(e,n,t,o){o(e);for(let r of e.namedChildren)r.startPosition.row>n||r.endPosition.row<t||Ee(r,n,t,o)}function V(e){return e.trim().replace(/\s+/gu," ")}function Fe(e){if(e.type!=="call_expression")return!1;let n=e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"||o.type==="argument_list");if(!n)return!1;let t=!1;return U(n,o=>{Ne.has(o.type)&&(t=!0)}),t}function ct(e){let n={};for(let t of Ce){let o=e.filter(r=>r.signals.includes(t)).length;o>0&&(n[t]=o)}return n}function lt(e,n){let t=new Map;for(let a of e){let s=a.signals.join(",");t.set(s,(t.get(s)??0)+1)}let o=new Set(_e),r=a=>{let s=t.get(a.signals.join(","))??1,l=Math.min(...a.signals.map(d=>n[d]??1)),c=a.signals.some(d=>o.has(d))?3:1,u=Math.max(0,a.signals.length-1)*1e3;return c*(1e3/s+1e3/l)+u};return[...e].sort((a,s)=>r(s)-r(a)||s.line-a.line)}var de=new Set(["lexical_declaration","variable_declarator","const_item","static_item","let_declaration","assignment"]);function ut(e,n,t){let o=[],r=/\b(?:describe|it|test)(?:\.(?:only|skip|todo))?\s*\(\s*(['"`])([^'"`]+)\1/u;for(let a=n;a<=t;a+=1){let s=r.exec(e[a]??"")?.[2];if(!(!s||o.includes(s))&&(o.push(s),o.length>=Oe))break}return o}var dt=new Set(["arrow_function","class_declaration","constructor_declaration","field_definition","function_declaration","function_definition","function_expression","function_item","generator_function_declaration","generator_function","lexical_declaration","method","method_declaration","method_definition","object_method","variable_declaration"]);function ft(e,n,t){let o=P(e,n)?.rootNode??null,r=mt(o,t);if(!r)return null;let a=O(e,n);if(a.length===0)return null;let s=Math.max(0,r.startPosition.row),l=r.endPosition.column===0?r.endPosition.row-1:r.endPosition.row;return{type:r.type,startLine:s,endLine:Math.min(a.length-1,Math.max(s,l))}}function Et(e,n,t,o,r){let a=ee(e,n,o,r,[t]),s=a.startLine===a.endLine&&/(?:=>|\(|\{|\[|,)\s*$/u.test(O(e,n)[a.startLine]??"");if(!s&&(a.startLine>o||a.endLine<r))return a;let l=ft(e,n,t);return s&&l?{startLine:l.startLine,endLine:l.endLine}:l&&l.startLine>=o&&l.endLine<=r?{startLine:l.startLine,endLine:l.endLine}:{startLine:o,endLine:r}}function mt(e,n){if(!e||!Ae(e,n))return null;let t=Te(e,n);for(;t;){if(dt.has(t.type))return t;t=t.parent}return null}function Te(e,n){let t=e.namedChildren.filter(o=>Ae(o,n)).sort((o,r)=>Pe(o)-Pe(r));return t.length>0?Te(t[0],n):e}function Ae(e,n){return e.startPosition.row<=n&&e.endPosition.row>=n}function Pe(e){return e.endIndex-e.startIndex}export{Ct as a,_t as b,Nt as c,ee as d,xt as e,vt as f,ft as g,Et as h};
4
- //# sourceMappingURL=chunk-RNKPYYYE.js.map
4
+ //# sourceMappingURL=chunk-HAXXKRTD.js.map
@@ -0,0 +1,2 @@
1
+ import{c as q}from"./chunk-2BMSSRBH.js";import{a as z}from"./chunk-BJWFVAA5.js";import{e as L,h as F,l as K,m as B,n as E}from"./chunk-YSYPDRD5.js";import{o as w}from"./chunk-SKKXTABJ.js";import{d as M}from"./chunk-C7C6AKAT.js";import{n as h}from"./chunk-RBAD4GJ2.js";import{A as y}from"./chunk-ZLMXIQLC.js";function ue(e,n={}){let{samples:i=50,scope:s,maxDisagreements:u=5}=n,c=new q(e),d=Z(c.productionCallableDefinitions({scope:s,minLoc:2,requireFunctionLikeSymbol:!0}),i),a=$(e,d);if(d.length===0||!a)return{available:!1,sampleSize:d.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:v(),callees:v(),renders:v()},l=[],m=0,p=a==="semantic"?K(e,d):new Map,f=a==="semantic"?E(e,d):new Map,S=a==="semantic"?B(e):null,x=o=>S===null||S(o)!==null,N=(o,g)=>S===null||S(g)===S(o.relativePath),T=a==="source"?oe(e,c,d):null;for(let o of d){let g=b(o,a==="semantic"?F(e,o).map(r=>r.file):[...T?.referencesBySymbolId.get(o.symbolId)??[]]),P=a==="semantic"?p.get(o.symbolId)??[]:[...T?.calleesBySymbolId.get(o.symbolId)??[]].map(r=>({file:r})),V=b(o,P.filter(r=>r.kind!=="jsx-render").map(r=>r.file)),G=b(o,P.filter(r=>r.kind==="jsx-render").map(r=>r.file));m+=1;let H=b(o,w(e,o,{semanticEvidence:z}).map(r=>r.file)),A=c.calleeMap([o],{semantic:!1}).get(o.symbolId)??[];for(let r of A){let k=(r.kind==="jsx-render"?t.renders:t.callees).sources;k[r.source]=(k[r.source]??0)+1}let J=b(o,A.filter(r=>r.kind!=="jsx-render").map(r=>r.file)),U=b(o,A.filter(r=>r.kind==="jsx-render").map(r=>r.file)),j=ne(e,o),Q=f.get(o.symbolId),R=Q!==void 0&&Q.unresolved===0,W=D(a,"references"),X=D(a,"callees")||R||j.calls===0,Y=D(a,"renders")||R||j.renders===0;C(t.references,o,"references",H,g,W,l,r=>N(o,r)),C(t.callees,o,"callees",J,V,X,l,x),C(t.renders,o,"renders",U,G,Y,l,x)}return l.sort((o,g)=>g.cheapOnly.length+g.oracleOnly.length-(o.cheapOnly.length+o.oracleOnly.length)),{available:!0,sampleSize:d.length,oracleCoverage:d.length>0?O(m/d.length):0,oracleKind:a,scores:["references","callees","renders"].map(o=>te(o,t[o],a)),topDisagreements:l.slice(0,u)}}function v(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0,completeSymbols:0,completeCheapTotal:0,completeAgreed:0,outsideCoverage:0,sources:{}}}function Z(e,n){let i=[...e].sort((c,d)=>c.symbolId-d.symbolId);if(i.length<=n)return i;let s=i.length/n,u=[];for(let c=0;c<n;c++)u.push(i[Math.floor(c*s)]);return u}function $(e,n){let i=n[0];if(!i)return null;if(I(e,i))return"source";try{if(L(e).capability("semantic-references",i.relativePath).available)return"semantic"}catch{}return n.some(s=>I(e,s))?"source":null}function b(e,n){let i=new Set;for(let s of n)s!==e.relativePath&&i.add(s);return i}function C(e,n,i,s,u,c,d,a=()=>!0){if(!c&&u.size===0){e.skippedOraclePartial+=1;return}let t=[...s].filter(f=>!u.has(f)&&!a(f));e.outsideCoverage+=t.length;let l=s.size-t.length;e.comparedSymbols+=1,e.cheapTotal+=l,e.oracleTotal+=u.size,c&&(e.completeSymbols+=1,e.completeCheapTotal+=l);let m=[],p=[];for(let f of s)u.has(f)?(e.agreed+=1,c&&(e.completeAgreed+=1)):a(f)&&m.push(f);for(let f of u)s.has(f)||p.push(f);(m.length>0||p.length>0)&&d.push({symbol:M(n.symbol),question:i,cheapOnly:m,oracleOnly:p})}var ee={references:!0,callees:!1,renders:!1};function ne(e,n){let i=h(e,n.relativePath),s=0,u=0;for(let c of i?.callSites??[])c.line<n.startLine||c.line>n.endLine||(c.kind==="jsx-render"?u+=1:s+=1);return{calls:s,renders:u}}function te(e,n,i){let s=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.completeCheapTotal>0?O(n.completeAgreed/n.completeCheapTotal):null,c=n.cheapTotal-n.agreed-(n.completeCheapTotal-n.completeAgreed);return{question:e,comparedSymbols:n.comparedSymbols,precision:u,recall:O(s),unverified:c,skippedOraclePartial:n.skippedOraclePartial,completeOracleSymbols:n.completeSymbols,outsideOracleCoverage:n.outsideCoverage,cheapSources:n.sources}}function D(e,n){return e==="semantic"?ee[n]:!1}function I(e,n){return y(n.relativePath)==="clojure"&&h(e,n.relativePath)!==null}function oe(e,n,i){let s=new Map,u=new Map,c=i.filter(t=>I(e,t)),d=new Map;for(let t of c){let l=d.get(t.leaf)??[];l.push(t),d.set(t.leaf,l)}for(let t of n.sourceFiles()){if(y(t)!=="clojure")continue;let l=h(e,t);if(l)for(let m of l.fileIdentifiers)for(let p of d.get(m)??[])_(s,p.symbolId,t)}let a=new Map;for(let t of n.scopedDefinitions()){if(y(t.relativePath)!=="clojure")continue;let l=a.get(t.leaf)??[];l.push(t),a.set(t.leaf,l)}for(let t of c){let l=h(e,t.relativePath);if(l){for(let m of l.callSites)if(!(m.line<t.startLine||m.line>t.endLine))for(let p of a.get(m.calleeLeaf)??[])_(u,t.symbolId,p.relativePath)}}return{referencesBySymbolId:s,calleesBySymbolId:u}}function _(e,n,i){let s=e.get(n);if(s){s.add(i);return}e.set(n,new Set([i]))}function O(e){return Math.round(e*1e3)/1e3}export{ue as a};
2
+ //# sourceMappingURL=chunk-HEZWBAZY.js.map
@@ -0,0 +1,2 @@
1
+ import{e as Q,m as X,v as P,x as I}from"./chunk-RMDPFPNW.js";import{a as L,b as G,d as R}from"./chunk-CKBUBRYD.js";import{a as d,f as w,g as B,h as p}from"./chunk-H5EXS3HM.js";import{H,I as W,U as Y,c as O,ca as J,e as q,ea as K,ha as z,r as U}from"./chunk-7HXT6YLU.js";import{a as V,g as F,h as S}from"./chunk-7F45LJKI.js";import{existsSync as Re}from"fs";import{randomUUID as ze}from"crypto";import{isAbsolute as Xe,join as Pe,relative as Ze,resolve as et}from"path";var f=1,m=2,ue="./node_modules/scip-query/docs/schemas/project-config.schema.json";function Z(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(c){return{kind:"malformed",reason:`invalid JSON: ${c instanceof Error?c.message:String(c)}`}}if(!d(t))return{kind:"malformed",reason:"project config must be a JSON object"};let n=t.schemaVersion;if(n!==void 0&&!Number.isInteger(n))return{kind:"malformed",reason:"schemaVersion must be an integer"};let r=n===void 0?f:n;if(r!==f&&r!==m)return{kind:"unsupported",schemaVersion:r,direction:r<f?"older":"future"};let s=t.$schema;if(s!==void 0&&(typeof s!="string"||s.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let i=ee(t),a=r!==m||typeof t.$schema!="string";return r===f?{kind:"legacy",sourceVersion:f,config:i,needsMigration:a}:{kind:"supported",sourceVersion:m,config:i,needsMigration:a}}function ee(e){let t=e,{$schema:n,schemaVersion:r,...s}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:ue,schemaVersion:m,...s}}import{createHash as pe}from"crypto";var k=1,te=2,ne=1,_=1,E="sha256";function Be(e,t,n){if(!p(e)||!w(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:ne,canonicalizationVersion:_,hashAlgorithm:E,projection:{name:e,version:t},digest:pe(E).update(le(e,t,n)).digest("hex")}}function le(e,t,n){return`{"canonicalizationVersion":${_},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function fe(e){if(!d(e))return{kind:"malformed",reason:"observation receipt must be an object"};let t=e.schemaVersion;if(!Number.isInteger(t))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(t===k)return ge(e)?{kind:"legacy",schemaVersion:k,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===te)return he(e)?{kind:"supported",schemaVersion:te,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<k?"older":"future"}}function re(e){let t=fe(e);return t.kind==="legacy"||t.kind==="supported"}function me(e,t){return e.schemaVersion===t.schemaVersion&&e.canonicalizationVersion===t.canonicalizationVersion&&e.hashAlgorithm===t.hashAlgorithm&&e.projection.name===t.projection.name&&e.projection.version===t.projection.version}function ge(e){if(!d(e))return!1;let t=e.index,n=e.worktree;return oe(e.observedAt)&&p(e.projectIdentity)&&Oe(e.authorityKind)&&(t===void 0||d(t)&&p(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||d(n)&&p(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||p(n.headCommit))&&(n.treeOid===void 0||p(n.treeOid)))&&Se(e.authorityKind,t,n)}function he(e){if(!d(e))return!1;let t=e.facts,n=e.observedSources,r=e.stabilityProofs;if(!oe(e.observedAt)||!d(t)||!Array.isArray(n)||n.length===0||!n.every(be)||!A(n,o=>o.kind)||!Array.isArray(r)||!r.every(ve)||!A(r,o=>o.source)||r.some(o=>!n.some(u=>u.kind===o.source))||!r.every(o=>xe(o,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(o=>t[o]!==void 0&&!l(t[o])))return!1;let i=t.relevantInputs;if(i!==void 0&&(!Array.isArray(i)||!i.every(ye)||!A(i,o=>`${o.subject}\0${o.identity.projection.name}`)))return!1;let a=t.index;if(a!==void 0&&(!d(a)||!l(a.generation)||a.inputs!==void 0&&!l(a.inputs)||a.source!=="immutable"&&a.source!=="legacy"))return!1;let c=e.diagnostics;return(c===void 0||d(c)&&(c.clean===void 0||typeof c.clean=="boolean")&&(c.headCommit===void 0||p(c.headCommit))&&(c.treeOid===void 0||p(c.treeOid)))&&Ce(t,n)}function l(e){return!d(e)||!d(e.projection)?!1:e.schemaVersion===ne&&e.canonicalizationVersion===_&&e.hashAlgorithm===E&&p(e.projection.name)&&w(e.projection.version)&&B(e.digest)}function ye(e){return d(e)&&p(e.subject)&&l(e.identity)}function be(e){return d(e)&&ie(e.kind)&&(e.identity===void 0||l(e.identity))}function ve(e){return d(e)&&ie(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,t){let n=e.index,r=t.find(o=>o.kind==="index-generation");if(r){if(!d(n)||!l(n.generation)||r.identity&&!j(r.identity,n.generation))return!1}else if(n!==void 0)return!1;let s=e.workspaceInstance,i=t.find(o=>o.kind==="live-workspace");if(i?.identity&&(!l(s)||!j(i.identity,s)))return!1;let a=e.wholeContent,c=t.find(o=>o.kind==="repository-snapshot");return!(c?.identity&&(!l(a)||!j(c.identity,a)))}function xe(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&d(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function j(e,t){return me(e,t)&&e.digest===t.digest}function Se(e,t,n){return e==="index-worktree"?t!==void 0&&n!==void 0:e==="index-only"?t!==void 0&&n===void 0:e==="worktree-only"?t===void 0&&n!==void 0:e==="process-local"&&t===void 0&&n===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function ie(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function oe(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function A(e,t){return new Set(e.map(t)).size===e.length}function He(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.kind==="automated-adjudication"&&t.policyVersion===1&&(t.decidedBy==="agent"||t.decidedBy==="human")&&G.includes(t.reasonCode)&&Array.isArray(t.evidence)&&t.evidence.length>0&&t.evidence.every(we)&&(t.observation===void 0||re(t.observation))&&!!t.invalidateOn&&typeof t.invalidateOn=="object"&&typeof t.invalidateOn.targetContentChange=="boolean"&&typeof t.invalidateOn.detectorMajorChange=="boolean"}function we(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="source"||t.kind==="config"||t.kind==="test"||t.kind==="graph")&&typeof t.referent=="string"&&t.referent.trim()!==""&&typeof t.claim=="string"&&t.claim.trim()!==""&&(t.contentHash===void 0||/^[a-f0-9]{64}$/u.test(t.contentHash))&&(t.generation===void 0||typeof t.generation=="string"&&t.generation.length>0)}var h=".scipquery.json",Ie=2e3,se=5e3,ae=se,ke=15*6e4,ce={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},je={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:Ie,cooldownMs:ae,gitPollMs:2e3,idleTimeoutMs:ke,autoRefresh:!0,ignore:[],resourceBudget:ce};var it=new Set(L);function ot(e){let t=Pe(e,h);if(!Re(t))return{};let n;try{n=F(t,{maxBytes:V,inputKind:"scip-query project config"})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${h} at ${t}: ${s}`,{cause:r})}return Ae(Z(n),t,"read").config}function st(e){return{...je,...e.watch,cooldownMs:Math.max(se,e.watch?.cooldownMs??ae),resourceBudget:{...ce,...e.watch?.resourceBudget}}}function Ae(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let s=n==="read"?`invalid ${h} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${s} The file was left untouched.`)}let r=n==="read"?`invalid ${h} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${f} and current v${m}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as y,lstatSync as Ee}from"fs";import{resolve as _e}from"path";function xt(e,t,n,r={}){let s=new Date().toISOString();if(!y(n.dbPath))return{state:"missing",checkedAt:s,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(n.metaPath))return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let i=R(S(n.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: scip-query reindex"};let a=i.metadata,c=t.languages??Q(e),o=a.fingerprint,u=n.cacheDir&&r.gitContext&&I(r.gitContext,n.cacheDir,o)?o:void 0,g=n.cacheDir&&r.gitContext&&u&&Ne(u,c,t)&&Te(e,u,t)?r.gitObservation?.context===r.gitContext?r.gitContext:H(r.gitContext):void 0,de=r.gitObservation&&r.gitObservation.context===r.gitContext?r.gitObservation.projectFileInventorySequence:void 0,M=g?.clean&&W(e,void 0,{cachedInventoryAfterSequence:de})?g:void 0,b=n.cacheDir&&M&&u&&I(M,n.cacheDir,u)?u:Me(e,c,t),N=[...a.indexedLanguages??[]].sort(),v=i.capabilities.publishableGeneration&&q(O(a.fingerprint),b)&&JSON.stringify(N)===JSON.stringify(b.languages),C=P(n.dbPath,n.metaPath),T=C.state==="invalid"||C.state==="drifted",x=v?X(n.dbPath,b,N):void 0,$=x?.state==="incomplete",D=v&&!T&&!$;return{state:D?"fresh":"stale",checkedAt:s,metaPath:n.metaPath,updatedAt:a.updatedAt,lastRefresh:a.lastRefresh,reason:T?`SQLite generation requires repair: ${C.reason}`:$?`SQLite generation is missing ${x.missingDocumentCount} indexed source document(s): ${x.missingPaths.join(", ")}`:v?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:D?void 0:"Run: scip-query reindex"}}catch(i){return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: scip-query reindex"}}}function St(e){let t=new Date().toISOString();if(!y(e.dbPath))return{state:"missing",checkedAt:t,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(e.metaPath))return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let n=R(S(e.metaPath,"reindex metadata"));if(n.kind==="unsupported")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Reindex metadata version ${n.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(n.kind==="malformed")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${n.reason}`,remedy:"Run: scip-query reindex"};let r=n.metadata,s=[...r.indexedLanguages??[]].sort(),i=O(r.fingerprint),a=[...i?.languages??[]].sort(),c=n.capabilities.publishableGeneration&&i!==null&&JSON.stringify(s)===JSON.stringify(a),o=P(e.dbPath,e.metaPath),u=o.state==="invalid"||o.state==="drifted",g=c&&!u;return{state:g?"fresh":"stale",checkedAt:t,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:u?`SQLite generation requires repair: ${o.reason}`:c?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:g?void 0:"Run: scip-query reindex"}}catch(n){return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${n instanceof Error?n.message:String(n)}`,remedy:"Run: scip-query reindex"}}}function Me(e,t,n){return K(e,t,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}function Ne(e,t,n){let r=$e(t,n);return e.version===r.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(r.languages)&&e.pnpmWorkspaces===r.pnpmWorkspaces&&e.typescriptProjectMode===r.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(r.typescriptProjects)&&e.clojureConfigPath===r.clojureConfigPath}function Te(e,t,n){if(!(t.languages.includes("typescript")||!!t.clojureConfigPath))return!0;let s=J(e);if(t.clojureConfigPath){let i=U(t.clojureConfigPath);if(!s.includes(i))return!1;try{if(!Ee(_e(e,i)).isFile())return!1}catch{return!1}}return!t.languages.includes("typescript")||Y(e,n.indexer?.typescript?.projectMode,n.indexer?.typescript?.projects??[],s)}function $e(e,t){return z(e,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath})}export{te as a,Be as b,He as c,ot as d,st as e,xt as f,St as g};
2
+ //# sourceMappingURL=chunk-HMEWLMML.js.map
@@ -1,4 +1,4 @@
1
- import{a as S}from"./chunk-ERCYGVAM.js";import{c as y}from"./chunk-PLYUVM4F.js";import{h as v}from"./chunk-PBUH2P5S.js";import{a as R,b as k,j as b}from"./chunk-BECZLYNU.js";import{b as C}from"./chunk-Q6T2CAJL.js";import{d as h}from"./chunk-TD7VKJ2Y.js";import{c as m,xa as f,ya as g}from"./chunk-GH5YSGZL.js";function _(e,a){let n=m(a),t=[],r="complete",o=C(n);o==="entry"&&s(t,"operational-root","structural entrypoint path"),o==="worker"&&s(t,"operational-root","worker launch convention"),b(n)&&s(t,"operational-root","framework-discovered entrypoint"),L(e,n)&&s(t,"operational-root","configured entry root");let l=!1;try{l=R(e,n),l&&s(t,"published-api","package manifest export");for(let i of k(e,n))s(t,"operational-root",i)}catch(i){r="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${x(i)}`)}try{let i=f(e.config.projectRoot,n,{maxBytes:8388608,inputKind:"change-surface source"});w(i)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(i){r="partial",s(t,"metadata-unavailable",g(i)?"indexed source file is unavailable on disk":`source metadata unavailable: ${x(i)}`)}return{operationalRoot:t.some(i=>i.kind==="operational-root"),publishedApi:l,coverage:r,reasons:t}}function L(e,a){let n=e.config.entryRoots;return n?n.files?.some(t=>m(t)===a)?!0:n.pathPrefixes?.some(t=>a.startsWith(m(t)))??!1:!1}function w(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,a,n){e.some(t=>t.kind===a&&t.detail===n)||e.push({kind:a,detail:n})}function x(e){return e instanceof Error?e.message:String(e)}function q(e,a,n={}){let t=S(e,a);if(!t)return null;let r=D(e,t);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,i=M(e,r.relative_path),p=_(e,r.relative_path),F=n.semantic===!1?new Map:v(e,i);for(let u of i){let c=I(e,r,u,F.get(u.symbolId)??new Set);l+=c;let d=N(c),E=[...p.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];o.push({symbol:u.symbol,shortName:h(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:c,externalConsumerRiskLevel:d,riskLevel:P(d,p),riskReasons:E})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l,fileRisk:p}}function D(e,a){return e.get(`SELECT id, relative_path FROM documents
1
+ import{a as S}from"./chunk-NSM5IEVW.js";import{c as y}from"./chunk-2BMSSRBH.js";import{i as v}from"./chunk-YSYPDRD5.js";import{a as R,b as k,j as b}from"./chunk-NJQISBL4.js";import{b as C}from"./chunk-FLMTCX5R.js";import{d as h}from"./chunk-C7C6AKAT.js";import{Ba as f,Ca as g,c as m}from"./chunk-JZ2A7LDM.js";function _(e,a){let n=m(a),t=[],r="complete",o=C(n);o==="entry"&&s(t,"operational-root","structural entrypoint path"),o==="worker"&&s(t,"operational-root","worker launch convention"),b(n)&&s(t,"operational-root","framework-discovered entrypoint"),L(e,n)&&s(t,"operational-root","configured entry root");let l=!1;try{l=R(e,n),l&&s(t,"published-api","package manifest export");for(let i of k(e,n))s(t,"operational-root",i)}catch(i){r="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${x(i)}`)}try{let i=f(e.config.projectRoot,n,{maxBytes:8388608,inputKind:"change-surface source"});w(i)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(i){r="partial",s(t,"metadata-unavailable",g(i)?"indexed source file is unavailable on disk":`source metadata unavailable: ${x(i)}`)}return{operationalRoot:t.some(i=>i.kind==="operational-root"),publishedApi:l,coverage:r,reasons:t}}function L(e,a){let n=e.config.entryRoots;return n?n.files?.some(t=>m(t)===a)?!0:n.pathPrefixes?.some(t=>a.startsWith(m(t)))??!1:!1}function w(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,a,n){e.some(t=>t.kind===a&&t.detail===n)||e.push({kind:a,detail:n})}function x(e){return e instanceof Error?e.message:String(e)}function q(e,a,n={}){let t=S(e,a);if(!t)return null;let r=D(e,t);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,i=M(e,r.relative_path),p=_(e,r.relative_path),F=n.semantic===!1?new Map:v(e,i);for(let u of i){let c=I(e,r,u,F.get(u.symbolId)??new Set);l+=c;let d=N(c),E=[...p.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];o.push({symbol:u.symbol,shortName:h(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:c,externalConsumerRiskLevel:d,riskLevel:P(d,p),riskReasons:E})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l,fileRisk:p}}function D(e,a){return e.get(`SELECT id, relative_path FROM documents
2
2
  WHERE relative_path = ?
3
3
  ${e.pathExclusionsFor("documents")}
4
4
  LIMIT 1`,a)??null}function M(e,a){return new y(e).definitionsForFile(a).sort((n,t)=>n.startLine-t.startLine||n.endLine-t.endLine)}function I(e,a,n,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
@@ -8,4 +8,4 @@ import{a as S}from"./chunk-ERCYGVAM.js";import{c as y}from"./chunk-PLYUVM4F.js";
8
8
  WHERE m.symbol_id = ?
9
9
  AND m.role != 1
10
10
  AND c.document_id != ?`,n.symbolId,a.id);return new Set([...r.map(o=>o.relative_path),...[...t].filter(o=>o!==a.relative_path)]).size}function N(e){return e>10?"high":e>0?"medium":"low"}function P(e,a){return e==="high"?"high":e==="medium"||a.operationalRoot||a.publishedApi||a.coverage==="partial"?"medium":"low"}export{q as a};
11
- //# sourceMappingURL=chunk-2KVU55CW.js.map
11
+ //# sourceMappingURL=chunk-HOBOVYPO.js.map
@@ -1,8 +1,8 @@
1
- import{a as B,c as D,i as L,k as H}from"./chunk-BDHFVH2M.js";import{j as E,o as T}from"./chunk-6VEFRPTD.js";import{d as A}from"./chunk-KMVGRIO2.js";import{c as _}from"./chunk-PLYUVM4F.js";import{d as C,e as y}from"./chunk-TD7VKJ2Y.js";import{a as N}from"./chunk-42W3LFUK.js";var J=5;function se(e,n={}){let{base:i="HEAD",minContainment:r=.7,minCallees:s=3,minSiteCoverage:t=.4,maxHelpers:m=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:d}=n,g=n.semantic!==!1,l=n.diffPlan??D(e,{base:i}),a={available:l.note!==B,base:i,changedFiles:l.changedFiles,helpersChecked:0,skipped:[],findings:[],...l.note?{note:l.note}:{}};if(!a.available||l.changedFiles.length===0)return a;let v=new _(e),x=new Set(l.changedFiles),j=new Map(l.renamedFiles.map(o=>[o.to,o.from]));if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");let $=n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Q(n.baseContentAt):L({projectRoot:e.config.projectRoot,base:i,preloadPaths:H(l)}),f=Z(v,x,j,$);if(f.unavailable)return a.available=!1,a.note=`Base content unavailable: ${f.unavailable.reason}`,a;if(f.definitions.length===0)return a;let k=f.definitions.slice(0,m);f.definitions.length>m&&(a.note=`helper scoring capped at ${m} of ${f.definitions.length} new symbols`);let z=v.calleeMap(k,{semantic:g}),q=k.map(o=>({def:o,callees:T((z.get(o.symbolId)??[]).map(p=>p.symbol))})),V=E(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,s),scanLimit:d,semantic:g}),M);for(let{def:o,callees:p}of q){let u=C(o.symbol);if(p.size<s){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:`fewer than ${s} meaningful callees \u2014 too small to score`});continue}let P=G(),w=Y(p,P);if(w===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let S=ee(e,o.symbolId);if(S.length===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}a.helpersChecked+=1;let I=K({candidateIndex:P,changed:x,helperCallees:p,helperFile:o.relativePath,helperSymbol:o.symbol,minContainment:r,minSiteCoverage:t,migratedFiles:S});I.length!==0&&(I.sort((h,b)=>O(b.migrationScope)-O(h.migrationScope)||b.containment-h.containment||b.siteCoverage-h.siteCoverage||h.file.localeCompare(b.file)),a.findings.push({helperSymbol:o.symbol,helperShortName:u,helperFile:o.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:w,migratedFiles:S.sort(),leftovers:I.slice(0,J)}))}return a.findings.sort((o,p)=>(p.leftovers[0]?.containment??0)-(o.leftovers[0]?.containment??0)||o.helperFile.localeCompare(p.helperFile)),a.findings=a.findings.slice(0,c),a}function K(e){let n=[],i=U(e.helperSymbol,e.helperFile,e.migratedFiles),r=new Set;for(let s of e.helperCallees)for(let t of e.candidateIndex.candidateIndexesByCallee.get(s)??[])r.add(t);for(let s of r){let t=e.candidateIndex.corpus[s];if(t.symbol===e.helperSymbol||e.changed.has(t.file)||t.callees.has(e.helperSymbol))continue;let m=A(e.helperCallees,t.callees);if(m<e.minContainment)continue;let c=[...e.helperCallees].filter(l=>t.callees.has(l)),d=t.callees.size===0?0:c.length/t.callees.size;if(d<e.minSiteCoverage||!c.some(l=>(e.candidateIndex.docFreq.get(l)??0)<=e.candidateIndex.ubiquityThreshold))continue;let g=W(i,t.symbol,t.file);n.push({symbol:t.symbol,shortName:C(t.symbol),file:t.file,...g,containment:m,siteCoverage:d,uniqueSiteCalleeCount:Math.max(0,t.callees.size-c.length),sharedCallees:c.map(C).sort()})}return n}function O(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,n,i){let r=new Set([...F(n),...R(y(e))]);for(let s of i)for(let t of F(s))r.add(t);return r}function W(e,n,i){let r=new Set([...F(i),...R(y(n))]);if(e.size===0||r.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let s=[...r].filter(t=>e.has(t)).sort();return s.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${s.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function F(e){return R(e.replace(/\.[^.]+$/,""))}function R(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!X.has(n))}function Y(e,n){let i=0;for(let r of e)(n.docFreq.get(r)??0)<=n.ubiquityThreshold&&(i+=1);return i}function Z(e,n,i,r){let s=[];for(let t of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(t.relativePath))continue;let m=i.get(t.relativePath)??t.relativePath,c=r(m);if(c.state==="unavailable")return{definitions:[],unavailable:c};(c.state==="absent"||!new RegExp(`\\b${N(t.leaf)}\\b`).test(c.content))&&s.push(t)}return{definitions:s}}function Q(e){return n=>{let i=e(n);return i===null?{state:"absent"}:{state:"present",content:i}}}function ee(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
1
+ import{a as B,c as D,i as L,k as H}from"./chunk-DBN7DMJB.js";import{j as E,o as T}from"./chunk-ZFVPWH62.js";import{d as A}from"./chunk-KMVGRIO2.js";import{c as _}from"./chunk-2BMSSRBH.js";import{d as C,e as y}from"./chunk-C7C6AKAT.js";import{a as N}from"./chunk-RBAD4GJ2.js";var J=5;function se(e,n={}){let{base:i="HEAD",minContainment:r=.7,minCallees:s=3,minSiteCoverage:t=.4,maxHelpers:m=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:d}=n,g=n.semantic!==!1,l=n.diffPlan??D(e,{base:i}),a={available:l.note!==B,base:i,changedFiles:l.changedFiles,helpersChecked:0,skipped:[],findings:[],...l.note?{note:l.note}:{}};if(!a.available||l.changedFiles.length===0)return a;let v=new _(e),x=new Set(l.changedFiles),j=new Map(l.renamedFiles.map(o=>[o.to,o.from]));if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");let $=n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Q(n.baseContentAt):L({projectRoot:e.config.projectRoot,base:i,preloadPaths:H(l)}),f=Z(v,x,j,$);if(f.unavailable)return a.available=!1,a.note=`Base content unavailable: ${f.unavailable.reason}`,a;if(f.definitions.length===0)return a;let k=f.definitions.slice(0,m);f.definitions.length>m&&(a.note=`helper scoring capped at ${m} of ${f.definitions.length} new symbols`);let z=v.calleeMap(k,{semantic:g}),q=k.map(o=>({def:o,callees:T((z.get(o.symbolId)??[]).map(p=>p.symbol))})),V=E(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,s),scanLimit:d,semantic:g}),M);for(let{def:o,callees:p}of q){let u=C(o.symbol);if(p.size<s){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:`fewer than ${s} meaningful callees \u2014 too small to score`});continue}let P=G(),w=Y(p,P);if(w===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let S=ee(e,o.symbolId);if(S.length===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}a.helpersChecked+=1;let I=K({candidateIndex:P,changed:x,helperCallees:p,helperFile:o.relativePath,helperSymbol:o.symbol,minContainment:r,minSiteCoverage:t,migratedFiles:S});I.length!==0&&(I.sort((h,b)=>O(b.migrationScope)-O(h.migrationScope)||b.containment-h.containment||b.siteCoverage-h.siteCoverage||h.file.localeCompare(b.file)),a.findings.push({helperSymbol:o.symbol,helperShortName:u,helperFile:o.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:w,migratedFiles:S.sort(),leftovers:I.slice(0,J)}))}return a.findings.sort((o,p)=>(p.leftovers[0]?.containment??0)-(o.leftovers[0]?.containment??0)||o.helperFile.localeCompare(p.helperFile)),a.findings=a.findings.slice(0,c),a}function K(e){let n=[],i=U(e.helperSymbol,e.helperFile,e.migratedFiles),r=new Set;for(let s of e.helperCallees)for(let t of e.candidateIndex.candidateIndexesByCallee.get(s)??[])r.add(t);for(let s of r){let t=e.candidateIndex.corpus[s];if(t.symbol===e.helperSymbol||e.changed.has(t.file)||t.callees.has(e.helperSymbol))continue;let m=A(e.helperCallees,t.callees);if(m<e.minContainment)continue;let c=[...e.helperCallees].filter(l=>t.callees.has(l)),d=t.callees.size===0?0:c.length/t.callees.size;if(d<e.minSiteCoverage||!c.some(l=>(e.candidateIndex.docFreq.get(l)??0)<=e.candidateIndex.ubiquityThreshold))continue;let g=W(i,t.symbol,t.file);n.push({symbol:t.symbol,shortName:C(t.symbol),file:t.file,...g,containment:m,siteCoverage:d,uniqueSiteCalleeCount:Math.max(0,t.callees.size-c.length),sharedCallees:c.map(C).sort()})}return n}function O(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,n,i){let r=new Set([...F(n),...R(y(e))]);for(let s of i)for(let t of F(s))r.add(t);return r}function W(e,n,i){let r=new Set([...F(i),...R(y(n))]);if(e.size===0||r.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let s=[...r].filter(t=>e.has(t)).sort();return s.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${s.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function F(e){return R(e.replace(/\.[^.]+$/,""))}function R(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!X.has(n))}function Y(e,n){let i=0;for(let r of e)(n.docFreq.get(r)??0)<=n.ubiquityThreshold&&(i+=1);return i}function Z(e,n,i,r){let s=[];for(let t of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(t.relativePath))continue;let m=i.get(t.relativePath)??t.relativePath,c=r(m);if(c.state==="unavailable")return{definitions:[],unavailable:c};(c.state==="absent"||!new RegExp(`\\b${N(t.leaf)}\\b`).test(c.content))&&s.push(t)}return{definitions:s}}function Q(e){return n=>{let i=e(n);return i===null?{state:"absent"}:{state:"present",content:i}}}function ee(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents ref_d ON c.document_id = ref_d.id
5
5
  WHERE m.symbol_id = ?
6
6
  AND m.role != 1
7
7
  ${e.pathExclusionsFor("ref_d")}`,n).map(r=>r.relative_path)}export{se as a};
8
- //# sourceMappingURL=chunk-2YC7YNKT.js.map
8
+ //# sourceMappingURL=chunk-HRFQ6GW5.js.map
@@ -1,2 +1,2 @@
1
- import{H as a,R as c}from"./chunk-C7IJMOFP.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
2
- //# sourceMappingURL=chunk-RYOYJMGF.js.map
1
+ import{J as a,T as c}from"./chunk-2VAHDDLM.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
2
+ //# sourceMappingURL=chunk-HX4X7KG3.js.map
@@ -1,4 +1,4 @@
1
- import{b as i}from"./chunk-ERCYGVAM.js";import{a as o}from"./chunk-4GAQ6FI4.js";import{y as l}from"./chunk-TD7VKJ2Y.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
1
+ import{b as i}from"./chunk-RVZC6TJE.js";import{a as o}from"./chunk-L7KTFEAV.js";import{Y as l}from"./chunk-2VAHDDLM.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
2
2
  WHERE relative_path IN (${a})
3
3
  ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
4
- //# sourceMappingURL=chunk-AZS7YPCB.js.map
4
+ //# sourceMappingURL=chunk-HYT2R7LX.js.map
@@ -0,0 +1,40 @@
1
+ import{a as y}from"./chunk-2GJSD5GY.js";import{b as f}from"./chunk-F5GSBHC6.js";import{c as h,d as w}from"./chunk-MTDBHTSF.js";import{d as u,e as m,j as b,r as p,s as g}from"./chunk-C7C6AKAT.js";import{dirname as $,isAbsolute as k,relative as x,resolve as v}from"path";var C=new Set(w());function R(t,e){return`tests/generated/twin-ab/${d(t)}-vs-${d(e)}.test.ts`}function d(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function P(t,e,a,n){let{refA:l,refB:s,outFile:r}=typeof e=="string"?{refA:e,refB:a,outFile:n}:e;if(typeof l!="string"||typeof s!="string"||typeof r!="string")throw new TypeError("twinAb requires refA, refB, and outFile.");if(!k(r))throw new TypeError("twinAb outFile must be an absolute path.");let i=A(t,l);if(!i.ok)return i;let o=A(t,s);if(!o.ok)return o;let c=i.symbol.paramCount===null||o.symbol.paramCount===null?null:i.symbol.paramCount===o.symbol.paramCount,S=N(i.symbol,o.symbol,t.config.projectRoot,r,c);return{ok:!0,a:i.symbol,b:o.symbol,signatureCompatible:c,testSource:S}}function A(t,e){let n=f(t,e).match;if(!n)return{ok:!1,reason:`${e} does not resolve to an indexed symbol.`};let s=t.get("SELECT kind FROM global_symbols WHERE id = ?",n.symbolId)?.kind??null;if(!(s!==null?C.has(s):b(n.symbol)))return{ok:!1,reason:`${e} resolves to ${u(n.symbol)}${s!==null?` with SCIP kind ${h(s)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!y(t,n))return{ok:!1,reason:`${e} (${u(n.symbol)} at ${n.relativePath}:${n.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let i=t.get("SELECT documentation FROM global_symbols WHERE id = ?",n.symbolId),o=p(g(i?.documentation??null));return{ok:!0,symbol:{ref:e,symbol:n.symbol,shortName:m(n.symbol)||u(n.symbol),file:n.relativePath,startLine:n.startLine,signature:o,paramCount:o?E(o):null}}}function E(t){let e=t.indexOf("(");if(e===-1)return null;let a=0,n=-1;for(let i=e;i<t.length;i+=1){let o=t[i];if(o==="(")a+=1;else if(o===")"&&(a-=1,a===0)){n=i;break}}if(n===-1)return null;let l=t.slice(e+1,n).trim();if(!l)return 0;let s=1,r=0;for(let i of l)i==="("||i==="["||i==="{"?r+=1:i===")"||i==="]"||i==="}"?r=Math.max(0,r-1):i===","&&r===0&&(s+=1);return s}function T(t,e,a){let n=$(e),l=v(t,a),r=x(n,l).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function N(t,e,a,n,l){let s=T(a,n,t.file),r=T(a,n,e.file),i=l===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":l?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
2
+ * Generated by 'scip-query twin-ab'. Cleanup integrity scenario.
3
+ * ("cross-examine same-concept twins"): where one concept is computed in
4
+ * more than one place, feed both the same input and require the same
5
+ * answer. Disagreement between twins means at least one is wrong \u2014
6
+ * determine which before consolidating.
7
+ *
8
+ * Twin A: ${t.shortName} (${t.file}:${t.startLine+1})
9
+ * ${t.signature??"(signature unavailable)"}
10
+ * Twin B: ${e.shortName} (${e.file}:${e.startLine+1})
11
+ * ${e.signature??"(signature unavailable)"}
12
+ * ${i}
13
+ *
14
+ * Fill in the TODO input table below with inputs both twins should agree
15
+ * on, then run this file with vitest.
16
+ */
17
+ import { describe, expect, it } from 'vitest';
18
+ import { ${t.shortName} as twinA } from '${s}';
19
+ import { ${e.shortName} as twinB } from '${r}';
20
+
21
+ // TODO: fill in shared inputs both twins should agree on \u2014 one arg array per call.
22
+ const inputs: any[][] = [
23
+ // [/* arg1, arg2, ... */],
24
+ ];
25
+
26
+ // Cast to a variadic signature so the input table can hold any arg shape \u2014
27
+ // the real twins have fixed, non-rest parameter lists, and TS rejects
28
+ // spreading a generic args array into those (TS2556) even when the array
29
+ // itself is 'any'; casting the callee's signature, not the args, satisfies
30
+ // the checker without weakening the twins' real exported types elsewhere.
31
+ const callA = twinA as (...callArgs: any[]) => any;
32
+ const callB = twinB as (...callArgs: any[]) => any;
33
+
34
+ describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${e.shortName}', () => {
35
+ it.each(inputs)('agrees on input %#', (...args) => {
36
+ expect(callA(...args)).toEqual(callB(...args));
37
+ });
38
+ });
39
+ `}export{R as a,P as b};
40
+ //# sourceMappingURL=chunk-IKQVBVQL.js.map
@@ -0,0 +1,4 @@
1
+ import{a as N,b as fe,e as ye,h as X,k as we,m as ve}from"./chunk-QBQE7ZJ5.js";import{b as L}from"./chunk-BOW7SSQH.js";import{C as Fe,a as Me}from"./chunk-ZLMXIQLC.js";import{c as Re,e as Ie}from"./chunk-ETC674NS.js";import{b as Se,d as xe,h as Y,y as Z}from"./chunk-KNLQGXVH.js";import{G as me,J as x,S as ge,T,U as G,g as ae,i as ce,o as de,q as c,u as le,v as ue,x as pe,xa as be,ya as he}from"./chunk-JZ2A7LDM.js";import{execFileSync as Te}from"child_process";import{createHash as it}from"crypto";import{existsSync as C,statSync as ot}from"fs";import{createRequire as st}from"module";import{platform as at}from"os";import{dirname as Pe,join as A}from"path";var ct=st(import.meta.url),jn={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function Q(t){return[t.indexerBinary,...t.binaryAliases??[]]}function dt(t){let e=Q(t);return e.length===1?e[0]:e.join(" or ")}function ee(t){for(let e of Q(t)){let n=ve(e);if(n)return n}return ut(t)}function kn(t){return ee(t)!==null||lt(t)}function lt(t){return Ae(t)!==null}function ut(t){let e=Ae(t);if(!e)return null;let r=JSON.parse(x(e,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return A(Pe(e),r);for(let i of Q(t)){let o=r[i];if(o)return A(Pe(e),o)}return null}function Ae(t){if(!t.bundledNpmPackage)return null;try{return ct.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function pt(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return r}return null}function ft(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return Be(e,n,r)}return null}function Nn(t,e){let n=mt(t,e);if(!n||n.canonicalPath!==e.canonicalPath||n.sha256!==e.sha256||n.size!==e.size||n.mtimeMs!==e.mtimeMs||n.device!==e.device||n.inode!==e.inode||n.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function mt(t,e){try{return Be(t,e.relativePath,e.configuredPath)}catch{return null}}function Be(t,e,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=be(t,e,r),o=he(t,e,r),s=ot(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:it("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function yt(t,e,n={}){return(n.trustProjectTools?ft(t,e)?.canonicalPath:null)??ee(t)}function Ln(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||te(n,e))return e;let r=Ee(n,e);return r?{...e,DOTNET_ROOT:r}:e}function Cn(t,e,n={}){let r=dt(t),i=e?yt(t,e,n):ee(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&&pt(t,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=gt(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function gt(t){if(te(t,process.env))return{runnable:!0};let e=Ee(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=De(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function Ee(t,e){for(let n of De(e))if(te(t,{...e,DOTNET_ROOT:n}))return n;return null}function De(t){let e=[],n=t.DOTNET_ROOT;if(n&&C(n)&&e.push(n),at()==="darwin"&&we("brew"))try{let r=Te("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=A(r,"libexec");C(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function te(t,e){try{return Te(t,["--version"],{stdio:"pipe",env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}import{getHeapStatistics as Nt}from"v8";var bt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function O(t){let e=t.toLowerCase();return bt.some(n=>e.endsWith(n))}function q(t){let e=_(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(l=>[l.path,l])),i=t.snapshot.files.filter(l=>{let m=ae(l.path,["typescript"]);return m==="config"||m==="ambient"}).map(l=>l.path),o=_([...e,...i]),s=o.find(l=>!r.has(l)),a=new Set(t.snapshot.files.map(l=>l.path)).size!==t.snapshot.files.length,d=!s&&o.some(l=>je(r.get(l))),u=Y(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:_(t.snapshot.typescriptProjects),membership:e})),p,f;return{identityFor(l,m){if(!n.has(l))return R("target-outside-project");if(a)return R("duplicate-input-path");if(s)return R("missing-input-fingerprint");if(d)return R("unreadable-input");let h=[],S,K;if(t.graph===null)h.push("dependency-graph-unavailable"),K="whole-project",S=o;else{let P=l===p&&f?f:ht(l,t.graph);if(p=l,f=P,P.find(V=>!r.has(V)))return R("missing-input-fingerprint");if(S=_([...P,...i]),S.some(V=>je(r.get(V))))return R("unreadable-input");K="dependency-closure"}let rt=S.map(P=>St(r.get(P)));return{version:1,key:Y(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:u,inputs:rt})),mode:K,inputFiles:S,reasons:h}}}}function ht(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...e.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function St(t){return t.semanticHash===void 0?{path:t.path,size:t.size,hash:t.hash}:{path:t.path,semanticHash:t.semanticHash}}function je(t){return t.size<0||t.hash==="unreadable"}function R(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function _(t){return[...new Set(t)].sort()}import{realpathSync as Ft}from"fs";import{createRequire as wt}from"module";import{dirname as vt,resolve as Pt}from"path";import{getHeapStatistics as xt}from"v8";var Mt=2560,Rt=1.25;function It(t){let e=t/1048576;return Math.max(0,Math.floor((e-Mt)/Rt))}function ke(){return It(xt().heap_size_limit)}var Ne=wt(import.meta.url),B,$;function Tt(){if(B!==void 0)return B;try{B=Ne("ts-morph")}catch{B=null}return B}function W(){if($)return $;let t=Tt();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=Ne("ts-morph/package.json").version??"unknown"}catch{}return $=`ts-morph:${e}:typescript:${t.ts.version}`,$}function Gn(t,e,n={}){return e.map(r=>At(t,r,n))}function At(t,e,n){let r=null,i,o,s=()=>(i===void 0&&(i=Le(t,e)),i),a=()=>{if(o===void 0){let d=n.fileBudget??ke(),u=s();o=(u===null?0:Math.ceil(u.size/2))>d*Bt?"file-closure":"project"}return o};return{tsconfigPath:e,get project(){return r??=new t.Project({tsConfigFilePath:e,skipFileDependencyResolution:!0,...a()==="file-closure"?{skipAddingFilesFromTsConfig:!0}:{}}),r},get loaded(){return r!==null},get fileNames(){return s()},get scope(){return a()}}}var Bt=1.35,Xn="TypeScript project-wide semantics are unavailable: a compiler project is file-scoped because its tsconfig lists more files than the worker heap can hold.";function Yn(t){return t.some(e=>e.scope==="file-closure")}function Zn(t,e){let n=new Set;for(let r of e)for(let i of Le(t,r)??[])n.add(i);return n}function Le(t,e){try{let n=t.ts,r=n.readConfigFile(e,n.sys.readFile);if(r.error||!r.config)return null;let i=n.parseJsonConfigFileContent(r.config,n.sys,vt(e),void 0,e),o=new Set;for(let s of i.fileNames){let a=Pt(s);o.add(a);try{o.add(Ft(a))}catch{}}return o}catch{return null}}function Qn(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var Et=xe("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function H(t,e,n){let r=Et.get(t,()=>Dt(t));if(!r)return null;let i=`${n}\0${e}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(e,n);return r.identities.set(i,s),s}function I(t){return Me(t,{includeIgnored:!1}).filter(O).sort()}function Dt(t){try{if(!t.generation.metadataRaw)return null;let e=pe(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=ce(e.metadata.fingerprint);return n?{builder:q({projectFiles:I(t),snapshot:n,graph:L(t),engineIdentity:W()}),identities:new Map}:null}catch{return null}}function _e(t,e){let n=ne(t);for(let r of e.values())n.add(r);return n.finish()}function ne(t){let e=new Map(t.map(r=>[r.symbol,r])),n=new Map(t.map(r=>[r.symbolId,[]]));return{add(r){for(let i of r){let o=e.get(i.targetSymbol);o&&n.get(o.symbolId).push(i.location)}},finish(){for(let[r,i]of n)n.set(r,jt(i));return n}}}function qe(t,e,n){let r=Oe(t,e),i=Oe(t,n),o=[...r].filter(f=>!i.has(f)).sort(),s=[...i].filter(f=>!r.has(f)).sort(),a=Ce(t,e),d=Ce(t,n),u=[...a].filter(f=>!d.has(f)).sort(),p=[...d].filter(f=>!a.has(f)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:u.length===0&&p.length===0,expectedCount:a.size,actualCount:d.size,missing:u,extra:p}}}function Ce(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function lr(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let s of e.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,kt(s));return i}function Oe(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function jt(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort($e)}function kt(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||$e(n.location,r.location))}function $e(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var J="typescript-reference-fragment-v2",We=128,D=Re({kind:"typescript-reference-fragments",invalidation:Ie("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:Wt});function Fr(t,e,n,r=t,i,o=new Set(n.keys())){let s=I(t),a=q({projectFiles:s,snapshot:e,graph:i??L(t),engineIdentity:W()}),d=[],u=0;for(let[f,l]of n){let m=a.identityFor(f,J).key;if(!m){u+=1;continue}d.push({relativePath:f,contentHash:m,value:[...l]})}let p=s.filter(f=>!o.has(f)&&!n.has(f)).length;return D.writeBatch(r,d),{affectedFiles:d.length,carriedFiles:p,skippedAffectedFiles:u}}function wr(t,e,n,r){let i=e.filter(s=>O(s.relativePath));if(i.length===0)return E("no TypeScript definitions");let o=E("shadow did not run");return Z("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=E("TypeScript reference fragment provider is unavailable"),o;let a=I(t),d=new Set(a),u=new Map;for(let m of He(a)){let h=s.referenceFragmentsForFiles(m);if(m.some(S=>!h.has(S)))return o=E("TypeScript reference fragment provider returned an incomplete batch"),o;for(let S of m)u.set(S,h.get(S)??[])}let p=_e(i,u),f=qe(i,Lt(n,d),p);if(!f.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...f},o;let l=[];for(let m of a){let h=H(t,m,J);h?.key&&l.push({relativePath:m,contentHash:h.key,value:u.get(m)??[]})}return D.writeBatch(t,l),o={state:"passing",files:a.length,keyedFiles:l.length,writtenFiles:l.length,...f},o}catch(s){return o=E(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function Lt(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function vr(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return Z("typescript.reference-fragments.materialize",()=>{try{let d=I(t);i=d.length;let u=ne(e),p=[];for(let l of d){let m=H(t,l,J);if(!m?.key)return null;let h=D.read(t,l,m.key);h===null?(s+=1,p.push({file:l,contentHash:m.key})):(o+=1,u.add(h))}return s===0?(r="hit",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):qt(t,p,n,l=>{for(let{fragments:m}of l)u.add(m);a+=l.length})?(r="computed",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):null}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function He(t){let e=[];for(let n=0;n<t.length;n+=We)e.push(t.slice(n,n+We));return e}var Ct=.75;function Ot(t){return{heapUsedFraction:()=>{let e=Nt();return e.heap_size_limit>0?e.used_heap_size/e.heap_size_limit:0},collect:Fe,release:()=>Se(t,{groups:["semantic-provider"]})}}function _t(t,e=Ct){return t.heapUsedFraction()<e||t.collect()&&t.heapUsedFraction()<e?!1:(t.release(),!0)}function qt(t,e,n,r,i=Ot(t)){for(let o of He(e)){let s=$t(t,o,n);if(!s)return!1;r(s),_t(i)}return!0}function $t(t,e,n){let r=e.map(({file:s})=>s),i=n(r[0]);if(!i.availability().available||!i.referenceFragmentsForFiles)return null;let o=i.referenceFragmentsForFiles(r);return r.some(s=>!o.has(s))?null:(D.writeBatch(t,e.map(({file:s,contentHash:a})=>({relativePath:s,contentHash:a,value:o.get(s)??[]}))),r.map(s=>({file:s,fragments:o.get(s)??[]})))}function Pr(t){let e=I(t),n=0;for(let r of e){let i=H(t,r,J);if(!i?.key)return null;D.has(t,r,i.key)||(n+=1)}return{files:e.length,missing:n}}function E(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function Wt(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(Ht)?null:e}catch{return null}}function Ht(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{createHash as Ut,randomUUID as Ge}from"crypto";import{closeSync as jr,existsSync as v,fstatSync as kr,lstatSync as k,mkdirSync as Nr,openSync as Lr,readdirSync as w,readSync as Cr,renameSync as Xe,rmSync as M}from"fs";import{basename as U,dirname as zt,join as y}from"path";function Je(t){return re(t,Jt)}function re(t,e){return Array.isArray(t)?`[${t.map(n=>re(n,e)).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([n],[r])=>e(n,r)).map(([n,r])=>`${JSON.stringify(n)}:${re(r,e)}`).join(",")}}`:JSON.stringify(t)}function Jt(t,e){return t.localeCompare(e)}var Kt=1,Vt=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),F=class extends Error{constructor(n,r,i,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${i.maxItemBytes}`:n==="item-capacity"?`mailbox has ${r.totalItems} retained items; limit is ${i.maxItems}`:n==="byte-capacity"?`mailbox retains ${r.totalBytes} bytes and the request adds ${o}; limit is ${i.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=r;this.limits=i;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},Gt=".owner.json",Xt={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function Jr(t){return{rootDir:t,pendingDir:y(t,"pending"),inflightDir:y(t,"inflight"),responseDir:y(t,"responses"),deadLetterDir:y(t,"dead-letter"),legacyRequestDir:y(t,"requests")}}function Yt(t={}){let e={...Vt,...t};for(let[n,r]of Object.entries(e))if(!Number.isFinite(r)||r<=0||!Number.isInteger(r))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return e}function Ye(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>ge(n));return G(...e)}function Ur(t,e){return Ut("sha256").update(Je({namespace:t,payload:e})).digest("hex")}function Ze(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function zr(t,e,n={}){let r=Yt(n.limits),i=n.nowMs??Date.now(),o=Ye(t);return sn(e),Qt(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??ye,n.durability??"durable",()=>{Zt(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),d=Ue(t,e.id);if(d){let l=ze(d,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:l.deadlineAtMs??e.deadlineAtMs}}let u=`${JSON.stringify(e)}
2
+ `,p=Buffer.byteLength(u),f=Qe(t);if(p>r.maxItemBytes)throw new F("item-too-large",f,r,p);if(f.totalItems+1>r.maxItems)throw new F("item-capacity",f,r,p);if(f.totalBytes+p>r.maxBytes)throw new F("byte-capacity",f,r,p);n.onBeforePublish?.();try{let l=n.durability??"durable",m=X(s,u,{durability:l}),h=l==="durable"?G(o,m.directorySync):"not-requested";return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:m.achievedDurability,directorySync:h}}catch(l){if(l.code!=="EEXIST")throw l;let m=Ue(t,e.id);if(!m)throw l;let h=ze(m,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:h.deadlineAtMs??e.deadlineAtMs}}})}function Zt(t,e,n,r=Xt){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of oe(t.inflightDir)){if(o<=0)break;let a=y(t.responseDir,`${s.requestId}.json`);if(v(a)){M(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||rn(t,s.ownerId,r)!=="dead")continue;let d=y(t.pendingDir,s.originalFile);try{Xe(s.path,d),i.reclaimed++}catch(u){if(u.code!=="EEXIST")throw u;M(s.path,{force:!0})}T(zt(s.path)),T(t.pendingDir),o--}o=Ke(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=Ke(t.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,e,()=>{i.deadLettersRemoved++});for(let s of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir]){if(o<=0)break;for(let a of et(s)){if(o<=0)break;if(!U(a).includes(".tmp-"))continue;let d;try{d=k(a).mtimeMs}catch(u){if(u.code==="ENOENT")continue;throw u}d+n.temporaryRetentionMs>e||(M(a,{force:!0}),i.temporaryFilesRemoved++,o--)}}return an(t.inflightDir),i}function Qe(t){Ye(t);let e=[...j(t.pendingDir).map(d=>({path:d,pending:!0})),...j(t.legacyRequestDir).map(d=>({path:d,pending:!0}))],n=oe(t.inflightDir).map(d=>({path:d.path,pending:!1})),r=j(t.responseDir).map(d=>({path:d,pending:!1})),i=j(t.deadLetterDir).map(d=>({path:d,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let d of e){let u=se(d.path);if(!u){s++;continue}let p=u.enqueuedAtMs;if(p===void 0)try{p=k(d.path).mtimeMs}catch(f){if(f.code==="ENOENT")continue;throw f}a=a===void 0?p:Math.min(a,p)}return{pending:e.length,inflight:n.length,responses:r.length,deadLetters:i.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((d,u)=>d+cn(u.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Qt(t,e,n,r,i,o){let s=y(t.rootDir,".admission.lock"),a=`${process.pid}-${Ge()}`,d=r()+Math.max(0,n);for(;!en(t.rootDir,s,a,i);){if(tn(s),r()>=d)throw new F("admission-busy",Qe(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{ie(s).ownerToken===a&&(M(s,{recursive:!0,force:!0}),i==="durable"&&T(t.rootDir))}catch{}}}function en(t,e,n,r){let i=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
3
+ `;try{return X(e,i,{durability:r}),!0}catch(o){if(o.code==="EEXIST")return!1;try{ie(e).ownerToken===n&&(M(e,{force:!0}),r==="durable"&&T(t))}catch{}throw o}}function tn(t){let e=null;try{let r=ie(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||nn(e))return;let n=`${t}.stale-${Ge()}`;try{Xe(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}M(n,{recursive:!0,force:!0})}function ie(t){try{return JSON.parse(x(t,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof me&&e.reason==="not-regular"))throw e;return JSON.parse(x(y(t,"owner.json"),"mailbox lock owner record"))}}function nn(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function rn(t,e,n){let r=on(y(t.inflightDir,tt(e),Gt));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?fe(r.processIdentity,i)?"live":"dead":"unknown"}function on(t){try{let e=JSON.parse(x(t,"mailbox owner record"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let n=e.processIdentity===void 0?null:N(e.processIdentity);return e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...n?{processIdentity:n}:{}}}catch{return null}}function Ue(t,e){for(let n of[y(t.pendingDir,`${e}.json`),y(t.legacyRequestDir,`${e}.json`),y(t.responseDir,`${e}.json`)])if(v(n))return n;for(let n of oe(t.inflightDir))if(n.requestId===e)return n.path;return null}function ze(t,e,n){let r=se(t);if(r?.operationKey===e)return r;if(U(t)===`${Ze(e)}.json`)return{id:n,operationKey:e};throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`)}function sn(t){if(t.mailboxVersion!==Kt||t.id!==Ze(t.operationKey)||!t.clientId.trim()||!Number.isFinite(t.enqueuedAtMs)||!Number.isFinite(t.deadlineAtMs)||t.deadlineAtMs<t.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function oe(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=Ve(n.name);if(r===null)continue;let i=y(t,n.name);for(let o of w(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=Ve(s[1]),d=Number(s[2]);if(a===null||U(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(d))continue;let u=y(i,o.name),p=se(u)??{id:U(a,".json")},f;try{f=k(u)}catch(l){if(l.code==="ENOENT")continue;throw l}e.push({requestId:p.id,ownerId:r,path:u,originalFile:a,claimedAtMs:f.mtimeMs,claimExpiresAtMs:d,byteLength:f.size,...p.operationKey?{operationKey:p.operationKey}:{},...p.clientId?{clientId:p.clientId}:{},...p.enqueuedAtMs===void 0?{}:{enqueuedAtMs:p.enqueuedAtMs},...p.deadlineAtMs===void 0?{}:{deadlineAtMs:p.deadlineAtMs},legacy:p.operationKey===void 0})}}return e.sort((n,r)=>n.claimedAtMs-r.claimedAtMs||n.path.localeCompare(r.path))}function se(t){try{let e=JSON.parse(x(t,"mailbox record"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function Ke(t,e,n,r,i){for(let o of j(t)){if(e<=0)break;let s;try{s=k(o)}catch(a){if(a.code==="ENOENT")continue;throw a}n(o,s.mtimeMs)>r||(M(o,{force:!0}),i(),e--)}return e}function j(t){return v(t)?w(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function et(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){let r=y(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...et(r))}return e.sort()}function an(t){if(v(t))for(let e of w(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=y(t,e.name);w(n).some(r=>r.endsWith(".claim"))||M(n,{recursive:!0,force:!0})}}function cn(t){try{return k(t).size}catch{return 0}}function tt(t){return Buffer.from(t,"utf8").toString("base64url")}function Ve(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return tt(e)===t?e:null}catch{return null}}import{join as z}from"path";var Qr=1e4,dn="watch.lock",ln="watch-state.json",un="watch-activity.json",pn="watch-refresh-requests";function ei(t){return{lockPath:z(t,dn),statePath:z(t,ln),activityPath:z(t,un),refreshRequestsPath:z(t,pn)}}function ti(t){try{return fn(JSON.parse(x(t,"watch service state")))}catch{return null}}function fn(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!g(e.startedAt)||!g(e.heartbeatAt)||!g(e.lastActivityAt)||!mn(e.watcher)||e.idleDeadlineAt!==void 0&&!g(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=N(e.processIdentity);if(!n||n.pid!==e.pid)return null;e.processIdentity=n}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!yn(e.lastError)||e.lastRefresh!==void 0&&!gn(e.lastRefresh)||e.reindexActivity!==void 0&&!bn(e.reindexActivity)||e.refreshRequests!==void 0&&!Sn(e.refreshRequests)||e.typescriptSemantic!==void 0&&!xn(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!Mn(e.typescriptIndex)?null:e}function g(t){return de(t)}function mn(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return b(e.changedFiles)&&b(e.reindexAt);case"indexing":return b(e.startedAt);case"cooldown":return b(e.until)&&typeof e.dirty=="boolean";case"budget-paused":return b(e.until)&&typeof e.dirty=="boolean"&&typeof e.reason=="string"&&c(e.rebuilt)&&c(e.estimatedWriteBytes);case"draining":return b(e.startedAt)&&typeof e.reason=="string";default:return!1}}function yn(t){if(!t||typeof t!="object")return!1;let e=t;return g(e.at)&&typeof e.message=="string"}function gn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&g(e.startedAt)&&g(e.completedAt)&&b(e.durationMs)}function bn(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!c(e.recordsRead)||e.invalidRecords!==void 0&&!c(e.invalidRecords)||e.skippedRecords!==void 0&&!c(e.skippedRecords)||e.readErrors!==void 0&&!c(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!c(e.ignoredPartialTailBytes)||!g(e.windowStartedAt)||!g(e.windowEndedAt)||!c(e.runs)||!c(e.rebuilt)||e.fullRebuilds!==void 0&&!c(e.fullRebuilds)||!c(e.reused)||!c(e.failed)||!c(e.suppressed)||!b(e.estimatedLogicalOutputBytes)||e.estimatedWriteBytes!==void 0&&!c(e.estimatedWriteBytes)||e.reflinkedBytes!==void 0&&!c(e.reflinkedBytes)||e.fallbackCopiedBytes!==void 0&&!c(e.fallbackCopiedBytes)||e.oldestRebuildAt!==void 0&&!g(e.oldestRebuildAt)||e.oldestWriteAt!==void 0&&!g(e.oldestWriteAt)||e.languageAttribution!==void 0&&e.languageAttribution!=="complete"&&e.languageAttribution!=="partial"&&e.languageAttribution!=="unavailable"||e.attributedRuns!==void 0&&!c(e.attributedRuns)||e.unattributedRuns!==void 0&&!c(e.unattributedRuns)||e.invalidLanguageDetails!==void 0&&!c(e.invalidLanguageDetails)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"||Array.isArray(e.byTrigger)||e.byLanguage!==void 0&&!hn(e.byLanguage)?!1:Object.values(e.byTrigger).every(n=>n===void 0||c(n))}function hn(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;for(let[e,n]of Object.entries(t)){if(!ue.includes(e)||!n||typeof n!="object")return!1;let r=n;if(!c(r.runs)||!c(r.rebuilt)||!c(r.reused)||!c(r.producedOutputBytes)||!le(r.durationMs)||r.rebuilt+r.reused!==r.runs)return!1}return!0}function Sn(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.claimed)&&c(e.completed)&&c(e.expired)&&c(e.invalid)&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function xn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&b(e.requests)&&b(e.sessionsCreated)&&b(e.sessionsReused)&&b(e.sessionsRefreshed)&&b(e.sessionsReplaced)&&b(e.projectsCreated)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||nt(e.mailbox))}function Mn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&c(e.requests)&&c(e.sessionsCreated)&&c(e.sessionsReplaced)&&(e.sessionsEvicted===void 0||c(e.sessionsEvicted))&&(e.activeSessions===void 0||c(e.activeSessions))&&(e.maxActiveSessions===void 0||c(e.maxActiveSessions))&&(e.heapUsedBytes===void 0||c(e.heapUsedBytes))&&(e.heapLimitBytes===void 0||c(e.heapLimitBytes))&&(e.softMemoryLimitBytes===void 0||c(e.softMemoryLimitBytes))&&(e.retireRequested===void 0||typeof e.retireRequested=="boolean")&&c(e.initializations)&&c(e.programUpdates)&&c(e.documentsEmitted)&&c(e.documentsRemoved)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastDurationMs===void 0||b(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||nt(e.mailbox))}function nt(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.inflight)&&c(e.responses)&&c(e.deadLetters)&&c(e.invalid)&&c(e.totalItems)&&b(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function b(t){return typeof t=="number"&&Number.isFinite(t)}export{jn as a,dt as b,ee as c,kn as d,pt as e,ft as f,Nn as g,Ln as h,Cn as i,Je as j,Kt as k,Jr as l,Ur as m,Ze as n,zr as o,Qr as p,ei as q,ti as r,bt as s,O as t,Tt as u,Gn as v,Xn as w,Yn as x,Zn as y,Qn as z,lr as A,H as B,Fr as C,wr as D,vr as E,Pr as F};
4
+ //# sourceMappingURL=chunk-J6GLBBRK.js.map
@@ -1,3 +1,3 @@
1
- import{a as f}from"./chunk-5H5WTJSD.js";import{b as d,d as m}from"./chunk-TD7VKJ2Y.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as f}from"./chunk-2USA3S3P.js";import{a as d,c as m}from"./chunk-BL6DCHQP.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,c.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],n=t.enclosing_symbol,i=1,y=new Set([t.symbol]);for(;n&&!y.has(n)&&i<20;){y.add(n);let s=e.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",n);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:i}),n=s.enclosing_symbol,i++}if(o.length>1)return o;let b=d(t.symbol);if("kind"in b)return o;let l=b.descriptors;if(l.length<=1)return o;let h=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let g=l.slice(0,s+1).map(a=>a.suffix==="method"?`${a.name}()`:a.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");h.push({symbol:g,shortName:g,depth:p})}return h}function N(e,r){return u(e,r)}export{u as a,N as b};
3
- //# sourceMappingURL=chunk-TNG2FYS5.js.map
3
+ //# sourceMappingURL=chunk-J7A4PWFX.js.map
@@ -0,0 +1,2 @@
1
+ import{b as T}from"./chunk-L7KTFEAV.js";import{b,d as I,i as U,j as L,k as J}from"./chunk-FVFDOIM3.js";import{a as G,b as z,d as O}from"./chunk-2VAHDDLM.js";import{a as W}from"./chunk-YXPUP5G2.js";import{b as E}from"./chunk-ATXPTSEI.js";import{d as _}from"./chunk-CKBUBRYD.js";import{b as B,d as N}from"./chunk-IW5XQG5G.js";import{e as M,f as A}from"./chunk-HGFDYOVB.js";import{a as H,c as C}from"./chunk-7HXT6YLU.js";function v(e){let t=P(e.projectFiles),r=new Set(t),s=new Map(e.snapshot.files.map(a=>[a.path,a])),c=e.snapshot.files.filter(a=>{let o=H(a.path,["typescript"]);return o==="config"||o==="ambient"}).map(a=>a.path),i=P([...t,...c]),n=i.find(a=>!s.has(a)),p=new Set(e.snapshot.files.map(a=>a.path)).size!==e.snapshot.files.length,d=!n&&i.some(a=>V(s.get(a))),l=E(JSON.stringify({pnpmWorkspaces:e.snapshot.pnpmWorkspaces,typescriptProjectMode:e.snapshot.typescriptProjectMode,typescriptProjects:P(e.snapshot.typescriptProjects),membership:t})),y,f;return{identityFor(a,o){if(!r.has(a))return g("target-outside-project");if(p)return g("duplicate-input-path");if(n)return g("missing-input-fingerprint");if(d)return g("unreadable-input");let m=[],u,w;if(e.graph===null)m.push("dependency-graph-unavailable"),w="whole-project",u=i;else{let h=a===y&&f?f:Z(a,e.graph);if(y=a,f=h,h.find(k=>!s.has(k)))return g("missing-input-fingerprint");if(u=P([...h,...c]),u.some(k=>V(s.get(k))))return g("unreadable-input");w="dependency-closure"}let X=u.map(h=>Q(s.get(h)));return{version:1,key:E(JSON.stringify({version:1,engineIdentity:e.engineIdentity,schemaVersion:o,projectIdentity:l,inputs:X})),mode:w,inputFiles:u,reasons:m}}}}function Z(e,t){let r=new Set,s=[e];for(let c=0;c<s.length;c+=1){let i=s[c];if(!(i===void 0||r.has(i))){r.add(i);for(let n of[...t.get(i)??[]].sort())r.has(n)||s.push(n)}}return[...r].sort()}function Q(e){return e.semanticHash===void 0?{path:e.path,size:e.size,hash:e.hash}:{path:e.path,semanticHash:e.semanticHash}}function V(e){return e.size<0||e.hash==="unreadable"}function g(e){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[e]}}function P(e){return[...new Set(e)].sort()}var ee=N("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function x(e,t,r){let s=ee.get(e,()=>te(e));if(!s)return null;let c=`${r}\0${t}`,i=s.identities.get(c);if(i)return i;let n=s.builder.identityFor(t,r);return s.identities.set(c,n),n}function S(e){return W(e,{includeIgnored:!1}).filter(b).sort()}function te(e){try{if(!e.generation.metadataRaw)return null;let t=_(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let r=C(t.metadata.fingerprint);return r?{builder:v({projectFiles:S(e),snapshot:r,graph:T(e),engineIdentity:I()}),identities:new Map}:null}catch{return null}}import{getHeapStatistics as ne}from"v8";var j="typescript-reference-fragment-v2",Y=128,R=z({kind:"typescript-reference-fragments",invalidation:O("typescript-reference-fragments"),serialize:e=>JSON.stringify(e),deserialize:ce});function Ce(e,t,r,s=e,c,i=new Set(r.keys())){let n=S(e),p=v({projectFiles:n,snapshot:t,graph:c??T(e),engineIdentity:I()}),d=[],l=0;for(let[f,a]of r){let o=p.identityFor(f,j).key;if(!o){l+=1;continue}d.push({relativePath:f,contentHash:o,value:[...a]})}let y=n.filter(f=>!i.has(f)&&!r.has(f)).length;return R.writeBatch(s,d),{affectedFiles:d.length,carriedFiles:y,skippedAffectedFiles:l}}function _e(e,t,r,s){let c=t.filter(n=>b(n.relativePath));if(c.length===0)return F("no TypeScript definitions");let i=F("shadow did not run");return M("typescript.reference-fragments.shadow",()=>{try{let n=s(c[0].relativePath);if(!n.availability().available||!n.referenceFragmentsForFiles)return i=F("TypeScript reference fragment provider is unavailable"),i;let p=S(e),d=new Set(p),l=new Map;for(let o of D(p)){let m=n.referenceFragmentsForFiles(o);if(o.some(u=>!m.has(u)))return i=F("TypeScript reference fragment provider returned an incomplete batch"),i;for(let u of o)l.set(u,m.get(u)??[])}let y=U(c,l),f=J(c,re(r,d),y);if(!f.passed)return i={state:"failing",files:p.length,keyedFiles:0,writtenFiles:0,...f},i;let a=[];for(let o of p){let m=x(e,o,j);m?.key&&a.push({relativePath:o,contentHash:m.key,value:l.get(o)??[]})}return R.writeBatch(e,a),i={state:"passing",files:p.length,keyedFiles:a.length,writtenFiles:a.length,...f},i}catch(n){return i=F(n instanceof Error?n.message:String(n)),i}},()=>({...i}))}function re(e,t){return new Map([...e].map(([r,s])=>[r,s.filter(c=>t.has(c.file))]))}function Ae(e,t,r){if(t.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let s="fallback",c=0,i=0,n=0,p=0;return M("typescript.reference-fragments.materialize",()=>{try{let d=S(e);c=d.length;let l=L(t),y=[];for(let a of d){let o=x(e,a,j);if(!o?.key)return null;let m=R.read(e,a,o.key);m===null?(n+=1,y.push({file:a,contentHash:o.key})):(i+=1,l.add(m))}return n===0?(s="hit",{references:l.finish(),files:c,cacheHits:i,cacheMisses:n,computedFiles:p}):ae(e,y,r,a=>{for(let{fragments:o}of a)l.add(o);p+=a.length})?(s="computed",{references:l.finish(),files:c,cacheHits:i,cacheMisses:n,computedFiles:p}):null}catch{return null}},()=>({state:s,files:c,cacheHits:i,cacheMisses:n,computedFiles:p}))}function D(e){let t=[];for(let r=0;r<e.length;r+=Y)t.push(e.slice(r,r+Y));return t}var ie=.75;function q(e){return{heapUsedFraction:()=>{let t=ne();return t.heap_size_limit>0?t.used_heap_size/t.heap_size_limit:0},collect:G,release:()=>B(e,{groups:["semantic-provider"]})}}function $(e,t=ie){return e.heapUsedFraction()<t||e.collect()&&e.heapUsedFraction()<t?!1:(e.release(),!0)}function ae(e,t,r,s,c=q(e)){for(let i of D(t)){let n=K(e,i,r);if(!n)return!1;s(n),$(c)}return!0}function K(e,t,r){let s=t.map(({file:n})=>n),c=r(s[0]);if(!c.availability().available||!c.referenceFragmentsForFiles)return null;let i=c.referenceFragmentsForFiles(s);return s.some(n=>!i.has(n))?null:(R.writeBatch(e,t.map(({file:n,contentHash:p})=>({relativePath:n,contentHash:p,value:i.get(n)??[]}))),s.map(n=>({file:n,fragments:i.get(n)??[]})))}var se=()=>new Promise(e=>setImmediate(e));async function Be(e,t,r={}){let s=r.yieldToEventLoop??se,c=r.probe??q(e),i="fallback",n=0,p=0,d=0,l=0;return A("typescript.reference-fragments.warm",async()=>{try{let y=S(e),f=r.files?new Set(r.files):null,a=f?y.filter(m=>f.has(m)):y;n=a.length;let o=[];for(let m of a){let u=x(e,m,j);if(!u?.key)return null;R.has(e,m,u.key)?p+=1:(d+=1,o.push({file:m,contentHash:u.key}))}if(o.length===0)return i="hit",{files:n,cacheHits:p,cacheMisses:d,computedFiles:l};for(let m of D(o)){let u=K(e,m,t);if(!u)return null;l+=u.length,$(c),r.onBatch?.({computedFiles:l,missingFiles:o.length}),await s()}return i="computed",{files:n,cacheHits:p,cacheMisses:d,computedFiles:l}}catch{return null}},()=>({state:i,files:n,cacheHits:p,cacheMisses:d,computedFiles:l}))}function F(e){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:e}}function ce(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(oe)?null:t}catch{return null}}function oe(e){if(!e||typeof e!="object")return!1;let t=e,r=t.location;return typeof t.targetSymbol=="string"&&!!r&&typeof r.file=="string"&&typeof r.line=="number"&&typeof r.column=="number"}export{x as a,Ce as b,_e as c,Ae as d,Be as e};
2
+ //# sourceMappingURL=chunk-JCSAZ35V.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-7KCZELVM.js";import{a as b,b as S}from"./chunk-6NC3YSPY.js";import{a as m}from"./chunk-IXESDH3J.js";import{p as y}from"./chunk-2XCGSDIT.js";import{a as f}from"./chunk-EELPBR7E.js";import{c as r}from"./chunk-DRENNWRG.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=a(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m}).map(n=>({symbol:n.symbol,file:n.file}))),s=a(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m})),c=s.length>0?s:a(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
2
- //# sourceMappingURL=chunk-EWWY2ZFL.js.map
1
+ import{a as m}from"./chunk-7KCZELVM.js";import{e as b,f as S}from"./chunk-AADQLOQ4.js";import{a}from"./chunk-WDSFQDPN.js";import{p as y}from"./chunk-FI7VGOR4.js";import{a as f}from"./chunk-2USA3S3P.js";import{c as r}from"./chunk-BL6DCHQP.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:a}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=m(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:a}).map(n=>({symbol:n.symbol,file:n.file}))),s=m(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:a})),c=s.length>0?s:m(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
2
+ //# sourceMappingURL=chunk-JDU2IV3A.js.map
@@ -1,2 +1,2 @@
1
- import{j as i}from"./chunk-AK3PYTIK.js";var c=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function d(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=n;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!c.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function p(n,t){return n.version===t.version&&n.pid===t.pid&&n.platform===t.platform&&n.startToken===t.startToken}import{execFileSync as y}from"child_process";import{platform as P}from"os";var I=1e3,a=16*1024,s;function N(n,t=u){if(!Number.isSafeInteger(n)||n<=0)return null;let e=n===process.pid&&t===u;if(e&&s)return{...s};try{let r=b(n,t);if(!r)return null;let o={version:1,pid:n,platform:t.platform,startToken:r};return e&&(s=o),{...o}}catch{return null}}function b(n,t){if(t.platform==="linux"||t.platform==="android")return T(t.readFile(`/proc/${n}/stat`));if(t.platform==="win32"){let e=`([DateTimeOffset](Get-Process -Id ${n} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return m(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",e]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?m(t.run("ps",["-p",String(n),"-o","lstart="])):null}function T(n){let t=n.lastIndexOf(")");if(t<0)return null;let r=n.slice(t+1).trim().split(/\s+/)[19];return r&&/^\d+$/.test(r)?r:null}function m(n){let t=n.trim();return t===""?null:t}var u={platform:P(),readFile(n){return i(n,{maxBytes:a,inputKind:"process identity pseudo-file"})},run(n,t){return y(n,[...t],{encoding:"utf8",timeout:I,maxBuffer:a,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function h(){return performance.now()}function _(n,t,e,r,o,l){if(n>0)return e;let f=Math.max(0,Math.min(l,t-1));return Math.min(o,r*2**f)}export{d as a,p as b,N as c,h as d,_ as e};
2
- //# sourceMappingURL=chunk-SB25YMEQ.js.map
1
+ import{j as i}from"./chunk-7F45LJKI.js";var c=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function d(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=n;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!c.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function p(n,t){return n.version===t.version&&n.pid===t.pid&&n.platform===t.platform&&n.startToken===t.startToken}import{execFileSync as y}from"child_process";import{platform as P}from"os";var I=1e3,a=16*1024,s;function N(n,t=u){if(!Number.isSafeInteger(n)||n<=0)return null;let e=n===process.pid&&t===u;if(e&&s)return{...s};try{let r=b(n,t);if(!r)return null;let o={version:1,pid:n,platform:t.platform,startToken:r};return e&&(s=o),{...o}}catch{return null}}function b(n,t){if(t.platform==="linux"||t.platform==="android")return T(t.readFile(`/proc/${n}/stat`));if(t.platform==="win32"){let e=`([DateTimeOffset](Get-Process -Id ${n} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return m(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",e]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?m(t.run("ps",["-p",String(n),"-o","lstart="])):null}function T(n){let t=n.lastIndexOf(")");if(t<0)return null;let r=n.slice(t+1).trim().split(/\s+/)[19];return r&&/^\d+$/.test(r)?r:null}function m(n){let t=n.trim();return t===""?null:t}var u={platform:P(),readFile(n){return i(n,{maxBytes:a,inputKind:"process identity pseudo-file"})},run(n,t){return y(n,[...t],{encoding:"utf8",timeout:I,maxBuffer:a,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function h(){return performance.now()}function _(n,t,e,r,o,l){if(n>0)return e;let f=Math.max(0,Math.min(l,t-1));return Math.min(o,r*2**f)}export{d as a,p as b,N as c,h as d,_ as e};
2
+ //# sourceMappingURL=chunk-JFMEXGFE.js.map
@@ -0,0 +1,4 @@
1
+ import{a as L}from"./chunk-BGBBVSH4.js";import{h as De}from"./chunk-AADQLOQ4.js";import{a as _}from"./chunk-WDSFQDPN.js";import{b as y}from"./chunk-NJGKXKQF.js";import{b as be,d as ye,e as he,f as Re,g as xe,h as ke,i as X,j as Pe,m as q}from"./chunk-FI7VGOR4.js";import{a as Se}from"./chunk-WRQXLNYE.js";import{b as I}from"./chunk-L7KTFEAV.js";import{c as ce}from"./chunk-BJT7LSPK.js";import{G as ae,H as E,J as le,N as fe,T,U as me,V as pe,W as ge,X as B,i as ie,l as oe,m as C,p as k,q as se}from"./chunk-2VAHDDLM.js";import{a as b}from"./chunk-YXPUP5G2.js";import{d as D,f as G,g as K,i as ue,j as de}from"./chunk-BL6DCHQP.js";import{a as Ee}from"./chunk-DHEQMPLW.js";import{d}from"./chunk-IW5XQG5G.js";import{e as ne}from"./chunk-HGFDYOVB.js";import{$ as x,aa as P,ba as re,o as g}from"./chunk-7HXT6YLU.js";import{existsSync as j,readdirSync as we}from"fs";import{join as F}from"path";var ot={files:new Set,pathPrefixes:[]};var U=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,st=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,Fe=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],at=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),ct=4,lt=d("package-surface",{clearGroups:["whole-project"]}),Nn=d("package-operational-surface",{clearGroups:["whole-project"]});function Me(t){return lt.get(t,()=>ft(t.config.projectRoot))}function W(t,e){let n=Me(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function ve(t,e){return Me(t).files.has(e)}function ft(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:i}of ut(t))for(let o of dt(r))mt(t,i,o,e,n);return e.size===0&&n.length===0?ot:{files:e,pathPrefixes:n}}function ut(t){let e=[],n=Ie(t,"");return n&&e.push({manifest:n,packageRoot:""}),Ce(t,"",e,0),e}function Ce(t,e,n,r){if(r>=ct)return;let i=F(t,e);if(j(i))for(let o of we(i,{withFileTypes:!0})){if(!o.isDirectory()||at.has(o.name))continue;let s=e?`${e}/${o.name}`:o.name,a=Ie(t,s);a&&n.push({manifest:a,packageRoot:s}),Ce(t,s,n,r+1)}}function Ie(t,e){let n;try{n=x(t,F(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!P(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function dt(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return Le(t.exports,e),e}function Le(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))Le(n,e)}function mt(t,e,n,r,i){let o=n.replace(/\\/g,"/").replace(/^\.\//,"");if(o===""||o.startsWith(".."))return;let s=o.indexOf("*");if(s>=0){let c=o.slice(0,s);for(let f of Te(c))f!==""&&i.push(h(e,f));return}let a=o.replace(st,"");for(let c of Te(a)){c===a&&c===o&&r.add(h(e,o));for(let f of Fe)pt(t,r,e,c+f)}r.add(h(e,o))}function Te(t){let e=[t];return U.test(t)&&(e.push(t.replace(U,"src/")),e.push(t.replace(U,""))),e}function pt(t,e,n,r){let i=h(n,r);if(e.add(i),!r.startsWith("src/")||j(F(t,i)))return;let o=Fe.find(l=>r.endsWith(l));if(!o)return;let s=r.slice(0,-o.length);gt(t,e,n,s,o);let a=s.lastIndexOf("/");if(a<=4)return;let c=s.slice(0,a),f=s.slice(a+1);for(let l of _e(t,n,c,`${f}${o}`))e.add(l)}function gt(t,e,n,r,i){let o=h(n,`${r}/index${i}`);j(F(t,o))&&e.add(o)}function _e(t,e,n,r){let i=F(t,e,n);if(!j(i))return[];let o=[];for(let s of we(i,{withFileTypes:!0})){let a=`${n}/${s.name}`;s.isDirectory()?o.push(..._e(t,e,a,r)):s.isFile()&&s.name===r&&o.push(h(e,a))}return o}function h(t,e){return t?`${t}/${e}`:e}import{existsSync as H,readdirSync as St}from"fs";import{dirname as bt,join as Y}from"path";var yt={rootFiles:new Set,sourcePrefixes:[]},ht=new Set([".git",".scipquery","node_modules","target"]),Rt=6,xt=d("rust-library-surface",{clearGroups:["whole-project"]});function je(t,e,n){if(!n.endsWith(".rs")||!Et(kt(t),n))return!1;let r=T(t,n).find(i=>i.symbol===e);return r?Dt(oe(t,n)[r.startLine]??""):!1}function kt(t){return xt.get(t,()=>Pt(t.config.projectRoot))}function Pt(t){let e=new Set,n=new Set;for(let r of Tt(t)){let i=x(t,Y(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),o=wt(i),s=h(r,"src/lib.rs"),a=o?h(r,o):!Ft(i)&&re(t,s)?s:null;if(!a)continue;e.add(a);let c=bt(a).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?yt:{rootFiles:e,sourcePrefixes:[...n].sort()}}function Et(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:Mt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Dt(t){return/^\s*pub\s+(?!\()/.test(t)}function Tt(t){if(!H(t))return[];let e=[];return Ae(t,"",e,0),e}function Ae(t,e,n,r){let i=Y(t,e);if(H(i)&&(H(Y(i,"Cargo.toml"))&&n.push(e),!(r>=Rt)))for(let o of St(i,{withFileTypes:!0})){if(!o.isDirectory()||ht.has(o.name))continue;let s=e?`${e}/${o.name}`:o.name;Ae(t,s,n,r+1)}}function wt(t){let e=!1;for(let n of t.split(`
2
+ `)){let r=n.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(r);if(i){e=i[1]==="lib";continue}if(!e)continue;let o=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(o)return o.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Ft(t){let e=!1;for(let n of t.split(`
3
+ `)){let r=n.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(r);if(i){e=i[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function Mt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}import{existsSync as vt,readdirSync as Ct}from"fs";import{join as It}from"path";var Lt=/^(?:[\w.-]+\.config\.[cm]?[jt]s|package\.json)$/,_t=/(?:\.{1,2}\/)?[\w@./-]+\.(?:[cm]?[jt]sx?)\b/g,jt=d("config-referenced-files",{clearGroups:["whole-project"]});function At(t){return jt.get(t,()=>Nt(t))}function Ne(t,e){return At(t).has(g(e))}function Nt(t){let e=new Set,n=t.config.projectRoot,r;try{r=Ct(n)}catch{return e}let i=r.filter(s=>Lt.test(s)&&vt(It(n,s)));if(i.length===0)return e;let o=new Set(b(t,{includeIgnored:!1}).map(s=>g(s)));for(let s of i){let a;try{a=x(n,s,{inputKind:"root configuration file"})}catch(c){if(P(c))continue;continue}for(let c of a.matchAll(_t)){let f=g(c[0]).replace(/^\.\//,"");f.startsWith("..")||f.startsWith("/")||o.has(f)&&e.add(f)}}return e}import{existsSync as Z,readdirSync as Ot}from"fs";import{join as A}from"path";var $t=["trigger.config.ts","trigger.config.mts","trigger.config.js","trigger.config.mjs"],Vt=["./src/trigger","./trigger"],Gt=/\bdirs\s*:\s*\[([^\]]*)\]/,Kt=/["'`]([^"'`]+)["'`]/g,Bt=["","apps","packages","services"],Xt=d("framework-task-surface",{clearGroups:["whole-project"]});function qt(t){return Xt.get(t,()=>Ut(t))}function Oe(t,e){let n=g(e);return qt(t).directories.some(r=>n===r.directory||n.startsWith(`${r.directory}/`))}function Ut(t){let e=new Map;for(let n of Wt(t.config.projectRoot))for(let r of Ht(t,n))e.has(r)||e.set(r,{directory:r,framework:"trigger.dev",config:n});return{directories:[...e.values()].sort((n,r)=>n.directory.localeCompare(r.directory))}}function Wt(t){let e=[],n=r=>{for(let i of $t){let o=r?`${r}/${i}`:i;Z(A(t,o))&&e.push(o)}};n("");for(let r of Bt.slice(1)){let i=A(t,r);if(!Z(i))continue;let o;try{o=Ot(i)}catch{continue}for(let s of o)n(`${r}/${s}`)}return e}function Ht(t,e){let n;try{n=x(t.config.projectRoot,e,{inputKind:"framework task config"})}catch(a){return P(a)?[]:[]}let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=Gt.exec(n)?.[1],o=i?[...i.matchAll(Kt)].map(a=>a[1]):Vt,s=[];for(let a of o){let c=g(A(r,a)).replace(/\/+$/,"");c===""||c.startsWith("..")||Z(A(t.config.projectRoot,c))&&s.push(c)}return s}function Yt(t){return Zt.get(t,()=>{let n=b(t,{includeIgnored:!1}).filter(s=>{let a=y(s);return a==="entry"||a==="worker"});if(n.length===0)return new Set;let r=I(t),i=new Set,o=new Set;for(;n.length>0;){let s=n.shift();if(!i.has(s)){i.add(s),y(s)==="barrel"&&o.add(s);for(let a of r.get(s)??[])i.has(a)||n.push(a)}}return o})}var Zt=d("live-barrels",{clearGroups:["whole-project"]});function zt(t,e){return Yt(t).has(g(e))}function Ve(t,e){let n=g(e),r=y(e);return r==="entry"||r==="worker"||Sn(n)||Oe(t,n)||Ne(t,n)||zt(t,n)}function Jt(t,e,n){let r=g(n),i=[];W(t,r)&&i.push("package-surface-file"),tn(t,e,r)&&i.push("transitive-package-surface"),je(t,e,r)&&i.push("rust-public-library"),gn(e,r)&&i.push("framework-entrypoint");let o=t.config.entryRoots;return o&&(o.files?.some(s=>g(s)===r)&&i.push("configured-file"),o.pathPrefixes?.some(s=>r.startsWith(g(s)))&&i.push("configured-path-prefix"),o.qualifiedVars?.some(s=>yn(e,s))&&i.push("configured-qualified-var"),o.symbolPatterns?.some(s=>{try{return Ee(s,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&i.push("configured-symbol-pattern")),i}function Ge(t,e,n){return Jt(t,e,n).length>0}var Qt=d("package-surface-reachability",{clearGroups:["whole-project"]}),en=d("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function tn(t,e,n){let r=nn(t).get(n);return r===void 0?!1:r===null||r.has(D(e))}function hr(t,e,n){let r=rn(t).get(n);return r===void 0?!1:r===null||r.has(D(e))}function nn(t){return Qt.get(t,()=>Ke(t,e=>W(t,e)))}function rn(t){return en.get(t,()=>Ke(t,e=>ve(t,e)))}function Ke(t,e){let n=new Map,r=[];for(let i of b(t,{includeIgnored:!1}))e(i)&&(n.set(i,null),r.push(i));for(;r.length>0;){let i=r.shift(),o=n.get(i);if(o!==void 0)for(let s of le(t,i)){if(!s.sourcePath||t.isIgnored(s.sourcePath))continue;let a=on(o,s);a!==void 0&&sn(n,s.sourcePath,a)&&r.push(s.sourcePath)}}return n}function on(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function sn(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let i=!1;for(let o of n)r.has(o)||(r.add(o),i=!0);return i}var Be=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),an=new Set(["default","generateMetadata","generateStaticParams"]),cn=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),ln=new Set(["default","middleware","config"]),fn=new Set(["register","onRequestError"]),un=new Set(["onRouterTransitionStart"]),dn=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),mn=new Set(["load","actions","entries",...Be]),pn=new Set(["default"]);function gn(t,e){let n=D(t);return n===""?!1:Xe(e)?Be.has(n):qe(e)?an.has(n):Ue(e)?cn.has(n):We(e)?ln.has(n):He(e)?fn.has(n):Ye(e)?un.has(n):Ze(e)?dn.has(n):ze(e)?mn.has(n):bn(e)?pn.has(n):!1}function Sn(t){return Xe(t)||qe(t)||Ue(t)||We(t)||He(t)||Ye(t)||Ze(t)||ze(t)}function Xe(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function qe(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ue(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function We(t){return z(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function He(t){return z(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function Ye(t){return z(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function z(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function Ze(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function ze(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function bn(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function yn(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),i=e.slice(n+1);return t.includes($e(r)+"/")&&t.includes($e(i)+".")}function $e(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}function J(t,e,n={}){let r=new Map;if(e&&e.length===0)return r;let i=b(t,{includeIgnored:!1}),o=Re(t),s=e??me(t),a=new Set(s.map(f=>f.symbolId)),c=Dn(s);return hn(t,r,i,o,a,c),Rn(t,r,s,a),En(t,r,i,o,a,c),n.semantic!==!1&&n.semanticEvidence&&wn(r,n.semanticEvidence.callerMap(t,Tn(s))),r}function hn(t,e,n,r,i,o){for(let s of n){if(!k(s))continue;let a=ae(t,s);if(a)for(let c of a){if(o&&!o.has(c.calleeLeaf))continue;let f=ye(s,r.get(c.calleeLeaf)??[]);if(!f||f.length===0)continue;let l=he(t,s,f,c.memberAccess,c.calleeQualifier);l&&i.has(l.symbolId)&&l.file!==s&&Q(e,l.symbolId,s)}}}function Rn(t,e,n,r){let i=kn(n);for(let o of xn(t,r))t.isIgnored(o.relative_path)||Pn(o,i.get(o.symbol_id))||Q(e,o.symbol_id,o.relative_path)}function xn(t,e){return Se(t,e?[...e]:void 0)}function kn(t){let e=new Map;for(let n of t)e.set(n.symbolId,{docId:n.documentId,startLine:n.startLine,endLine:n.endLine});return e}function Pn(t,e){return!!e&&e.docId===t.document_id&&t.chunk_start>=e.startLine&&t.chunk_end<=e.endLine}function En(t,e,n,r,i,o){for(let s of n){if(k(s)!=="rust")continue;let a=E(t,s,{includeRustAttributeNames:!0});if(a.length!==0)for(let{name:c}of a){if(o&&!o.has(c))continue;let f=r.get(c);if(f)for(let l of f)i.has(l.symbolId)&&l.file!==s&&Q(e,l.symbolId,s)}}}function Q(t,e,n){let r=t.get(e);r||(r=new Set,t.set(e,r)),r.add(n)}function Dn(t){let e=new Set;for(let n of t){let r="leaf"in n&&typeof n.leaf=="string"?n.leaf:"symbol"in n&&typeof n.symbol=="string"?D(n.symbol):"";r&&e.add(r)}return e.size>0?e:null}function Tn(t){return t.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function wn(t,e){for(let[n,r]of e){let i=t.get(n);i||(i=new Set,t.set(n,i));for(let o of r)i.add(o)}}var Fn=d("cross-file-caller-files",{clearGroups:["whole-project","source-file"]}),Mn=d("source-fallback-caller-files",{clearGroups:["whole-project","source-file"]});function Je(t,e,n){let r=e.filter(o=>!t.has(o.symbolId));if(r.length>0){let o=n(r);for(let s of r)t.set(s.symbolId,o.get(s.symbolId)??new Set)}let i=new Map;for(let o of e){let s=t.get(o.symbolId);s&&s.size>0&&i.set(o.symbolId,new Set(s))}return i}function ee(t,e,n={}){if(e===void 0)return J(t,e,n);let r=Je(Fn.get(t,()=>new Map),e,i=>J(t,i,{semantic:!1}));return n.semantic===!1||!n.semanticEvidence?r:et(r,n.semanticEvidence.callerMap(t,e.filter(i=>"relativePath"in i&&"symbol"in i&&"leaf"in i)))}function te(t,e,n={}){return n.skipPath?q(t,e,n):Je(Mn.get(t,()=>new Map),e,r=>q(t,r))}function Qe(t,e,n={}){let r=ee(t,e,{semantic:n.semantic,semanticEvidence:n.semanticEvidence});return n.sourceFallback===!1?r:et(r,te(t,e))}function et(t,e){let n=new Map;for(let[r,i]of t)n.set(r,new Set(i));for(let[r,i]of e){let o=n.get(r)??new Set;for(let s of i)o.add(s);n.set(r,o)}return n}function tt(t,e,n){let r=e.identifierResolution==="strict"?X:Pe,i=e.candidateNames?xe(e.candidateNames):null,o=0,s=0,a=0,c=0,f="";for(let l of e.paths)if(o+=1,f=l,!(!k(l)&&!(e.includeVueSfc&&se(l)))&&!t.isIgnored(l)&&!e.skipPath?.(l))try{if(i&&!ke(ie(t,l),i))continue;s+=1;let M=(m,S,$,w)=>{if(e.candidateNames&&!e.candidateNames.has(m))return;a+=1;let v=e.resolveTargets?e.resolveTargets({sourceFile:l,name:m,kind:S,defaultTargets:w}):w();for(let V of v)c+=1,n({sourceFile:l,name:m,target:V,occurrences:$,kind:S})},O=be(t,l);for(let[m,S]of O)M(m,"identifier",S.length,()=>r(t,l,m));for(let m of E(t,l,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let S=m.kind==="cross-language-dispatch"?()=>X(t,l,m.name):()=>r(t,l,m.name);M(m.name,m.kind,m.occurrences,S)}}finally{e.afterPath?.(l),o%10===0&&ne("source-reference-scan.progress",()=>{},()=>({scannedPaths:o,currentPath:f,candidateMatchedPaths:s,visitedNames:a,visitedHits:c}))}}function nt(t,e={}){let{scope:n,files:r,minLoc:i=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:s,excludeEntrySurfaces:a=!1,excludeTypesFiles:c=!1,excludeRootedSymbols:f=!1,requireFunctionLikeSymbol:l=!1,requireCallableSymbol:N=!1,excludeRustTraitImplMembers:M=!1,includeSuppressed:O=!1,sortByLocDesc:m=!1}=e,S=[],$=vn(t,{scope:n,files:r,requireFunctionLikeSymbol:l,requireCallableSymbol:N}),w=new Map,v=new Map,V=u=>{let p=w.get(u);if(p!==void 0)return p;let R=Ve(t,u);return w.set(u,R),R},it=u=>{let p=v.get(u);if(p!==void 0)return p;let R=y(u);return v.set(u,R),R};for(let u of $){let p=u.relativePath;if(t.isIgnored(p)||a&&V(p)||!Cn(u,{requireFunctionLikeSymbol:l,requireCallableSymbol:N})||s!==void 0&&u.symbol===s)continue;let R=L(u);R<i||R>o||c&&In(p)||f&&Ge(t,u.symbol,p)||M&&ue(u.symbol)||it(p)!=="test"&&(de(u.symbol)||!O&&C(t,p,u.startLine)||S.push(u))}return m?S.sort((u,p)=>L(p)-L(u)):S}function vn(t,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>T(t,r)):e.requireCallableSymbol?B(t,{scope:e.scope,symbolMatches:G,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?B(t,{scope:e.scope,symbolMatches:K,sqlPrefilter:"function-like"}):ge(t,e.scope)}function Cn(t,e){return e.requireCallableSymbol?G(t.symbol):e.requireFunctionLikeSymbol?K(t.symbol):t.isFunctionLike}function In(t){return(t.split("/").pop()??"").includes("types")}var rt=class{constructor(e){this.db=e}db;scopedDefinitions(e){return pe(this.db,e)}definitionsForFile(e){return T(this.db,e)}productionCallableDefinitions(e={}){return nt(this.db,e)}calleeMap(e,n={}){return De(this.db,e,{...n,semanticEvidence:_})}crossFileCallerMap(e,n={}){return ee(this.db,e,{...n,semanticEvidence:_})}sourceFallbackCallerFiles(e,n={}){return te(this.db,e,n)}callerFileMap(e,n={}){return Qe(this.db,e,{...n,semanticEvidence:_})}frameworkReferencedSymbolIds(e){let n=new Map;for(let i of e){if(!i.leaf)continue;let o=n.get(i.leaf)??[];o.push(i.symbolId),n.set(i.leaf,o)}let r=new Set;for(let i of b(this.db,{includeIgnored:!1}))if(k(i)==="rust")for(let{name:o}of E(this.db,i,{includeRustAttributeNames:!0}))for(let s of n.get(o)??[])r.add(s);return r}symbolsWithNonSelfCallees(e,n={}){if(e.length===0)return new Set;let r=new Map(e.map(o=>[o.symbolId,o.symbol])),i=this.calleeMap(e,n);return new Set([...i.entries()].filter(([o,s])=>{let a=r.get(o);return s.some(c=>c.symbol!==a)}).map(([o])=>o))}fileDependencyGraph(e){return I(this.db,e)}fileKind(e){return y(e)}hasSuppressionComment(e){return C(this.db,e.relativePath,e.startLine)}sourceFiles(){return ce(this.db)}scanSourceReferences(e,n){tt(this.db,e,n)}callableSignature(e){let n=fe(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return n?{paramCount:n.paramCount}:null}};export{Ve as a,Jt as b,hr as c,nt as d,rt as e};
4
+ //# sourceMappingURL=chunk-JFMI5SGB.js.map