scip-query 0.22.0 → 0.23.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 (386) hide show
  1. package/CHANGELOG.md +257 -0
  2. package/README.md +11 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-XI2CSWEY.js +2 -0
  5. package/dist/call-graph-UONR6JR5.js +2 -0
  6. package/dist/{chunk-FGNCOQUX.js → chunk-2E7CX53V.js} +2 -2
  7. package/dist/chunk-2GRUZAQF.js +43 -0
  8. package/dist/{chunk-DPWKKNKI.js → chunk-2LDBDR6J.js} +2 -2
  9. package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
  10. package/dist/{chunk-XGGBK66W.js → chunk-2R3V3PSD.js} +2 -2
  11. package/dist/chunk-2WC2OEDO.js +4 -0
  12. package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
  13. package/dist/{chunk-2RE5OCHZ.js → chunk-3D3QG236.js} +2 -2
  14. package/dist/{chunk-D2MVJSP4.js → chunk-3FHOF22C.js} +2 -2
  15. package/dist/{chunk-7XZGZBSQ.js → chunk-3JKSW6LJ.js} +2 -2
  16. package/dist/chunk-3L2ZBPEX.js +133 -0
  17. package/dist/{chunk-NVSZNESQ.js → chunk-3PJABJSU.js} +2 -2
  18. package/dist/{chunk-WOOAY3PA.js → chunk-3SVF22I5.js} +2 -2
  19. package/dist/{chunk-YAGYMBEX.js → chunk-3WR4E3A3.js} +2 -2
  20. package/dist/chunk-4FTZ4P5G.js +2 -0
  21. package/dist/{chunk-F24G5NBE.js → chunk-4ILJCCXV.js} +2 -2
  22. package/dist/chunk-4UX2F3JX.js +2 -0
  23. package/dist/chunk-4WNW27SX.js +2 -0
  24. package/dist/chunk-5ENOG4VP.js +61 -0
  25. package/dist/{chunk-RHHCLWQ6.js → chunk-64BFSI5I.js} +2 -2
  26. package/dist/chunk-66DVSJQG.js +455 -0
  27. package/dist/{chunk-ISWFRGJ6.js → chunk-6HFCYNYE.js} +2 -2
  28. package/dist/{chunk-Y2VM4CJC.js → chunk-6I6L7Z62.js} +2 -2
  29. package/dist/{chunk-CKRWA452.js → chunk-6PQNKL3G.js} +2 -2
  30. package/dist/{chunk-GPGRZJ3R.js → chunk-6V5CNXL6.js} +2 -2
  31. package/dist/chunk-6VVV4WRR.js +4 -0
  32. package/dist/{chunk-BDGTPN27.js → chunk-7BWFZPPZ.js} +2 -2
  33. package/dist/{chunk-25GWKRUZ.js → chunk-7CYG22FH.js} +2 -2
  34. package/dist/chunk-7F45LJKI.js +2 -0
  35. package/dist/{chunk-4TQU4TX2.js → chunk-7IWV2EG3.js} +2 -2
  36. package/dist/{chunk-UDY7MIAW.js → chunk-AFHTBORT.js} +2 -2
  37. package/dist/chunk-AVRYW5OZ.js +2 -0
  38. package/dist/chunk-B3PYOSCX.js +2 -0
  39. package/dist/{chunk-RNKPYYYE.js → chunk-B5D7QPBE.js} +2 -2
  40. package/dist/{chunk-FFJQZG6J.js → chunk-BBCIS4DX.js} +2 -2
  41. package/dist/chunk-BDUVI7TO.js +3 -0
  42. package/dist/{chunk-BVFYEEBH.js → chunk-BE7ZZTMC.js} +2 -2
  43. package/dist/{chunk-NEIQPFBI.js → chunk-BHVUJOCQ.js} +2 -2
  44. package/dist/chunk-BKVWUP7Y.js +2 -0
  45. package/dist/{chunk-IJMD6BRI.js → chunk-BQGB4HBD.js} +2 -2
  46. package/dist/{chunk-ERCYGVAM.js → chunk-BRV7PIFF.js} +2 -2
  47. package/dist/chunk-CEEZJXEF.js +2 -0
  48. package/dist/{chunk-BTVKZGWT.js → chunk-CIYLO6SI.js} +2 -2
  49. package/dist/chunk-CJZXN4NU.js +2 -0
  50. package/dist/{chunk-VXJJTQYE.js → chunk-CNO7TOKL.js} +2 -2
  51. package/dist/{chunk-ZZ3Z7D56.js → chunk-COF23M5F.js} +2 -2
  52. package/dist/{chunk-ZGW4HLPD.js → chunk-CWFP7GM5.js} +2 -2
  53. package/dist/chunk-D2DHWI3D.js +2 -0
  54. package/dist/{chunk-Q55NF3ZG.js → chunk-D4N5SQ2M.js} +2 -2
  55. package/dist/{chunk-LXQUF2RP.js → chunk-DBRSYFXR.js} +2 -2
  56. package/dist/{chunk-PXXYQK55.js → chunk-DHUIOLDT.js} +2 -2
  57. package/dist/{chunk-KZYID5KV.js → chunk-DIRJWYBM.js} +2 -2
  58. package/dist/{chunk-IKVNEGTW.js → chunk-DIUFNHRJ.js} +2 -2
  59. package/dist/{chunk-CLG6DWVS.js → chunk-DTZCKZEU.js} +2 -2
  60. package/dist/{chunk-Z2PZVKPR.js → chunk-DULC3QFP.js} +2 -2
  61. package/dist/{chunk-AYPDH2LU.js → chunk-DYGHBZ2N.js} +2 -2
  62. package/dist/{chunk-JJ62MTQH.js → chunk-E5R6AQ73.js} +2 -2
  63. package/dist/{chunk-BWVQP3LB.js → chunk-E73UNJTF.js} +2 -2
  64. package/dist/{chunk-GVOMSPGL.js → chunk-EG2CPZMJ.js} +2 -2
  65. package/dist/{chunk-56NQAEPJ.js → chunk-EKV5HX33.js} +2 -2
  66. package/dist/{chunk-GDRJB3SB.js → chunk-EQHFIL6T.js} +2 -2
  67. package/dist/{chunk-EWWY2ZFL.js → chunk-ESIQ66Z7.js} +2 -2
  68. package/dist/chunk-EVFUMY4R.js +3 -0
  69. package/dist/{chunk-ZYM4HOFA.js → chunk-F7DY272B.js} +2 -2
  70. package/dist/chunk-FBN2FGXG.js +2 -0
  71. package/dist/{chunk-AZS7YPCB.js → chunk-FDLOBR6P.js} +2 -2
  72. package/dist/chunk-FESCRNVV.js +5 -0
  73. package/dist/{chunk-URSGGIZX.js → chunk-FFRKR4EQ.js} +2 -2
  74. package/dist/chunk-FGA2U4OR.js +8 -0
  75. package/dist/{chunk-7YQOCABQ.js → chunk-FIQRSHVM.js} +2 -2
  76. package/dist/{chunk-KFVSJX25.js → chunk-FPYLNQPT.js} +2 -2
  77. package/dist/{chunk-FELGD32K.js → chunk-FRUSVINH.js} +2 -2
  78. package/dist/chunk-GAS2LJMP.js +3 -0
  79. package/dist/{chunk-OTSPRVNW.js → chunk-GSP44ENC.js} +2 -2
  80. package/dist/{chunk-K3XFWJI2.js → chunk-GUFSG5TX.js} +2 -2
  81. package/dist/chunk-GYIZ4NXB.js +2 -0
  82. package/dist/{chunk-2OXVP5U5.js → chunk-GZIUDL6G.js} +2 -2
  83. package/dist/chunk-HCXEQRFF.js +18 -0
  84. package/dist/{chunk-LO5JSW2C.js → chunk-HEHOQQKH.js} +2 -2
  85. package/dist/{chunk-U2N2KE7A.js → chunk-HKGFPJ4T.js} +2 -2
  86. package/dist/chunk-HLZTEXRA.js +2 -0
  87. package/dist/{chunk-EELPBR7E.js → chunk-HOENASQM.js} +2 -2
  88. package/dist/{chunk-VTCIYFEK.js → chunk-HVF5VBG6.js} +2 -2
  89. package/dist/{chunk-TH6IC56G.js → chunk-HYO3NP5Q.js} +2 -2
  90. package/dist/{chunk-OPSAW5DT.js → chunk-I55I7XXP.js} +2 -2
  91. package/dist/{chunk-DEAB5TGT.js → chunk-IDFEUFKS.js} +2 -2
  92. package/dist/{chunk-DJAO2OZJ.js → chunk-IHGQTTVW.js} +2 -2
  93. package/dist/{chunk-XU75YQN4.js → chunk-IICPE7B2.js} +2 -2
  94. package/dist/{chunk-GY7CCCEZ.js → chunk-IL676XCC.js} +2 -2
  95. package/dist/{chunk-4HE7MVWD.js → chunk-ILTDAWEF.js} +2 -2
  96. package/dist/chunk-IZDPJ2QI.js +2 -0
  97. package/dist/{chunk-5YRQIE2B.js → chunk-J66VOFW6.js} +2 -2
  98. package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
  99. package/dist/{chunk-QLBSG7U5.js → chunk-JGKUET5J.js} +2 -2
  100. package/dist/{chunk-VZ7NXSHV.js → chunk-JS4PGXMV.js} +2 -2
  101. package/dist/{chunk-ZAZGGSM3.js → chunk-JTQVMR42.js} +2 -2
  102. package/dist/chunk-JWTGMPIT.js +80 -0
  103. package/dist/{chunk-5ZMBRQFC.js → chunk-JYR66JN5.js} +2 -2
  104. package/dist/chunk-KLFEXGQA.js +2 -0
  105. package/dist/chunk-KYSDI3GE.js +5 -0
  106. package/dist/{chunk-MSR2QRUE.js → chunk-L6PJPETJ.js} +2 -2
  107. package/dist/{chunk-VU6LIWHT.js → chunk-LDVT66YM.js} +2 -2
  108. package/dist/chunk-LEECKFCJ.js +2 -0
  109. package/dist/{chunk-H7CG6LOE.js → chunk-LMZ5PRUV.js} +2 -2
  110. package/dist/{chunk-ZPASRBLF.js → chunk-LQRQN2XA.js} +2 -2
  111. package/dist/{chunk-HISEUIL2.js → chunk-LXABEJX3.js} +2 -2
  112. package/dist/{chunk-WHADK6OS.js → chunk-M2O5NY6W.js} +2 -2
  113. package/dist/{chunk-Y334QQU5.js → chunk-MNV5FSBW.js} +2 -2
  114. package/dist/{chunk-RYOYJMGF.js → chunk-MPQ4OTBM.js} +2 -2
  115. package/dist/{chunk-6NC3YSPY.js → chunk-MV3CDXPI.js} +2 -2
  116. package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
  117. package/dist/chunk-N2ZSIIGR.js +117 -0
  118. package/dist/chunk-N5B2NILC.js +5 -0
  119. package/dist/{chunk-Q6T2CAJL.js → chunk-NJITK2GP.js} +2 -2
  120. package/dist/{chunk-ENWQWA2R.js → chunk-NOGJXYFO.js} +2 -2
  121. package/dist/{chunk-V4NG5OMS.js → chunk-NOYBFVJA.js} +106 -106
  122. package/dist/chunk-NWQXSFFU.js +3 -0
  123. package/dist/chunk-ODDUPDP7.js +13 -0
  124. package/dist/{chunk-A77SCPW2.js → chunk-OLIWTZI3.js} +2 -2
  125. package/dist/{chunk-XFMVKFSF.js → chunk-OLNV6I6U.js} +2 -2
  126. package/dist/{chunk-QKT4UI2Y.js → chunk-OR2E3AGZ.js} +2 -2
  127. package/dist/chunk-OSR2GEHQ.js +2 -0
  128. package/dist/{chunk-5H5WTJSD.js → chunk-OSSESPDX.js} +2 -2
  129. package/dist/{chunk-KQHJEU6V.js → chunk-OWOOWNJ5.js} +2 -2
  130. package/dist/{chunk-GRX7JOXQ.js → chunk-P42EIXTA.js} +2 -2
  131. package/dist/{chunk-AQ2PORIO.js → chunk-PJFGPYTU.js} +2 -2
  132. package/dist/{chunk-LRI5OMPE.js → chunk-PP7KNN7L.js} +2 -2
  133. package/dist/{chunk-PLJUQFQN.js → chunk-PU7T5QYQ.js} +2 -2
  134. package/dist/{chunk-JUN5DOAK.js → chunk-PWWAJSKV.js} +2 -2
  135. package/dist/{chunk-7IQXARSQ.js → chunk-PZL5T7SU.js} +2 -2
  136. package/dist/{chunk-UAQ4T73O.js → chunk-QBE3YX64.js} +2 -2
  137. package/dist/{chunk-3TJY6M3B.js → chunk-QGVTFRY2.js} +2 -2
  138. package/dist/chunk-QOJONDS7.js +2 -0
  139. package/dist/chunk-QU5XRYB5.js +4 -0
  140. package/dist/{chunk-2KVU55CW.js → chunk-QUU5OBVK.js} +2 -2
  141. package/dist/{chunk-Q5TA4OY4.js → chunk-RBLQNW26.js} +2 -2
  142. package/dist/chunk-RTQ7NEKG.js +81 -0
  143. package/dist/{chunk-F24QUEQP.js → chunk-SQXRS7BG.js} +2 -2
  144. package/dist/chunk-SSK6LDPC.js +2 -0
  145. package/dist/chunk-SZHGTCPP.js +7 -0
  146. package/dist/chunk-T4N4P2K5.js +16 -0
  147. package/dist/chunk-TA3QKLLU.js +2 -0
  148. package/dist/chunk-TEBQMNVI.js +43 -0
  149. package/dist/{chunk-NK3JMP22.js → chunk-TPFHAQ2G.js} +2 -2
  150. package/dist/chunk-TQPCBMWT.js +5 -0
  151. package/dist/{chunk-HG722PO7.js → chunk-TRNAEQ6P.js} +2 -2
  152. package/dist/chunk-TY7CRN3Z.js +2 -0
  153. package/dist/{chunk-7XA3OM44.js → chunk-UHFYCMZO.js} +2 -2
  154. package/dist/{chunk-ARVO6TTW.js → chunk-UICY4GTQ.js} +2 -2
  155. package/dist/{chunk-SWK4XPUS.js → chunk-UVGEWT4Y.js} +2 -2
  156. package/dist/{chunk-GIQ6CSL4.js → chunk-UXW33INU.js} +2 -2
  157. package/dist/{chunk-RDULNRSJ.js → chunk-VMPRET3I.js} +2 -2
  158. package/dist/{chunk-I6UTXNHU.js → chunk-VNLGKHS6.js} +2 -2
  159. package/dist/{chunk-44T4DUAA.js → chunk-VQILFTEH.js} +2 -2
  160. package/dist/{chunk-N7FP5H5U.js → chunk-VUPHCS7Y.js} +8 -8
  161. package/dist/{chunk-JAT6C3VX.js → chunk-VVZSBTSU.js} +2 -2
  162. package/dist/{chunk-FBCVASUG.js → chunk-VZRNID6A.js} +2 -2
  163. package/dist/{chunk-TUQIPUDS.js → chunk-W5OXRYGE.js} +2 -2
  164. package/dist/chunk-W6STWDQI.js +57 -0
  165. package/dist/chunk-W7CXK74K.js +2 -0
  166. package/dist/chunk-WB3WYIRE.js +4 -0
  167. package/dist/{chunk-C76O5MDS.js → chunk-WDNVY4E7.js} +2 -2
  168. package/dist/{chunk-TAYD3AE7.js → chunk-WIWY3CRX.js} +2 -2
  169. package/dist/chunk-WK46TNUM.js +3 -0
  170. package/dist/chunk-WNTFFKAX.js +12 -0
  171. package/dist/{chunk-JFQBRL3J.js → chunk-WOIKCX6A.js} +2 -2
  172. package/dist/{chunk-PIFTZEEM.js → chunk-WUN6KBHV.js} +2 -2
  173. package/dist/chunk-WYCTJDVR.js +2 -0
  174. package/dist/chunk-WYPL7GF7.js +2 -0
  175. package/dist/{chunk-XN22RGSR.js → chunk-XBGWL66K.js} +2 -2
  176. package/dist/{chunk-R6M456QG.js → chunk-XDQMU3BT.js} +2 -2
  177. package/dist/{chunk-XJX6LGHL.js → chunk-XFA4SSO3.js} +2 -2
  178. package/dist/{chunk-2YC7YNKT.js → chunk-XGZEP6GR.js} +2 -2
  179. package/dist/chunk-XPDPNWTQ.js +368 -0
  180. package/dist/chunk-XRYABF57.js +8 -0
  181. package/dist/{chunk-YIHNPKWD.js → chunk-YBGKCQIS.js} +2 -2
  182. package/dist/{chunk-2XCGSDIT.js → chunk-YEN6CYC7.js} +2 -2
  183. package/dist/{chunk-VMWUV6WB.js → chunk-YF5IB2LF.js} +2 -2
  184. package/dist/{chunk-TNG2FYS5.js → chunk-YI2AWIHC.js} +2 -2
  185. package/dist/{chunk-EELG7D3Q.js → chunk-YPWBKGFU.js} +2 -2
  186. package/dist/{chunk-GQIDEID3.js → chunk-YPWHBBIS.js} +2 -2
  187. package/dist/{chunk-TKDNDQA7.js → chunk-YSH6U3L4.js} +2 -2
  188. package/dist/{chunk-BUTEIZKP.js → chunk-YU5DZUZI.js} +2 -2
  189. package/dist/chunk-YWO5DDRC.js +16 -0
  190. package/dist/{chunk-6HRZQLOI.js → chunk-Z4CDXYNQ.js} +2 -2
  191. package/dist/{chunk-XSWYJCAK.js → chunk-ZF5KHH7C.js} +2 -2
  192. package/dist/chunk-ZOHS7AQV.js +21 -0
  193. package/dist/{chunk-7U2YQSDE.js → chunk-ZTI4SBFV.js} +2 -2
  194. package/dist/cli-main.js +2 -2
  195. package/dist/code-MI6F2TTU.js +2 -0
  196. package/dist/code-result-json-FXALY4HE.js +2 -0
  197. package/dist/{command-descriptors-ORNTVNYV.js → command-descriptors-P34VABY5.js} +136 -135
  198. package/dist/dataflow-4KEMJPC6.js +2 -0
  199. package/dist/dependence-slice-R7FPWD5M.js +2 -0
  200. package/dist/deps-7EMQUYUT.js +2 -0
  201. package/dist/direct-navigation-6YO234F2.js +3 -0
  202. package/dist/entry-map-KOOLR26E.js +2 -0
  203. package/dist/files-OPIPJIGZ.js +2 -0
  204. package/dist/hierarchy-QPD2CAER.js +2 -0
  205. package/dist/imports-M6HUXRXC.js +2 -0
  206. package/dist/index.js +1 -1
  207. package/dist/members-I5MEFOCT.js +2 -0
  208. package/dist/methods-5JYGGHXA.js +2 -0
  209. package/dist/output-continuation-command-UPQAAKBP.js +3 -0
  210. package/dist/postinstall.js +1 -1
  211. package/dist/project-reindex-UKKQ5PLS.js +3 -0
  212. package/dist/queries/affected.js +1 -1
  213. package/dist/queries/anchors.js +1 -1
  214. package/dist/queries/architecture.js +1 -1
  215. package/dist/queries/bottlenecks.js +1 -1
  216. package/dist/queries/by-kind.js +1 -1
  217. package/dist/queries/call-graph.js +1 -1
  218. package/dist/queries/change-surface.js +1 -1
  219. package/dist/queries/cleanup-plan.js +1 -1
  220. package/dist/queries/co-change.js +1 -1
  221. package/dist/queries/code.js +1 -1
  222. package/dist/queries/complexity-hotspots.js +1 -1
  223. package/dist/queries/complexity.js +1 -1
  224. package/dist/queries/context.js +1 -1
  225. package/dist/queries/convergence.js +1 -1
  226. package/dist/queries/coupling.js +1 -1
  227. package/dist/queries/cycles.js +1 -1
  228. package/dist/queries/dataflow.js +1 -1
  229. package/dist/queries/dead.js +1 -1
  230. package/dist/queries/decorative-checkers.js +1 -1
  231. package/dist/queries/deep-chains.js +1 -1
  232. package/dist/queries/dependence-slice.js +1 -1
  233. package/dist/queries/dependency-depth.js +1 -1
  234. package/dist/queries/deps.js +1 -1
  235. package/dist/queries/diff-impact.d.ts +9 -0
  236. package/dist/queries/diff-impact.js +1 -1
  237. package/dist/queries/doc-drift.js +1 -1
  238. package/dist/queries/drift.js +1 -1
  239. package/dist/queries/duplicate-bodies.js +1 -1
  240. package/dist/queries/entry-map.js +1 -1
  241. package/dist/queries/evidence.js +1 -1
  242. package/dist/queries/extract-candidates.js +1 -1
  243. package/dist/queries/fan.js +1 -1
  244. package/dist/queries/files.js +1 -1
  245. package/dist/queries/health.js +1 -1
  246. package/dist/queries/hierarchy.js +1 -1
  247. package/dist/queries/hotspots.js +1 -1
  248. package/dist/queries/imports.js +1 -1
  249. package/dist/queries/incomplete-migration.js +1 -1
  250. package/dist/queries/index.js +1 -1
  251. package/dist/queries/isolated.js +1 -1
  252. package/dist/queries/locality-candidates.js +1 -1
  253. package/dist/queries/members.js +1 -1
  254. package/dist/queries/methods.js +1 -1
  255. package/dist/queries/not-implemented.js +1 -1
  256. package/dist/queries/outline.js +1 -1
  257. package/dist/queries/passthrough-candidates.js +1 -1
  258. package/dist/queries/plan-context.js +1 -1
  259. package/dist/queries/react-component-duplicates.js +1 -1
  260. package/dist/queries/react-hook-candidates.js +1 -1
  261. package/dist/queries/react-large-component-pressure.js +1 -1
  262. package/dist/queries/recent-duplicates.js +1 -1
  263. package/dist/queries/redundant-reexports.js +1 -1
  264. package/dist/queries/reference-neighborhood.js +1 -1
  265. package/dist/queries/reference-reachability.js +1 -1
  266. package/dist/queries/refs.js +1 -1
  267. package/dist/queries/self-audit.js +1 -1
  268. package/dist/queries/similar-chains.js +1 -1
  269. package/dist/queries/similar-files.js +1 -1
  270. package/dist/queries/similar-signatures.js +1 -1
  271. package/dist/queries/similar.js +1 -1
  272. package/dist/queries/slice.js +1 -1
  273. package/dist/queries/source-inspection.js +1 -1
  274. package/dist/queries/source-search.js +1 -1
  275. package/dist/queries/stale-abstractions.js +1 -1
  276. package/dist/queries/surface.js +1 -1
  277. package/dist/queries/symbols.js +1 -1
  278. package/dist/queries/system-map.js +1 -1
  279. package/dist/queries/system.js +1 -1
  280. package/dist/queries/test-quality.js +1 -1
  281. package/dist/queries/trace.js +1 -1
  282. package/dist/queries/twin-ab.js +1 -1
  283. package/dist/queries/twin-drift.js +1 -1
  284. package/dist/queries/unused-imports.js +1 -1
  285. package/dist/queries/unused-params.js +1 -1
  286. package/dist/queries/value-flow.js +1 -1
  287. package/dist/queries/vue-component-duplicates.js +1 -1
  288. package/dist/queries/vue-composable-candidates.js +1 -1
  289. package/dist/queries/vue-large-view-pressure.js +1 -1
  290. package/dist/queries/wrapper-candidates.js +1 -1
  291. package/dist/query-service-server.js +3 -3
  292. package/dist/refs-PSU4JZZW.js +2 -0
  293. package/dist/refs-pagination-JG6CJMRC.js +2 -0
  294. package/dist/reindex-worker.js +25 -25
  295. package/dist/reindex.d.ts +3 -2
  296. package/dist/reindex.js +35 -35
  297. package/dist/runtime.d.ts +34 -2
  298. package/dist/runtime.js +4 -4
  299. package/dist/rust-semantic-session-server.js +1 -1
  300. package/dist/rust-semantic-session-worker.js +1 -1
  301. package/dist/rust-semantic-worker.js +1 -1
  302. package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
  303. package/dist/slice-HYRATV64.js +2 -0
  304. package/dist/surface-VTGDYWF5.js +2 -0
  305. package/dist/symbol-resolution-WD5EU5JE.js +2 -0
  306. package/dist/system-LRQNFOR2.js +2 -0
  307. package/dist/trace-F4B6OLL4.js +2 -0
  308. package/dist/typescript-mailbox-worker.js +1 -1
  309. package/dist/value-flow-VRPZY72V.js +2 -0
  310. package/dist/watch-server.js +3 -3
  311. package/package.json +1 -1
  312. package/dist/by-kind-4IYG2SKW.js +0 -2
  313. package/dist/call-graph-WQNXMNNN.js +0 -2
  314. package/dist/chunk-2BTJALUS.js +0 -454
  315. package/dist/chunk-3QXC54FQ.js +0 -3
  316. package/dist/chunk-42W3LFUK.js +0 -13
  317. package/dist/chunk-4GAQ6FI4.js +0 -43
  318. package/dist/chunk-6VEFRPTD.js +0 -5
  319. package/dist/chunk-7C26EKLZ.js +0 -4
  320. package/dist/chunk-7JYHQAH2.js +0 -22
  321. package/dist/chunk-7KSO2OAP.js +0 -2
  322. package/dist/chunk-AK3PYTIK.js +0 -5
  323. package/dist/chunk-AMIMMNA4.js +0 -11
  324. package/dist/chunk-AUY5BL74.js +0 -2
  325. package/dist/chunk-BDHFVH2M.js +0 -18
  326. package/dist/chunk-BECZLYNU.js +0 -8
  327. package/dist/chunk-BYDAFMSR.js +0 -57
  328. package/dist/chunk-BZYSGZRK.js +0 -2
  329. package/dist/chunk-C7IJMOFP.js +0 -134
  330. package/dist/chunk-CBBHFNLX.js +0 -2
  331. package/dist/chunk-D35XIZGN.js +0 -2
  332. package/dist/chunk-DKM723YF.js +0 -79
  333. package/dist/chunk-E44IVWIJ.js +0 -367
  334. package/dist/chunk-EDMB6SSO.js +0 -7
  335. package/dist/chunk-EETGXQY7.js +0 -3
  336. package/dist/chunk-FKGQOTKD.js +0 -2
  337. package/dist/chunk-GH5YSGZL.js +0 -5
  338. package/dist/chunk-HCVJR2V4.js +0 -3
  339. package/dist/chunk-HXOU4XNH.js +0 -3
  340. package/dist/chunk-IMKZEXZG.js +0 -2
  341. package/dist/chunk-ISIQLPJ2.js +0 -61
  342. package/dist/chunk-IXESDH3J.js +0 -2
  343. package/dist/chunk-JT6XX7QY.js +0 -8
  344. package/dist/chunk-MHIEP7EG.js +0 -4
  345. package/dist/chunk-OJNK5ALA.js +0 -2
  346. package/dist/chunk-OXYAWIEA.js +0 -2
  347. package/dist/chunk-OZETODHH.js +0 -2
  348. package/dist/chunk-PBUH2P5S.js +0 -3
  349. package/dist/chunk-PLYUVM4F.js +0 -2
  350. package/dist/chunk-Q7GBK5T7.js +0 -81
  351. package/dist/chunk-QWKHW6VZ.js +0 -2
  352. package/dist/chunk-RPL3ARU7.js +0 -16
  353. package/dist/chunk-SVHTMVA4.js +0 -4
  354. package/dist/chunk-T6QD2ZQB.js +0 -43
  355. package/dist/chunk-TD7VKJ2Y.js +0 -117
  356. package/dist/chunk-TUSPIVZ3.js +0 -4
  357. package/dist/chunk-UT7TADJX.js +0 -2
  358. package/dist/chunk-VUSKPCUB.js +0 -2
  359. package/dist/chunk-WN3TCGJ4.js +0 -2
  360. package/dist/chunk-WSLEJSFR.js +0 -2
  361. package/dist/chunk-WYZIHUPZ.js +0 -16
  362. package/dist/chunk-XE33FV5W.js +0 -2
  363. package/dist/chunk-Z2AWCTN6.js +0 -2
  364. package/dist/chunk-ZOXKSQQB.js +0 -2
  365. package/dist/code-EQJFDT6I.js +0 -2
  366. package/dist/code-result-json-7UWIWBOO.js +0 -2
  367. package/dist/dataflow-6VL54GX5.js +0 -2
  368. package/dist/dependence-slice-DT2NUHD2.js +0 -2
  369. package/dist/deps-DB7H5IKC.js +0 -2
  370. package/dist/direct-navigation-O3LUAYWQ.js +0 -3
  371. package/dist/entry-map-6K62RV3D.js +0 -2
  372. package/dist/files-MSLD7MO6.js +0 -2
  373. package/dist/hierarchy-IVBXAKFA.js +0 -2
  374. package/dist/imports-FRAVZ3Y2.js +0 -2
  375. package/dist/members-KJOJDYGO.js +0 -2
  376. package/dist/methods-2AYABBT3.js +0 -2
  377. package/dist/output-continuation-command-JHMPH6NC.js +0 -3
  378. package/dist/project-reindex-HYO4WD7Z.js +0 -3
  379. package/dist/refs-ARMA6XUJ.js +0 -2
  380. package/dist/refs-pagination-VUGIWN6U.js +0 -2
  381. package/dist/slice-YOB5YFAM.js +0 -2
  382. package/dist/surface-VY5EFWTW.js +0 -2
  383. package/dist/symbol-resolution-DGQN4XIV.js +0 -2
  384. package/dist/system-2KQ3QD2P.js +0 -2
  385. package/dist/trace-HTIPTXAE.js +0 -2
  386. package/dist/value-flow-5FV3VQI7.js +0 -2
@@ -1,7 +1,7 @@
1
- import{a as z}from"./chunk-XN22RGSR.js";import{b as C}from"./chunk-7KSO2OAP.js";import{c as W}from"./chunk-56NQAEPJ.js";import{b as U}from"./chunk-5YRQIE2B.js";import{d as D}from"./chunk-6NC3YSPY.js";import{a as _}from"./chunk-RYOYJMGF.js";import{a as k,b as j,e as A}from"./chunk-EELPBR7E.js";import{B as I,I as O,R as h,W as T,h as F,j as M,k as B}from"./chunk-C7IJMOFP.js";import{c as S,d as w,l as $}from"./chunk-DRENNWRG.js";import{A as P}from"./chunk-AK3PYTIK.js";import{basename as me,extname as K}from"path";var oe=12,se=280;function y(n,e,t,o){let i=ae(n,e,t,o);if(i.size===0)return ce();let r=[],a=new Set,u=(l,d,c,f)=>{if(d===e&&c<=o&&f>=t)return;let m=`${d}:${c}:${f}:${l}`;a.has(m)||(a.add(m),r.push({name:l,relativePath:d,startLine:c,endLine:f}))};for(let l of h(n,e))i.has(l.leaf)&&u(l.leaf,l.relativePath,l.startLine,l.endLine);for(let l of O(n,e)){let d=l.localName;if(!d||!i.has(d)||!l.sourcePath||l.kind==="namespace")continue;let c=l.importedName==="default"?d:l.importedName;for(let f of _(n,l.sourcePath,c,{maxReexportDepth:3}))u(d,f.relativePath,f.startLine,f.endLine)}r.sort(H);let s=r.map(l=>{let d=le(n,l);return d?{...l,source:d}:null}).filter(l=>l!==null).slice(0,oe);return x(s)}function X(n,e=[]){return x(ue(n.flatMap(t=>t?.inline??[]),e))}function ae(n,e,t,o){let i=I(n,e),r=new Set;if(!i)return r;for(let a=t;a<=o;a+=1)for(let u of i.identifiersByLine[a]??[])r.add(u);return r}function le(n,e){if(e.startLine!==e.endLine)return null;let t=(B(n,e.relativePath)[e.startLine]??"").trim();if(!t||t.length>se)return null;let o=t.indexOf("=");if(o<0||t[o+1]===">")return null;let i=t.slice(o+1).replace(/(?:\/\/|#).*$/u,"").trim();if(!i||i.includes("${")||/\b(?:function|class|struct|interface|trait|enum|lambda)\b/u.test(i))return null;let a=i.replace(/(['"`])(?:\\.|(?!\1).)*\1/gu,"").replace(/\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)n?\b/gu,""),u=new Set(["true","false","null","undefined","None","True","False"]);return(a.match(/[A-Za-z_][A-Za-z0-9_]*/gu)??[]).some(l=>!u.has(l))?null:t}function ue(n,e){let t=new Map;for(let o of n){if(de(o,e))continue;let i=`${o.relativePath}:${o.startLine}:${o.endLine}:${o.name}`;t.has(i)||t.set(i,{...o})}return[...t.values()].sort(H)}function de(n,e){return e.some(t=>t.relativePath===n.relativePath&&t.startLine<=n.startLine&&t.endLine>=n.endLine)}function H(n,e){return n.relativePath.localeCompare(e.relativePath)||n.startLine-e.startLine||n.name.localeCompare(e.name)}function x(n){return{coverage:"indexed-project-literal-values",inline:n}}function ce(){return x([])}function G(n,e){let t=W(n,e);if(!t)return[];let o=T(n,[t],{sort:!0});if(o.length===0)return[];let i=Math.max(0,M(F(n,t)).length-1),r=o.map(s=>({symbol:s.symbol,shortName:s.shortName,startLine:s.startLine,endLine:Math.min(s.endLine,i),signature:s.signature,children:[]})),a=new Map;for(let s of r)a.set(s.symbol,s);let u=[];for(let s=0;s<o.length;s++){let l=o[s],d=r[s];if(l.enclosingSymbol&&a.has(l.enclosingSymbol)){a.get(l.enclosingSymbol).children.push(d);continue}let c=null,f=1/0;for(let m of r)if(m!==d&&m.startLine<=d.startLine&&m.endLine>=d.endLine){if(m.startLine===d.startLine&&m.endLine===d.endLine&&!$(m.symbol,d.symbol))continue;let g=m.endLine-m.startLine;g<f&&(f=g,c=m)}c?c.children.push(d):u.push(d)}return u}function Je(n,e,t={}){let{context:o=0}=t,i=ie(e);if(i)return re(n,i.filePath,i.startLine,i.endLine,o);let r=ne(n,e);if(r)return Y(n,r);let a=k(n,e);return a?p(n,a,o):null}function Qe(n,e,t={}){if(e.length===0)throw new RangeError("code requires at least one selector.");if(e.length>24)throw new RangeError(`code accepts at most ${24} selectors per complete packet; received ${e.length}.`);let o=t.context??0,i=t.members??"exported",r=e.map(s=>ge(n,s,o,i)),a=r.flatMap(s=>s.results),u=a.map(s=>({relativePath:s.relativePath,startLine:s.startLine,endLine:s.endLine}));return{requested:e.length,matched:r.filter(s=>s.status==="matched").length,ambiguous:r.filter(s=>s.status==="ambiguous").length,missing:r.filter(s=>s.status==="missing").length,entries:r,bindingClosure:X(a.map(s=>s.bindingClosure),u)}}function ge(n,e,t,o){let i=ie(e);if(i){let d=re(n,i.filePath,i.startLine,i.endLine,t);return d?he(n,e,d,t):R(n,e,"definition-source-unreadable")}let r=ne(n,e);if(r)return be(n,e,r,t,o);let a=j(n,e);if(!a.match)return R(n,e,"definition-not-found");let u=Ne(n,a),s=u.map(te);if(a.total>1){let d=a.total<=4&&u.length===a.total;return{selector:e,status:"ambiguous",kind:"source",totalCandidates:a.total,results:d?u.flatMap(c=>{let f=p(n,c,t);return f?[f]:[]}):[],definitions:[],candidates:s,omittedCandidates:Math.max(0,a.total-s.length),suggestions:[]}}let l=p(n,a.match,t);return l?Re(e,l):R(n,e,"definition-source-unreadable")}function he(n,e,t,o){let i=h(n,t.relativePath).filter(l=>!Z(l,t.relativePath)),r=pe(n,t,i),a=V(r.map(l=>p(n,l,o)).filter(l=>l!==null)).filter(l=>!ee(t,l)),u=new Set(a.map(l=>l.symbol)),s=r.filter(l=>!u.has(l.symbol)&&!(t.startLine<=l.startLine&&t.endLine>=l.endLine)).map(te);return{selector:e,status:"matched",kind:"source",totalCandidates:1,results:[t,...a],definitions:[],candidates:[],omittedCandidates:0,suggestions:[],rangeCoverage:{basis:"requested-range-and-same-file-call-closure",referencedDefinitions:r.length,returnedDefinitions:r.length-s.length,returnedBodies:a.length,omittedDefinitions:s.length,omittedLedger:s}}}function pe(n,e,t){if(!b(e.freshness))return[];if(t.length===0)return[];let o=D(n,t,{additive:!1,semantic:!1}),i=new Map;for(let a of t){let u=i.get(a.symbol)??[];u.push(a),i.set(a.symbol,u)}let r=new Map;for(let a of t)if(!(a.endLine<e.startLine||a.startLine>e.endLine)){for(let u of o.get(a.symbolId)??[])if(u.file===e.relativePath&&!(u.source==="ast-callsite"&&(u.chunkId<e.startLine||u.chunkId>e.endLine)))for(let s of i.get(u.symbol)??[])r.set(s.symbolId,s)}return Q(n,[...r.values()],t)}function be(n,e,t,o,i){let r=t.relativePath,a=ye(n,r),u=b(t.freshness)?h(n,r).filter(g=>!Z(g,r)):[],s=u.filter(g=>z(n,g)),l=s.length>0?s:Ce(a,u),d=i==="all"?[]:Q(n,l,u),c=i==="all"||u.length===0?[Y(n,t)]:V(d.map(g=>p(n,g,o)).filter(g=>g!==null)),f=ve(a,c),m=Se(r,a,c),v=De(a);return{selector:e,status:"matched",kind:"file-source",totalCandidates:1,results:c,definitions:[],candidates:[],omittedCandidates:0,suggestions:[],fileCoverage:{members:i,basis:i==="all"||u.length===0?"complete-file-source":s.length>0?"explicit-exports-and-same-file-reference-closure":"top-level-and-same-file-reference-closure",totalDefinitions:v,returnedDefinitions:f,returnedBodies:c.length,omittedDefinitions:Math.max(0,v-f),omittedLedger:m}}}function Ce(n,e){let t=new Set(n.map(o=>o.symbol));return e.filter(o=>t.has(o.symbol))}function ye(n,e){return G(n,e).flatMap(t=>Le(t,e)?t.children:[t])}function Z(n,e){return J(e).has(n.leaf)}function Le(n,e){return J(e).has(w(n.symbol))}function J(n){let e=me(n);return new Set([e,e.slice(0,Math.max(0,e.length-K(e).length))])}function Q(n,e,t){if(e.length===0)return[];let o=D(n,t,{additive:!0,semantic:!1}),i=new Map;for(let u of t){let s=i.get(u.symbol)??[];s.push(u),i.set(u.symbol,s)}let r=new Map,a=[...e];for(;a.length>0;){let u=a.shift();if(!r.has(u.symbolId)){r.set(u.symbolId,u);for(let s of o.get(u.symbolId)??[])for(let l of i.get(s.symbol)??[])r.has(l.symbolId)||a.push(l)}}return[...r.values()].sort(xe)}function V(n){let e=[...n].sort((o,i)=>o.relativePath.localeCompare(i.relativePath)||o.startLine-i.startLine||i.endLine-o.endLine),t=[];for(let o of e)t.some(i=>ee(i,o))||t.push(o);return t}function Y(n,e){let t=e.text.split(`
1
+ import{a as z}from"./chunk-XBGWL66K.js";import{b as C}from"./chunk-4FTZ4P5G.js";import{c as W}from"./chunk-EKV5HX33.js";import{b as U}from"./chunk-J66VOFW6.js";import{d as D}from"./chunk-MV3CDXPI.js";import{a as _}from"./chunk-MPQ4OTBM.js";import{a as k,b as j,e as A}from"./chunk-HOENASQM.js";import{C as I,K as O,T as h,Y as T,i as F,k as M,l as B}from"./chunk-3L2ZBPEX.js";import{c as S,d as w,l as $}from"./chunk-DRENNWRG.js";import{m as P}from"./chunk-KYSDI3GE.js";import{basename as me,extname as K}from"path";var oe=12,se=280;function y(n,e,t,o){let i=ae(n,e,t,o);if(i.size===0)return ce();let r=[],a=new Set,u=(l,d,c,f)=>{if(d===e&&c<=o&&f>=t)return;let m=`${d}:${c}:${f}:${l}`;a.has(m)||(a.add(m),r.push({name:l,relativePath:d,startLine:c,endLine:f}))};for(let l of h(n,e))i.has(l.leaf)&&u(l.leaf,l.relativePath,l.startLine,l.endLine);for(let l of O(n,e)){let d=l.localName;if(!d||!i.has(d)||!l.sourcePath||l.kind==="namespace")continue;let c=l.importedName==="default"?d:l.importedName;for(let f of _(n,l.sourcePath,c,{maxReexportDepth:3}))u(d,f.relativePath,f.startLine,f.endLine)}r.sort(H);let s=r.map(l=>{let d=le(n,l);return d?{...l,source:d}:null}).filter(l=>l!==null).slice(0,oe);return x(s)}function X(n,e=[]){return x(ue(n.flatMap(t=>t?.inline??[]),e))}function ae(n,e,t,o){let i=I(n,e),r=new Set;if(!i)return r;for(let a=t;a<=o;a+=1)for(let u of i.identifiersByLine[a]??[])r.add(u);return r}function le(n,e){if(e.startLine!==e.endLine)return null;let t=(B(n,e.relativePath)[e.startLine]??"").trim();if(!t||t.length>se)return null;let o=t.indexOf("=");if(o<0||t[o+1]===">")return null;let i=t.slice(o+1).replace(/(?:\/\/|#).*$/u,"").trim();if(!i||i.includes("${")||/\b(?:function|class|struct|interface|trait|enum|lambda)\b/u.test(i))return null;let a=i.replace(/(['"`])(?:\\.|(?!\1).)*\1/gu,"").replace(/\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)n?\b/gu,""),u=new Set(["true","false","null","undefined","None","True","False"]);return(a.match(/[A-Za-z_][A-Za-z0-9_]*/gu)??[]).some(l=>!u.has(l))?null:t}function ue(n,e){let t=new Map;for(let o of n){if(de(o,e))continue;let i=`${o.relativePath}:${o.startLine}:${o.endLine}:${o.name}`;t.has(i)||t.set(i,{...o})}return[...t.values()].sort(H)}function de(n,e){return e.some(t=>t.relativePath===n.relativePath&&t.startLine<=n.startLine&&t.endLine>=n.endLine)}function H(n,e){return n.relativePath.localeCompare(e.relativePath)||n.startLine-e.startLine||n.name.localeCompare(e.name)}function x(n){return{coverage:"indexed-project-literal-values",inline:n}}function ce(){return x([])}function G(n,e){let t=W(n,e);if(!t)return[];let o=T(n,[t],{sort:!0});if(o.length===0)return[];let i=Math.max(0,M(F(n,t)).length-1),r=o.map(s=>({symbol:s.symbol,shortName:s.shortName,startLine:s.startLine,endLine:Math.min(s.endLine,i),signature:s.signature,children:[]})),a=new Map;for(let s of r)a.set(s.symbol,s);let u=[];for(let s=0;s<o.length;s++){let l=o[s],d=r[s];if(l.enclosingSymbol&&a.has(l.enclosingSymbol)){a.get(l.enclosingSymbol).children.push(d);continue}let c=null,f=1/0;for(let m of r)if(m!==d&&m.startLine<=d.startLine&&m.endLine>=d.endLine){if(m.startLine===d.startLine&&m.endLine===d.endLine&&!$(m.symbol,d.symbol))continue;let g=m.endLine-m.startLine;g<f&&(f=g,c=m)}c?c.children.push(d):u.push(d)}return u}function Je(n,e,t={}){let{context:o=0}=t,i=ie(e);if(i)return re(n,i.filePath,i.startLine,i.endLine,o);let r=ne(n,e);if(r)return Y(n,r);let a=k(n,e);return a?p(n,a,o):null}function Qe(n,e,t={}){if(e.length===0)throw new RangeError("code requires at least one selector.");if(e.length>24)throw new RangeError(`code accepts at most ${24} selectors per complete packet; received ${e.length}.`);let o=t.context??0,i=t.members??"exported",r=e.map(s=>ge(n,s,o,i)),a=r.flatMap(s=>s.results),u=a.map(s=>({relativePath:s.relativePath,startLine:s.startLine,endLine:s.endLine}));return{requested:e.length,matched:r.filter(s=>s.status==="matched").length,ambiguous:r.filter(s=>s.status==="ambiguous").length,missing:r.filter(s=>s.status==="missing").length,entries:r,bindingClosure:X(a.map(s=>s.bindingClosure),u)}}function ge(n,e,t,o){let i=ie(e);if(i){let d=re(n,i.filePath,i.startLine,i.endLine,t);return d?he(n,e,d,t):R(n,e,"definition-source-unreadable")}let r=ne(n,e);if(r)return be(n,e,r,t,o);let a=j(n,e);if(!a.match)return R(n,e,"definition-not-found");let u=Ne(n,a),s=u.map(te);if(a.total>1){let d=a.total<=4&&u.length===a.total;return{selector:e,status:"ambiguous",kind:"source",totalCandidates:a.total,results:d?u.flatMap(c=>{let f=p(n,c,t);return f?[f]:[]}):[],definitions:[],candidates:s,omittedCandidates:Math.max(0,a.total-s.length),suggestions:[]}}let l=p(n,a.match,t);return l?Re(e,l):R(n,e,"definition-source-unreadable")}function he(n,e,t,o){let i=h(n,t.relativePath).filter(l=>!Z(l,t.relativePath)),r=pe(n,t,i),a=V(r.map(l=>p(n,l,o)).filter(l=>l!==null)).filter(l=>!ee(t,l)),u=new Set(a.map(l=>l.symbol)),s=r.filter(l=>!u.has(l.symbol)&&!(t.startLine<=l.startLine&&t.endLine>=l.endLine)).map(te);return{selector:e,status:"matched",kind:"source",totalCandidates:1,results:[t,...a],definitions:[],candidates:[],omittedCandidates:0,suggestions:[],rangeCoverage:{basis:"requested-range-and-same-file-call-closure",referencedDefinitions:r.length,returnedDefinitions:r.length-s.length,returnedBodies:a.length,omittedDefinitions:s.length,omittedLedger:s}}}function pe(n,e,t){if(!b(e.freshness))return[];if(t.length===0)return[];let o=D(n,t,{additive:!1,semantic:!1}),i=new Map;for(let a of t){let u=i.get(a.symbol)??[];u.push(a),i.set(a.symbol,u)}let r=new Map;for(let a of t)if(!(a.endLine<e.startLine||a.startLine>e.endLine)){for(let u of o.get(a.symbolId)??[])if(u.file===e.relativePath&&!(u.source==="ast-callsite"&&(u.chunkId<e.startLine||u.chunkId>e.endLine)))for(let s of i.get(u.symbol)??[])r.set(s.symbolId,s)}return Q(n,[...r.values()],t)}function be(n,e,t,o,i){let r=t.relativePath,a=ye(n,r),u=b(t.freshness)?h(n,r).filter(g=>!Z(g,r)):[],s=u.filter(g=>z(n,g)),l=s.length>0?s:Ce(a,u),d=i==="all"?[]:Q(n,l,u),c=i==="all"||u.length===0?[Y(n,t)]:V(d.map(g=>p(n,g,o)).filter(g=>g!==null)),f=ve(a,c),m=Se(r,a,c),v=De(a);return{selector:e,status:"matched",kind:"file-source",totalCandidates:1,results:c,definitions:[],candidates:[],omittedCandidates:0,suggestions:[],fileCoverage:{members:i,basis:i==="all"||u.length===0?"complete-file-source":s.length>0?"explicit-exports-and-same-file-reference-closure":"top-level-and-same-file-reference-closure",totalDefinitions:v,returnedDefinitions:f,returnedBodies:c.length,omittedDefinitions:Math.max(0,v-f),omittedLedger:m}}}function Ce(n,e){let t=new Set(n.map(o=>o.symbol));return e.filter(o=>t.has(o.symbol))}function ye(n,e){return G(n,e).flatMap(t=>Le(t,e)?t.children:[t])}function Z(n,e){return J(e).has(n.leaf)}function Le(n,e){return J(e).has(w(n.symbol))}function J(n){let e=me(n);return new Set([e,e.slice(0,Math.max(0,e.length-K(e).length))])}function Q(n,e,t){if(e.length===0)return[];let o=D(n,t,{additive:!0,semantic:!1}),i=new Map;for(let u of t){let s=i.get(u.symbol)??[];s.push(u),i.set(u.symbol,s)}let r=new Map,a=[...e];for(;a.length>0;){let u=a.shift();if(!r.has(u.symbolId)){r.set(u.symbolId,u);for(let s of o.get(u.symbolId)??[])for(let l of i.get(s.symbol)??[])r.has(l.symbolId)||a.push(l)}}return[...r.values()].sort(xe)}function V(n){let e=[...n].sort((o,i)=>o.relativePath.localeCompare(i.relativePath)||o.startLine-i.startLine||i.endLine-o.endLine),t=[];for(let o of e)t.some(i=>ee(i,o))||t.push(o);return t}function Y(n,e){let t=e.text.split(`
2
2
  `);return{symbol:e.relativePath,shortName:e.relativePath,relativePath:e.relativePath,startLine:0,endLine:Math.max(0,t.length-1),language:n.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath)?.language??E(e.relativePath),source:e.text,freshness:e.freshness,...b(e.freshness)?{bindingClosure:y(n,e.relativePath,0,Math.max(0,t.length-1))}:{}}}function ve(n,e){return L(n).filter(t=>e.some(o=>N(t,o))).length}function Se(n,e,t){let o=[];return q(o,n,e,t,0),o}function q(n,e,t,o,i){for(let r of t){if(o.some(u=>N(r,u)))continue;let a=L(r.children).filter(u=>!o.some(s=>N(u,s))).length;n.push({symbol:r.symbol,shortName:r.shortName,relativePath:e,startLine:r.startLine,endLine:r.endLine,signature:r.signature,depth:i,nestedDefinitions:a}),q(n,e,r.children,o,i+1)}}function L(n){return n.flatMap(e=>[e,...L(e.children)])}function De(n){return L(n).length}function N(n,e){return e.startLine<=n.startLine&&e.endLine>=n.endLine}function ee(n,e){return n.relativePath===e.relativePath&&n.startLine<=e.startLine&&n.endLine>=e.endLine}function xe(n,e){return n.startLine-e.startLine||e.endLine-n.endLine||n.symbol.localeCompare(e.symbol)}function Re(n,e){return{selector:n,status:"matched",kind:"source",totalCandidates:1,results:[e],definitions:[],candidates:[],omittedCandidates:0,suggestions:[]}}function R(n,e,t){return{selector:e,status:"missing",kind:"source",totalCandidates:0,results:[],definitions:[],candidates:[],omittedCandidates:0,suggestions:A(n,e,5),reason:t}}function ne(n,e){try{return C(n,e)}catch(t){if(t instanceof P)return null;throw t}}function Ne(n,e){if(!e.match)return[];let t=[e.match];for(let i of e.candidates){let r=h(n,i.relativePath).find(a=>a.symbol===i.symbol&&a.startLine===i.startLine);r&&t.push(r)}let o=new Set;return t.filter(i=>{let r=`${i.relativePath}:${i.startLine}:${i.endLine}:${i.symbol}`;return o.has(r)?!1:(o.add(r),!0)})}function te(n){return{symbol:n.symbol,shortName:S(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine}}function ie(n){let e=n.match(/^(.+):(\d+)-(\d+)$/);if(!e)return null;let t=Number(e[2]),o=Number(e[3]);if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`Source range start line must be a positive integer, got "${e[2]}".`);if(!Number.isSafeInteger(o)||o<t)throw new RangeError(`Source range end line must be an integer at or after ${t}, got "${e[3]}".`);return{filePath:e[1],startLine:t,endLine:o}}function p(n,e,t){let o=n.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),i=C(n,e.relativePath);if(!i)return null;let a=i.text.split(`
3
3
  `),u=e.endLine<=e.startLine?U(n,e.relativePath,e.startLine,Number.MAX_SAFE_INTEGER):null,s=u?.unitType?u.unitStartLine:e.startLine,l=u?.unitType?u.unitEndLine:e.endLine,d=Math.max(0,s-t),c=Math.min(a.length-1,l+t),f=a.slice(d,c+1).join(`
4
4
  `);return{symbol:e.symbol,shortName:S(e.symbol),relativePath:e.relativePath,startLine:d,endLine:c,language:o?.language??E(e.relativePath),source:f,freshness:i.freshness,...b(i.freshness)?{bindingClosure:y(n,e.relativePath,d,c)}:{}}}function re(n,e,t,o,i){let r=C(n,e);if(!r)return null;let a=n.get("SELECT language FROM documents WHERE relative_path = ?",r.relativePath),s=r.text.split(`
5
5
  `);if(t>s.length)return null;let l=Math.max(0,t-1-i),d=Math.min(s.length-1,o-1+i),c=s.slice(l,d+1).join(`
6
6
  `);return{symbol:`${r.relativePath}:${t}-${o}`,shortName:`${r.relativePath}:${t}-${o}`,relativePath:r.relativePath,startLine:l,endLine:d,language:a?.language??E(r.relativePath),source:c,freshness:r.freshness,...b(r.freshness)?{bindingClosure:y(n,r.relativePath,l,d)}:{}}}function b(n){return!!(n&&n.semantic.state!=="stale"&&n.semantic.basis!=="no-compiler-document")}function E(n){switch(K(n).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{G as a,Je as b,Qe as c};
7
- //# sourceMappingURL=chunk-TUQIPUDS.js.map
7
+ //# sourceMappingURL=chunk-W5OXRYGE.js.map
@@ -0,0 +1,57 @@
1
+ import{a as Z}from"./chunk-MPQ4OTBM.js";import{b as ht}from"./chunk-FRUSVINH.js";import{q as vt}from"./chunk-YEN6CYC7.js";import{a as gt}from"./chunk-WRQXLNYE.js";import{c as Se}from"./chunk-BJT7LSPK.js";import{A as dt,C as pt,E as mt,F as ft,J as yt,K as G,T as _,_ as xe,a as ot,b as ie,d as ae,h as st,i as he,j as Me,n as ge,p as ve,q as lt,r as be,s as k,t as D,v as M,w as ut,x as X,y as O,z as ct}from"./chunk-3L2ZBPEX.js";import{c as re}from"./chunk-RTQ7NEKG.js";import{c as Q}from"./chunk-IW5XQG5G.js";function Re(e){let t=e.replaceAll("\\","/");return ht(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import{createHash as fe}from"crypto";import{setImmediate as jr}from"timers/promises";import{createRequire as qr}from"module";import{createHash as _n}from"crypto";var Ce=8;function ee(e,t,n){return Ge(bt(e,t,Ue(n),0,new Set))}function ze(e,t,n){return He(e,t,n,0,new Set)}function bt(e,t,n,r,i){if(r>Ce)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?St(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?xt(e,t,n,r,i):[]}function St(e,t,n,r,i,a){let s=[];for(let o of He(e,t,n,i+1,new Set(a))){let l=M(o.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let d=u.childForFieldName("key")??u.namedChild(0);if(bn(d)!==r)continue;let c=u.childForFieldName("value")??u.namedChild(1);c&&s.push(...bt(e,o.definition.relativePath,Ue(c.text),i+1,new Set(a)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let c=gn(e,o.definition.relativePath,r,u);s.push(...c.length>0?c:[yn(o.definition,r,u)]);continue}if(u.type==="spread_element"){let d=u.namedChild(0);if(!d)continue;for(let c of He(e,o.definition.relativePath,Ue(d.text),i+1,new Set(a)))s.push(...St(e,c.definition.relativePath,c.definition.leaf,r,i+1,new Set(a)))}}}return Ge(s)}function yn(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function He(e,t,n,r,i){return r>Ce||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:xt(e,t,n,r,i).flatMap(a=>{let s=O(e,a.relativePath)?.rootNode,o=s?vn(s,a.leaf):null;return o?[{definition:a,initializer:o}]:[]})}function xt(e,t,n,r,i){if(r>Ce)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let s=_(e,t).filter(u=>u.leaf===n);if(s.length>0)return s;let o=hn(e,t,n);if(o.length>0)return o;let l=G(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return Ve(e,l.sourcePath,u,r+1,new Set(i))}return Ve(e,t,n,r+1,new Set(i))}function hn(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(pt(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function Ve(e,t,n,r,i){if(r>Ce)return[];let a=_(e,t).filter(s=>s.leaf===n);return a.length>0?a:Ge(yt(e,t).flatMap(s=>s.sourcePath?s.kind==="named"&&!s.names.includes(n)?[]:Ve(e,s.sourcePath,n,r+1,new Set(i)):[]))}function gn(e,t,n,r){return _(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function vn(e,t){let n=null;return k(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function bn(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Ue(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function Ge(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}var Sn=8;function V(e,t){return t?te(e,t,0,new Set):null}function te(e,t,n,r){if(n>Sn)return U(t,"value-evaluation-depth");let i=M(t),a=In(i);if(a)return Pn(e.file,i,a.term,a.value,a.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>te(e,u,n+1,new Set(r)));if(l.length>=2&&l.every(u=>u!==null)){let u={kind:"concat",parts:l.map(c=>c.term)},d=l.map(c=>c.value).join("");return wn(e.file,i,u,d,l.some(c=>c.precision!=="literal")?"constrained-pattern":"literal",l)}}let s=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))return Nn(e,s,i,n,r);let o=En(i);return o?Bn(e,o.base,o.properties,i,n,r):i.type==="call_expression"||i.type==="call"?xn(e,i,n,r):U(i,`unsupported-expression:${i.type}`)}function xn(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",s=Rn(e,a);if(s.length!==1)return U(t,s.length===0?"call-target-unresolved":"call-target-ambiguous");let o=s[0],l=`${o.relativePath}\0${o.symbol}`;if(r.has(l))return U(t,"call-return-cycle");let u=O(e.db,o.relativePath)?.rootNode;if(!u)return U(t,"call-target-unparsed");let d=D(u,o.startLine,o.endLine);if(!d)return U(t,"call-target-syntax-unavailable");let c=Cn(d);if(!c)return U(t,"call-return-not-single-expression");let p=new Set(r);p.add(l);let m=te({db:e.db,file:o.relativePath,root:u},c,n+1,p);return m?Ne(t,"bounded-call-return",m,o.symbol):U(t,"call-return-unresolved")}function Rn(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=_(e.db,e.file).filter(s=>s.isFunctionLike&&s.leaf===t);if(i.length>0)return i;let a=G(e.db,e.file).find(s=>s.localName===t&&s.sourcePath&&s.kind!=="namespace");return a?.sourcePath?Z(e.db,a.sourcePath,a.importedName==="default"?t:a.importedName).filter(s=>s.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=G(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?Z(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function Cn(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return Ct(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function Ct(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)Ct(e,r,n)}}function Nn(e,t,n,r,i){let a=`${e.file}\0${t}`;if(i.has(a))return U(n,"value-cycle");i.add(a);let s=je(e.root,t);if(s){let g=te(e,s,r+1,i);return g?Ne(n,"local-constant",g):U(n,"non-foldable-local")}let o=G(e.db,e.file).find(g=>g.localName===t&&g.sourcePath);if(!o?.sourcePath)return H(n,t,"unresolved-identifier");if(o.kind==="namespace")return H(n,t,"namespace-import-requires-property");let l=o.importedName==="default"?t:o.importedName,u=Z(e.db,o.sourcePath,l);if(u.length!==1)return H(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let d=u[0],c=O(e.db,d.relativePath)?.rootNode;if(!c)return H(n,d.symbol,"import-definition-unparsed");let p=je(c,d.leaf);if(!p)return H(n,d.symbol,"import-definition-non-value");let m=te({db:e.db,file:d.relativePath,root:c},p,r+1,i);return m?Ne(n,"imported-constant",m,d.symbol):H(n,d.symbol,"import-value-unresolved")}function Bn(e,t,n,r,i,a){let s=G(e.db,e.file).find(m=>m.localName===t&&m.sourcePath),o=e.file,l=t,u;if(s?.sourcePath){s.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=s.importedName==="default"?t:s.importedName;let m=Z(e.db,s.sourcePath,l);if(m.length!==1)return H(r,`${t}.${n.join(".")}`,m.length===0?"member-definition-missing":"member-definition-ambiguous");o=m[0].relativePath,l=m[0].leaf,u=m[0].symbol}let d=o===e.file?e.root:O(e.db,o)?.rootNode;if(!d)return H(r,u??t,"member-definition-unparsed");let c=je(d,l);if(!c)return H(r,u??t,"member-base-non-value");for(let m of n){let g=M(c);if(c=Tn(g,m),!c)return H(r,u??`${t}.${n.join(".")}`,`member-property-missing:${m}`)}let p=te({db:e.db,file:o,root:d},c,i+1,a);return p?Ne(r,"member-constant",p,u):H(r,u??t,"member-value-unresolved")}function In(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],a=0,s=/\$\{([^}]*)\}/gu;for(let o of r.matchAll(s)){let l=o.index??0;l>a&&i.push({kind:"literal",value:r.slice(a,l)}),i.push({kind:"unknown",reason:`template-hole:${o[1]?.trim()||"expression"}`}),a=l+o[0].length}return a<r.length&&i.push({kind:"literal",value:r.slice(a)}),{term:{kind:"pattern",language:"template",value:r.replace(s,"{}")},value:r.replace(s,"{}"),precision:"constrained-pattern"}}function Pn(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:Be("direct-literal","direct",e,t)}}function wn(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...Be("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(s=>s.derivation.inputFactIds),sourceSpans:a.flatMap(s=>s.derivation.sourceSpans)}}}function Ne(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function H(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:Be(n,"heuristic","",e)}}function U(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:Be(t,"heuristic","",e)}}function Be(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function En(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}var Rt=new WeakMap;function Fn(e){let t=Rt.get(e);if(t)return t;let n=new Map;return k(e,r=>{if(r.type!=="variable_declarator")return;let a=(r.childForFieldName("name")??r.namedChild(0))?.text.trim();if(!a||n.has(a))return;let s=r.parent;if(!s||s.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(s.text))return;let o=r.childForFieldName("value")??r.namedChild(1);o&&n.set(a,o)}),Rt.set(e,n),n}function je(e,t){return Fn(e).get(t)??null}function Tn(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}var $n=new WeakMap,Tt=new Set(["delete","get","head","options","patch","post","put"]),Ln=/(?:^|\.)(?:app|router|server)$/u,kn=new Set(["findFirst","findMany","findUnique","from","get","select"]),On=new Set(["create","delete","insert","remove","update","upsert"]),An=new Set(["execute","query","raw"]),Nt=/(?:\b(?:name|id)|['"`](?:name|id)['"`])\s*:/u,Bt=/(?:^\s*|[,{]\s*)(?:async\s+)?['"`]?(?:execute|handler|invoke|run)['"`]?\s*(?::|\([^)]*\)\s*\{)/mu,It=/\b[A-Za-z_$][\w$-]*[_-][\w$-]*\s*\(/u,Pt=/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s+[A-Za-z_$][\w$-]*\s*\(/iu,Xe=[Vn(),Hn(),Dn(),Un(),Gn(),jn(),Kn()],Ke=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function Dn(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=Mn(e.source),n=[];return q(e.root,"call_expression",r=>{let i=ue(r);if(!i)return;let a=t.direct.get(i),s=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),o=s&&t.namespaces.has(s[1])?s[2]:null,l=a??o;if(!l||!Ke.has(l))return;let u=W(r),d=A(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},c=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(T(e,r,"builtin.node-child-process",c,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...d}],"exact","node-child-process-import"))}),n}}}function Mn(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let l of e.matchAll(i))for(let u of(l[1]??"").split(",")){let d=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);d&&Ke.has(d[1])&&t.set(d[2]??d[1],d[1])}let a=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(a))for(let u of(l[1]??"").split(",")){let d=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);d&&Ke.has(d[1])&&t.set(d[2]??d[1],d[1])}let s=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(s))n.add(l[1]);let o=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(o))n.add(l[1]);return{direct:t,namespaces:n}}function L(e,t,n,r){let i=oe(r,"runtime-boundaries.context.ast",t,()=>n===void 0?O(e,t):ct(e,t,n));if(!i)return null;let a=i.rootNode;n!==void 0&&$n.set(a,i);let s=n??he(e,t),o,l,u,d=()=>(l!==void 0||(l=oe(r,"runtime-boundaries.context.callable-sites",t,()=>{let c=ve(t);return(c?ft(a,c):null)??mt(e,t)})),l);return{db:e,file:t,source:s,root:a,get constants(){return u??=oe(r,"runtime-boundaries.context.constants",t,()=>Qn(a)),u},ownerAt:c=>{let m=(o??=oe(r,"runtime-boundaries.context.definitions",t,()=>_(e,t,{rangeCorrectionEvidence:{source:s,callables:d()}},(f,y)=>oe(r,`runtime-boundaries.context.definitions.${f}`,t,y)))).filter(f=>f.startLine<=c&&f.endLine>=c).sort((f,y)=>f.endLine-f.startLine-(y.endLine-y.startLine)||f.startLine-y.startLine)[0];if(m)return{file:t,symbol:m.symbol,name:m.leaf,startLine:m.startLine,endLine:m.endLine};let b=(d()??[]).filter(f=>f.startLine<=c&&f.endLine>=c).sort((f,y)=>f.endLine-f.startLine-(y.endLine-y.startLine)||f.startLine-y.startLine)[0];return{file:t,symbol:null,name:b?.name??null,startLine:b?.startLine??c,endLine:b?.endLine??c}}}}function oe(e,t,n,r){return e?e(t,r,{file:n}):r()}function Hn(){return{id:"builtin.effect-httpapi",supports:e=>se(e,"HttpApiEndpoint").size>0||se(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=se(e.source,"HttpApiEndpoint"),r=se(e.source,"HttpApiGroup"),i=se(e.source,"HttpApiBuilder");return q(e.root,"call_expression",a=>{let s=_t(a);if(!s)return;let o=W(a);if(n.has(s.receiver)&&Tt.has(s.member)){let b=A(o[0],e),f=A(o[1],e),y=Et(a,r,"make",0,e);if(!b||!f||!y)return;let v=s.member.toUpperCase();t.push(T(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:v,evidence:"literal"},{name:"path",...f}],z([{name:"path",...f}]),"effect-httpapi-endpoint-declaration")),t.push(T(e,a,"builtin.effect-httpapi","framework.declare",qe(y,b),z(qe(y,b)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(s.member))return;let l=Et(a,i,"group",1,e),u=A(o[0],e),d=o[1];if(!l||!u||!d)return;let c=qe(l,u),p=ee(e.db,e.file,d.text),m=T(e,a,"builtin.effect-httpapi","framework.handle",c,p.length===1?z(c):"candidate","effect-httpapi-handler-registration"),g=p[0];p.length===1&&g&&(m.owner={file:g.relativePath,symbol:g.symbol,name:g.leaf,startLine:g.startLine,endLine:g.endLine}),t.push(m)}),t}}}function qe(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function se(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(r)){let s=a[2]??"";if(wt(s))for(let o of(a[1]??"").split(",")){let l=o.trim().replace(/^type\s+/u,""),u=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(l);u?.[1]===t&&n.add(u[2]??u[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(i)){let s=a[2]??"";s.endsWith(`/${t}`)&&wt(s)&&n.add(a[1])}return n}function wt(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function Et(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let s=Ft(a,t,n,r,i);if(s)return s;let o=a.childForFieldName("function")??a.namedChild(0),l=null;if(o&&We(o,u=>{!l&&u.type==="call_expression"&&(l=Ft(u,t,n,r,i))}),l)return l}a=a.parent}return null}function Ft(e,t,n,r,i){let a=_t(e);return!a||a.member!==n||!t.has(a.receiver)?null:A(W(e)[r],i)}function _t(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function Vn(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||le(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return q(e.root,["decorator","call_expression"],n=>{if(n.type==="decorator"){let p=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!p||!le(e.source,["fastapi","flask"]))return;t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:p[1].toUpperCase(),evidence:"literal"},{name:"path",value:p[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=ue(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",a=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",s=W(n);if(i==="route"&&le(e.source,["axum"])){let p=A(s[0],e),m=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(s[1]?.text??"")?.[1];if(!p||!m)return;t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:m.toUpperCase(),evidence:"literal"},{name:"path",...p}],z([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=A(s[0],e);if(!p)return;let g=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(s[1]?.text??"")?.[1]?.toUpperCase()??(s[1]?null:"GET"),b=[...g?[{name:"method",value:g,evidence:"literal"}]:[],{name:"path",...p}];t.push(T(e,n,"builtin.http","http.request",b,g?z(b):"candidate","call-expression"));return}if(!Tt.has(i))return;let o=A(s[0],e);if(!o)return;let l=i.toUpperCase();if(Ln.test(a)&&le(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],z([{name:"path",...o}]),"framework-adapter"));return}let d=Wn(e.source,["axios"]),c=a.split(".")[0]??"";d.has(c)&&t.push(T(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],z([{name:"path",...o}]),"client-adapter"))}),t}}}function Un(){return{id:"builtin.capability-registry",supports:e=>Nt.test(e)&&Bt.test(e)||It.test(e)||Pt.test(e),extract:e=>{let t=[],n=new Set,r=[];return Nt.test(e.source)&&Bt.test(e.source)&&r.push("pair"),(It.test(e.source)||Pt.test(e.source))&&r.push("string","string_literal","template_string"),q(e.root,r,i=>{if(i.type==="pair"){let s=i.childForFieldName("key")??i.namedChild(0),o=i.childForFieldName("value")??i.namedChild(1),l=s?.text.replace(/^['"`]|['"`]$/gu,"");if(l!=="name"&&l!=="id")return;let u=$t(o,e),d=tr(i);if(!u||u.evidence!=="literal"||!d)return;let c=`handle\0${u.value}\0${d.startPosition.row}`;if(n.has(c))return;n.add(c),t.push(T(e,d,"builtin.capability-registry","registry.handle",[{name:"key",...u}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(i.type))return;let a=i.text.replace(/^['"`]|['"`]$/gu,"");for(let s of a.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let o=s[1];if(!zn(a,o,s.index))continue;let l=`reference\0${o}\0${i.startPosition.row}`;n.has(l)||(n.add(l),t.push(T(e,i,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function zn(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function Gn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return q(e.root,["pair","call_expression"],n=>{if(n.type==="pair"){let a=er(n);if(!a)return;let s=n.childForFieldName("key")??n.namedChild(0),o=n.childForFieldName("value")??n.namedChild(1),l=$t(s,e);if(!l||!o||!Lt(o))return;let u=Ze(o)?"exact":"candidate";t.push(T(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],z([{name:"key",...l}],u),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(T(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function jn(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=rr(e.root);return q(e.root,"call_expression",r=>{let i=ue(r);if(!i)return;let a=i.split("."),s=a.at(-1)??"",o=W(r),l=o[0]?.text??"",u=nr(s,l);if(!u)return;let d=kt(a,n);if(!d)return;let c=qn(o[0],e)??ir(l),p=ar(d,a,s,c);if(!p)return;let m=s==="insert"?"persistence-insert":u==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(l)?"persistence-skip-locked-claim":"persistence-adapter";t.push(T(e,r,"builtin.persistence",u,[{name:"resource",...p}],z([{name:"resource",...p}]),m))}),t}}}function qn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:A(e,t)}function Kn(){return{id:"builtin.queue",supports:e=>le(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return q(e.root,"call_expression",n=>{let r=ue(n);if(!r)return;let i=r.split(".").at(-1)??"",a=W(n),s=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!s)return;let o=i==="send"||i==="subscribe"?Yn(a[0],"topic",e):A(a[0],e);o&&t.push(T(e,n,"builtin.queue",s,[{name:"address",...o}],z([{name:"address",...o}]),"framework-adapter"))}),t}}}function T(e,t,n,r,i,a,s){let o=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${_n("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:o,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:s,strength:a,protocol:r.split(".")[0]??r,role:Xn(r),executionDomain:Zn(e.file),derivation:{kind:a==="candidate"?"heuristic":a==="derived"?"mechanically-derived":"direct",rule:s,ruleVersion:"1",inputFactIds:i.flatMap(u=>u.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(u=>u.derivation?.sourceSpans??[])]},valuePrecision:i.some(u=>u.evidence==="expression")?"unknown":i.some(u=>u.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:Re(e.file)}}function Xn(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function Zn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function le(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function Wn(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),a=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let s of e.matchAll(a)){let o=s[1]??s[2];o&&n.add(o)}}return n}function Ie(e,t,n,r,i,a,s){return T(e,t,n,r,i,a,s)}function ue(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function W(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function A(e,t){let n=V(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function Yn(e,t,n){if(!e)return null;let r=e.namedChildren.find(a=>a.type!=="pair"?!1:(a.childForFieldName("key")??a.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return A(i,n)}function $t(e,t){if(!e)return null;let n=A(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function z(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function Jn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function Qn(e){let t=new Map;return We(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let a=Jn(i);a!==null&&t.set(r.text,a)}),t}function er(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function Ze(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function Lt(e){return Ze(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function tr(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),s=i?.text.replace(/^['"`]|['"`]$/gu,"");if(s&&["execute","handler","invoke","run"].includes(s)&&a&&Lt(a))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function kt(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function nr(e,t){if(kn.has(e))return"database.read";if(On.has(e))return"database.write";if(!An.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function rr(e){let t=new Set;return q(e,"call_expression",n=>{let r=ue(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!kt(i)))for(let a of W(n)){if(!Ze(a))continue;let o=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=o?ut(o):null;l&&t.add(l)}}),t}function ir(e){let t=Ot(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function ar(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let a=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return a?{value:a,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=Ot(r.value);return i?{value:i,evidence:r.evidence}:null}function Ot(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function We(e,t){t(e);for(let n of e.namedChildren)We(n,t)}function q(e,t,n){for(let r of be(e,t))n(r)}var or=Q("resolved-call-syntax",{clearGroups:[]}),Ye=Q("resolved-call-sites",{clearGroups:[]}),sr=Q("resolved-call-sites-reference-evidence",{clearGroups:[]});function Je(e,t){return Ye.get(e,t.symbolId,()=>Dt(e,t,lr(e,t)))}function At(e,t){let n=[...new Map(t.map(a=>[a.symbolId,a])).values()],r=n.filter(a=>!Ye.has(e,a.symbolId)),i=Mt(e,r);return new Map(n.map(a=>[a.symbolId,Ye.get(e,a.symbolId,()=>Dt(e,a,i.get(a.symbolId)??[]))]))}function Dt(e,t,n){let r=[],i=[],a=new Set,s=new Set;for(let o of n){a.add(o.file);let l=or.get(e,o.file,()=>cr(e,o.file));if(!l){i.push({callee:t,file:o.file,line:o.startLine,reason:"ast-unavailable",candidates:0,referenceProvenance:o.provenance});continue}let u=(l.byLeaf.get(t.leaf)??[]).filter(({callNode:p})=>p.startPosition.row<=o.endLine&&p.endPosition.row>=o.startLine);if(u.length!==1){i.push({callee:t,file:o.file,line:o.startLine,reason:u.length===0?"call-not-found":"ambiguous-call",candidates:u.length,referenceProvenance:o.provenance});continue}let d=u[0],c=`${o.file}\0${d.callNode.startIndex}\0${d.callNode.endIndex}`;s.has(c)||(s.add(c),r.push({callee:t,caller:xe(_(e,o.file),d.callNode.startPosition.row),file:o.file,line:d.callNode.startPosition.row,startLine:d.callNode.startPosition.row,endLine:d.callNode.endPosition.row,targetText:d.targetNode.text,callNode:d.callNode,targetNode:d.targetNode,arguments:d.arguments,referenceProvenance:o.provenance}))}return{sites:r,unresolved:i,filesVisited:a.size}}function lr(e,t){return Mt(e,[t]).get(t.symbolId)??[]}function Mt(e,t){if(!ur(e))return new Map(t.map(r=>[r.symbolId,vt(e,r,{semantic:!1}).map(i=>({file:i.file,startLine:i.line,endLine:i.line,provenance:i.provenance}))]));let n=new Map;for(let r of gt(e,t.map(i=>i.symbolId))){let i=n.get(r.symbol_id)??[];i.push({file:r.relative_path,startLine:r.chunk_start,endLine:r.chunk_end,provenance:"scip-reference-chunk"}),n.set(r.symbol_id,i)}return new Map(t.map(r=>[r.symbolId,n.get(r.symbolId)??[]]))}function ur(e){return sr.get(e,"project",()=>!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))}function cr(e,t){let n=O(e,t)?.rootNode;if(!n)return null;let r=new Map;for(let i of be(n,["call_expression","call"])){let a=i.childForFieldName("function")??i.namedChild(0);if(!a)continue;let s=dt(a);if(!s)continue;let o=i.childForFieldName("arguments")??i.namedChildren.find(d=>d.type==="arguments"),l={callNode:i,targetNode:a,arguments:o?.namedChildren??[]},u=r.get(s);u?u.push(l):r.set(s,[l])}return{byLeaf:r}}var dr=Q("call-parameter-value-flow",{clearGroups:[]});function ce(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return dr.get(e,n,()=>pr(e,t))}function de(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function pr(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-unavailable",proof:n}))};let r=O(e,t.caller.relativePath)?.rootNode,i=r?D(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let a=X(i),s=[],o=[];return t.arguments.forEach((l,u)=>{let d=l.text.trim(),c=a.indexOf(d);c>=0?s.push({calleePosition:u,callerPosition:c,argumentText:d,proof:n}):o.push({calleePosition:u,argumentText:d,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:s,unknown:o}}var mr=8,fr=8;function Vt(e,t,n=[]){let r=[],i=yr(e,n,r),a=i.summaries,s=hr(e,t,a,r),o=gr(e,t,r);return{observations:Pr([...s.observations,...o]),bodySummaries:a.size,discriminatorSummaries:s.summaries,filesInspected:i.filesInspected,errors:r}}function yr(e,t,n){let r=new Map,i=[],a=new Map,s=o=>{if(a.has(o))return a.get(o)??null;let l=L(e,o);return a.set(o,l),l};for(let o of t){let l={...o,depth:0,proofSpans:[{file:o.definition.relativePath,startLine:o.definition.startLine,endLine:o.definition.endLine}]};r.set(o.definition.symbol,l),i.push(l)}for(;i.length>0;){let o=i.shift();if(!(o.depth>=mr))try{for(let l of Je(e,o.definition).sites){if(!s(l.file))continue;let d=l.caller;if(!d)continue;let c=de(ce(e,l),o.parameterIndexes);if(c.length===0)continue;let p={definition:d,parameterIndexes:Kt(c),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]};xr(r,p)&&i.push(r.get(d.symbol))}}catch(l){n.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${tt(l)}`)}}return{summaries:r,filesInspected:new Set(t.map(o=>o.definition.relativePath)).size}}function hr(e,t,n,r){let i=new Map,a=[],s=[];for(let o of t){if(o.action!=="http.request"||o.strength==="candidate"||o.sourceScope!=="production")continue;let l=zt(o);if(!l)continue;let u=L(e,o.source.file);if(!u)continue;let d=Gt(u.root,o.source.startLine),c=d.find(v=>v.startPosition.row===o.source.startLine)??d[0];if(!c)continue;let p=et(c);if(!p)continue;let m=ee(e,o.source.file,p.text);if(m.length!==1)continue;let g=n.get(m[0].symbol);if(!g)continue;let b=o.owner.symbol?_(e,o.owner.file).find(v=>v.symbol===o.owner.symbol):null;if(!b)continue;let f=Rr(u,b),y=Pe(c);for(let v of g.parameterIndexes){let R=Nr(u,y[v]);if(R)for(let x of Br(R)){let h=jt(x),S=qt(x);if(!h||!S)continue;let B=f.indexOf(S.text.trim());if(B>=0){let N={definition:b,carrier:l,field:h,parameterIndex:B,depth:0,proofObservationIds:[o.id],proofSpans:[o.source,{file:o.source.file,startLine:x.startPosition.row,endLine:x.endPosition.row}]},F=Ht(N);i.has(F)||(i.set(F,N),a.push(N));continue}let I=V(u,S);!I||I.evidence==="expression"||s.push(Qe(u,x,"carrier.publish",l,h,I.value,[o.id]))}}}for(;a.length>0;){let o=a.shift();if(!(o.depth>=fr))try{for(let l of Je(e,o.definition).sites){let u=L(e,l.file);if(!u)continue;let d=l.callNode,c=Pe(d)[o.parameterIndex];if(!c)continue;let p=V(u,c);p&&p.evidence!=="expression"&&s.push(Qe(u,d,"carrier.publish",o.carrier,o.field,p.value,o.proofObservationIds));let m=l.caller;if(!m)continue;let g=ce(e,l).transfers.find(y=>y.calleePosition===o.parameterIndex)?.callerPosition;if(g===void 0)continue;let b={...o,definition:m,parameterIndex:g,depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},f=Ht(b);i.has(f)||(i.set(f,b),a.push(b))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${o.definition.relativePath}: ${tt(l)}`)}}return{observations:s,summaries:i.size}}function gr(e,t,n){let r=[],i=t.filter(a=>a.action==="registry.handle"&&a.strength!=="candidate"&&a.sourceScope==="production");for(let a of t){if(a.action!=="http.handle"||a.strength==="candidate"||a.sourceScope!=="production")continue;let s=zt(a);if(!s)continue;let o=L(e,a.source.file);if(!o)continue;let l=Gt(o.root,a.source.startLine)[0];if(l)for(let u of Pe(l).slice(1)){let d=ee(e,a.source.file,u.text);for(let c of d)try{let p=L(e,c.relativePath);if(!p)continue;let m=D(p.root,c.startLine,c.endLine);if(!m)continue;k(m,g=>{if(g.type!=="call_expression")return;let b=et(g);if(!b)return;let f=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(b.text.trim());if(!f)return;let y=f[1],v=f[2],R=br(e,p,c,v);if(!R)return;let x=Sr(e,c.relativePath,y);for(let h of i){let S=h.keyParts.find(F=>F.name==="registry")?.value,B=h.keyParts.find(F=>F.name==="key")?.value;if(!S||!B||!x.some(F=>F.file===h.source.file&&F.binding===S))continue;let I=L(e,h.source.file),N=I?Cr(I.root,h.source.startLine):null;!I||!N||r.push(Qe(I,N,"carrier.consume",s,R,B,[a.id,h.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${c.relativePath}: ${tt(p)}`)}}}return r}function Ut(e){let t=_(e.db,e.file),n=new Map;return k(e.root,r=>{if(r.type!=="pair"||jt(r)?.toLowerCase()!=="body")return;let i=qt(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=xe(t,r.startPosition.row),s=vr(r);if(!a||!s)return;let o=X(s),l=new Set;Ir(i,o,l);let u=n.get(a.symbol)??new Set;o.forEach((d,c)=>{d&&l.has(d)&&u.add(c)}),u.size>0&&n.set(a.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[{definition:r,parameterIndexes:[...i].sort((a,s)=>a-s)}]:[]})}function vr(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function br(e,t,n,r){let i=D(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${ge(r)}\\b`,"u");if(a.test(i.text))return r;let s=null;if(k(i,d=>{if(s||d.type!=="variable_declarator")return;let c=d.childForFieldName("name")??d.namedChild(0),p=d.childForFieldName("value")??d.namedChild(1);!c||!p||!new RegExp(`(?:^|[,{}])\\s*${ge(r)}\\s*(?:[,}]|$)`,"u").test(c.text)||p.type==="call_expression"&&(s=et(p)?.text??null)}),!s)return null;let o=ee(e,n.relativePath,s);if(o.length!==1)return null;let l=L(e,o[0].relativePath),u=l?D(l.root,o[0].startLine,o[0].endLine):null;return u&&a.test(u.text)&&new RegExp(`\\b${ge(r)}\\s*[,}]`,"u").test(u.text)?r:null}function Sr(e,t,n){let r=[];for(let i of ze(e,t,n)){let a=M(i.initializer);if(a.type==="call_expression")for(let s of Pe(a)){let o=s.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))for(let l of ze(e,i.definition.relativePath,o))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Qe(e,t,n,r,i,a,s){let l=Ie(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:a,evidence:"constant",term:{kind:"literal",value:a}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...s],sourceSpans:[l.source]},l}function zt(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function xr(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=Kt([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function Ht(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function Rr(e,t){let n=D(e.root,t.startLine,t.endLine);return n?X(n):[]}function Cr(e,t){let n=null;return k(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function Gt(e,t){let n=[];return k(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function et(e){return e.childForFieldName("function")??e.namedChild(0)}function Pe(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Nr(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return M(t);let r=null;return k(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),r?M(r):M(t)}function Br(e){let t=M(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function jt(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function qt(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function Ir(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function Kt(e){return[...new Set(e)].sort((t,n)=>t-n)}function Pr(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function tt(e){return e instanceof Error?e.message:String(e)}import{createHash as wr}from"crypto";function Xt(e,t){let n=new Map;for(let a of t){if(a.action!=="http.handle"||a.sourceScope!=="production")continue;let s=n.get(a.source.file)??[];s.push(a),n.set(a.source.file,s)}let r=[],i=Er(e);for(let a of i.mounts)for(let s of a.targetFiles)for(let o of n.get(s)??[]){let l=o.keyParts.find(p=>p.name==="path");if(!l||l.evidence==="expression")continue;let u=Tr(a.prefix.value,l.value),d=o.keyParts.map(p=>p.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[a.prefix.term??{kind:"literal",value:a.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line},...a.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:p),c=`${o.id}\0${a.file}\0${a.line}\0${u}`;r.push({...o,id:`boundary:${wr("sha256").update(c).digest("hex").slice(0,16)}`,keyParts:d,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line}]},resolution:"unresolved"}),o.strength="candidate",o.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function Er(e){let t=[],n=Se(e);for(let r of n){let i=he(e,r);if(!_r(i))continue;let a=L(e,r);a&&Zt(a.root,s=>{if(s.type!=="call_expression")return;let o=s.childForFieldName("function")??s.namedChild(0);if(!o||!o.text.replace(/\s+/gu,"").endsWith(".use"))return;let l=$r(s);if(l.length<2)return;let u=V(a,l[0]);if(!u||u.evidence==="expression")return;let d=Fr(e,r,l[1]);d.length!==0&&t.push({file:r,line:s.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:d})})}return{mounts:t,filesInspected:n.length}}function Fr(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let a=G(e,t).find(l=>l.localName===i&&l.sourcePath);if(!a?.sourcePath)return[t];if(a.kind==="namespace")return[a.sourcePath];let s=a.importedName==="default"?i:a.importedName,o=Z(e,a.sourcePath,s);return[...new Set(o.map(l=>l.relativePath))]}function Tr(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function _r(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function $r(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Zt(e,t){t(e);for(let n of e.namedChildren)Zt(n,t)}import{createHash as Lr}from"crypto";function we(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}var Fe=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),kr=8,Wt=ie({kind:"runtime-boundary-http-roles",invalidation:ae("runtime-boundary-http-roles"),serialize:Mr,deserialize:Hr});function Qt(e,t,n){let r=n??((f,y)=>y()),i=new Map,a=[],s=[],o=new Set,l=[],u=[],d=new Map,c=new Map,p=new Map,m=f=>{if(d.has(f))return d.get(f)??null;let y=L(e,f);return d.set(f,y),y},g=f=>{let y=c.get(f);if(y)return y;let v=_(e,f);return c.set(f,v),v},b=(f,y)=>{let v=p.get(f.file);if(!v){let h=re(e,f.file,f.source),S=Wt.read(e,f.file,h)??[];v={contentHash:h,roles:new Map(S.map(B=>[B.symbol,B])),dirty:!1},p.set(f.file,v)}let R=v.roles.get(y.symbol);if(R)return R;let x=Dr(f,y);return v.roles.set(y.symbol,{symbol:y.symbol,...x}),v.dirty=!0,x};for(r("runtime-boundaries.http-summary.seed",()=>{for(let f of t){if(f.action!=="http.request"||!f.owner.symbol||f.evidence!=="call-expression"&&f.evidence!=="client-adapter")continue;let y=g(f.owner.file).find(h=>h.symbol===f.owner.symbol);if(!y)continue;let v=m(y.relativePath);if(!v)continue;let R=b(v,y),x={definition:y,...R,constantMethods:f.keyParts.flatMap(h=>h.name==="method"&&h.evidence!=="expression"&&Fe.has(h.value.toUpperCase())?[h.value.toUpperCase()]:[]),depth:0,proofObservationIds:[f.id],proofSpans:[f.source]};Jt(i,x)&&a.push(i.get(y.symbol))}});a.length>0;){let f=a.splice(0,a.length),y=r("runtime-boundaries.http-summary.resolve-call-sites",()=>At(e,f.map(v=>v.definition)),{batchSize:f.length});r("runtime-boundaries.http-summary.process-call-sites",()=>{for(let v of f)if(!(v.depth>=kr))try{let R=y.get(v.definition.symbolId);if(!R)continue;u.push(...R.unresolved.map(x=>Or(v,x)));for(let x of R.sites){let h=m(x.file);if(!h)continue;o.add(x.file);let S=x.callNode,B=Ar(v,S,h);B&&s.push(B);let I=x.caller;if(!I)continue;let N=b(h,I),F=Vr(e,v,x),$={definition:I,pathParameterIndexes:Ee([...N.pathParameterIndexes,...F.pathParameterIndexes]),methodParameterIndexes:Ee([...N.methodParameterIndexes,...F.methodParameterIndexes]),constantMethods:ne([...v.constantMethods,...N.constantMethods]),depth:v.depth+1,proofObservationIds:ne([...v.proofObservationIds,...B?[B.id]:[]]),proofSpans:[...v.proofSpans,{file:x.file,startLine:x.startLine,endLine:x.endLine}]};Jt(i,$)&&a.push(i.get(I.symbol))}}catch(R){l.push(`builtin.http-summary failed for ${v.definition.relativePath}:${v.definition.startLine+1}: ${R instanceof Error?R.message:String(R)}`)}},{batchSize:f.length})}return Wt.writeBatch(e,[...p.entries()].flatMap(([f,y])=>y.dirty?[{relativePath:f,contentHash:y.contentHash,value:[...y.roles.values()].sort((v,R)=>v.symbol.localeCompare(R.symbol))}]:[])),{observations:s,frontiers:we(u),summaries:i.size,filesInspected:o.size,errors:l}}function Or(e,t){let n=ne([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${Lr("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:Re(t.file)}}function Ar(e,t,n){let r=en(t),i=e.pathParameterIndexes.flatMap(c=>{let p=V(n,r[c]);return p&&p.evidence!=="expression"&&zr(p.value)?[{index:c,value:p}]:[]}),a=e.methodParameterIndexes.flatMap(c=>{let p=V(n,r[c]),m=p?.value.toUpperCase();return p&&m&&p.evidence!=="expression"&&Fe.has(m)?[{index:c,value:{...p,value:m}}]:[]}),s=ne([...e.constantMethods,...a.map(c=>c.value.value)]);if(i.length!==1||s.length!==1)return null;let o=i[0].value,l=a.find(c=>c.value.value===s[0])?.value,u=[{name:"method",value:s[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:s[0]},derivation:l?.derivation},{name:"path",value:o.value,evidence:"constant",term:o.term,derivation:o.derivation}],d=Ie(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return d.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,d.source]},d}function Dr(e,t){let n=D(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=X(n),i=new Set,a=new Set,s=new Set;return k(n,o=>{if(o.type==="call_expression"&&((o.childForFieldName("function")??o.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let m=en(o);pe(m[0],r,i);let g=Ur(m[1],"method");if(g){pe(g,r,a);let b=V(e,g),f=b?.value.toUpperCase();f&&b?.evidence!=="expression"&&Fe.has(f)&&s.add(f)}else pe(m[1],r,a)}if(o.type!=="pair")return;let l=o.childForFieldName("key")??o.namedChild(0),u=o.childForFieldName("value")??o.namedChild(1),d=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(d==="url"||d==="path"||d==="endpoint")&&pe(u,r,i),(d==="init"||d==="requestinit"||d==="options")&&pe(u,r,a)}),{pathParameterIndexes:r.flatMap((o,l)=>o&&i.has(o)?[l]:[]),methodParameterIndexes:r.flatMap((o,l)=>o&&a.has(o)?[l]:[]),constantMethods:[...s].sort()}}function Mr(e){return e.map(t=>[encodeURIComponent(t.symbol),t.pathParameterIndexes.join(","),t.methodParameterIndexes.join(","),t.constantMethods.join(",")].join(" ")).join(`
2
+ `)}function Hr(e){if(!e)return[];let t=[];for(let n of e.split(`
3
+ `)){let r=n.split(" ");if(r.length!==4)return null;let i=Yt(r[1]),a=Yt(r[2]),s=r[3]?r[3].split(","):[];if(i===null||a===null||s.some(o=>!Fe.has(o)))return null;t.push({symbol:decodeURIComponent(r[0]),pathParameterIndexes:i,methodParameterIndexes:a,constantMethods:s})}return t}function Yt(e){if(!e)return[];let t=e.split(",").map(Number);return t.every(n=>Number.isSafeInteger(n)&&n>=0)?t:null}function Vr(e,t,n){let r=ce(e,n);return{pathParameterIndexes:de(r,t.pathParameterIndexes),methodParameterIndexes:de(r,t.methodParameterIndexes)}}function Jt(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=Ee([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=Ee([...n.methodParameterIndexes,...t.methodParameterIndexes]),a=ne([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||a.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:a,depth:Math.min(n.depth,t.depth),proofObservationIds:ne([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function Ur(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function pe(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function en(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function zr(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function Ee(e){return[...new Set(e)].sort((t,n)=>t-n)}function ne(e){return[...new Set(e)].sort()}import{createHash as Gr}from"crypto";function rn(e){let t=tn(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=tn(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?nt(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[nn(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?nt(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[nn(r,a,i,"queue.consume")]:[]}):[])}function tn(e){let t=new Map;for(let n of e)for(let r of nt(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function nt(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function nn(e,t,n,r){let i=`database:${n}`,a=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",s=[e.id,r,i,a].join("\0");return{...e,id:`boundary:${Gr("sha256").update(s).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:a,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var ye="runtime-boundaries-v19",Kr=qr(import.meta.url),w=Kr("typescript"),Xr=new Set([w.SyntaxKind.WhitespaceTrivia,w.SyntaxKind.NewLineTrivia,w.SyntaxKind.SingleLineCommentTrivia,w.SyntaxKind.MultiLineCommentTrivia]),Zr=new Set([w.SyntaxKind.NoSubstitutionTemplateLiteral,w.SyntaxKind.TemplateHead,w.SyntaxKind.TemplateMiddle,w.SyntaxKind.TemplateTail]),$e=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],Wr=64,cn="builtin.http-summary",Le={HTTP_HANDLE:"http.handle",HTTP_REQUEST:"http.request",REGISTRY_HANDLE:"registry.handle"},rt=new Set(Object.values(Le));async function Yr(e,t={}){let n=Se(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(vi)),a=t.previousGraph?.fileCoverage,s=i.size>0&&t.previousGraph?.extractorVersion===ye&&a!==void 0&&a.length===t.previousGraph.coverage.filesScanned,o=s?a.filter(C=>r.has(C.file)&&!i.has(C.file)):[],l=new Set(o.flatMap(C=>C.observationIds)),u=s?t.previousGraph.observations.filter(C=>l.has(C.id)&&r.has(C.source.file)):[],d=s?n.filter(C=>i.has(C)):n,c=[],p=a?.reduce((C,P)=>C+P.observationIds.length,0)??0,m=performance.now(),g=await pi(e,d,t.profileSpan);j(c,"direct-extraction",m,d.length,g.observations.length,{filesVisited:d.length,filesReused:o.length,factsReused:u.length,factsInvalidated:Math.max(0,p-u.length)});let b=[...o,...g.fileCoverage].sort((C,P)=>C.file.localeCompare(P.file)),f=gi(b),y=b.flatMap(C=>C.extractionErrors),v=me([...u,...g.observations]);if(s&&!t.forceDerivedRebuild&&t.previousGraph&&Jr(a,g.fileCoverage,i)&&(!ii(e,t.previousGraph,i)||si(a,g.fileCoverage,i)&&!li(t.previousGraph,i))){for(let P of t.previousGraph.coverage.extractors)f.has(P.id)||f.set(P.id,P);let C=ci(t.previousGraph.coverage.phases);return c.push(...C),{...t.previousGraph,observations:t.previousGraph.observations,relationGroups:t.previousGraph.relationGroups,links:t.previousGraph.links,frontiers:t.previousGraph.frontiers,coverage:{filesScanned:n.length,filesWithAst:b.filter(P=>P.hasAst).length,filesWithoutAst:b.filter(P=>!P.hasAst).length,filesReused:o.length,extractors:[...f.values()],extractionErrors:t.previousGraph.coverage.extractionErrors,phases:c},fileCoverage:b}}let R=me([...v,...rn(v)]),x=s&&t.previousGraph!==void 0?Qr(t.previousGraph,a,g.fileCoverage,i,v):{reuse:!1,shapeUnchanged:!1,proofFilesUnchanged:!1,seedUnchanged:!1},h=x.reuse;t.profileSpan?.("runtime-boundaries.http-summary.reuse-decision",()=>{},x),m=performance.now();let S;if(h){let C=t.previousGraph.coverage.phases?.find(E=>E.id==="http-summary"),P=t.previousGraph.coverage.extractors.find(E=>E.id==="builtin.wrapper");S={observations:t.previousGraph.observations.filter(E=>E.extractor===cn),frontiers:t.previousGraph.frontiers.filter(E=>E.kind==="call-resolution"&&E.action===Le.HTTP_REQUEST),summaries:0,filesInspected:C?.filesVisited??P?.applicableFiles??0,errors:t.previousGraph.coverage.extractionErrors.filter(E=>E.startsWith("builtin.http-summary failed"))},j(c,"http-summary",m,R.length,S.observations.length,{filesVisited:0,filesReused:S.filesInspected,factsReused:S.observations.length+S.frontiers.length,factsInvalidated:0}),P&&f.set(P.id,P)}else S=Qt(e,R,t.profileSpan),j(c,"http-summary",m,R.length,S.observations.length,{filesVisited:S.filesInspected}),f.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:S.filesInspected,observations:S.observations.length,errors:S.errors.length});y.push(...S.errors);let B=me([...R,...S.observations]);m=performance.now();let I=Xt(e,B);j(c,"http-mount",m,B.length,I.observations.length,{filesVisited:I.filesInspected});let N=me([...B,...I.observations]);m=performance.now();let F=h&&t.previousGraph!==void 0&&ei(t.previousGraph,a,g.fileCoverage,i),$;if(F){let C=t.previousGraph.coverage.phases?.find(E=>E.id==="carrier"),P=t.previousGraph.coverage.extractors.find(E=>E.id==="builtin.carrier");$={observations:t.previousGraph.observations.filter(E=>E.extractor==="builtin.carrier"),bodySummaries:P?.applicableFiles??0,discriminatorSummaries:0,filesInspected:C?.filesVisited??0,errors:t.previousGraph.coverage.extractionErrors.filter(E=>E.startsWith("builtin.carrier"))},j(c,"carrier",m,N.length,$.observations.length,{filesVisited:0,filesReused:$.filesInspected,factsReused:$.observations.length,factsInvalidated:0}),P&&f.set(P.id,P)}else $=Vt(e,N,b.flatMap(C=>C.bodySummaries??[])),j(c,"carrier",m,N.length,$.observations.length,{filesVisited:$.filesInspected}),f.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:$.bodySummaries,observations:$.observations.length,errors:$.errors.length});y.push(...$.errors);let K=me([...N,...$.observations]);m=performance.now();let J=bi(K);j(c,"relations",m,K.length,J.length),m=performance.now();let it=xi(K,J);j(c,"links",m,J.length,it.length),Ri(K,J),m=performance.now();let at=we([...Ci(K,J),...S.frontiers]);return j(c,"frontiers",m,K.length,at.length),{schemaVersion:2,extractorVersion:ye,observations:K,relationGroups:J,links:it,frontiers:at,coverage:{filesScanned:n.length,filesWithAst:b.filter(C=>C.hasAst).length,filesWithoutAst:b.filter(C=>!C.hasAst).length,...s?{filesReused:o.length}:{},extractors:[...f.values()],extractionErrors:y,phases:c},fileCoverage:b}}function Jr(e,t,n){if(!e)return!1;let r=e.filter(a=>n.has(a.file)).filter(an).map(on).sort((a,s)=>a.file.localeCompare(s.file)),i=t.filter(an).map(on).sort((a,s)=>a.file.localeCompare(s.file));return JSON.stringify(r)===JSON.stringify(i)}function an(e){return e.observationIds.length>0||e.extractionErrors.length>0}function on(e){let{syntaxHash:t,shapeHash:n,bodySummaries:r,...i}=e;return i}function Qr(e,t,n,r,i){let a=ni(t,n,r),s=ri(e),l=![...dn(t,n)].some(p=>s.has(p)),u=new Set((t??[]).filter(p=>r.has(p.file)).flatMap(p=>p.observationIds)),d=new Set(n.flatMap(p=>p.observationIds)),c=sn(e.observations,u)===sn(i,d);return{reuse:a&&l&&c,shapeUnchanged:a,proofFilesUnchanged:l,seedUnchanged:c}}function dn(e,t){let n=new Map(e?.map(r=>[r.file,r.syntaxHash])??[]);return new Set(t.filter(r=>r.syntaxHash===void 0||n.get(r.file)!==r.syntaxHash).map(r=>r.file))}function ei(e,t,n,r){if(!t)return!1;let i=t.filter(l=>r.has(l.file)).map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file)),a=n.map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file));if(JSON.stringify(i)!==JSON.stringify(a))return!1;let s=dn(t,n),o=ti(e,"builtin.carrier");return![...s].some(l=>o.has(l))}function ti(e,t){let n=new Set;for(let r of e.observations)if(r.extractor===t){n.add(r.source.file);for(let i of r.derivation.sourceSpans)n.add(i.file)}return n}function ni(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.shapeHash]));return t.length===n.size&&t.every(i=>i.shapeHash!==void 0&&r.get(i.file)===i.shapeHash)}function ri(e){let t=new Set;for(let n of e.observations)if(n.extractor===cn){t.add(n.source.file);for(let r of n.derivation.sourceSpans)t.add(r.file)}for(let n of e.frontiers)n.kind==="call-resolution"&&n.action===Le.HTTP_REQUEST&&n.source&&t.add(n.source.file);return t}function sn(e,t){return JSON.stringify(e.filter(n=>t.has(n.id)&&n.action===Le.HTTP_REQUEST&&n.owner.symbol!==null&&(n.evidence==="call-expression"||n.evidence==="client-adapter")).map(n=>({ownerSymbol:n.owner.symbol,evidence:n.evidence,methods:n.keyParts.filter(r=>r.name==="method"&&r.evidence!=="expression").map(r=>r.value.toUpperCase()).sort()})).sort((n,r)=>`${n.ownerSymbol}\0${n.evidence}\0${n.methods.join(",")}`.localeCompare(`${r.ownerSymbol}\0${r.evidence}\0${r.methods.join(",")}`)))}function ii(e,t,n){let r=ai(t),i=oi(t);if([...n].some(o=>r.has(o)))return!0;if(i.size===0||n.size===0)return!1;if(!!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))return!0;let s=[...n];for(let o=0;o<s.length;o+=750){let l=s.slice(o,o+750),u=l.map(()=>"?").join(",");if(e.all(`SELECT DISTINCT global_symbol.symbol
4
+ FROM mentions mention
5
+ JOIN chunks reference_chunk ON reference_chunk.id = mention.chunk_id
6
+ JOIN documents reference_document ON reference_document.id = reference_chunk.document_id
7
+ JOIN global_symbols global_symbol ON global_symbol.id = mention.symbol_id
8
+ WHERE mention.role != 1
9
+ AND reference_document.relative_path IN (${u})`,...l).some(c=>i.has(c.symbol)))return!0}return!1}function ai(e){let t=new Set;for(let n of e.observations)if(rt.has(n.action)){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)!n.action||!rt.has(n.action)||!n.source||t.add(n.source.file);return t}function oi(e){return new Set(e.observations.flatMap(t=>rt.has(t.action)&&t.owner.symbol?[t.owner.symbol]:[]))}function si(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.syntaxHash]));return t.length===n.size&&t.every(i=>i.syntaxHash!==void 0&&r.get(i.file)===i.syntaxHash)}function li(e,t){let n=ui(e);return[...t].some(r=>n.has(r))}function ui(e){let t=new Set;for(let n of e.observations){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)n.source&&t.add(n.source.file);return t}function ci(e){return(e??[]).filter(t=>t.id!=="direct-extraction").map(t=>({...t,durationMs:0,filesVisited:0,filesReused:t.filesVisited??0,factsReused:t.outputFacts,factsInvalidated:0}))}function j(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}var di=256;async function pi(e,t,n){let r=[],i=[],a=n??((c,p)=>p()),s=[],o=[],l=new Map,u=c=>{let p=l.get(c);if(p!==void 0)return p;let m=re(e,c,Me(e,c));return l.set(c,m),m},d=0;for(let c of t){d+=1,d>=di&&(d=0,ot(),await jr());let p=a("runtime-boundaries.file.read",()=>Me(e,c)),m=re(e,c,p);l.set(c,m);let g=a("runtime-boundaries.file.direct-product",()=>{let h=un.read(e,c,m);if(!h||h.extractorVersion!==ye)return null;for(let S of h.deps)if(u(S.path)!==S.contentHash)return null;return h});if(g){r.push(...g.observations),i.push(g.coverage);continue}let b=a("runtime-boundaries.file.supports",()=>Xe.filter(h=>h.supports(p))),f=/\bJSON\.stringify\s*\(/u.test(p)&&/\bbody\s*:/u.test(p),y=a("runtime-boundaries.file.hashes",()=>{let h=ln.read(e,c,m);if(h)return h;let S=mi(c,p);return s.push({relativePath:c,contentHash:m,value:S}),S}),v=new Set,R=[],x=st(h=>v.add(h),()=>{let h=b.length>0||f?L(e,c,p,n):null,S={file:c,hasAst:h!==null||hi(c,p),syntaxHash:y.syntaxHash,shapeHash:y.shapeHash,bodySummaries:h&&f?Ut(h):[],observationIds:[],extractors:[],extractionErrors:[]};if(h)for(let B of b){let I={id:B.id,applicableFiles:1,observations:0,errors:0};try{let N=yi(n,`runtime-boundaries.extractor.${B.id}`,c,()=>B.extract(h));I.observations=N.length,R.push(...N),S.observationIds.push(...N.map(F=>F.id))}catch(N){I.errors=1,S.extractionErrors.push(`${B.id} failed for ${c}: ${N instanceof Error?N.message:String(N)}`)}S.extractors.push(I)}return S});r.push(...R),i.push(x),x.extractionErrors.length===0&&(v.delete(c),o.push({relativePath:c,contentHash:m,value:{extractorVersion:ye,deps:[...v].sort().map(h=>({path:h,contentHash:u(h)})),observations:R,coverage:x}}))}return s.length>0&&ln.writeBatch(e,s),o.length>0&&un.writeBatch(e,o),{observations:r,fileCoverage:i}}var ln=ie({kind:"runtime-boundary-source-hashes",invalidation:ae("runtime-boundary-source-hashes"),serialize:e=>JSON.stringify(e),deserialize:e=>{try{let t=JSON.parse(e);return typeof t.syntaxHash=="string"&&typeof t.shapeHash=="string"?{syntaxHash:t.syntaxHash,shapeHash:t.shapeHash}:null}catch{return null}}}),un=ie({kind:"runtime-boundary-direct-extraction",invalidation:ae("runtime-boundary-direct-extraction"),serialize:e=>JSON.stringify(e),deserialize:e=>{try{let t=JSON.parse(e);return typeof t.extractorVersion!="string"||!Array.isArray(t.deps)||!Array.isArray(t.observations)||typeof t.coverage!="object"||t.coverage===null||!t.deps.every(n=>typeof n=="object"&&n!==null&&typeof n.path=="string"&&typeof n.contentHash=="string")?null:t}catch{return null}}});function mi(e,t){if(!/\.(?:[cm]?[jt]sx?)$/iu.test(e)){let u=fe("sha256").update(t).digest("hex");return{syntaxHash:u,shapeHash:u}}let n=/\.[jt]sx$/iu.test(e)?w.LanguageVariant.JSX:w.LanguageVariant.Standard,r=w.createScanner(w.ScriptTarget.Latest,!1,n,t),i=fe("sha256"),a=fe("sha256"),s=[],o=[0];for(let u=0;u<t.length;u+=1)t.charCodeAt(u)===10&&o.push(u+1);let l=0;for(let u=r.scan();u!==w.SyntaxKind.EndOfFileToken;u=r.scan()){if(u===w.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)===0&&(u=r.reScanTemplateToken(!1)),Xr.has(u))continue;let d=r.getTokenText();for(;o[l+1]!==void 0&&o[l+1]<=r.getTokenPos();)l+=1;i.update(String(u)),i.update("\0"),i.update(d),i.update("\0"),i.update(String(l)),i.update("\0"),a.update(String(u)),a.update("\0"),!Zr.has(u)&&!fi(u,d)&&a.update(d),a.update("\0"),a.update(String(l)),a.update("\0"),u===w.SyntaxKind.TemplateHead?s.push(0):u===w.SyntaxKind.TemplateTail?s.pop():u===w.SyntaxKind.OpenBraceToken&&s.length>0?s[s.length-1]+=1:u===w.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)>0&&(s[s.length-1]-=1)}return{syntaxHash:i.digest("hex"),shapeHash:a.digest("hex")}}function fi(e,t){if(e!==w.SyntaxKind.StringLiteral||t.length<2)return!1;let n=t.slice(1,-1);return n.startsWith("/")||n.includes("://")}function yi(e,t,n,r){return e?e(t,r,{file:n}):r()}function hi(e,t){return t?lt(e)?/<script\b/iu.test(t):ve(e)!==null:!1}function gi(e){let t=new Map(Xe.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function vi(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function bi(e){let t=new Map;for(let n of $e){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let a=Bi(i,n.keyNames);if(!a)continue;let s=a.map(c=>`${c.name}=${mn(c.name,c.value)}`).join("\0"),o=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${o}\0${s}`,u=`boundary-group:${fe("sha256").update(l).digest("hex").slice(0,16)}`,d=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:s,keyParts:a,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&d.producerIds.push(i.id),n.consumerActions.includes(i.action)&&d.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&d.declarationIds.push(i.id),d.derivation.inputFactIds.push(i.id),d.derivation.sourceSpans.push(i.source),t.set(u,d)}}return[...t.values()].map(Si).sort(Pi)}function Si(e){return{...e,producerIds:Te(e.producerIds),consumerIds:Te(e.consumerIds),declarationIds:Te(e.declarationIds),derivation:{...e.derivation,inputFactIds:Te(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function xi(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=$e.find(o=>o.id===i.joinRule);if(!a?.traversable)continue;let s=a.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(s.length===0||i.consumerIds.length===0)&&!(a.requireUniquePair&&(s.length!==1||i.consumerIds.length!==1))&&!(a.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(s.length*i.consumerIds.length>Wr))for(let o of s)for(let l of i.consumerIds){let u=n.get(o),d=n.get(l);if(!u||!d||Ii(u,d))continue;let c=u.strength==="derived"||d.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${o}\0${l}`,m={id:`boundary-link:${fe("sha256").update(p).digest("hex").slice(0,16)}`,from:o,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:c,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[o,l],sourceSpans:[u.source,d.source]}};r.set(m.id,m)}}return[...r.values()].sort(wi)}function Ri(e,t){let n=new Set(t.filter(pn).flatMap(_e)),r=new Set(t.filter(Ni).flatMap(_e));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function Ci(e,t){let n=new Set(e.filter(a=>a.strength!=="candidate").map(a=>`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)),r=new Set(t.flatMap(_e)),i=new Set(t.filter(pn).flatMap(_e));return e.filter(a=>a.sourceScope==="production").filter(a=>a.strength!=="candidate"||!n.has(`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)).filter(a=>!i.has(a.id)).map(a=>{let s=a.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),o=s.length>0?`${a.extractor} observed ${a.action}, but ${s.join(", ")} remained symbolic or unknown.`:a.resolution==="ambiguous"?`${a.extractor} established the address for ${a.action}, but more than one indexed peer has the same runtime key.`:r.has(a.id)?`${a.extractor} established the address for ${a.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${a.extractor} observed ${a.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:a.id,reason:o,missingKeyParts:s,sourceScope:a.sourceScope}}).sort((a,s)=>a.observationId.localeCompare(s.observationId))}function _e(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function pn(e){let t=$e.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function Ni(e){let t=$e.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function Bi(e,t){let n=[];for(let r of t){let i=e.keyParts.find(a=>a.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:mn(r,i.value)})}return n}function mn(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function Ii(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function me(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function Te(e){return[...new Set(e)].sort()}function Pi(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function wi(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}import Ei from"better-sqlite3";var Oe="scip_query_runtime_boundaries",Y="scip_query_runtime_observations",Ae="scip_query_runtime_relation_groups",De="scip_query_runtime_relation_participants";function Fi(e,t){let n=new Ei(e);try{n.exec(`
10
+ CREATE TABLE IF NOT EXISTS ${Oe} (
11
+ singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
12
+ schema_version INTEGER NOT NULL,
13
+ extractor_version TEXT NOT NULL,
14
+ payload TEXT NOT NULL
15
+ )
16
+ `),_i(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${Oe} (singleton, schema_version, extractor_version, payload) VALUES (1, ?, ?, ?)`).run(t.schemaVersion,t.extractorVersion,JSON.stringify(t)),n.prepare(`DELETE FROM ${Y}`).run(),n.prepare(`DELETE FROM ${De}`).run(),n.prepare(`DELETE FROM ${Ae}`).run();let r=n.prepare(`INSERT INTO ${Y}
17
+ (id, protocol, action, role, strength, source_scope, resolution, file, start_line, end_line, owner_symbol, payload)
18
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let s of t.observations)r.run(s.id,s.protocol,s.action,s.role,s.strength,s.sourceScope,s.resolution,s.source.file,s.source.startLine,s.source.endLine,s.owner.symbol,JSON.stringify(s));let i=n.prepare(`INSERT INTO ${Ae} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),a=n.prepare(`INSERT INTO ${De} (group_id, observation_id, participant_role) VALUES (?, ?, ?)`);for(let s of t.relationGroups){i.run(s.id,s.protocol,s.joinRule,s.normalizedKey,JSON.stringify(s));for(let o of s.producerIds)a.run(s.id,o,"producer");for(let o of s.consumerIds)a.run(s.id,o,"consumer");for(let o of s.declarationIds)a.run(s.id,o,"declaration")}})()}finally{n.close()}}function Ti(e,t={}){if(!$i(e,Y))return fn(e)?.observations??[];let n=[],r=[];return ke(n,r,"protocol",t.protocols),ke(n,r,"action",t.actions),ke(n,r,"source_scope",t.sourceScopes),ke(n,r,"file",t.files),e.all(`SELECT payload FROM ${Y}${n.length>0?` WHERE ${n.join(" AND ")}`:""} ORDER BY file, start_line, id`,...r).flatMap(a=>Li(a.payload))}function _i(e){e.exec(`
19
+ CREATE TABLE IF NOT EXISTS ${Y} (
20
+ id TEXT PRIMARY KEY,
21
+ protocol TEXT NOT NULL,
22
+ action TEXT NOT NULL,
23
+ role TEXT NOT NULL,
24
+ strength TEXT NOT NULL,
25
+ source_scope TEXT NOT NULL,
26
+ resolution TEXT NOT NULL,
27
+ file TEXT NOT NULL,
28
+ start_line INTEGER NOT NULL,
29
+ end_line INTEGER NOT NULL,
30
+ owner_symbol TEXT,
31
+ payload TEXT NOT NULL
32
+ );
33
+ CREATE INDEX IF NOT EXISTS idx_runtime_observations_protocol_action_scope
34
+ ON ${Y}(protocol, action, source_scope);
35
+ CREATE INDEX IF NOT EXISTS idx_runtime_observations_file_line
36
+ ON ${Y}(file, start_line);
37
+
38
+ CREATE TABLE IF NOT EXISTS ${Ae} (
39
+ id TEXT PRIMARY KEY,
40
+ protocol TEXT NOT NULL,
41
+ join_rule TEXT NOT NULL,
42
+ normalized_key TEXT NOT NULL,
43
+ payload TEXT NOT NULL
44
+ );
45
+ CREATE INDEX IF NOT EXISTS idx_runtime_groups_protocol_key
46
+ ON ${Ae}(protocol, join_rule, normalized_key);
47
+
48
+ CREATE TABLE IF NOT EXISTS ${De} (
49
+ group_id TEXT NOT NULL,
50
+ observation_id TEXT NOT NULL,
51
+ participant_role TEXT NOT NULL,
52
+ PRIMARY KEY (group_id, observation_id, participant_role)
53
+ );
54
+ CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
55
+ ON ${De}(observation_id, participant_role);
56
+ `)}function $i(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function ke(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function Li(e){try{return[JSON.parse(e)]}catch{return[]}}function fn(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",Oe))return null;let n=e.get(`SELECT schema_version, payload FROM ${Oe} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}export{Re as a,V as b,Je as c,ce as d,ye as e,Yr as f,Fi as g,Ti as h,fn as i};
57
+ //# sourceMappingURL=chunk-W6STWDQI.js.map
@@ -0,0 +1,2 @@
1
+ import{a as B,b as J,c as y,e as b,f as O,h as T,k as _,l as z}from"./chunk-NWQXSFFU.js";import{y as N}from"./chunk-WB3WYIRE.js";import{b as U}from"./chunk-TEBQMNVI.js";import{h as d}from"./chunk-FESCRNVV.js";import{c as j,h as v,i as g,r as A,t as P,v as $,y as m}from"./chunk-JWTGMPIT.js";var ce={references:T,referenceMap:_,callerMap:(t,s)=>b(t).callerMap(s),calleeMap:q};function q(t,s){let a=$(),i=new Map,o=O(t,s),r=[],n=[],u=0,c=0,p=0,f=0,E=0,k=0,H=0;for(let{definition:e,callees:l}of o.hits)E+=1,l.length>0&&(k+=1,H+=l.length,i.set(e.symbolId,l));let h=K(t,o.hits);if(h.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(t,h.entries),()=>({entries:h.entries.length,sourceMissing:h.sourceMissing,skippedUnsupportedLanguage:h.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[e,l]of B(o.misses)){if(!y(e)){a&&(u+=l.length);continue}let R=d(t,e);if(!R){a&&(c+=l.length),n.push(...l);continue}let x=g(t,e,R),C=G(t,e);if(!C){n.push(...l);continue}let Y=A(t,e,x,C);for(let D of l){let L=Y.get(D.symbol)??null;if(L!==null){let M=V(L);if(M){a&&(p+=1),M.length>0&&i.set(D.symbolId,M);continue}a&&(f+=1)}r.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:u,sourceMissing:c,cacheHits:p,parseFailures:f,misses:r.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:k,inMemoryCalleeCount:H,resultRows:i.size,missSample:r.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:n.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),r.length===0&&n.length===0)return i;let I=[...n,...r.map(e=>e.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let e=z(t,I);return w=e.size,e},()=>({definitions:I.length,misses:r.length,unkeyed:n.length,rows:w}));for(let[e,l]of F)i.set(e,l);let S=r.filter(e=>b(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(F.get(e.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(t,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:r.length})),i}function K(t,s){let a=[],i=new Map,o=0,r=0;for(let{definition:n,callees:u}of s){if(!y(n.relativePath)){r+=1;continue}if(!i.has(n.relativePath)){let p=d(t,n.relativePath),f=p?G(t,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(t,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){o+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(u)})}return{entries:a,sourceMissing:o,skippedUnsupportedLanguage:r}}var Q="typescript-callees-v2-callsite-line";function G(t,s){let a=y(s);if(a==="typescript")return N(t,s,Q)?.key??null;let i=X(t,s);return a==="rust"?v(JSON.stringify({kind:"semantic-callees",language:a,engine:J(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(t){try{return JSON.parse(t)}catch{return null}}var W=j("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,s){return W.get(t,s,()=>{let i=[...U(t).get(s)??[]].sort().map(o=>`${o}:${g(t,o,d(t,o))}`);return v(i.join("|"))})}export{ce as a};
2
+ //# sourceMappingURL=chunk-W7CXK74K.js.map
@@ -0,0 +1,4 @@
1
+ import{a as L,b as fe,e as ye,h as X,k as we,m as ve}from"./chunk-TRNAEQ6P.js";import{b as N}from"./chunk-TEBQMNVI.js";import{B as Fe,a as Me}from"./chunk-ZOHS7AQV.js";import{c as Re,e as Ie}from"./chunk-FESCRNVV.js";import{b as Se,d as xe,h as Y,y as Z}from"./chunk-JWTGMPIT.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,wa as be,x as pe,xa as he}from"./chunk-N5B2NILC.js";import{execFileSync as Te}from"child_process";import{createHash as nt}from"crypto";import{existsSync as C,statSync as rt}from"fs";import{createRequire as it}from"module";import{platform as ot}from"os";import{dirname as Pe,join as A}from"path";var st=it(import.meta.url),Rn={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function Q(t){return[t.indexerBinary,...t.binaryAliases??[]]}function at(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 dt(t)}function In(t){return ee(t)!==null||ct(t)}function ct(t){return Ae(t)!==null}function dt(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 st.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function lt(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return r}return null}function ut(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return Be(e,n,r)}return null}function Fn(t,e){let n=pt(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 pt(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=rt(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:nt("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function ft(t,e,n={}){return(n.trustProjectTools?ut(t,e)?.canonicalPath:null)??ee(t)}function wn(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 vn(t,e,n={}){let r=at(t),i=e?ft(t,e,n):ee(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&&lt(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=mt(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function mt(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),ot()==="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 Ft}from"v8";var yt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function O(t){let e=t.toLowerCase();return yt.some(n=>e.endsWith(n))}function q(t){let e=_(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(d=>[d.path,d])),i=t.snapshot.files.filter(d=>{let m=ae(d.path,["typescript"]);return m==="config"||m==="ambient"}).map(d=>d.path),o=_([...e,...i]),s=o.find(d=>!r.has(d)),a=new Set(t.snapshot.files.map(d=>d.path)).size!==t.snapshot.files.length,l=!s&&o.some(d=>ke(r.get(d))),u=Y(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:_(t.snapshot.typescriptProjects),membership:e})),p,f;return{identityFor(d,m){if(!n.has(d))return R("target-outside-project");if(a)return R("duplicate-input-path");if(s)return R("missing-input-fingerprint");if(l)return R("unreadable-input");let h=[],S,V;if(t.graph===null)h.push("dependency-graph-unavailable"),V="whole-project",S=o;else{let P=d===p&&f?f:gt(d,t.graph);if(p=d,f=P,P.find(K=>!r.has(K)))return R("missing-input-fingerprint");if(S=_([...P,...i]),S.some(K=>ke(r.get(K))))return R("unreadable-input");V="dependency-closure"}let tt=S.map(P=>bt(r.get(P)));return{version:1,key:Y(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:u,inputs:tt})),mode:V,inputFiles:S,reasons:h}}}}function gt(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 bt(t){return t.semanticHash===void 0?{path:t.path,size:t.size,hash:t.hash}:{path:t.path,semanticHash:t.semanticHash}}function ke(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{createRequire as ht}from"module";var je=ht(import.meta.url),B,$;function St(){if(B!==void 0)return B;try{B=je("ts-morph")}catch{B=null}return B}function W(){if($)return $;let t=St();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=je("ts-morph/package.json").version??"unknown"}catch{}return $=`ts-morph:${e}:typescript:${t.ts.version}`,$}function kn(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function jn(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var xt=xe("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function H(t,e,n){let r=xt.get(t,()=>Mt(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 Mt(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:N(t),engineIdentity:W()}),identities:new Map}:null}catch{return null}}function Ce(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,Rt(i));return n}}}function Oe(t,e,n){let r=Ne(t,e),i=Ne(t,n),o=[...r].filter(f=>!i.has(f)).sort(),s=[...i].filter(f=>!r.has(f)).sort(),a=Le(t,e),l=Le(t,n),u=[...a].filter(f=>!l.has(f)).sort(),p=[...l].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:l.size,missing:u,extra:p}}}function Le(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 Un(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,It(s));return i}function Ne(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 Rt(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 It(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",qe=128,D=Re({kind:"typescript-reference-fragments",invalidation:Ie("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:Et});function or(t,e,n,r=t,i,o=new Set(n.keys())){let s=I(t),a=q({projectFiles:s,snapshot:e,graph:i??N(t),engineIdentity:W()}),l=[],u=0;for(let[f,d]of n){let m=a.identityFor(f,J).key;if(!m){u+=1;continue}l.push({relativePath:f,contentHash:m,value:[...d]})}let p=s.filter(f=>!o.has(f)&&!n.has(f)).length;return D.writeBatch(r,l),{affectedFiles:l.length,carriedFiles:p,skippedAffectedFiles:u}}function sr(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),l=new Set(a),u=new Map;for(let m of $e(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=Ce(i,u),f=Oe(i,wt(n,l),p);if(!f.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...f},o;let d=[];for(let m of a){let h=H(t,m,J);h?.key&&d.push({relativePath:m,contentHash:h.key,value:u.get(m)??[]})}return D.writeBatch(t,d),o={state:"passing",files:a.length,keyedFiles:d.length,writtenFiles:d.length,...f},o}catch(s){return o=E(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function wt(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function ar(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 l=I(t);i=l.length;let u=ne(e),p=[];for(let d of l){let m=H(t,d,J);if(!m?.key)return null;let h=D.read(t,d,m.key);h===null?(s+=1,p.push({file:d,contentHash:m.key})):(o+=1,u.add(h))}return s===0?(r="hit",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):At(t,p,n,d=>{for(let{fragments:m}of d)u.add(m);a+=d.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 $e(t){let e=[];for(let n=0;n<t.length;n+=qe)e.push(t.slice(n,n+qe));return e}var vt=.75;function Pt(t){return{heapUsedFraction:()=>{let e=Ft();return e.heap_size_limit>0?e.used_heap_size/e.heap_size_limit:0},collect:Fe,release:()=>Se(t,{groups:["semantic-provider"]})}}function Tt(t,e=vt){return t.heapUsedFraction()<e||t.collect()&&t.heapUsedFraction()<e?!1:(t.release(),!0)}function At(t,e,n,r,i=Pt(t)){for(let o of $e(e)){let s=Bt(t,o,n);if(!s)return!1;r(s),Tt(i)}return!0}function Bt(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 cr(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 Et(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(Dt)?null:e}catch{return null}}function Dt(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 jt,randomUUID as Ve}from"crypto";import{closeSync as mr,existsSync as v,fstatSync as yr,lstatSync as j,mkdirSync as gr,openSync as br,readdirSync as w,readSync as hr,renameSync as Ke,rmSync as M}from"fs";import{basename as U,dirname as Lt,join as y}from"path";function We(t){return re(t,kt)}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 kt(t,e){return t.localeCompare(e)}var Nt=1,Ct=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},Ot=".owner.json",_t={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function wr(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 qt(t={}){let e={...Ct,...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 Ge(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>ge(n));return G(...e)}function vr(t,e){return jt("sha256").update(We({namespace:t,payload:e})).digest("hex")}function Xe(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function Pr(t,e,n={}){let r=qt(n.limits),i=n.nowMs??Date.now(),o=Ge(t);return Kt(e),Wt(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??ye,n.durability??"durable",()=>{$t(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),l=He(t,e.id);if(l){let d=Je(l,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:d.deadlineAtMs??e.deadlineAtMs}}let u=`${JSON.stringify(e)}
2
+ `,p=Buffer.byteLength(u),f=Ye(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 d=n.durability??"durable",m=X(s,u,{durability:d}),h=d==="durable"?G(o,m.directorySync):"not-requested";return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:m.achievedDurability,directorySync:h}}catch(d){if(d.code!=="EEXIST")throw d;let m=He(t,e.id);if(!m)throw d;let h=Je(m,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:h.deadlineAtMs??e.deadlineAtMs}}})}function $t(t,e,n,r=_t){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||zt(t,s.ownerId,r)!=="dead")continue;let l=y(t.pendingDir,s.originalFile);try{Ke(s.path,l),i.reclaimed++}catch(u){if(u.code!=="EEXIST")throw u;M(s.path,{force:!0})}T(Lt(s.path)),T(t.pendingDir),o--}o=Ue(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=Ue(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 Ze(s)){if(o<=0)break;if(!U(a).includes(".tmp-"))continue;let l;try{l=j(a).mtimeMs}catch(u){if(u.code==="ENOENT")continue;throw u}l+n.temporaryRetentionMs>e||(M(a,{force:!0}),i.temporaryFilesRemoved++,o--)}}return Gt(t.inflightDir),i}function Ye(t){Ge(t);let e=[...k(t.pendingDir).map(l=>({path:l,pending:!0})),...k(t.legacyRequestDir).map(l=>({path:l,pending:!0}))],n=oe(t.inflightDir).map(l=>({path:l.path,pending:!1})),r=k(t.responseDir).map(l=>({path:l,pending:!1})),i=k(t.deadLetterDir).map(l=>({path:l,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let l of e){let u=se(l.path);if(!u){s++;continue}let p=u.enqueuedAtMs;if(p===void 0)try{p=j(l.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((l,u)=>l+Xt(u.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Wt(t,e,n,r,i,o){let s=y(t.rootDir,".admission.lock"),a=`${process.pid}-${Ve()}`,l=r()+Math.max(0,n);for(;!Ht(t.rootDir,s,a,i);){if(Jt(s),r()>=l)throw new F("admission-busy",Ye(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 Ht(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 Jt(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||Ut(e))return;let n=`${t}.stale-${Ve()}`;try{Ke(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 Ut(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function zt(t,e,n){let r=Vt(y(t.inflightDir,Qe(e),Ot));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 Vt(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:L(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 He(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 Je(t,e,n){let r=se(t);if(r?.operationKey===e)return r;if(U(t)===`${Xe(e)}.json`)return{id:n,operationKey:e};throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`)}function Kt(t){if(t.mailboxVersion!==Nt||t.id!==Xe(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=ze(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=ze(s[1]),l=Number(s[2]);if(a===null||U(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(l))continue;let u=y(i,o.name),p=se(u)??{id:U(a,".json")},f;try{f=j(u)}catch(d){if(d.code==="ENOENT")continue;throw d}e.push({requestId:p.id,ownerId:r,path:u,originalFile:a,claimedAtMs:f.mtimeMs,claimExpiresAtMs:l,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 Ue(t,e,n,r,i){for(let o of k(t)){if(e<=0)break;let s;try{s=j(o)}catch(a){if(a.code==="ENOENT")continue;throw a}n(o,s.mtimeMs)>r||(M(o,{force:!0}),i(),e--)}return e}function k(t){return v(t)?w(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function Ze(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(...Ze(r))}return e.sort()}function Gt(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 Xt(t){try{return j(t).size}catch{return 0}}function Qe(t){return Buffer.from(t,"utf8").toString("base64url")}function ze(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return Qe(e)===t?e:null}catch{return null}}import{join as z}from"path";var jr=1e4,Yt="watch.lock",Zt="watch-state.json",Qt="watch-activity.json",en="watch-refresh-requests";function Lr(t){return{lockPath:z(t,Yt),statePath:z(t,Zt),activityPath:z(t,Qt),refreshRequestsPath:z(t,en)}}function Nr(t){try{return tn(JSON.parse(x(t,"watch service state")))}catch{return null}}function tn(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)||!nn(e.watcher)||e.idleDeadlineAt!==void 0&&!g(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=L(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&&!rn(e.lastError)||e.lastRefresh!==void 0&&!on(e.lastRefresh)||e.reindexActivity!==void 0&&!sn(e.reindexActivity)||e.refreshRequests!==void 0&&!cn(e.refreshRequests)||e.typescriptSemantic!==void 0&&!dn(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!ln(e.typescriptIndex)?null:e}function g(t){return de(t)}function nn(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 rn(t){if(!t||typeof t!="object")return!1;let e=t;return g(e.at)&&typeof e.message=="string"}function on(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 sn(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&&!an(e.byLanguage)?!1:Object.values(e.byTrigger).every(n=>n===void 0||c(n))}function an(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 cn(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 dn(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||et(e.mailbox))}function ln(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||et(e.mailbox))}function et(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{Rn as a,at as b,ee as c,In as d,lt as e,ut as f,Fn as g,wn as h,vn as i,We as j,Nt as k,wr as l,vr as m,Xe as n,Pr as o,jr as p,Lr as q,Nr as r,yt as s,O as t,St as u,kn as v,jn as w,Un as x,H as y,or as z,sr as A,ar as B,cr as C};
4
+ //# sourceMappingURL=chunk-WB3WYIRE.js.map
@@ -1,4 +1,4 @@
1
- import{e as l,f as d,h as u}from"./chunk-WN3TCGJ4.js";import{F as c}from"./chunk-AK3PYTIK.js";import h from"better-sqlite3";var m=["busy_timeout = 5000","query_only = ON","temp_store = MEMORY","cache_size = -64000","mmap_size = 268435456"],o=class{constructor(t,e){this.connection=t;this.releaseGenerationReader=e}connection;releaseGenerationReader;active=!0;initialize(t){try{for(let e of m)this.connection.pragma(e);t(this.connection)}catch(e){try{this.close()}catch(n){throw new AggregateError([e,n],"SQLite initialization and rollback both failed.",{cause:n})}throw e}}close(){if(!this.active)return;this.active=!1;let t,e;try{this.connection.close()}catch(n){t=n}try{this.releaseGenerationReader()}catch(n){e=n}if(t!==void 0&&e!==void 0)throw new AggregateError([t,e],"SQLite connection close and generation-reader release both failed.");if(t!==void 0)throw t;if(e!==void 0)throw e}},b=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],p=class{db;config;generation;pathFilter;connection;connectionOwnership;statementCache=new Map;constructor(t,e){this.config=t,this.pathFilter=e??null;let n=S(t),i=new o(n.db,n.release);try{i.initialize(y),this.generation=n.generation,this.connection=n.db,this.connectionOwnership=i,this.db=g(n.db)}catch(r){try{i.close()}catch(s){throw new AggregateError([r,s],"SQLite construction and rollback both failed.",{cause:s})}throw r}}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
1
+ import{o as l,t as d,w as u}from"./chunk-5ENOG4VP.js";import{f as c}from"./chunk-N5B2NILC.js";import h from"better-sqlite3";var m=["busy_timeout = 5000","query_only = ON","temp_store = MEMORY","cache_size = -64000","mmap_size = 268435456"],o=class{constructor(t,e){this.connection=t;this.releaseGenerationReader=e}connection;releaseGenerationReader;active=!0;initialize(t){try{for(let e of m)this.connection.pragma(e);t(this.connection)}catch(e){try{this.close()}catch(n){throw new AggregateError([e,n],"SQLite initialization and rollback both failed.",{cause:n})}throw e}}close(){if(!this.active)return;this.active=!1;let t,e;try{this.connection.close()}catch(n){t=n}try{this.releaseGenerationReader()}catch(n){e=n}if(t!==void 0&&e!==void 0)throw new AggregateError([t,e],"SQLite connection close and generation-reader release both failed.");if(t!==void 0)throw t;if(e!==void 0)throw e}},b=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],p=class{db;config;generation;pathFilter;connection;connectionOwnership;statementCache=new Map;constructor(t,e){this.config=t,this.pathFilter=e??null;let n=S(t),i=new o(n.db,n.release);try{i.initialize(y),this.generation=n.generation,this.connection=n.db,this.connectionOwnership=i,this.db=g(n.db)}catch(r){try{i.close()}catch(s){throw new AggregateError([r,s],"SQLite construction and rollback both failed.",{cause:s})}throw r}}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
2
2
  EXISTS (
3
3
  SELECT 1
4
4
  FROM defn_enclosing_ranges local_der
@@ -17,4 +17,4 @@ import{e as l,f as d,h as u}from"./chunk-WN3TCGJ4.js";import{F as c}from"./chunk
17
17
  )
18
18
  )`}get pathExclusions(){return this.pathExclusionsFor("d")}get symbolNoise(){return this.symbolNoiseFor("gs")}pathExclusionsFor(...t){return t.flatMap(e=>b.flatMap(n=>[`AND ${e}.relative_path NOT LIKE '${n}/%'`,`AND ${e}.relative_path NOT LIKE '%/${n}/%'`])).join(`
19
19
  `)}symbolNoiseFor(t){return`AND ${t}.symbol NOT LIKE '%().(%' AND ${t}.symbol NOT LIKE '%typeLiteral%'`}all(t,...e){return this.statement(t).all(...e)}get(t,...e){return this.statement(t).get(...e)}close(){this.statementCache.clear(),this.connectionOwnership.close()}statement(t){let e=this.statementCache.get(t);return e||(e=this.connection.prepare(t),this.statementCache.set(t,e)),e}};function g(a){return Object.freeze({prepare(t){let e=a.prepare(t);if(!e.readonly||!e.reader)throw new Error("ScipDatabase.db only permits read-only statements that return rows.");return f(e)}})}function f(a){let t={get:(...e)=>a.get(...e),all:(...e)=>a.all(...e),iterate:(...e)=>a.iterate(...e),pluck(e){return e===void 0?a.pluck():a.pluck(e),t},expand(e){return e===void 0?a.expand():a.expand(e),t},raw(e){return e===void 0?a.raw():a.raw(e),t},bind(...e){return a.bind(...e),t},columns:()=>a.columns(),safeIntegers(e){return e===void 0?a.safeIntegers():a.safeIntegers(e),t}};return Object.freeze(t)}function y(a){if(!a.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'documents'").get())return;let e=a.prepare("SELECT relative_path FROM documents").iterate();for(let n of e)c(n.relative_path)}function S(a){for(let t=0;t<4;t+=1){let e=l(a),n=e.generation,i;try{i=new h(n.databasePath,{readonly:!0,fileMustExist:!0})}catch(r){throw e.release(),r}if(n.source==="immutable")return{db:i,generation:n,release:e.release};try{let r=d(a);if(n.databaseFileIdentity===u(n.databasePath)&&r.source==="legacy"&&r.identity===n.identity&&r.databaseFileIdentity===n.databaseFileIdentity&&r.metadataRaw===n.metadataRaw)return{db:i,generation:n,release:e.release}}catch(r){throw i.close(),e.release(),r}i.close(),e.release()}throw new Error("SQLite index publication changed repeatedly while opening a coherent generation.")}export{p as a};
20
- //# sourceMappingURL=chunk-C76O5MDS.js.map
20
+ //# sourceMappingURL=chunk-WDNVY4E7.js.map
@@ -1,3 +1,3 @@
1
- import{e as i}from"./chunk-TD7VKJ2Y.js";import{a as o}from"./chunk-42W3LFUK.js";import{E as s}from"./chunk-Q7GBK5T7.js";function u(r,e){let t=s(r,e.relativePath);if(t.length===0)return!1;let n=i(e.symbol);if(!n)return!1;let c=t.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
1
+ import{e as i}from"./chunk-N2ZSIIGR.js";import{a as o}from"./chunk-ODDUPDP7.js";import{k as s}from"./chunk-FESCRNVV.js";function u(r,e){let t=s(r,e.relativePath);if(t.length===0)return!1;let n=i(e.symbol);if(!n)return!1;let c=t.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
2
  `),a=o(n);return new RegExp(`^\\s*export\\s+(?:default\\s+)?(?:(?:async\\s+)?function\\s+${a}\\b|(?:abstract\\s+)?class\\s+${a}\\b|(?:interface|type|enum|namespace|module)\\s+${a}\\b|(?:const|let|var)\\s+${a}\\b)`,"m").test(c)?!0:p(t,n)}function p(r,e){if(!e)return!1;let t=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${o(e)}\\b`);return r.some(n=>t.test(n))}export{u as a};
3
- //# sourceMappingURL=chunk-TAYD3AE7.js.map
3
+ //# sourceMappingURL=chunk-WIWY3CRX.js.map
@@ -0,0 +1,3 @@
1
+ import{a as H,b as O,c as pe,e as de,f as U,j as ue}from"./chunk-TQZV7KV4.js";import{T as v,U as ye,c as se,d as ae,e as ce,f as le,g as _,n as fe}from"./chunk-3L2ZBPEX.js";import{a as A}from"./chunk-YXPUP5G2.js";import{d as w,e as me}from"./chunk-DRENNWRG.js";import{d as oe}from"./chunk-RTQ7NEKG.js";import{c as ie}from"./chunk-IW5XQG5G.js";import{a as j,e as I}from"./chunk-HGFDYOVB.js";import{$ as K,W as re}from"./chunk-KYSDI3GE.js";import{h as ne}from"./chunk-7F45LJKI.js";import{existsSync as E}from"fs";import b from"path";var W=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function z(o,e){let t=e?b.dirname(b.join(o,e)):o,r=b.resolve(o);for(;t.startsWith(r);){for(let s of W){let a=b.join(t,s);if(E(a))return a}let i=b.dirname(t);if(i===t)break;t=i}for(let i of W){let s=b.join(o,i);if(E(s))return s}return null}function ge(o){let e=o.config.projectRoot,n=new Set(He(e,o.config.semantic?.typescript?.tsconfigs)),t=A(o,{includeIgnored:!1,extensions:H});for(let r of t){let i=z(e,r);i&&n.add(b.resolve(i))}if(n.size===0){let r=z(e);r&&n.add(b.resolve(r))}return[...n].filter(r=>!he(e,r)).sort((r,i)=>r.localeCompare(i))}function He(o,e=[]){let n=new Set;for(let t of e){let r=b.isAbsolute(t)?t:b.join(o,t);E(r)&&n.add(b.resolve(r))}for(let t of Oe(o))for(let r of W){let i=b.join(t,r);E(i)&&n.add(b.resolve(i))}if(n.size===0){let t=z(o);t&&n.add(b.resolve(t))}return[...n].filter(t=>!he(o,t)).sort((t,r)=>t.localeCompare(r))}function Oe(o){let e=b.join(o,"package.json");if(!E(e))return[];let n;try{n=JSON.parse(ne(e,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(r=>le(o,r))}function he(o,e){let n=b.relative(o,e).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as m}from"perf_hooks";function x(o,e,n){if(o.has(e))return o.get(e);let t=n();return o.set(e,t),t}import Me from"path";import{realpathSync as Se}from"fs";function Ue(o,e){return o.getReferences().map(n=>{let t=n.getNode();return B(t,e)})}function Be(o){let e=o;return typeof e.findReferences=="function"?e.findReferences():[]}function Ie(o,e,n,t){let r=[];for(let i of Be(o))for(let s of Ue(i,t))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let i of n)r.push(i);return P(r)}function xe(o,e,n,t){let r=[],i=n?.getStart();for(let s of o.getReferences()){let a=s.getNode();L(t,a.getSourceFile().getFilePath())===e&&(i!==void 0&&a.getStart()===i||r.push({location:B(a,t),node:a}))}return r}function B(o,e){let n=o.getSourceFile(),t=n.getLineAndColumnAtPos(o.getStart());return{file:L(e,n.getFilePath())??n.getBaseName(),line:t.line-1,column:t.column-1}}function Fe(o,e,n){let t=o.getSourceFile(),r=q(t,o),i=o.getText(),s=new RegExp(`\\b${fe(i)}\\b`,"g"),a=t.getFullText().split(`
2
+ `),c=[];for(let l=0;l<a.length;l++){if(l===r)continue;let f=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(f))!==null;)c.push({file:e,line:l,column:p.index})}return P(c.filter(l=>L(n,Me.join(n,l.file))===e))}function V(o){for(let e=o;e;e=e.getParent()){let n=e.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function q(o,e){return o.getLineAndColumnAtPos(e.getStart()).line-1}function P(o){let e=new Set,n=[];for(let t of o){let r=`${t.file}:${t.line}:${t.column}`;e.has(r)||(e.add(r),n.push(t))}return n}function L(o,e){let n=o||process.cwd(),t=be(n,e);if(t)return t;try{return be(Se(n),Se(e))}catch{return null}}function be(o,e){let n=Me.relative(o,e).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function Te(o,e,n,t){let r=$e(e,t);return r.size===0?new Map:Ke(o,n,r)}function $e(o,e){let n=new Map;for(let t of v(o,e)){let r=w(t.symbol)??t.leaf;if(!r)continue;let i=n.get(r);i||(i=[],n.set(r,i)),i.push(t)}return n}function Ke(o,e,n){let t=new Map,r=new Map;return e.forEachDescendant(i=>{for(let s of _e(o,i)){let a=n.get(s);if(!a)continue;let c=q(e,i);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let f=Math.abs(c-l.startLine),p=r.get(l.symbolId);p!==void 0&&p<=f||(r.set(l.symbolId,f),t.set(l.symbolId,i))}}}),t}function _e(o,e){let n=[],t=r=>{r&&!n.includes(r)&&n.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();t(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();t(r)}return o.Node.isIdentifier(e)&&t(e.getText()),n}var We=ie("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ke(o,e,n,t){let r=J(o,e),i=Y(r.get(t)??[],n);if(i)return i;let s=[];for(let a of r.values())for(let c of a)((c.leaf||w(c.symbol)||"").includes(t)||c.symbol.includes(t))&&s.push(c);return Y(s,n)}function G(o,e,n,t){return Y(J(o,e).get(t)??[],n)}function De(o,e){let n=new Map;for(let[t,r]of J(o,e)){let i=r[0];i&&n.set(t,i)}return n}function J(o,e){return We.get(o,e,()=>{let n=new Map;for(let t of v(o,e)){let r=t.leaf||w(t.symbol);if(!r)continue;let i=n.get(r);i||(i=[],n.set(r,i)),i.push({...t,leaf:r})}for(let t of n.values())t.sort((r,i)=>r.startLine-i.startLine||r.endLine-i.endLine||r.symbolId-i.symbolId);return n})}function Y(o,e){let n=null,t=Number.POSITIVE_INFINITY;for(let r of o){let i=Math.abs(r.startLine-e);(i<t||i===t&&n&&r.startLine<n.startLine)&&(n=r,t=i)}return n}import ze from"path";import{realpathSync as Ve}from"fs";function Re(o,e){let n=new Map,t=null,r=null,i=()=>(r??=A(o,{extensions:H}),r),s=()=>(t??=I("typescript.source-file-index",()=>qe(o.config.projectRoot,e,i()),()=>({projects:e.length,indexedDocuments:i().length})),t),a=c=>O(c)?x(n,c,()=>{let l=Ne(o.config.projectRoot,c);if(!l)return null;for(let{project:f,sourceFiles:p}of s()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&X(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:i}}function qe(o,e,n){let t=e.map(({project:r})=>{let i=new Map;for(let s of r.getSourceFiles())X(i,s);return{project:r,sourceFiles:i}});for(let r of n){let i=Ne(o,r);if(i)for(let s of t){if(s.sourceFiles.has(i))break;let a=s.project.addSourceFileAtPathIfExists(i)??null;if(a){X(s.sourceFiles,a);break}}}return t}function X(o,e){let n=Q(e.getFilePath());o.set(n,e);try{o.set(Q(Ve(n)),e)}catch(t){if(!K(t))throw t}}function Ne(o,e){try{return Q(re(o,e,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!K(n))throw n;return null}}function Q(o){return ze.resolve(o)}function Z(o,e){for(let n of o)if(e===n.name||e.startsWith(`${n.name}/`))return n.name;return null}function Ce(o){let e=`${o.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}var Ye=32;function tn(o,e){let n=I("typescript.provider.load",()=>pe());if(!n)return U("ts-morph is not installed");let t=I("typescript.provider.tsconfig-discovery",()=>ge(o));if(t.length===0)return U("no tsconfig found");try{let r=I("typescript.provider.project-bundles",()=>de(n,t),()=>({tsconfigs:t.length}));return Ge(o,n,r)}catch(r){return U(r instanceof Error?r.message:String(r),t[0],t)}}function Ge(o,e,n,t={}){return I("typescript.provider.construct",()=>new ee(o,e,n),()=>({tsconfigs:n.length,reusedProjects:t.reusedProjects===!0}))}var ee=class{constructor(e,n,t){this.db=e;this.tsMorph=n;this.projects=t;this.workspacePackages=ce(e.config.projectRoot),this.sourceFiles=Re(e,t)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return x(this.importUsageCache,e,()=>{let n=this.sourceFiles.sourceFile(e);if(!n)return[];let t=Xe();return I("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,n,t),()=>({file:e,...t}))})}referencesFor(e){return x(this.referencesCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,n)})}referencesForDefinitions(e,n={}){let t=new Map,r=j(),i=[];for(let f of e){let p=this.referencesCache.get(f.symbolId);p?t.set(f.symbolId,p):i.push(f)}if(i.length===0)return t;let s=i,a=n.exact?[]:i.filter(f=>!Pe(f));if(a.length>=Ye){let f=this.referencesForDefinitionsBySymbolScan(a);for(let p of a){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}if(s=i.filter(p=>Pe(p)),s.length===0)return t}let c=new Map;for(let f of s){let p=c.get(f.relativePath);p?p.push(f):c.set(f.relativePath,[f])}let l=[];for(let[f,p]of c){let d=Le();I("typescript.references-map.file",()=>{let S=this.definitionNodesForFile(f);for(let y of p){r&&(d.cacheMisses+=1);let h=S.get(y.symbolId)??null;r&&(h?d.nodeHits+=1:d.nodeMisses+=1);try{let u=this.referencesForDefinitionNode(y,h,r?d:void 0);this.referencesCache.set(y.symbolId,u),t.set(y.symbolId,u)}catch{d.preciseSearchFailures+=1,l.push(y)}}},()=>({relativePath:f,definitions:p.length,...Ee(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);for(let p of l){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}}return t}referenceFragmentsForFiles(e){let n=ye(this.db).filter(i=>O(i.relativePath)),t=e.filter(i=>this.sourceFiles.sourceFile(i)!==null),r=this.referencesForDefinitionsBySymbolScan(n,t);return ue(n,r,t)}referencesForDefinitionsBySymbolScan(e,n){let t=j(),r=Le(),i=new Map,s=new Set(e.map(c=>c.symbolId)),a=new Map(e.map(c=>[c.symbolId,c]));for(let c of e)i.set(c.symbolId,[]);return I("typescript.references-map.inverted-scan",()=>{let c=t?m.now():0,l=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let u of e){let g=l.get(u.symbolId)??[];if(g.length>0){let T=i.get(u.symbolId)??[];T.push(...g),i.set(u.symbolId,T)}t&&(r.packageReferenceCount+=g.length)}t&&(r.packageRefsMs+=m.now()-c);let f=new Map,p=new Map,d=this.hierarchyTargetsForDefinitions(e),S=new Set(e.map(u=>u.leaf).filter(Boolean)),y=t?m.now():0;for(let u of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(u))continue;let g=this.sourceFiles.sourceFile(u);g&&(t&&(r.scanFiles+=1),this.addReferencesFromSourceFileScan(g,u,s,a,d,S,f,p,i,t?r:void 0))}t&&(r.scanMs+=m.now()-y);let h=t?m.now():0;this.addHierarchyMemberReferences(e,i,t?r:void 0),t&&(r.hierarchyMs+=m.now()-h);for(let[u,g]of i){let T=P(g);i.set(u,T),t&&(r.referenceCount+=T.length)}},()=>({definitions:e.length,...Ee(r)})),i}addReferencesFromSourceFileScan(e,n,t,r,i,s,a,c,l,f){let p=this.compilerCheckerForSourceFile(e),d=e.compilerNode,S=et(e),y=h=>{if(this.tsMorph.ts.isIdentifier(h)){if(f&&(f.identifiers+=1),!s.has(h.text)&&!S.has(h.text)){this.tsMorph.ts.forEachChild(h,y);return}let u=this.compilerReferenceSymbol(p,h,f);if(u){let g;a.has(u)?g=a.get(u)??null:(g=this.referenceDefinitionFromCompilerSymbol(u),a.set(u,g)),f&&(g?f.targetHits+=1:f.targetMisses+=1);let T=x(c,u,()=>this.compilerSymbolKeys(u)),N=null,k=null,C=g&&t.has(g.symbolId)?r.get(g.symbolId):void 0;if(C&&(N=$(d,h),!ve(C,n,N))){let R=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:R.line,column:R.character};let D=l.get(C.symbolId)??[];D.push(k),l.set(C.symbolId,D),f&&(f.requestedHits+=1)}for(let R of T)for(let D of i.get(R)?.values()??[]){if(N??=$(d,h),ve(D,n,N))continue;if(!k){let F=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:F.line,column:F.character}}let M=l.get(D.symbolId)??[];M.push(k),l.set(D.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(h,y)};y(d)}hierarchyTargetsMemo=null;hierarchyTargetsForDefinitions(e){let n=ot(e);if(this.hierarchyTargetsMemo?.key===n)return this.hierarchyTargetsMemo.targets;let t=oe(this.db),r=`definitions:${n}`,i=!1,s=I("typescript.references-map.hierarchy-targets",()=>{if(t){let c=we.read(this.db,r,t);if(c&&c.projectRoot===this.db.config.projectRoot)return i=!0,it(c,e)}let a=this.computeHierarchyTargets(e);return t&&we.write(this.db,r,t,{version:Ae,projectRoot:this.db.config.projectRoot,entries:[...a].map(([c,l])=>[c,[...l.values()].map(f=>f.symbol)])}),a},()=>({definitions:e.length,hit:i}));return this.hierarchyTargetsMemo={key:n,targets:s},s}computeHierarchyTargets(e){let n=new Map;for(let t of e){let r=this.nodeForDefinition(t),i=r?.compilerNode;if(!i||!this.isHierarchyMethod(i))continue;let s=i.parent;if(!this.isHierarchyContainer(s))continue;let a=this.compilerCheckerForSourceFile(r.getSourceFile()),c=a.getSymbolAtLocation(i.name);if(c)for(let l of this.hierarchyMemberSymbols(a,s,c))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(t.symbolId,t),n.set(f,p)}}return n}hierarchyMemberSymbols(e,n,t){let r=new Set,i=new Set,s=(a,c,l)=>{if(!i.has(a)){i.add(a),r.add(c);for(let f of l){let p=f.getProperty(t.name);p&&s(f,p,this.hierarchyAncestorTypesForType(e,f))}}};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}addHierarchyMemberReferences(e,n,t){let r=new Map;for(let i of e){let s=this.nodeForDefinition(i),a=s?.compilerNode;if(!a||!this.isHierarchyMethod(a))continue;let c=a.parent;if(!this.isHierarchyContainer(c))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),f=l.getSymbolAtLocation(a.name);if(!f)continue;let p=a.getSourceFile(),d=p.getLineAndCharacterOfPosition(a.name.getStart(p)),S={definition:i,location:{file:i.relativePath,line:d.line,column:d.character}},y=n.get(i.symbolId)??[];for(let u of this.hierarchyMemberSymbols(l,c,f))if(u!==f)for(let g of this.compilerSymbolLocations(u))y.push(g),t&&(t.hierarchyReferences+=1);n.set(i.symbolId,y);let h=this.hierarchyRootMemberSymbols(l,c,f);for(let u of h){let g=r.get(u)??new Map;g.set(i.symbolId,S),r.set(u,g)}t&&(t.hierarchyDefinitions+=1)}for(let i of r.values())if(!(i.size<2)){t&&(t.hierarchyFamilies+=1);for(let{definition:s}of i.values()){let a=n.get(s.symbolId)??[];for(let c of i.values())c.definition.symbolId!==s.symbolId&&(a.push(c.location),t&&(t.hierarchyReferences+=1));n.set(s.symbolId,a)}}}hierarchyRootMemberSymbols(e,n,t){let r=new Set,i=new Set,s=(a,c,l)=>{if(i.has(a))return;i.add(a);let f=!1;for(let p of l){let d=p.getProperty(t.name);d&&(f=!0,s(p,d,this.hierarchyAncestorTypesForType(e,p)))}if(!f)for(let p of this.compilerSymbolKeys(c))r.add(p)};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}compilerSymbolKeys(e){return(e.declarations??[]).map(n=>{let t=n.getSourceFile();return`${t.fileName}\0${n.getStart(t)}\0${e.name}`})}compilerSymbolLocations(e){let n=[];for(let t of e.declarations??[]){let r=t.getSourceFile(),i=L(this.db.config.projectRoot,r.fileName);if(!i)continue;let s=t.name,a=r.getLineAndCharacterOfPosition((s??t).getStart(r));n.push({file:i,line:a.line,column:a.character})}return n}baseTypes(e,n){try{return e.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(e,n){let t=new Set(this.hierarchyAncestorTypesForType(e,e.getTypeAtLocation(n)));for(let r of n.heritageClauses??[])for(let i of r.types)t.add(e.getTypeAtLocation(i));return[...t]}hierarchyAncestorTypesForType(e,n){let t=new Set(this.baseTypes(e,n));for(let r of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(r))for(let i of r.heritageClauses??[])for(let s of i.types)t.add(e.getTypeAtLocation(s));return[...t]}isHierarchyMethod(e){return this.tsMorph.ts.isMethodDeclaration(e)||this.tsMorph.ts.isMethodSignature(e)}isHierarchyContainer(e){return this.tsMorph.ts.isClassDeclaration(e)||this.tsMorph.ts.isClassExpression(e)||this.tsMorph.ts.isInterfaceDeclaration(e)}compilerReferenceSymbol(e,n,t){t&&(t.symbolLookups+=1);let r=e.getSymbolAtLocation(n);if(r){if((r.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return r;try{return t&&(t.aliasResolutions+=1),e.getAliasedSymbol(r)}catch{return r}}}calleesFor(e){return x(this.calleesCache,e.symbolId,()=>x(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let n=new Map,t=new Map;for(let r of e){let i=t.get(r.relativePath);i?i.push(r):t.set(r.relativePath,[r])}for(let[r,i]of t){let s=this.fileCalleesCache.get(r),a=new Set(i.map(l=>l.symbolId)),c=s??this.calleeMapForFile(r,a);for(let l of i){let f=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(e,n,t){let r=t?m.now():0,i=this.packageImportReferencesForDefinition(e);if(t&&(t.packageRefsMs+=m.now()-r,t.packageReferenceCount+=i.length),!n)return i;let s=t?m.now():0,a=Ie(n,e,i,this.db.config.projectRoot);return t&&(t.semanticRefsMs+=m.now()-s,t.referenceCount+=a.length),a}signatureFor(e){return x(this.signatureCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let t=n.getType().getCallSignatures()[0];if(!t)return null;let r=t.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return je(c)}),i=t.getReturnType().getText(n);return`(${r.join(",")})=>${je(i)}`})}importUsageForSourceFile(e,n,t){let r=[],i=new Map;for(let s of n.getImportDeclarations()){t.declarations+=1;let a=_(this.db,e,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of te(s)){t.entries+=1;let f=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(f?t.bindingSymbols+=1:t.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:f,references:[]};if(r.push(p),c||!l.localName||!f)continue;let d=i.get(l.localName);d?d.push(p):i.set(l.localName,[p])}}return i.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=i.get(s.getText());if(!a||Qe(s))return;t.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(t.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:B(s,this.db.config.projectRoot),node:s}),t.matchedReferences+=1;break}}}),r.map(s=>s.typeOnlyDeclaration?Je(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(t.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,n,t){let r=t.identifier?t.identifier.findReferences():[],i=[];for(let s of r)for(let a of xe(s,e,t.identifier,this.db.config.projectRoot))i.push(a);return this.valueImportUsageFromLocations(e,n,t,i)}valueImportUsageFromLocations(e,n,t,r){let i=r.some(c=>!V(c.node)),s=r.some(c=>V(c.node)),a=t.isTypeOnly;return{importer:e,sourcePath:n,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:a,isUsed:a||r.length>0,isTypeUsed:a||s,isValueUsed:i,references:r.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferencesForFiles(e){let n=new Map,t=new Set;for(let i of e){let s=this.sourceFiles.sourceFile(i);if(s)for(let a of s.getImportDeclarations()){let c=Z(this.workspacePackages,a.getModuleSpecifierValue());c&&t.add(c)}}if(t.size===0)return n;let r=this.packageExportsForNames(t);for(let i of e)this.addPackageImportReferencesForDocument(n,r,i);for(let[i,s]of n)n.set(i,P(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,n=this.packageExports();for(let t of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,n,t);for(let[t,r]of e)e.set(t,P(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,n,t){if(this.db.isIgnored(t))return;let r=this.sourceFiles.sourceFileMatch(t);if(r)for(let i of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,n,t,i)}addPackageImportReferencesForDeclaration(e,n,t,r){let i=Z(this.workspacePackages,r.getModuleSpecifierValue());if(!i)return;let s=n.get(i);if(s)for(let a of te(r)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=Fe(a.identifier,t,this.db.config.projectRoot);l.length>0&&st(e,c,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(e=>e.name))),this.packageExportIndex)}packageExportsForNames(e){let n=new Map;for(let t of this.workspacePackages){if(!e.has(t.name))continue;let r=new Map;for(let i of Ce(t))this.collectPackageExports(t,i,r,new Set);r.size>0&&n.set(t.name,r)}return n}collectPackageExports(e,n,t,r){if(r.has(n))return;r.add(n);let i=this.sourceFiles.sourceFile(n);if(i)for(let s of i.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?_(this.db,n,a):n;if(!c||!c.startsWith(`${e.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,t,r);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,S=this.indexedDefinitionByLeaf(c,p);if(!S)continue;let y=t.get(d);y||(y=new Set,t.set(d,y)),y.add(S.symbolId)}}}indexedDefinitionByLeaf(e,n){return x(this.indexedDefinitionLeafCache,e,()=>De(this.db,e)).get(n)??null}nodeForDefinition(e){return x(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return x(this.fileDefinitionNodeCache,e,()=>{let n=this.sourceFiles.sourceFile(e);return n?Te(this.tsMorph,this.db,n,e):new Map})}referenceDefinitionFromCompilerSymbol(e){return this.definitionFromCompilerSymbol(e,void 0,!0)}definitionFromCompilerSymbol(e,n,t=!1){let r=e.name,i=n?m.now():0,s=e.declarations??[];n&&(n.declarationsMs+=m.now()-i,n.declarationChecks+=s.length);for(let a of s){let c=n?m.now():0,l=a.getSourceFile(),f=L(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(a.getStart(l)).line;if(n&&(n.declarationLocationMs+=m.now()-c),!f||this.db.isIgnored(f))continue;let d=n?m.now():0,S=this.compilerDeclarationName(a),y=t?G(this.db,f,p,r)??(S&&S!==r?G(this.db,f,p,S):null):ke(this.db,f,p,r);if(n&&(n.indexedLookupMs+=m.now()-d),y)return{symbolId:y.symbolId,symbol:y.symbol,file:y.relativePath,line:y.startLine}}return null}compilerDeclarationName(e){let n=e.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(e,n){let t=j(),r=0,i=0,s=0,a=0,c=0,l=0,f=0,p=0,d=t?nt():void 0;return I("typescript.callee-map.file",()=>{let S=t?m.now():0,y=this.sourceFiles.sourceFile(e);if(t&&(c=Math.round(m.now()-S)),!y)return new Map;let h=t?m.now():0,u=v(this.db,e).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(t&&(l=Math.round(m.now()-h)),r=u.length,u.length===0)return new Map;let g=new Map,T=t?m.now():0,N=this.compilerCheckerForSourceFile(y),k=y.compilerNode;t&&(f=Math.round(m.now()-T));let C=new Map,R=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){t&&(i+=1);let F=this.semanticCalleeForCallNode(N,k,u,M,C,n,d);F&&(t&&(s+=1),Ze(g,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,R)},D=t?m.now():0;R(k),t&&(p=Math.round(m.now()-D));for(let[M,F]of g)g.set(M,at(F));return a=g.size,g},()=>({relativePath:e,definitions:r,callNodes:i,resolvedCallees:s,outputRows:a,requestedDefinitions:n?.size??r,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?rt(d):{}}))}semanticCalleeForCallNode(e,n,t,r,i,s,a){let c=a?m.now():0,l=tt(t,$(n,r));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let f=r.expression,p=this.compilerSymbolForExpression(e,f,a),d=null;if(p)if(a&&(a.targetSymbolHits+=1),i.has(p))a&&(a.compilerSymbolCacheHits+=1),d=i.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let S=a?m.now():0;d=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-S),i.set(p,d)}else a&&(a.targetMisses+=1);return d?{callerId:l.symbolId,target:{symbol:d.symbol,file:d.file,line:d.line,callsiteLine:$(n,r)}}:null}compilerSymbolForExpression(e,n,t){let r=t?m.now():0,i=e.getSymbolAtLocation(n);if(t&&(t.expressionSymbolMs+=m.now()-r),i)return i;t&&(t.typeFallbacks+=1);let s=t?m.now():0,a=e.getTypeAtLocation(n).getSymbol();return t&&(t.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(e){let n=e.getProject(),t=this.compilerCheckerCache.get(n);return t||(t=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,t)),t}};function te(o){let e=[],n=o.getDefaultImport();n&&e.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});let t=o.getNamespaceImport();t&&e.push({identifier:t,importedName:"*",localName:t.getText(),kind:"namespace",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});for(let r of o.getNamedImports()){let i=r.getNameNode(),a=r.getAliasNode()??(i.getKindName()==="Identifier"?i:null);e.push({identifier:a,importedName:i.getText(),localName:a?.getText()??i.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(o.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Je(o,e,n){return{importer:o,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Xe(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Qe(o){for(let e=o;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function Ze(o,e,n){let t=o.get(e);t||(t=[],o.set(e,t)),t.push(n)}function et(o){let e=new Set;for(let n of o.getImportDeclarations())for(let t of te(n))t.localName&&e.add(t.localName);return e}function tt(o,e){let n=null;for(let t of o)e<t.startLine||e>t.endLine||(!n||t.startLine>=n.startLine)&&(n=t);return n}function $(o,e){return o.getLineAndCharacterOfPosition(e.getStart(o)).line}function ve(o,e,n){return e===o.relativePath&&n>=o.startLine&&n<=o.endLine}function Pe(o){return o.symbol.includes("#")?me(o.symbol)==="type"&&o.relativePath.endsWith(".d.ts"):!1}function nt(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function rt(o){return{...o,callerLookupMs:Math.round(o.callerLookupMs),expressionSymbolMs:Math.round(o.expressionSymbolMs),typeSymbolMs:Math.round(o.typeSymbolMs),targetLookupMs:Math.round(o.targetLookupMs),declarationsMs:Math.round(o.declarationsMs),declarationLocationMs:Math.round(o.declarationLocationMs),indexedLookupMs:Math.round(o.indexedLookupMs)}}function Le(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}var Ae=1,we=se({kind:"typescript-hierarchy-targets",invalidation:ae("typescript-hierarchy-targets"),serialize:o=>JSON.stringify(o),deserialize:o=>{try{let e=JSON.parse(o);return e.version!==Ae||typeof e.projectRoot!="string"||!Array.isArray(e.entries)?null:e}catch{return null}}});function it(o,e){let n=new Map(e.map(r=>[r.symbol,r])),t=new Map;for(let[r,i]of o.entries){let s=new Map;for(let a of i){let c=n.get(a);c&&s.set(c.symbolId,c)}s.size>0&&t.set(r,s)}return t}function ot(o){let e=2166136261;for(let n of o)e^=n.symbolId,e=Math.imul(e,16777619)>>>0;return`${o.length}:${e.toString(16)}`}function Ee(o){return{...o,scanMs:Math.round(o.scanMs),packageRefsMs:Math.round(o.packageRefsMs),semanticRefsMs:Math.round(o.semanticRefsMs),hierarchyMs:Math.round(o.hierarchyMs)}}function st(o,e,n){for(let t of e){let r=o.get(t)??[];r.push(...n),o.set(t,r)}}function at(o){let e=new Set,n=[];for(let t of o){let r=`${t.symbol}|${t.file}|${t.line}|${t.callsiteLine??""}`;e.has(r)||(e.add(r),n.push(t))}return n}function je(o){return o.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ge as a,tn as b,Ge as c};
3
+ //# sourceMappingURL=chunk-WK46TNUM.js.map