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,4 +1,4 @@
1
- import{a as ye}from"./chunk-3TNRNKAT.js";import{b as ne,c as Xe}from"./chunk-7KCZELVM.js";import{a as Jn}from"./chunk-XN22RGSR.js";import{a as yt,b as ht,c as Yn,d as Ye,e as Yt,f as Me,g as Xt,h as Zt}from"./chunk-RNKPYYYE.js";import{b as Xn,c as Zn,d as bt}from"./chunk-SVHTMVA4.js";import{a as Wt,b as Un,c as Hn,d as Vn,h as Qt,i as Qn}from"./chunk-BYDAFMSR.js";import{a as je}from"./chunk-RYOYJMGF.js";import{b as mt}from"./chunk-FELGD32K.js";import{a as Ee,d as ft,e as Wn,f as gt,n as Vt}from"./chunk-2XCGSDIT.js";import{b as Ht}from"./chunk-EELPBR7E.js";import{b as jn,c as Kn}from"./chunk-TQZV7KV4.js";import{A as pt,B as J,C as ge,E as Ut,I as xe,K as Gn,R as X,S as zn,Y as Ge,h as dt,k as le,q as ut,s as zt,x as Y}from"./chunk-C7IJMOFP.js";import{a as Bn,b as On}from"./chunk-YXPUP5G2.js";import{b as qn,c as ee,h as re}from"./chunk-DRENNWRG.js";import{c as _n}from"./chunk-IW5XQG5G.js";import{D as Pe,c as $n,f as Dn}from"./chunk-AK3PYTIK.js";import{createHash as mc}from"crypto";var Xr=[{id:"general-interprocedural-value-flow",families:["dataflow"],capability:"Whole-program definition-use flow through arbitrary calls and returns is unavailable.",consequence:"Missing dataflow edges cannot establish that a value never crosses an unmodeled call.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"heap-aliasing",families:["dataflow","state"],capability:"Heap points-to and cross-instance alias analysis are unavailable.",consequence:"Missing field or state edges cannot establish that two references never reach the same object.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"exceptional-flow",families:["execution","dataflow","temporal"],capability:"Interprocedural exception propagation and finally completion flow are unavailable.",consequence:"Normal-path reachability and ordering do not establish behavior after a throw or rejection.",recoverWith:["dependence-slice","inspect","code"]},{id:"reflection",families:["execution","runtime","identity","dependencies"],capability:"Reflective lookup, dynamic loading, and name-computed invocation are unavailable without exact evidence.",consequence:"Missing static edges cannot establish that a construct is unreachable through reflection.",recoverWith:["search","inspect","code"]},{id:"generated-dispatch",families:["execution","runtime","identity"],capability:"Dispatch tables or names created only by generated or unavailable source are unavailable.",consequence:"Missing dispatch edges cannot establish that no generated consumer exists.",recoverWith:["search","inspect","code"]},{id:"unsupported-framework-adapters",families:["runtime","dataflow","state","temporal"],capability:"Framework runtime crossings without a registered source adapter are unavailable.",consequence:"Missing boundary edges cannot establish that no producer, consumer, state effect, or ordering exists.",recoverWith:["search","inspect","code"]}];function Zr(e){let t=new Set(e);return Xr.filter(n=>n.families.some(o=>t.has(o)))}function eo(e){return Zr(e).map(t=>`[${t.id}] ${t.capability} ${t.consequence} Recover selected paths with: ${t.recoverWith.map(n=>`scip-query ${n}`).join(", ")}.`)}var Jr=["incoming","outgoing","both"];function W(e,t,n,o={}){return{family:e,subtype:t,...o.match?{match:o.match}:{},directions:Jr,evidenceStrengths:o.strengths??["exact","derived","mixed"],supportCeiling:o.supportCeiling??"partial",establishes:n,nonClaims:o.nonClaims??[],recoverWith:o.recoverWith??["inspect","code"]}}var ei=["predicate-consequence","predicate-alternative","predicate-fallthrough","predicate-case","predicate-default","predicate-return","predicate-throw","loop-iteration","loop-exit","exception-handler","finally-cleanup","handler-return","handler-throw"],ti=["captured-value-to-state","constant-to-state","expression-to-state","property-to-state","return-to-state","value-to-state"],ni=["await-completion-before","awaits-completion","inside-lock-scope","lexical-successor"],oi=[{id:"indexed-program-identity",label:"SCIP/compiler identity and source ownership",requirements:["indexed-graph"],relations:[W("execution","call","The source construct may call the resolved target.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["Static may-call reachability does not prove that an invocation occurred at runtime."],recoverWith:["call-graph","inspect","code"]}),W("execution","result-callback","The referenced callable can produce the result consumed by this path.",{nonClaims:["A callback relationship does not prove invocation order or runtime selection."],recoverWith:["call-graph","inspect","code"]}),W("contract","uses-contract-symbol","The source construct refers to the identified contract symbol.",{supportCeiling:"exact",nonClaims:["Contract identity does not prove runtime invocation or behavioral conformance."],recoverWith:["hierarchy","inspect","code"]}),W("identity","references","The occurrence resolves to the identified compiler-owned symbol.",{supportCeiling:"exact",nonClaims:["A reference does not establish execution or value transfer."],recoverWith:["refs","trace","inspect"]}),W("ownership","contains","The owner contains the identified program construct.",{supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),W("ownership","contains-","The owner contains the identified program construct.",{match:"prefix",supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),W("ownership","owns-","The owner owns the identified source or runtime observation.",{match:"prefix",supportCeiling:"exact",nonClaims:["Observation ownership does not establish singleton lifetime or exclusive ownership."],recoverWith:["inspect","code"]}),W("dependencies","imports","The source file or module statically imports the indexed target.",{nonClaims:["An import does not establish that imported code executes."],recoverWith:["imports","deps","code"]}),W("dependencies","imports-external","The source region statically imports an external package.",{nonClaims:["An external import does not establish which package behavior executes."],recoverWith:["imports","code"]})]},{id:"runtime-boundary-join",label:"source-grounded runtime-boundary joins",requirements:["indexed-graph","source-facts"],relations:[W("runtime","runtime-handoff","A producer and consumer share a source-grounded runtime rendezvous.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["A candidate or unresolved join does not prove a runtime handoff."],recoverWith:["evidence","inspect","code"]}),W("runtime","discriminator-dispatch","A serialized discriminator selects the reported consumer.",{strengths:["exact","derived","mixed"],nonClaims:["The dispatch edge does not prove delivery, retry, or successful handling."],recoverWith:["evidence","inspect","code"]}),W("dataflow","serialized-discriminator-transfer","The producer serializes the discriminator consumed by dispatch.",{strengths:["exact","derived","mixed"],nonClaims:["This edge does not establish the flow of every payload field."],recoverWith:["value-flow","inspect","code"]}),W("temporal","enqueue-before-consume","The reported enqueue precedes a possible consume through the queue.",{strengths:["exact","derived","mixed"],nonClaims:["Queue order does not establish delivery time, uniqueness, retry count, or durability."],recoverWith:["evidence","inspect","code"]})]},{id:"parser-control-dependence",label:"parser-proved intraprocedural control dependence",requirements:["indexed-graph","source-facts"],relations:[...ei.map(e=>W("execution",e,"The outcome is control-dependent on the reported predicate or handler.",{strengths:["exact"],nonClaims:["Local control dependence does not establish that the containing function executes."],recoverWith:["dependence-slice","inspect","code"]})),W("execution","returns","The selected construct contains the reported return terminal.",{strengths:["exact"],nonClaims:["A local return terminal does not establish that the containing callable executes."],recoverWith:["inspect","code"]}),W("execution","throws","The selected construct contains the reported throw terminal.",{strengths:["exact"],nonClaims:["A local throw terminal does not establish propagation, handling, or callable execution."],recoverWith:["inspect","code"]})]},{id:"bounded-static-value-flow",label:"compiler callsites and bounded static value evaluation",requirements:["indexed-graph","source-facts"],relations:["argument-to-parameter","constant-to-parameter","property-to-parameter","return-to-parameter","return-to-call-result"].map(e=>W("dataflow",e,"The reported value may reach the target through the evidenced callsite transfer.",{strengths:["exact","derived","mixed"],nonClaims:["This provider does not establish general local definition-use, alias, field, or heap flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}))},{id:"typescript-local-dependence",label:"TypeScript compiler identities, control-flow graph, and reaching definitions",requirements:["typescript-semantic"],relations:[W("dataflow","definition-to-use","The definition reaches the reported read on a feasible local control-flow path.",{strengths:["exact"],nonClaims:["Local reaching definitions do not establish heap aliasing, exceptional flow, or the runtime order of closure invocation."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),W("dataflow","value-to-definition","The reported right-hand-side read supplies the assigned local definition.",{strengths:["exact"],nonClaims:["A local assignment edge does not establish field or heap points-to flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),W("dataflow","closure-capture","The nested callable reads the reported binding from an enclosing callable.",{strengths:["candidate"],supportCeiling:"candidate",nonClaims:["Closure capture does not establish whether or when the nested callable executes."],recoverWith:["call-graph","inspect","code"]}),W("dataflow","field-definition-to-use","The reported same-owner field definition can reach the field read.",{strengths:["exact","candidate"],nonClaims:["Field-name identity does not establish whole-program heap aliasing or cross-instance flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),W("execution","control-dependence","Execution of the reported statement depends on the outcome of the predicate.",{strengths:["exact"],nonClaims:["Intraprocedural control dependence does not establish that the containing callable executes."],recoverWith:["dependence-slice","inspect","code"]})]},{id:"parser-state-temporal",label:"parser-proved local state and temporal facts",requirements:["indexed-graph","source-facts"],relations:[...ti.map(e=>W("dataflow",e,"The reported source value is assigned into the identified state resource.",{strengths:["exact"],nonClaims:["The edge does not establish alias, heap, or later read flow."],recoverWith:["value-flow","inspect","code"]})),...["writes-resource","deletes-resource","reads-resource","enqueues-resource","consumes-resource"].map(e=>W("state",e,"The reported construct performs the named operation on the identified resource.",{strengths:["exact"],nonClaims:["A state operation does not establish transactionality, durability, or exclusive ownership."],recoverWith:["evidence","inspect","code"]})),...ni.map(e=>W("temporal",e,"The reported source constructs have the named local ordering relationship.",{strengths:["exact"],nonClaims:["Local source order does not establish cross-process happens-before or durable completion."],recoverWith:["evidence","inspect","code"]}))]}];function to(e,t){let n=oi.flatMap(o=>o.relations.filter(r=>r.family===e&&(r.match==="prefix"?t.startsWith(r.subtype):t===r.subtype)).map(r=>({provider:o,relation:r})));if(n.length>1)throw new Error(`Ambiguous graph relation provider for ${e}/${t}: ${n.map(o=>o.provider.id).join(", ")}`);return n[0]??null}var Ce=["execution","runtime","dataflow","state","temporal","contract","identity","ownership","dependencies"];function Ke(e){return e.includes("symbol-anchor")?0:e.includes("literal-owner")?1:e.some(t=>t.startsWith("boundary-import:"))?2:e.includes("reference-owner")?3:4}function no(e,t){return Ke(e.origins)-Ke(t.origins)||e.depth-t.depth||e.startLine-t.startLine||e.shortName.localeCompare(t.shortName)}var oo=new WeakMap,ro=new WeakMap,io=new WeakMap,ao=new WeakMap,so=new WeakMap;function lo(e,t){let n=ro.get(e);n||(n=new Map,ro.set(e,n));let o=n.get(t);if(o)return o;let r=Y(e,t)?.rootNode;if(!r)return n.set(t,[]),[];let a=new Set;he(r,d=>{if(d.type!=="call_expression")return;let c=d.childForFieldName("function")??d.namedChild(0),u=/^([A-Za-z_$][\w$]*(?:\.Service)?)\.of$/u.exec(c?.text.replace(/\s+/gu,"")??"");u&&a.add(u[1])});let i=xe(e,t).filter(d=>!!d.sourcePath),s=new Set;for(let d of a){let c=/^([A-Za-z_$][\w$]*)\.Service$/u.exec(d);if(c){for(let u of i)u.localName===c[1]&&s.add(u.sourcePath);continue}if(d==="Service"){X(e,t).some(u=>u.leaf==="Service")&&s.add(t);for(let u of i)(u.localName??u.importedName)==="Service"&&s.add(u.sourcePath)}}let l=nn([...s]).sort();return n.set(t,l),l}function Jt(e,t,n={}){let r=Ut(e,t)?.filter(m=>!n.ranges||n.ranges.some(p=>m.line>=p.startLine&&m.line<=p.endLine));if(!r)return{targets:[],unresolvedCallsites:0};let a=xe(e,t).filter(m=>!!m.sourcePath),i=vi(dt(e,t)??""),s=Y(e,t)?.rootNode??null,l=s?ii(s):co(),d=new Map,c=gt(e),u=[],f=0;for(let m of r){if(!m.memberAccess)continue;let p=ft(t,c.get(m.calleeLeaf)??[]);if(n.excludeIndexedTargets!==!1&&Wn(e,t,p,!0,m.calleeQualifier))continue;let g=m.calleeQualifier,b=bi(e,t,m,a);if(b){u.push(b);continue}let C=ri(e,t,m,a,ai(l,m.calleeQualifier,m.line));if(C.length>0){u.push(...C);continue}let S=si(e,t,m);if(S.length>0){u.push(...S);continue}let v=g?i.get(g)??g:null,y=(v?nn(a.filter(L=>(L.localName??L.importedName)===v).map(L=>L.sourcePath)):[]).flatMap(L=>{let x=d.get(L);return x||(x=ge(e,L)??[],d.set(L,x)),x.filter(M=>M.name===m.calleeLeaf).map(M=>({file:L,callable:M}))});if(y.length!==1){f+=1;continue}let N=y[0];u.push({calleeLeaf:m.calleeLeaf,line:m.line,sourceFile:t,targetFile:N.file,targetStartLine:N.callable.startLine,targetEndLine:N.callable.endLine,resolution:"direct-import-receiver",strength:"candidate"})}return{targets:u,unresolvedCallsites:f}}function ri(e,t,n,o,r){let a=n.calleeQualifier;if(!a||!/^[A-Za-z_$][\w$]*$/u.test(a))return[];if(r.size!==1)return[];let i=[...r][0],s=nn(o.filter(c=>c.localName===i||c.importedName===i).map(c=>c.sourcePath));if(s.length!==1)return[];let l=s[0],d=ui(e,l,n.calleeLeaf);return d.map(c=>({calleeLeaf:c.name,line:n.line,sourceFile:t,targetFile:c.file,targetStartLine:c.startLine,targetEndLine:c.endLine,serviceFile:l,resolutionAlternativeCount:d.length,resolution:"imported-service-object-member",strength:"candidate"}))}function co(){return{declarations:new Map,callbacks:[]}}function ii(e){let t=co();return he(e,n=>{if(n.type==="variable_declarator"){let l=n.childForFieldName("name")??n.namedChild(0),d=n.childForFieldName("value")??n.namedChild(1);if(l?.type!=="identifier"||!d)return;let c=new Set;if(he(d,u=>{if(u.type!=="member_expression")return;let f=u.childForFieldName("object")??u.namedChild(0),m=u.childForFieldName("property")??u.namedChild(1);f?.type==="identifier"&&m?.text==="Service"&&c.add(f.text)}),c.size===1){let u=t.declarations.get(l.text)??[];u.push({line:n.startPosition.row,alias:[...c][0]}),t.declarations.set(l.text,u)}return}if(!["arrow_function","function_expression","generator_function"].includes(n.type))return;let o=n.childForFieldName("parameters")??n.childForFieldName("parameter");if(!o)return;let r=n.parent;for(;r&&r.type!=="call_expression";)r=r.parent;if(!r)return;let a=r.childForFieldName("function")??r.namedChild(0),i=/^([A-Za-z_$][\w$]*)\.Service\.use$/u.exec(a?.text??"");if(!i)return;let s=new Set;he(o,l=>{l.type==="identifier"&&s.add(l.text)}),s.size!==0&&t.callbacks.push({startLine:n.startPosition.row,endLine:n.endPosition.row,receivers:s,alias:i[1]})}),t}function ai(e,t,n){if(!t||!/^[A-Za-z_$][\w$]*$/u.test(t))return new Set;let o=new Set((e.declarations.get(t)??[]).filter(r=>r.line<=n).map(r=>r.alias));for(let r of e.callbacks)r.startLine<=n&&r.endLine>=n&&r.receivers.has(t)&&o.add(r.alias);return o}function si(e,t,n){let o=n.calleeQualifier;if(!o||!/^[A-Za-z_$][\w$]*$/u.test(o))return[];let r=Y(e,t)?.rootNode;if(!r)return[];let a=li(e,t,r,n.line,n.calleeLeaf,o),i=a?di(a,o):null;if(!i)return[];if(!ci(i))return[];let s=(ge(e,t)??[]).filter(m=>m.startLine<=i.startPosition.row&&m.endLine>=i.endPosition.row).sort((m,p)=>m.endLine-m.startLine-(p.endLine-p.startLine))[0];if(!s)return[];let l=X(e,t).filter(m=>m.isFunctionLike&&m.leaf===s.name);if(l.length!==1)return[];let d=l[0],c=ao.get(e);c||(c=new Map,ao.set(e,c));let u=`${d.symbol}\0${n.calleeLeaf}`,f=c.get(u);if(!f){let m=[];for(let p of Vt(e,d)){let g=Y(e,p.file)?.rootNode;if(!g)continue;let b=ut(g,"call_expression").filter(v=>v.startPosition.row>p.line||v.endPosition.row<p.line?!1:(v.childForFieldName("function")??v.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,"").match(/[A-Za-z_$][\w$]*$/u)?.[0]===d.leaf);if(b.length!==1)continue;let S=b[0].childForFieldName("arguments")?.namedChildren.find(v=>Ae(v).type==="object");if(S)for(let v of Ae(S).namedChildren){if(v.type==="shorthand_property_identifier"&&v.text===n.calleeLeaf){m.push(...St(e,p.file,n.calleeLeaf,v,v));continue}if(v.type!=="pair")continue;let R=v.childForFieldName("key")??v.namedChild(0),y=v.childForFieldName("value")??v.namedChild(1);vt(R?.text)!==n.calleeLeaf||!y||m.push(...St(e,p.file,n.calleeLeaf,y,v))}}f=m.filter((p,g,b)=>b.findIndex(C=>C.file===p.file&&C.startLine===p.startLine&&C.endLine===p.endLine&&C.name===p.name)===g),c.set(u,f)}return f.map(m=>({calleeLeaf:m.name,line:n.line,sourceFile:t,targetFile:m.file,targetStartLine:m.startLine,targetEndLine:m.endLine,resolutionAlternativeCount:f.length,resolution:"factory-callback-member",strength:f.length===1?"exact":"candidate"}))}function li(e,t,n,o,r,a){let i=io.get(e);i||(i=new Map,io.set(e,i));let s=i.get(t);if(!s){s=new Map;for(let l of ut(n,"call_expression")){let d=l.childForFieldName("function")??l.namedChild(0),c=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(d?.text.replace(/\s+/gu,"")??"");if(c)for(let u=l.startPosition.row;u<=l.endPosition.row;u+=1){let f=`${u}\0${c[1]}\0${c[2]}`,m=s.get(f);(!m||l.endIndex-l.startIndex<m.endIndex-m.startIndex)&&s.set(f,l)}}i.set(t,s)}return s.get(`${o}\0${a}\0${r}`)??null}function ci(e){return e.descendantsOfType("return_statement").some(t=>{let n=t.childForFieldName("argument")??t.namedChild(0);return!!(n&&Ae(n).type==="object")})}function di(e,t){let n=e.parent;for(;n;){if(/(?:function|method|lambda)/u.test(n.type)||n.type==="arrow_function"){let o=n.childForFieldName("parameters")??n.childForFieldName("parameter"),r=!1;if(o&&he(o,a=>{a.type==="identifier"&&a.text===t&&(r=!0)}),r)return n}n=n.parent}return null}function St(e,t,n,o,r){if(o.type==="identifier")return(ge(e,t)??[]).filter(l=>l.name===o.text).map(l=>({...l,file:t}));let a=en(e,t,o.text);if(a.length>0)return a;if(!tn(o))return[];let s=(ge(e,t)??[]).filter(l=>l.startLine>=r.startPosition.row&&l.endLine<=r.endPosition.row&&(l.name===n||l.name.startsWith("source@"))).sort((l,d)=>l.endLine-l.startLine-(d.endLine-d.startLine))[0];return[s?{...s,file:t}:{name:n,file:t,startLine:r.startPosition.row,endLine:r.endPosition.row}]}function ui(e,t,n){let o=so.get(e);o||(o=new Map,so.set(e,o));let r=`${t}\0${n}`,a=o.get(r);if(a)return a;let i=fi(e,t).flatMap(s=>pi(e,s,t,n));return o.set(r,i),i}function pi(e,t,n,o){let r=Y(e,t)?.rootNode,a=ge(e,t)??[];if(!r)return[];let i=gi(e,t,n);if(i.size===0)return[];let s=new Set,l=[],d=[],c=[];return he(r,f=>{if(mi(f,i)){if(f.type==="pair"){let m=f.childForFieldName("key")??f.namedChild(0),p=f.childForFieldName("value")??f.namedChild(1);if(vt(m?.text)!==o||!p)return;if(p.type==="identifier")s.add(p.text);else if(tn(p))l.push({name:o,startLine:f.startPosition.row,endLine:f.endPosition.row});else{let g=yi(e,t,p.text),b=en(e,t,p.text);if(g.length>0)c.push(...g);else if(b.length>0)c.push(...b);else{let C=hi(f);C&&d.push(C)}}return}f.type==="shorthand_property_identifier"&&f.text===o&&s.add(o)}}),[...a.filter(f=>s.has(f.name)).map(f=>({...f,file:t})),...l.map(f=>({...f,file:t})),...d.map(f=>({...f,file:t})),...c].filter((f,m,p)=>p.findIndex(g=>g.file===f.file&&g.name===f.name&&g.startLine===f.startLine&&g.endLine===f.endLine)===m)}function mi(e,t){let n=e,o=null;for(;n;){if(n.type==="object"&&(o=n),n.type==="call_expression"){if(!o)return!1;let r=n.childForFieldName("function")??n.namedChild(0);return r?t.has(r.text.replace(/\.of$/u,""))&&r.text.endsWith(".of"):!1}n=n.parent}return!1}function fi(e,t){let n=oo.get(e);n||(n=new Map,oo.set(e,n));let o=n.get(t);if(o)return o;let r=new Set([t]),a=X(e,t).filter(s=>s.leaf==="Service"&&s.isTypeLike);for(let s of a)for(let l of Vt(e,s))r.add(l.file);let i=[...r].sort();return n.set(t,i),i}function gi(e,t,n){let o=new Set;Pe(t,n)&&o.add("Service");for(let r of xe(e,t)){if(!r.sourcePath||!Pe(r.sourcePath,n))continue;if(r.kind==="namespace"&&r.localName){o.add(`${r.localName}.Service`);continue}(r.importedName==="default"?r.localName:r.importedName)==="Service"?o.add(r.localName??r.importedName):r.localName&&r.importedName!=="default"&&o.add(`${r.localName}.Service`)}return o}function en(e,t,n){let o=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!o)return[];let r=Y(e,t)?.rootNode;if(!r)return[];let a=uo(r,o[1]),i=a?po(a):null;if(!i)return[];let s=i.childForFieldName("function")??i.namedChild(0),l=s?mo(e,t,s.text):[];if(l.length!==1)return[];let d=l[0],c=Y(e,d.relativePath)?.rootNode;if(!c)return[];let u=zt(c,d.startLine,d.endLine);if(!u)return[];let f=[];for(let m of u.descendantsOfType("return_statement")){let p=m.childForFieldName("argument")??m.namedChild(0);if(!p)continue;let g=Ae(p);if(g.type==="object")for(let b of g.namedChildren){if(b.type==="shorthand_property_identifier"&&b.text===o[2]){for(let v of ge(e,d.relativePath)??[])v.name===o[2]&&f.push({...v,file:d.relativePath});continue}if(b.type!=="pair")continue;let C=b.childForFieldName("key")??b.namedChild(0),S=b.childForFieldName("value")??b.namedChild(1);if(!(vt(C?.text)!==o[2]||!S))if(S.type==="identifier")for(let v of ge(e,d.relativePath)??[])v.name===S.text&&f.push({...v,file:d.relativePath});else tn(S)&&f.push({name:o[2],startLine:b.startPosition.row,endLine:b.endPosition.row,file:d.relativePath})}}return f.filter((m,p,g)=>g.findIndex(b=>b.file===m.file&&b.name===m.name&&b.startLine===m.startLine&&b.endLine===m.endLine)===p)}function yi(e,t,n){let o=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!o)return[];let r=Y(e,t)?.rootNode;if(!r)return[];let a=uo(r,o[1]),i=a?po(a):null,s=i?.childForFieldName("function")??i?.namedChild(0),l=s?mo(e,t,s.text):[];if(l.length!==1||!i)return[];let d=l[0],c=Y(e,d.relativePath)?.rootNode;if(!c)return[];let u=zt(c,d.startLine,d.endLine);if(!u)return[];let f=new Set,m=u.childForFieldName("parameters")??u.childForFieldName("parameter");if(m&&he(m,L=>{L.type==="identifier"&&f.add(L.text)}),f.size===0)return[];let p=en(e,t,n);if(p.length===0)return[];let g=(ge(e,d.relativePath)??[]).filter(L=>L.startLine>=d.startLine&&L.endLine<=d.endLine),b=(Ut(e,d.relativePath)??[]).filter(L=>L.line>=d.startLine&&L.line<=d.endLine),C=new Set,S=p.map(L=>({name:L.name,startLine:L.startLine,endLine:L.endLine})),v=new Set;for(;S.length>0&&v.size<32;){let L=S.shift(),x=`${L.name}\0${L.startLine}\0${L.endLine}`;if(!v.has(x)){v.add(x);for(let M of b.filter(h=>h.line>=L.startLine&&h.line<=L.endLine)){if(M.memberAccess&&M.calleeQualifier&&f.has(M.calleeQualifier)){C.add(M.calleeLeaf);continue}if(M.memberAccess)continue;let h=g.filter(P=>P.name===M.calleeLeaf);h.length===1&&S.push(h[0])}}}if(C.size===0)return[];let y=i.childForFieldName("arguments")?.namedChildren.find(L=>Ae(L).type==="object");if(!y)return[];let N=[];for(let L of Ae(y).namedChildren){if(L.type==="shorthand_property_identifier"&&C.has(L.text)){N.push(...St(e,t,L.text,L,L));continue}if(L.type!=="pair")continue;let x=L.childForFieldName("key")??L.namedChild(0),M=L.childForFieldName("value")??L.namedChild(1),h=vt(x?.text);!h||!C.has(h)||!M||N.push(...St(e,t,h,M,L))}return N.filter((L,x,M)=>M.findIndex(h=>h.file===L.file&&h.name===L.name&&h.startLine===L.startLine&&h.endLine===L.endLine)===x)}function uo(e,t){for(let n of ut(e,"variable_declarator"))if((n.childForFieldName("name")??n.namedChild(0))?.text===t)return n.childForFieldName("value")??n.namedChild(1);return null}function po(e){return e.type==="call_expression"?e:e.descendantsOfType("call_expression")[0]??null}function mo(e,t,n){let o=n.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,""),r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(o);if(r){let u=xe(e,t).filter(p=>p.localName===r[1]&&p.sourcePath);if(u.length!==1||!u[0].sourcePath)return[];let f=u[0].sourcePath,m=je(e,f,r[2]).filter(p=>p.isFunctionLike);return m.length>0?m:(ge(e,f)??[]).filter(p=>p.name===r[2]).map(p=>({...p,relativePath:f}))}if(!/^[A-Za-z_$][\w$]*$/u.test(o))return[];let a=X(e,t).filter(u=>u.leaf===o&&u.isFunctionLike);if(a.length>0)return a;let i=(ge(e,t)??[]).filter(u=>u.name===o).map(u=>({...u,relativePath:t}));if(i.length>0)return i;let s=xe(e,t).filter(u=>u.localName===o&&u.sourcePath&&u.kind!=="namespace");if(s.length!==1||!s[0].sourcePath)return[];let l=s[0].sourcePath,d=s[0].importedName==="default"?o:s[0].importedName,c=je(e,l,d).filter(u=>u.isFunctionLike);return c.length>0?c:(ge(e,l)??[]).filter(u=>u.name===d).map(u=>({...u,relativePath:l}))}function tn(e){return["arrow_function","function_expression","generator_function"].includes(e.type)||e.descendantsOfType(["arrow_function","function_expression","generator_function"]).length>0}function hi(e){let t=e.parent;for(;t;){if(t.type==="variable_declarator"){let n=t.childForFieldName("name")??t.namedChild(0);if(n?.type==="identifier")return{name:n.text,startLine:t.startPosition.row,endLine:t.endPosition.row}}t=t.parent}return null}function vt(e){return e?e.replace(/^(?:['"])(.*)(?:['"])$/u,"$1"):null}function bi(e,t,n,o){let r=/^this\.([A-Za-z_$][\w$]*)$/u.exec(n.calleeQualifier??"");if(!r)return null;let a=Y(e,t)?.rootNode;if(!a)return null;let i=Si(a,n.line);if(!i)return null;let s=new Set;if(he(i,g=>{if(g.type!=="assignment_expression")return;let b=g.childForFieldName("left")??g.namedChild(0),C=g.childForFieldName("right")??g.namedChild(g.namedChildCount-1);if(b?.text.replace(/\s+/gu,"")!==`this.${r[1]}`||!C)return;let S=Ae(C);if(S.type!=="new_expression")return;let R=(S.childForFieldName("constructor")??S.namedChild(0))?.text.match(/[A-Za-z_$][\w$]*$/u)?.[0];R&&s.add(R)}),s.size!==1)return null;let l=[...s][0],d=o.filter(g=>g.localName===l);if(d.length!==1)return null;let c=d[0].importedName==="default"?l:d[0].importedName,u=d[0].importedName==="default"?je(e,d[0].sourcePath,l):[],f=u.length===1?u[0].leaf:c,m=X(e,d[0].sourcePath).filter(g=>g.isFunctionLike&&g.leaf===n.calleeLeaf&&qn(g.symbol)===f);if(m.length!==1)return null;let p=m[0];return{calleeLeaf:n.calleeLeaf,line:n.line,sourceFile:t,targetFile:p.relativePath,targetStartLine:p.startLine,targetEndLine:p.endLine,targetSymbol:p.symbol,resolution:"constructed-member-receiver",strength:"exact"}}function Si(e,t){let n=[];return he(e,o=>{["class","class_declaration","class_definition"].includes(o.type)&&o.startPosition.row<=t&&o.endPosition.row>=t&&n.push(o)}),n.sort((o,r)=>o.endPosition.row-o.startPosition.row-(r.endPosition.row-r.startPosition.row))[0]??null}function Ae(e){let t=e;for(;["parenthesized_expression","as_expression","type_assertion","satisfies_expression"].includes(t.type)&&t.namedChildCount===1;)t=t.namedChild(0);return t}function he(e,t){t(e);for(let n of e.namedChildren)he(n,t)}function vi(e){let t=new Map,n=/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*;/gu;for(let o of e.matchAll(n)){let r=o[1],a=o[2];r&&a&&t.set(r,a)}return t}function nn(e){let t=[];for(let n of e)t.some(o=>Pe(o,n))||t.push(n);return t}import{existsSync as Ei}from"fs";import{SymbolRole as Ci}from"@c4312/scip";import{deserializeSCIP as xi}from"@c4312/scip";function fo(e,t){return xi(Dn(e,{inputKind:t,maxBytes:$n}))}var on=new WeakMap;function xt(e,t,n,o){let r=J(e,t),a=(r?.callSites??[]).filter(m=>m.line>=n&&m.line<=o);if(!r||a.length===0)return{available:!!r,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let i=an(e);if(!i)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:a.length};let s=(i.byFile.get(t)??[]).filter(m=>m.sourceLine>=n&&m.sourceLine<=o).map(m=>({...m,calleeLeaf:m.definition.leaf})),l=go(a.map(m=>({line:m.line,leaf:m.calleeLeaf}))),d=go(s.map(m=>({line:m.sourceLine,leaf:m.calleeLeaf}))),c=new Set([...l].flatMap(([m,p])=>d.get(m)===p?[m]:[])),u=s.filter(m=>c.has(ho(m.sourceLine,m.calleeLeaf))),f=[...c].reduce((m,p)=>m+(l.get(p)??0),0);return{available:!0,targets:u,resolvedCallsites:f,unresolvedCallsites:Math.max(0,a.length-f)}}function rn(e,t,n,o){let r=an(e);return r?{available:!0,targets:(r.byFile.get(t)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=o)}:{available:!1,targets:[]}}function yo(e,t,n,o){let r=an(e);return r?{available:!0,targets:(r.byFile.get(t)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=o&&Et(e,a.definition)).map(a=>({...a,calleeLeaf:a.definition.leaf}))}:{available:!1,targets:[]}}function an(e){if(on.has(e))return on.get(e)??null;let t=Li(e);return on.set(e,t),t}function Li(e){if(!e.generation.indexPath||!Ei(e.generation.indexPath))return null;try{let t=zn(e),n=new Map(t.map(a=>[a.symbol,a])),o=fo(e.generation.indexPath,"SCIP source-range call-target index"),r=new Map;for(let a of o.documents??[]){let i=a.relativePath;if(!i||e.isIgnored(i))continue;let s=[];for(let l of a.occurrences??[]){if(!l.symbol||(l.symbolRoles&Ci.Definition)!==0)continue;let d=n.get(l.symbol),c=l.range?.[0];!d||!Number.isInteger(c)||s.push({sourceLine:c,definition:d})}r.set(i,s)}return{byFile:r}}catch{return null}}function Et(e,t){if(!t.isFunctionLike)return!1;let n=J(e,t.relativePath);return!n||n.callables.some(o=>o.name===t.leaf&&o.startLine===t.startLine&&o.endLine===t.endLine)?!0:Ii(t)}function Ii(e){let t=e.documentation;if(!t)return!1;let n=e.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${n}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(t)||new RegExp(`\\b(?:const|let|var)\\s+${n}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(t)}function go(e){let t=new Map;for(let n of e){let o=ho(n.line,n.leaf);t.set(o,(t.get(o)??0)+1)}return t}function ho(e,t){return`${e}\0${t}`}var wi=16,Ni=4,Mi=3e3,Ri=800,Ti=new Set(["assignment","const_declaration","const_item","field_declaration","lexical_declaration","local_declaration_statement","local_variable_declaration","static_item","variable_declaration"]);function Co(e,t,n={}){let o=n.maxSteps??wi;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`maxSteps must be a positive safe integer; received ${o}`);let r=new Map(t.nodes.map(E=>[E.id,E])),a=_i(n.focusLocations??[]),i=new Set,s=new Map(t.edges.map(E=>[E.id,E])),l=Le(t.paths.flatMap(E=>E.nodeIds)),d=Le(t.anchors.filter(E=>E.status==="matched").flatMap(E=>E.nodeIds)),c=t.nodes.filter(E=>E.disposition==="emitted"&&E.attributes.upstreamCausalPath===!0).sort((E,k)=>Number(k.attributes.upstreamCausalDistance??0)-Number(E.attributes.upstreamCausalDistance??0)||E.id.localeCompare(k.id)).map(E=>E.id),u=new Set(c),f=Math.max(0,o-d.length),p=Fi(t,d,a,f).slice(0,f),g=new Set(p),b=new Set(p),C=new Set([...l,...c,...d]),S=t.edges.filter(E=>E.disposition==="emitted"&&E.kind!=="structural-membership"),v=t.edges.filter(E=>E.disposition!=="excluded"&&E.disposition!=="unsupported"&&E.kind!=="structural-membership"),R=new Set([...t.paths.flatMap(E=>E.edgeIds),...S.filter(E=>u.has(E.fromNodeId)&&u.has(E.toNodeId)).map(E=>E.id)]),y=t.paths.some(E=>E.edgeIds.length>0),N=new Set(d);for(let E of p)N.add(E);for(let E of t.paths){let k=E.nodeIds[0],G=s.get(E.edgeIds[0]??""),H=E.nodeIds[1];k&&H&&G?.fromNodeId===k&&G.toNodeId===H&&N.add(k)}if(t.paths.every(E=>E.nodeIds.length===0))for(let E of t.anchors)for(let k of E.nodeIds)N.add(k);let L=Ki(d,v,r,Ni),x=Le(S.filter(E=>E.kind==="call"&&d.includes(E.fromNodeId)).map(E=>E.toNodeId)),M=new Set(Le([...L,...y?[]:x]));for(let E of M)N.add(E);let h=Le(S.flatMap(E=>C.has(E.fromNodeId)||C.has(E.toNodeId)?[E.fromNodeId,E.toNodeId]:[])),P=t.nodes.filter(E=>E.disposition==="emitted"&&E.kind!=="structural-region"&&S.some(k=>k.fromNodeId===E.id||k.toNodeId===E.id)).map(E=>E.id),D=Le([...c,...l,...d,...p,...M,...h,...P]).filter(E=>r.has(E)),O=[];for(let E of D)y&&!C.has(E)&&!g.has(E)&&!M.has(E)||O.length>=o&&!C.has(E)||O.push(E);let w=new Set(O),T=new Map(O.map(E=>[E,zi(E)])),I=new Set([...l,...c]),_=new Set(t.anchors.flatMap(E=>E.nodeIds)),A=O.map((E,k)=>{let G=r.get(E),H=Di(G,a);for(let me of H)i.add(qe(G.location.file,me));return{id:T.get(E),nodeId:E,order:k,role:_.has(E)?"anchor":I.has(E)?"connector":"junction",kind:G.kind,label:G.label,location:G.location,behavior:Pi(e,G,_.has(E),[...new Set([...H,...$i(e,G,v,r,R,N)])],H,N.has(G.id)&&(H.length===0||_.has(G.id)),M.has(G.id),b.has(G.id)&&H.length===0)}}),j=new Map;for(let E of t.paths)for(let k=0;k<E.edgeIds.length;k+=1){let G=s.get(E.edgeIds[k]),H=E.nodeIds[k],me=E.nodeIds[k+1];!G||!H||!me||j.set(G.id,G.fromNodeId===H&&G.toNodeId===me?"forward":"reverse")}let B=v.filter(E=>w.has(E.fromNodeId)&&w.has(E.toNodeId)).sort((E,k)=>qi(E,k,t)).map((E,k)=>({id:Ui(E.id),edgeId:E.id,order:k,kind:E.kind,fromStepId:T.get(E.fromNodeId),toStepId:T.get(E.toNodeId),directed:!0,pathTraversal:j.get(E.id)??"adjacent",evidence:E.evidence})),U=new Map(B.map(E=>[E.edgeId,E.id])),q=t.paths.map(E=>({id:E.id,status:E.status,stepIds:E.nodeIds.flatMap(k=>{let G=T.get(k);return G?[G]:[]}),transitionIds:E.edgeIds.flatMap(k=>{let G=U.get(k);return G?[G]:[]})})),se=A.flatMap(E=>E.location?[`${E.location.file}:${E.location.line+1}`]:[]),Ne=t.anchors.some(E=>E.status==="ambiguous"),Oe=q.some(E=>E.status==="connected"||E.status==="candidate"),ve=q.some(E=>E.status==="partial");return{status:A.length===0?"unavailable":Ne?"ambiguous":Oe&&!ve?"connected":ve?"partial":"connected",steps:A,transitions:B,paths:q,coverage:{candidateNodes:D.length,returnedNodes:O.length,omittedNodeIds:D.filter(E=>!w.has(E)),returnedTransitions:B.length,withheldStatements:A.reduce((E,k)=>E+(k.behavior?.coverage.omittedStatements??0),0),requestedFocusLocations:a,matchedFocusLocations:a.filter(E=>i.has(qe(E.file,E.line))),unmatchedFocusLocations:a.filter(E=>!i.has(qe(E.file,E.line)))},behaviorCommand:Eo(se,"behavior"),exactSourceCommand:Eo(se,"source")}}function Fi(e,t,n,o){if(o<=0||n.length===0)return[];let r=new Set(t),a=new Set(n.map(i=>qe(i.file,i.line)));return Le(e.edges.filter(i=>i.disposition!=="excluded"&&i.disposition!=="unsupported"&&["call","runtime-boundary"].includes(i.kind)&&r.has(i.fromNodeId)&&i.evidence.some(s=>!["candidate","unknown"].includes(s.strength)&&s.location&&a.has(qe(s.location.file,s.location.line)))).sort((i,s)=>{let l=i.evidence.find(c=>c.location)?.location,d=s.evidence.find(c=>c.location)?.location;return(l?.file??"").localeCompare(d?.file??"")||(l?.line??Number.MAX_SAFE_INTEGER)-(d?.line??Number.MAX_SAFE_INTEGER)||i.id.localeCompare(s.id)}).map(i=>i.toNodeId)).slice(0,o)}function Pi(e,t,n,o,r,a,i,s){if(!t.location||!["symbol","source-construct","runtime-boundary-participant"].includes(t.kind))return null;let l=t.location.endLine??t.location.line,d=le(e,t.location.file),c=o.length>0?o:[t.location.line],u=t.kind==="runtime-boundary-participant"?Ye(e,t.location.file,0,Math.max(0,d.length-1),[t.location.line]):Ye(e,t.location.file,t.location.line,l,c),f=o.filter(M=>M>=u.startLine&&M<=u.endLine),m=yt(e,t.location.file,u.startLine,u.endLine,f),p=m??(f.length>0?yt(e,t.location.file,u.startLine,u.endLine,f,{requireSavings:!1}):null),g=f.length>0?Bi(e,t,u.startLine,u.endLine,f,p,a):null,b=d.slice(u.startLine,u.endLine+1).join(`
1
+ import{a as ye}from"./chunk-3TNRNKAT.js";import{b as ne,c as Xe}from"./chunk-7KCZELVM.js";import{a as Jn}from"./chunk-XBGWL66K.js";import{a as yt,b as ht,c as Yn,d as Ye,e as Yt,f as Me,g as Xt,h as Zt}from"./chunk-B5D7QPBE.js";import{b as Xn,c as Zn,e as bt}from"./chunk-2WC2OEDO.js";import{a as Wt,b as Un,c as Hn,d as Vn,h as Qt,i as Qn}from"./chunk-W6STWDQI.js";import{a as je}from"./chunk-MPQ4OTBM.js";import{b as mt}from"./chunk-FRUSVINH.js";import{a as Ee,d as ft,e as Wn,f as gt,n as Vt}from"./chunk-YEN6CYC7.js";import{b as Ht}from"./chunk-HOENASQM.js";import{b as jn,c as Kn}from"./chunk-TQZV7KV4.js";import{B as pt,C as J,E as ge,G as Ut,K as xe,M as Gn,T as X,U as zn,_ as Ge,i as dt,l as le,r as ut,t as zt,y as Y}from"./chunk-3L2ZBPEX.js";import{a as Bn,b as On}from"./chunk-YXPUP5G2.js";import{b as qn,c as ee,h as re}from"./chunk-DRENNWRG.js";import{c as _n}from"./chunk-IW5XQG5G.js";import{p as Pe}from"./chunk-KYSDI3GE.js";import{c as $n,f as Dn}from"./chunk-7F45LJKI.js";import{createHash as mc}from"crypto";var Xr=[{id:"general-interprocedural-value-flow",families:["dataflow"],capability:"Whole-program definition-use flow through arbitrary calls and returns is unavailable.",consequence:"Missing dataflow edges cannot establish that a value never crosses an unmodeled call.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"heap-aliasing",families:["dataflow","state"],capability:"Heap points-to and cross-instance alias analysis are unavailable.",consequence:"Missing field or state edges cannot establish that two references never reach the same object.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"exceptional-flow",families:["execution","dataflow","temporal"],capability:"Interprocedural exception propagation and finally completion flow are unavailable.",consequence:"Normal-path reachability and ordering do not establish behavior after a throw or rejection.",recoverWith:["dependence-slice","inspect","code"]},{id:"reflection",families:["execution","runtime","identity","dependencies"],capability:"Reflective lookup, dynamic loading, and name-computed invocation are unavailable without exact evidence.",consequence:"Missing static edges cannot establish that a construct is unreachable through reflection.",recoverWith:["search","inspect","code"]},{id:"generated-dispatch",families:["execution","runtime","identity"],capability:"Dispatch tables or names created only by generated or unavailable source are unavailable.",consequence:"Missing dispatch edges cannot establish that no generated consumer exists.",recoverWith:["search","inspect","code"]},{id:"unsupported-framework-adapters",families:["runtime","dataflow","state","temporal"],capability:"Framework runtime crossings without a registered source adapter are unavailable.",consequence:"Missing boundary edges cannot establish that no producer, consumer, state effect, or ordering exists.",recoverWith:["search","inspect","code"]}];function Zr(e){let t=new Set(e);return Xr.filter(n=>n.families.some(o=>t.has(o)))}function eo(e){return Zr(e).map(t=>`[${t.id}] ${t.capability} ${t.consequence} Recover selected paths with: ${t.recoverWith.map(n=>`scip-query ${n}`).join(", ")}.`)}var Jr=["incoming","outgoing","both"];function W(e,t,n,o={}){return{family:e,subtype:t,...o.match?{match:o.match}:{},directions:Jr,evidenceStrengths:o.strengths??["exact","derived","mixed"],supportCeiling:o.supportCeiling??"partial",establishes:n,nonClaims:o.nonClaims??[],recoverWith:o.recoverWith??["inspect","code"]}}var ei=["predicate-consequence","predicate-alternative","predicate-fallthrough","predicate-case","predicate-default","predicate-return","predicate-throw","loop-iteration","loop-exit","exception-handler","finally-cleanup","handler-return","handler-throw"],ti=["captured-value-to-state","constant-to-state","expression-to-state","property-to-state","return-to-state","value-to-state"],ni=["await-completion-before","awaits-completion","inside-lock-scope","lexical-successor"],oi=[{id:"indexed-program-identity",label:"SCIP/compiler identity and source ownership",requirements:["indexed-graph"],relations:[W("execution","call","The source construct may call the resolved target.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["Static may-call reachability does not prove that an invocation occurred at runtime."],recoverWith:["call-graph","inspect","code"]}),W("execution","result-callback","The referenced callable can produce the result consumed by this path.",{nonClaims:["A callback relationship does not prove invocation order or runtime selection."],recoverWith:["call-graph","inspect","code"]}),W("contract","uses-contract-symbol","The source construct refers to the identified contract symbol.",{supportCeiling:"exact",nonClaims:["Contract identity does not prove runtime invocation or behavioral conformance."],recoverWith:["hierarchy","inspect","code"]}),W("identity","references","The occurrence resolves to the identified compiler-owned symbol.",{supportCeiling:"exact",nonClaims:["A reference does not establish execution or value transfer."],recoverWith:["refs","trace","inspect"]}),W("ownership","contains","The owner contains the identified program construct.",{supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),W("ownership","contains-","The owner contains the identified program construct.",{match:"prefix",supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),W("ownership","owns-","The owner owns the identified source or runtime observation.",{match:"prefix",supportCeiling:"exact",nonClaims:["Observation ownership does not establish singleton lifetime or exclusive ownership."],recoverWith:["inspect","code"]}),W("dependencies","imports","The source file or module statically imports the indexed target.",{nonClaims:["An import does not establish that imported code executes."],recoverWith:["imports","deps","code"]}),W("dependencies","imports-external","The source region statically imports an external package.",{nonClaims:["An external import does not establish which package behavior executes."],recoverWith:["imports","code"]})]},{id:"runtime-boundary-join",label:"source-grounded runtime-boundary joins",requirements:["indexed-graph","source-facts"],relations:[W("runtime","runtime-handoff","A producer and consumer share a source-grounded runtime rendezvous.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["A candidate or unresolved join does not prove a runtime handoff."],recoverWith:["evidence","inspect","code"]}),W("runtime","discriminator-dispatch","A serialized discriminator selects the reported consumer.",{strengths:["exact","derived","mixed"],nonClaims:["The dispatch edge does not prove delivery, retry, or successful handling."],recoverWith:["evidence","inspect","code"]}),W("dataflow","serialized-discriminator-transfer","The producer serializes the discriminator consumed by dispatch.",{strengths:["exact","derived","mixed"],nonClaims:["This edge does not establish the flow of every payload field."],recoverWith:["value-flow","inspect","code"]}),W("temporal","enqueue-before-consume","The reported enqueue precedes a possible consume through the queue.",{strengths:["exact","derived","mixed"],nonClaims:["Queue order does not establish delivery time, uniqueness, retry count, or durability."],recoverWith:["evidence","inspect","code"]})]},{id:"parser-control-dependence",label:"parser-proved intraprocedural control dependence",requirements:["indexed-graph","source-facts"],relations:[...ei.map(e=>W("execution",e,"The outcome is control-dependent on the reported predicate or handler.",{strengths:["exact"],nonClaims:["Local control dependence does not establish that the containing function executes."],recoverWith:["dependence-slice","inspect","code"]})),W("execution","returns","The selected construct contains the reported return terminal.",{strengths:["exact"],nonClaims:["A local return terminal does not establish that the containing callable executes."],recoverWith:["inspect","code"]}),W("execution","throws","The selected construct contains the reported throw terminal.",{strengths:["exact"],nonClaims:["A local throw terminal does not establish propagation, handling, or callable execution."],recoverWith:["inspect","code"]})]},{id:"bounded-static-value-flow",label:"compiler callsites and bounded static value evaluation",requirements:["indexed-graph","source-facts"],relations:["argument-to-parameter","constant-to-parameter","property-to-parameter","return-to-parameter","return-to-call-result"].map(e=>W("dataflow",e,"The reported value may reach the target through the evidenced callsite transfer.",{strengths:["exact","derived","mixed"],nonClaims:["This provider does not establish general local definition-use, alias, field, or heap flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}))},{id:"typescript-local-dependence",label:"TypeScript compiler identities, control-flow graph, and reaching definitions",requirements:["typescript-semantic"],relations:[W("dataflow","definition-to-use","The definition reaches the reported read on a feasible local control-flow path.",{strengths:["exact"],nonClaims:["Local reaching definitions do not establish heap aliasing, exceptional flow, or the runtime order of closure invocation."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),W("dataflow","value-to-definition","The reported right-hand-side read supplies the assigned local definition.",{strengths:["exact"],nonClaims:["A local assignment edge does not establish field or heap points-to flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),W("dataflow","closure-capture","The nested callable reads the reported binding from an enclosing callable.",{strengths:["candidate"],supportCeiling:"candidate",nonClaims:["Closure capture does not establish whether or when the nested callable executes."],recoverWith:["call-graph","inspect","code"]}),W("dataflow","field-definition-to-use","The reported same-owner field definition can reach the field read.",{strengths:["exact","candidate"],nonClaims:["Field-name identity does not establish whole-program heap aliasing or cross-instance flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),W("execution","control-dependence","Execution of the reported statement depends on the outcome of the predicate.",{strengths:["exact"],nonClaims:["Intraprocedural control dependence does not establish that the containing callable executes."],recoverWith:["dependence-slice","inspect","code"]})]},{id:"parser-state-temporal",label:"parser-proved local state and temporal facts",requirements:["indexed-graph","source-facts"],relations:[...ti.map(e=>W("dataflow",e,"The reported source value is assigned into the identified state resource.",{strengths:["exact"],nonClaims:["The edge does not establish alias, heap, or later read flow."],recoverWith:["value-flow","inspect","code"]})),...["writes-resource","deletes-resource","reads-resource","enqueues-resource","consumes-resource"].map(e=>W("state",e,"The reported construct performs the named operation on the identified resource.",{strengths:["exact"],nonClaims:["A state operation does not establish transactionality, durability, or exclusive ownership."],recoverWith:["evidence","inspect","code"]})),...ni.map(e=>W("temporal",e,"The reported source constructs have the named local ordering relationship.",{strengths:["exact"],nonClaims:["Local source order does not establish cross-process happens-before or durable completion."],recoverWith:["evidence","inspect","code"]}))]}];function to(e,t){let n=oi.flatMap(o=>o.relations.filter(r=>r.family===e&&(r.match==="prefix"?t.startsWith(r.subtype):t===r.subtype)).map(r=>({provider:o,relation:r})));if(n.length>1)throw new Error(`Ambiguous graph relation provider for ${e}/${t}: ${n.map(o=>o.provider.id).join(", ")}`);return n[0]??null}var Ce=["execution","runtime","dataflow","state","temporal","contract","identity","ownership","dependencies"];function Ke(e){return e.includes("symbol-anchor")?0:e.includes("literal-owner")?1:e.some(t=>t.startsWith("boundary-import:"))?2:e.includes("reference-owner")?3:4}function no(e,t){return Ke(e.origins)-Ke(t.origins)||e.depth-t.depth||e.startLine-t.startLine||e.shortName.localeCompare(t.shortName)}var oo=new WeakMap,ro=new WeakMap,io=new WeakMap,ao=new WeakMap,so=new WeakMap;function lo(e,t){let n=ro.get(e);n||(n=new Map,ro.set(e,n));let o=n.get(t);if(o)return o;let r=Y(e,t)?.rootNode;if(!r)return n.set(t,[]),[];let a=new Set;he(r,d=>{if(d.type!=="call_expression")return;let c=d.childForFieldName("function")??d.namedChild(0),u=/^([A-Za-z_$][\w$]*(?:\.Service)?)\.of$/u.exec(c?.text.replace(/\s+/gu,"")??"");u&&a.add(u[1])});let i=xe(e,t).filter(d=>!!d.sourcePath),s=new Set;for(let d of a){let c=/^([A-Za-z_$][\w$]*)\.Service$/u.exec(d);if(c){for(let u of i)u.localName===c[1]&&s.add(u.sourcePath);continue}if(d==="Service"){X(e,t).some(u=>u.leaf==="Service")&&s.add(t);for(let u of i)(u.localName??u.importedName)==="Service"&&s.add(u.sourcePath)}}let l=nn([...s]).sort();return n.set(t,l),l}function Jt(e,t,n={}){let r=Ut(e,t)?.filter(m=>!n.ranges||n.ranges.some(p=>m.line>=p.startLine&&m.line<=p.endLine));if(!r)return{targets:[],unresolvedCallsites:0};let a=xe(e,t).filter(m=>!!m.sourcePath),i=vi(dt(e,t)??""),s=Y(e,t)?.rootNode??null,l=s?ii(s):co(),d=new Map,c=gt(e),u=[],f=0;for(let m of r){if(!m.memberAccess)continue;let p=ft(t,c.get(m.calleeLeaf)??[]);if(n.excludeIndexedTargets!==!1&&Wn(e,t,p,!0,m.calleeQualifier))continue;let g=m.calleeQualifier,b=bi(e,t,m,a);if(b){u.push(b);continue}let C=ri(e,t,m,a,ai(l,m.calleeQualifier,m.line));if(C.length>0){u.push(...C);continue}let S=si(e,t,m);if(S.length>0){u.push(...S);continue}let v=g?i.get(g)??g:null,y=(v?nn(a.filter(L=>(L.localName??L.importedName)===v).map(L=>L.sourcePath)):[]).flatMap(L=>{let x=d.get(L);return x||(x=ge(e,L)??[],d.set(L,x)),x.filter(M=>M.name===m.calleeLeaf).map(M=>({file:L,callable:M}))});if(y.length!==1){f+=1;continue}let N=y[0];u.push({calleeLeaf:m.calleeLeaf,line:m.line,sourceFile:t,targetFile:N.file,targetStartLine:N.callable.startLine,targetEndLine:N.callable.endLine,resolution:"direct-import-receiver",strength:"candidate"})}return{targets:u,unresolvedCallsites:f}}function ri(e,t,n,o,r){let a=n.calleeQualifier;if(!a||!/^[A-Za-z_$][\w$]*$/u.test(a))return[];if(r.size!==1)return[];let i=[...r][0],s=nn(o.filter(c=>c.localName===i||c.importedName===i).map(c=>c.sourcePath));if(s.length!==1)return[];let l=s[0],d=ui(e,l,n.calleeLeaf);return d.map(c=>({calleeLeaf:c.name,line:n.line,sourceFile:t,targetFile:c.file,targetStartLine:c.startLine,targetEndLine:c.endLine,serviceFile:l,resolutionAlternativeCount:d.length,resolution:"imported-service-object-member",strength:"candidate"}))}function co(){return{declarations:new Map,callbacks:[]}}function ii(e){let t=co();return he(e,n=>{if(n.type==="variable_declarator"){let l=n.childForFieldName("name")??n.namedChild(0),d=n.childForFieldName("value")??n.namedChild(1);if(l?.type!=="identifier"||!d)return;let c=new Set;if(he(d,u=>{if(u.type!=="member_expression")return;let f=u.childForFieldName("object")??u.namedChild(0),m=u.childForFieldName("property")??u.namedChild(1);f?.type==="identifier"&&m?.text==="Service"&&c.add(f.text)}),c.size===1){let u=t.declarations.get(l.text)??[];u.push({line:n.startPosition.row,alias:[...c][0]}),t.declarations.set(l.text,u)}return}if(!["arrow_function","function_expression","generator_function"].includes(n.type))return;let o=n.childForFieldName("parameters")??n.childForFieldName("parameter");if(!o)return;let r=n.parent;for(;r&&r.type!=="call_expression";)r=r.parent;if(!r)return;let a=r.childForFieldName("function")??r.namedChild(0),i=/^([A-Za-z_$][\w$]*)\.Service\.use$/u.exec(a?.text??"");if(!i)return;let s=new Set;he(o,l=>{l.type==="identifier"&&s.add(l.text)}),s.size!==0&&t.callbacks.push({startLine:n.startPosition.row,endLine:n.endPosition.row,receivers:s,alias:i[1]})}),t}function ai(e,t,n){if(!t||!/^[A-Za-z_$][\w$]*$/u.test(t))return new Set;let o=new Set((e.declarations.get(t)??[]).filter(r=>r.line<=n).map(r=>r.alias));for(let r of e.callbacks)r.startLine<=n&&r.endLine>=n&&r.receivers.has(t)&&o.add(r.alias);return o}function si(e,t,n){let o=n.calleeQualifier;if(!o||!/^[A-Za-z_$][\w$]*$/u.test(o))return[];let r=Y(e,t)?.rootNode;if(!r)return[];let a=li(e,t,r,n.line,n.calleeLeaf,o),i=a?di(a,o):null;if(!i)return[];if(!ci(i))return[];let s=(ge(e,t)??[]).filter(m=>m.startLine<=i.startPosition.row&&m.endLine>=i.endPosition.row).sort((m,p)=>m.endLine-m.startLine-(p.endLine-p.startLine))[0];if(!s)return[];let l=X(e,t).filter(m=>m.isFunctionLike&&m.leaf===s.name);if(l.length!==1)return[];let d=l[0],c=ao.get(e);c||(c=new Map,ao.set(e,c));let u=`${d.symbol}\0${n.calleeLeaf}`,f=c.get(u);if(!f){let m=[];for(let p of Vt(e,d)){let g=Y(e,p.file)?.rootNode;if(!g)continue;let b=ut(g,"call_expression").filter(v=>v.startPosition.row>p.line||v.endPosition.row<p.line?!1:(v.childForFieldName("function")??v.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,"").match(/[A-Za-z_$][\w$]*$/u)?.[0]===d.leaf);if(b.length!==1)continue;let S=b[0].childForFieldName("arguments")?.namedChildren.find(v=>Ae(v).type==="object");if(S)for(let v of Ae(S).namedChildren){if(v.type==="shorthand_property_identifier"&&v.text===n.calleeLeaf){m.push(...St(e,p.file,n.calleeLeaf,v,v));continue}if(v.type!=="pair")continue;let R=v.childForFieldName("key")??v.namedChild(0),y=v.childForFieldName("value")??v.namedChild(1);vt(R?.text)!==n.calleeLeaf||!y||m.push(...St(e,p.file,n.calleeLeaf,y,v))}}f=m.filter((p,g,b)=>b.findIndex(C=>C.file===p.file&&C.startLine===p.startLine&&C.endLine===p.endLine&&C.name===p.name)===g),c.set(u,f)}return f.map(m=>({calleeLeaf:m.name,line:n.line,sourceFile:t,targetFile:m.file,targetStartLine:m.startLine,targetEndLine:m.endLine,resolutionAlternativeCount:f.length,resolution:"factory-callback-member",strength:f.length===1?"exact":"candidate"}))}function li(e,t,n,o,r,a){let i=io.get(e);i||(i=new Map,io.set(e,i));let s=i.get(t);if(!s){s=new Map;for(let l of ut(n,"call_expression")){let d=l.childForFieldName("function")??l.namedChild(0),c=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(d?.text.replace(/\s+/gu,"")??"");if(c)for(let u=l.startPosition.row;u<=l.endPosition.row;u+=1){let f=`${u}\0${c[1]}\0${c[2]}`,m=s.get(f);(!m||l.endIndex-l.startIndex<m.endIndex-m.startIndex)&&s.set(f,l)}}i.set(t,s)}return s.get(`${o}\0${a}\0${r}`)??null}function ci(e){return e.descendantsOfType("return_statement").some(t=>{let n=t.childForFieldName("argument")??t.namedChild(0);return!!(n&&Ae(n).type==="object")})}function di(e,t){let n=e.parent;for(;n;){if(/(?:function|method|lambda)/u.test(n.type)||n.type==="arrow_function"){let o=n.childForFieldName("parameters")??n.childForFieldName("parameter"),r=!1;if(o&&he(o,a=>{a.type==="identifier"&&a.text===t&&(r=!0)}),r)return n}n=n.parent}return null}function St(e,t,n,o,r){if(o.type==="identifier")return(ge(e,t)??[]).filter(l=>l.name===o.text).map(l=>({...l,file:t}));let a=en(e,t,o.text);if(a.length>0)return a;if(!tn(o))return[];let s=(ge(e,t)??[]).filter(l=>l.startLine>=r.startPosition.row&&l.endLine<=r.endPosition.row&&(l.name===n||l.name.startsWith("source@"))).sort((l,d)=>l.endLine-l.startLine-(d.endLine-d.startLine))[0];return[s?{...s,file:t}:{name:n,file:t,startLine:r.startPosition.row,endLine:r.endPosition.row}]}function ui(e,t,n){let o=so.get(e);o||(o=new Map,so.set(e,o));let r=`${t}\0${n}`,a=o.get(r);if(a)return a;let i=fi(e,t).flatMap(s=>pi(e,s,t,n));return o.set(r,i),i}function pi(e,t,n,o){let r=Y(e,t)?.rootNode,a=ge(e,t)??[];if(!r)return[];let i=gi(e,t,n);if(i.size===0)return[];let s=new Set,l=[],d=[],c=[];return he(r,f=>{if(mi(f,i)){if(f.type==="pair"){let m=f.childForFieldName("key")??f.namedChild(0),p=f.childForFieldName("value")??f.namedChild(1);if(vt(m?.text)!==o||!p)return;if(p.type==="identifier")s.add(p.text);else if(tn(p))l.push({name:o,startLine:f.startPosition.row,endLine:f.endPosition.row});else{let g=yi(e,t,p.text),b=en(e,t,p.text);if(g.length>0)c.push(...g);else if(b.length>0)c.push(...b);else{let C=hi(f);C&&d.push(C)}}return}f.type==="shorthand_property_identifier"&&f.text===o&&s.add(o)}}),[...a.filter(f=>s.has(f.name)).map(f=>({...f,file:t})),...l.map(f=>({...f,file:t})),...d.map(f=>({...f,file:t})),...c].filter((f,m,p)=>p.findIndex(g=>g.file===f.file&&g.name===f.name&&g.startLine===f.startLine&&g.endLine===f.endLine)===m)}function mi(e,t){let n=e,o=null;for(;n;){if(n.type==="object"&&(o=n),n.type==="call_expression"){if(!o)return!1;let r=n.childForFieldName("function")??n.namedChild(0);return r?t.has(r.text.replace(/\.of$/u,""))&&r.text.endsWith(".of"):!1}n=n.parent}return!1}function fi(e,t){let n=oo.get(e);n||(n=new Map,oo.set(e,n));let o=n.get(t);if(o)return o;let r=new Set([t]),a=X(e,t).filter(s=>s.leaf==="Service"&&s.isTypeLike);for(let s of a)for(let l of Vt(e,s))r.add(l.file);let i=[...r].sort();return n.set(t,i),i}function gi(e,t,n){let o=new Set;Pe(t,n)&&o.add("Service");for(let r of xe(e,t)){if(!r.sourcePath||!Pe(r.sourcePath,n))continue;if(r.kind==="namespace"&&r.localName){o.add(`${r.localName}.Service`);continue}(r.importedName==="default"?r.localName:r.importedName)==="Service"?o.add(r.localName??r.importedName):r.localName&&r.importedName!=="default"&&o.add(`${r.localName}.Service`)}return o}function en(e,t,n){let o=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!o)return[];let r=Y(e,t)?.rootNode;if(!r)return[];let a=uo(r,o[1]),i=a?po(a):null;if(!i)return[];let s=i.childForFieldName("function")??i.namedChild(0),l=s?mo(e,t,s.text):[];if(l.length!==1)return[];let d=l[0],c=Y(e,d.relativePath)?.rootNode;if(!c)return[];let u=zt(c,d.startLine,d.endLine);if(!u)return[];let f=[];for(let m of u.descendantsOfType("return_statement")){let p=m.childForFieldName("argument")??m.namedChild(0);if(!p)continue;let g=Ae(p);if(g.type==="object")for(let b of g.namedChildren){if(b.type==="shorthand_property_identifier"&&b.text===o[2]){for(let v of ge(e,d.relativePath)??[])v.name===o[2]&&f.push({...v,file:d.relativePath});continue}if(b.type!=="pair")continue;let C=b.childForFieldName("key")??b.namedChild(0),S=b.childForFieldName("value")??b.namedChild(1);if(!(vt(C?.text)!==o[2]||!S))if(S.type==="identifier")for(let v of ge(e,d.relativePath)??[])v.name===S.text&&f.push({...v,file:d.relativePath});else tn(S)&&f.push({name:o[2],startLine:b.startPosition.row,endLine:b.endPosition.row,file:d.relativePath})}}return f.filter((m,p,g)=>g.findIndex(b=>b.file===m.file&&b.name===m.name&&b.startLine===m.startLine&&b.endLine===m.endLine)===p)}function yi(e,t,n){let o=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!o)return[];let r=Y(e,t)?.rootNode;if(!r)return[];let a=uo(r,o[1]),i=a?po(a):null,s=i?.childForFieldName("function")??i?.namedChild(0),l=s?mo(e,t,s.text):[];if(l.length!==1||!i)return[];let d=l[0],c=Y(e,d.relativePath)?.rootNode;if(!c)return[];let u=zt(c,d.startLine,d.endLine);if(!u)return[];let f=new Set,m=u.childForFieldName("parameters")??u.childForFieldName("parameter");if(m&&he(m,L=>{L.type==="identifier"&&f.add(L.text)}),f.size===0)return[];let p=en(e,t,n);if(p.length===0)return[];let g=(ge(e,d.relativePath)??[]).filter(L=>L.startLine>=d.startLine&&L.endLine<=d.endLine),b=(Ut(e,d.relativePath)??[]).filter(L=>L.line>=d.startLine&&L.line<=d.endLine),C=new Set,S=p.map(L=>({name:L.name,startLine:L.startLine,endLine:L.endLine})),v=new Set;for(;S.length>0&&v.size<32;){let L=S.shift(),x=`${L.name}\0${L.startLine}\0${L.endLine}`;if(!v.has(x)){v.add(x);for(let M of b.filter(h=>h.line>=L.startLine&&h.line<=L.endLine)){if(M.memberAccess&&M.calleeQualifier&&f.has(M.calleeQualifier)){C.add(M.calleeLeaf);continue}if(M.memberAccess)continue;let h=g.filter(P=>P.name===M.calleeLeaf);h.length===1&&S.push(h[0])}}}if(C.size===0)return[];let y=i.childForFieldName("arguments")?.namedChildren.find(L=>Ae(L).type==="object");if(!y)return[];let N=[];for(let L of Ae(y).namedChildren){if(L.type==="shorthand_property_identifier"&&C.has(L.text)){N.push(...St(e,t,L.text,L,L));continue}if(L.type!=="pair")continue;let x=L.childForFieldName("key")??L.namedChild(0),M=L.childForFieldName("value")??L.namedChild(1),h=vt(x?.text);!h||!C.has(h)||!M||N.push(...St(e,t,h,M,L))}return N.filter((L,x,M)=>M.findIndex(h=>h.file===L.file&&h.name===L.name&&h.startLine===L.startLine&&h.endLine===L.endLine)===x)}function uo(e,t){for(let n of ut(e,"variable_declarator"))if((n.childForFieldName("name")??n.namedChild(0))?.text===t)return n.childForFieldName("value")??n.namedChild(1);return null}function po(e){return e.type==="call_expression"?e:e.descendantsOfType("call_expression")[0]??null}function mo(e,t,n){let o=n.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,""),r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(o);if(r){let u=xe(e,t).filter(p=>p.localName===r[1]&&p.sourcePath);if(u.length!==1||!u[0].sourcePath)return[];let f=u[0].sourcePath,m=je(e,f,r[2]).filter(p=>p.isFunctionLike);return m.length>0?m:(ge(e,f)??[]).filter(p=>p.name===r[2]).map(p=>({...p,relativePath:f}))}if(!/^[A-Za-z_$][\w$]*$/u.test(o))return[];let a=X(e,t).filter(u=>u.leaf===o&&u.isFunctionLike);if(a.length>0)return a;let i=(ge(e,t)??[]).filter(u=>u.name===o).map(u=>({...u,relativePath:t}));if(i.length>0)return i;let s=xe(e,t).filter(u=>u.localName===o&&u.sourcePath&&u.kind!=="namespace");if(s.length!==1||!s[0].sourcePath)return[];let l=s[0].sourcePath,d=s[0].importedName==="default"?o:s[0].importedName,c=je(e,l,d).filter(u=>u.isFunctionLike);return c.length>0?c:(ge(e,l)??[]).filter(u=>u.name===d).map(u=>({...u,relativePath:l}))}function tn(e){return["arrow_function","function_expression","generator_function"].includes(e.type)||e.descendantsOfType(["arrow_function","function_expression","generator_function"]).length>0}function hi(e){let t=e.parent;for(;t;){if(t.type==="variable_declarator"){let n=t.childForFieldName("name")??t.namedChild(0);if(n?.type==="identifier")return{name:n.text,startLine:t.startPosition.row,endLine:t.endPosition.row}}t=t.parent}return null}function vt(e){return e?e.replace(/^(?:['"])(.*)(?:['"])$/u,"$1"):null}function bi(e,t,n,o){let r=/^this\.([A-Za-z_$][\w$]*)$/u.exec(n.calleeQualifier??"");if(!r)return null;let a=Y(e,t)?.rootNode;if(!a)return null;let i=Si(a,n.line);if(!i)return null;let s=new Set;if(he(i,g=>{if(g.type!=="assignment_expression")return;let b=g.childForFieldName("left")??g.namedChild(0),C=g.childForFieldName("right")??g.namedChild(g.namedChildCount-1);if(b?.text.replace(/\s+/gu,"")!==`this.${r[1]}`||!C)return;let S=Ae(C);if(S.type!=="new_expression")return;let R=(S.childForFieldName("constructor")??S.namedChild(0))?.text.match(/[A-Za-z_$][\w$]*$/u)?.[0];R&&s.add(R)}),s.size!==1)return null;let l=[...s][0],d=o.filter(g=>g.localName===l);if(d.length!==1)return null;let c=d[0].importedName==="default"?l:d[0].importedName,u=d[0].importedName==="default"?je(e,d[0].sourcePath,l):[],f=u.length===1?u[0].leaf:c,m=X(e,d[0].sourcePath).filter(g=>g.isFunctionLike&&g.leaf===n.calleeLeaf&&qn(g.symbol)===f);if(m.length!==1)return null;let p=m[0];return{calleeLeaf:n.calleeLeaf,line:n.line,sourceFile:t,targetFile:p.relativePath,targetStartLine:p.startLine,targetEndLine:p.endLine,targetSymbol:p.symbol,resolution:"constructed-member-receiver",strength:"exact"}}function Si(e,t){let n=[];return he(e,o=>{["class","class_declaration","class_definition"].includes(o.type)&&o.startPosition.row<=t&&o.endPosition.row>=t&&n.push(o)}),n.sort((o,r)=>o.endPosition.row-o.startPosition.row-(r.endPosition.row-r.startPosition.row))[0]??null}function Ae(e){let t=e;for(;["parenthesized_expression","as_expression","type_assertion","satisfies_expression"].includes(t.type)&&t.namedChildCount===1;)t=t.namedChild(0);return t}function he(e,t){t(e);for(let n of e.namedChildren)he(n,t)}function vi(e){let t=new Map,n=/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*;/gu;for(let o of e.matchAll(n)){let r=o[1],a=o[2];r&&a&&t.set(r,a)}return t}function nn(e){let t=[];for(let n of e)t.some(o=>Pe(o,n))||t.push(n);return t}import{existsSync as Ei}from"fs";import{SymbolRole as Ci}from"@c4312/scip";import{deserializeSCIP as xi}from"@c4312/scip";function fo(e,t){return xi(Dn(e,{inputKind:t,maxBytes:$n}))}var on=new WeakMap;function xt(e,t,n,o){let r=J(e,t),a=(r?.callSites??[]).filter(m=>m.line>=n&&m.line<=o);if(!r||a.length===0)return{available:!!r,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let i=an(e);if(!i)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:a.length};let s=(i.byFile.get(t)??[]).filter(m=>m.sourceLine>=n&&m.sourceLine<=o).map(m=>({...m,calleeLeaf:m.definition.leaf})),l=go(a.map(m=>({line:m.line,leaf:m.calleeLeaf}))),d=go(s.map(m=>({line:m.sourceLine,leaf:m.calleeLeaf}))),c=new Set([...l].flatMap(([m,p])=>d.get(m)===p?[m]:[])),u=s.filter(m=>c.has(ho(m.sourceLine,m.calleeLeaf))),f=[...c].reduce((m,p)=>m+(l.get(p)??0),0);return{available:!0,targets:u,resolvedCallsites:f,unresolvedCallsites:Math.max(0,a.length-f)}}function rn(e,t,n,o){let r=an(e);return r?{available:!0,targets:(r.byFile.get(t)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=o)}:{available:!1,targets:[]}}function yo(e,t,n,o){let r=an(e);return r?{available:!0,targets:(r.byFile.get(t)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=o&&Et(e,a.definition)).map(a=>({...a,calleeLeaf:a.definition.leaf}))}:{available:!1,targets:[]}}function an(e){if(on.has(e))return on.get(e)??null;let t=Li(e);return on.set(e,t),t}function Li(e){if(!e.generation.indexPath||!Ei(e.generation.indexPath))return null;try{let t=zn(e),n=new Map(t.map(a=>[a.symbol,a])),o=fo(e.generation.indexPath,"SCIP source-range call-target index"),r=new Map;for(let a of o.documents??[]){let i=a.relativePath;if(!i||e.isIgnored(i))continue;let s=[];for(let l of a.occurrences??[]){if(!l.symbol||(l.symbolRoles&Ci.Definition)!==0)continue;let d=n.get(l.symbol),c=l.range?.[0];!d||!Number.isInteger(c)||s.push({sourceLine:c,definition:d})}r.set(i,s)}return{byFile:r}}catch{return null}}function Et(e,t){if(!t.isFunctionLike)return!1;let n=J(e,t.relativePath);return!n||n.callables.some(o=>o.name===t.leaf&&o.startLine===t.startLine&&o.endLine===t.endLine)?!0:Ii(t)}function Ii(e){let t=e.documentation;if(!t)return!1;let n=e.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${n}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(t)||new RegExp(`\\b(?:const|let|var)\\s+${n}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(t)}function go(e){let t=new Map;for(let n of e){let o=ho(n.line,n.leaf);t.set(o,(t.get(o)??0)+1)}return t}function ho(e,t){return`${e}\0${t}`}var wi=16,Ni=4,Mi=3e3,Ri=800,Ti=new Set(["assignment","const_declaration","const_item","field_declaration","lexical_declaration","local_declaration_statement","local_variable_declaration","static_item","variable_declaration"]);function Co(e,t,n={}){let o=n.maxSteps??wi;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`maxSteps must be a positive safe integer; received ${o}`);let r=new Map(t.nodes.map(E=>[E.id,E])),a=_i(n.focusLocations??[]),i=new Set,s=new Map(t.edges.map(E=>[E.id,E])),l=Le(t.paths.flatMap(E=>E.nodeIds)),d=Le(t.anchors.filter(E=>E.status==="matched").flatMap(E=>E.nodeIds)),c=t.nodes.filter(E=>E.disposition==="emitted"&&E.attributes.upstreamCausalPath===!0).sort((E,k)=>Number(k.attributes.upstreamCausalDistance??0)-Number(E.attributes.upstreamCausalDistance??0)||E.id.localeCompare(k.id)).map(E=>E.id),u=new Set(c),f=Math.max(0,o-d.length),p=Fi(t,d,a,f).slice(0,f),g=new Set(p),b=new Set(p),C=new Set([...l,...c,...d]),S=t.edges.filter(E=>E.disposition==="emitted"&&E.kind!=="structural-membership"),v=t.edges.filter(E=>E.disposition!=="excluded"&&E.disposition!=="unsupported"&&E.kind!=="structural-membership"),R=new Set([...t.paths.flatMap(E=>E.edgeIds),...S.filter(E=>u.has(E.fromNodeId)&&u.has(E.toNodeId)).map(E=>E.id)]),y=t.paths.some(E=>E.edgeIds.length>0),N=new Set(d);for(let E of p)N.add(E);for(let E of t.paths){let k=E.nodeIds[0],G=s.get(E.edgeIds[0]??""),H=E.nodeIds[1];k&&H&&G?.fromNodeId===k&&G.toNodeId===H&&N.add(k)}if(t.paths.every(E=>E.nodeIds.length===0))for(let E of t.anchors)for(let k of E.nodeIds)N.add(k);let L=Ki(d,v,r,Ni),x=Le(S.filter(E=>E.kind==="call"&&d.includes(E.fromNodeId)).map(E=>E.toNodeId)),M=new Set(Le([...L,...y?[]:x]));for(let E of M)N.add(E);let h=Le(S.flatMap(E=>C.has(E.fromNodeId)||C.has(E.toNodeId)?[E.fromNodeId,E.toNodeId]:[])),P=t.nodes.filter(E=>E.disposition==="emitted"&&E.kind!=="structural-region"&&S.some(k=>k.fromNodeId===E.id||k.toNodeId===E.id)).map(E=>E.id),D=Le([...c,...l,...d,...p,...M,...h,...P]).filter(E=>r.has(E)),O=[];for(let E of D)y&&!C.has(E)&&!g.has(E)&&!M.has(E)||O.length>=o&&!C.has(E)||O.push(E);let w=new Set(O),T=new Map(O.map(E=>[E,zi(E)])),I=new Set([...l,...c]),_=new Set(t.anchors.flatMap(E=>E.nodeIds)),A=O.map((E,k)=>{let G=r.get(E),H=Di(G,a);for(let me of H)i.add(qe(G.location.file,me));return{id:T.get(E),nodeId:E,order:k,role:_.has(E)?"anchor":I.has(E)?"connector":"junction",kind:G.kind,label:G.label,location:G.location,behavior:Pi(e,G,_.has(E),[...new Set([...H,...$i(e,G,v,r,R,N)])],H,N.has(G.id)&&(H.length===0||_.has(G.id)),M.has(G.id),b.has(G.id)&&H.length===0)}}),j=new Map;for(let E of t.paths)for(let k=0;k<E.edgeIds.length;k+=1){let G=s.get(E.edgeIds[k]),H=E.nodeIds[k],me=E.nodeIds[k+1];!G||!H||!me||j.set(G.id,G.fromNodeId===H&&G.toNodeId===me?"forward":"reverse")}let B=v.filter(E=>w.has(E.fromNodeId)&&w.has(E.toNodeId)).sort((E,k)=>qi(E,k,t)).map((E,k)=>({id:Ui(E.id),edgeId:E.id,order:k,kind:E.kind,fromStepId:T.get(E.fromNodeId),toStepId:T.get(E.toNodeId),directed:!0,pathTraversal:j.get(E.id)??"adjacent",evidence:E.evidence})),U=new Map(B.map(E=>[E.edgeId,E.id])),q=t.paths.map(E=>({id:E.id,status:E.status,stepIds:E.nodeIds.flatMap(k=>{let G=T.get(k);return G?[G]:[]}),transitionIds:E.edgeIds.flatMap(k=>{let G=U.get(k);return G?[G]:[]})})),se=A.flatMap(E=>E.location?[`${E.location.file}:${E.location.line+1}`]:[]),Ne=t.anchors.some(E=>E.status==="ambiguous"),Oe=q.some(E=>E.status==="connected"||E.status==="candidate"),ve=q.some(E=>E.status==="partial");return{status:A.length===0?"unavailable":Ne?"ambiguous":Oe&&!ve?"connected":ve?"partial":"connected",steps:A,transitions:B,paths:q,coverage:{candidateNodes:D.length,returnedNodes:O.length,omittedNodeIds:D.filter(E=>!w.has(E)),returnedTransitions:B.length,withheldStatements:A.reduce((E,k)=>E+(k.behavior?.coverage.omittedStatements??0),0),requestedFocusLocations:a,matchedFocusLocations:a.filter(E=>i.has(qe(E.file,E.line))),unmatchedFocusLocations:a.filter(E=>!i.has(qe(E.file,E.line)))},behaviorCommand:Eo(se,"behavior"),exactSourceCommand:Eo(se,"source")}}function Fi(e,t,n,o){if(o<=0||n.length===0)return[];let r=new Set(t),a=new Set(n.map(i=>qe(i.file,i.line)));return Le(e.edges.filter(i=>i.disposition!=="excluded"&&i.disposition!=="unsupported"&&["call","runtime-boundary"].includes(i.kind)&&r.has(i.fromNodeId)&&i.evidence.some(s=>!["candidate","unknown"].includes(s.strength)&&s.location&&a.has(qe(s.location.file,s.location.line)))).sort((i,s)=>{let l=i.evidence.find(c=>c.location)?.location,d=s.evidence.find(c=>c.location)?.location;return(l?.file??"").localeCompare(d?.file??"")||(l?.line??Number.MAX_SAFE_INTEGER)-(d?.line??Number.MAX_SAFE_INTEGER)||i.id.localeCompare(s.id)}).map(i=>i.toNodeId)).slice(0,o)}function Pi(e,t,n,o,r,a,i,s){if(!t.location||!["symbol","source-construct","runtime-boundary-participant"].includes(t.kind))return null;let l=t.location.endLine??t.location.line,d=le(e,t.location.file),c=o.length>0?o:[t.location.line],u=t.kind==="runtime-boundary-participant"?Ye(e,t.location.file,0,Math.max(0,d.length-1),[t.location.line]):Ye(e,t.location.file,t.location.line,l,c),f=o.filter(M=>M>=u.startLine&&M<=u.endLine),m=yt(e,t.location.file,u.startLine,u.endLine,f),p=m??(f.length>0?yt(e,t.location.file,u.startLine,u.endLine,f,{requireSavings:!1}):null),g=f.length>0?Bi(e,t,u.startLine,u.endLine,f,p,a):null,b=d.slice(u.startLine,u.endLine+1).join(`
2
2
  `).length,C=Me(e,t.location.file,u.startLine,u.endLine),S=d.slice(u.startLine,u.endLine+1).some((M,h)=>M.length>Ri&&(C.get(u.startLine+h)??[]).some(P=>["binding","branch","loop","call","return","throw","mutation"].includes(P))),v=M=>Ai(e,t,u.startLine,u.endLine,r.filter(h=>h>=u.startLine&&h<=u.endLine),M),R=(i||t.kind==="runtime-boundary-participant"||t.anchorIds.length>0)&&b<=Mi,y=n&&(f.length===0||R);if(m&&(s||y))return v(bo(m));if(!s&&!y&&g&&!S&&!R&&g.renderedCharacters<(p?.outlineCharacters??b))return v(g);if(m)return v(bo(m));let N=d.slice(u.startLine,u.endLine+1),L=N.join(`
3
3
  `),x=Me(e,t.location.file,u.startLine,u.endLine);return v({kind:"source",constructKind:"source construct",signature:N.find(M=>M.trim().length>0)?.trim()??t.label,lines:N.map((M,h)=>({line:u.startLine+h,endLine:u.startLine+h,depth:0,signals:x.get(u.startLine+h)??[],text:M,copied:!0})),coverage:{sourceStatements:N.length,representedStatements:N.length,copiedStatements:N.length,omittedStatements:0},rawCharacters:L.length,renderedCharacters:L.length})}function Ai(e,t,n,o,r,a){if(!t.location)return a;let i=rn(e,t.location.file,n,o);if(!i.available)return a;let s=Me(e,t.location.file,n,o),l=le(e,t.location.file),d=new Set(r);for(let S of r){let v=Ct(l[S]??"");if(!v)continue;let R=Ee(e,t.location.file,v).find(y=>y>S&&y<=o);R!==void 0&&d.add(R)}let c=[...new Map(i.targets.flatMap(S=>{let v=S.definition,R=v.relativePath===t.location.file&&v.startLine<=o&&v.endLine>=n;if(v.isTypeLike||R)return[];let y=Et(e,v),N=r.length>0&&y&&s.get(S.sourceLine)?.includes("return"),L=y&&d.has(S.sourceLine);return y&&!N&&!L?[]:[[v.symbol,{definition:v,kind:N?"return-value-transformer":L?"focused-causal-target":"compiler-referenced-declaration"}]]})).values()].sort((S,v)=>S.definition.relativePath.localeCompare(v.definition.relativePath)||S.definition.startLine-v.definition.startLine||S.definition.symbol.localeCompare(v.definition.symbol)),u=[],f=c.filter(({kind:S})=>S!=="compiler-referenced-declaration").map(({definition:S})=>({owner:S,depth:1})),m=new Set,p=new Set(c.map(({definition:S})=>S.symbol));for(;f.length>0;){let S=f.shift();if(!S||m.has(S.owner.symbol))continue;m.add(S.owner.symbol);let{owner:v,depth:R}=S,y=rn(e,v.relativePath,v.startLine,v.endLine);if(!y.available)continue;let N=Me(e,v.relativePath,v.startLine,v.endLine),L=le(e,v.relativePath);for(let x of y.targets){let M=x.definition,h=M.relativePath===v.relativePath&&M.startLine<=v.endLine&&M.endLine>=v.startLine;if(M.isTypeLike||h)continue;let P=Et(e,M),D=Ct(L[x.sourceLine]??""),O=P&&D!==null&&Ee(e,v.relativePath,D).some(T=>T>x.sourceLine&&T<=v.endLine&&(N.get(T)??[]).some(I=>["branch","return","throw"].includes(I))),w=P&&((N.get(x.sourceLine)??[]).some(T=>["branch","return","throw"].includes(T))||O);P&&!w||(p.has(M.symbol)||(p.add(M.symbol),u.push({definition:M,kind:P?"focused-causal-target":"compiler-referenced-declaration"})),P&&R<2&&f.push({owner:M,depth:R+1}))}}let g=[...new Map([...c,...u].map(S=>[S.definition.symbol,S])).values()].sort((S,v)=>S.definition.relativePath.localeCompare(v.definition.relativePath)||S.definition.startLine-v.definition.startLine||S.definition.symbol.localeCompare(v.definition.symbol)),b=[],C=[];for(let{definition:S,kind:v}of g){let R=v==="compiler-referenced-declaration"?ki(e,S.relativePath,S.startLine,S.endLine):{startLine:S.startLine,endLine:S.endLine},y=le(e,S.relativePath).slice(R.startLine,R.endLine+1).join(`
4
4
  `),N=v==="compiler-referenced-declaration"?null:yt(e,S.relativePath,S.startLine,S.endLine,[]),L=N?[N.signature,...N.lines.map(D=>`${D.line+1}${D.signals.length>0?`[${D.signals.join(",")}]`:""} ${D.text}`)].join(" | "):null,x=L&&L.length<y.length?L:y,M={symbol:S.symbol,label:S.leaf,file:S.relativePath,line:R.startLine,endLine:R.endLine},h=v==="compiler-referenced-declaration"?1e3:8e3,P=v==="compiler-referenced-declaration"?12:120;if(x.length>h||R.endLine-R.startLine>P){C.push({...M,reason:"source-too-large"});continue}b.push({kind:v,...M,text:x})}return{...a,...b.length===0?{}:{supportingDeclarations:b},...C.length===0?{}:{omittedSupportingDeclarations:C}}}function ki(e,t,n,o){let r=Y(e,t);if(!r)return{startLine:n,endLine:o};let a=[];Lo(r.rootNode,s=>{Ti.has(s.type)&&s.startPosition.row<=n&&s.endPosition.row>=o&&a.push(s)});let i=a.sort((s,l)=>s.endPosition.row-s.startPosition.row-(l.endPosition.row-l.startPosition.row)||s.endIndex-s.startIndex-(l.endIndex-l.startIndex))[0];return i?{startLine:i.startPosition.row,endLine:i.endPosition.row}:{startLine:n,endLine:o}}function Lo(e,t){t(e);for(let n of e.namedChildren)Lo(n,t)}function bo(e){return{kind:"outline",constructKind:e.constructKind,signature:e.signature,lines:e.lines,coverage:e.coverage,rawCharacters:e.rawCharacters,renderedCharacters:e.outlineCharacters}}function $i(e,t,n,o,r,a){if(!t.location||!["symbol","source-construct","runtime-boundary-participant"].includes(t.kind))return[];let i=new Set,s=new Set(J(e,t.location.file)?.callSites.map(l=>l.line)??[]);if(t.kind==="runtime-boundary-participant"&&i.add(t.location.line),a.has(t.id))for(let l of Qt(e,{files:[t.location.file]}))l.source.startLine>=t.location.line&&l.source.startLine<=(t.location.endLine??t.location.line)&&i.add(l.source.startLine);for(let l of n){if(l.fromNodeId!==t.id&&l.toNodeId!==t.id)continue;let d=o.get(l.fromNodeId===t.id?l.toNodeId:l.fromNodeId),c=a.has(t.id)&&["call","reference","runtime-boundary"].includes(l.kind)&&l.fromNodeId===t.id,u=(d?.anchorIds.length??0)>0;if(!r.has(l.id)&&!c&&!u)continue;let f=l.evidence.flatMap(C=>C.location?.file===t.location.file?[C.location.line]:[]),m=f.filter(C=>s.has(C));for(let C of m.length>0?m:f)i.add(C);let p=d?.attributes.leaf;if(typeof p!="string"||p.length===0)continue;let g=Ee(e,t.location.file,p).filter(C=>C>=t.location.line&&C<=(t.location.endLine??t.location.line)),b=g.find(C=>s.has(C))??g[0];b!==void 0&&i.add(b)}return[...i].sort((l,d)=>l-d)}function Di(e,t){if(!e.location)return[];let n=e.location.endLine??e.location.line;return t.filter(o=>o.file===e.location.file&&o.line>=e.location.line&&o.line<=n).map(o=>o.line)}function _i(e){let t=new Map;for(let n of e){if(!n.file||!Number.isSafeInteger(n.line)||n.line<0)throw new RangeError(`Behavior focus locations require a repository file and non-negative line; received ${JSON.stringify(n)}.`);t.set(qe(n.file,n.line),{file:n.file,line:n.line})}return[...t.values()].sort((n,o)=>n.file.localeCompare(o.file)||n.line-o.line)}function qe(e,t){return`${e}\0${t}`}function Bi(e,t,n,o,r,a,i){if(!t.location)return null;let s=le(e,t.location.file),l=Me(e,t.location.file,n,o),d=[...l].filter(([,w])=>w.length>0).map(([w])=>w).sort((w,T)=>w-T),c=r.map(w=>(l.get(w)??[]).length>0?w:d.find(T=>T>w&&T-w<=8)??w),u=new Set([...r,...c]),f=i?Yt(e,t.location.file,n,o,{minimumBodyLines:0}):null,m=a?[...new Map(c.flatMap(w=>a.lines.filter(T=>T.text.length<=500&&T.signals.some(I=>["branch","loop","catch","finally"].includes(I))&&w>=T.line&&w<=T.endLine).sort((T,I)=>T.endLine-T.line-(I.endLine-I.line)||T.line-I.line).slice(0,2).map(T=>[`${T.line}\0${T.endLine}`,T]))).values()]:ht(e,t.location.file,n,o,c);for(let w of f?.lines??[])u.add(w.line);for(let w of m)u.add(w.line);for(let[w,T]of l)T.includes("call")&&T.includes("shape")&&u.add(w);let p=[];for(let w of c){let T=Ct(s[w]??"");if(!T)continue;let I=Ee(e,t.location.file,T).filter(B=>B>w&&B<=o),_=I[0];_!==void 0&&u.add(_);let A=I.find(B=>(l.get(B)??[]).some(U=>U==="branch"||U==="loop"));if(A===void 0)continue;u.add(A);let j=(a?.lines??[]).find(B=>B.line===A)??{line:A,endLine:Math.min(o,A+40),depth:0,signals:l.get(A)??[],text:(s[A]??"").trim(),copied:!0},$=a?.lines??s.slice(j.line,j.endLine+1).map((B,U)=>{let q=j.line+U;return{line:q,endLine:q,depth:0,signals:l.get(q)??[],text:B.trim(),copied:!0}});p.push({focusLine:w,governingUse:A,lines:$.filter(B=>B.line>=j.line&&B.line<=j.endLine&&B.text.length<=500&&B.signals.some(U=>["binding","branch","call","mutation"].includes(U)))})}for(let w of p.sort((T,I)=>I.governingUse-I.focusLine-(T.governingUse-T.focusLine)||T.focusLine-I.focusLine).slice(0,2))for(let T of w.lines.slice(0,14))u.add(T.line);let g=new Set(["binding","branch","loop","call","return","throw","mutation"]);for(let w of m)for(let T of a?.lines??[])T.line<w.line||T.line>w.endLine||T.signals.some(I=>g.has(I))&&u.add(T.line);let b=s.slice(n,o+1).flatMap((w,T)=>{let I=Ct(w);return I?[{name:I,line:n+T}]:[]}),C=!0;for(;C;){C=!1;for(let w of b)if([...u].some(I=>Gi(s[I]??"",w.name))){u.has(w.line)||(u.add(w.line),C=!0);for(let I of Ee(e,t.location.file,w.name))I<n||I>o||u.has(I)||(l.get(I)??[]).some(_=>g.has(_))&&(u.add(I),C=!0)}}for(let w of a?.lines??[])if(w.signals.some(T=>["branch","loop","catch","finally"].includes(T))&&u.has(w.line))for(let T of a?.lines??[])T.line<w.line||T.line>w.endLine||T.signals.some(I=>g.has(I))&&u.add(T.line);let S=J(e,t.location.file),v=new Set(S?.callSites.map(w=>w.line)??[]),R=l,y=new Map([...a?.lines??[],...m].filter(w=>w.signals.some(T=>["branch","loop","catch","finally"].includes(T))).map(w=>[w.line,w])),N=new Map((a?.lines??[]).filter(w=>w.text.length<=500&&w.signals.includes("shape")&&(w.signals.includes("call")||w.signals.includes("mutation")||w.signals.includes("return"))).sort((w,T)=>w.endLine-w.line-(T.endLine-T.line)||w.line-T.line).map(w=>[w.line,w])),L=new Map((f?.lines??[]).map(w=>[w.line,w.signals.filter(T=>T!=="lifecycle")])),x=[...u].filter(w=>w>=n&&w<=o).sort((w,T)=>w-T).map(w=>{let T=y.get(w)??N.get(w);return{line:w,endLine:T?.endLine??w,depth:T?.depth??0,signals:Oi([...R.get(w)??[],...a?.lines.filter(I=>w>=I.line&&w<=I.endLine).flatMap(I=>I.signals)??[],...L.get(w)??[],...r.includes(w)?["anchor"]:[],...v.has(w)?["call"]:[]]),text:T?.text??(s[w]??"").trim(),copied:T?.copied??!0}}).filter(w=>w.text.length>0);if(x.length===0)return null;let M=f?.candidateLines??Yt(e,t.location.file,n,o,{minimumBodyLines:0})?.candidateLines??0,h=Math.max(a?.coverage.sourceStatements??0,M,x.length),P=a?.signature??(s[n]??t.label).trim(),D=P.length+x.reduce((w,T)=>w+T.text.length+T.signals.join(",").length+12,0),O=s.slice(n,o+1).join(`
@@ -18,4 +18,4 @@ import{a as ye}from"./chunk-3TNRNKAT.js";import{b as ne,c as Xe}from"./chunk-7KC
18
18
  LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
19
19
  WHERE imp_d.relative_path = ? AND m.role = 2
20
20
  ORDER BY def_d.relative_path, gs.symbol`,t);return n.length>0?n.map(o=>({symbol:o.symbol,shortName:ee(o.symbol),importedName:Ar(ee(o.symbol)),localName:Ar(ee(o.symbol)),fromFile:o.from_file,source:"compiler"})):xe(e,t).map(o=>{let r=Hl(o.importedName,o.localName,o.kind),a=o.localName??o.importedName,i=o.importedName==="default"?a:o.importedName;return{symbol:r,shortName:r,importedName:i,localName:a,fromFile:o.sourcePath,source:"parsed-source"}})}function Ar(e){return e.slice(e.lastIndexOf(":")+1).replace(/\(\)$/u,"")||e}function Hl(e,t,n){return n==="namespace"&&e==="*"&&t?`* as ${t}`:n==="default"&&t?`default as ${t}`:n==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function Te(e,t,n){let o=Ht(e,n);if(!o.match)return{matches:[],total:0,omitted:0};let r=[o.match,...o.candidates.map(i=>Ht(e,i.symbol).match)].filter(i=>i!==null),a=new Map;for(let i of r){let s=t.definitionsForFile(i.relativePath).find(l=>l.symbol===i.symbol);s&&a.set(s.symbol,s)}return{matches:[...a.values()],total:o.total,omitted:Math.max(0,o.total-a.size)}}function Vl(e){return{symbol:e.symbol,shortName:ee(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine}}function pe(e,t){let n=[t.kind,t.fromFile,t.fromSymbol??"",t.toFile,t.toSymbol??"",t.fromBoundaryParticipant?.observationId??"",t.toBoundaryParticipant?.observationId??"",t.fromSourceConstruct?Se(t.fromSourceConstruct):"",t.toSourceConstruct?Se(t.toSourceConstruct):"",t.runtimeBoundaryKey??"",t.line??""].join("\0");e.set(n,t)}function Ve(e){return{observationId:e.id,action:e.action,protocol:e.protocol,role:e.role,address:Gr(e),file:e.source.file,line:e.source.startLine,endLine:e.source.endLine,ownerName:e.owner.name,ownerSymbol:e.owner.symbol}}function Bt(e,t){let n=le(e,t.source.file);return Ye(e,t.source.file,0,Math.max(0,n.length-1),[t.source.startLine])}function kr(e,t){let n=[...e.values()];for(let o of[t.owner,t.source]){let r=n.filter(a=>a.file===o.file&&a.startLine<=o.startLine&&a.endLine>=o.startLine).sort((a,i)=>a.endLine-a.startLine-(i.endLine-i.startLine)||a.startLine-i.startLine)[0];if(r)return r}return null}function $r(e,t,n,o,r){let a=[],i=n.get(e.id);i!==void 0&&i<=t&&a.push(i);for(let s of o.values()){if(s.depth>t)continue;let l=s.definition;Dr(l,e)&&a.push(s.depth)}for(let s of r.values())s.depth>t||Dr(s,e)&&a.push(s.depth);return a.length>0?Math.min(...a):null}function Dr(e,t){let n=e.relativePath??e.file;return[t.owner,t.source].some(o=>n===o.file&&e.startLine<=o.startLine&&e.endLine>=o.startLine)}function Mn(e){return ue("runtime-boundary-participant",e)}function Ql(e,t,n){let o=de(e,n),r=de(t,n);return o.relativeDir!==r.relativeDir?!0:/(?:^|\/)(?:contracts?|schemas?|db\/schema)(?:\/|$)/u.test(t)}function Yl(e,t,n){return lt(e,n).id===lt(t,n).id}function Xl(e,t,n,o){if(e.referenceScope==="all")return!0;let r=lt(t,o).id;return[...n.values()].some(i=>i.promoteBoundaryImports&&lt(i.file,o).id===r)?!0:e.referenceScope!=="cross-workspace-or-forward"?!1:de(t,o).relativeDir!==de(e.definition.relativePath,o).relativeDir}function Zl(e,t){let n={none:0,"forward-regions":1,"cross-workspace-or-forward":2,all:3};return n[e]>=n[t]?e:t}function Jl(e,t){let n=Nr.get(e);if(n)return n;let o=t.fileDependencyGraph(),r={fileGraph:o,reverseFileGraph:ec(o),workspaces:tc(t.sourceFiles()),runtimeBoundaries:Qn(e)};return Nr.set(e,r),r}function ec(e){let t=new Map;for(let[n,o]of e)for(let r of o){let a=t.get(r)??new Set;a.add(n),t.set(r,a)}return t}function de(e,t){return t.find(n=>e===n.relativeDir||e.startsWith(`${n.relativeDir}/`))??{name:"root",relativeDir:""}}function tc(e){let t=new Set(["apps","packages","services","crates","libs","tools"]),n=new Map;for(let o of e){let r=o.split("/").filter(Boolean);if(r.length<3||!t.has(r[0]))continue;let a=`${r[0]}/${r[1]}`;n.set(a,{name:r[1],relativeDir:a})}return[...n.values()].sort((o,r)=>r.relativeDir.length-o.relativeDir.length)}function lt(e,t){let n=de(e,t),r=(n.relativeDir?e.slice(n.relativeDir.length+1):e).split("/").filter(Boolean);r[0]==="src"&&r.shift();let a=nc(r);return{id:`region:${n.relativeDir||"root"}:${a}`,label:`${n.name}:${a}`,workspace:n.name,structuralPath:a}}function nc(e){if(e.length<=1)return"root";let t=e[0],n=e[1];return["components","features","modules"].includes(t)?`${t}/${n}`:t==="db"?`${t}/${n}`:["contracts","routes","services"].includes(t)?t:t==="tests"||t==="__tests__"?"tests":t}function oc(e,t,n,o,r,a,i){let s=ye([...e.values()],m=>a.get(m.file).id),l=ye([...t.values()],m=>a.get(m.definition.relativePath).id),d=ye(n,m=>a.get(m.file).id),c=new Map;for(let m of o)for(let p of new Set([m.fromRegionId,m.toRegionId])){let g=c.get(p)??[];g.push(m),c.set(p,g)}let u=ye(r,m=>m.toRegionId),f=ye(r,m=>m.fromRegionId);return[...s.entries()].map(([m,p])=>{let g=a.get(p[0].file),b=l.get(m)??[],C=d.get(m)??[],S=c.get(m)??[],v=i.has(m),R=b.map(ac).sort(dc).slice(0,Hs),y=p.filter(N=>mt(N.file)==="test").length;return{id:m,label:g.label,workspace:g.workspace,structuralPath:g.structuralPath,minDepth:Math.min(...p.map(N=>N.depth)),fileCount:p.length,sourceFileCount:p.length-y,testFileCount:y,symbolCount:b.length,literalHitCount:C.length,anchorQueries:z([...C.map(N=>N.query),...b.flatMap(N=>[...N.anchorQueries])]),relationKinds:z(S.map(N=>N.kind)),incomingRegionIds:z((u.get(m)??[]).map(N=>N.fromRegionId)),outgoingRegionIds:z((f.get(m)??[]).map(N=>N.toRegionId)),memberCallCandidateRelationCount:S.filter(N=>N.evidence==="ast-member-import-candidate").length,notableSymbols:R,omittedNotableSymbols:Math.max(0,b.length-R.length),expanded:v,files:v?p.map(rc).sort(uc):[],symbols:v?b.map(ic).sort(pc):[],literalHits:v?[...C].sort(Kr):[],relations:v?[...S].sort(jr):[]}}).sort((m,p)=>m.minDepth-p.minDepth||m.label.localeCompare(p.label))}function rc(e){return{file:e.file,kind:mt(e.file),depth:e.depth,origins:z([...e.origins])}}function ic(e){return{symbol:e.definition.symbol,shortName:ee(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,depth:e.depth,origins:z([...e.origins]),anchorQueries:z([...e.anchorQueries]),referenceExpansion:e.referenceScope!=="none",referenceScope:e.referenceScope}}function ac(e){return{shortName:ee(e.definition.symbol),file:e.definition.relativePath,origins:z([...e.origins])}}function sc(e){return[...ye(e.filter(n=>n.fromRegionId!==n.toRegionId),n=>`${n.fromRegionId}\0${n.toRegionId}`).values()].map(n=>({fromRegionId:n[0].fromRegionId,toRegionId:n[0].toRegionId,kinds:z(n.map(o=>o.kind)),relationCount:n.length,fromFiles:z(n.map(o=>o.fromFile)),toFiles:z(n.map(o=>o.toFile)),fromSymbols:z(n.flatMap(o=>o.fromSymbol?[ee(o.fromSymbol)]:[])),toSymbols:z(n.flatMap(o=>o.toSymbol?[ee(o.toSymbol)]:[])),evidence:z(n.map(o=>o.evidence)),strengths:z(n.map(o=>o.strength??"unknown"))})).sort((n,o)=>n.fromRegionId.localeCompare(o.fromRegionId)||n.toRegionId.localeCompare(o.toRegionId))}function lc(e,t){return[...e.values()].map(n=>({kind:"external-import",name:n.name,fromRegionIds:z([...n.fromFiles].flatMap(o=>{let r=t.get(o);return r?[r.id]:[]})),fromFiles:z([...n.fromFiles])})).sort((n,o)=>n.name.localeCompare(o.name))}function cc(e,t,n,o){let r=e.kind==="literal"?t.filter(a=>a.query===e.query).map(a=>a.file):[...n.values()].filter(a=>a.anchorQueries.has(e.query)).map(a=>a.definition.relativePath);return z(r.map(a=>o.get(a)?.id).filter(a=>!!a))}function Gr(e){return e.keyParts.map(t=>`${t.name}=${t.value}`).join(" ")}function z(e){return[...new Set(e)].sort()}function jr(e,t){return e.fromRegionId.localeCompare(t.fromRegionId)||e.toRegionId.localeCompare(t.toRegionId)||e.kind.localeCompare(t.kind)||e.fromFile.localeCompare(t.fromFile)||e.toFile.localeCompare(t.toFile)||(e.line??-1)-(t.line??-1)}function dc(e,t){return Ke(e.origins)-Ke(t.origins)||e.shortName.localeCompare(t.shortName)}function uc(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)}function pc(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)}function Kr(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.query.localeCompare(t.query)}var fc={causal:["execution","runtime","dataflow","state","temporal"],structure:["contract","identity","ownership","dependencies"],complete:Ce},gc=2,yc=48,qr=64,hc=5e4;function ju(e,t,n={}){let o=ne([...t.symbols??[],...t.locations??[]]),r=ne(t.searches??[]);if(o.length===0&&r.length===0)throw new Error("evidence requires at least one positional symbol, --symbol, --at, or --search selector.");let a=n.view??"causal",i=bc(n.families,a),s=n.direction??"both",l=ne(n.subtypes??[]),d=n.connecting??!1,c=n.inventoryOnly??!1,u=ne(n.foldIds??[]),f=n.maxDepth??gc,m=n.maxEdges??yc;if(!Number.isSafeInteger(f)||f<0)throw new RangeError(`Evidence depth must be a non-negative safe integer; received ${f}.`);if(!Number.isSafeInteger(m)||m<=0)throw new RangeError(`Evidence max edges must be a positive safe integer; received ${m}.`);if(!["incoming","outgoing","both"].includes(s))throw new Error(`Unsupported graph evidence direction: ${s}.`);if(c&&u.length>0)throw new Error("Evidence fold materialization cannot be combined with --inventory-only.");let p=_r(e,{symbols:o,searches:r,maxDepth:f,maxTopologyCharacters:hc,relations:Sc(i)}),g=new Map(p.nodes.map($=>[$.id,$])),b=p.edges.filter($=>$.disposition==="emitted"||$.disposition==="folded").flatMap($=>vc($,g)),C=b.filter($=>i.includes($.family)).filter($=>l.length===0||l.includes($.subtype)),S=new Set(p.anchors.flatMap($=>$.nodeIds));if(d&&S.size<2)throw new Error("Connecting evidence requires at least two resolved root nodes.");let v=new Set(C.map($=>$.id)),R=Rn(b,S,"incoming").filter($=>v.has($.id)),y=Rn(b,S,"outgoing").filter($=>v.has($.id)),N=Rn(b,S,"both").filter($=>v.has($.id)),L=Ic(i,l,R,y,N),x=s==="incoming"?R:s==="outgoing"?y:N,M=d?Pc(x,[...S],s):x,h=kc(M,S,s),P=[...M].sort(($,B)=>$c($,B,h)),D=wc(P,m),O=Mc(D,u),w=c?[]:u.length>0?P.filter($=>O.has($.id)):P,T=u.length>0?w:w.slice(0,m),I=u.length>0||c?[]:D,_=Math.max(0,w.length-T.length),A=p.frontiers.filter($=>$.disposition==="unsupported").length,j=p.coverage.status==="incomplete"?"incomplete":_>0?"bounded":"accounted";return{kind:"graph",view:n.families&&n.families.length>0?"custom":a,families:i,selection:{direction:s,subtypes:l,connecting:d,inventoryOnly:c,foldIds:u},targets:p.anchors.map($=>({kind:$.kind,query:$.query,status:$.status,nodeIds:[...$.nodeIds],omittedCandidates:$.omittedCandidates})),inventory:L,edges:T,folds:I,coverage:{status:j,topologyStatus:p.coverage.status,scope:p.coverage.scope,maxDepth:f,maxEdges:m,matchedEdges:P.length,eligibleEdges:w.length,returnedEdges:T.length,omittedEdges:_,frontierGroups:p.frontiers.length,unsupportedFrontiers:A,blindSpots:ne([...p.coverage.blindSpots,...eo(i)]),explanation:c?`${P.length} relationship(s) match the explicit projection; only exact inventory counts were requested.`:u.length>0?`Every relationship in ${u.length} explicitly selected recoverable fold(s) was emitted.`:j==="accounted"?"Every selected relationship in the bounded topology was emitted.":j==="bounded"?`${_} selected relationship(s) were withheld by the explicit edge budget.`:p.coverage.explanation}}}function bc(e,t){let n=e&&e.length>0?e:fc[t],o=n.filter(r=>!Ce.includes(r));if(o.length>0)throw new Error(`Unsupported graph evidence family: ${o.join(", ")}.`);return ne(n)}function Sc(e){return["call","contract-symbol","import","reference","runtime-boundary"]}function vc(e,t){let n=t.get(e.fromNodeId),o=t.get(e.toNodeId);return!n||!o?[]:(e.semantics??[]).flatMap((r,a)=>{let i=Ec(r);if(!i)return[];let s=to(i,r.subtype);if(!s)throw new Error(`No graph relation provider contract is registered for ${i}/${r.subtype}.`);let l=Lc(e);return s.relation.evidenceStrengths.includes(l)?[{id:`${e.id}:${a}:${i}`,family:i,semanticFamily:r.family,subtype:r.subtype,from:zr(n),to:zr(o),sourceKind:e.kind,providerId:s.provider.id,supportCeiling:s.relation.supportCeiling,establishes:s.relation.establishes,nonClaims:[...s.relation.nonClaims],recoverWith:[...s.relation.recoverWith],evidenceStrength:l,evidenceMethods:ne(e.evidence.map(d=>d.method)),evidenceConstituents:xc(e.evidence),context:r.context?{...r.context}:null,attributes:r.attributes?{...r.attributes}:null}]:[]})}function xc(e){let t=new Map;for(let n of e)t.set(`${n.method}\0${n.strength}`,n);return[...t.values()].map(({method:n,strength:o})=>({method:n,strength:o}))}function Ec(e){switch(e.family){case"control":return e.context?.crossesRuntimeBoundary===!0||e.subtype==="runtime-handoff"?"runtime":"execution";case"data":return"dataflow";case"state":return"state";case"temporal":return"temporal";case"contract":return"contract";case"identity":return e.subtype.startsWith("contains")||e.subtype.startsWith("owns-")?"ownership":e.subtype.startsWith("import")?"dependencies":"identity"}}function zr(e){let t=Cc(e);return{id:e.id,kind:e.kind,label:t?ee(t):e.label,symbol:t,location:e.location?{...e.location}:null}}function Cc(e){return e.kind!=="symbol"||!e.id.startsWith("symbol:")?null:decodeURIComponent(e.id.slice(7))}function Lc(e){let t=ne(e.evidence.map(n=>n.strength));return t.length===1?t[0]:t.includes("exact")&&t.every(n=>n==="exact"||n==="derived")?"mixed":t.includes("candidate")?"candidate":t.includes("unknown")||t.length===0?"unknown":"mixed"}function Rn(e,t,n){let o=Tn(e,n),r=new Map,a=new Map,i=[...t].sort();for(let s of i)a.set(s,0);for(let s=0;s<i.length;s+=1){let l=i[s],d=a.get(l);for(let c of o.get(l)??[])r.set(c.edge.id,c.edge),!a.has(c.next)&&(a.set(c.next,d+1),i.push(c.next))}return[...r.values()]}function Tn(e,t){let n=new Map,o=(r,a,i)=>{let s=n.get(r)??[];s.push({edge:i,next:a}),n.set(r,s)};for(let r of e)t!=="incoming"&&o(r.from.id,r.to.id,r),t!=="outgoing"&&o(r.to.id,r.from.id,r);for(let r of n.values())r.sort((a,i)=>a.edge.id.localeCompare(i.edge.id)||a.next.localeCompare(i.next));return n}function Ic(e,t,n,o,r){let a=new Set;for(let c of[...n,...o,...r])a.add(`${c.family}\0${c.subtype}`);if(t.length>0)for(let c of e)for(let u of t)a.add(`${c}\0${u}`);let i=c=>{let u=new Map;for(let f of c){let m=`${f.family}\0${f.subtype}`;u.set(m,(u.get(m)??0)+1)}return u},s=i(n),l=i(o),d=i(r);return[...a].map(c=>{let[u,f]=c.split("\0");return{family:u,subtype:f,incoming:s.get(c)??0,outgoing:l.get(c)??0,both:d.get(c)??0}}).sort((c,u)=>Ce.indexOf(c.family)-Ce.indexOf(u.family)||c.subtype.localeCompare(u.subtype))}function wc(e,t){let n=e.slice(t),o=new Map;for(let i of n){let s=Nc(i),l=`${i.family}\0${s}`,d=o.get(l)??[];d.push(i),o.set(l,d)}let r=new Map(e.map((i,s)=>[i.id,s+1])),a=[];for(let[i,s]of[...o].sort(([l],[d])=>l.localeCompare(d))){let[l,d]=i.split("\0"),c=[...s].sort((u,f)=>u.id.localeCompare(f.id));for(let u=0;u<c.length;u+=qr){let f=c.slice(u,u+qr),m=f.map(C=>C.id),p=ne(f.map(C=>C.subtype)).sort(),g=p.length===1?p[0]:"mixed",b=[...new Set(f.flatMap(C=>[C.from.id,C.to.id]))].sort();a.push({id:Fc(l,p.join("\0"),m),mode:Rc(f),family:l,subtype:g,subtypes:p,region:d,edgeCount:m.length,edgeIds:m,nodeIds:b,minimumMaxEdges:Math.max(...m.map(C=>r.get(C)??e.length))})}}return a.sort((i,s)=>Ce.indexOf(i.family)-Ce.indexOf(s.family)||(i.region??"").localeCompare(s.region??"")||i.id.localeCompare(s.id))}function Nc(e){let t=e.from.location?.file??`kind:${e.from.kind}`,n=e.to.location?.file??`kind:${e.to.kind}`;return t===n?t:`${t} -> ${n}`}function Mc(e,t){if(t.length===0)return new Set;let n=new Map(e.map(r=>[r.id,r])),o=t.filter(r=>!n.has(r));if(o.length>0){let r=e.map(a=>a.id).sort();throw new Error(`Unknown evidence fold ${o.join(", ")} for this projection. Available folds: ${r.join(", ")||"(none)"}.`)}return new Set(t.flatMap(r=>n.get(r).edgeIds))}function Rc(e){let t=new Map,n=new Map,o=new Set;for(let a of e){o.add(a.from.id),o.add(a.to.id);let i=t.get(a.from.id)??new Set;i.add(a.to.id),t.set(a.from.id,i);let s=n.get(a.to.id)??new Set;s.add(a.from.id),n.set(a.to.id,s)}return Tc(o,t)?"scc":[...o].every(a=>(n.get(a)?.size??0)<=1&&(t.get(a)?.size??0)<=1)?"linear":"topology"}function Tc(e,t){let n=new Set,o=new Set,r=a=>{if(n.has(a))return!0;if(o.has(a))return!1;n.add(a);for(let i of t.get(a)??[])if(r(i))return!0;return n.delete(a),o.add(a),!1};return[...e].some(r)}function Fc(e,t,n){return`fold:${mc("sha256").update([e,t,...n].join("\0")).digest("hex").slice(0,16)}`}function Pc(e,t,n){let o=new Map,r=[...new Set(t)].sort();for(let a=0;a<r.length;a+=1)for(let i=a+1;i<r.length;i+=1)for(let s of Ac(e,r[a],r[i],n))o.set(s.id,s);return[...o.values()]}function Ac(e,t,n,o){let r=Tn(e,o),a=new Map([[t,0]]),i=new Map,s=[t];for(let d=0;d<s.length;d+=1){let c=s[d],u=a.get(c);if(c!==n)for(let f of r.get(c)??[])a.has(f.next)||(a.set(f.next,u+1),i.set(f.next,{node:c,edge:f.edge}),s.push(f.next))}if(!a.has(n))return[];let l=[];for(let d=n;d!==t;){let c=i.get(d);if(!c)return[];l.push(c.edge),d=c.node}return l.reverse()}function kc(e,t,n){let o=Tn(e,n),r=new Map,a=[...t];for(let i of t)r.set(i,0);for(let i=0;i<a.length;i+=1){let s=a[i],l=r.get(s);for(let{next:d}of o.get(s)??[])r.has(d)||(r.set(d,l+1),a.push(d))}return r}function $c(e,t,n){return Ur(e,n)-Ur(t,n)||Wr(e)-Wr(t)||Hr(e.evidenceStrength)-Hr(t.evidenceStrength)||Ce.indexOf(e.family)-Ce.indexOf(t.family)||e.from.label.localeCompare(t.from.label)||e.to.label.localeCompare(t.to.label)||e.subtype.localeCompare(t.subtype)||e.id.localeCompare(t.id)}function Ur(e,t){return Math.min(t.get(e.from.id)??Number.MAX_SAFE_INTEGER,t.get(e.to.id)??Number.MAX_SAFE_INTEGER)}function Wr(e){let t=[e.from,e.to].filter(n=>n.kind==="structural-region").length;return t===2?2:t}function Hr(e){switch(e){case"exact":return 0;case"mixed":return 1;case"derived":return 2;case"candidate":return 3;case"unknown":return 4}}export{ju as a};
21
- //# sourceMappingURL=chunk-D2MVJSP4.js.map
21
+ //# sourceMappingURL=chunk-3FHOF22C.js.map
@@ -1,2 +1,2 @@
1
- import{a as b,b as y}from"./chunk-FGNCOQUX.js";import{a as R,b as H,c as B,e as h,f as k}from"./chunk-B3X6KU75.js";import{a as p,b as g}from"./chunk-KMVGRIO2.js";import{P as v}from"./chunk-7JYHQAH2.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:o=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),t=b(l,r=>r.tokens);return y({profiles:l,limit:o,filePattern:d,focusFiles:f,candidateIndex:t,profile:{name:"react-hook-candidates"},compare:(r,a)=>C(r,a,m,i),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function C(e,s,m,i){let o=p(e.tokens,s.tokens);if(o.size<i||!E(o))return null;let c=H(e.tokens,s.tokens);if(c<m)return null;let n=h(o,"hook:"),d=h(o,"react-hook:"),f=h(o,"effect:"),l=h(o,"state:"),t=h(o,"request:"),r=h(o,"handler:"),a=h(o,"handler-verb:"),u=A({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:k(o),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){return R({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:S})}function S(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,o=0,c=0,n=0,d=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?m+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?c+=1:t.startsWith("state:")?n+=1:t.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+o+c+f;return B([{name:"requests",count:o},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
2
- //# sourceMappingURL=chunk-7XZGZBSQ.js.map
1
+ import{a as b,b as y}from"./chunk-2E7CX53V.js";import{a as R,b as H,c as B,e as h,f as k}from"./chunk-B3X6KU75.js";import{a as p,b as g}from"./chunk-KMVGRIO2.js";import{P as v}from"./chunk-ZOHS7AQV.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:o=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),t=b(l,r=>r.tokens);return y({profiles:l,limit:o,filePattern:d,focusFiles:f,candidateIndex:t,profile:{name:"react-hook-candidates"},compare:(r,a)=>C(r,a,m,i),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function C(e,s,m,i){let o=p(e.tokens,s.tokens);if(o.size<i||!E(o))return null;let c=H(e.tokens,s.tokens);if(c<m)return null;let n=h(o,"hook:"),d=h(o,"react-hook:"),f=h(o,"effect:"),l=h(o,"state:"),t=h(o,"request:"),r=h(o,"handler:"),a=h(o,"handler-verb:"),u=A({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:k(o),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){return R({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:S})}function S(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,o=0,c=0,n=0,d=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?m+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?c+=1:t.startsWith("state:")?n+=1:t.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+o+c+f;return B([{name:"requests",count:o},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
2
+ //# sourceMappingURL=chunk-3JKSW6LJ.js.map