scip-query 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (470) hide show
  1. package/CHANGELOG.md +500 -0
  2. package/README.md +13 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-H3P6BR5G.js +2 -0
  5. package/dist/call-graph-VTG2CUOQ.js +2 -0
  6. package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
  7. package/dist/chunk-2BMSSRBH.js +2 -0
  8. package/dist/{chunk-TAYD3AE7.js → chunk-2GJSD5GY.js} +2 -2
  9. package/dist/{chunk-TUQIPUDS.js → chunk-2M2LSIMY.js} +3 -3
  10. package/dist/{chunk-GIQ6CSL4.js → chunk-2N6WBNDC.js} +2 -2
  11. package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
  12. package/dist/{chunk-EELPBR7E.js → chunk-2USA3S3P.js} +2 -2
  13. package/dist/chunk-2VAHDDLM.js +133 -0
  14. package/dist/chunk-2XWIUW5Z.js +455 -0
  15. package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
  16. package/dist/chunk-3D4BOXW6.js +20 -0
  17. package/dist/{chunk-FFJQZG6J.js → chunk-3LO4FST5.js} +2 -2
  18. package/dist/{chunk-HXOU4XNH.js → chunk-3WTY4LP2.js} +2 -2
  19. package/dist/{chunk-DPWKKNKI.js → chunk-3Z5AMSK6.js} +2 -2
  20. package/dist/{chunk-F24G5NBE.js → chunk-44IETFOU.js} +2 -2
  21. package/dist/chunk-4FR6GQIT.js +2 -0
  22. package/dist/chunk-4KBTHJLP.js +2 -0
  23. package/dist/chunk-5BIKR67W.js +2 -0
  24. package/dist/{chunk-DJAO2OZJ.js → chunk-5PROPLHI.js} +2 -2
  25. package/dist/chunk-5V7EPTII.js +2 -0
  26. package/dist/{chunk-VZ7NXSHV.js → chunk-62LPZCBQ.js} +2 -2
  27. package/dist/{chunk-LXQUF2RP.js → chunk-64O2JHQA.js} +2 -2
  28. package/dist/chunk-6D4F5VWG.js +10 -0
  29. package/dist/{chunk-NEIQPFBI.js → chunk-6ERFBC3X.js} +2 -2
  30. package/dist/{chunk-4HE7MVWD.js → chunk-6ILKOOGH.js} +2 -2
  31. package/dist/chunk-6MFXCMZC.js +2 -0
  32. package/dist/chunk-6O7FACKB.js +2 -0
  33. package/dist/{chunk-R6M456QG.js → chunk-6TS3KOXR.js} +2 -2
  34. package/dist/{chunk-7U2YQSDE.js → chunk-76QOU4PK.js} +2 -2
  35. package/dist/{chunk-25GWKRUZ.js → chunk-7DUI77BN.js} +2 -2
  36. package/dist/chunk-7F45LJKI.js +2 -0
  37. package/dist/{chunk-DEAB5TGT.js → chunk-7F7T6DCR.js} +2 -2
  38. package/dist/chunk-7H6VHWWJ.js +2 -0
  39. package/dist/chunk-7HXT6YLU.js +5 -0
  40. package/dist/{chunk-KZYID5KV.js → chunk-7R4V5ES6.js} +4 -4
  41. package/dist/chunk-7RIRIADH.js +7 -0
  42. package/dist/chunk-7ZLWLOGT.js +2 -0
  43. package/dist/{chunk-WHADK6OS.js → chunk-A4WEAK35.js} +2 -2
  44. package/dist/chunk-AADQLOQ4.js +38 -0
  45. package/dist/{chunk-XFMVKFSF.js → chunk-AN76MGUE.js} +2 -2
  46. package/dist/chunk-ANLNLY66.js +2 -0
  47. package/dist/chunk-ATXPTSEI.js +81 -0
  48. package/dist/{chunk-EELG7D3Q.js → chunk-AX7IDVFT.js} +2 -2
  49. package/dist/chunk-B3PYOSCX.js +2 -0
  50. package/dist/chunk-B7MPDEAK.js +3 -0
  51. package/dist/chunk-BBB5FBX4.js +2 -0
  52. package/dist/{chunk-Y2VM4CJC.js → chunk-BHKK5RJY.js} +2 -2
  53. package/dist/chunk-BJWFVAA5.js +2 -0
  54. package/dist/chunk-BKVWUP7Y.js +2 -0
  55. package/dist/{chunk-7XA3OM44.js → chunk-BKZYTLGE.js} +2 -2
  56. package/dist/chunk-BL6DCHQP.js +2 -0
  57. package/dist/chunk-BOW7SSQH.js +43 -0
  58. package/dist/{chunk-KQHJEU6V.js → chunk-C4RHHCKL.js} +2 -2
  59. package/dist/chunk-C7C6AKAT.js +117 -0
  60. package/dist/chunk-CD6M6LS2.js +16 -0
  61. package/dist/chunk-CFE6PSG6.js +2 -0
  62. package/dist/{chunk-GPGRZJ3R.js → chunk-CFNIGQMT.js} +2 -2
  63. package/dist/{chunk-K3XFWJI2.js → chunk-CKBUBRYD.js} +2 -2
  64. package/dist/chunk-CZW5MZ5B.js +2 -0
  65. package/dist/chunk-DBBZ63ZX.js +2 -0
  66. package/dist/chunk-DBN7DMJB.js +18 -0
  67. package/dist/{chunk-CKRWA452.js → chunk-DUULLZHZ.js} +2 -2
  68. package/dist/{chunk-6HRZQLOI.js → chunk-DV5Y5NOS.js} +2 -2
  69. package/dist/chunk-DZOIKCTM.js +3 -0
  70. package/dist/chunk-E4PKTOL3.js +2 -0
  71. package/dist/{chunk-GVOMSPGL.js → chunk-E65ELFKU.js} +2 -2
  72. package/dist/{chunk-VXJJTQYE.js → chunk-E7QR35ST.js} +2 -2
  73. package/dist/{chunk-2RE5OCHZ.js → chunk-EFSXAINW.js} +2 -2
  74. package/dist/{chunk-GY7CCCEZ.js → chunk-EHVEIEQN.js} +2 -2
  75. package/dist/{chunk-BVFYEEBH.js → chunk-EHYDXE3Z.js} +2 -2
  76. package/dist/{chunk-HISEUIL2.js → chunk-EP63Y6LD.js} +2 -2
  77. package/dist/chunk-EPX6NQN6.js +4 -0
  78. package/dist/chunk-ETC674NS.js +5 -0
  79. package/dist/{chunk-5H5WTJSD.js → chunk-F5GSBHC6.js} +2 -2
  80. package/dist/chunk-FH3DGXC6.js +2 -0
  81. package/dist/{chunk-2XCGSDIT.js → chunk-FI7VGOR4.js} +2 -2
  82. package/dist/chunk-FJF6VO2P.js +2 -0
  83. package/dist/{chunk-FELGD32K.js → chunk-FLMTCX5R.js} +2 -2
  84. package/dist/chunk-FVFDOIM3.js +2 -0
  85. package/dist/{chunk-AQ2PORIO.js → chunk-G2HU5WRN.js} +2 -2
  86. package/dist/{chunk-7YQOCABQ.js → chunk-G4ALYS4J.js} +2 -2
  87. package/dist/{chunk-SWK4XPUS.js → chunk-G56I7K4W.js} +2 -2
  88. package/dist/{chunk-JFQBRL3J.js → chunk-GC4DG2V5.js} +2 -2
  89. package/dist/chunk-GG45PK4S.js +4 -0
  90. package/dist/{chunk-XN22RGSR.js → chunk-GHNPACNP.js} +2 -2
  91. package/dist/{chunk-XU75YQN4.js → chunk-GINH3YQU.js} +2 -2
  92. package/dist/chunk-GTZZVLKJ.js +2 -0
  93. package/dist/chunk-GXXW5ZHH.js +2 -0
  94. package/dist/{chunk-RNKPYYYE.js → chunk-HAXXKRTD.js} +2 -2
  95. package/dist/chunk-HEZWBAZY.js +2 -0
  96. package/dist/chunk-HMEWLMML.js +2 -0
  97. package/dist/{chunk-2KVU55CW.js → chunk-HOBOVYPO.js} +2 -2
  98. package/dist/{chunk-2YC7YNKT.js → chunk-HRFQ6GW5.js} +2 -2
  99. package/dist/{chunk-RYOYJMGF.js → chunk-HX4X7KG3.js} +2 -2
  100. package/dist/{chunk-AZS7YPCB.js → chunk-HYT2R7LX.js} +2 -2
  101. package/dist/chunk-IKQVBVQL.js +40 -0
  102. package/dist/chunk-J6GLBBRK.js +4 -0
  103. package/dist/{chunk-TNG2FYS5.js → chunk-J7A4PWFX.js} +2 -2
  104. package/dist/chunk-JCSAZ35V.js +2 -0
  105. package/dist/{chunk-EWWY2ZFL.js → chunk-JDU2IV3A.js} +2 -2
  106. package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
  107. package/dist/chunk-JFMI5SGB.js +4 -0
  108. package/dist/chunk-JJP37RGX.js +57 -0
  109. package/dist/chunk-JZ2A7LDM.js +5 -0
  110. package/dist/chunk-KNLQGXVH.js +80 -0
  111. package/dist/chunk-KVQCECPR.js +2 -0
  112. package/dist/{chunk-F24QUEQP.js → chunk-KXXORBZ2.js} +2 -2
  113. package/dist/{chunk-IKVNEGTW.js → chunk-L5KYH6U3.js} +2 -2
  114. package/dist/chunk-L6XHYJPZ.js +21 -0
  115. package/dist/chunk-L7KTFEAV.js +43 -0
  116. package/dist/{chunk-UAQ4T73O.js → chunk-LDXHR5EL.js} +2 -2
  117. package/dist/chunk-LEECKFCJ.js +2 -0
  118. package/dist/{chunk-LO5JSW2C.js → chunk-MHGDSBFX.js} +2 -2
  119. package/dist/{chunk-JUN5DOAK.js → chunk-MLQVVDG3.js} +2 -2
  120. package/dist/chunk-MOKUWRHO.js +3 -0
  121. package/dist/{chunk-44T4DUAA.js → chunk-MPYAPMNE.js} +2 -2
  122. package/dist/{chunk-ARVO6TTW.js → chunk-MV6SPXCR.js} +2 -2
  123. package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
  124. package/dist/{chunk-TH6IC56G.js → chunk-MZPXPSUJ.js} +2 -2
  125. package/dist/{chunk-FBCVASUG.js → chunk-N55KIE46.js} +2 -2
  126. package/dist/{chunk-VMWUV6WB.js → chunk-NB4D3BNM.js} +2 -2
  127. package/dist/{chunk-JAT6C3VX.js → chunk-NGKBOT6G.js} +2 -2
  128. package/dist/{chunk-Q6T2CAJL.js → chunk-NJGKXKQF.js} +2 -2
  129. package/dist/chunk-NJQISBL4.js +8 -0
  130. package/dist/chunk-NJT3ZEKY.js +16 -0
  131. package/dist/{chunk-KFVSJX25.js → chunk-NKMKZP6A.js} +2 -2
  132. package/dist/chunk-NODFZ6ED.js +2 -0
  133. package/dist/{chunk-ERCYGVAM.js → chunk-NSM5IEVW.js} +2 -2
  134. package/dist/{chunk-YAGYMBEX.js → chunk-NTGUVNR2.js} +2 -2
  135. package/dist/{chunk-N7FP5H5U.js → chunk-NU3KFF2O.js} +8 -8
  136. package/dist/chunk-NWLVNU66.js +557 -0
  137. package/dist/{chunk-Q55NF3ZG.js → chunk-NYKZMCRC.js} +2 -2
  138. package/dist/{chunk-I6UTXNHU.js → chunk-O6BUXZEH.js} +2 -2
  139. package/dist/chunk-ODPDP7A4.js +3 -0
  140. package/dist/{chunk-ZAZGGSM3.js → chunk-OHIV323X.js} +2 -2
  141. package/dist/chunk-OIAPEKMT.js +3 -0
  142. package/dist/chunk-OIOC5EHF.js +3 -0
  143. package/dist/{chunk-YIHNPKWD.js → chunk-ONPPQM4G.js} +2 -2
  144. package/dist/{chunk-RHHCLWQ6.js → chunk-OUHEZBYI.js} +2 -2
  145. package/dist/{chunk-MSR2QRUE.js → chunk-OVGYW7UD.js} +2 -2
  146. package/dist/{chunk-OPSAW5DT.js → chunk-OYKU4B3Y.js} +2 -2
  147. package/dist/{chunk-5YRQIE2B.js → chunk-POBJ6FR2.js} +2 -2
  148. package/dist/{chunk-ZGW4HLPD.js → chunk-PSZPMMWN.js} +2 -2
  149. package/dist/chunk-PXTRBKRK.js +3 -0
  150. package/dist/{chunk-U2N2KE7A.js → chunk-Q5JRIHT3.js} +2 -2
  151. package/dist/{chunk-GRX7JOXQ.js → chunk-Q7ATHARX.js} +2 -2
  152. package/dist/{chunk-5ZMBRQFC.js → chunk-Q7CSKIDM.js} +2 -2
  153. package/dist/{chunk-HG722PO7.js → chunk-QBQE7ZJ5.js} +2 -2
  154. package/dist/{chunk-Z2PZVKPR.js → chunk-QH22UIXP.js} +2 -2
  155. package/dist/chunk-QXCKQTKR.js +60 -0
  156. package/dist/chunk-RBAD4GJ2.js +13 -0
  157. package/dist/chunk-RMDPFPNW.js +2 -0
  158. package/dist/chunk-ROPJDEJZ.js +4 -0
  159. package/dist/{chunk-56NQAEPJ.js → chunk-RVZC6TJE.js} +2 -2
  160. package/dist/{chunk-XJX6LGHL.js → chunk-S4QZBKSR.js} +2 -2
  161. package/dist/chunk-SCPMZ73U.js +2 -0
  162. package/dist/{chunk-7IQXARSQ.js → chunk-SIAP5RGI.js} +2 -2
  163. package/dist/{chunk-4TQU4TX2.js → chunk-SIX4RFR3.js} +2 -2
  164. package/dist/{chunk-AYPDH2LU.js → chunk-SKKXTABJ.js} +2 -2
  165. package/dist/{chunk-ZYM4HOFA.js → chunk-SSRFUQBD.js} +2 -2
  166. package/dist/chunk-SYVJEEUJ.js +3 -0
  167. package/dist/chunk-T3CZAZSI.js +8 -0
  168. package/dist/chunk-T3I6NHBH.js +2 -0
  169. package/dist/{chunk-GDRJB3SB.js → chunk-T6DWDI5E.js} +2 -2
  170. package/dist/chunk-T6HRIROJ.js +7 -0
  171. package/dist/{chunk-OTSPRVNW.js → chunk-TAA7HXHE.js} +2 -2
  172. package/dist/{chunk-IJMD6BRI.js → chunk-TJ2JQYT3.js} +2 -2
  173. package/dist/chunk-TULNMD5T.js +368 -0
  174. package/dist/chunk-U2FPY5XA.js +3 -0
  175. package/dist/chunk-U3SXIMII.js +38 -0
  176. package/dist/{chunk-ENWQWA2R.js → chunk-U6KCHXJ4.js} +2 -2
  177. package/dist/chunk-UH3XSKS5.js +9 -0
  178. package/dist/{chunk-UDY7MIAW.js → chunk-UIFUZVCC.js} +2 -2
  179. package/dist/{chunk-BDGTPN27.js → chunk-UXKURIVI.js} +2 -2
  180. package/dist/{chunk-FGNCOQUX.js → chunk-V2RBODHL.js} +2 -2
  181. package/dist/chunk-VBKUWB6N.js +2 -0
  182. package/dist/{chunk-PIFTZEEM.js → chunk-VBV6ALJE.js} +2 -2
  183. package/dist/{chunk-2OXVP5U5.js → chunk-VDGFWCQV.js} +2 -2
  184. package/dist/chunk-VDSDOEWF.js +2 -0
  185. package/dist/{chunk-C76O5MDS.js → chunk-VZPWVCLN.js} +2 -2
  186. package/dist/chunk-WDSFQDPN.js +2 -0
  187. package/dist/{chunk-BTVKZGWT.js → chunk-WFA35BGR.js} +2 -2
  188. package/dist/{chunk-H7CG6LOE.js → chunk-WLMP3OCW.js} +2 -2
  189. package/dist/{chunk-WOOAY3PA.js → chunk-WSA52GOR.js} +2 -2
  190. package/dist/chunk-WYPL7GF7.js +2 -0
  191. package/dist/{chunk-RDULNRSJ.js → chunk-X3YVZAKZ.js} +2 -2
  192. package/dist/chunk-X6OGVFIT.js +2 -0
  193. package/dist/{chunk-ISWFRGJ6.js → chunk-XKXTR6ZI.js} +2 -2
  194. package/dist/chunk-Y5DFAW5W.js +4 -0
  195. package/dist/chunk-YSYPDRD5.js +3 -0
  196. package/dist/chunk-ZFVPWH62.js +5 -0
  197. package/dist/chunk-ZGIHTH27.js +2 -0
  198. package/dist/{chunk-QKT4UI2Y.js → chunk-ZGIQN2SX.js} +2 -2
  199. package/dist/chunk-ZHG4WAHR.js +12 -0
  200. package/dist/{chunk-CLG6DWVS.js → chunk-ZKB2XUEN.js} +2 -2
  201. package/dist/chunk-ZLMXIQLC.js +21 -0
  202. package/dist/chunk-ZMCQIHI4.js +2 -0
  203. package/dist/cli-main.js +2 -2
  204. package/dist/code-TAVIKWJI.js +2 -0
  205. package/dist/code-result-json-5FEFQCAQ.js +2 -0
  206. package/dist/command-descriptors-7BKH53Y3.js +343 -0
  207. package/dist/dataflow-GFBTVDH3.js +2 -0
  208. package/dist/dependence-slice-GWGQCODG.js +2 -0
  209. package/dist/deps-4QHVDPYA.js +2 -0
  210. package/dist/direct-navigation-4UBC6HNW.js +3 -0
  211. package/dist/entry-map-QCTF4RVY.js +2 -0
  212. package/dist/files-M2UBF5HJ.js +2 -0
  213. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  214. package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
  215. package/dist/hierarchy-2UIHRLW4.js +2 -0
  216. package/dist/imports-WIE3YZOB.js +2 -0
  217. package/dist/index.d.ts +1 -1
  218. package/dist/index.js +1 -1
  219. package/dist/members-YKD636DA.js +2 -0
  220. package/dist/methods-VDF4IMYG.js +2 -0
  221. package/dist/output-continuation-command-4UMDOOLO.js +3 -0
  222. package/dist/output-pagination-2GME6OPY.js +19 -0
  223. package/dist/postinstall.js +1 -1
  224. package/dist/project-reindex-XEQTRCV5.js +3 -0
  225. package/dist/queries/affected.js +1 -1
  226. package/dist/queries/anchors.d.ts +1 -1
  227. package/dist/queries/anchors.js +1 -1
  228. package/dist/queries/architecture.js +1 -1
  229. package/dist/queries/bottlenecks.js +1 -1
  230. package/dist/queries/by-kind.js +1 -1
  231. package/dist/queries/call-graph.d.ts +2 -0
  232. package/dist/queries/call-graph.js +1 -1
  233. package/dist/queries/change-surface.js +1 -1
  234. package/dist/queries/cleanup-plan.js +1 -1
  235. package/dist/queries/co-change.d.ts +20 -2
  236. package/dist/queries/co-change.js +1 -1
  237. package/dist/queries/code.js +1 -1
  238. package/dist/queries/complexity-hotspots.js +1 -1
  239. package/dist/queries/complexity.js +1 -1
  240. package/dist/queries/context.js +1 -1
  241. package/dist/queries/convergence.js +1 -1
  242. package/dist/queries/coupling.js +1 -1
  243. package/dist/queries/cycles.js +1 -1
  244. package/dist/queries/dataflow.js +1 -1
  245. package/dist/queries/dead.d.ts +2 -0
  246. package/dist/queries/dead.js +1 -1
  247. package/dist/queries/decorative-checkers.js +1 -1
  248. package/dist/queries/deep-chains.js +1 -1
  249. package/dist/queries/dependence-slice.js +1 -1
  250. package/dist/queries/dependency-depth.js +1 -1
  251. package/dist/queries/deps.js +1 -1
  252. package/dist/queries/diff-impact.d.ts +9 -0
  253. package/dist/queries/diff-impact.js +1 -1
  254. package/dist/queries/doc-drift.js +1 -1
  255. package/dist/queries/drift.js +1 -1
  256. package/dist/queries/duplicate-bodies.d.ts +28 -1
  257. package/dist/queries/duplicate-bodies.js +1 -1
  258. package/dist/queries/entry-map.d.ts +1 -1
  259. package/dist/queries/entry-map.js +1 -1
  260. package/dist/queries/evidence.js +1 -1
  261. package/dist/queries/extract-candidates.d.ts +50 -23
  262. package/dist/queries/extract-candidates.js +1 -1
  263. package/dist/queries/fan.js +1 -1
  264. package/dist/queries/files.js +1 -1
  265. package/dist/queries/health.d.ts +1 -1
  266. package/dist/queries/health.js +1 -1
  267. package/dist/queries/hierarchy.js +1 -1
  268. package/dist/queries/hotspots.js +1 -1
  269. package/dist/queries/imports.js +1 -1
  270. package/dist/queries/incomplete-migration.js +1 -1
  271. package/dist/queries/index.d.ts +4 -3
  272. package/dist/queries/index.js +1 -1
  273. package/dist/queries/isolated.js +1 -1
  274. package/dist/queries/locality-candidates.js +1 -1
  275. package/dist/queries/members.js +1 -1
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.js +1 -1
  278. package/dist/queries/outline.js +1 -1
  279. package/dist/queries/passthrough-candidates.d.ts +9 -1
  280. package/dist/queries/passthrough-candidates.js +1 -1
  281. package/dist/queries/plan-context.js +1 -1
  282. package/dist/queries/react-component-duplicates.d.ts +19 -3
  283. package/dist/queries/react-component-duplicates.js +1 -1
  284. package/dist/queries/react-hook-candidates.d.ts +22 -3
  285. package/dist/queries/react-hook-candidates.js +1 -1
  286. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  287. package/dist/queries/react-large-component-pressure.js +1 -1
  288. package/dist/queries/recent-duplicates.js +1 -1
  289. package/dist/queries/redundant-reexports.js +1 -1
  290. package/dist/queries/reference-neighborhood.js +1 -1
  291. package/dist/queries/reference-reachability.js +1 -1
  292. package/dist/queries/refs.js +1 -1
  293. package/dist/queries/self-audit.d.ts +7 -1
  294. package/dist/queries/self-audit.js +1 -1
  295. package/dist/queries/similar-chains.js +1 -1
  296. package/dist/queries/similar-files.js +1 -1
  297. package/dist/queries/similar-signatures.js +1 -1
  298. package/dist/queries/similar.js +1 -1
  299. package/dist/queries/slice.js +1 -1
  300. package/dist/queries/source-inspection.js +1 -1
  301. package/dist/queries/source-search.js +1 -1
  302. package/dist/queries/stale-abstractions.js +1 -1
  303. package/dist/queries/surface.js +1 -1
  304. package/dist/queries/symbols.js +1 -1
  305. package/dist/queries/system-map.d.ts +1 -1
  306. package/dist/queries/system-map.js +1 -1
  307. package/dist/queries/system.js +1 -1
  308. package/dist/queries/test-quality.js +1 -1
  309. package/dist/queries/trace.js +1 -1
  310. package/dist/queries/twin-ab.js +1 -1
  311. package/dist/queries/twin-drift.d.ts +22 -6
  312. package/dist/queries/twin-drift.js +1 -1
  313. package/dist/queries/unused-imports.js +1 -1
  314. package/dist/queries/unused-params.js +1 -1
  315. package/dist/queries/value-flow.js +1 -1
  316. package/dist/queries/vue-component-duplicates.js +1 -1
  317. package/dist/queries/vue-composable-candidates.js +1 -1
  318. package/dist/queries/vue-large-view-pressure.js +1 -1
  319. package/dist/queries/wrapper-candidates.d.ts +16 -1
  320. package/dist/queries/wrapper-candidates.js +1 -1
  321. package/dist/query-service-fastpath.js +5 -5
  322. package/dist/query-service-server.js +3 -3
  323. package/dist/refs-JNK5CLM7.js +2 -0
  324. package/dist/refs-pagination-6BLRYGMV.js +2 -0
  325. package/dist/reindex-worker.js +25 -25
  326. package/dist/reindex.d.ts +3 -2
  327. package/dist/reindex.js +35 -35
  328. package/dist/runtime.d.ts +34 -2
  329. package/dist/runtime.js +4 -4
  330. package/dist/rust-semantic-session-server.js +1 -1
  331. package/dist/rust-semantic-session-worker.js +1 -1
  332. package/dist/rust-semantic-worker.js +1 -1
  333. package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
  334. package/dist/slice-PHPVNCWX.js +2 -0
  335. package/dist/surface-MQX5MPIV.js +2 -0
  336. package/dist/symbol-resolution-DBLVXLBC.js +2 -0
  337. package/dist/system-JOPKV4OG.js +2 -0
  338. package/dist/trace-I2P2YFH4.js +2 -0
  339. package/dist/typescript-mailbox-worker.js +1 -1
  340. package/dist/value-flow-JJVMF7NP.js +2 -0
  341. package/dist/watch-server.js +3 -3
  342. package/docs/COMMAND_REFERENCE.md +2 -2
  343. package/docs/DETECTOR_GUIDE.md +51 -12
  344. package/docs/accuracy-audit-checklist.md +36 -13
  345. package/docs/locality-analyzer-design.md +9 -9
  346. package/package.json +2 -2
  347. package/skills/conductor/SKILL.md +110 -0
  348. package/skills/conductor/agents/openai.yaml +4 -0
  349. package/skills/principal-maintainability-review/SKILL.md +273 -0
  350. package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
  351. package/skills/scip-calibrate/SKILL.md +102 -0
  352. package/skills/scip-calibrate/agents/openai.yaml +4 -0
  353. package/skills/scip-claim-audit/SKILL.md +113 -0
  354. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  355. package/skills/scip-probe-reachability/SKILL.md +93 -0
  356. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  357. package/skills/scip-root-cause/SKILL.md +160 -0
  358. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  359. package/skills/scip-system-compression/SKILL.md +252 -0
  360. package/skills/scip-system-compression/agents/openai.yaml +4 -0
  361. package/skills/scip-system-compression/references/compression-atlas.md +116 -0
  362. package/skills/scip-system-compression/references/compression-patterns.md +87 -0
  363. package/skills/scip-twin-drift/SKILL.md +109 -0
  364. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  365. package/dist/by-kind-4IYG2SKW.js +0 -2
  366. package/dist/call-graph-WQNXMNNN.js +0 -2
  367. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  368. package/dist/chunk-2BTJALUS.js +0 -454
  369. package/dist/chunk-3QXC54FQ.js +0 -3
  370. package/dist/chunk-3TJY6M3B.js +0 -7
  371. package/dist/chunk-42W3LFUK.js +0 -13
  372. package/dist/chunk-4GAQ6FI4.js +0 -43
  373. package/dist/chunk-6NC3YSPY.js +0 -38
  374. package/dist/chunk-6VEFRPTD.js +0 -5
  375. package/dist/chunk-7C26EKLZ.js +0 -4
  376. package/dist/chunk-7JYHQAH2.js +0 -22
  377. package/dist/chunk-7KSO2OAP.js +0 -2
  378. package/dist/chunk-7XZGZBSQ.js +0 -2
  379. package/dist/chunk-A77SCPW2.js +0 -3
  380. package/dist/chunk-AK3PYTIK.js +0 -5
  381. package/dist/chunk-AMIMMNA4.js +0 -11
  382. package/dist/chunk-AUY5BL74.js +0 -2
  383. package/dist/chunk-BDHFVH2M.js +0 -18
  384. package/dist/chunk-BECZLYNU.js +0 -8
  385. package/dist/chunk-BUTEIZKP.js +0 -10
  386. package/dist/chunk-BWVQP3LB.js +0 -38
  387. package/dist/chunk-BYDAFMSR.js +0 -57
  388. package/dist/chunk-BZYSGZRK.js +0 -2
  389. package/dist/chunk-C7IJMOFP.js +0 -134
  390. package/dist/chunk-CBBHFNLX.js +0 -2
  391. package/dist/chunk-D2MVJSP4.js +0 -21
  392. package/dist/chunk-D35XIZGN.js +0 -2
  393. package/dist/chunk-DKM723YF.js +0 -79
  394. package/dist/chunk-DRENNWRG.js +0 -2
  395. package/dist/chunk-E44IVWIJ.js +0 -367
  396. package/dist/chunk-EDMB6SSO.js +0 -7
  397. package/dist/chunk-EETGXQY7.js +0 -3
  398. package/dist/chunk-FKGQOTKD.js +0 -2
  399. package/dist/chunk-GH5YSGZL.js +0 -5
  400. package/dist/chunk-GQIDEID3.js +0 -2
  401. package/dist/chunk-HCVJR2V4.js +0 -3
  402. package/dist/chunk-IMKZEXZG.js +0 -2
  403. package/dist/chunk-ISIQLPJ2.js +0 -61
  404. package/dist/chunk-IXESDH3J.js +0 -2
  405. package/dist/chunk-JJ62MTQH.js +0 -40
  406. package/dist/chunk-JT6XX7QY.js +0 -8
  407. package/dist/chunk-KFOYCQAJ.js +0 -9
  408. package/dist/chunk-LRI5OMPE.js +0 -2
  409. package/dist/chunk-MHIEP7EG.js +0 -4
  410. package/dist/chunk-NK3JMP22.js +0 -2
  411. package/dist/chunk-NVSZNESQ.js +0 -2
  412. package/dist/chunk-OJNK5ALA.js +0 -2
  413. package/dist/chunk-OXYAWIEA.js +0 -2
  414. package/dist/chunk-OZETODHH.js +0 -2
  415. package/dist/chunk-PBUH2P5S.js +0 -3
  416. package/dist/chunk-PLJUQFQN.js +0 -2
  417. package/dist/chunk-PLYUVM4F.js +0 -2
  418. package/dist/chunk-PXXYQK55.js +0 -2
  419. package/dist/chunk-Q5TA4OY4.js +0 -20
  420. package/dist/chunk-Q7GBK5T7.js +0 -81
  421. package/dist/chunk-QLBSG7U5.js +0 -3
  422. package/dist/chunk-QWKHW6VZ.js +0 -2
  423. package/dist/chunk-RPL3ARU7.js +0 -16
  424. package/dist/chunk-SVHTMVA4.js +0 -4
  425. package/dist/chunk-T6QD2ZQB.js +0 -43
  426. package/dist/chunk-TD7VKJ2Y.js +0 -117
  427. package/dist/chunk-TKDNDQA7.js +0 -3
  428. package/dist/chunk-TQZV7KV4.js +0 -2
  429. package/dist/chunk-TUSPIVZ3.js +0 -4
  430. package/dist/chunk-URSGGIZX.js +0 -2
  431. package/dist/chunk-UT7TADJX.js +0 -2
  432. package/dist/chunk-V4NG5OMS.js +0 -554
  433. package/dist/chunk-VTCIYFEK.js +0 -2
  434. package/dist/chunk-VU6LIWHT.js +0 -2
  435. package/dist/chunk-VUSKPCUB.js +0 -2
  436. package/dist/chunk-WN3TCGJ4.js +0 -2
  437. package/dist/chunk-WSLEJSFR.js +0 -2
  438. package/dist/chunk-WYZIHUPZ.js +0 -16
  439. package/dist/chunk-XE33FV5W.js +0 -2
  440. package/dist/chunk-XGGBK66W.js +0 -4
  441. package/dist/chunk-XSWYJCAK.js +0 -2
  442. package/dist/chunk-Y334QQU5.js +0 -3
  443. package/dist/chunk-Z2AWCTN6.js +0 -2
  444. package/dist/chunk-ZOXKSQQB.js +0 -2
  445. package/dist/chunk-ZPASRBLF.js +0 -2
  446. package/dist/chunk-ZZ3Z7D56.js +0 -2
  447. package/dist/code-EQJFDT6I.js +0 -2
  448. package/dist/code-result-json-7UWIWBOO.js +0 -2
  449. package/dist/command-descriptors-ORNTVNYV.js +0 -342
  450. package/dist/dataflow-6VL54GX5.js +0 -2
  451. package/dist/dependence-slice-DT2NUHD2.js +0 -2
  452. package/dist/deps-DB7H5IKC.js +0 -2
  453. package/dist/direct-navigation-O3LUAYWQ.js +0 -3
  454. package/dist/entry-map-6K62RV3D.js +0 -2
  455. package/dist/files-MSLD7MO6.js +0 -2
  456. package/dist/hierarchy-IVBXAKFA.js +0 -2
  457. package/dist/imports-FRAVZ3Y2.js +0 -2
  458. package/dist/members-KJOJDYGO.js +0 -2
  459. package/dist/methods-2AYABBT3.js +0 -2
  460. package/dist/output-continuation-command-JHMPH6NC.js +0 -3
  461. package/dist/output-pagination-3OFL2MJV.js +0 -19
  462. package/dist/project-reindex-HYO4WD7Z.js +0 -3
  463. package/dist/refs-ARMA6XUJ.js +0 -2
  464. package/dist/refs-pagination-VUGIWN6U.js +0 -2
  465. package/dist/slice-YOB5YFAM.js +0 -2
  466. package/dist/surface-VY5EFWTW.js +0 -2
  467. package/dist/symbol-resolution-DGQN4XIV.js +0 -2
  468. package/dist/system-2KQ3QD2P.js +0 -2
  469. package/dist/trace-HTIPTXAE.js +0 -2
  470. package/dist/value-flow-5FV3VQI7.js +0 -2
@@ -0,0 +1,16 @@
1
+ import{a as un,b as pn}from"./chunk-PXTRBKRK.js";import{a as se}from"./chunk-3TNRNKAT.js";import{a as ht,b as xt}from"./chunk-WSA52GOR.js";import{a as cn}from"./chunk-2GJSD5GY.js";import{b as dn}from"./chunk-7R4V5ES6.js";import{a as ln,b as St}from"./chunk-7H6VHWWJ.js";import{b as rn,c as sn,d as an}from"./chunk-Y5DFAW5W.js";import{a as bt,b as en,c as tn,d as nn,i as on}from"./chunk-NU3KFF2O.js";import{a as Zt}from"./chunk-GC4DG2V5.js";import{d as $e}from"./chunk-BOJ5SVE2.js";import{c as Xt}from"./chunk-2BMSSRBH.js";import{b as Vt,d as Qt}from"./chunk-U3SXIMII.js";import{t as Yt,u as Jt}from"./chunk-J6GLBBRK.js";import{a as gt}from"./chunk-SKKXTABJ.js";import{b as yt}from"./chunk-F5GSBHC6.js";import{g as Ht,i as Wt}from"./chunk-NJQISBL4.js";import{b as We}from"./chunk-FLMTCX5R.js";import{C as Me,d as V,k as Y,v as fe}from"./chunk-C7C6AKAT.js";import{A as Gt,n as ce,y as ft}from"./chunk-RBAD4GJ2.js";import{E as he,K as He,a as qt,b as Ut}from"./chunk-ZLMXIQLC.js";import{h as zt,k as mt}from"./chunk-ETC674NS.js";import{c as jt}from"./chunk-KNLQGXVH.js";import{d as pt}from"./chunk-JZ2A7LDM.js";function Ne(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 mn(e,t){return Ne(e.origins)-Ne(t.origins)||e.depth-t.depth||e.startLine-t.startLine||e.shortName.localeCompare(t.shortName)}var fn=["call","contract-symbol","import","reference","runtime-boundary"],Mo={call:[{family:"control",subtype:"call"}],"contract-symbol":[{family:"contract",subtype:"uses-contract-symbol"}],import:[{family:"identity",subtype:"imports"}],reference:[{family:"identity",subtype:"references"}]},No={"structural-membership":[{family:"identity",subtype:"contains"}],"boundary-observation":[{family:"identity",subtype:"owns-runtime-observation"}],"external-import":[{family:"identity",subtype:"imports-external"}]};function gn(e){if(e.kind!=="runtime-boundary")return yn(Mo[e.kind]);let t=e.fromBoundaryParticipant?.protocol??e.toBoundaryParticipant?.protocol,n={crossesRuntimeBoundary:!0,...t?{protocol:t}:{},...e.runtimeBoundaryKey?{runtimeKey:e.runtimeBoundaryKey}:{}},o=[{family:"control",subtype:"runtime-handoff",context:n}];return e.evidence==="runtime-boundary:carrier.discriminator"&&(o.push({family:"control",subtype:"discriminator-dispatch",context:{...n},attributes:{joinRule:"carrier.discriminator",...e.fromBoundaryParticipant?.action?{producerAction:e.fromBoundaryParticipant.action}:{},...e.toBoundaryParticipant?.action?{consumerAction:e.toBoundaryParticipant.action}:{}}}),o.push({family:"data",subtype:"serialized-discriminator-transfer",context:{...n},attributes:{joinRule:"carrier.discriminator"}})),e.evidence==="runtime-boundary:queue.address"&&e.fromBoundaryParticipant?.action==="queue.send"&&e.toBoundaryParticipant?.action==="queue.consume"&&o.push({family:"temporal",subtype:"enqueue-before-consume",context:{...n},attributes:{producerAction:e.fromBoundaryParticipant.action,consumerAction:e.toBoundaryParticipant.action,retryPolicy:"unknown"}}),o}function Ve(e){return yn(No[e])}function yn(e){return e.map(t=>({...t,...t.context?{context:{...t.context}}:{},...t.attributes?{attributes:{...t.attributes}}:{}}))}import{join as er}from"path";import{createRequire as Ro}from"module";import{resolve as De}from"path";var Fo=Ro(import.meta.url),Ae;function Sn(e,t,n){let o=To();if(!o)return vt("The TypeScript compiler runtime is unavailable.");let i=Po(o,e,t),s=i.getSourceFile(De(t))??i.getSourceFile(t);if(!s)return vt(`The TypeScript compiler did not materialize ${t}.`);let r={ts:o,sourceFile:s,checker:i.getTypeChecker(),points:new Map,edges:new Map,unsupported:new Set,nextCfgId:0},a=$o(o,s,n);if(a.length===0)return vt("No function-like construct intersects the selected source range.");let d=new Map(a.map(u=>[u,Ao(s,u)])),c=a.map(u=>Bo(r,u,Do(o,u,d),d.get(u)));for(let u of c)Oo(r,u),qo(r,u),Go(r,u);Wo(r,c);let l=[...r.unsupported].sort();return{points:[...r.points.values()].map(({node:u,...f})=>f).sort(Zo),edges:[...r.edges.values()].sort((u,f)=>u.id.localeCompare(f.id)),coverage:{status:l.length===0?"complete":"partial",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:l}}}function To(){if(Ae!==void 0)return Ae;try{Ae=Fo("typescript")}catch{Ae=Jt()?.ts??null}return Ae}function Po(e,t,n){let o=De(n),i={target:e.ScriptTarget.ESNext,module:e.ModuleKind.NodeNext,moduleResolution:e.ModuleResolutionKind.NodeNext,skipLibCheck:!0,noResolve:!0},s=e.createSourceFile(o,t,i.target,!0,ko(e,o)),r=e.createCompilerHost(i,!0),a=r.getSourceFile.bind(r),d=r.readFile.bind(r),c=r.fileExists.bind(r);return r.getSourceFile=(l,u,f,m)=>De(l)===o?s:a(l,u,f,m),r.readFile=l=>De(l)===o?t:d(l),r.fileExists=l=>De(l)===o||c(l),e.createProgram([o],i,r)}function ko(e,t){return/\.tsx$/iu.test(t)?e.ScriptKind.TSX:/\.[cm]?js$/iu.test(t)?e.ScriptKind.JS:/\.jsx$/iu.test(t)?e.ScriptKind.JSX:e.ScriptKind.TS}function $o(e,t,n){let o=[],i=s=>{if(hn(e,s)){let r=t.getLineAndCharacterOfPosition(s.getStart(t)).line,a=t.getLineAndCharacterOfPosition(s.getEnd()).line;(!n||r<=n.endLine&&a>=n.startLine)&&o.push(s)}s.forEachChild(i)};return t.forEachChild(i),o.sort((s,r)=>s.getStart(t)-r.getStart(t))}function hn(e,t){return e.isFunctionLike(t)&&"body"in t&&t.body!==void 0}function Ao(e,t){return`callable:${encodeURIComponent(e.fileName)}:${t.getStart(e)}:${t.getEnd()}`}function Do(e,t,n){for(let o=t.parent;o;o=o.parent)if(hn(e,o)&&n.has(o))return n.get(o);return null}function Bo(e,t,n,o){let i=new Map,s=G(e,i,"exit",null),r=t.body,a=s.id;if(r&&e.ts.isBlock(r))a=Et(e,i,[...r.statements],s.id,{breakTarget:null,continueTarget:null});else if(r){let c=G(e,i,"statement",r);j(i,c.id,s.id),a=c.id}let d=G(e,i,"entry",t);return j(i,d.id,a),{id:o,node:t,parentId:n,cfg:i,entryId:d.id,exitId:s.id}}function Et(e,t,n,o,i){let s=o;for(let r=n.length-1;r>=0;r-=1)s=xe(e,t,n[r],s,i);return s}function xe(e,t,n,o,i){let s=e.ts;if(s.isBlock(n))return Et(e,t,[...n.statements],o,i);if(s.isIfStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.thenStatement,o,i),c=n.elseStatement?xe(e,t,n.elseStatement,o,i):o;return j(t,a.id,d),j(t,a.id,c),a.id}if(s.isWhileStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),a.id}if(s.isDoStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),d}if(s.isForStatement(n)){let a=G(e,t,"predicate",n.condition??n),d=n.incrementor?G(e,t,"statement",n.incrementor):null;d&&j(t,d.id,a.id);let c=d?.id??a.id,l=xe(e,t,n.statement,c,{breakTarget:o,continueTarget:c});if(j(t,a.id,l),n.condition&&j(t,a.id,o),!n.initializer)return a.id;let u=G(e,t,"statement",n.initializer);return j(t,u.id,a.id),u.id}if(s.isForInStatement(n)||s.isForOfStatement(n)){e.unsupported.add("for-in/for-of iterator assignment is conservatively represented without iterable element flow.");let a=G(e,t,"predicate",n.expression),d=G(e,t,"statement",n.initializer),c=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d.id),j(t,a.id,o),j(t,d.id,c),a.id}if(s.isSwitchStatement(n)){e.unsupported.add("switch fallthrough is represented conservatively; discriminant-to-case value refinement is unsupported.");let a=G(e,t,"predicate",n.expression),d=o,c=[];for(let l=n.caseBlock.clauses.length-1;l>=0;l-=1){let u=n.caseBlock.clauses[l];d=Et(e,t,[...u.statements],d,{...i,breakTarget:o}),c.push(d)}for(let l of c)j(t,a.id,l);return j(t,a.id,o),a.id}if(s.isReturnStatement(n)||s.isThrowStatement(n)){let a=G(e,t,"statement",n),d=[...t.values()].find(c=>c.kind==="exit");return j(t,a.id,d.id),a.id}if(s.isBreakStatement(n)){let a=G(e,t,"statement",n);return i.breakTarget||e.unsupported.add("A break statement could not be attached to a structured target."),j(t,a.id,i.breakTarget??o),a.id}if(s.isContinueStatement(n)){let a=G(e,t,"statement",n);return i.continueTarget||e.unsupported.add("A continue statement could not be attached to a structured target."),j(t,a.id,i.continueTarget??o),a.id}if(s.isTryStatement(n)){e.unsupported.add("Exceptional control-flow and finally completion are not included in the local compiler CFG.");let a=G(e,t,"statement",n);return a.invalidatesAllDefinitions=!0,j(t,a.id,o),a.id}let r=G(e,t,"statement",n);return j(t,r.id,o),r.id}function G(e,t,n,o){let i={id:`cfg:${e.nextCfgId++}`,kind:n,ast:o,successors:new Set,predecessors:new Set,definitions:[],uses:[],displayPoint:null,invalidatesAllDefinitions:!1};return t.set(i.id,i),i}function j(e,t,n){e.get(t).successors.add(n),e.get(n).predecessors.add(t)}function Oo(e,t){let n=t.cfg.get(t.entryId);for(let o of t.node.parameters){let i=ve(e,o.name);if(!i){e.unsupported.add("Destructured parameter definition-use is not implemented.");continue}n.definitions.push({point:Ee(e,i.node,"parameter-definition",i.symbolKey,i.name,t.id),rhsUseIds:[]})}for(let o of t.cfg.values())!o.ast||o.kind==="entry"||o.kind==="exit"||(o.kind==="predicate"&&(o.displayPoint=Ee(e,o.ast,"predicate",null,"predicate",t.id)),_o(e,t,o,o.ast),!o.displayPoint&&o.definitions.length===0&&o.uses.length===0&&(o.displayPoint=Ee(e,o.ast,"statement",null,Qo(e,o.ast),t.id)))}function _o(e,t,n,o){let i=e.ts;if(i.isTryStatement(o))return;let s=r=>{if(!(r!==o&&i.isFunctionLike(r))){if(i.isVariableDeclaration(r)){let a=r.initializer?Qe(e,t.id,r.initializer,n):[];n.uses.push(...a);let d=ve(e,r.name);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Destructured variable reaching definitions are not implemented."));return}if(i.isBinaryExpression(r)&&En(i,r.operatorToken.kind)){let a=Qe(e,t.id,r.right,n);r.operatorToken.kind!==i.SyntaxKind.EqualsToken&&a.push(...Qe(e,t.id,r.left,n)),n.uses.push(...a);let d=ve(e,r.left);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Dynamic or destructured assignment targets are not included in reaching definitions."));return}if((i.isPrefixUnaryExpression(r)||i.isPostfixUnaryExpression(r))&&(r.operator===i.SyntaxKind.PlusPlusToken||r.operator===i.SyntaxKind.MinusMinusToken)){let a=Qe(e,t.id,r.operand,n);n.uses.push(...a);let d=ve(e,r.operand);d&&n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)});return}if(!(i.isFunctionDeclaration(r)||i.isClassDeclaration(r)||i.isInterfaceDeclaration(r))){if(xn(e,r)){let a=vn(e,t.id,r);a&&n.uses.push(a),i.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}}};s(o),n.uses=In(n.uses)}function Qe(e,t,n,o){let i=[],s=r=>{if(!e.ts.isFunctionLike(r)){if(e.ts.isBinaryExpression(r)&&En(e.ts,r.operatorToken.kind)){o.invalidatesAllDefinitions=!0,e.unsupported.add("Nested assignment expressions are not included in ordered local definition-use flow."),r.operatorToken.kind!==e.ts.SyntaxKind.EqualsToken&&s(r.left),s(r.right);return}if(xn(e,r)){let a=vn(e,t,r);a&&i.push(a),e.ts.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}};return s(n),In(i)}function xn(e,t){if(e.ts.isPropertyAccessExpression(t))return!0;if(!e.ts.isIdentifier(t))return!1;let n=t.parent;return!(e.ts.isPropertyAccessExpression(n)&&n.name===t||"name"in n&&n.name===t&&Ko(e.ts,n)||e.ts.isPropertyAssignment(n)&&n.name===t||e.ts.isBindingElement(n)&&n.propertyName===t||e.ts.isLabeledStatement(n)||e.ts.isBreakOrContinueStatement(n)||jo(e.ts,t))}function Ko(e,t){return e.isVariableDeclaration(t)||e.isParameter(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isMethodDeclaration(t)||e.isPropertyDeclaration(t)||e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isImportSpecifier(t)||e.isImportClause(t)||e.isNamespaceImport(t)}function jo(e,t){for(let n=t.parent;n;n=n.parent){if(e.isExpression(n)||e.isStatement(n)||e.isSourceFile(n))return!1;if(e.isTypeNode(n))return!0}return!1}function vn(e,t,n){let o=ve(e,n);return o?{point:Ee(e,o.node,"use",o.symbolKey,o.name,t),property:e.ts.isPropertyAccessExpression(n)}:null}function ve(e,t){let n=e.ts;if(n.isIdentifier(t)){let o=bn(e,t);return o?{node:t,symbolKey:o,name:t.text}:null}if(n.isPropertyAccessExpression(t)){let o=bn(e,t.name);return o?{node:t,symbolKey:o,name:t.getText(e.sourceFile)}:null}return n.isParenthesizedExpression(t)||n.isAsExpression(t)||n.isTypeAssertionExpression(t)||n.isNonNullExpression(t)?ve(e,t.expression):((n.isArrayLiteralExpression(t)||n.isObjectLiteralExpression(t))&&e.unsupported.add("Heap aggregate identity and destructured assignment are not included in local points-to flow."),null)}function bn(e,t){let n=e.checker.getSymbolAtLocation(t);if(!n)return null;if((n.flags&e.ts.SymbolFlags.Alias)!==0)try{n=e.checker.getAliasedSymbol(n)}catch{}let o=n.valueDeclaration??n.declarations?.[0];return o?`symbol:${encodeURIComponent(o.getSourceFile().fileName)}:${o.getStart()}:${n.getName()}`:`symbol:${n.getName()}`}function Ee(e,t,n,o,i,s){let r=t.getStart(e.sourceFile),a=t.getEnd(),d=e.sourceFile.getLineAndCharacterOfPosition(r),c=`flow-point:${encodeURIComponent(e.sourceFile.fileName)}:${r}:${a}:${n}:${encodeURIComponent(o??i)}`,l=e.points.get(c);if(l)return l;let u={id:c,kind:n,name:i,symbolKey:o,callableId:s,start:r,end:a,line:d.line,column:d.character,node:t};return e.points.set(c,u),u}function qo(e,t){let n=[...t.cfg.values()].flatMap(d=>d.definitions),o=new Map(n.map(d=>[d.point.id,d])),i=Uo(n),s=new Map,r=new Map;for(let d of t.cfg.values())s.set(d.id,new Set),r.set(d.id,new Set);let a=!0;for(;a;){a=!1;for(let d of t.cfg.values()){let c=Jo([...d.predecessors].map(f=>r.get(f))),l=new Set(c);d.invalidatesAllDefinitions&&l.clear();let u=zo(d.definitions);for(let f of u){for(let m of i.get(f.point.symbolKey)??[])l.delete(m.point.id);l.add(f.point.id)}It(s.get(d.id),c)||(s.set(d.id,c),a=!0),It(r.get(d.id),l)||(r.set(d.id,l),a=!0)}}for(let d of t.cfg.values()){let c=s.get(d.id);for(let l of d.uses){let u=d.definitions.filter(m=>m.point.symbolKey===l.point.symbolKey&&m.point.start<l.point.start&&!m.rhsUseIds.includes(l.point.id)).sort((m,p)=>p.point.start-m.point.start)[0],f=u?[u.point.id]:c;for(let m of f){let p=o.get(m);p.point.symbolKey===l.point.symbolKey&&Be(e,"reaching-definition",p.point.id,l.point.id,"exact","A CFG path reaches this use without an intervening definition.")}}for(let l of d.definitions)for(let u of l.rhsUseIds)Be(e,"value-source",u,l.point.id,"exact","This right-hand-side use supplies the new definition.")}}function Uo(e){let t=new Map;for(let n of e){if(!n.point.symbolKey)continue;let o=t.get(n.point.symbolKey)??[];o.push(n),t.set(n.point.symbolKey,o)}return t}function zo(e){let t=new Map;for(let n of e)n.point.symbolKey&&t.set(n.point.symbolKey,n);return[...t.values()]}function Go(e,t){let n=Ho(t);for(let o of t.cfg.values()){if(o.successors.size<2||!o.displayPoint)continue;let i=n.get(o.id);for(let s of o.successors)for(let r of n.get(s)??[]){if(i.has(r)||r===t.exitId)continue;let a=t.cfg.get(r),d=[...a.definitions.map(c=>c.point),...a.uses.map(c=>c.point),...a.displayPoint?[a.displayPoint]:[]];for(let c of Yo(d))Be(e,"control-dependence",o.displayPoint.id,c.id,"exact","The target postdominates a branch successor but does not postdominate the predicate.")}}}function Ho(e){let t=[...e.cfg.keys()],n=new Set(t),o=new Map;for(let s of t)o.set(s,s===e.exitId?new Set([s]):new Set(n));let i=!0;for(;i;){i=!1;for(let s of e.cfg.values()){if(s.id===e.exitId)continue;let r=[...s.successors].map(d=>o.get(d)),a=new Set([s.id,...Xo(r)]);It(o.get(s.id),a)||(o.set(s.id,a),i=!0)}}return o}function Wo(e,t){let n=new Map(t.map(r=>[r.id,r.parentId])),o=t.flatMap(r=>[...r.cfg.values()].flatMap(a=>a.definitions.map(d=>d.point))),i=new Map;for(let r of o){if(!r.symbolKey)continue;let a=i.get(r.symbolKey)??[];a.push(r),i.set(r.symbolKey,a)}let s=new Set([...e.edges.values()].filter(r=>r.kind==="reaching-definition").map(r=>r.toPointId));for(let r of t)for(let a of[...r.cfg.values()].flatMap(d=>d.uses)){if(!a.point.symbolKey||s.has(a.point.id))continue;let d=i.get(a.point.symbolKey)??[];for(let c of d)Vo(c.callableId,a.point.callableId,n)?Be(e,"closure-capture",c.id,a.point.id,"candidate","Compiler identity proves the captured binding, but invocation order can select among outer definitions."):a.property&&Be(e,"field-definition-to-use",c.id,a.point.id,"candidate","Compiler identity matches the field; cross-callable receiver and execution order remain unresolved.")}[...e.edges.values()].some(r=>r.kind==="closure-capture")&&e.unsupported.add("Closure capture identity is known, but invocation order and intervening writes remain candidate flow."),[...e.edges.values()].some(r=>r.kind==="field-definition-to-use")&&e.unsupported.add("Cross-callable field flow lacks receiver points-to and invocation-order analysis.")}function Vo(e,t,n){for(let o=n.get(t)??null;o;o=n.get(o)??null)if(o===e)return!0;return!1}function Be(e,t,n,o,i,s){let r=`local-flow-edge:${t}:${encodeURIComponent(n)}:${encodeURIComponent(o)}`;e.edges.set(r,{id:r,kind:t,fromPointId:n,toPointId:o,strength:i,reason:s})}function En(e,t){return t>=e.SyntaxKind.FirstAssignment&&t<=e.SyntaxKind.LastAssignment}function Qo(e,t){let n=t.getText(e.sourceFile).replace(/\s+/gu," ").trim();return n.length>80?`${n.slice(0,77)}...`:n||e.ts.SyntaxKind[t.kind]||"statement"}function In(e){return[...new Map(e.map(t=>[t.point.id,t])).values()]}function Yo(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Jo(e){return new Set(e.flatMap(t=>[...t]))}function Xo(e){return e.length===0?new Set:new Set([...e[0]].filter(t=>e.slice(1).every(n=>n.has(t))))}function It(e,t){return e.size===t.size&&[...e].every(n=>t.has(n))}function Zo(e,t){return e.start-t.start||e.kind.localeCompare(t.kind)||e.id.localeCompare(t.id)}function vt(e){return{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[e]}}}var tr=jt("typescript-local-flow",{clearGroups:["whole-project","source-file","semantic-provider"]});function Ct(e,t,n,o){if(!Yt(t))return null;let i=`${t}\0${n}\0${o}`;return tr.get(e,i,()=>{let s=zt(e,t);return s?Sn(s,er(e.config.projectRoot,t),{startLine:n,endLine:o}):{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[`Current source is unavailable for ${t}.`]}}})}function nr(e,t=new Map){let n=new Map,o=new Map,i=[];for(let s of e.transfers){if(!e.caller)continue;let r=Ye(e.caller,s.callerPosition),a=Ye(e.callee,s.calleePosition);Oe(n,r),Oe(n,a),wt(o,e.caller,r),wt(o,e.callee,a);let d=Q("edge","data-transfer",s.proof.file,String(s.proof.startLine),String(s.callerPosition),String(s.calleePosition));o.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,callerPosition:s.callerPosition,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-direct-parameter-transfer",strength:"exact",identity:`${e.caller.symbol}:${s.callerPosition} -> ${e.callee.symbol}:${s.calleePosition}`,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]})}return e.unknown.forEach((s,r)=>{let a=Ye(e.callee,s.calleePosition);Oe(n,a),wt(o,e.callee,a);let d=t.get(s.calleePosition);if(d&&mr(d)){pr(o,n,e,s.calleePosition,s.argumentText,d);return}let c=cr(e,s.calleePosition,s.argumentText);Oe(n,c);let l=Q("edge","data-transfer-unsupported",s.proof.file,String(s.proof.startLine),String(s.calleePosition),String(r));o.set(l,{id:l,kind:"data-transfer",fromNodeId:c.id,toNodeId:a.id,directed:!0,disposition:"unsupported",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-argument-expression",strength:"exact",identity:s.argumentText,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]}),i.push({id:Q("frontier","data-transfer",l),kind:"data-transfer",direction:"unresolved",fromNodeIds:[c.id],edgeIds:[l],memberNodeIds:[a.id],memberCount:1,disposition:"unsupported",reason:d?.derivation.rule??s.reason,expansion:null})}),{nodes:[...n.values()],edges:[...o.values()],frontiers:i,blindSpots:[]}}function Ln(e,t,n=[]){let o=wn(),i=new Map,s=new Set;for(let r of t){if(r.kind!=="call"||!r.fromSymbol||!r.toSymbol||r.line===null)continue;let a=dr(i,e,r.toFile,r.toSymbol);if(!a)continue;let d=tn(e,a),c=d.sites.filter(b=>b.file===r.fromFile&&b.startLine<=r.line&&b.endLine>=r.line&&b.caller?.symbol===r.fromSymbol);if(c.length!==1){let b=d.unresolved.find(S=>S.file===r.fromFile&&S.line===r.line);b&&o.blindSpots.push(`Parameter flow unresolved at ${r.fromFile}:${r.line+1}: ${b.reason}.`);continue}let l=c[0],u=`${l.file}\0${l.callNode.startIndex}\0${l.callNode.endIndex}\0${a.symbol}`;if(s.has(u))continue;s.add(u);let f=nn(e,l),m=he(e,l.file)?.rootNode,p=new Map;if(m)for(let b of f.unknown){let S=en({db:e,file:l.file,root:m},l.arguments[b.calleePosition]);S&&p.set(b.calleePosition,S)}Cn(o,nr(f,p)),f.caller&&ar(l.callNode)&&lr(o,f,l.callNode)}for(let r of n){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=Ct(e,r.location.file,r.location.line,a);if(d){Cn(o,or(r,d.points,d.edges));for(let c of d.coverage.unsupported)o.blindSpots.push(`TypeScript local flow is partial for ${r.location.file}:${r.location.line+1}-${a+1}: ${c} Recover with: scip-query inspect --at '${r.location.file}:${r.location.line+1}-${a+1}' --view behavior.`)}}return o.blindSpots=[...new Set(o.blindSpots)].sort(),o}function or(e,t,n){let o=wn(),i=new Map,s=new Map,r=new Map,a=e.location.file;for(let d of t){let c=rr(e,a,d);r.set(d.id,c.id),i.set(c.id,c),ir(s,e,c)}for(let d of n){let c=r.get(d.fromPointId),l=r.get(d.toPointId);if(!c||!l)continue;let u=sr(d),f=Q("edge","typescript-local-flow",a,d.id);s.set(f,{id:f,kind:d.kind==="control-dependence"?"control-dependence":"data-transfer",fromNodeId:c,toNodeId:l,directed:!0,disposition:"folded",semantics:[u],evidence:[{method:"typescript-compiler-cfg-reaching-definitions",strength:d.strength,identity:d.reason,location:i.get(c)?.location??e.location}]})}return o.nodes=[...i.values()],o.edges=[...s.values()],o}function rr(e,t,n){return{id:Q("local-flow-point",t,String(n.start),String(n.end),n.kind,n.symbolKey??n.name),kind:n.kind==="parameter-definition"||n.kind==="definition"?"local-definition":n.kind==="use"?"local-use":n.kind==="predicate"?"control-predicate":"local-statement",label:n.name,disposition:"folded",location:{file:t,line:n.line,endLine:n.line},anchorIds:[],attributes:{ownerNodeId:e.id,pointKind:n.kind,callableId:n.callableId,symbolKey:n.symbolKey,column:n.column}}}function ir(e,t,n){let o=Q("edge","local-flow-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"local-flow-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"typescript-compiler-local-flow-owner",strength:"exact",identity:t.id,location:n.location}]})}function sr(e){switch(e.kind){case"reaching-definition":return{family:"data",subtype:"definition-to-use"};case"value-source":return{family:"data",subtype:"value-to-definition"};case"closure-capture":return{family:"data",subtype:"closure-capture"};case"field-definition-to-use":return{family:"data",subtype:"field-definition-to-use"};case"control-dependence":return{family:"control",subtype:"control-dependence"}}}function ar(e){let t=e;for(;t.parent&&["await_expression","yield_expression","parenthesized_expression","as_expression","type_assertion"].includes(t.parent.type);)t=t.parent;return t.parent!==null&&t.parent.type!=="expression_statement"}function lr(e,t,n){if(!t.caller)return;let o={id:Q("call-result",t.call.file,String(n.startIndex),String(n.endIndex),t.callee.symbol),kind:"call-result",label:`result of ${t.callee.leaf}`,disposition:"folded",location:{file:t.call.file,line:t.call.startLine,endLine:t.call.endLine},anchorIds:[],attributes:{calleeSymbol:t.callee.symbol,callerSymbol:t.caller.symbol}},i=Q("edge","return-to-call-result",t.callee.symbol,o.id),s=Q("edge","call-result-owner",t.caller.symbol,o.id);e.nodes.push(o),e.edges.push({id:i,kind:"data-transfer",fromNodeId:Mt(t.callee.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"return-to-call-result"}],evidence:[{method:"compiler-callsite-used-result",strength:"exact",identity:`${t.callee.symbol} -> ${t.caller.symbol}`,location:o.location}]},{id:s,kind:"call-result-owner",fromNodeId:Mt(t.caller.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-call-result"}],evidence:[{method:"compiler-call-result-owner",strength:"exact",identity:t.caller.symbol,location:o.location}]})}function wn(){return{nodes:[],edges:[],frontiers:[],blindSpots:[]}}function Cn(e,t){Lt(e.nodes,t.nodes),Lt(e.edges,t.edges),Lt(e.frontiers,t.frontiers),e.blindSpots.push(...t.blindSpots)}function Lt(e,t){let n=new Set(e.map(o=>o.id));for(let o of t)n.has(o.id)||(n.add(o.id),e.push(o))}function dr(e,t,n,o){let i=`${n}\0${o}`,s=e.get(i);if(s!==void 0)return s;let r=fe(t,n).find(a=>a.symbol===o)??null;return e.set(i,r),r}function Ye(e,t){return{id:yr(e.symbol,t),kind:"parameter",label:`${e.leaf} parameter ${t}`,disposition:"folded",location:{file:e.relativePath,line:e.startLine,endLine:e.endLine},anchorIds:[],attributes:{ownerSymbol:e.symbol,position:t}}}function cr(e,t,n){return{id:Q("argument-expression",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"argument-expression",label:n,disposition:"unsupported",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{calleeSymbol:e.callee.symbol,position:t}}}function ur(e,t,n){return{id:Q("static-value",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"static-value",label:n.value,disposition:"folded",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{value:n.value,precision:n.precision,evidence:n.evidence,termKind:n.term.kind,derivationRule:n.derivation.rule}}}function pr(e,t,n,o,i,s){let r=ur(n,o,s),a=Ye(n.callee,o);Oe(t,r);let d=Q("edge","static-value-transfer",n.call.file,String(n.call.startLine),String(o));e.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:fr(s),attributes:{argumentText:i,calleePosition:o,value:s.value,precision:s.precision,derivationRule:s.derivation.rule}}],evidence:gr(s,n)})}function mr(e){return e.derivation.kind!=="heuristic"&&e.precision!=="symbolic"&&e.precision!=="unknown"}function fr(e){return e.derivation.rule==="bounded-call-return"?"return-to-parameter":e.derivation.rule==="member-constant"||e.term.kind==="property"?"property-to-parameter":"constant-to-parameter"}function gr(e,t){return(e.derivation.sourceSpans.length>0?e.derivation.sourceSpans:[t.call]).map(o=>({method:`static-value:${e.derivation.rule}`,strength:e.derivation.kind==="direct"?"exact":"derived",identity:e.derivation.inputFactIds.join(",")||e.value,location:{file:o.file,line:o.startLine,endLine:o.endLine}}))}function Oe(e,t){e.has(t.id)||e.set(t.id,t)}function wt(e,t,n){let o=Q("edge","parameter-owner",t.symbol,n.id);e.has(o)||e.set(o,{id:o,kind:"parameter-owner",fromNodeId:Mt(t.symbol),toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"compiler-parameter-owner",strength:"exact",identity:t.symbol,location:{file:t.relativePath,line:t.startLine,endLine:t.endLine}}]})}function yr(e,t){return Q("parameter",e,String(t))}function Mt(e){return Q("symbol",e)}function Q(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function Mn(e,t){let n=new Map,o=new Map,i=new Map,s=new Set;for(let r of t){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=sn(e,r.location.file,r.location.line,a);if(!d){s.add(`Control dependence unavailable for ${r.location.file}:${r.location.line+1}-${a+1}: no supported syntax tree or covering construct.`);continue}for(let c of d.facts){let l=Nt(r,c.controller),u=Nt(r,c.outcome);n.set(l.id,l),n.set(u.id,u),br(o,r,l);let f=Ie("edge","control-dependence",l.id,u.id,c.subtype);o.set(f,{id:f,kind:"control-dependence",fromNodeId:l.id,toNodeId:u.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:c.subtype,attributes:{...c.attributes}}],evidence:[{method:"parser-control-dependence",strength:"exact",identity:`${r.location.file}:${c.controller.startLine+1}-${c.outcome.startLine+1}`,location:{file:r.location.file,line:c.controller.startLine,endLine:c.controller.endLine}}]})}for(let c of d.terminals){let l=Nt(r,c);n.set(l.id,l);let u=c.label.startsWith("throw")||c.label.startsWith("raise")?"throw":"return",f=Ie("edge","control-terminal",r.id,l.id,u);o.set(f,{id:f,kind:"control-terminal",fromNodeId:r.id,toNodeId:l.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:u==="throw"?"throws":"returns"}],evidence:[{method:"parser-terminal-statement",strength:"exact",identity:c.label,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]})}for(let c of d.unsupported){let l=Ie("control-unsupported",r.location.file,String(c.startLine),String(c.endLine),c.reason);n.set(l,{id:l,kind:"control-unsupported",label:c.reason,disposition:"unsupported",location:{file:r.location.file,line:c.startLine,endLine:c.endLine},anchorIds:[],attributes:{ownerNodeId:r.id}});let u=Ie("edge","control-unsupported",r.id,l);o.set(u,{id:u,kind:"control-dependence",fromNodeId:r.id,toNodeId:l,directed:!0,disposition:"unsupported",semantics:[{family:"control",subtype:"unresolved-control-construct"}],evidence:[{method:"parser-control-construct",strength:"exact",identity:c.reason,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]});let f=Ie("frontier","control-dependence",l);i.set(f,{id:f,kind:"control-dependence",direction:"unresolved",fromNodeIds:[r.id],edgeIds:[u],memberNodeIds:[l],memberCount:1,disposition:"unsupported",reason:c.reason,expansion:null})}}return{nodes:[...n.values()],edges:[...o.values()],frontiers:[...i.values()],blindSpots:[...s].sort()}}function Nt(e,t){let n=e.location.file;return{id:Ie(`control-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`control-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind,implicit:t.implicit}}}function br(e,t,n){let o=Ie("edge","control-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"control-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-control"}],evidence:[{method:"parser-control-owner",strength:"exact",identity:t.id,location:t.location}]})}function Ie(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Je=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),Ke=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Sr=new Set(["assignment","assignment_expression","augmented_assignment_expression"]),Ft=new Set(["update_expression"]),Tn=new Set(["array_access","element_access_expression","subscript_expression"]),Pn=new Set(["attribute","field_access","field_expression","member_access_expression","member_expression","selector_expression"]),hr=new Set(["false","null","null_literal","number","number_literal","string","string_literal","template_string","true"]),xr=new Set(["call_expression","method_invocation","object_creation_expression"]),vr=new Set(["comment","else_clause","formal_parameters","parameters","type_parameters"]);function kn(e,t,n,o){let i=he(e,t);if(!i)return null;let s=Rr(i.rootNode,n,o);if(!s)return null;let r=[],a=[],d=[];return Ce(s,c=>{if(Sr.has(c.type)||Ft.has(c.type)||An(c)){let l=Er(c);l?r.push(l):d.push({family:"state",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:`Mutation target ${le(c.text)} could not be resolved to an exact source resource.`})}}),Ce(s,c=>{if(!Ke.has(c.type))return;let l=Mr(c);for(let u=0;u<l.length-1;u+=1)a.push({from:_e(l[u]),to:_e(l[u+1]),subtype:"lexical-successor",synchronizationScope:null,attributes:{sameScope:!0,executionConditional:!0}});for(let u=0;u<l.length;u+=1){let f=l[u],m=Tr(f).filter(p=>p.type==="await_expression");for(let p of m){let b=je("event",`await ${le(p.text.replace(/^await\s+/u,""))}`,p);a.push({from:_e(f),to:b,subtype:"awaits-completion",synchronizationScope:null,attributes:{completionRequired:!0}});let S=l[u+1];S&&a.push({from:b,to:_e(S),subtype:"await-completion-before",synchronizationScope:null,attributes:{continuationOnly:!0}})}}}),Ce(s,c=>{if(c.type!=="synchronized_statement")return;let l=c.childForFieldName("object")??c.childForFieldName("condition")??c.namedChildren.find(b=>!Ke.has(b.type)),u=c.childForFieldName("body")??c.namedChildren.find(b=>Ke.has(b.type));if(!l||!u){d.push({family:"temporal",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:"Synchronized scope has no structurally resolved monitor or body."});return}let f=le(l.text).replace(/^\(|\)$/gu,""),m=je("lock",f,l),p=Fr(u).filter(b=>b.parent!==null&&Dn(b));for(let b of Nr(p))a.push({from:m,to:_e(b),subtype:"inside-lock-scope",synchronizationScope:f,attributes:{syntaxNative:!0}})}),{mutations:r,temporal:a,unsupported:d}}function Er(e){let t=An(e),n=e.childForFieldName("left")??e.childForFieldName("argument")??(t?e.namedChildren.at(-1)??null:e.namedChildren[0]??null);if(!n)return null;let o=Ir(n);if(!o)return null;let i=t?"delete":Ft.has(e.type)||!wr(e,n).startsWith("=")?"update":"assign",s=t||Ft.has(e.type)?null:e.childForFieldName("right");return{event:je("event",le(e.text),e),resource:{kind:"resource",label:o.name,startLine:n.startPosition.row,endLine:n.endPosition.row},operation:i,durabilityClass:"in-memory",recordIdentity:o.recordIdentity,value:s?je("value",le(s.text),s):null,dataSubtype:s?Cr(s,e):null}}function Ir(e){if(Tn.has(e.type)){let t=e.childForFieldName("object")??e.childForFieldName("array")??e.namedChildren[0]??null,n=e.childForFieldName("index")??e.childForFieldName("subscript")??e.namedChildren[1]??null;return!t||!n?null:{name:`${le(t.text)}[]`,recordIdentity:le(n.text)}}return Pn.has(e.type)?{name:le(e.text),recordIdentity:null}:/^(?:identifier|property_identifier|field_identifier)$/u.test(e.type)?{name:le(e.text),recordIdentity:null}:null}function Cr(e,t){return hr.has(e.type)||/(?:integer|float|decimal|boolean|character)_literal$/u.test(e.type)?"constant-to-state":xr.has(e.type)?"return-to-state":Pn.has(e.type)||Tn.has(e.type)?"property-to-state":/identifier$/u.test(e.type)?Lr(e.text,t)?"captured-value-to-state":"value-to-state":"expression-to-state"}function Lr(e,t){let n=Rt(t.parent);if(!n||Nn(n,e))return!1;let o=Rt(n.parent);for(;o;){if(Nn(o,e))return!0;o=Rt(o.parent)}return!1}function Rt(e){let t=e;for(;t;){if(Je.has(t.type))return t;t=t.parent}return null}function Nn(e,t){let n=e.childForFieldName("parameters")??e.namedChildren.find(s=>["formal_parameters","parameters"].includes(s.type));if(n&&Rn(n,t))return!0;let o=e.childForFieldName("body")??e.namedChildren.find(s=>Ke.has(s.type));if(!o)return!1;let i=!1;return $n(o,e,s=>{if(i||!/(?:declarator|declaration|parameter)$/u.test(s.type))return;let r=s.childForFieldName("name")??s.childForFieldName("pattern")??s.namedChildren[0];r&&Rn(r,t)&&(i=!0)}),i}function Rn(e,t){let n=!1;return Ce(e,o=>{/identifier$/u.test(o.type)&&o.text===t&&(n=!0)}),n}function $n(e,t,n){n(e);for(let o of e.namedChildren)o!==t&&Je.has(o.type)||$n(o,t,n)}function wr(e,t){let n=e.childForFieldName("right"),o=Math.max(0,t.endIndex-e.startIndex),i=n?Math.max(o,n.startIndex-e.startIndex):e.text.length;return e.text.slice(o,i).trim()}function An(e){return(e.type==="delete_expression"||e.type==="unary_expression")&&/^delete\b/u.test(e.text.trim())}function Mr(e){return e.namedChildren.filter(t=>Dn(t))}function Dn(e){return vr.has(e.type)||Ke.has(e.type)?!1:/(?:statement|declaration)$/u.test(e.type)||e.type==="expression_statement"||e.type==="local_variable_declaration"}function Nr(e){let t=new Set(e);return e.filter(n=>{let o=n.parent;for(;o;){if(t.has(o))return!1;o=o.parent}return!0})}function _e(e){return je("event",le(e.text),e)}function je(e,t,n){return{kind:e,label:t,startLine:n.startPosition.row,endLine:n.endPosition.row}}function Rr(e,t,n){let o=[];return Ce(e,s=>{s.startPosition.row<=t&&s.endPosition.row>=n&&o.push(s)}),o.filter(s=>Je.has(s.type)).sort(Fn)[0]??o.sort(Fn)[0]??null}function Fn(e,t){return e.endIndex-e.startIndex-(t.endIndex-t.startIndex)||e.startIndex-t.startIndex}function Fr(e){let t=[];return Ce(e,n=>t.push(n)),t}function Tr(e){let t=[],n=o=>{t.push(o);for(let i of o.namedChildren)i!==e&&Je.has(i.type)||n(i)};return n(e),t}function Ce(e,t){t(e);for(let n of e.namedChildren)Ce(n,t)}function le(e){return e.trim().replace(/\s+/gu," ")}function _n(e,t,n=[]){let o=new Map,i=new Map,s=new Map,r=new Set;for(let a of t){if(!a.location||!["source-construct","symbol"].includes(a.kind))continue;let d=a.location.endLine??a.location.line,c=kn(e,a.location.file,a.location.line,d);if(!c){r.add(`State and temporal analysis unavailable for ${a.location.file}:${a.location.line+1}-${d+1}: no supported syntax tree or covering construct.`);continue}for(let l of c.mutations){let u=Ze(a,l.event),f=Br(a,l.resource,l.durabilityClass);if(o.set(u.id,u),o.set(f.id,f),et(i,a,u,"contains-state-effect"),tt(i,{kind:"state-resource",from:u,to:f,semantics:[{family:"state",subtype:l.operation==="delete"?"deletes-resource":"writes-resource",attributes:{operation:l.operation,durabilityClass:l.durabilityClass,resource:l.resource.label,recordIdentity:l.recordIdentity,transactionMembership:"unknown"}}],method:"parser-state-mutation",identity:l.event.label}),l.value&&l.dataSubtype){let m=Ze(a,l.value);o.set(m.id,m),tt(i,{kind:"data-to-state",from:m,to:f,semantics:[{family:"data",subtype:l.dataSubtype,attributes:{operation:l.operation,resource:l.resource.label,recordIdentity:l.recordIdentity,value:l.value.label}}],method:"parser-assignment-value",identity:`${l.value.label} -> ${l.resource.label}`})}}for(let l of c.temporal){let u=Ze(a,l.from),f=Ze(a,l.to);o.set(u.id,u),o.set(f.id,f),et(i,a,u,l.from.kind==="lock"?"contains-lock-scope":"contains-event"),et(i,a,f,"contains-event"),tt(i,{kind:"temporal-order",from:u,to:f,semantics:[{family:"temporal",subtype:l.subtype,context:l.synchronizationScope?{synchronizationScope:l.synchronizationScope}:void 0,attributes:{...l.attributes}}],method:l.subtype==="inside-lock-scope"?"parser-synchronized-scope":"parser-program-order",identity:`${l.from.label} -> ${l.to.label}`})}for(let l of c.unsupported){let u=ue(`${l.family}-unsupported`,a.location.file,String(l.startLine),String(l.endLine),l.reason);o.set(u,{id:u,kind:`${l.family}-unsupported`,label:l.reason,disposition:"unsupported",location:{file:a.location.file,line:l.startLine,endLine:l.endLine},anchorIds:[],attributes:{ownerNodeId:a.id}});let f=ue("edge",`${l.family}-unsupported`,a.id,u);i.set(f,{id:f,kind:`${l.family}-unsupported`,fromNodeId:a.id,toNodeId:u,directed:!0,disposition:"unsupported",semantics:[{family:l.family,subtype:`unresolved-${l.family}-construct`}],evidence:[{method:`parser-${l.family}-construct`,strength:"exact",identity:l.reason,location:{file:a.location.file,line:l.startLine,endLine:l.endLine}}]});let m=ue("frontier",l.family,u);s.set(m,{id:m,kind:l.family,direction:"unresolved",fromNodeIds:[a.id],edgeIds:[f],memberNodeIds:[u],memberCount:1,disposition:"unsupported",reason:l.reason,expansion:null})}}for(let a of t.filter(d=>d.kind==="runtime-boundary-participant")){let d=Xe(a,"protocol"),c=Xe(a,"action"),l=Xe(a,"address")??a.label;!d||!c||!On(d,c)||Bn(o,i,a,{observationId:a.id,action:c,strength:"exact",file:a.location?.file??"",line:a.location?.line??0,address:l,protocol:d,role:Xe(a,"role")??void 0,resolution:"locally-linked"})}for(let a of n){if(!a.protocol||!On(a.protocol,a.action))continue;let d=Ar(t,a.file,a.line,a.ownerShortName??null);if(!d){r.add(`State observation ${a.observationId} at ${a.file}:${a.line+1} has no materialized owner node.`);continue}Bn(o,i,d,a)}return{nodes:[...o.values()],edges:[...i.values()],frontiers:[...s.values()],blindSpots:[...r].sort()}}function Bn(e,t,n,o){let i=kr(o),r={id:ue("runtime-state-event",o.observationId),kind:"runtime-state-event",label:`${o.action} ${i}`,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{action:o.action,protocol:o.protocol??null,modality:o.modality??null,resolution:o.resolution??null}},a=o.protocol==="database"?"external-durable-intent":"external",d={id:ue("runtime-state-resource",o.protocol??"unknown",i),kind:"runtime-state-resource",label:i,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{protocol:o.protocol??null,durabilityClass:a}};e.set(r.id,r),e.set(d.id,d),et(t,n,r,"contains-runtime-state-effect");let c=Pr(o.action);tt(t,{kind:"runtime-state-resource",from:r,to:d,semantics:[{family:"state",subtype:c,context:{crossesRuntimeBoundary:!0,protocol:o.protocol},attributes:{operation:o.action,durabilityClass:a,resource:i,recordIdentity:$r(o),modality:o.modality??null,resolution:o.resolution??null,transactionMembership:"unknown",commitState:o.protocol==="database"?"unknown":null}}],method:`runtime-boundary-${o.strength}`,identity:o.observationId})}function Pr(e){return e==="database.read"?"reads-resource":e==="queue.send"?"enqueues-resource":e==="queue.consume"?"consumes-resource":"writes-resource"}function kr(e){return(e.keyParts?.find(n=>["address","resource"].includes(n.name))?.value??e.address)||e.observationId}function $r(e){return e.keyParts?.find(n=>/^(?:id|key|record)$/u.test(n.name))?.value??null}function On(e,t){return e==="database"&&["database.read","database.write"].includes(t)||e==="queue"&&["queue.consume","queue.send"].includes(t)}function Xe(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function Ar(e,t,n,o){let i=e.filter(r=>r.location?.file===t&&["source-construct","symbol"].includes(r.kind)),s=i.filter(r=>r.location.line<=n&&(r.location.endLine??r.location.line)>=n).sort(Dr)[0];if(s)return s;if(o){let r=i.find(a=>a.label===o||a.label.endsWith(`.${o}`)||a.label.includes(o));if(r)return r}return i.length===1?i[0]:null}function Dr(e,t){let n=(e.location?.endLine??e.location?.line??0)-(e.location?.line??0),o=(t.location?.endLine??t.location?.line??0)-(t.location?.line??0);return n-o}function Ze(e,t){let n=e.location.file;return{id:ue(`program-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`program-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind}}}function Br(e,t,n){let o=e.location.file;return{id:ue("program-resource",o,e.id,t.label,n),kind:"program-resource",label:t.label,disposition:"folded",location:{file:o,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,durabilityClass:n}}}function et(e,t,n,o){let i=ue("edge","program-owner",t.id,n.id,o);e.has(i)||e.set(i,{id:i,kind:"program-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:o}],evidence:[{method:"parser-program-owner",strength:"exact",identity:t.id,location:n.location}]})}function tt(e,t){let n=ue("edge",t.kind,t.from.id,t.to.id,t.semantics[0].subtype);e.set(n,{id:n,kind:t.kind,fromNodeId:t.from.id,toNodeId:t.to.id,directed:!0,disposition:"folded",semantics:t.semantics,evidence:[{method:t.method,strength:"exact",identity:t.identity,location:t.from.location}]})}function ue(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Or=new Set(["control","data","state","temporal"]),nt=new Set(["contains-control","contains-event","contains-lock-scope","contains-state-effect","contains-runtime-state-effect","contains","owns-parameter","owns-runtime-observation"]),Un=new Set(["discriminator-dispatch","result-callback","returns","runtime-handoff","throws"]);function zn(e,t={}){let n=new Map(e.nodes.map(v=>[v.id,v])),o=Gr(e.nodes,t.focusLocations),i=Hr(e.edges,t.focusLocations),s=Wr(e.edges,i),r=new Set(e.paths.flatMap(v=>v.edgeIds)),a=pe(e.anchors.filter(v=>v.status==="matched").flatMap(v=>v.nodeIds)),c=e.edges.filter(qn).filter(v=>_r(v,o,i,r)),l=c.filter(v=>Ur(v,o,i,s,n,r)),u=Kn(a,l,"forward"),f=qr(u,l),m=Kn(f,l,"backward"),p=new Set([...u].filter(v=>m.has(v)));for(let v of a)p.add(v);let b=new Set(l.filter(v=>p.has(v.fromNodeId)&&p.has(v.toNodeId)).map(v=>v.id)),S=new Set(p),w=new Set(b);Kr(c,S,w,o,i);let I=e.frontiers.filter(v=>Qr(v,S)),L=pe(I.filter(v=>v.disposition==="unsupported").map(v=>v.id)),N=pe(e.edges.filter(v=>!qn(v)&&Hn(v)&&Vr(v,S)).map(v=>v.id)),y=pe(I.map(v=>v.id)),E=[];a.length===0&&E.push("No matched anchor node starts the corridor."),f.length===0&&E.push("No proved mechanical outcome is reachable from a matched anchor."),L.length>0&&E.push(`${L.length} unsupported frontier(s) touch the protected corridor.`),N.length>0&&E.push(`${N.length} candidate or unknown edge(s) touch the protected corridor.`);let C=E.length===0?"complete":"incomplete";return{schemaVersion:1,status:C,startNodeIds:a,outcomeNodeIds:f,baseNodeIds:pe([...p]),baseEdgeIds:pe([...b]),nodeIds:pe([...S]),edgeIds:pe([...w]),accountedFrontierIds:y,unresolvedFrontierIds:L,unresolvedEdgeIds:N,coverage:{protectedNodes:S.size,protectedEdges:w.size,baseNodes:p.size,baseEdges:b.size,accountedFrontiers:y.length,unresolvedFrontiers:L.length,unresolvedEdges:N.length},explanation:C==="complete"?"Every proved anchor-to-outcome path is closed over its material causal facts within reported coverage.":E.join(" ")}}function _r(e,t,n,o){return t===null||e.disposition==="emitted"||o.has(e.id)||n?.has(e.id)===!0?!0:(e.semantics??[]).some(i=>{if(i.family==="identity"&&nt.has(i.subtype))return t.has(e.toNodeId);if(i.family==="contract")return t.has(e.fromNodeId)&&t.has(e.toNodeId);if(i.family==="state")return t.has(e.fromNodeId);if(i.family==="data"||i.family==="temporal")return t.has(e.fromNodeId)||t.has(e.toNodeId);if(i.family==="control"){if(Wn(i))return t.has(e.fromNodeId);if(["returns","throws"].includes(i.subtype))return t.has(e.toNodeId);if(i.subtype==="completion-callback")return t.has(e.fromNodeId)||t.has(e.toNodeId)}return!1})}function Kr(e,t,n,o,i){let s=!0;for(;s;){s=!1;for(let r of e)jr(r,t,o,i)&&(n.has(r.id)||(n.add(r.id),s=!0),t.has(r.fromNodeId)||(t.add(r.fromNodeId),s=!0),t.has(r.toNodeId)||(t.add(r.toNodeId),s=!0))}}function jr(e,t,n,o){let i=t.has(e.fromNodeId),s=t.has(e.toNodeId);return!i&&!s?!1:(e.semantics??[]).some(r=>r.family==="identity"?nt.has(r.subtype)&&(s||n===null||n.has(e.toNodeId)):r.family==="contract"?!0:r.family==="state"?i&&(n===null||n.has(e.fromNodeId)):r.family==="temporal"?r.subtype==="lexical-successor"?i&&s:!0:r.family==="data"?s&&(i||n===null||n.has(e.fromNodeId)||o?.has(e.id)===!0):r.family==="control"?Gn(r)||["returns","throws"].includes(r.subtype)&&!s&&n!==null&&!n.has(e.toNodeId)?!1:Un.has(r.subtype)||Wn(r)||r.subtype==="completion-callback":!1)}function qr(e,t){let n=new Set,o=new Map,i=new Map;for(let s of t)!e.has(s.fromNodeId)||!e.has(s.toNodeId)||(o.set(s.fromNodeId,(o.get(s.fromNodeId)??0)+1),i.set(s.toNodeId,(i.get(s.toNodeId)??0)+1),(s.semantics??[]).some(r=>r.family==="state"||r.family==="control"&&Un.has(r.subtype))&&n.add(s.toNodeId));for(let s of e)(i.get(s)??0)>0&&(o.get(s)??0)===0&&n.add(s);return pe([...n])}function Kn(e,t,n){let o=new Map;for(let r of t){let a=n==="forward"?r.fromNodeId:r.toNodeId,d=n==="forward"?r.toNodeId:r.fromNodeId,c=o.get(a)??[];c.push(d),o.set(a,c)}let i=new Set(e),s=[...e];for(;s.length>0;){let r=s.shift();for(let a of o.get(r)??[])i.has(a)||(i.add(a),s.push(a))}return i}function Ur(e,t,n,o,i,s){return(e.semantics??[]).some(r=>e.disposition==="emitted"||s.has(e.id)?!0:r.family==="identity"&&nt.has(r.subtype)?t===null||t.has(e.toNodeId)||o?.has(e.toNodeId)===!0:!Or.has(r.family)||Gn(r)?!1:r.family==="control"&&["returns","throws"].includes(r.subtype)&&t!==null?t.has(e.toNodeId):t===null?!0:r.family==="state"?t.has(e.fromNodeId):r.family==="data"?t.has(e.fromNodeId)||t.has(e.toNodeId)||n?.has(e.id)===!0:r.family==="temporal"?r.subtype==="lexical-successor"?t.has(e.fromNodeId)&&t.has(e.toNodeId):t.has(e.fromNodeId)||t.has(e.toNodeId):r.family==="control"?zr(e,i)&&(t.has(e.fromNodeId)||t.has(e.toNodeId)):!1)}function Gn(e){return e.family==="control"&&["call","discriminator-dispatch","result-callback","runtime-handoff"].includes(e.subtype)}function zr(e,t){let n=t.get(e.fromNodeId),o=t.get(e.toNodeId);if(!n||!o)return!1;let i=jn(n,"ownerNodeId")??(n.kind==="symbol"?n.id:null),s=jn(o,"ownerNodeId")??(o.kind==="symbol"?o.id:null);return i!==null&&i===s}function Gr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>{if(!o.location||o.kind==="parameter")return!1;let i=n.get(o.location.file)??[],s=o.location.endLine??o.location.line;return i.some(r=>r>=o.location.line&&r<=s)}).map(o=>o.id))}function Hr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>o.evidence.some(i=>{if(!i.location)return!1;let s=n.get(i.location.file)??[],r=i.location.endLine??i.location.line;return s.some(a=>a>=i.location.line&&a<=r)})).map(o=>o.id))}function Wr(e,t){return t===null?null:new Set(e.filter(n=>t.has(n.id)).flatMap(n=>[n.fromNodeId,n.toNodeId]))}function jn(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function qn(e){return e.disposition==="excluded"||e.disposition==="unsupported"||!Hn(e)?!1:e.evidence.some(t=>t.strength==="exact"||t.strength==="derived")}function Hn(e){return(e.semantics??[]).some(t=>t.family!=="identity"||nt.has(t.subtype))}function Wn(e){return e.subtype.startsWith("predicate-")||e.subtype.startsWith("loop-")||e.subtype.startsWith("exception-")||e.subtype.startsWith("finally-")||e.subtype.startsWith("handler-")}function Vr(e,t){return t.has(e.fromNodeId)||t.has(e.toNodeId)}function Qr(e,t){return[...e.fromNodeIds,...e.memberNodeIds].some(n=>t.has(n))}function pe(e){return[...new Set(e)].sort()}import{createHash as Yr}from"crypto";var ot=["identity","contract","control","data","state","temporal"],Jr=new Set(ot);function it(e){let t=Fe(e.anchors,"anchor"),n=Fe(e.nodes,"node"),o=Fe(e.edges,"edge"),i=Fe(e.paths??[],"path"),s=Fe(e.frontiers??[],"frontier"),r=new Set(t.map(m=>m.id)),a=new Set(n.map(m=>m.id)),d=new Set(o.map(m=>m.id)),c=e.routeCatalog?{...e.routeCatalog,routes:Fe(e.routeCatalog.routes,"route"),selectedRouteIds:J(e.routeCatalog.selectedRouteIds)}:void 0;for(let m of t)Z(`anchor ${m.id}`,[...m.nodeIds,...m.candidateNodeIds],a,"node");for(let m of n)Z(`node ${m.id}`,m.anchorIds,r,"anchor");for(let m of o){if(Z(`edge ${m.id}`,[m.fromNodeId,m.toNodeId],a,"node"),m.evidence.length===0)throw new Error(`Exploration edge ${m.id} has no evidence source.`);ei(m)}for(let m of i)Z(`path ${m.id}`,[m.fromAnchorId,m.toAnchorId],r,"anchor"),Z(`path ${m.id}`,m.nodeIds,a,"node"),Z(`path ${m.id}`,m.edgeIds,d,"edge");for(let m of s)if(Z(`frontier ${m.id}`,m.fromNodeIds,a,"node"),Z(`frontier ${m.id}`,m.edgeIds,d,"edge"),Z(`frontier ${m.id}`,m.memberNodeIds,a,"node"),m.memberCount!==m.memberNodeIds.length)throw new Error(`Exploration frontier ${m.id} reports ${m.memberCount} member(s) but identifies ${m.memberNodeIds.length}.`);for(let m of c?.routes??[])Z(`route ${m.id}`,m.nodeIds,a,"node"),Z(`route ${m.id}`,m.edgeIds,d,"edge"),Z(`route ${m.id}`,[m.anchorNodeId,m.endpointNodeId],a,"node");c&&Z("route catalog selection",c.selectedRouteIds,new Set(c.routes.map(m=>m.id)),"route");let l=J(e.incompleteReasons??[]),u=l.length===0?"accounted":"incomplete",f=t.reduce((m,p)=>m+p.omittedCandidates,0);return{schemaVersion:1,anchors:t,nodes:n,edges:o,paths:i,frontiers:s,coverage:{status:u,scope:e.scope,nodes:no(n),edges:no(o),matchedAnchors:t.filter(m=>m.status==="matched").length,ambiguousAnchors:t.filter(m=>m.status==="ambiguous").length,missingAnchors:t.filter(m=>m.status==="missing").length,omittedCandidates:f,frontierGroups:s.length,programEdges:Zr(o),blindSpots:J(e.blindSpots??[]),explanation:u==="accounted"?"Every node and edge discovered within the declared query scope is emitted, folded with recoverable identity, explicitly excluded, or reported unsupported.":`The declared query scope is not fully accounted for: ${l.join("; ")}`},completion:oi(u,i,e.scope),...c?{routeCatalog:c}:{}}}function Xr(e){return e.flatMap(t=>ti(t.semantics??[]).map(n=>({id:ni(t.id,n),sourceEdgeId:t.id,sourceKind:t.kind,fromNodeId:t.fromNodeId,toNodeId:t.toNodeId,directed:!0,disposition:t.disposition,evidence:[...t.evidence],family:n.family,subtype:n.subtype,...n.context?{context:{...n.context}}:{},...n.attributes?{attributes:{...n.attributes}}:{}}))).sort((t,n)=>t.id.localeCompare(n.id))}function Zr(e){let t=Xr(e),n=new Set(t.map(r=>r.sourceEdgeId)),o=new Map(ot.map(r=>[r,new Set])),i=new Map(ot.map(r=>[r,new Set])),s=new Map(ot.map(r=>[r,0]));for(let r of t)o.get(r.family).add(r.sourceEdgeId),i.get(r.family).add(r.subtype),s.set(r.family,s.get(r.family)+1);return{sourceEdges:e.length,mappedSourceEdges:n.size,projectedEdges:t.length,unmappedSourceEdges:e.length-n.size,unsupportedSourceEdges:e.filter(r=>r.disposition==="unsupported").length,unmappedKinds:J(e.filter(r=>!n.has(r.id)).map(r=>r.kind)),families:{identity:Re("identity",o,s,i),contract:Re("contract",o,s,i),control:Re("control",o,s,i),data:Re("data",o,s,i),state:Re("state",o,s,i),temporal:Re("temporal",o,s,i)}}}function Re(e,t,n,o){return{sourceEdges:t.get(e)?.size??0,projectedEdges:n.get(e)??0,subtypes:[...o.get(e)??[]].sort()}}function ei(e){let t=new Set;for(let n of e.semantics??[]){if(!Jr.has(n.family))throw new Error(`Exploration edge ${e.id} has unknown program edge family: ${n.family}.`);if(n.subtype.trim().length===0)throw new Error(`Exploration edge ${e.id} has an empty program edge subtype.`);let o=Tt(n);if(t.has(o))throw new Error(`Exploration edge ${e.id} repeats program edge semantic ${o}.`);t.add(o)}}function ti(e){return[...e].sort((t,n)=>Tt(t).localeCompare(Tt(n)))}function Tt(e){return`${e.family}:${e.subtype}`}function ni(e,t){return`program:${encodeURIComponent(e)}:${t.family}:${encodeURIComponent(t.subtype)}`}function oi(e,t,n){return e==="incomplete"||t.some(o=>o.status!=="connected")?{status:"coverage-incomplete",scope:n,explanation:"The declared graph query has an ambiguous, missing, candidate-only, or disconnected anchor relationship."}:t.length>0?{status:"connector-complete",scope:n,explanation:"Every requested anchor pair has a selected path supported by proved repository relationships."}:{status:"frontier-accounted",scope:n,explanation:"Every discovered direction in the declared graph query is emitted or represented by an exact frontier."}}function oo(e,t={}){let n=t.maxSelectedNodes??24;if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`maxSelectedNodes must be a positive safe integer; received ${n}`);let o=new Set(e.anchors.flatMap(g=>[...g.nodeIds,...g.candidateNodeIds])),i=[],s=e.anchors.filter(g=>g.status!=="missing"&&g.nodeIds.length+g.candidateNodeIds.length>0);for(let g=0;g<s.length;g+=1)for(let R=g+1;R<s.length;R+=1){let $=s[g],B=s[R],A=Xn(e,$,B,!1),h=A??Xn(e,$,B,!0);h?(h.nodeIds.forEach(k=>o.add(k)),i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:!A||$.status==="ambiguous"||B.status==="ambiguous"?"candidate":"connected",nodeIds:h.nodeIds,edgeIds:h.edgeIds})):i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:"partial",nodeIds:[],edgeIds:[]})}let r=J(t.routeIds??[]),a=ri(e,r),d=new Set(a.routes.map(g=>g.id)),c=r.filter(g=>!d.has(g));if(c.length>0)throw new Error(`Unknown exploration route id(s): ${c.join(", ")}`);let u=a.routes.filter(g=>r.includes(g.id)).map(g=>({anchorNodeId:g.anchorNodeId,endpointNodeId:g.endpointNodeId,endpointKind:g.endpointKind,endpointPriority:2,nodeIds:[...g.nodeIds].reverse(),edgeIds:[...g.edgeIds].reverse()}));for(let g of u)g.nodeIds.forEach(R=>o.add(R));let f=i.length===0||i.some(g=>g.edgeIds.length>0);f&&eo(e,o,n);let m=to(e,o),p=new Set(t.expandedFrontierIds??[]),b=new Set(m.map(g=>g.id)),S=[...p].filter(g=>!b.has(g)).sort();if(S.length>0)throw new Error(`Unknown exploration frontier id(s): ${S.join(", ")}`);for(let g of m)p.has(g.id)&&g.memberNodeIds.forEach(R=>o.add(R));f&&eo(e,o,n);let w=new Map(u.map(g=>[g.endpointNodeId,g.endpointKind])),I=new Set(u.flatMap(g=>g.nodeIds)),L=new Map;for(let g of u)for(let R=0;R<g.nodeIds.length;R+=1){let $=g.nodeIds[R],B=R;L.set($,Math.max(L.get($)??0,B))}let N=e.nodes.map(g=>{let R=w.get(g.id),$=I.has(g.id)?{upstreamCausalPath:!0,upstreamCausalDistance:L.get(g.id)??0,...R?{upstreamCausalEndpoint:R}:{}}:{};return{...g,attributes:{...g.attributes,...$},disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:o.has(g.id)?"emitted":"folded"}}),y=new Set([...i.flatMap(g=>g.edgeIds),...u.flatMap(g=>g.edgeIds)]),E=e.edges.map(g=>({...g,disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:y.has(g.id)||o.has(g.fromNodeId)&&o.has(g.toNodeId)?"emitted":"folded"})),C=it({anchors:e.anchors,nodes:N,edges:E,paths:i,frontiers:[...e.frontiers.filter(g=>g.disposition!=="folded"),...to({...e,nodes:N,edges:E},o)],scope:e.coverage.scope,blindSpots:e.coverage.blindSpots,incompleteReasons:e.coverage.status==="incomplete"?[e.coverage.explanation]:[],routeCatalog:a}),v=new Set(C.frontiers.flatMap(g=>g.edgeIds)),F=C.edges.filter(g=>g.disposition==="folded"&&!v.has(g.id)).map(g=>g.id);if(F.length>0)throw new Error(`Folded exploration edge(s) are not frontier-accounted: ${F.sort().join(", ")}`);return C}var Vn=10;function ri(e,t=[]){let n=new Map(e.nodes.map(S=>[S.id,S])),o=new Map(e.edges.map(S=>[S.id,S])),i=new Map;for(let S of e.edges){if(!ii(S))continue;let w=i.get(S.toNodeId)??[];w.push(S),i.set(S.toNodeId,w)}for(let S of i.values())S.sort((w,I)=>Number(qe(I))-Number(qe(w))||Jn(I)-Jn(w)||w.fromNodeId.localeCompare(I.fromNodeId)||w.id.localeCompare(I.id));let s=J(e.anchors.filter(S=>S.status==="matched").flatMap(S=>S.nodeIds)),r=new Map,a=new Set,d=(S,w,I)=>{let L=w.nodeIds[w.nodeIds.length-1],N=n.get(L),y=n.get(S);if(!N?.location||!y)return;let E=[...w.nodeIds].reverse(),C=[...w.edgeIds].reverse(),v=new Set(E),F=C.flatMap(A=>{let H=o.get(A);return H?[H]:[]}),g=e.edges.filter(A=>A.disposition!=="excluded"&&A.disposition!=="unsupported"&&(v.has(A.fromNodeId)||v.has(A.toNodeId))),R={id:rt("route",S,L,I,...C),status:"proved",anchorNodeId:S,anchorLabel:y.label,endpointNodeId:L,endpointLabel:N.label,endpointLocation:{...N.location},endpointKind:I,nodeIds:E,edgeIds:C,evidenceStrengths:J(F.flatMap(A=>A.evidence.map(H=>H.strength))),spineEdgeFamilies:Qn(F,!0),relatedEdgeFamilies:Qn(g,!1),crossesRuntimeBoundary:F.some(qe)},$=`${S}\0${L}\0${I}`,B=r.get($);(!B||Yn(R,B)<0)&&r.set($,R)};for(let S of s){n.get(S)?.attributes.publicEntry===!0&&d(S,{nodeIds:[S],edgeIds:[]},"public-entry");let w=[{nodeIds:[S],edgeIds:[]}],I=new Map([[S,0]]);for(let L=0;L<w.length;L+=1){let N=w[L],y=N.nodeIds[N.nodeIds.length-1];N.edgeIds.length>0&&n.get(y)?.location&&n.get(y)?.attributes.publicEntry===!0&&d(S,N,"public-entry");let E=i.get(y)??[];if(N.edgeIds.length>=Vn){E.some(C=>!N.nodeIds.includes(C.fromNodeId))&&a.add(S);continue}for(let C of E){if(N.nodeIds.includes(C.fromNodeId))continue;let v=N.edgeIds.length+1,F=I.get(C.fromNodeId);if(F!==void 0&&F<=v)continue;let g={nodeIds:[...N.nodeIds,C.fromNodeId],edgeIds:[...N.edgeIds,C.id]};if(I.set(C.fromNodeId,v),qe(C)&&n.get(C.fromNodeId)?.location){d(S,g,"runtime-boundary");continue}w.push(g)}}}let c=[...r.values()].sort(Yn),l=new Set(c.map(S=>S.id)),u=J(t.filter(S=>l.has(S))),f=J(c.map(S=>S.anchorNodeId)),m=s.filter(S=>!f.includes(S)),p=[...a].sort(),b=e.coverage.status==="accounted"&&p.length===0?"accounted":"incomplete";return{schemaVersion:1,routes:c,selectedRouteIds:u,coverage:{status:b,scope:"Distinct proved public-entry and runtime-boundary endpoints reachable upstream in the supplied topology.",enumeration:"one-shortest-proved-path-per-endpoint",maximumDepth:Vn,anchorNodeIds:s,anchorsWithRoutes:f,anchorsWithoutRoutes:m,depthLimitedAnchorNodeIds:p,routeCount:c.length,explanation:b==="accounted"?"Every distinct proved upstream public/runtime endpoint in the supplied topology has one stable shortest route.":"Route enumeration is incomplete because the supplied topology has incomplete coverage or a traversal reached the route-depth bound."}}}function Qn(e,t){let n=e.flatMap(o=>o.semantics?.map(i=>i.family)??[]);return t&&e.length>0&&n.length===0&&n.push("control"),J(n)}function Yn(e,t){return e.anchorNodeId.localeCompare(t.anchorNodeId)||e.edgeIds.length-t.edgeIds.length||e.endpointKind.localeCompare(t.endpointKind)||e.endpointNodeId.localeCompare(t.endpointNodeId)||e.id.localeCompare(t.id)}function ii(e){return e.disposition!=="excluded"&&e.disposition!=="unsupported"&&si(e)&&e.evidence.some(t=>["exact","derived","mixed"].includes(t.strength))}function si(e){return qe(e)||e.kind==="boundary-observation"||e.kind==="call"||e.kind==="compiler:call"}function qe(e){return e.kind==="runtime-boundary"||e.kind.startsWith("runtime:")}function Jn(e){let t={exact:5,derived:4,mixed:3,candidate:1,unknown:0};return Math.max(0,...e.evidence.map(n=>t[n.strength]))}function Xn(e,t,n,o){return Zn(e,t,n,o)??Zn(e,n,t,o)}function Zn(e,t,n,o){let i=[...t.nodeIds,...t.candidateNodeIds].sort(),s=new Set([...n.nodeIds,...n.candidateNodeIds]);if(i.some(l=>s.has(l)))return{nodeIds:[i.find(u=>s.has(u))],edgeIds:[]};let r=new Set(e.nodes.filter(l=>l.kind==="structural-region").map(l=>l.id)),a=new Map;for(let l of e.edges)l.disposition==="excluded"||l.disposition==="unsupported"||l.kind==="structural-membership"||r.has(l.fromNodeId)||r.has(l.toNodeId)||l.evidence.every(f=>["candidate","unknown"].includes(f.strength))&&!o||ai(a,l.fromNodeId,l.toNodeId,l.id);for(let l of a.values())l.sort((u,f)=>u.nodeId.localeCompare(f.nodeId)||u.edgeId.localeCompare(f.edgeId));let d=i.map(l=>({nodeId:l,nodeIds:[l],edgeIds:[]})),c=new Set(i);for(let l=0;l<d.length;l+=1){let u=d[l];for(let f of a.get(u.nodeId)??[]){if(c.has(f.nodeId))continue;let m={nodeId:f.nodeId,nodeIds:[...u.nodeIds,f.nodeId],edgeIds:[...u.edgeIds,f.edgeId]};if(s.has(f.nodeId))return m;c.add(f.nodeId),d.push(m)}}return null}function ai(e,t,n,o){let i=e.get(t)??[];i.push({nodeId:n,edgeId:o}),e.set(t,i)}function li(e,t,n){let o=new Map;for(let a of e.edges){let d=o.get(a.fromNodeId)??{incoming:0,outgoing:0},c=o.get(a.toNodeId)??{incoming:0,outgoing:0};d.outgoing+=1,c.incoming+=1,o.set(a.fromNodeId,d),o.set(a.toNodeId,c)}let i=new Set,s=new Map;for(let a of e.edges){let d=t.has(a.fromNodeId),c=t.has(a.toNodeId);if(d===c)continue;let l=d?a.toNodeId:a.fromNodeId,u=d?a.fromNodeId:a.toNodeId,f=e.nodes.find(b=>b.id===l);if(f?.kind==="structural-region")continue;let m=s.get(l)??new Set;m.add(u),s.set(l,m),(/(?:runtime-boundary|external)/u.test(a.kind)||f&&/(?:frontier|external)/u.test(f.kind))&&i.add(l)}let r=[...s].filter(([a,d])=>{if(i.has(a))return!0;let c=o.get(a)??{incoming:0,outgoing:0};return(c.incoming>1||c.outgoing>1)&&d.size>1}).sort(([a,d],[c,l])=>Number(i.has(c))-Number(i.has(a))||l.size-d.size||a.localeCompare(c)).map(([a])=>a);for(let a of r){if(t.size>=n)break;t.add(a)}}function eo(e,t,n){let o=-1;for(;t.size!==o&&t.size<n;)o=t.size,li(e,t,n)}function to(e,t){let n=new Set(e.nodes.filter(r=>!t.has(r.id)&&r.disposition!=="excluded"&&r.disposition!=="unsupported").map(r=>r.id)),o=new Map;for(let r of e.edges){if(!n.has(r.fromNodeId)||!n.has(r.toNodeId))continue;let a=o.get(r.fromNodeId)??new Set,d=o.get(r.toNodeId)??new Set;a.add(r.toNodeId),d.add(r.fromNodeId),o.set(r.fromNodeId,a),o.set(r.toNodeId,d)}let i=[],s=new Set;for(let r of[...n].sort()){if(s.has(r))continue;let a=[],d=[r];s.add(r);for(let c=0;c<d.length;c+=1){let l=d[c];a.push(l);for(let u of[...o.get(l)??[]].sort())s.has(u)||(s.add(u),d.push(u))}i.push(a.sort())}return i.map(r=>{let a=new Set(r),d=e.edges.filter(p=>a.has(p.fromNodeId)||a.has(p.toNodeId)),c=d.filter(p=>a.has(p.fromNodeId)!==a.has(p.toNodeId)),l=J(c.map(p=>a.has(p.fromNodeId)?p.toNodeId:p.fromNodeId)),u=new Set(c.map(p=>a.has(p.toNodeId)?"outgoing":"incoming")),f=J(d.map(p=>p.id)),m=J(c.map(p=>p.kind));return{id:rt("frontier",...r,...f),kind:m.join("+")||"disconnected",direction:u.size===1?[...u][0]:"undirected",fromNodeIds:l,edgeIds:f,memberNodeIds:r,memberCount:r.length,disposition:"folded",reason:c.length>0?"Connected evidence is folded beyond the first edge leaving the selected connector graph.":"Discovered evidence is disconnected from every selected anchor connector under the declared relation scope.",expansion:null}})}function rt(e,...t){let n=Yr("sha256").update(t.join("\0")).digest("hex").slice(0,16);return`${e}:${n}`}function Fe(e,t){let n=[...e].sort((o,i)=>o.id.localeCompare(i.id));for(let o=1;o<n.length;o+=1)if(n[o-1].id===n[o].id)throw new Error(`Duplicate exploration ${t} id: ${n[o].id}`);return n}function Z(e,t,n,o){let i=J(t.filter(s=>!n.has(s)));if(i.length>0)throw new Error(`Exploration ${e} references missing ${o}(s): ${i.join(", ")}`)}function no(e){return{total:e.length,emitted:e.filter(t=>t.disposition==="emitted").length,folded:e.filter(t=>t.disposition==="folded").length,excluded:e.filter(t=>t.disposition==="excluded").length,unsupported:e.filter(t=>t.disposition==="unsupported").length}}function J(e){return[...new Set(e)].sort()}var di=5,ci=12,ui=8,pi=3,ro=8,mi=6,fi=12,io=12,gi=12,yi=2,bi=new Set(["branch","loop","call","await","return","throw","mutation","catch","finally"]),Si=9e3,so=fn,ao=new WeakMap;function Ua(e,t){return So(e,t,"full")}function za(e,t){return So(e,t,"topology")}function hi(e,t,n,o,i,s=!1){let r=e.get(t);if(r)return r.depth=Math.min(r.depth,n),r.primary||=i,r.promoteBoundaryImports||=s,r.origins.add(o),r;let a={file:t,depth:n,primary:i,promoteBoundaryImports:s,origins:new Set([o]),processed:!1};return e.set(t,a),a}function xi(e,t,n,o,i,s,r="none",a=!1){let d=e.get(n.symbol);if(d)return d.depth=Math.min(d.depth,o),d.origins.add(i),s&&d.anchorQueries.add(s),d.referenceScope=Ss(d.referenceScope,r),t(n.relativePath,o,i,!0,a),d;let c={definition:n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),referenceScope:r,processed:!1};return e.set(n.symbol,c),t(n.relativePath,o,i,!0,a),c}function vi(e,t,n,o,i,s,r=!1,a=!0){let d=de(n),c=e.get(d);if(c)return c.depth=Math.min(c.depth,o),c.origins.add(i),s&&c.anchorQueries.add(s),c.reverseCallExpansion||=r,c.traversalEligible||=a,t(n.file,o,i,c.traversalEligible,!0),c;let l={...n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),reverseCallExpansion:r,traversalEligible:a};return e.set(d,l),t(n.file,o,i,a,!0),l}function Ei(e){let{db:t,index:n,pendingRelations:o,addFile:i,addSymbol:s,addSourceConstruct:r,observation:a,depth:d,origin:c}=e;i(a.source.file,d,c,!0,!0),a.owner.file!==a.source.file&&i(a.owner.file,d,`${c}:owner`,!0,!0);let l=fe(t,a.owner.file),u=a.owner.symbol?ye(t,n,a.owner.symbol).matches.find(p=>p.relativePath===a.owner.file):null,f=(u&&!Y(u.symbol)?u:null)??Me(l,a.source.startLine);if(f&&!Y(f.symbol))return s(f,d,c,void 0,"none",!0),f.symbol;a.owner.name&&r({file:a.owner.file,name:a.owner.name,startLine:a.owner.startLine,endLine:a.owner.endLine},d,`${c}:source-owner`,void 0,!0);let m=e.index.definitionsForFile(a.source.file).filter(p=>!!p.leaf&&gt(t,a.source.file,p.leaf).some(b=>b>=a.source.startLine&&b<=a.source.endLine));if(m.length===1){let p=m[0];s(p,d,`${c}:handler-identifier`,void 0,"none",!0),ne(o,{kind:"runtime-boundary",evidence:"runtime-boundary:handler-identifier",fromFile:a.source.file,fromSymbol:null,toFile:p.relativePath,toSymbol:p.symbol,fromBoundaryParticipant:Pe(a),line:a.source.startLine,strength:"derived"})}return null}function Ii(e){let t=0,n=0,o=0;for(let i of e.searches){let s=ts(e.db,e.index,i,e.boundaryObservationLocations),r=s.filter(l=>ss(l,e.sourceAllowed)),a=!e.opts.fullLiteralTraversal&&(s.length>ci||r.length>ui),d=a?[]:s,c=new Set((a?[]:e.opts.fullLiteralTraversal?r:[...r].sort(ns).slice(0,pi)).map(mo));a&&(n+=1,o+=s.length);for(let l of d){let u=c.has(mo(l)),f=u&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerEndLine!==null;if(e.addFile(l.relativePath,0,`${u?"literal-anchor":"literal-match"}:${i}`,f,f),f&&e.addSourceConstruct({file:l.relativePath,name:l.ownerShortName??`${l.relativePath}:${l.ownerStartLine+1}`,startLine:l.ownerStartLine,endLine:l.ownerEndLine},0,`literal-source-owner:${i}`,i,!0),u&&l.ownerSymbol){let m=ye(e.db,e.index,l.ownerSymbol).matches[0];m&&!Y(m.symbol)&&e.addSymbol(m,0,"literal-owner",i,"all",!0)}e.literalHits.push({query:i,file:l.relativePath,line:l.line,ownerSymbol:l.ownerSymbol,ownerShortName:l.ownerShortName,ownerStartLine:l.ownerStartLine,ownerEndLine:l.ownerEndLine,sourceLine:l.sourceLine.trim(),matchKind:l.matchKind,traversalSeed:u})}e.anchors.push({kind:"literal",query:i,status:s.length>0?"matched":"missing",matchedRegionIds:[],matchingLines:s.length,seedMatchingLines:a?0:c.size,matchOnlyLines:s.length-c.size,eligibleSeedMatchingLines:r.length,materializedMatchingLines:d.length,withheldMatchingLines:a?s.length:0,literalTraversal:a?"withheld-broad":"materialized",representativeMatches:a?as(i,s):void 0,narrowingCommands:a?ds(i,s):void 0,exhaustiveTraversalCommand:a||c.size<r.length?`scip-query system-map --search ${O(i)} --full-literal-traversal`:void 0,seedRegionIds:[],matchOnlyRegionIds:[]})}for(let i of e.symbolQueries){let s=ye(e.db,e.index,i);t+=s.omitted;let r=os(e.db,i),a=s.matches.filter(f=>!Y(f.symbol)),d=r!==null&&a.length===0;d&&e.addSourceConstruct(r,0,"source-construct-anchor",i,!0);let c=d?a:s.matches;for(let f of c)e.addSymbol(f,0,"symbol-anchor",i,"all",!0);let l=d?rs(r):null,u=d?1:s.total;e.anchors.push({kind:"symbol",query:i,status:u===0?"missing":u===1?"matched":"ambiguous",matchedRegionIds:[],symbolCandidates:[...l?[l]:[],...c.map(fs)],totalSymbolCandidates:u,omittedSymbolCandidates:s.omitted})}return{omittedSymbolCandidates:t,broadLiteralAnchors:n,withheldLiteralMatches:o}}function Ci(e){let{db:t,opts:n,mode:o,searches:i,symbolQueries:s,maxDepth:r,maxTopologyCharacters:a,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,workspaces:u,runtimeBoundaries:f,boundaryObservations:m,representedBoundaryLinkIds:p,files:b,symbols:S,sourceConstructs:w,literalHits:I,pendingRelations:L,externalImports:N,anchors:y,omittedSymbolCandidates:E,broadLiteralAnchors:C,withheldLiteralMatches:v,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,sourceAllowed:$}=e,B=new Set(d),A=new Map;for(let x of b.keys())A.set(x,Ue(x,u));let H=[...L.values()].filter(x=>A.has(x.fromFile)&&A.has(x.toFile)).map(x=>({...x,fromRegionId:A.get(x.fromFile).id,toRegionId:A.get(x.toFile).id})).sort(Eo),h=Ms(H),k=new Set(n.expand??[]),M=Is(b,S,I,H,h,A,k),_=new Set([...b.values()].filter(x=>[...x.origins].some(P=>P.startsWith("literal-anchor:")||P==="literal-owner"||P==="symbol-anchor")).map(x=>A.get(x.file).id)),W=Xi(M),q=new Set(M.map(x=>x.id)),U=[...k].filter(x=>!q.has(x)).sort();for(let x of y)if(x.matchedRegionIds=Rs(x,I,S,A),x.kind==="literal"){let P=I.filter(z=>z.query===x.query);x.seedRegionIds=D(P.filter(z=>z.traversalSeed).map(z=>A.get(z.file).id)),x.matchOnlyRegionIds=D(P.filter(z=>!z.traversalSeed).map(z=>A.get(z.file).id))}let K=[...S.values()].filter(x=>!x.processed).length,ae=[...b.values()].filter(x=>x.primary&&!x.processed).length,Le=[...b.values()].filter(x=>!x.primary&&!x.processed).length,ze=[...S.values()].filter(x=>x.processed),we=(f?.frontiers??[]).flatMap(x=>{let P=m.get(x.observationId);return!P&&x.source&&x.action&&x.strength?!B.has("runtime-boundary")||!$(x.source.file)||c==="exact"||!b.has(x.source.file)?[]:[{observationId:x.observationId,action:x.action,strength:x.strength,file:x.source.file,line:x.source.startLine,ownerShortName:x.ownerShortName??null,address:x.address??x.missingKeyParts.join(", "),reason:x.reason}]:!B.has("runtime-boundary")||!P||!$(P.source.file)||c==="exact"&&P.strength!=="exact"||!b.has(P.source.file)?[]:[{observationId:P.id,action:P.action,strength:P.strength,file:P.source.file,line:P.source.startLine,ownerShortName:P.owner.name,address:vo(P),reason:x.reason,protocol:P.protocol,role:P.role,modality:P.modality,resolution:P.resolution,sourceScope:P.sourceScope,keyParts:P.keyParts.map(z=>({name:z.name,value:z.value,evidence:z.evidence}))}]}).sort((x,P)=>x.file.localeCompare(P.file)||x.line-P.line),me=(f?.links??[]).filter(x=>{if(!B.has("runtime-boundary")||c==="exact"&&x.strength!=="exact")return!1;let P=m.get(x.from),z=m.get(x.to);return!!(P&&z&&$(P.source.file)&&$(z.source.file)&&(b.has(P.source.file)||b.has(z.source.file)))}),T=me.filter(x=>x.strength==="exact").length,oe=me.filter(x=>x.strength==="derived").length,re=me.filter(x=>x.strength==="candidate").length,be=f?.links.filter(x=>x.strength==="exact").length??0,Se=f?.links.filter(x=>x.strength==="derived").length??0,ke=f?.links.filter(x=>x.strength==="candidate").length??0,ct=Ns(N,A),ut=E===0?"accounted":"incomplete",Bt=[...C>0?[`${C} broad literal anchor(s) withheld ${v} exact match(es) before graph traversal; representative identities and scoped search commands preserve recovery without treating every textual occurrence as relevant.`]:[],`Literal matches outside the included source scopes (${l.join(", ")}) remain visible as match-only evidence and do not seed traversal.`,f?"Built-in runtime-boundary extractors traverse direct and replayably derived links; heuristic candidates, unsupported frameworks, reflection, generated names, and dependency wiring not recoverable from compiler occurrences or constructor assignments remain disclosed frontiers.":"Runtime-boundary evidence is unavailable for this index; run scip-query reindex with this build to extract supported HTTP, event, registry, and persistence observations.","Reverse references do not recursively expand from discovered callers or callees.","Member calls use compiler occurrences, exact constructor-assigned fields, bounded unique service providers, direct factory-return members, and compiler-resolved object-literal callbacks when available. Ambiguous providers remain candidate frontiers; callback values routed through mutation, reflection, or unsupported dependency containers remain unrepresented.","Literal traversal is bounded to the smallest parser-delimited source construct; parser gaps may reduce an owner to one source line and leave its continuation untraversed.","Schema consumers stay within forward-flow regions; cross-workspace contracts may discover consumers in other workspaces. Add an explicit symbol anchor to widen either scope.",`Traversal stops after depth ${r}; nonzero frontier counts identify evidence that was discovered but not traversed.`,"Region labels are structural path groupings, not inferred runtime or architectural boundaries."],ie=ji({db:t,anchors:y,regions:M,symbolStates:S,sourceConstructStates:w,literalHits:I,relations:H,externalBoundaries:ct,boundaryFrontiers:we,regionForFile:A,closureStatus:ut,omittedSymbolCandidates:E,maxDepth:r,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,blindSpots:Bt,topologyFrontiers:n.topologyFrontiers??[],routeIds:n.routeIds??[],expandedRegionIds:[...k],maxTopologyCharacters:a,fullLiteralTraversal:n.fullLiteralTraversal??!1});if(o==="topology")return ie;let Ot=(n.behaviorFocusLocations?.length??0)>0?new Set([...ie.anchors.flatMap(x=>x.nodeIds),...ie.paths.flatMap(x=>x.nodeIds)]).size:void 0,Ge=dn(t,ie,{focusLocations:n.behaviorFocusLocations,...Ot?{maxSteps:Ot}:{}});pn(t,ie,Ge);let Co=Ri(t,ie,Ge,n.behaviorFocusLocations??[]);ie.corridor=zn(ie,{focusLocations:Co});let _t=un(t,ie,Ge,{sourceAllowed:$,selectionTerms:n.selectionTerms}),Kt=Hi(ie),Lo=Yi(i,s,r,d,c,l,n.fullLiteralTraversal??!1,a,M,h,_,k,Kt),wo=Qi(i,s,r,M.filter(x=>Kt.has(x.id)),_,d,c,l,n.fullLiteralTraversal??!1,a);return{anchors:y,regions:M,regionRelations:h,externalBoundaries:ct,boundaryFrontiers:we,unmatchedExpansions:U,expansion:wo,drilldown:W,presentation:Lo,topology:ie,behavior:Ge,nextAnchors:_t,closure:{status:ut,emitted:{regions:M.length,relations:H.length,runtimeLinks:p.size},withheld:{symbols:K,files:ae+Le,regions:ie.nodes.filter(x=>x.kind==="structural-region"&&x.disposition==="folded").length,drillAnchors:(W?.omittedAnchors??0)+_t.omittedAnchors,literalMatches:v},ambiguous:{anchors:y.filter(x=>x.status==="ambiguous").length,omittedSymbolCandidates:E},external:ct.length,unresolved:we.length,explanation:ut==="accounted"?"Every fact reached under the declared anchors, relations, depth, evidence floor, source scopes, and installed analyzers is accounted for as emitted, withheld, ambiguous, external, or unresolved.":"Some ambiguous symbol candidates were not identified, so the declared query is not fully accounted for."},coverage:{explicitAnchorCount:y.length,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,matchedAnchorCount:y.filter(x=>x.status!=="missing").length,literalSearchesComplete:!0,broadLiteralAnchors:C,withheldLiteralMatches:v,symbolCandidateSetsComplete:E===0,omittedSymbolCandidates:E,maxTraversalDepth:r,frontierSymbols:K,frontierFiles:ae,supportFilesNotTraversed:Le,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,runtimeBoundaryEvidenceAvailable:f!==null,runtimeBoundaryObservations:f?.observations.length??0,runtimeBoundaryExactLinks:T,runtimeBoundaryDerivedLinks:oe,runtimeBoundaryCandidateLinks:re,repositoryRuntimeBoundaryExactLinks:be,repositoryRuntimeBoundaryDerivedLinks:Se,repositoryRuntimeBoundaryCandidateLinks:ke,runtimeBoundaryTraversedLinks:p.size,runtimeBoundaryFrontiers:we.length,referenceExpansionEligibleSymbols:ze.filter(x=>x.referenceScope!=="none").length,referenceExpansionSkippedSymbols:ze.filter(x=>x.referenceScope==="none").length,dynamicDispatchRepresented:f?.links.some(x=>x.joinRule==="carrier.discriminator"&&p.has(x.id))??!1,runtimeGeneratedLinksRepresented:f!==null,regionBoundariesAreStructural:!0,relationFamilies:{"literal-anchor":{evidence:"exact-source",scope:"all indexed documents for each explicit literal",completeWithinScope:!0},reference:{evidence:"compiler-graph",scope:"all cross-file indexed/source-attributed sites for explicit anchors and promoted non-module boundary symbols",completeWithinScope:!0},call:{evidence:"mixed",scope:"static callees plus exact SCIP call occurrences in traversed source ranges, exact constructor-assigned member receivers, and uniquely attributed direct-import member candidates",completeWithinScope:!0},"contract-symbol":{evidence:"compiler-graph",scope:"compiler-resolved symbol identities referenced across inferred workspace boundaries",completeWithinScope:!0},import:{evidence:"compiler-graph",scope:"all indexed or source-resolved imports of traversed primary files",completeWithinScope:!0},"runtime-boundary":{evidence:"exact-source",scope:"direct and mechanically derived links produced by grounded runtime adapters and factorized relation groups",completeWithinScope:!0}},blindSpots:Bt}}}function Li(e,t){let{db:n,relationPolicy:o,sourceConstructs:i,reverseExpandedSourceConstructs:s,pendingRelations:r,reverseFileGraph:a,serviceCallerFilesBySourceConstruct:d,sourceAllowed:c,memberCallTargetsForWholeFile:l,addSymbol:u,addSourceConstruct:f}=e;if(o.has("call")){let m=[...i.values()].filter(p=>p.traversalEligible&&p.reverseCallExpansion&&p.depth<=t&&!s.has(de(p)));for(let p of m){s.add(de(p));let b=ce(n,p.file);if((b?.callables??[]).filter(I=>I.name===p.name&&I.startLine<=p.endLine&&I.endLine>=p.startLine).length===1){let I=(b?.callSites??[]).filter(L=>L.calleeLeaf===p.name&&!L.memberAccess);for(let L of I){let N=t+1,y=Me(fe(n,p.file),L.line),E=null,C=null;if(y&&!Y(y.symbol)){if(y.relativePath===p.file&&y.startLine<=p.endLine&&y.endLine>=p.startLine)continue;u(y,N,"reverse-local-call-owner",void 0,"forward-regions",!0),E=y.symbol}else{let v=Pt(n,p.file,L.line);v&&de(v)!==de(p)&&(C=f(v,N,"reverse-local-call-source-owner",void 0,!0))}!E&&!C||ne(r,{kind:"call",evidence:"ast-callsite",fromFile:p.file,fromSymbol:E,toFile:p.file,toSymbol:null,fromSourceConstruct:C?X(C):void 0,toSourceConstruct:X(p),line:L.line,strength:"derived"})}}let w=new Set([...a.get(p.file)??[],...d.get(de(p))??[],...ln(n,p.file).flatMap(I=>[...a.get(I)??[]])]);for(let I of w){if(!c(I))continue;let N=l(I).targets.filter(y=>y.targetFile===p.file&&y.targetStartLine<=p.endLine&&y.targetEndLine>=p.startLine);for(let y of N){let E=t+1,C=Me(fe(n,I),y.line),v=null,F=null;if(C&&!Y(C.symbol))u(C,E,"reverse-member-call-owner",void 0,"cross-workspace-or-forward",!0),v=C.symbol;else{let g=Pt(n,I,y.line);g&&(F=f(g,E,"reverse-member-call-source-owner",void 0,!0))}!v&&!F||ne(r,{kind:"call",evidence:"ast-service-member-callsite",fromFile:I,fromSymbol:v,toFile:p.file,toSymbol:null,fromSourceConstruct:F?X(F):void 0,toSourceConstruct:X(p),line:y.line,strength:y.strength==="exact"?"exact":"derived"})}}}}}function wi(e,t){let{db:n,index:o,relationPolicy:i,symbols:s,sourceAllowed:r,files:a,workspaces:d,addFile:c,addSymbol:l,addSourceConstruct:u,pendingRelations:f,fileGraph:m,traversalMetrics:p}=e,b=[...s.values()].filter(w=>!w.processed&&w.depth<=t),S=i.has("call")?o.calleeMap(b.map(w=>w.definition),{additive:!1,semantic:!1}):new Map;for(let w of b){w.processed=!0;let I=w.definition;if(w.referenceScope!=="none"&&(i.has("call")||i.has("reference")||i.has("contract-symbol"))){let L=us(n,o,I).filter(y=>r(y.file)&&bs(w,y.file,a,d)),N=new Set(L.flatMap(y=>{if(!(i.has("call")&&ce(n,y.file)?.callSites.some(v=>v.line===y.line&&lo(n,y.file,v,I))===!0)||!y.enclosingSymbol)return[];let C=ye(n,o,y.enclosingSymbol).matches[0];return C&&!Y(C.symbol)?[{owner:C,site:y}]:[]}).sort((y,E)=>{let C=ee(I.relativePath,d).relativeDir,v=ee(y.owner.relativePath,d).relativeDir===C,F=ee(E.owner.relativePath,d).relativeDir===C,g=co(n,y.owner),R=co(n,E.owner),$=y.owner.endLine-y.owner.startLine,B=E.owner.endLine-E.owner.startLine;return Number(F)-Number(v)||R-g||$-B||y.owner.symbol.localeCompare(E.owner.symbol)}).filter((y,E,C)=>C.findIndex(v=>v.owner.symbol===y.owner.symbol)===E).reduce((y,E)=>{if(y.length>=yi)return y;let C=ee(E.owner.relativePath,d).relativeDir;return y.some(v=>v.workspace===C)||y.push({symbol:E.owner.symbol,workspace:C}),y},[]).map(y=>y.symbol));for(let y of L){let E=t+1;c(y.file,E,`reference:${V(I.symbol)}`,!0);let C=i.has("call")&&ce(n,y.file)?.callSites.some(g=>g.line===y.line&&lo(n,y.file,g,I))===!0,v=null,F=null;if(y.enclosingSymbol){let g=ye(n,o,y.enclosingSymbol).matches[0];g&&!Y(g.symbol)&&(l(g,E,"reference-owner",void 0,C&&N.has(g.symbol)?w.referenceScope:"none"),v=g.symbol)}if(!v&&y.line!==null){let g=Pt(n,y.file,y.line);g&&(F=u(g,E,"reference-source-owner",void 0,C))}i.has("reference")&&ne(f,{kind:"reference",evidence:"indexed-or-source-reference",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"mixed"}),C&&ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"derived"}),i.has("contract-symbol")&&ee(y.file,d).relativeDir!==ee(I.relativePath,d).relativeDir&&ne(f,{kind:"contract-symbol",evidence:"compiler-cross-workspace-symbol",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"exact"})}}for(let L of S.get(I.symbolId)??[]){let N=ye(n,o,L.symbol).matches.find(E=>E.relativePath===L.file);if(!N||!r(N.relativePath))continue;if(!(N.relativePath===I.relativePath||(m.get(I.relativePath)??new Set).has(N.relativePath))){p.filteredUnverifiedCallEdges+=1;continue}l(N,t+1,`call:${V(I.symbol)}`,void 0,"none",!0),ne(f,{kind:"call",evidence:L.source,fromFile:I.relativePath,fromSymbol:I.symbol,toFile:N.relativePath,toSymbol:N.symbol,line:null,strength:Vi(L.source)})}}}function Mi(e,t){let{db:n,index:o,relationPolicy:i,files:s,sourceConstructs:r,symbols:a,boundaryObservations:d,boundaryObservationDepths:c,sourceAllowed:l,addSymbol:u,pendingRelations:f,traversalMetrics:m,addSourceConstruct:p,serviceCallerFilesBySourceConstruct:b,reverseFileGraph:S,externalImports:w,addFile:I,workspaces:L}=e,N=[...s.values()].filter(y=>!y.processed&&y.primary&&y.depth<=t);for(let y of N){y.processed=!0;let E=[...r.values()].filter(h=>h.traversalEligible&&h.file===y.file&&h.depth<=t),C=[...a.values()].filter(h=>h.definition.relativePath===y.file&&h.depth<=t).map(h=>{let k=ht(n,y.file,h.definition.startLine);return{startLine:k?.startLine??h.definition.startLine,endLine:k?.endLine??h.definition.endLine}}),v=h=>[...a.values()].filter(k=>k.definition.relativePath===y.file&&k.definition.startLine<=h&&k.definition.endLine>=h).sort((k,M)=>k.definition.endLine-k.definition.startLine-(M.definition.endLine-M.definition.startLine)||k.definition.startLine-M.definition.startLine)[0],F=[...d.values()].filter(h=>h.source.file===y.file&&c.has(h.id)),g=[...E.map(h=>({startLine:h.startLine,endLine:h.endLine})),...F.map(h=>({...st(n,h)}))],R=[...C,...g],$=(ce(n,y.file)?.callSites??[]).filter(h=>R.some(k=>h.line>=k.startLine&&h.line<=k.endLine)),B=new Set;if(i.has("call"))for(let h of R){let k=Vt(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath))continue;let _=v(M.sourceLine),W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-call:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"call",evidence:"scip-occurrence-callsite",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"}),B.add(`${M.sourceLine}\0${M.calleeLeaf}`)}}if(i.has("reference"))for(let h of R){let k=Qt(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath)||B.has(`${M.sourceLine}\0${M.calleeLeaf}`))continue;let _=v(M.sourceLine);if(_?.definition.symbol===M.definition.symbol)continue;let W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-reference:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"reference",evidence:"scip-occurrence-reference",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"})}}let A=i.has("call")?St(n,y.file,{ranges:R,excludeIndexedTargets:!1}):{targets:[],unresolvedCallsites:0};m.unresolvedMemberCallsites+=A.unresolvedCallsites;let H=A.targets.filter(h=>!B.has(`${h.line}\0${h.calleeLeaf}`));m.memberCallCandidateEdges+=H.filter(h=>h.strength!=="exact"&&(h.resolution!=="imported-service-object-member"||(h.resolutionAlternativeCount??0)>1)).length;for(let h of H){let k=(h.resolutionAlternativeCount??1)===1,M=h.targetSymbol?fe(n,h.targetFile).find(K=>K.symbol===h.targetSymbol):void 0,_=M?null:p({file:h.targetFile,name:h.calleeLeaf,startLine:h.targetStartLine,endLine:h.targetEndLine},t+1,`member-call:${y.file}`,void 0,h.resolution==="imported-service-object-member"&&k,k);if(_&&h.serviceFile){let K=de(_),ae=b.get(K)??new Set;for(let Le of S.get(h.serviceFile)??[])ae.add(Le);b.set(K,ae)}M&&u(M,t+1,`member-call:${y.file}`,void 0,"none",!0);let W=E.find(K=>K.startLine<=h.line&&K.endLine>=h.line),q=v(h.line),U=F.find(K=>{let ae=st(n,K);return ae.startLine<=h.line&&ae.endLine>=h.line});ne(f,{kind:"call",evidence:h.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":h.resolution==="factory-callback-member"?"ast-factory-callback-callsite":h.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-member-import-candidate",fromFile:y.file,fromSymbol:q?.definition.symbol??null,toFile:h.targetFile,toSymbol:M?.symbol??null,fromBoundaryParticipant:U?Pe(U):void 0,fromSourceConstruct:W?X(W):void 0,toSourceConstruct:_?X(_):void 0,line:h.line,strength:h.resolution==="imported-service-object-member"?(h.resolutionAlternativeCount??0)===1?"derived":"candidate":h.strength??"candidate"})}for(let h of i.has("import")||i.has("call")?ps(n,y.file):[]){if(!h.fromFile){if(i.has("import")){let M=w.get(h.shortName)??{name:h.shortName,fromFiles:new Set};M.fromFiles.add(y.file),w.set(h.shortName,M)}continue}if(!l(h.fromFile))continue;if(i.has("import")&&(I(h.fromFile,t+1,`import:${y.file}`,!1),ne(f,{kind:"import",evidence:"indexed-or-source-import",fromFile:y.file,fromSymbol:null,toFile:h.fromFile,toSymbol:h.symbol,line:null,strength:"mixed"})),i.has("call")&&$.length>0){let M=(h.source==="compiler"?ye(n,o,h.symbol).matches:Zt(n,h.fromFile,h.importedName)).filter(_=>!Y(_.symbol));for(let _ of M){let W=$.filter(q=>q.calleeLeaf===h.localName).map(q=>q.line);if(W.length!==0){u(_,t+1,`source-call:${y.file}`,void 0,"none",!0);for(let q of W)ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:null,toFile:_.relativePath,toSymbol:_.symbol,line:q,strength:"derived"})}}}if(!y.promoteBoundaryImports||!gs(y.file,h.fromFile,L))continue;let k=ye(n,o,h.symbol);for(let M of k.matches)if(ys(M.relativePath,h.fromFile,L)&&!Y(M.symbol)){let _=ee(y.file,L).relativeDir!==ee(M.relativePath,L).relativeDir;u(M,t+1,`boundary-import:${y.file}`,void 0,_?"cross-workspace-or-forward":"forward-regions")}}}}function Ni(e,t){let{relationPolicy:n,runtimeBoundaries:o,evidenceFloor:i,representedBoundaryLinkIds:s,boundaryObservations:r,sourceAllowed:a,boundaryObservationDepths:d,symbols:c,sourceConstructs:l,addBoundaryObservation:u,pendingRelations:f}=e;for(let m of n.has("runtime-boundary")?o?.links??[]:[]){if(m.strength==="candidate"||i==="exact"&&m.strength!=="exact"||s.has(m.id))continue;let p=r.get(m.from),b=r.get(m.to);if(!p||!b||!a(p.source.file)||!a(b.source.file))continue;let S=yo(p,t,d,c,l),w=yo(b,t,d,c,l);if(S===null&&w===null)continue;let I=t+1,L=u(p,S??I,`runtime-boundary:${m.joinRule}`),N=u(b,w??I,`runtime-boundary:${m.joinRule}`),y=L?null:go(l,p),E=N?null:go(l,b);d.set(p.id,S??I),d.set(b.id,w??I),ne(f,{kind:"runtime-boundary",evidence:`runtime-boundary:${m.joinRule}`,fromFile:p.source.file,fromSymbol:L,toFile:b.source.file,toSymbol:N,fromBoundaryParticipant:Pe(p),toBoundaryParticipant:Pe(b),fromSourceConstruct:y?X(y):void 0,toSourceConstruct:E?X(E):void 0,runtimeBoundaryKey:m.matchedKeyParts.map(C=>`${C.name}=${C.value}`).join(" "),line:p.source.startLine,strength:m.strength}),s.add(m.id)}}function So(e,t,n){let o=$e(t.searches??[]),i=$e(t.symbols??[]),s=$e(t.relations&&t.relations.length>0?t.relations:so),r=s.filter(T=>!so.includes(T));if(r.length>0)throw new Error(`Unsupported system-map relation kind(s): ${r.join(", ")}`);let a=new Set(s),d=t.evidenceFloor??"derived";if(d!=="exact"&&d!=="derived")throw new Error(`Unsupported system-map evidence floor: ${d}`);let c=$e(t.sourceScopes&&t.sourceScopes.length>0?t.sourceScopes:["production"]),l=["production","test","fixture","example","generated","script","unknown"],u=c.filter(T=>!l.includes(T));if(u.length>0)throw new Error(`Unsupported system-map source scope(s): ${u.join(", ")}`);let f=new Set(c),m=T=>f.has(bt(T));if(o.length===0&&i.length===0)throw new Error("system-map requires at least one --search or --symbol anchor.");let p=t.maxDepth??di;if(!Number.isSafeInteger(p)||p<0)throw new RangeError(`maxDepth must be a non-negative safe integer; received ${p}`);let b=t.maxTopologyCharacters??Si;if(!Number.isSafeInteger(b)||b<=0)throw new RangeError(`maxTopologyCharacters must be a positive safe integer; received ${b}`);let S=new Xt(e),{fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N}=hs(e,S),y=new Map((N?.observations??[]).map(T=>[T.id,T])),E=new Set((N?.observations??[]).map(T=>`${T.source.file}\0${T.source.startLine}`)),C=new Set,v=new Map,F=new Map,g=new Map,R=new Map,$=[],B=new Map,A=new Map,H=[],h={filteredUnverifiedCallEdges:0,memberCallCandidateEdges:0,unresolvedMemberCallsites:0},k=new Set,M=new Map,_=new Map,W=T=>{let oe=_.get(T);if(oe)return oe;let re=St(e,T,{excludeIndexedTargets:!1});return _.set(T,re),re},q=(T,oe,re,be,Se=!1)=>hi(F,T,oe,re,be,Se),U=(T,oe,re,be,Se="none",ke=!1)=>xi(g,q,T,oe,re,be,Se,ke),K=(T,oe,re,be,Se=!1,ke=!0)=>vi(R,q,T,oe,re,be,Se,ke),ae=(T,oe,re)=>Ei({db:e,index:S,pendingRelations:B,addFile:q,addSymbol:U,addSourceConstruct:K,observation:T,depth:oe,origin:re}),{omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we}=Ii({db:e,index:S,searches:o,symbolQueries:i,opts:t,boundaryObservationLocations:E,sourceAllowed:m,addFile:q,addSymbol:U,addSourceConstruct:K,literalHits:$,anchors:H}),me={db:e,index:S,relationPolicy:a,evidenceFloor:d,sourceAllowed:m,fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,boundaryObservationDepths:v,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,pendingRelations:B,externalImports:A,reverseExpandedSourceConstructs:k,serviceCallerFilesBySourceConstruct:M,traversalMetrics:h,memberCallTargetsForWholeFile:W,addFile:q,addSymbol:U,addSourceConstruct:K,addBoundaryObservation:ae};for(let T=0;T<p;T+=1)Li(me,T),wi(me,T),Mi(me,T),Ni(me,T);return Ci({db:e,opts:t,mode:n,searches:o,symbolQueries:i,maxDepth:p,maxTopologyCharacters:b,requestedRelationKinds:s,evidenceFloor:d,includedSourceScopes:c,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,literalHits:$,pendingRelations:B,externalImports:A,anchors:H,omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we,filteredUnverifiedCallEdges:h.filteredUnverifiedCallEdges,memberCallCandidateEdges:h.memberCallCandidateEdges,unresolvedMemberCallsites:h.unresolvedMemberCallsites,sourceAllowed:m})}function Ri(e,t,n,o){let i=new Map,s=d=>{i.set(`${d.file}\0${d.line}`,d)};for(let d of o)s(d);let r=new Set(t.anchors.filter(d=>d.status==="matched").flatMap(d=>d.nodeIds));for(let d of n.steps)if(!(!d.location||!r.has(d.nodeId)||(d.behavior?.rawCharacters??1/0)>3e3))for(let c of d.behavior?.lines??[])c.signals.some(l=>bi.has(l))&&s({file:d.location.file,line:c.line,endLine:c.endLine});let a=t.edges.filter(d=>d.disposition==="emitted").flatMap(d=>d.evidence.flatMap(c=>c.location?[c.location]:[]));for(let d of a){s(d);let c=t.nodes.filter(u=>u.location?.file===d.file&&["symbol","source-construct","runtime-boundary-participant"].includes(u.kind)&&u.location.line<=d.line&&(u.location.endLine??u.location.line)>=d.line).sort((u,f)=>(u.location.endLine??u.location.line)-u.location.line-((f.location.endLine??f.location.line)-f.location.line)||u.id.localeCompare(f.id))[0];if(!c?.location)continue;let l=rn(e,d.file,c.location.line,c.location.endLine??c.location.line,[d.line]);for(let u of l)s({file:d.file,line:u.line,endLine:u.endLine})}return[...i.values()].sort((d,c)=>d.file.localeCompare(c.file)||d.line-c.line)}function Fi(e){if(e.ownerStartLine===null||e.ownerStartLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner start line.`);if(e.ownerEndLine===null||e.ownerEndLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner end line.`);return{file:e.file,name:e.ownerShortName??`${e.file}:${e.ownerStartLine+1}`,startLine:e.ownerStartLine,endLine:e.ownerEndLine}}function de(e){return`${e.file}\0${e.startLine}\0${e.endLine}\0${e.name}`}function X(e){return{file:e.file,name:e.name,startLine:e.startLine,endLine:e.endLine}}function lo(e,t,n,o){if(n.calleeLeaf===o.leaf)return!0;let i=Gt(e,t,n.calleeLeaf);return i!==null&&i.importedName===o.leaf&&i.sourcePath!==null&&pt(i.sourcePath,o.relativePath)}function at(e,t){let n=He(ce(e,t.file)?.callables??[],t.startLine);if(n&&n.endLine>=t.endLine)return{file:t.file,name:/^source@\d+$/u.test(n.name)&&!/^source@\d+$/u.test(t.name)?t.name:n.name,startLine:n.startLine,endLine:n.endLine};let o=xo(e,t.file,t.startLine);return o&&o.endLine>=t.endLine?{file:t.file,name:o.name,startLine:o.startLine,endLine:o.endLine}:X(t)}function Te(e){return te("source-construct",e.file,String(e.startLine),String(e.endLine),e.name)}function lt(e,t){let n=Ht(e,t.symbol,t.relativePath),o=new Set(["package-surface-file","transitive-package-surface"]),i=n.filter(r=>!o.has(r)||cn(e,t)),s=i.some(r=>!o.has(r));return{evidence:i,priority:s||Wt(e,t.symbol,t.relativePath)?2:1}}function co(e,t){let n=lt(e,t);return n.evidence.length>0?n.priority:0}function Ti(e,t){let n=fe(e,t.file),o=n.filter(i=>i.startLine<=t.startLine&&i.endLine>=t.startLine).sort((i,s)=>i.endLine-i.startLine-(s.endLine-s.startLine)||i.startLine-s.startLine);for(let i of o){let s=lt(e,i);if(s.evidence.length>0)return s}for(let i of Pi(e,t.file,t.startLine)){let s=n.filter(r=>r.leaf===i.name).sort((r,a)=>Math.abs(r.startLine-i.startLine)-Math.abs(a.startLine-i.startLine)||r.symbol.localeCompare(a.symbol));for(let r of s){let a=lt(e,r);if(a.evidence.length>0)return a}return{evidence:[],priority:0}}return{evidence:[],priority:0}}function Pi(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return[];let i=[],s=At(o,n);for(;s;){if(s.type==="variable_declarator"||s.type==="function_declaration"||s.type==="generator_function_declaration"||s.type==="class_declaration"){let r=s.childForFieldName("name")??s.namedChild(0);(r?.type==="identifier"||r?.type==="type_identifier")&&i.push({name:r.text,startLine:s.startPosition.row})}s=s.parent}return i}function ki(e){return[...new Map([...e.sourceConstructStates.values()].map(t=>at(e.db,t)).map(t=>[de(t),t])).values()].sort((t,n)=>t.file.localeCompare(n.file)||t.startLine-n.startLine||t.endLine-n.endLine)}function $i(e,t){return e.anchors.map((n,o)=>{let i=te("anchor",String(o),n.kind,n.query),s=[...e.symbolStates.values()].filter(l=>l.anchorQueries.has(n.query)).flatMap(l=>{if(!Y(l.definition.symbol))return[ge(l.definition.symbol)];let u=t.filter(f=>f.file===l.definition.relativePath).map(f=>Te(f));return u.length>0?u:[ge(l.definition.symbol)]}),r=[...e.sourceConstructStates.values()].filter(l=>l.anchorQueries.has(n.query)).map(l=>Te(at(e.db,l))),a=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&l.ownerSymbol&&e.symbolStates.has(l.ownerSymbol)).map(l=>ge(l.ownerSymbol)),d=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerStartLine!==void 0&&l.ownerEndLine!==null&&l.ownerEndLine!==void 0).map(l=>Te(at(e.db,Fi(l)))),c=D(n.kind==="symbol"?[...s,...r]:a.length+d.length>0?[...a,...d]:n.seedRegionIds??[]);return{id:i,kind:n.kind,query:n.query,status:n.status,nodeIds:n.status==="ambiguous"?[]:c,candidateNodeIds:n.status==="ambiguous"?c:[],omittedCandidates:n.omittedSymbolCandidates??0}})}function Ai(e){let t=new Map;for(let n of e)for(let o of[...n.nodeIds,...n.candidateNodeIds]){let i=t.get(o)??[];i.push(n.id),t.set(o,i)}return t}function Di(e,t,n){let o=e.relations.flatMap(r=>[r.fromBoundaryParticipant,r.toBoundaryParticipant].flatMap(a=>a?.ownerName?[a]:[])),i=e.regions.map(r=>({id:r.id,kind:"structural-region",label:r.label,disposition:"folded",location:null,anchorIds:D(n.get(r.id)??[]),attributes:{workspace:r.workspace,structuralPath:r.structuralPath,minimumDepth:r.minDepth,files:r.fileCount,symbols:r.symbolCount,expanded:r.expanded}}));for(let r of e.symbolStates.values()){let a=e.regionForFile.get(r.definition.relativePath)?.id;if(!a)throw new Error(`System-map symbol ${r.definition.symbol} has no structural region.`);let d=ge(r.definition.symbol),c=lt(e.db,r.definition);i.push({id:d,kind:"symbol",label:V(r.definition.symbol),disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,depth:r.depth,leaf:r.definition.leaf??V(r.definition.symbol),referenceScope:r.referenceScope,...c.evidence.length>0?{publicEntry:!0,publicEntryPriority:c.priority,publicEntryEvidence:c.evidence.join(",")}:{}}})}for(let r of t){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Source construct ${r.name} has no structural region.`);let d=Te(r),l=o.find(f=>f.file===r.file&&f.line>=r.startLine&&f.line<=r.endLine)?.ownerName??r.name,u=Ti(e.db,r);i.push({id:d,kind:"source-construct",label:l,disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.file,line:r.startLine,endLine:r.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,leaf:l,sourceOwned:!0,...u.evidence.length>0?{publicEntry:!0,publicEntryPriority:u.priority,publicEntryEvidence:u.evidence.join(",")}:{}}})}let s=new Map;for(let r of e.relations)r.fromBoundaryParticipant&&s.set(r.fromBoundaryParticipant.observationId,r.fromBoundaryParticipant),r.toBoundaryParticipant&&s.set(r.toBoundaryParticipant.observationId,r.toBoundaryParticipant);for(let r of[...s.values()].sort((a,d)=>a.observationId.localeCompare(d.observationId))){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Runtime-boundary participant ${r.observationId} has no structural region.`);i.push({id:Dt(r.observationId),kind:"runtime-boundary-participant",label:r.address||r.ownerName||`${r.role} ${r.action}`,disposition:"folded",location:{file:r.file,line:r.line,endLine:r.endLine},anchorIds:[],attributes:{regionId:a,action:r.action,protocol:r.protocol,role:r.role,...r.address?{address:r.address}:{},ownerSymbol:r.ownerSymbol}})}return i}function Bi(e,t,n,o,i,s,r,a,d,c=!1){let l=o?ge(o):null;if(l&&t.has(l)&&!Y(o))return l;let u=i?Dt(i.observationId):null;if(c&&u&&t.has(u))return u;let f=s?Te(at(e,s)):null;if(f&&t.has(f))return f;if(u&&t.has(u))return u;let m=d===null?null:(n.get(a)??[]).filter(p=>p.startLine<=d&&p.endLine>=d).sort((p,b)=>p.endLine-p.startLine-(b.endLine-b.startLine)||p.startLine-b.startLine)[0]??null;return m?Te(m):l&&t.has(l)?l:r}function Oi(e,t,n){let o=new Set(t.map(c=>c.id)),i=se(n,c=>c.file),s=(c,l,u,f,m,p,b=!1)=>Bi(e.db,o,i,c,l,u,f,m,p,b),r=[];for(let c of e.symbolStates.values()){let l=e.regionForFile.get(c.definition.relativePath)?.id;if(!l)continue;let u=ge(c.definition.symbol);r.push({id:te("edge","structural-membership",l,u),kind:"structural-membership",fromNodeId:l,toNodeId:u,directed:!0,disposition:"folded",semantics:Ve("structural-membership"),evidence:[{method:"indexed-definition-file",strength:"exact",identity:c.definition.symbol,location:{file:c.definition.relativePath,line:c.definition.startLine,endLine:c.definition.endLine}}]})}let a=se(e.relations,c=>`${s(c.fromSymbol,c.fromBoundaryParticipant,c.fromSourceConstruct,c.fromRegionId,c.fromFile,c.line,c.kind==="runtime-boundary")}\0${s(c.toSymbol,c.toBoundaryParticipant,c.toSourceConstruct,c.toRegionId,c.toFile,null)}\0${c.kind}`),d=new Set;for(let c of a.values()){let l=c[0],u=s(l.fromSymbol,l.fromBoundaryParticipant,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line,l.kind==="runtime-boundary"),f=s(l.toSymbol,l.toBoundaryParticipant,l.toSourceConstruct,l.toRegionId,l.toFile,null);if(l.kind==="runtime-boundary"&&l.fromBoundaryParticipant){let p=Dt(l.fromBoundaryParticipant.observationId),b=s(l.fromSymbol,void 0,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line);b!==p&&!d.has(p)&&(d.add(p),r.push({id:te("edge","boundary-observation",b,p),kind:"boundary-observation",fromNodeId:b,toNodeId:p,directed:!0,disposition:"folded",semantics:Ve("boundary-observation"),evidence:[{method:"runtime-boundary-observation-owner",strength:l.strength??"unknown",identity:l.fromBoundaryParticipant.observationId,location:{file:l.fromBoundaryParticipant.file,line:l.fromBoundaryParticipant.line,endLine:l.fromBoundaryParticipant.endLine}}]}))}(u===f?t.find(p=>p.id===u):null)?.kind!=="structural-region"&&r.push({id:te("edge",l.kind,u,f),kind:l.kind,fromNodeId:u,toNodeId:f,directed:!0,disposition:"folded",semantics:gn(l),evidence:Wi(c.map(p=>({method:p.evidence,strength:p.strength??"unknown",identity:p.kind==="runtime-boundary"&&p.runtimeBoundaryKey?p.runtimeBoundaryKey:`${p.fromSymbol??p.fromFile} -> ${p.toSymbol??p.toFile}`,location:p.line===null?null:{file:p.fromFile,line:p.line}})))})}return r}function _i(e,t,n){for(let i of e.externalBoundaries){let s=te("external",i.kind,i.name),r=D(i.fromRegionIds);t.push({id:s,kind:i.kind,label:i.name,disposition:"folded",location:null,anchorIds:[],attributes:{}});for(let a of r)n.push({id:te("edge",i.kind,a,s),kind:i.kind,fromNodeId:a,toNodeId:s,directed:!0,disposition:"folded",semantics:Ve("external-import"),evidence:[{method:"indexed-or-source-import",strength:"mixed",identity:`${a} -> ${i.name}`,location:null}]})}let o=[];return e.boundaryFrontiers.forEach((i,s)=>{let r=e.regionForFile.get(i.file)?.id;if(!r)throw new Error(`Runtime-boundary frontier ${i.observationId} has no system-map region.`);let a=te("unsupported","runtime-boundary",i.observationId,String(s)),d=te("edge","runtime-boundary-frontier",r,a);t.push({id:a,kind:"runtime-boundary-frontier",label:i.address,disposition:"unsupported",location:{file:i.file,line:i.line},anchorIds:[],attributes:{action:i.action,strength:i.strength,owner:i.ownerShortName}}),n.push({id:d,kind:"runtime-boundary-frontier",fromNodeId:r,toNodeId:a,directed:!0,disposition:"unsupported",evidence:[{method:"runtime-boundary-extractor",strength:i.strength,identity:i.observationId,location:{file:i.file,line:i.line}}]}),o.push({id:te("frontier","runtime-boundary",i.observationId,String(s)),kind:"runtime-boundary",direction:"unresolved",fromNodeIds:[r],edgeIds:[d],memberNodeIds:[a],memberCount:1,disposition:"unsupported",reason:i.reason,expansion:null})}),o}function Ki(e,t){let n=t.topologyFrontiers.some(p=>p==="frontier:program-facts"),o=oo(e,{expandedFrontierIds:t.topologyFrontiers.filter(p=>p!=="frontier:program-facts"),routeIds:t.routeIds}),i=o.nodes.filter(p=>p.disposition==="emitted"||o.anchors.some(b=>b.status==="matched"&&b.nodeIds.includes(p.id))),s=t.relations.filter(p=>i.some(b=>qi(p,b))),r=t.boundaryFrontiers.filter(p=>i.some(b=>Ui(p,b))),a=Ln(t.db,s,i),d=Mn(t.db,i),c=_n(t.db,i,r),l=[...a.nodes,...d.nodes,...c.nodes].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),u=[...a.edges,...d.edges,...c.edges].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),f=n?null:zi(i,l,u),m=it({anchors:o.anchors,nodes:[...o.nodes,...l],edges:[...o.edges,...u],paths:o.paths,frontiers:[...o.frontiers,...a.frontiers,...d.frontiers,...c.frontiers,...f?[f]:[]],scope:o.coverage.scope,blindSpots:[...o.coverage.blindSpots,...a.blindSpots,...d.blindSpots,...c.blindSpots],incompleteReasons:o.coverage.status==="incomplete"?[o.coverage.explanation]:[],...o.routeCatalog?{routeCatalog:o.routeCatalog}:{}});m.completion=o.completion;for(let p of m.frontiers)p.disposition==="folded"&&(p.id.startsWith("frontier:program-facts:")||(p.expansion=Gi(t,p.id)));return m}function ji(e){let t=ki(e),n=$i(e,t),o=Di(e,t,Ai(n)),i=Oi(e,o,t),s=_i(e,o,i);return Ki(it({anchors:n,nodes:o,edges:i,paths:[],frontiers:s,scope:`explicit anchors; relations ${e.requestedRelationKinds.join(", ")}; depth ${e.maxDepth}; evidence floor ${e.evidenceFloor}; source scopes ${e.includedSourceScopes.join(", ")}`,blindSpots:[...e.blindSpots],incompleteReasons:e.closureStatus==="incomplete"?[`${e.omittedSymbolCandidates} ambiguous symbol candidate(s) were omitted`]:[]}),e)}function qi(e,t){if(e.fromSymbol&&t.id===ge(e.fromSymbol)||e.toSymbol&&t.id===ge(e.toSymbol))return!0;if(!t.location)return!1;let n=t.location.endLine??t.location.line;return t.location.file===e.fromFile&&e.line!==null&&e.line>=t.location.line&&e.line<=n||t.location.file===e.toFile}function Ui(e,t){if(!t.location||t.location.file!==e.file)return!1;let n=t.location.endLine??t.location.line;return e.line>=t.location.line&&e.line<=n||t.label===e.ownerShortName||typeof e.ownerShortName=="string"&&t.label.includes(e.ownerShortName)}function zi(e,t,n){let o=D(t.filter(s=>s.disposition==="folded").map(s=>s.id)),i=D(n.filter(s=>s.disposition==="folded").map(s=>s.id));return o.length===0&&i.length===0?null:{id:te("frontier","program-facts"),kind:"program-facts",direction:"outgoing",fromNodeIds:D(e.map(s=>s.id)),edgeIds:i,memberNodeIds:o,memberCount:o.length,disposition:"folded",reason:"Control, data, state, and temporal facts are folded beneath the selected high-level owners.",expansion:null}}function Gi(e,t){return`scip-query system-map ${[...e.anchors.flatMap(o=>o.kind==="literal"?[`--search ${O(o.query)}`]:[`--symbol ${O(o.query)}`]),`--depth ${e.maxDepth}`,...e.requestedRelationKinds.map(o=>`--relation ${O(o)}`),`--evidence-floor ${O(e.evidenceFloor)}`,...e.includedSourceScopes.map(o=>`--source-scope ${O(o)}`),...e.fullLiteralTraversal?["--full-literal-traversal"]:[],`--topology-characters ${e.maxTopologyCharacters}`,...e.expandedRegionIds.map(o=>`--expand ${O(o)}`),...e.topologyFrontiers.map(o=>`--frontier ${O(o)}`),...e.routeIds.map(o=>`--route ${O(o)}`),`--frontier ${O(t)}`].join(" ")}`}function Hi(e){let t=new Set;for(let n of e.nodes){if(n.disposition!=="emitted")continue;n.kind==="structural-region"&&t.add(n.id);let o=n.attributes.regionId;typeof o=="string"&&t.add(o)}return t}function Wi(e){let t=new Map;for(let n of e){let o=n.location?`${n.location.file}:${n.location.line}`:"";t.set(`${n.method}\0${n.strength}\0${n.identity??""}\0${o}`,n)}return[...t.values()].sort((n,o)=>n.method.localeCompare(o.method)||(n.identity??"").localeCompare(o.identity??"")||(n.location?.file??"").localeCompare(o.location?.file??"")||(n.location?.line??0)-(o.location?.line??0))}function te(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function ge(e){return te("symbol",e)}function Vi(e){return e==="semantic-callee"||e==="scip-chunk"||e==="scip-occurrence"?"exact":"derived"}function Qi(e,t,n,o,i,s,r,a,d,c){let l=[...o].sort((b,S)=>ho(b,S,i)),f=l.slice(0,io).map(b=>b.id),m=l.slice(io).map(b=>b.id),p=[...e.map(b=>`--search ${O(b)}`),...t.map(b=>`--symbol ${O(b)}`),`--depth ${n}`,...s.map(b=>`--relation ${O(b)}`),`--evidence-floor ${O(r)}`,...a.map(b=>`--source-scope ${O(b)}`),...d?["--full-literal-traversal"]:[],`--topology-characters ${c}`,...f.map(b=>`--expand ${O(b)}`)];return{command:f.length===0?null:`scip-query system-map ${p.join(" ")}`,regionCount:f.length,regionIds:f,candidateRegionCount:o.length,omittedRegionIds:m}}function Yi(e,t,n,o,i,s,r,a,d,c,l,u,f){let m=[...d].sort((g,R)=>ho(g,R,l)).filter(g=>!f||f.has(g.id)||u.has(g.id)),p=c.length>0?Math.floor(a*.4):0,b=a-p,S=new Set,w=0;for(let g of m){let R=uo(g);!u.has(g.id)&&S.size>0&&w+R>b||(S.add(g.id),w+=R)}let I=c.filter(g=>S.has(g.fromRegionId)&&S.has(g.toRegionId)).sort(Ji),L=[];for(let g of I){let R=po(g);L.length>0&&w+R>a||(L.push(dt(g)),w+=R)}let N=d.filter(g=>!S.has(g.id)).map(g=>g.id).sort(),y=new Set(L),E=c.filter(g=>!y.has(dt(g))).length,C=d.reduce((g,R)=>g+uo(R),0)+c.reduce((g,R)=>g+po(R),0),v=m.every(g=>S.has(g.id))&&L.length===I.length,F=[...e.map(g=>`--search ${O(g)}`),...t.map(g=>`--symbol ${O(g)}`),`--depth ${n}`,...o.map(g=>`--relation ${O(g)}`),`--evidence-floor ${O(i)}`,...s.map(g=>`--source-scope ${O(g)}`),...r?["--full-literal-traversal"]:[],`--topology-characters ${Math.max(a,C)}`];return{maxCharacters:a,estimatedCharacters:w,totalEstimatedCharacters:C,regionIds:[...S],omittedRegionIds:N,relationKeys:L,omittedRelations:E,complete:v,expansionCommand:v?null:`scip-query system-map ${F.join(" ")}`}}function uo(e){return 120+e.id.length+e.anchorQueries.join(",").length+e.relationKinds.join(",").length+e.notableSymbols.slice(0,2).reduce((t,n)=>t+n.shortName.length+n.file.length,0)}function po(e){return 70+e.fromRegionId.length+e.toRegionId.length+e.kinds.join(",").length+e.evidence.join(",").length}function Ji(e,t){let n=o=>o.kinds.includes("runtime-boundary")?0:o.kinds.includes("contract-symbol")?1:2;return n(e)-n(t)||t.relationCount-e.relationCount||dt(e).localeCompare(dt(t))}function dt(e){return`${e.fromRegionId}\0${e.toRegionId}`}function ho(e,t,n){let o=a=>n.has(a.id)?0:1,i=a=>a.sourceFileCount===0?1:0,s=a=>a.symbolCount+a.literalHitCount>0?0:1,r=a=>[...a.incomingRegionIds,...a.outgoingRegionIds].filter(d=>n.has(d)).length;return o(e)-o(t)||s(e)-s(t)||i(e)-i(t)||e.minDepth-t.minDepth||r(t)-r(e)||t.literalHitCount-e.literalHitCount||e.testFileCount-t.testFileCount||e.label.localeCompare(t.label)}function Xi(e){let t=[],n=new Set;for(let i of e.filter(s=>s.expanded)){for(let d of i.symbols)d.origins.includes("symbol-anchor")&&n.add(d.file);let s=se(i.symbols,d=>d.file),r=se(i.literalHits,d=>d.file),a=[...i.files].sort((d,c)=>es(d,c,s,r));for(let d of a){let c=(s.get(d.file)??[]).sort(mn)[0];if(c){t.push({kind:"symbol",regionId:i.id,file:c.file,line:c.startLine,endLine:c.endLine,label:c.shortName});continue}let l=(r.get(d.file)??[]).sort(Io)[0];l&&t.push({kind:"literal",regionId:i.id,file:l.file,line:l.line,endLine:null,label:l.ownerShortName??l.query})}}let o=Zi(t,n);return{command:o.length===0?null:`scip-query inspect ${o.map(i=>`--at ${O(`${i.file}:${i.line+1}`)}`).join(" ")} --view behavior`,definitionCommand:null,candidateAnchors:t.length,selectedAnchors:o.length,omittedAnchors:t.length-o.length,anchors:o}}function Zi(e,t){let n=[...se(e,r=>r.regionId).values()],o=[],i=new Set,s=Math.min(gi,24);for(let r of e)if(!(!t.has(r.file)||i.has(r.file))&&(o.push(r),i.add(r.file),o.length===s))return o;for(let r=0;o.length<s;r+=1){let a=!1;for(let d of n){let c=d[r];if(c&&(a=!0,!i.has(c.file)&&(o.push(c),i.add(c.file),o.length===s)))break}if(!a)break}return o}function es(e,t,n,o){let i=a=>a.kind==="test"?2:a.kind==="barrel"?1:0,s=a=>(o.get(a.file)??[]).some(d=>d.traversalSeed)?0:1,r=a=>{let d=n.get(a.file)??[];return Math.min(5,...d.map(c=>Ne(c.origins)))};return i(e)-i(t)||s(e)-s(t)||r(e)-r(t)||e.depth-t.depth||e.file.localeCompare(t.file)}function O(e){return`'${e.replaceAll("'","'\\''")}'`}function ts(e,t,n,o){let i=[];for(let s of qt(e,{includeIgnored:!1})){let r=mt(e,s);if(r.length===0)continue;let a=[];for(let l=0;l<r.length;l+=1){let u=r[l]??"";u.includes(n)&&a.push({line:l,sourceLine:u})}if(a.length===0)continue;let d=t.definitionsForFile(s),c=ce(e,s)?.callables??[];for(let{line:l,sourceLine:u}of a){let f=Me(d,l),m=He(c,l),p=f&&!Y(f.symbol)?f:null,b=p?.startLine??m?.startLine??f?.startLine??l,S=p?.endLine??m?.endLine??f?.endLine??l,w=xt(e,s,l,b,S),I=o.has(`${s}\0${l}`),L=!!(p?.isFunctionLike||m);i.push({relativePath:s,line:l,sourceLine:u,ownerSymbol:p?.symbol??null,ownerShortName:p?V(p.symbol):m?.name??(f?V(f.symbol):null),ownerStartLine:w.startLine,ownerEndLine:w.endLine,matchKind:is(u,n),seedPriority:I?0:L?1:2})}}return i}function ns(e,t){let n={"exact-value":0,boundary:1,embedded:2};return e.seedPriority-t.seedPriority||n[e.matchKind]-n[t.matchKind]||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function mo(e){return`${e.relativePath}\0${e.line}`}function Pt(e,t,n){let i=He(ce(e,t)?.callables??[],n)??xo(e,t,n);if(!i)return null;let s=xt(e,t,n,i.startLine,i.endLine);return{file:t,name:i.name,startLine:s.startLine,endLine:s.endLine}}function xo(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return null;let i=At(o,n);for(;i;){if(i.type==="variable_declarator"){let r=i.childForFieldName("name")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1);if(r?.type==="identifier"&&a&&kt(a,n))return{name:r.text,startLine:i.startPosition.row,endLine:i.endPosition.row}}if(i.type==="pair"){let r=i.childForFieldName("key")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1),d=r?.text.replace(/^(?:['"])(.*)(?:['"])$/u,"$1");if(d&&a&&/^[A-Za-z_$][\w$]*$/u.test(d)&&kt(a,n))return{name:d,startLine:i.startPosition.row,endLine:i.endPosition.row}}i=i.parent}let s=ht(e,t,n);return s?{name:`source@${n+1}`,startLine:s.startLine,endLine:s.endLine}:null}function kt(e,t){return["arrow_function","function_expression","generator_function","generator_function_declaration"].includes(e.type)&&e.startPosition.row<=t&&e.endPosition.row>=t?!0:e.namedChildren.some(n=>n.startPosition.row<=t&&n.endPosition.row>=t&&kt(n,t))}function At(e,t){let n=e.namedChildren.filter(o=>o.startPosition.row<=t&&o.endPosition.row>=t).sort((o,i)=>o.endIndex-o.startIndex-(i.endIndex-i.startIndex)||o.startPosition.row-i.startPosition.row)[0];return n?At(n,t):e}function os(e,t){let n=t.match(/^(.+):(\d+)(?:-(\d+))?$/u);if(!n)return null;let o=Ut(e,n[1],{allowMultiple:!1})[0]?.relativePath;if(!o)return null;let i=Math.max(0,Number.parseInt(n[2],10)-1),s=n[3]?Math.max(i,Number.parseInt(n[3],10)-1):i,r=(ce(e,o)?.callables??[]).filter(a=>a.startLine<=i&&a.endLine>=s).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine)||a.startLine-d.startLine)[0];return r?{file:o,name:r.name,startLine:r.startLine,endLine:r.endLine}:null}function rs(e){return{symbol:`source-construct:${e.file}:${e.startLine}:${e.endLine}:${e.name}`,shortName:e.name,relativePath:e.file,startLine:e.startLine,endLine:e.endLine}}function is(e,t){let n=/[\p{L}\p{N}_$]/u,o=e.indexOf(t);for(;o>=0;){let i=e[o-1]??"",s=e[o+t.length]??"";if((i==="'"||i==='"'||i==="`")&&s===i)return"exact-value";if(!n.test(i)&&!n.test(s))return"boundary";o=e.indexOf(t,o+Math.max(1,t.length))}return"embedded"}function $t(e){return We(e)==="test"?!1:!/(?:^|[/._-])(?:fixtures?|mocks?|previews?|demos?|examples?|stories)(?:[/._-]|$)/iu.test(e)}function ss(e,t){return e.matchKind!=="embedded"&&t(e.relativePath)&&(bt(e.relativePath)!=="production"||$t(e.relativePath))}function as(e,t){let n=[...t].sort(ls),o=[],i=new Set;for(let s of n)if(!i.has(s.relativePath)&&(o.push(s),i.add(s.relativePath),o.length>=ro))break;for(let s of n){if(o.length>=ro)break;o.includes(s)||o.push(s)}return o.map(s=>({query:e,file:s.relativePath,line:s.line,ownerSymbol:s.ownerSymbol,ownerShortName:s.ownerShortName,ownerStartLine:s.ownerStartLine,ownerEndLine:s.ownerEndLine,sourceLine:s.sourceLine.trim(),matchKind:s.matchKind,traversalSeed:!1}))}function ls(e,t){let n={"exact-value":0,boundary:1,embedded:2};return n[e.matchKind]-n[t.matchKind]||+(t.ownerSymbol!==null)-+(e.ownerSymbol!==null)||+!$t(e.relativePath)-+!$t(t.relativePath)||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function ds(e,t){let n=new Map;for(let o of t){let i=cs(o.relativePath);n.set(i,(n.get(i)??0)+1)}return[...n].sort(([o,i],[s,r])=>r-i||o.localeCompare(s)).slice(0,mi).map(([o])=>`scip-query search ${O(e)} --scope ${O(o)}`)}function cs(e){let t=e.split("/").filter(Boolean);if(t.length<=1)return e;let n=t.slice(0,-1),o=n.lastIndexOf("src");return o>=0?n.slice(0,Math.min(n.length,o+3)).join("/"):n.slice(0,Math.min(n.length,3)).join("/")}function us(e,t,n){let o=t.callerFileMap([n],{semantic:!1}).get(n.symbolId)??new Set,i=[];for(let s of[...o].sort()){let r=ft(e,s).filter(l=>l.importedName===n.leaf&&l.sourcePath!==null&&pt(l.sourcePath,n.relativePath)),a=new Set;if(r.length>0)for(let l of r)a.add(l.localName??l.importedName);else n.leaf&&a.add(n.leaf);let d=[...new Set([...a].flatMap(l=>gt(e,s,l)))].sort((l,u)=>l-u);if(d.length===0){i.push({file:s,line:null,enclosingSymbol:null});continue}let c=t.definitionsForFile(s);for(let l of d)i.push({file:s,line:l,enclosingSymbol:Me(c,l)?.symbol??null})}return i}function ps(e,t){let n=e.all(`SELECT DISTINCT gs.symbol, def_d.relative_path AS from_file
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents imp_d ON c.document_id = imp_d.id
5
+ JOIN global_symbols gs ON m.symbol_id = gs.id
6
+ LEFT JOIN (
7
+ SELECT m2.symbol_id, c2.document_id
8
+ FROM mentions m2
9
+ JOIN chunks c2 ON m2.chunk_id = c2.id
10
+ WHERE m2.role = 1
11
+ GROUP BY m2.symbol_id
12
+ ) sym_def ON sym_def.symbol_id = gs.id
13
+ LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
14
+ WHERE imp_d.relative_path = ? AND m.role = 2
15
+ ORDER BY def_d.relative_path, gs.symbol`,t);return n.length>0?n.map(o=>({symbol:o.symbol,shortName:V(o.symbol),importedName:fo(V(o.symbol)),localName:fo(V(o.symbol)),fromFile:o.from_file,source:"compiler"})):ft(e,t).map(o=>{let i=ms(o.importedName,o.localName,o.kind),s=o.localName??o.importedName,r=o.importedName==="default"?s:o.importedName;return{symbol:i,shortName:i,importedName:r,localName:s,fromFile:o.sourcePath,source:"parsed-source"}})}function fo(e){return e.slice(e.lastIndexOf(":")+1).replace(/\(\)$/u,"")||e}function ms(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 ye(e,t,n){let o=yt(e,n);if(!o.match)return{matches:[],total:0,omitted:0};let i=[o.match,...o.candidates.map(r=>yt(e,r.symbol).match)].filter(r=>r!==null),s=new Map;for(let r of i){let a=t.definitionsForFile(r.relativePath).find(d=>d.symbol===r.symbol);a&&s.set(a.symbol,a)}return{matches:[...s.values()],total:o.total,omitted:Math.max(0,o.total-s.size)}}function fs(e){return{symbol:e.symbol,shortName:V(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine}}function ne(e,t){let n=[t.kind,t.fromFile,t.fromSymbol??"",t.toFile,t.toSymbol??"",t.fromBoundaryParticipant?.observationId??"",t.toBoundaryParticipant?.observationId??"",t.fromSourceConstruct?de(t.fromSourceConstruct):"",t.toSourceConstruct?de(t.toSourceConstruct):"",t.runtimeBoundaryKey??"",t.line??""].join("\0");e.set(n,t)}function Pe(e){return{observationId:e.id,action:e.action,protocol:e.protocol,role:e.role,address:vo(e),file:e.source.file,line:e.source.startLine,endLine:e.source.endLine,ownerName:e.owner.name,ownerSymbol:e.owner.symbol}}function st(e,t){let n=mt(e,t.source.file);return an(e,t.source.file,0,Math.max(0,n.length-1),[t.source.startLine])}function go(e,t){let n=[...e.values()];for(let o of[t.owner,t.source]){let i=n.filter(s=>s.file===o.file&&s.startLine<=o.startLine&&s.endLine>=o.startLine).sort((s,r)=>s.endLine-s.startLine-(r.endLine-r.startLine)||s.startLine-r.startLine)[0];if(i)return i}return null}function yo(e,t,n,o,i){let s=[],r=n.get(e.id);r!==void 0&&r<=t&&s.push(r);for(let a of o.values()){if(a.depth>t)continue;let d=a.definition;bo(d,e)&&s.push(a.depth)}for(let a of i.values())a.depth>t||bo(a,e)&&s.push(a.depth);return s.length>0?Math.min(...s):null}function bo(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 Dt(e){return te("runtime-boundary-participant",e)}function gs(e,t,n){let o=ee(e,n),i=ee(t,n);return o.relativeDir!==i.relativeDir?!0:/(?:^|\/)(?:contracts?|schemas?|db\/schema)(?:\/|$)/u.test(t)}function ys(e,t,n){return Ue(e,n).id===Ue(t,n).id}function bs(e,t,n,o){if(e.referenceScope==="all")return!0;let i=Ue(t,o).id;return[...n.values()].some(r=>r.promoteBoundaryImports&&Ue(r.file,o).id===i)?!0:e.referenceScope!=="cross-workspace-or-forward"?!1:ee(t,o).relativeDir!==ee(e.definition.relativePath,o).relativeDir}function Ss(e,t){let n={none:0,"forward-regions":1,"cross-workspace-or-forward":2,all:3};return n[e]>=n[t]?e:t}function hs(e,t){let n=ao.get(e);if(n)return n;let o=t.fileDependencyGraph(),i={fileGraph:o,reverseFileGraph:xs(o),workspaces:vs(t.sourceFiles()),runtimeBoundaries:on(e)};return ao.set(e,i),i}function xs(e){let t=new Map;for(let[n,o]of e)for(let i of o){let s=t.get(i)??new Set;s.add(n),t.set(i,s)}return t}function ee(e,t){return t.find(n=>e===n.relativeDir||e.startsWith(`${n.relativeDir}/`))??{name:"root",relativeDir:""}}function vs(e){let t=new Set(["apps","packages","services","crates","libs","tools"]),n=new Map;for(let o of e){let i=o.split("/").filter(Boolean);if(i.length<3||!t.has(i[0]))continue;let s=`${i[0]}/${i[1]}`;n.set(s,{name:i[1],relativeDir:s})}return[...n.values()].sort((o,i)=>i.relativeDir.length-o.relativeDir.length)}function Ue(e,t){let n=ee(e,t),i=(n.relativeDir?e.slice(n.relativeDir.length+1):e).split("/").filter(Boolean);i[0]==="src"&&i.shift();let s=Es(i);return{id:`region:${n.relativeDir||"root"}:${s}`,label:`${n.name}:${s}`,workspace:n.name,structuralPath:s}}function Es(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 Is(e,t,n,o,i,s,r){let a=se([...e.values()],m=>s.get(m.file).id),d=se([...t.values()],m=>s.get(m.definition.relativePath).id),c=se(n,m=>s.get(m.file).id),l=new Map;for(let m of o)for(let p of new Set([m.fromRegionId,m.toRegionId])){let b=l.get(p)??[];b.push(m),l.set(p,b)}let u=se(i,m=>m.toRegionId),f=se(i,m=>m.fromRegionId);return[...a.entries()].map(([m,p])=>{let b=s.get(p[0].file),S=d.get(m)??[],w=c.get(m)??[],I=l.get(m)??[],L=r.has(m),N=S.map(ws).sort(Fs).slice(0,fi),y=p.filter(E=>We(E.file)==="test").length;return{id:m,label:b.label,workspace:b.workspace,structuralPath:b.structuralPath,minDepth:Math.min(...p.map(E=>E.depth)),fileCount:p.length,sourceFileCount:p.length-y,testFileCount:y,symbolCount:S.length,literalHitCount:w.length,anchorQueries:D([...w.map(E=>E.query),...S.flatMap(E=>[...E.anchorQueries])]),relationKinds:D(I.map(E=>E.kind)),incomingRegionIds:D((u.get(m)??[]).map(E=>E.fromRegionId)),outgoingRegionIds:D((f.get(m)??[]).map(E=>E.toRegionId)),memberCallCandidateRelationCount:I.filter(E=>E.evidence==="ast-member-import-candidate").length,notableSymbols:N,omittedNotableSymbols:Math.max(0,S.length-N.length),expanded:L,files:L?p.map(Cs).sort(Ts):[],symbols:L?S.map(Ls).sort(Ps):[],literalHits:L?[...w].sort(Io):[],relations:L?[...I].sort(Eo):[]}}).sort((m,p)=>m.minDepth-p.minDepth||m.label.localeCompare(p.label))}function Cs(e){return{file:e.file,kind:We(e.file),depth:e.depth,origins:D([...e.origins])}}function Ls(e){return{symbol:e.definition.symbol,shortName:V(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,depth:e.depth,origins:D([...e.origins]),anchorQueries:D([...e.anchorQueries]),referenceExpansion:e.referenceScope!=="none",referenceScope:e.referenceScope}}function ws(e){return{shortName:V(e.definition.symbol),file:e.definition.relativePath,origins:D([...e.origins])}}function Ms(e){return[...se(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:D(n.map(o=>o.kind)),relationCount:n.length,fromFiles:D(n.map(o=>o.fromFile)),toFiles:D(n.map(o=>o.toFile)),fromSymbols:D(n.flatMap(o=>o.fromSymbol?[V(o.fromSymbol)]:[])),toSymbols:D(n.flatMap(o=>o.toSymbol?[V(o.toSymbol)]:[])),evidence:D(n.map(o=>o.evidence)),strengths:D(n.map(o=>o.strength??"unknown"))})).sort((n,o)=>n.fromRegionId.localeCompare(o.fromRegionId)||n.toRegionId.localeCompare(o.toRegionId))}function Ns(e,t){return[...e.values()].map(n=>({kind:"external-import",name:n.name,fromRegionIds:D([...n.fromFiles].flatMap(o=>{let i=t.get(o);return i?[i.id]:[]})),fromFiles:D([...n.fromFiles])})).sort((n,o)=>n.name.localeCompare(o.name))}function Rs(e,t,n,o){let i=e.kind==="literal"?t.filter(s=>s.query===e.query).map(s=>s.file):[...n.values()].filter(s=>s.anchorQueries.has(e.query)).map(s=>s.definition.relativePath);return D(i.map(s=>o.get(s)?.id).filter(s=>!!s))}function vo(e){return e.keyParts.map(t=>`${t.name}=${t.value}`).join(" ")}function D(e){return[...new Set(e)].sort()}function Eo(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 Fs(e,t){return Ne(e.origins)-Ne(t.origins)||e.shortName.localeCompare(t.shortName)}function Ts(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)}function Ps(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)}function Io(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.query.localeCompare(t.query)}export{Ua as a,za as b,dt as c};
16
+ //# sourceMappingURL=chunk-CD6M6LS2.js.map
@@ -0,0 +1,2 @@
1
+ import{k as c,l}from"./chunk-ETC674NS.js";function w(t,e,n,o,r,i){let a=new Set;f(t,e,n,o)&&a.add(r);let p=u(i);for(let s of i)s.value&&y(a,s.label,s.value,p);return[...a].slice(0,6)}function u(t){let e={self:new Set,other:new Set},n=0;for(let o of t)if(!(!o.side||!o.value)){n+=1;for(let r of d(o.value))e[o.side].add(r)}return n===0||e.self.size===0||e.other.size===0?new Set:new Set([...e.self].filter(o=>e.other.has(o)))}function y(t,e,n,o){let r=d(n);e.endsWith("name")&&g(r)&&t.add(`${e} has type-guard boundary shape`);for(let i of r){if(o.has(i))continue;let a=m.get(i);a&&t.add(`${e} has ${a} term: ${i}`)}}function f(t,e,n,o){if(n<=0)return!1;let r=c(t,e);if(r.length===0)return!1;for(let i=n-1;i>=0&&i>=n-5;i-=1){let a=(r[i]??"").trim();if(a!==""){if(l(a)===o)return!0;if(!a.startsWith("//")&&!a.startsWith("*")&&!a.startsWith("/*")&&!a.startsWith("@")&&!a.startsWith("#"))return!1}}return!1}function d(t){return t.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function g(t){return t.some(e=>b.has(e))&&t.some(e=>h.has(e))}var m=new Map([["access","access policy"],["accessible","access policy"],["adapter","adapter"],["adapters","adapter"],["allow","access policy"],["allowed","access policy"],["animation","animation calculation"],["api","api surface"],["apply","settings/application"],["audit","side-effect boundary"],["auth","authorization"],["authorize","authorization"],["audio","audio side-effect"],["can","access policy"],["capabilities","capability boundary"],["capability","capability boundary"],["boundary","boundary"],["begin","lifecycle"],["bridge","bridge"],["bridges","bridge"],["cache","state cache"],["chase","gameplay action"],["command","command boundary"],["context","context policy"],["cooldown","temporal state"],["cooldowns","temporal state"],["controller","controller"],["controllers","controller"],["diagnostic","diagnostics"],["diagnostics","diagnostics"],["effect","side-effect boundary"],["effects","side-effect boundary"],["energy","gameplay calculation"],["expired","temporal state"],["facade","facade"],["facades","facade"],["fire","gameplay action"],["gateway","gateway"],["gateways","gateway"],["guard","guard"],["guards","guard"],["haptic","haptic side-effect"],["haptics","haptic side-effect"],["head","sequence boundary"],["history","state history"],["input","input boundary"],["jump","gameplay action"],["keyboard","input boundary"],["log","side-effect boundary"],["logger","side-effect boundary"],["lock","coordination boundary"],["middleware","middleware"],["multiplier","gameplay calculation"],["mute","audio side-effect"],["normalize","normalization"],["normalise","normalization"],["normalizer","normalization"],["oscillate","animation calculation"],["oscillation","animation calculation"],["overlap","collision predicate"],["performance","diagnostics"],["permission","access policy"],["permissions","access policy"],["policy","policy"],["pool","state pool"],["pooled","state pool"],["pools","state pool"],["predict","prediction"],["presenter","presenter"],["presenters","presenter"],["projectile","gameplay entity"],["provider","provider boundary"],["providers","provider boundary"],["public","public surface"],["quality","settings/application"],["rate","calculation"],["register","registry"],["registry","registry"],["relay","relay"],["relays","relay"],["reseed","state lifecycle"],["reset","state lifecycle"],["respond","response boundary"],["response","response boundary"],["resolve","resolution"],["resolver","resolution"],["route","route boundary"],["routes","route boundary"],["run","lifecycle"],["sample","diagnostics"],["score","gameplay calculation"],["scope","scope policy"],["scroll","position state"],["scrolled","position state"],["seed","state lifecycle"],["seeded","state lifecycle"],["segment","segment boundary"],["segments","segment boundary"],["setting","settings/application"],["settings","settings/application"],["spawn","gameplay lifecycle"],["spawning","gameplay lifecycle"],["speed","gameplay calculation"],["surface","public surface"],["tail","sequence boundary"],["tick","temporal state"],["transaction","transaction"],["transactional","transaction"],["transform","transformation"],["transformer","transformation"],["translate","translation"],["translator","translation"],["try","fallible action"],["validate","validation"],["validation","validation"],["validator","validation"],["visual","diagnostics"],["window","settings/application"],["socket","transport boundary"],["websocket","transport boundary"]]),b=new Set(["can","has","is","should"]),h=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);export{w as a};
2
+ //# sourceMappingURL=chunk-CFE6PSG6.js.map
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-D2MVJSP4.js";function i(r,s,e={}){let a=t(r,s,{families:["dataflow"],...e.maxDepth!==void 0?{maxDepth:e.maxDepth}:{},...e.maxEdges!==void 0?{maxEdges:e.maxEdges}:{}});return{kind:"value-flow",targets:a.targets,edges:a.edges,coverage:{status:a.coverage.status,basis:"proved-bounded-static-value-flow",analysisBasis:"partial-system-definition-use",providers:["bounded-static-value-flow","typescript-local-dependence"],supportedRelations:["compiler-identified local definitions reaching local reads through a TypeScript control-flow graph","right-hand-side local reads supplying assignments and declarations","candidate closure captures and bounded same-owner field flow with explicit evidence strength","direct argument-to-parameter forwarding at compiler-resolved calls","bounded mechanically derived static arguments","callee return value to a consumed compiler-resolved call result"],unsupportedRelations:["general heap alias and cross-instance field points-to flow","exceptional control and value flow","closure invocation order","downstream local definition-use after a call result","dynamic calls not resolved by the semantic provider"],graph:a.coverage}}}export{i as a};
2
- //# sourceMappingURL=chunk-GPGRZJ3R.js.map
1
+ import{a as t}from"./chunk-L6XHYJPZ.js";function i(r,s,e={}){let a=t(r,s,{families:["dataflow"],...e.maxDepth!==void 0?{maxDepth:e.maxDepth}:{},...e.maxEdges!==void 0?{maxEdges:e.maxEdges}:{}});return{kind:"value-flow",targets:a.targets,edges:a.edges,coverage:{status:a.coverage.status,basis:"proved-bounded-static-value-flow",analysisBasis:"partial-system-definition-use",providers:["bounded-static-value-flow","typescript-local-dependence"],supportedRelations:["compiler-identified local definitions reaching local reads through a TypeScript control-flow graph","right-hand-side local reads supplying assignments and declarations","candidate closure captures and bounded same-owner field flow with explicit evidence strength","direct argument-to-parameter forwarding at compiler-resolved calls","bounded mechanically derived static arguments","callee return value to a consumed compiler-resolved call result"],unsupportedRelations:["general heap alias and cross-instance field points-to flow","exceptional control and value flow","closure invocation order","downstream local definition-use after a call result","dynamic calls not resolved by the semantic provider"],graph:a.coverage}}}export{i as a};
2
+ //# sourceMappingURL=chunk-CFNIGQMT.js.map
@@ -1,2 +1,2 @@
1
- import{a as r,b as u}from"./chunk-H5EXS3HM.js";import{s as c}from"./chunk-AK3PYTIK.js";var g=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"],R=["entry-surface","generated-code","compatibility-shim","reflection-or-registration","test-fixture","intentional-twin","historical-coupling-ended","detector-counterexample"];var p=2,a=3;var d=new Set(g);function P(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(l){return{kind:"malformed",reason:`invalid JSON: ${C(l)}`}}if(!r(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let n=t.version;if(!Number.isInteger(n))return{kind:"malformed",reason:"version must be an integer"};if(n!==p&&n!==a)return{kind:"unsupported",version:n,direction:n<p?"older":"future"};let o=m(t,n);if(o)return{kind:"malformed",reason:o};let i=t,s={metadata:i,capabilities:f(i)};return n===p?{kind:"legacy",...s,metadata:i}:{kind:"supported",...s,metadata:i}}function L(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function j(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===a?t.sqliteLayoutVersion:void 0})}function f(e){let t=e.fingerprint!==void 0,n=r(e.fingerprint),o=e.indexedLanguages!==void 0,i=e.status==="complete",s=e.version===a?e:null;return{usableForQuery:o,usableForEvidenceCache:t,publishableGeneration:i&&n&&o,stableGenerationIdentity:i&&t&&typeof e.updatedAt=="string",languageShardReuse:!!s?.languageFingerprints,typescriptProjectShardReuse:!!s?.typescriptProjectShards}}function m(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!u(e.updatedAt))return"updatedAt must be a valid timestamp";for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!y(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!b(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===a&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===a&&e.languageFingerprints!==void 0&&!x(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===a&&e.typescriptProjectShards!==void 0&&!S(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function v(e){return e.version===a&&e.sqliteLayoutVersion===1}function y(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&d.has(t))?!1:new Set(e).size===e.length}function b(e){return Array.isArray(e)&&e.every(t=>r(t)&&typeof t.language=="string"&&d.has(t.language)&&typeof t.reason=="string")}function x(e){return r(e)&&Object.entries(e).every(([t,n])=>d.has(t)&&r(n))}function S(e){return r(e)&&Object.values(e).every(t=>r(t)&&Array.isArray(t.files)&&t.files.every(c))}function C(e){return e instanceof Error?e.message:String(e)}export{g as a,R as b,a as c,P as d,L as e,j as f,f as g,v as h};
2
- //# sourceMappingURL=chunk-K3XFWJI2.js.map
1
+ import{a as r,b as u}from"./chunk-H5EXS3HM.js";import{g as c}from"./chunk-7HXT6YLU.js";var g=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"],R=["entry-surface","generated-code","compatibility-shim","reflection-or-registration","test-fixture","intentional-twin","historical-coupling-ended","detector-counterexample"];var p=2,a=3;var d=new Set(g);function P(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(l){return{kind:"malformed",reason:`invalid JSON: ${C(l)}`}}if(!r(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let n=t.version;if(!Number.isInteger(n))return{kind:"malformed",reason:"version must be an integer"};if(n!==p&&n!==a)return{kind:"unsupported",version:n,direction:n<p?"older":"future"};let o=m(t,n);if(o)return{kind:"malformed",reason:o};let i=t,s={metadata:i,capabilities:f(i)};return n===p?{kind:"legacy",...s,metadata:i}:{kind:"supported",...s,metadata:i}}function L(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function j(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===a?t.sqliteLayoutVersion:void 0})}function f(e){let t=e.fingerprint!==void 0,n=r(e.fingerprint),o=e.indexedLanguages!==void 0,i=e.status==="complete",s=e.version===a?e:null;return{usableForQuery:o,usableForEvidenceCache:t,publishableGeneration:i&&n&&o,stableGenerationIdentity:i&&t&&typeof e.updatedAt=="string",languageShardReuse:!!s?.languageFingerprints,typescriptProjectShardReuse:!!s?.typescriptProjectShards}}function m(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!u(e.updatedAt))return"updatedAt must be a valid timestamp";for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!y(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!b(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===a&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===a&&e.languageFingerprints!==void 0&&!x(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===a&&e.typescriptProjectShards!==void 0&&!S(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function v(e){return e.version===a&&e.sqliteLayoutVersion===1}function y(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&d.has(t))?!1:new Set(e).size===e.length}function b(e){return Array.isArray(e)&&e.every(t=>r(t)&&typeof t.language=="string"&&d.has(t.language)&&typeof t.reason=="string")}function x(e){return r(e)&&Object.entries(e).every(([t,n])=>d.has(t)&&r(n))}function S(e){return r(e)&&Object.values(e).every(t=>r(t)&&Array.isArray(t.files)&&t.files.every(c))}function C(e){return e instanceof Error?e.message:String(e)}export{g as a,R as b,a as c,P as d,L as e,j as f,f as g,v as h};
2
+ //# sourceMappingURL=chunk-CKBUBRYD.js.map
@@ -0,0 +1,2 @@
1
+ import{a as f,c as g}from"./chunk-F4FNK44D.js";import{X as p,Y as x}from"./chunk-7HXT6YLU.js";import{h as d}from"./chunk-7F45LJKI.js";function U(n){if(!n)return;let e=Number(n);return Number.isInteger(e)&&e>0?e:void 0}import{execFileSync as b}from"child_process";import{createHash as v}from"crypto";import{existsSync as s,statSync as j}from"fs";import{createRequire as B}from"module";import{platform as N}from"os";import{dirname as m,join as a}from"path";var S=B(import.meta.url),G={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function l(n){return[n.indexerBinary,...n.binaryAliases??[]]}function k(n){let e=l(n);return e.length===1?e[0]:e.join(" or ")}function u(n){for(let e of l(n)){let r=g(e);if(r)return r}return O(n)}function W(n){return u(n)!==null||L(n)}function L(n){return I(n)!==null}function O(n){let e=I(n);if(!e)return null;let t=JSON.parse(d(e,"indexer package manifest")).bin;if(!t)return null;if(typeof t=="string")return a(m(e),t);for(let o of l(n)){let i=t[o];if(i)return a(m(e),i)}return null}function I(n){if(!n.bundledNpmPackage)return null;try{return S.resolve(`${n.bundledNpmPackage}/package.json`)}catch{return null}}function E(n,e){for(let r of n.projectLocalBinaries??[]){let t=a(e,r);if(s(t))return t}return null}function w(n,e){for(let r of n.projectLocalBinaries??[]){let t=a(e,r);if(s(t))return T(e,r,t)}return null}function Y(n,e){let r=D(n,e);if(!r||r.canonicalPath!==e.canonicalPath||r.sha256!==e.sha256||r.size!==e.size||r.mtimeMs!==e.mtimeMs||r.device!==e.device||r.inode!==e.inode||r.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function D(n,e){try{return T(n,e.relativePath,e.configuredPath)}catch{return null}}function T(n,e,r){let t={maxBytes:268435456,inputKind:"project-local indexer"},o=p(n,e,t),i=x(n,e,t),h=j(o.absolutePath);return{configuredPath:r,canonicalPath:o.absolutePath,relativePath:e,sha256:v("sha256").update(i).digest("hex"),size:o.size,mtimeMs:o.mtimeMs,device:o.device,inode:o.inode,executable:(h.mode&73)!==0}}function R(n,e,r={}){return(r.trustProjectTools?w(n,e)?.canonicalPath:null)??u(n)}function Z(n,e=process.env,r=n.indexerBinary){if(n.indexerBinary!=="scip-dotnet"||c(r,e))return e;let t=P(r,e);return t?{...e,DOTNET_ROOT:t}:e}function Q(n,e,r={}){let t=k(n),o=e?R(n,e,r):u(n);if(!o)return{language:n.language,binaryLabel:t,installed:!1,runnable:!1,resolvedBinary:null,installUrl:n.installUrl,...e&&E(n,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(n.indexerBinary!=="scip-dotnet")return{language:n.language,binaryLabel:t,installed:!0,runnable:!0,resolvedBinary:o};let i=J(o);return{language:n.language,binaryLabel:t,installed:!0,runnable:i.runnable,resolvedBinary:o,installUrl:n.installUrl,note:i.note}}function J(n){if(c(n,process.env))return{runnable:!0};let e=P(n,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let r=y(process.env);return{runnable:!1,note:r.length>0?`.NET 9 runtime still unavailable after checking ${r.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function P(n,e){for(let r of y(e))if(c(n,{...e,DOTNET_ROOT:r}))return r;return null}function y(n){let e=[],r=n.DOTNET_ROOT;if(r&&s(r)&&e.push(r),N()==="darwin"&&f("brew"))try{let t=b("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:n,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),o=a(t,"libexec");s(o)&&!e.includes(o)&&e.push(o)}catch{}return e}function c(n,e){try{return b(n,["--version"],{stdio:"pipe",env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}export{G as a,k as b,u as c,W as d,E as e,w as f,Y as g,Z as h,Q as i,U as j};
2
+ //# sourceMappingURL=chunk-CZW5MZ5B.js.map
@@ -0,0 +1,2 @@
1
+ import{d as x}from"./chunk-GG45PK4S.js";import{g as f,h as p}from"./chunk-OIOC5EHF.js";import{a as L}from"./chunk-E7QR35ST.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as v}from"./chunk-2BMSSRBH.js";import{a as E}from"./chunk-BGBBVSH4.js";import{a as C}from"./chunk-BJWFVAA5.js";import{f as y}from"./chunk-U3SXIMII.js";import{b}from"./chunk-F5GSBHC6.js";import{d as m,v as g}from"./chunk-C7C6AKAT.js";import{c as u,n as h}from"./chunk-RBAD4GJ2.js";var A=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,N=/^(?:is|has)(?:[A-Z].*)?$/,k=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,I=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,_=/\.(?:addIssue|push)\s*\(/;function M(e,t={}){let{scope:n,limit:i=30,scanLimit:l}=t,a=new v(e),r=D(a.productionCallableDefinitions({scope:n,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),s=[];for(let o of r){let c=P(e,o);c&&s.push({symbol:o.symbol,shortName:m(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:E(o),...c})}return s.sort((o,c)=>o.file.localeCompare(c.file)||o.startLine-c.startLine||o.loc-c.loc),i?s.slice(0,i):s}function w(e){return A.test(e)?"imperative":N.test(e)?"predicate":null}function P(e,t){let n=w(t.leaf);if(!n||L(e,t))return null;let i=f(e,t);if(!i||!I.test(i))return null;let l=h(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine);if(n==="predicate"&&l?.paramCount===0)return null;if(x(i)){let r=O(e,t);return!r||S(r.body,T(r.snippet))||R(r.body)?null:{nameKind:n,resolvedVia:"one-hop-delegate",delegateTarget:r.shortName}}let a=p(i);return S(a,T(i))||R(a)?null:{nameKind:n,resolvedVia:"direct"}}var F=new Set(["if","for","while","switch","catch","function"]);function R(e){let t=u(e);for(let n of t.matchAll(/\b([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g))if(!F.has(n[1]))return!0;return!1}function T(e){let t=e.indexOf("=>");return t===-1?!1:!/^\s*\{/.test(e.slice(t+2))}function S(e,t){let n=u(e);if(/\bthrow\b/.test(n)||/\.reject\s*\(/.test(n)||k.test(n)||_.test(n))return!0;let i=K(n);if(t&&i.length===0){let l=n.trim();return l!==""&&l!=="true"}for(let l of i)if(l!==""&&l!=="true")return!0;return!1}function K(e){let t=[];d.lastIndex=0;let n;for(;n=d.exec(e);){let i=n.index+n[0].length,l=0,a=e.length;for(let r=i;r<e.length;r+=1){let s=e[r];if(s==="("||s==="["||s==="{")l+=1;else if(s===")"||s==="]"||s==="}"){if(l===0){a=r;break}l-=1}else if(s===";"&&l===0){a=r;break}}t.push(e.slice(i,a).trim()),d.lastIndex=a}return t}function O(e,t){let n=y(e,t,{callableOnly:!0,limit:3,semanticEvidence:C}),i=[...new Set(n.map(o=>o.symbol))].filter(o=>o!==t.symbol);if(i.length!==1)return null;let a=b(e,i[0]).match;if(!a)return null;let r=g(e,a.relativePath).find(o=>o.symbolId===a.symbolId);if(!r)return null;let s=f(e,r);return s?{body:p(s),snippet:s,shortName:m(r.symbol)}:null}export{M as a};
2
+ //# sourceMappingURL=chunk-DBBZ63ZX.js.map
@@ -0,0 +1,18 @@
1
+ import{a as U}from"./chunk-QOKYJ33H.js";import{a as $,c as W}from"./chunk-2BMSSRBH.js";import{d as z,i as G}from"./chunk-YSYPDRD5.js";import{d as j,i as S,k as O}from"./chunk-C7C6AKAT.js";import{E as k}from"./chunk-ZLMXIQLC.js";import{Ba as A,Y as R,f as _}from"./chunk-JZ2A7LDM.js";import{execFileSync as g}from"child_process";import{existsSync as se}from"fs";import{basename as q}from"path";var ae="Unable to compute git diff.",re={semanticConsumers:G,sourceFallbackConsumers:$,semanticReadiness:z},I={resolveCommit:R,readBatch({projectRoot:e,resolvedBase:i,relativePaths:t}){let n=t.map(a=>`${i}:./${a}
2
+ `).join("");return g("git",["cat-file","--batch"],{cwd:e,input:n,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]})}};function Ye(e,i={}){let t=i.plan??oe(e,i);return t.note?de(t.note,t.changedFileLines):t.changedFiles.length===0?ue(t.changedFileLines):le(t.changedFiles,[ce(e,t.changedFiles,t.changedFiles,t.changedRanges)])}function oe(e,i={}){let{base:t="HEAD"}=i;try{let n=R(e.config.projectRoot,t),a=fe(e.config.projectRoot,n),s=a.changedFileLines,r=Re(e,s),o=Se(e,a.changedRanges);return{changedFileLines:s,changedFiles:r,changedRanges:o,renamedFiles:he(e.config.projectRoot,n,r,a),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:ae}}}function ce(e,i,t,n=[],a={}){let s=a.evidenceRuntime??re,r=new W(e),o=new Set(t),l=U(n),u=[],d=new Map,c=i.flatMap(f=>r.definitionsForFile(f)).filter(Ae),m=c.filter(f=>ve(f,l)),p=Le(e,c,m,l),y=xe([...m,...p.definitions]).sort((f,b)=>f.relativePath.localeCompare(b.relativePath)||f.startLine-b.startLine),B=y.map(f=>f.symbolId),w=Te(e,B),ne=Ne(e,B,t),h=y.filter(f=>(w.get(f.symbolId)??0)===0),M=h.length>0?s.semanticReadiness?.(e)??{ready:!0}:{ready:!0},P=M.ready?Z("semantic-consumers",h.length,()=>s.semanticConsumers(e,h)):{values:new Map,status:{tier:"semantic-consumers",state:"failed",attemptedSymbols:h.length,reason:M.reason}},E=P.values,T=h.filter(f=>(E.get(f.symbolId)?.size??0)===0),N=Z("source-fallback-consumers",T.length,()=>s.sourceFallbackConsumers(e,T)),ie=N.values;for(let f of y)Me(e,f,o,u,d,E.get(f.symbolId)??new Set,ie.get(f.symbolId)??new Set,w.get(f.symbolId)??0,ne.get(f.symbolId)??new Set);return{changedSymbols:u,consumerEntries:[...d.entries()].map(([f,b])=>({file:f,symbols:[...b].sort()})),attributionNotes:p.notes,evidenceTiers:[P.status,N.status]}}function le(e,i){let t=new Map,n=i.flatMap(o=>o.changedSymbols),a=i.flatMap(o=>o.attributionNotes??[]),s=Pe(i);for(let o of i)for(let l of o.consumerEntries){let u=t.get(l.file);u||(u=new Set,t.set(l.file,u));for(let d of l.symbols)u.add(d)}let r=_e(t);return{changedFiles:[...e],changedSymbols:n,affectedConsumers:r,attributionNotes:a,evidenceTiers:s,summary:{totalChangedFiles:e.length,totalChangedSymbols:n.length,totalAffectedFiles:r.length}}}function de(e,i=[]){return{changedFiles:i,changedSymbols:[],affectedConsumers:[],attributionNotes:[],evidenceTiers:te(),summary:{totalChangedFiles:i.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function ue(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],evidenceTiers:te(),summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function fe(e,i){let t=g("git",["diff","--name-status","--find-renames",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864}),n=g("git",["diff","--name-status","--find-renames","--cached",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),a=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),s=g("git",["diff","--unified=0",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),r=g("git",["diff","--unified=0","--cached",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),o=be([t,n]);return{changedFileLines:[...new Set([...o.changedFiles,...K(a)])],changedRanges:X([...J(s),...J(r)]),renamedFiles:o.renamedFiles,deletedFiles:o.deletedFiles}}function me(e,i,t){let n=typeof e=="string"?{projectRoot:e,base:i,relativePath:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string"||typeof n.relativePath!="string")throw new TypeError("fileContentAtBase requires projectRoot, base, and relativePath.");let a={projectRoot:n.projectRoot,base:n.base,relativePath:n.relativePath},{relativePath:s}=a,r=V(a);if(r.state==="unavailable")throw new Error(`Base content unavailable for ${s}: ${r.reason}`);return r.state==="present"?r.content:null}function V(e,i=I){return Y(e.relativePath),F({projectRoot:e.projectRoot,base:e.base,relativePaths:[e.relativePath]},i).get(e.relativePath)??{state:"unavailable",reason:`Base-content lookup omitted ${e.relativePath}.`}}function F(e,i=I){for(let r of e.relativePaths)Y(r);let t=[...new Set(e.relativePaths)];if(t.length===0)return new Map;let n;try{n=i.resolveCommit(e.projectRoot,e.base)}catch(r){return C(t,v(r))}let a;try{a=i.readBatch({projectRoot:e.projectRoot,resolvedBase:n,relativePaths:t})}catch(r){return C(t,v(r))}let s;try{s=pe(a,t)}catch(r){return C(t,`Malformed git cat-file batch output: ${v(r)}`)}return new Map(t.map(r=>{let o=s.get(r)??null;return[r,o===null?{state:"absent"}:{state:"present",content:o}]}))}function ge(e,i=I){let t=F({projectRoot:e.projectRoot,base:e.base,relativePaths:e.preloadPaths??[]},i);return n=>(t.has(n)||t.set(n,V({projectRoot:e.projectRoot,base:e.base,relativePath:n},i)),t.get(n)??{state:"unavailable",reason:`Base-content reader omitted ${n}.`})}function Ke(e,i,t=[]){let n=typeof e=="string"?{projectRoot:e,base:i,preloadPaths:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string")throw new TypeError("createBaseContentReader requires projectRoot and base.");let a={projectRoot:n.projectRoot,base:n.base,preloadPaths:n.preloadPaths},s=ge(a);return r=>{let o=s(r);if(o.state==="unavailable")throw new Error(`Base content unavailable for ${r}: ${o.reason}`);return o.state==="present"?o.content:null}}function Qe(e,i=e.changedFiles){let t=new Map(e.renamedFiles.map(n=>[n.to,n.from]));return[...new Set(i.map(n=>t.get(n)??n))]}function Xe(e,i,t){let n=typeof e=="string"?{projectRoot:e,base:i,relativePaths:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string"||!Array.isArray(n.relativePaths))throw new TypeError("fileContentsAtBase requires projectRoot, base, and relativePaths.");let a=F(n),s=new Map;for(let[r,o]of a){if(o.state==="unavailable")throw new Error(`Base content unavailable for ${r}: ${o.reason}`);s.set(r,o.state==="present"?o.content:null)}return s}function Y(e){_(e)}function C(e,i){return new Map(e.map(t=>[t,{state:"unavailable",reason:i}]))}function v(e){let t=(e instanceof Error?e.message:String(e)).replaceAll(/\s+/g," ").trim().slice(0,500);return t===""?"Git base-content lookup failed without a reason.":t}function pe(e,i){let t=new Map,n=0;for(let a of i){let s=e.indexOf(10,n);if(s<0)throw new Error("git cat-file batch output ended before object header");let r=e.subarray(n,s).toString("utf-8");if(n=s+1,r.endsWith(" missing")){t.set(a,null);continue}let o=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(r);if(!o)throw new Error(`unexpected git cat-file batch header: ${r}`);let[,l,u]=o,d=Number(u);if(!Number.isFinite(d)||d<0)throw new Error(`unexpected git cat-file batch size: ${r}`);if(n+d>e.length)throw new Error("git cat-file batch output ended before blob payload");let c=e.subarray(n,n+d);t.set(a,l==="blob"?c.toString("utf-8"):null),n+=d,e[n]===10&&(n+=1)}return t}function he(e,i,t,n){if(t.length===0)return[];let a=new Map,s=new Set;for(let o of n.renamedFiles)t.includes(o.to)&&(a.set(o.to,o),s.add(o.from));let r=n.deletedFiles;if(r.length===0)return[...a.values()].sort((o,l)=>o.to.localeCompare(l.to));for(let o of t){if(a.has(o)||!se(`${e}/${o}`))continue;let l=r.filter(c=>!s.has(c)).filter(c=>q(c)===q(o));if(l.length===0)continue;let u=A(e,o),d=l.map(c=>({from:c,to:o,similarity:ye(me({projectRoot:e,base:i,relativePath:c})??"",u)})).sort((c,m)=>m.similarity-c.similarity)[0];d&&d.similarity>=.45&&(a.set(o,d),s.add(d.from))}return[...a.values()].sort((o,l)=>o.to.localeCompare(l.to))}function be(e){let i=new Set,t=new Map,n=new Set;for(let a of e.flatMap(s=>K(s))){let[s,r,o]=a.split(" ");if(!(!s||!r)){if(s.startsWith("R")&&o){i.add(o),t.set(o,{from:r,to:o,similarity:Number(s.slice(1))/100});continue}i.add(r),s.startsWith("D")&&n.add(r)}}return{changedFiles:[...i],renamedFiles:[...t.values()],deletedFiles:[...n]}}function ye(e,i){let t=new Set(H(e)),n=new Set(H(i));if(t.size===0&&n.size===0)return 1;if(t.size===0||n.size===0)return 0;let a=0;for(let s of t)n.has(s)&&(a+=1);return 2*a/(t.size+n.size)}function H(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function K(e){return e.split(`
3
+ `).map(i=>i.trim()).filter(i=>i.length>0)}function Re(e,i){let t=Q(e),n=[];for(let a of i){let s=t(a);s&&!e.isIgnored(s)&&n.push(s)}return n}function Se(e,i){let t=Q(e),n=[];for(let a of i){let s=t(a.file);s&&!e.isIgnored(s)&&n.push({...a,file:s})}return X(n)}function Q(e){let i=e.all(`SELECT relative_path FROM documents
4
+ ORDER BY id`).map(n=>n.relative_path),t=new Map(i.map(n=>[n,n]));return n=>{let a=n.replace(/\\/g,"/"),s=t.get(a);return s||(i.find(r=>r.endsWith(a))??null)}}function J(e){let i=[],t=null;for(let n of e.split(`
5
+ `)){if(n.startsWith("+++ ")){t=Ce(n.slice(4).trim());continue}if(!t||!n.startsWith("@@ "))continue;let a=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(n);if(!a)continue;let s=Math.max(0,Number(a[1])-1),r=a[2]===void 0?1:Number(a[2]);i.push({file:t,startLine:s,endLine:Math.max(s,s+Math.max(r,1)-1)})}return i}function Ce(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function X(e){let i=new Set,t=[];for(let n of e){let a=`${n.file}:${n.startLine}:${n.endLine}`;i.has(a)||(i.add(a),t.push(n))}return t}function ve(e,i){let t=i.get(e.relativePath);return!t||t.length===0?!0:t.some(n=>x(e.startLine,e.endLine,n.startLine,n.endLine))}function De(e,i,t){let n=new Map,a=[],s=ee(e),r=Be(t);for(let o of i){let l=s.get(o.file)??[];if(l.some(c=>x(c.startLine,c.endLine,o.startLine,o.endLine)))continue;let u=r.get(o.file)??[],d=we(u,o);if(d){let c=l.find(m=>m.startLine>=d.startLine&&m.startLine<=d.endLine);if(c){n.set(c.symbolId,c),a.push(D(o,"ast-widened"));continue}}if(u.length===0){let c=[...l].filter(m=>m.startLine<=o.startLine).sort((m,p)=>p.startLine-m.startLine||m.endLine-p.endLine)[0];if(c){n.set(c.symbolId,c),a.push(D(o,"nearest-preceding"));continue}}a.push(D(o,"unattributed"))}return{definitions:[...n.values()],notes:a}}function Le(e,i,t,n){let a=ee(t),s=[],r=[],o=[...new Set(i.map(l=>l.relativePath))];for(let l of o){let u=n.get(l)??[];if(u.length===0)continue;let d=a.get(l)??[];for(let c of u)d.some(m=>x(m.startLine,m.endLine,c.startLine,c.endLine))||s.push(c);s.some(c=>c.file===l)&&r.push(...Ie(e,l))}return De(i,s,r)}function Ie(e,i){let t=k(e,i);return t?t.rootNode.namedChildren.filter(Fe).map(n=>({file:i,startLine:n.startPosition.row,endLine:n.endPosition.row})).filter(n=>n.endLine>=n.startLine):[]}function Fe(e){return e.endPosition.row<e.startPosition.row?!1:!new Set(["import_statement","comment"]).has(e.type)}function xe(e){let i=new Map;for(let t of e)i.set(t.symbolId,t);return[...i.values()]}function ee(e){let i=new Map;for(let t of e){let n=i.get(t.relativePath)??[];n.push(t),i.set(t.relativePath,n)}return i}function Be(e){let i=new Map;for(let t of e){let n=i.get(t.file)??[];n.push(t),i.set(t.file,n)}return i}function we(e,i){return e.filter(t=>t.startLine<=i.startLine&&t.endLine>=i.endLine).sort((t,n)=>t.endLine-t.startLine-(n.endLine-n.startLine))[0]}function D(e,i){return{file:e.file,startLine:e.startLine,endLine:e.endLine,method:i}}function x(e,i,t,n){return e<=n&&t<=i}function Me(e,i,t,n,a,s,r,o,l){let u=Math.max(o,s.size,r.size);if(!ke(i,u))return;let d=j(i.symbol);n.push({symbol:i.symbol,shortName:d,file:i.relativePath,startLine:i.startLine,endLine:i.endLine,fanIn:u});for(let c of l)L(e,t,a,c,d);for(let c of s)L(e,t,a,c,d);for(let c of r)L(e,t,a,c,d)}function Z(e,i,t){try{return{values:t(),status:{tier:e,state:"complete",attemptedSymbols:i}}}catch(n){return{values:new Map,status:{tier:e,state:"failed",attemptedSymbols:i,reason:Ee(n)}}}}function Pe(e){return["semantic-consumers","source-fallback-consumers"].map(i=>{let t=e.map(s=>s.evidenceTiers?.find(r=>r.tier===i)??{tier:i,state:"failed",attemptedSymbols:0,reason:"isolated diff-impact batch omitted its evidence-tier status"}),n=t.reduce((s,r)=>s+r.attemptedSymbols,0),a=[...new Set(t.filter(s=>s.state==="failed").map(s=>s.reason))];return a.length===0?{tier:i,state:"complete",attemptedSymbols:n}:{tier:i,state:"failed",attemptedSymbols:n,reason:a.join("; ").slice(0,500)}})}function te(){return[{tier:"semantic-consumers",state:"complete",attemptedSymbols:0},{tier:"source-fallback-consumers",state:"complete",attemptedSymbols:0}]}function Ee(e){let t=(e instanceof Error?e.message:String(e)).replaceAll(/\s+/g," ").trim().slice(0,500);return t===""?"evidence provider failed without a reason":t}function Te(e,i){if(i.length===0)return new Map;let t=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
6
+ FROM mentions m
7
+ JOIN chunks c ON m.chunk_id = c.id
8
+ WHERE m.symbol_id IN (${i.map(()=>"?").join(",")})
9
+ AND m.role != 1
10
+ GROUP BY m.symbol_id`,...i);return new Map(t.map(n=>[n.symbol_id,n.fan_in]))}function Ne(e,i,t){if(i.length===0||t.length===0)return new Map;let n=e.all(`SELECT DISTINCT m.symbol_id, ref_d.relative_path
11
+ FROM mentions m
12
+ JOIN chunks c ON m.chunk_id = c.id
13
+ JOIN documents ref_d ON c.document_id = ref_d.id
14
+ WHERE m.symbol_id IN (${i.map(()=>"?").join(",")})
15
+ AND m.role != 1
16
+ AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
17
+ ${e.pathExclusionsFor("ref_d")}`,...i,...t),a=new Map;for(let s of n){let r=a.get(s.symbol_id);r||(r=new Set,a.set(s.symbol_id,r)),r.add(s.relative_path)}return a}function L(e,i,t,n,a){if(e.isIgnored(n)||i.has(n))return;let s=t.get(n);s||(s=new Set,t.set(n,s)),s.add(a)}function _e(e){return[...e.entries()].map(([i,t])=>({file:i,consumedSymbols:t.size})).sort((i,t)=>t.consumedSymbols-i.consumedSymbols)}function Ae(e){return!(O(e.symbol)||e.parentTypeName!==null&&!S(e.symbol))}function ke(e,i){return S(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&i>0}export{ae as a,Ye as b,oe as c,ce as d,le as e,me as f,V as g,F as h,ge as i,Ke as j,Qe as k,Xe as l,De as m};
18
+ //# sourceMappingURL=chunk-DBN7DMJB.js.map
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{$b as s,Bb as E,Ib as I,Sb as x,Ub as V,dc as k,eb as S,ec as A,mc as b}from"./chunk-V4NG5OMS.js";import{Ba as h,_ as v}from"./chunk-2BTJALUS.js";var fe={defaultRole:"repository-observation"};function Ce(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function N(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function ge(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function _(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as ne}from"async_hooks";var W=1,G=1;var Y={policyId:"scip-query:unresolved-repository-policy",policyVersion:G,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function L(e){return{schemaVersion:W,origin:e.contract.origin,coverage:X(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:S(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??Y,...e.contract.families?{families:e.contract.families}:{}}}function X(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var z="scip-query-result";var Z=1,ee=1,M=1,P=1;function J(e){let n=e.resultSchemaVersion??ee;if(!h(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:z,schemaVersion:Z,producer:{name:"scip-query",version:t},resultSchemaVersion:n,...o}}function T(e,n){return JSON.stringify(e,null,n?0:2)}var D=Symbol("option-value-source"),B=new Map,H=new Map,j=new Map,q=new ne;function _e(e,n){return q.run(e,n)}function Le(e){B=new Map(e)}function Me(e){H=new Map(e)}function Pe(e){j=new Map(e)}function f(e){return(...n)=>{let{args:t,opts:o}=K(n);I(r=>{b(r.generation.identity),e({db:r,args:t,opts:o})})}}function y(e,n){return f(t=>{let o=A(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function Je(e){return f(n=>c(n,e,{kind:"list"}))}function Te(e){return f(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function De(e){return f(n=>c(n,e,{kind:"grouped",key:e.key}))}function te(e){return f(n=>R(n,e))}function Be(e){return te({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function He(e,n,t){return(...o)=>{let{args:r,opts:i}=K(o),a=n({args:r,opts:i});if(!a)return t(...o);b(a.generationIdentity);let u={args:r,opts:i,observationReceipt:a.observationReceipt};R(u,{commandName:e.commandName,query:()=>a.result,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(l,m)=>s.sectionedReport(e.sections(l,m)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}}function oe(e,n){return y(e,t=>R(t,{...n,commandName:n.commandName??e}))}function je(e,n){return oe(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function qe(e,n){return y(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function Qe(e,n){return y(e,t=>c(t,{...n,commandName:e},{kind:"table",headers:n.headers,dashWidths:n.dashWidths}))}function Ke(e,n){return y(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Ue(e,n){return String(e[n])}function Fe(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function $e(e,n){let t=e[n];return typeof t=="string"?t:void 0}function We(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ge(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ye(e,n,t){return Q(e,n)??t}function Xe(e,n,t){let o=Q(e,n),r=o!==void 0&&re(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function re(e,n){return e[D]?.(n)}function c(e,n,t){R(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function R(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");ae(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:ie(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),observationReceipt:e.observationReceipt});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&k(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function ie(e){return e.budget?.analysisBudget}function ae(e,n,t,o,r={}){let i=B.get(e),a=H.get(e),u=j.get(e),l=a?N(a.operation,{args:n,options:t}):void 0,m=q.getStore();if(m!==void 0&&l!==void 0&&m!==l)throw new Error(`Command ${e} changed operation role during execution: selected ${m}, rendered ${l}.`);let O=m??l,w=me(o),C=r.coverage??ue(a,o,r.analysisBudget),p=C&&w&&!C.resolution?{...C,resolution:w}:C;p&&de(p);let g=d(t,"agentOutput"),U=g&&r.agentResult!==void 0?r.agentResult:o;if(d(t,"resultOnly")){let $=g&&r.agentResult!==void 0?r.agentResult:Object.hasOwn(r,"resultOnly")?r.resultOnly:o;x(JSON.stringify($,null,d(t,"compact")?0:2));return}let F=J({producerVersion:v,command:e,...O?{operationRole:O}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ce(n),options:t,result:U,...g?{resultProjection:"agent"}:{},...p?{coverage:p}:{},...r.agentResult!==void 0&&!g?{agentResult:r.agentResult}:{},...se(O,i,r.analysisBudget,p,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});x(T(F,d(t,"compact")))}function se(e,n,t,o,r,i){if(!e||!_(e))return{};let a=E(),u=i??(a?V({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:M,operationRole:e,receipt:u,analysisManifest:{schemaVersion:P,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:L({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function de(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ue(e,n,t){if(!e)return;let o=le(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function le(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function me(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ce(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function K(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:pe(n)}}function pe(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,D,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{fe as a,Ce as b,N as c,ge as d,_e as e,Le as f,Me as g,Pe as h,f as i,y as j,Je as k,Te as l,De as m,te as n,Be as o,He as p,oe as q,je as r,qe as s,Qe as t,Ke as u,Ue as v,Fe as w,$e as x,We as y,Q as z,d as A,Ge as B,Ye as C,Xe as D,re as E,ae as F,K as G,pe as H};
3
- //# sourceMappingURL=chunk-CKRWA452.js.map
2
+ import{Bb as E,Ib as I,Tb as x,Vb as V,ac as s,eb as S,ec as k,fc as A,nc as b}from"./chunk-NWLVNU66.js";import{Ca as h,_ as v}from"./chunk-2XWIUW5Z.js";var fe={defaultRole:"repository-observation"};function Ce(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function N(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function ge(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function _(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as ne}from"async_hooks";var W=1,G=1;var Y={policyId:"scip-query:unresolved-repository-policy",policyVersion:G,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function L(e){return{schemaVersion:W,origin:e.contract.origin,coverage:X(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:S(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??Y,...e.contract.families?{families:e.contract.families}:{}}}function X(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var z="scip-query-result";var Z=1,ee=1,M=1,P=1;function J(e){let n=e.resultSchemaVersion??ee;if(!h(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:z,schemaVersion:Z,producer:{name:"scip-query",version:t},resultSchemaVersion:n,...o}}function T(e,n){return JSON.stringify(e,null,n?0:2)}var D=Symbol("option-value-source"),B=new Map,H=new Map,j=new Map,q=new ne;function _e(e,n){return q.run(e,n)}function Le(e){B=new Map(e)}function Me(e){H=new Map(e)}function Pe(e){j=new Map(e)}function f(e){return(...n)=>{let{args:t,opts:o}=K(n);I(r=>{b(r.generation.identity),e({db:r,args:t,opts:o})})}}function y(e,n){return f(t=>{let o=A(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function Je(e){return f(n=>c(n,e,{kind:"list"}))}function Te(e){return f(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function De(e){return f(n=>c(n,e,{kind:"grouped",key:e.key}))}function te(e){return f(n=>R(n,e))}function Be(e){return te({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function He(e,n,t){return(...o)=>{let{args:r,opts:i}=K(o),a=n({args:r,opts:i});if(!a)return t(...o);b(a.generationIdentity);let u={args:r,opts:i,observationReceipt:a.observationReceipt};R(u,{commandName:e.commandName,query:()=>a.result,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(l,m)=>s.sectionedReport(e.sections(l,m)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}}function oe(e,n){return y(e,t=>R(t,{...n,commandName:n.commandName??e}))}function je(e,n){return oe(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function qe(e,n){return y(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function Qe(e,n){return y(e,t=>c(t,{...n,commandName:e},{kind:"table",headers:n.headers,dashWidths:n.dashWidths}))}function Ke(e,n){return y(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Ue(e,n){return String(e[n])}function Fe(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function $e(e,n){let t=e[n];return typeof t=="string"?t:void 0}function We(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ge(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ye(e,n,t){return Q(e,n)??t}function Xe(e,n,t){let o=Q(e,n),r=o!==void 0&&re(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function re(e,n){return e[D]?.(n)}function c(e,n,t){R(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function R(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");ae(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:ie(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),observationReceipt:e.observationReceipt});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&k(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function ie(e){return e.budget?.analysisBudget}function ae(e,n,t,o,r={}){let i=B.get(e),a=H.get(e),u=j.get(e),l=a?N(a.operation,{args:n,options:t}):void 0,m=q.getStore();if(m!==void 0&&l!==void 0&&m!==l)throw new Error(`Command ${e} changed operation role during execution: selected ${m}, rendered ${l}.`);let O=m??l,w=me(o),C=r.coverage??ue(a,o,r.analysisBudget),p=C&&w&&!C.resolution?{...C,resolution:w}:C;p&&de(p);let g=d(t,"agentOutput"),U=g&&r.agentResult!==void 0?r.agentResult:o;if(d(t,"resultOnly")){let $=g&&r.agentResult!==void 0?r.agentResult:Object.hasOwn(r,"resultOnly")?r.resultOnly:o;x(JSON.stringify($,null,d(t,"compact")?0:2));return}let F=J({producerVersion:v,command:e,...O?{operationRole:O}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ce(n),options:t,result:U,...g?{resultProjection:"agent"}:{},...p?{coverage:p}:{},...r.agentResult!==void 0&&!g?{agentResult:r.agentResult}:{},...se(O,i,r.analysisBudget,p,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});x(T(F,d(t,"compact")))}function se(e,n,t,o,r,i){if(!e||!_(e))return{};let a=E(),u=i??(a?V({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:M,operationRole:e,receipt:u,analysisManifest:{schemaVersion:P,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:L({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function de(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ue(e,n,t){if(!e)return;let o=le(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function le(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function me(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ce(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function K(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:pe(n)}}function pe(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,D,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{fe as a,Ce as b,N as c,ge as d,_e as e,Le as f,Me as g,Pe as h,f as i,y as j,Je as k,Te as l,De as m,te as n,Be as o,He as p,oe as q,je as r,qe as s,Qe as t,Ke as u,Ue as v,Fe as w,$e as x,We as y,Q as z,d as A,Ge as B,Ye as C,Xe as D,re as E,ae as F,K as G,pe as H};
3
+ //# sourceMappingURL=chunk-DUULLZHZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as _}from"./chunk-ZOXKSQQB.js";import{f as L,g as A}from"./chunk-QLBSG7U5.js";import{a as R}from"./chunk-TAYD3AE7.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as E}from"./chunk-PLYUVM4F.js";import{a as w}from"./chunk-BGBBVSH4.js";import{f as x,h as I}from"./chunk-BECZLYNU.js";import{d as N}from"./chunk-TD7VKJ2Y.js";import{b as T,c as h}from"./chunk-42W3LFUK.js";import{a as g}from"./chunk-7JYHQAH2.js";import{B as S}from"./chunk-Q7GBK5T7.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=L(e,n);if(!o)return null;let r=A(o),l=r.trim();if(l==="")return!z(o)||!R(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
2
- //# sourceMappingURL=chunk-6HRZQLOI.js.map
1
+ import{a as _}from"./chunk-GTZZVLKJ.js";import{g as L,h as A}from"./chunk-OIOC5EHF.js";import{a as R}from"./chunk-2GJSD5GY.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as E}from"./chunk-2BMSSRBH.js";import{a as w}from"./chunk-BGBBVSH4.js";import{f as x,h as I}from"./chunk-NJQISBL4.js";import{d as N}from"./chunk-C7C6AKAT.js";import{b as T,c as h}from"./chunk-RBAD4GJ2.js";import{a as g}from"./chunk-ZLMXIQLC.js";import{h as S}from"./chunk-ETC674NS.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=L(e,n);if(!o)return null;let r=A(o),l=r.trim();if(l==="")return!z(o)||!R(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
2
+ //# sourceMappingURL=chunk-DV5Y5NOS.js.map