scip-query 0.21.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/CHANGELOG.md +317 -0
  2. package/README.md +11 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-XI2CSWEY.js +2 -0
  5. package/dist/call-graph-UONR6JR5.js +2 -0
  6. package/dist/{chunk-JGMD6JGB.js → chunk-2E7CX53V.js} +2 -2
  7. package/dist/chunk-2GRUZAQF.js +43 -0
  8. package/dist/{chunk-RSUH7G5T.js → chunk-2LDBDR6J.js} +2 -2
  9. package/dist/{chunk-4SZJF4GK.js → chunk-2OOY75BW.js} +2 -2
  10. package/dist/{chunk-3YETOKNO.js → chunk-2R3V3PSD.js} +2 -2
  11. package/dist/chunk-2WC2OEDO.js +4 -0
  12. package/dist/{chunk-O4PZFAXA.js → chunk-3AF4TUFK.js} +2 -2
  13. package/dist/{chunk-I2LY3KN7.js → chunk-3D3QG236.js} +2 -2
  14. package/dist/{chunk-DXEJ4FLZ.js → chunk-3FHOF22C.js} +8 -8
  15. package/dist/{chunk-BCTCADNB.js → chunk-3JKSW6LJ.js} +2 -2
  16. package/dist/chunk-3L2ZBPEX.js +133 -0
  17. package/dist/{chunk-4HQYNZ3P.js → chunk-3PJABJSU.js} +2 -2
  18. package/dist/{chunk-GBZCVYWA.js → chunk-3SVF22I5.js} +2 -2
  19. package/dist/{chunk-TP2X2C2Y.js → chunk-3WR4E3A3.js} +2 -2
  20. package/dist/chunk-4FTZ4P5G.js +2 -0
  21. package/dist/{chunk-LJMWILX6.js → chunk-4ILJCCXV.js} +2 -2
  22. package/dist/chunk-4UX2F3JX.js +2 -0
  23. package/dist/chunk-4WNW27SX.js +2 -0
  24. package/dist/chunk-5ENOG4VP.js +61 -0
  25. package/dist/{chunk-YKHL4J3G.js → chunk-64BFSI5I.js} +2 -2
  26. package/dist/chunk-66DVSJQG.js +455 -0
  27. package/dist/{chunk-BYXWXLKM.js → chunk-6HFCYNYE.js} +2 -2
  28. package/dist/{chunk-UBETC3Q2.js → chunk-6I6L7Z62.js} +2 -2
  29. package/dist/{chunk-IZKJQQCQ.js → chunk-6PQNKL3G.js} +2 -2
  30. package/dist/{chunk-ITF3CWS5.js → chunk-6V5CNXL6.js} +2 -2
  31. package/dist/chunk-6VVV4WRR.js +4 -0
  32. package/dist/{chunk-ZQUNCTEZ.js → chunk-7BWFZPPZ.js} +2 -2
  33. package/dist/{chunk-5QM7QT5B.js → chunk-7CYG22FH.js} +2 -2
  34. package/dist/chunk-7F45LJKI.js +2 -0
  35. package/dist/{chunk-QN2AI3D2.js → chunk-7IWV2EG3.js} +2 -2
  36. package/dist/{chunk-5KIJMEPC.js → chunk-AFHTBORT.js} +2 -2
  37. package/dist/chunk-AVRYW5OZ.js +2 -0
  38. package/dist/chunk-B3PYOSCX.js +2 -0
  39. package/dist/{chunk-YF25RQER.js → chunk-B5D7QPBE.js} +2 -2
  40. package/dist/{chunk-PU6XDQ2X.js → chunk-BBCIS4DX.js} +5 -5
  41. package/dist/chunk-BDUVI7TO.js +3 -0
  42. package/dist/{chunk-UXNXOMXJ.js → chunk-BE7ZZTMC.js} +2 -2
  43. package/dist/{chunk-527HV7JY.js → chunk-BHVUJOCQ.js} +2 -2
  44. package/dist/{chunk-4IASLUOP.js → chunk-BJT7LSPK.js} +2 -2
  45. package/dist/chunk-BKVWUP7Y.js +2 -0
  46. package/dist/{chunk-QZCACNV5.js → chunk-BQGB4HBD.js} +2 -2
  47. package/dist/{chunk-QH5Q6M5C.js → chunk-BRV7PIFF.js} +2 -2
  48. package/dist/chunk-CEEZJXEF.js +2 -0
  49. package/dist/{chunk-X5MWO4DM.js → chunk-CIYLO6SI.js} +2 -2
  50. package/dist/chunk-CJZXN4NU.js +2 -0
  51. package/dist/{chunk-V6XENWOF.js → chunk-CNO7TOKL.js} +2 -2
  52. package/dist/{chunk-FUUDUAKM.js → chunk-COF23M5F.js} +2 -2
  53. package/dist/{chunk-GTZFKDP3.js → chunk-CWFP7GM5.js} +2 -2
  54. package/dist/chunk-D2DHWI3D.js +2 -0
  55. package/dist/{chunk-SBFDPHKH.js → chunk-D4N5SQ2M.js} +2 -2
  56. package/dist/{chunk-FCGMQETU.js → chunk-DBRSYFXR.js} +2 -2
  57. package/dist/{chunk-47WX6UC4.js → chunk-DHUIOLDT.js} +2 -2
  58. package/dist/{chunk-KGKCJFWZ.js → chunk-DIRJWYBM.js} +2 -2
  59. package/dist/{chunk-QGVUPYBC.js → chunk-DIUFNHRJ.js} +2 -2
  60. package/dist/{chunk-YLNCTPOI.js → chunk-DTZCKZEU.js} +2 -2
  61. package/dist/{chunk-O3EX5STE.js → chunk-DULC3QFP.js} +2 -2
  62. package/dist/{chunk-B3AREUQK.js → chunk-DYGHBZ2N.js} +2 -2
  63. package/dist/{chunk-AAOEROT3.js → chunk-E5R6AQ73.js} +2 -2
  64. package/dist/{chunk-UM56ZET4.js → chunk-E73UNJTF.js} +2 -2
  65. package/dist/{chunk-6QN4FYQW.js → chunk-EG2CPZMJ.js} +2 -2
  66. package/dist/{chunk-OMVNRPST.js → chunk-EKV5HX33.js} +2 -2
  67. package/dist/{chunk-27OUNZW5.js → chunk-EQHFIL6T.js} +2 -2
  68. package/dist/{chunk-ZGDHC5AT.js → chunk-ESIQ66Z7.js} +2 -2
  69. package/dist/chunk-EVFUMY4R.js +3 -0
  70. package/dist/{chunk-WZRNEVYC.js → chunk-F7DY272B.js} +2 -2
  71. package/dist/chunk-FBN2FGXG.js +2 -0
  72. package/dist/{chunk-HR5JYLVV.js → chunk-FDLOBR6P.js} +2 -2
  73. package/dist/chunk-FESCRNVV.js +5 -0
  74. package/dist/{chunk-MLTKGHD2.js → chunk-FFRKR4EQ.js} +2 -2
  75. package/dist/chunk-FGA2U4OR.js +8 -0
  76. package/dist/{chunk-3KXFB2FM.js → chunk-FIQRSHVM.js} +2 -2
  77. package/dist/{chunk-ZP2WUVZ5.js → chunk-FPYLNQPT.js} +2 -2
  78. package/dist/{chunk-EPLE5O5O.js → chunk-FRUSVINH.js} +2 -2
  79. package/dist/chunk-GAS2LJMP.js +3 -0
  80. package/dist/{chunk-4TOU7HHQ.js → chunk-GSP44ENC.js} +2 -2
  81. package/dist/{chunk-DXYMTQZ4.js → chunk-GUFSG5TX.js} +2 -2
  82. package/dist/chunk-GYIZ4NXB.js +2 -0
  83. package/dist/{chunk-CQVDALWQ.js → chunk-GZIUDL6G.js} +2 -2
  84. package/dist/chunk-HCXEQRFF.js +18 -0
  85. package/dist/{chunk-2LJLEM5B.js → chunk-HEHOQQKH.js} +2 -2
  86. package/dist/{chunk-RNKRYK6B.js → chunk-HKGFPJ4T.js} +2 -2
  87. package/dist/chunk-HLZTEXRA.js +2 -0
  88. package/dist/{chunk-T2PBOVDI.js → chunk-HOENASQM.js} +2 -2
  89. package/dist/{chunk-PX6QNUYF.js → chunk-HVF5VBG6.js} +2 -2
  90. package/dist/{chunk-K2DZCH2K.js → chunk-HYO3NP5Q.js} +2 -2
  91. package/dist/{chunk-MRXBLYRE.js → chunk-I55I7XXP.js} +2 -2
  92. package/dist/{chunk-AQF35NGT.js → chunk-IDFEUFKS.js} +2 -2
  93. package/dist/{chunk-7G2WIVIX.js → chunk-IHGQTTVW.js} +2 -2
  94. package/dist/{chunk-P3UFF22M.js → chunk-IICPE7B2.js} +2 -2
  95. package/dist/{chunk-NT4NVEHU.js → chunk-IL676XCC.js} +2 -2
  96. package/dist/{chunk-OU6SDWAM.js → chunk-ILTDAWEF.js} +2 -2
  97. package/dist/chunk-IW5XQG5G.js +2 -0
  98. package/dist/chunk-IZDPJ2QI.js +2 -0
  99. package/dist/{chunk-J4HUBIVF.js → chunk-J66VOFW6.js} +2 -2
  100. package/dist/chunk-JFMEXGFE.js +2 -0
  101. package/dist/{chunk-DGM2RJ3I.js → chunk-JGKUET5J.js} +2 -2
  102. package/dist/{chunk-BM4OTGSY.js → chunk-JS4PGXMV.js} +2 -2
  103. package/dist/{chunk-OG5UK2K7.js → chunk-JTQVMR42.js} +2 -2
  104. package/dist/chunk-JWTGMPIT.js +80 -0
  105. package/dist/{chunk-3XQLJG7V.js → chunk-JYR66JN5.js} +2 -2
  106. package/dist/chunk-KLFEXGQA.js +2 -0
  107. package/dist/chunk-KYSDI3GE.js +5 -0
  108. package/dist/{chunk-LIWIV26I.js → chunk-L6PJPETJ.js} +2 -2
  109. package/dist/{chunk-6DO3VBLV.js → chunk-LDVT66YM.js} +2 -2
  110. package/dist/chunk-LEECKFCJ.js +2 -0
  111. package/dist/{chunk-BVR44XXB.js → chunk-LMZ5PRUV.js} +2 -2
  112. package/dist/{chunk-KFFQURUZ.js → chunk-LQRQN2XA.js} +2 -2
  113. package/dist/{chunk-YR7VRWNX.js → chunk-LXABEJX3.js} +2 -2
  114. package/dist/{chunk-ARGPDW2Y.js → chunk-M2O5NY6W.js} +2 -2
  115. package/dist/{chunk-7YZGSLW6.js → chunk-MNV5FSBW.js} +2 -2
  116. package/dist/{chunk-XFRHBAIT.js → chunk-MPQ4OTBM.js} +2 -2
  117. package/dist/{chunk-PJBYDCBQ.js → chunk-MV3CDXPI.js} +2 -2
  118. package/dist/{chunk-DK6MB565.js → chunk-MWN53KRN.js} +2 -2
  119. package/dist/chunk-N2ZSIIGR.js +117 -0
  120. package/dist/chunk-N5B2NILC.js +5 -0
  121. package/dist/{chunk-HW7FASEL.js → chunk-NJITK2GP.js} +2 -2
  122. package/dist/{chunk-DUDUIT5P.js → chunk-NOGJXYFO.js} +2 -2
  123. package/dist/chunk-NOYBFVJA.js +554 -0
  124. package/dist/chunk-NWQXSFFU.js +3 -0
  125. package/dist/chunk-ODDUPDP7.js +13 -0
  126. package/dist/chunk-OLIWTZI3.js +3 -0
  127. package/dist/{chunk-JO6FK3Q5.js → chunk-OLNV6I6U.js} +2 -2
  128. package/dist/{chunk-CXT3GZSQ.js → chunk-OR2E3AGZ.js} +2 -2
  129. package/dist/chunk-OSR2GEHQ.js +2 -0
  130. package/dist/{chunk-7MUHSZGN.js → chunk-OSSESPDX.js} +2 -2
  131. package/dist/{chunk-ND3BWIVN.js → chunk-OWOOWNJ5.js} +2 -2
  132. package/dist/{chunk-UEQORB2A.js → chunk-P42EIXTA.js} +2 -2
  133. package/dist/{chunk-PWEQ6CZZ.js → chunk-PJFGPYTU.js} +2 -2
  134. package/dist/{chunk-CNT4ND5O.js → chunk-PP7KNN7L.js} +2 -2
  135. package/dist/{chunk-C52Q3JEQ.js → chunk-PU7T5QYQ.js} +2 -2
  136. package/dist/{chunk-OY7PCALC.js → chunk-PWWAJSKV.js} +2 -2
  137. package/dist/{chunk-LXMW6ZAX.js → chunk-PZL5T7SU.js} +2 -2
  138. package/dist/{chunk-G47MFF47.js → chunk-QBE3YX64.js} +2 -2
  139. package/dist/{chunk-SGSPCEFC.js → chunk-QGVTFRY2.js} +2 -2
  140. package/dist/chunk-QOJONDS7.js +2 -0
  141. package/dist/chunk-QU5XRYB5.js +4 -0
  142. package/dist/{chunk-4ZCLDH6T.js → chunk-QUU5OBVK.js} +2 -2
  143. package/dist/{chunk-N4EFQIRX.js → chunk-RBLQNW26.js} +2 -2
  144. package/dist/chunk-RTQ7NEKG.js +81 -0
  145. package/dist/{chunk-XNF5T4T2.js → chunk-SQXRS7BG.js} +2 -2
  146. package/dist/chunk-SSK6LDPC.js +2 -0
  147. package/dist/chunk-SZHGTCPP.js +7 -0
  148. package/dist/chunk-T4N4P2K5.js +16 -0
  149. package/dist/{chunk-LFWB7TOJ.js → chunk-TA3QKLLU.js} +2 -2
  150. package/dist/chunk-TEBQMNVI.js +43 -0
  151. package/dist/chunk-TPFHAQ2G.js +2 -0
  152. package/dist/chunk-TQPCBMWT.js +5 -0
  153. package/dist/chunk-TQZV7KV4.js +2 -0
  154. package/dist/{chunk-FOP7HD6H.js → chunk-TRNAEQ6P.js} +2 -2
  155. package/dist/chunk-TY7CRN3Z.js +2 -0
  156. package/dist/{chunk-XDOEHEET.js → chunk-UHFYCMZO.js} +2 -2
  157. package/dist/{chunk-E6N6YTVM.js → chunk-UICY4GTQ.js} +2 -2
  158. package/dist/{chunk-AFRS7WJU.js → chunk-UVGEWT4Y.js} +2 -2
  159. package/dist/{chunk-IHGK3SZ7.js → chunk-UXW33INU.js} +2 -2
  160. package/dist/{chunk-RZWBTKXO.js → chunk-VMPRET3I.js} +2 -2
  161. package/dist/{chunk-DZA7MQMU.js → chunk-VNLGKHS6.js} +2 -2
  162. package/dist/chunk-VQILFTEH.js +2 -0
  163. package/dist/chunk-VUPHCS7Y.js +57 -0
  164. package/dist/{chunk-K63CAPS2.js → chunk-VVZSBTSU.js} +2 -2
  165. package/dist/{chunk-IH3K5J6K.js → chunk-VZRNID6A.js} +2 -2
  166. package/dist/{chunk-NSDPPUDY.js → chunk-W5OXRYGE.js} +2 -2
  167. package/dist/chunk-W6STWDQI.js +57 -0
  168. package/dist/chunk-W7CXK74K.js +2 -0
  169. package/dist/chunk-WB3WYIRE.js +4 -0
  170. package/dist/{chunk-WV6R37XV.js → chunk-WDNVY4E7.js} +2 -2
  171. package/dist/{chunk-Z2QB75BS.js → chunk-WIWY3CRX.js} +2 -2
  172. package/dist/chunk-WK46TNUM.js +3 -0
  173. package/dist/chunk-WNTFFKAX.js +12 -0
  174. package/dist/{chunk-U2MNECDU.js → chunk-WOIKCX6A.js} +2 -2
  175. package/dist/{chunk-5BJPJUXF.js → chunk-WUN6KBHV.js} +2 -2
  176. package/dist/chunk-WYCTJDVR.js +2 -0
  177. package/dist/chunk-WYPL7GF7.js +2 -0
  178. package/dist/{chunk-OFZVFIDF.js → chunk-XBGWL66K.js} +2 -2
  179. package/dist/{chunk-3T5U2EQ2.js → chunk-XDQMU3BT.js} +2 -2
  180. package/dist/{chunk-BZCRHP46.js → chunk-XFA4SSO3.js} +2 -2
  181. package/dist/{chunk-4KIPF45P.js → chunk-XGZEP6GR.js} +2 -2
  182. package/dist/chunk-XPDPNWTQ.js +368 -0
  183. package/dist/chunk-XRYABF57.js +8 -0
  184. package/dist/{chunk-KBIC6JHJ.js → chunk-YBGKCQIS.js} +2 -2
  185. package/dist/{chunk-5J3A6RBZ.js → chunk-YEN6CYC7.js} +2 -2
  186. package/dist/{chunk-OA2BO4DR.js → chunk-YF5IB2LF.js} +2 -2
  187. package/dist/{chunk-Q4MRRB3C.js → chunk-YI2AWIHC.js} +2 -2
  188. package/dist/{chunk-YCXQQ3YB.js → chunk-YPWBKGFU.js} +2 -2
  189. package/dist/{chunk-EJHNTAEE.js → chunk-YPWHBBIS.js} +2 -2
  190. package/dist/{chunk-FIO44MVK.js → chunk-YSH6U3L4.js} +2 -2
  191. package/dist/{chunk-HYU4W353.js → chunk-YU5DZUZI.js} +2 -2
  192. package/dist/chunk-YWO5DDRC.js +16 -0
  193. package/dist/{chunk-5Z2H76VD.js → chunk-YXPUP5G2.js} +2 -2
  194. package/dist/{chunk-H2RBDP5S.js → chunk-Z4CDXYNQ.js} +2 -2
  195. package/dist/{chunk-VJAD5WX5.js → chunk-ZF5KHH7C.js} +2 -2
  196. package/dist/chunk-ZOHS7AQV.js +21 -0
  197. package/dist/{chunk-YT4IQBET.js → chunk-ZTI4SBFV.js} +2 -2
  198. package/dist/cli-main.js +2 -2
  199. package/dist/code-MI6F2TTU.js +2 -0
  200. package/dist/code-result-json-FXALY4HE.js +2 -0
  201. package/dist/{command-descriptors-6INSCKLW.js → command-descriptors-P34VABY5.js} +144 -143
  202. package/dist/dataflow-4KEMJPC6.js +2 -0
  203. package/dist/dependence-slice-R7FPWD5M.js +2 -0
  204. package/dist/deps-7EMQUYUT.js +2 -0
  205. package/dist/direct-navigation-6YO234F2.js +3 -0
  206. package/dist/entry-map-KOOLR26E.js +2 -0
  207. package/dist/files-OPIPJIGZ.js +2 -0
  208. package/dist/hierarchy-QPD2CAER.js +2 -0
  209. package/dist/imports-M6HUXRXC.js +2 -0
  210. package/dist/index.js +1 -1
  211. package/dist/members-I5MEFOCT.js +2 -0
  212. package/dist/methods-5JYGGHXA.js +2 -0
  213. package/dist/output-continuation-command-UPQAAKBP.js +3 -0
  214. package/dist/postinstall.js +1 -1
  215. package/dist/project-reindex-UKKQ5PLS.js +3 -0
  216. package/dist/queries/affected.js +1 -1
  217. package/dist/queries/anchors.js +1 -1
  218. package/dist/queries/architecture.js +1 -1
  219. package/dist/queries/bottlenecks.js +1 -1
  220. package/dist/queries/by-kind.js +1 -1
  221. package/dist/queries/call-graph.js +1 -1
  222. package/dist/queries/change-surface.js +1 -1
  223. package/dist/queries/cleanup-plan.js +1 -1
  224. package/dist/queries/co-change.js +1 -1
  225. package/dist/queries/code.js +1 -1
  226. package/dist/queries/complexity-hotspots.js +1 -1
  227. package/dist/queries/complexity.d.ts +11 -0
  228. package/dist/queries/complexity.js +1 -1
  229. package/dist/queries/context.js +1 -1
  230. package/dist/queries/convergence.js +1 -1
  231. package/dist/queries/coupling.js +1 -1
  232. package/dist/queries/cycles.js +1 -1
  233. package/dist/queries/dataflow.js +1 -1
  234. package/dist/queries/dead.js +1 -1
  235. package/dist/queries/decorative-checkers.js +1 -1
  236. package/dist/queries/deep-chains.js +1 -1
  237. package/dist/queries/dependence-slice.js +1 -1
  238. package/dist/queries/dependency-depth.js +1 -1
  239. package/dist/queries/deps.js +1 -1
  240. package/dist/queries/diff-impact.d.ts +9 -0
  241. package/dist/queries/diff-impact.js +1 -1
  242. package/dist/queries/doc-drift.js +1 -1
  243. package/dist/queries/drift.js +1 -1
  244. package/dist/queries/duplicate-bodies.js +1 -1
  245. package/dist/queries/entry-map.js +1 -1
  246. package/dist/queries/evidence.js +1 -1
  247. package/dist/queries/extract-candidates.js +1 -1
  248. package/dist/queries/fan.js +1 -1
  249. package/dist/queries/files.js +1 -1
  250. package/dist/queries/health.js +1 -1
  251. package/dist/queries/hierarchy.js +1 -1
  252. package/dist/queries/hotspots.js +1 -1
  253. package/dist/queries/imports.js +1 -1
  254. package/dist/queries/incomplete-migration.js +1 -1
  255. package/dist/queries/index.js +1 -1
  256. package/dist/queries/isolated.js +1 -1
  257. package/dist/queries/locality-candidates.js +1 -1
  258. package/dist/queries/members.js +1 -1
  259. package/dist/queries/methods.js +1 -1
  260. package/dist/queries/not-implemented.js +1 -1
  261. package/dist/queries/outline.js +1 -1
  262. package/dist/queries/passthrough-candidates.js +1 -1
  263. package/dist/queries/plan-context.js +1 -1
  264. package/dist/queries/react-component-duplicates.js +1 -1
  265. package/dist/queries/react-hook-candidates.js +1 -1
  266. package/dist/queries/react-large-component-pressure.js +1 -1
  267. package/dist/queries/recent-duplicates.js +1 -1
  268. package/dist/queries/redundant-reexports.js +1 -1
  269. package/dist/queries/reference-neighborhood.js +1 -1
  270. package/dist/queries/reference-reachability.js +1 -1
  271. package/dist/queries/refs.js +1 -1
  272. package/dist/queries/self-audit.js +1 -1
  273. package/dist/queries/similar-chains.js +1 -1
  274. package/dist/queries/similar-files.js +1 -1
  275. package/dist/queries/similar-signatures.js +1 -1
  276. package/dist/queries/similar.js +1 -1
  277. package/dist/queries/slice.js +1 -1
  278. package/dist/queries/source-inspection.js +1 -1
  279. package/dist/queries/source-search.js +1 -1
  280. package/dist/queries/stale-abstractions.js +1 -1
  281. package/dist/queries/surface.js +1 -1
  282. package/dist/queries/symbols.js +1 -1
  283. package/dist/queries/system-map.js +1 -1
  284. package/dist/queries/system.js +1 -1
  285. package/dist/queries/test-quality.js +1 -1
  286. package/dist/queries/trace.js +1 -1
  287. package/dist/queries/twin-ab.js +1 -1
  288. package/dist/queries/twin-drift.js +1 -1
  289. package/dist/queries/unused-imports.js +1 -1
  290. package/dist/queries/unused-params.js +1 -1
  291. package/dist/queries/value-flow.js +1 -1
  292. package/dist/queries/vue-component-duplicates.js +1 -1
  293. package/dist/queries/vue-composable-candidates.js +1 -1
  294. package/dist/queries/vue-large-view-pressure.js +1 -1
  295. package/dist/queries/wrapper-candidates.js +1 -1
  296. package/dist/query-service-fastpath.js +5 -5
  297. package/dist/query-service-server.js +3 -3
  298. package/dist/refs-PSU4JZZW.js +2 -0
  299. package/dist/refs-pagination-JG6CJMRC.js +2 -0
  300. package/dist/reindex-worker.js +64 -22
  301. package/dist/reindex.d.ts +3 -2
  302. package/dist/reindex.js +74 -32
  303. package/dist/runtime.d.ts +34 -2
  304. package/dist/runtime.js +4 -4
  305. package/dist/rust-semantic-session-server.js +1 -1
  306. package/dist/rust-semantic-session-worker.js +1 -1
  307. package/dist/rust-semantic-worker.js +1 -1
  308. package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
  309. package/dist/slice-HYRATV64.js +2 -0
  310. package/dist/surface-VTGDYWF5.js +2 -0
  311. package/dist/symbol-resolution-WD5EU5JE.js +2 -0
  312. package/dist/system-LRQNFOR2.js +2 -0
  313. package/dist/trace-F4B6OLL4.js +2 -0
  314. package/dist/typescript-mailbox-worker.js +1 -1
  315. package/dist/value-flow-VRPZY72V.js +2 -0
  316. package/dist/watch-server.js +3 -3
  317. package/package.json +1 -1
  318. package/dist/by-kind-XXGZGNZ6.js +0 -2
  319. package/dist/call-graph-VGY3R4L3.js +0 -2
  320. package/dist/chunk-3XZELASU.js +0 -2
  321. package/dist/chunk-63TFRBMB.js +0 -2
  322. package/dist/chunk-67FK5KGV.js +0 -3
  323. package/dist/chunk-6LS3IG2I.js +0 -13
  324. package/dist/chunk-6X4KO5A7.js +0 -11
  325. package/dist/chunk-743MEVFJ.js +0 -8
  326. package/dist/chunk-7Z4GMCHM.js +0 -117
  327. package/dist/chunk-ANCHW2R4.js +0 -57
  328. package/dist/chunk-BMKTDJI6.js +0 -16
  329. package/dist/chunk-BZYSGZRK.js +0 -2
  330. package/dist/chunk-C7WSQA6A.js +0 -21
  331. package/dist/chunk-CTO3TRX7.js +0 -2
  332. package/dist/chunk-DNPETNXT.js +0 -2
  333. package/dist/chunk-DZNWXJN2.js +0 -18
  334. package/dist/chunk-E7CJ6O72.js +0 -2
  335. package/dist/chunk-FLSVYEPL.js +0 -2
  336. package/dist/chunk-FSPENGSU.js +0 -4
  337. package/dist/chunk-FYCH2EYQ.js +0 -2
  338. package/dist/chunk-G6VV7ROY.js +0 -2
  339. package/dist/chunk-GSHTVE56.js +0 -3
  340. package/dist/chunk-IGBQVEHE.js +0 -2
  341. package/dist/chunk-IM23CSG5.js +0 -2
  342. package/dist/chunk-IQMGNIGY.js +0 -2
  343. package/dist/chunk-JLZWYDCZ.js +0 -4
  344. package/dist/chunk-JSHDCVUM.js +0 -81
  345. package/dist/chunk-L7WRUNKJ.js +0 -2
  346. package/dist/chunk-LGVTIZPV.js +0 -61
  347. package/dist/chunk-MFBVUQJZ.js +0 -2
  348. package/dist/chunk-MLTSTKXD.js +0 -5
  349. package/dist/chunk-MR4ZKWO6.js +0 -57
  350. package/dist/chunk-NODZYYGC.js +0 -2
  351. package/dist/chunk-NP4JFCLE.js +0 -133
  352. package/dist/chunk-NQXWWE6S.js +0 -8
  353. package/dist/chunk-O2VY47Y5.js +0 -325
  354. package/dist/chunk-PAZSBPJR.js +0 -3
  355. package/dist/chunk-PRLU3I7G.js +0 -79
  356. package/dist/chunk-QLWZUFDT.js +0 -2
  357. package/dist/chunk-SIGVQT43.js +0 -2
  358. package/dist/chunk-SRIZDEWX.js +0 -4
  359. package/dist/chunk-U7DOYZDH.js +0 -2
  360. package/dist/chunk-UAQQR55F.js +0 -2
  361. package/dist/chunk-VRJG7N3I.js +0 -453
  362. package/dist/chunk-W7HN6V4E.js +0 -7
  363. package/dist/chunk-WCIKJ2E3.js +0 -3
  364. package/dist/chunk-WEXQYJY3.js +0 -5
  365. package/dist/chunk-WOPZX5GM.js +0 -2
  366. package/dist/chunk-WZ7V4BQV.js +0 -2
  367. package/dist/chunk-XDQX6LDT.js +0 -4
  368. package/dist/chunk-XIPGCT3D.js +0 -5
  369. package/dist/chunk-XKM5D2XS.js +0 -16
  370. package/dist/chunk-Y2S4YNLH.js +0 -3
  371. package/dist/chunk-YA72ZUKO.js +0 -2
  372. package/dist/chunk-YBWE6J32.js +0 -43
  373. package/dist/chunk-YDTK77JP.js +0 -43
  374. package/dist/chunk-Z2KGMIL4.js +0 -2
  375. package/dist/chunk-Z67JOKRE.js +0 -554
  376. package/dist/chunk-ZMS4YCY7.js +0 -2
  377. package/dist/chunk-ZNW5A5VX.js +0 -3
  378. package/dist/code-AXLJBZ6T.js +0 -2
  379. package/dist/code-result-json-CTZHAQXJ.js +0 -2
  380. package/dist/dataflow-AFXY423Q.js +0 -2
  381. package/dist/dependence-slice-2G4X6VSJ.js +0 -2
  382. package/dist/deps-LMCAV5DO.js +0 -2
  383. package/dist/direct-navigation-2ONV22Y2.js +0 -3
  384. package/dist/entry-map-ZOC3VXO5.js +0 -2
  385. package/dist/files-WJQJLHMH.js +0 -2
  386. package/dist/hierarchy-ASNIHAX4.js +0 -2
  387. package/dist/imports-JICEKDKK.js +0 -2
  388. package/dist/members-C5H2K3MS.js +0 -2
  389. package/dist/methods-KZOZHSD4.js +0 -2
  390. package/dist/output-continuation-command-NX3RH3TP.js +0 -3
  391. package/dist/project-reindex-A2SXUH2H.js +0 -3
  392. package/dist/refs-ZOORVRQC.js +0 -2
  393. package/dist/refs-pagination-SRCUOYRD.js +0 -2
  394. package/dist/slice-NOTBWA7S.js +0 -2
  395. package/dist/surface-BTBCLKNA.js +0 -2
  396. package/dist/symbol-resolution-SVSMX4RN.js +0 -2
  397. package/dist/system-2EIUFP6B.js +0 -2
  398. package/dist/trace-BB2GHQPG.js +0 -2
  399. package/dist/value-flow-OA7AHSUG.js +0 -2
@@ -1,8 +0,0 @@
1
- import{b as p}from"./chunk-HW7FASEL.js";import{a as T}from"./chunk-DHEQMPLW.js";import{b as N}from"./chunk-YBWE6J32.js";import{a as A,e as h,t as D}from"./chunk-7Z4GMCHM.js";import{v as O}from"./chunk-6LS3IG2I.js";import{a as m}from"./chunk-C7WSQA6A.js";import{C as j,d as u}from"./chunk-JSHDCVUM.js";import{c as l,ua as S,va as w,wa as _}from"./chunk-WEXQYJY3.js";import{existsSync as b,readdirSync as M}from"fs";import{join as d}from"path";var it={files:new Set,pathPrefixes:[]},at={reasonsByFile:new Map},P=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,ot=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,C=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],ct=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),ut=4,ft=u("package-surface",{clearGroups:["whole-project"]}),lt=u("package-operational-surface",{clearGroups:["whole-project"]});function $(t){return ft.get(t,()=>pt(t.config.projectRoot))}function x(t,e){let n=$(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function I(t,e){return $(t).files.has(e)}function gt(t){return lt.get(t,()=>dt(t.config.projectRoot))}function ce(t,e){return gt(t).reasonsByFile.get(e)??[]}function pt(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of L(t))for(let i of St(r))U(t,s,i,e,n);return e.size===0&&n.length===0?it:{files:e,pathPrefixes:n}}function dt(t){let e=new Map;for(let{manifest:n,packageRoot:r}of L(t)){let s=mt(n);for(let a of s)v(t,r,a,"package binary",e);let i=n.scripts;if(!(!i||typeof i!="object")){for(let[a,o]of Object.entries(i))if(typeof o=="string")for(let c of ht(o))v(t,r,c,`package script "${a}"`,e)}}return e.size===0?at:{reasonsByFile:e}}function L(t){let e=[],n=X(t,"");return n&&e.push({manifest:n,packageRoot:""}),V(t,"",e,0),e}function V(t,e,n,r){if(r>=ut)return;let s=d(t,e);if(b(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||ct.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name,o=X(t,a);o&&n.push({manifest:o,packageRoot:a}),V(t,a,n,r+1)}}function X(t,e){let n;try{n=S(t,d(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!w(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function St(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return B(t.exports,e),e}function mt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(n=>typeof n=="string")}function ht(t){let e=[],n=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let r of t.matchAll(n)){let s=r[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function v(t,e,n,r,s){let i=new Set;U(t,e,n,i,[]);for(let a of i){let o=s.get(a)??[];o.includes(r)||o.push(r),s.set(a,o)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))B(n,e)}function U(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let a=i.indexOf("*");if(a>=0){let c=i.slice(0,a);for(let g of F(c))g!==""&&s.push(f(e,g));return}let o=i.replace(ot,"");for(let c of F(o)){c===o&&c===i&&r.add(f(e,i));for(let g of C)bt(t,r,e,c+g)}r.add(f(e,i))}function F(t){let e=[t];return P.test(t)&&(e.push(t.replace(P,"src/")),e.push(t.replace(P,""))),e}function bt(t,e,n,r){let s=f(n,r);if(e.add(s),!r.startsWith("src/")||b(d(t,s)))return;let i=C.find(y=>r.endsWith(y));if(!i)return;let a=r.slice(0,-i.length);yt(t,e,n,a,i);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),g=a.slice(o+1);for(let y of G(t,n,c,`${g}${i}`))e.add(y)}function yt(t,e,n,r,s){let i=f(n,`${r}/index${s}`);b(d(t,i))&&e.add(i)}function G(t,e,n,r){let s=d(t,e,n);if(!b(s))return[];let i=[];for(let a of M(s,{withFileTypes:!0})){let o=`${n}/${a.name}`;a.isDirectory()?i.push(...G(t,e,o,r)):a.isFile()&&a.name===r&&i.push(f(e,o))}return i}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as E,readdirSync as Pt}from"fs";import{dirname as xt,join as k}from"path";var Et={rootFiles:new Set,sourcePrefixes:[]},kt=new Set([".git",".scipquery","node_modules","target"]),Rt=6,Tt=u("rust-library-surface",{clearGroups:["whole-project"]});function W(t,e,n){if(!n.endsWith(".rs")||!jt(wt(t),n))return!1;let r=D(t,n).find(s=>s.symbol===e);return r?Ot(j(t,n)[r.startLine]??""):!1}function wt(t){return Tt.get(t,()=>_t(t.config.projectRoot))}function _t(t){let e=new Set,n=new Set;for(let r of Nt(t)){let s=S(t,k(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=At(s),a=f(r,"src/lib.rs"),o=i?f(r,i):!Dt(s)&&_(t,a)?a:null;if(!o)continue;e.add(o);let c=xt(o).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?Et:{rootFiles:e,sourcePrefixes:[...n].sort()}}function jt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:vt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Ot(t){return/^\s*pub\s+(?!\()/.test(t)}function Nt(t){if(!E(t))return[];let e=[];return H(t,"",e,0),e}function H(t,e,n,r){let s=k(t,e);if(E(s)&&(E(k(s,"Cargo.toml"))&&n.push(e),!(r>=Rt)))for(let i of Pt(s,{withFileTypes:!0})){if(!i.isDirectory()||kt.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name;H(t,a,n,r+1)}}function At(t){let e=!1;for(let n of t.split(`
2
- `)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Dt(t){let e=!1;for(let n of t.split(`
3
- `)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function vt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function Ft(t){return p(t)==="barrel"}function q(t){return Mt.get(t,()=>{let n=m(t,{includeIgnored:!1}).filter(a=>{let o=p(a);return o==="entry"||o==="worker"});if(n.length===0)return new Set;let r=N(t),s=new Set,i=new Set;for(;n.length>0;){let a=n.shift();if(!s.has(a)){s.add(a),p(a)==="barrel"&&i.add(a);for(let o of r.get(a)??[])s.has(o)||n.push(o)}}return i})}var Mt=u("live-barrels",{clearGroups:["whole-project"]});function Ct(t,e){return q(t).has(l(e))}function Ne(t){let e=q(t);return m(t,{includeIgnored:!1}).filter(n=>Ft(n)&&!e.has(n)&&!$t(t,n))}function $t(t,e){let n=l(e),r=A(t).forFile(n,{facts:!0}).facts?.callables;return r&&r.length>0?!0:(t.get(`SELECT COUNT(*) AS n
4
- FROM defn_enclosing_ranges der
5
- JOIN documents d ON d.id = der.document_id
6
- WHERE d.relative_path = ?
7
- AND der.end_line - der.start_line >= 2`,n)?.n??0)>0}function Ae(t,e){let n=l(e),r=p(e);return r==="entry"||r==="worker"||ee(n)||Ct(t,n)}function It(t,e,n){let r=l(n),s=[];x(t,r)&&s.push("package-surface-file"),Xt(t,e,r)&&s.push("transitive-package-surface"),W(t,e,r)&&s.push("rust-public-library"),te(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(a=>l(a)===r)&&s.push("configured-file"),i.pathPrefixes?.some(a=>r.startsWith(l(a)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(a=>re(e,a))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(a=>{try{return T(a,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function De(t,e,n){return It(t,e,n).length>0}var Lt=u("package-surface-reachability",{clearGroups:["whole-project"]}),Vt=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function Xt(t,e,n){let r=Bt(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function ve(t,e,n){let r=Ut(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function Bt(t){return Lt.get(t,()=>Y(t,e=>x(t,e)))}function Ut(t){return Vt.get(t,()=>Y(t,e=>I(t,e)))}function Y(t,e){let n=new Map,r=[];for(let s of m(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let a of O(t,s)){if(!a.sourcePath||t.isIgnored(a.sourcePath))continue;let o=Gt(i,a);o!==void 0&&Wt(n,a.sourcePath,o)&&r.push(a.sourcePath)}}return n}function Gt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function Wt(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Z=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Ht=new Set(["default","generateMetadata","generateStaticParams"]),Kt=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),qt=new Set(["default","middleware","config"]),Yt=new Set(["register","onRequestError"]),Zt=new Set(["onRouterTransitionStart"]),Jt=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Qt=new Set(["load","actions","entries",...Z]),zt=new Set(["default"]);function te(t,e){let n=h(t);return n===""?!1:J(e)?Z.has(n):Q(e)?Ht.has(n):z(e)?Kt.has(n):tt(e)?qt.has(n):et(e)?Yt.has(n):nt(e)?Zt.has(n):rt(e)?Jt.has(n):st(e)?Qt.has(n):ne(e)?zt.has(n):!1}function ee(t){return J(t)||Q(t)||z(t)||tt(t)||et(t)||nt(t)||rt(t)||st(t)}function J(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Q(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function z(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function tt(t){return R(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function et(t){return R(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function nt(t){return R(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function R(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function rt(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ne(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function re(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(K(r)+"/")&&t.includes(K(s)+".")}function K(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{x as a,ce as b,Ft as c,Ct as d,Ne as e,Ae as f,It as g,De as h,ve as i,ee as j};
8
- //# sourceMappingURL=chunk-743MEVFJ.js.map
@@ -1,117 +0,0 @@
1
- import{a as I,m as A,p as v,v as P,w as Q}from"./chunk-6LS3IG2I.js";import{C as w,a as D}from"./chunk-C7WSQA6A.js";import{C as $,c as S,d as N,i as h,j as x,p as _,w as C,y as O,z as T}from"./chunk-JSHDCVUM.js";var te={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=ie(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function p(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function ie(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||j(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!j(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=te[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function j(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function B(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=re(r);s&&i.push(s)}return i.join(":")}function re(e){let n=e.suffix==="namespace"?se(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function se(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function W(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function g(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function je(e){return e.endsWith("().")||g(e)==="method"}function L(e){let n=g(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function Be(e){return g(e)==="namespace"}var oe=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function We(e){return oe.test(e)}var ae=new Set(["test","tests","_tests"]);function Je(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&ae.has(i.name))return!0}return!1}function ze(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function He(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ue(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
2
- FROM global_symbols gs
3
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
- JOIN documents d ON der.document_id = d.id
5
- WHERE ${n.where}
6
- ${e.pathExclusionsFor("d")}
7
- ${z(n.orderBy)}
8
- ${H(n.limit)}`,...n.params??[])}function Ke(e,n){return e.all(`SELECT
9
- gs.id,
10
- gs.symbol,
11
- c.document_id,
12
- MIN(c.start_line) AS start_line,
13
- 0 AS start_char,
14
- MAX(c.end_line) AS end_line,
15
- 0 AS end_char,
16
- d.relative_path,
17
- gs.display_name,
18
- gs.documentation
19
- FROM global_symbols gs
20
- JOIN mentions m ON m.symbol_id = gs.id
21
- JOIN chunks c ON m.chunk_id = c.id
22
- JOIN documents d ON c.document_id = d.id
23
- WHERE m.role = 1
24
- AND ${n.where}
25
- ${e.pathExclusionsFor("d")}
26
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
27
- ${z(n.orderBy)}
28
- ${H(n.limit)}`,...n.params??[])}function z(e){return e?`ORDER BY ${e}`:""}function H(e){return typeof e=="number"?`LIMIT ${e}`:""}function G(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function U(e){if(!e)return null;let n=J(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(J(i)??i).replace(/\n/g," ")}function J(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function b(e){return{forFile(n,t){return K(e,n,t)},forFiles(n,t){let i=new Map;for(let r of n)i.set(r,K(e,r,t));return i}}}function K(e,n,t){let i={file:n},r=t.facts||t.identifiers;if(t.text&&(i.text=T(e,n)),t.lines&&(i.lines=$(e,n)),t.ast&&(i.ast=w(e,n)),t.imports&&(i.imports=Q(e,n)),t.reexports&&(i.reexports=P(e,n)),r){let s=A(e,n),o=s.facts;t.facts&&(i.facts=o),s.unavailable&&(i.sourceFactsUnavailable=s.unavailable),t.identifiers&&o&&(i.identifiers=o.fileIdentifiers,i.identifierLineMap=o.identifierLineMap)}return i}function le(e,n={}){if(p(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let r=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(r)}function F(e,n,t={}){let i=new Map;for(let s of n)e.length>0&&!le(s,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||i.set(s.id,s);for(let s of e)i.set(s.id,s);let r=[...i.values()];return t.sort?r.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):r}function gn(e){let n=new Map;for(let t of e){if(!t.leaf)continue;let i=n.get(t.leaf)??[];i.push(t),n.set(t.leaf,i)}return n}var ce=S("file-definitions",{clearGroups:["definition-catalog"]}),de=N("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),ue=S("file-function-like-definitions",{clearGroups:["definition-catalog"]}),Y=new WeakMap;function E(e,n,t={},i){return t.includeClassMemberFallbacks?R(e,n,void 0,{includeClassMemberFallbacks:!0},i):ce.get(e,n,()=>{let r=m(i,"evidence-read",()=>V(e,n));if(r)return r;let s=R(e,n,void 0,t,i);return m(i,"evidence-write",()=>{let o=x(e),a=b(e).forFile(n,{text:!0}).text;o&&a&&q.write(e,n,h(e,n,a),{projectFingerprint:o,definitions:s.map(c=>({...c}))})}),s})}function fe(e,n){return ue.get(e,n,()=>{let t=V(e,n);return t?t.filter(i=>i.isFunctionLike):R(e,n,i=>i.isFunctionLike)})}var q=C({kind:"file-definitions",invalidation:O("file-definitions"),serialize:me,deserialize:pe});function V(e,n){let t=x(e);if(!t)return null;let i=b(e).forFile(n,{text:!0}).text;if(!i)return null;let r=q.read(e,n,h(e,n,i));return r?ge(r,t,n):null}function me(e){return JSON.stringify(e)}function pe(e){try{let n=JSON.parse(e);return!_(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function ge(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let s=be(r,t);if(!s)return null;i.push(s)}return i}function be(e,n){return!_(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function R(e,n,t,i={},r){let s=m(r,"primary-rows",()=>ye(e,n)),o=m(r,"fallback-rows",()=>Se(e,n)),a=m(r,"merge-rows",()=>F(s,o,{sort:!0,includeClassMemberFallbacks:i.includeClassMemberFallbacks}).map(k));return t&&(a=a.filter(t)),m(r,"range-correction",()=>M(e,n,a,r,i.rangeCorrectionEvidence))}function m(e,n,t){return e?e(n,t):t()}function ye(e,n){return e.all(`SELECT
29
- gs.id,
30
- gs.symbol,
31
- der.document_id,
32
- der.start_line,
33
- der.start_char,
34
- der.end_line,
35
- der.end_char,
36
- d.relative_path,
37
- gs.display_name,
38
- gs.kind,
39
- gs.documentation,
40
- gs.enclosing_symbol
41
- FROM global_symbols gs
42
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
43
- JOIN documents d ON der.document_id = d.id
44
- WHERE d.relative_path = ?
45
- ${e.symbolNoiseFor("gs")}
46
- ORDER BY der.start_line, der.end_line`,n)}function Se(e,n){return e.all(`SELECT
47
- gs.id,
48
- gs.symbol,
49
- c.document_id,
50
- MIN(c.start_line) AS start_line,
51
- 0 AS start_char,
52
- MAX(c.end_line) AS end_line,
53
- 0 AS end_char,
54
- d.relative_path,
55
- gs.display_name,
56
- gs.kind,
57
- gs.documentation,
58
- gs.enclosing_symbol
59
- FROM global_symbols gs
60
- JOIN mentions m ON m.symbol_id = gs.id
61
- JOIN chunks c ON m.chunk_id = c.id
62
- JOIN documents d ON c.document_id = d.id
63
- WHERE d.relative_path = ?
64
- AND m.role = 1
65
- ${e.symbolNoiseFor("gs")}
66
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
67
- ORDER BY start_line, end_line`,n)}function k(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:W(e.symbol),parentTypeName:p(e.symbol),isFunctionLike:L(e.symbol),isTypeLike:g(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function bn(e,n={}){return he(e,n.scope)}function he(e,n){return D(e,{scope:n,includeIgnored:!1}).flatMap(t=>E(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function yn(e,n){return D(e,{scope:n,includeIgnored:!1}).flatMap(t=>fe(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function Sn(e,n){let t=de.get(e,()=>new WeakMap),i=t.get(n.symbolMatches);i||(i=new Map,t.set(n.symbolMatches,i));let r=JSON.stringify({scope:n.scope??null,sqlPrefilter:n.sqlPrefilter??null}),s=i.get(r);if(s)return[...s];let o=X(xe(e,n.scope,n.sqlPrefilter)),a=X(De(e,n.scope,n.sqlPrefilter)),c=new Set([...o.keys(),...a.keys()]),l=[];for(let d of[...c].sort()){if(e.isIgnored(d))continue;let f=F(o.get(d)??[],a.get(d)??[],{sort:!0}).filter(ne=>n.symbolMatches(ne.symbol));f.length!==0&&l.push(...M(e,d,f.map(k)))}return i.set(r,l),[...l]}function xe(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ee("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
68
- gs.id,
69
- gs.symbol,
70
- der.document_id,
71
- der.start_line,
72
- der.start_char,
73
- der.end_line,
74
- der.end_char,
75
- d.relative_path,
76
- gs.display_name,
77
- gs.kind,
78
- gs.documentation,
79
- gs.enclosing_symbol
80
- FROM global_symbols gs
81
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
82
- JOIN documents d ON der.document_id = d.id
83
- WHERE 1 = 1
84
- ${e.pathExclusionsFor("d")}
85
- ${i}
86
- ${r}
87
- ${e.symbolNoiseFor("gs")}
88
- ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function De(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ee("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
89
- gs.id,
90
- gs.symbol,
91
- c.document_id,
92
- MIN(c.start_line) AS start_line,
93
- 0 AS start_char,
94
- MAX(c.end_line) AS end_line,
95
- 0 AS end_char,
96
- d.relative_path,
97
- gs.display_name,
98
- gs.kind,
99
- gs.documentation,
100
- gs.enclosing_symbol
101
- FROM global_symbols gs
102
- JOIN mentions m ON m.symbol_id = gs.id
103
- JOIN chunks c ON m.chunk_id = c.id
104
- JOIN documents d ON c.document_id = d.id
105
- WHERE m.role = 1
106
- AND NOT EXISTS (
107
- SELECT 1
108
- FROM defn_enclosing_ranges existing_der
109
- WHERE existing_der.symbol_id = gs.id
110
- )
111
- ${e.pathExclusionsFor("d")}
112
- ${i}
113
- ${r}
114
- ${e.symbolNoiseFor("gs")}
115
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
116
- ORDER BY d.relative_path, start_line, end_line`,...s)}function _e(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function ee(e,n){return n==="callable"?_e(e):Ie(e)}function Ie(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function X(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function hn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>E(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:B(r.symbol),signature:G(U(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Le(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function xn(e,n){let t=Y.get(e);return t||(t=Le(e),Y.set(e,t)),t.get(n)??null}function Dn(e,n){let t=E(e,n.relative_path).find(i=>i.symbolId===n.id)??(p(n.symbol)===null||!L(n.symbol)?void 0:M(e,n.relative_path,[k(n)])[0]);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function M(e,n,t,i,r){let s=m(i,"range-correction.source-text",()=>r?r.source:b(e).forFile(n,{text:!0}).text),o=m(i,"range-correction.callable-sites",()=>r?r.callables:v(e,n));return o?m(i,"range-correction.ast-correction",()=>Ne(t,o,s)):s?m(i,"range-correction.regex-fallback",()=>Fe(t,s)):t}function Fe(e,n){let t=n.split(/\r?\n/),i=Re(e,t),r=Ee(e,i),s=ke(r,t);return Me(e,s)}function Re(e,n){let t=e.some(r=>y(r.symbol))?ve(n):null,i=new Map;for(let r of e)i.set(r.symbolId,Ae(n,t,r));return i}function Ee(e,n){return e.filter(t=>y(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function ke(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:Pe(n,r.definition,r.startLine,o)})}return t}function Me(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function Ne(e,n,t=null){let i=new Map;for(let r of n){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!we(r)||!r.leaf)return Z(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return Z(r,t);let o=t?Ce(r,s,t):null;if(o)return{...r,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<s.length;l+=1){let d=s[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Ce(e,n,t){let i=Oe(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${I(i)}\\b`);for(let o of n){let a=Te(r,o.startLine);if(a&&s.test(a))return o}return null}function Oe(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Te(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return $e(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function $e(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let s=e[r]??"";if(i.push(s),s.includes("{"))break}return i.join(" ")}function we(e){return y(e.symbol)?!0:g(e.symbol)==="term"&&p(e.symbol)===null}function Z(e,n){if(!n||!e.leaf||g(e.symbol)!=="term"||p(e.symbol)!==null)return e;let t=I(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),s=n.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function Ae(e,n,t){if(!y(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-t.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function ve(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&o(d[1],a);for(let d of c.matchAll(t))d[1]&&o(d[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let d of c.matchAll(r))d[1]&&o(d[1],a)}return s}function Pe(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),s=Math.max(t,Math.min(r,n.endLine)),o=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=Qe(e[l]??"");for(let f of d)f==="{"?(o+=1,c=!0):f==="}"?o=Math.max(0,o-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function Qe(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!t&&s==="/"&&o==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(s==="\\"){i=!0,n+=" ";continue}s===t&&(t=null),n+=" ";continue}if(s==='"'||s==="'"||s==="`"){t=s,n+=" ";continue}n+=s}return n}function y(e){return e.includes("().")}function _n(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{b as a,u as b,p as c,B as d,W as e,g as f,je as g,L as h,Be as i,We as j,Je as k,ze as l,He as m,Ue as n,Ke as o,G as p,U as q,F as r,gn as s,E as t,bn as u,he as v,yn as w,Sn as x,hn as y,Le as z,xn as A,Dn as B,_n as C};
117
- //# sourceMappingURL=chunk-7Z4GMCHM.js.map
@@ -1,57 +0,0 @@
1
- import{a as Z}from"./chunk-U2MNECDU.js";import{p as yt}from"./chunk-B3AREUQK.js";import{d as ft}from"./chunk-KK7GPALL.js";import{b as mt}from"./chunk-HW7FASEL.js";import{A as he,t as T}from"./chunk-7Z4GMCHM.js";import{a as me,f as k,g as D,i as M,j as ot,k as X,l as ut,p as ct,q as dt,v as pt,w as j}from"./chunk-6LS3IG2I.js";import{A as at,C as O,D as st,F as lt,M as ye,z as fe}from"./chunk-C7WSQA6A.js";import{A as it,c as Q,i as tt,w as nt,y as rt,z as pe}from"./chunk-JSHDCVUM.js";function ge(e){let t=e.replaceAll("\\","/");return mt(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import cn from"better-sqlite3";var be="scip_query_runtime_boundaries",W="scip_query_runtime_observations",Se="scip_query_runtime_relation_groups",xe="scip_query_runtime_relation_participants";function dn(e,t){let n=new cn(e);try{n.exec(`
2
- CREATE TABLE IF NOT EXISTS ${be} (
3
- singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
4
- schema_version INTEGER NOT NULL,
5
- extractor_version TEXT NOT NULL,
6
- payload TEXT NOT NULL
7
- )
8
- `),mn(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${be} (singleton, schema_version, extractor_version, payload) VALUES (1, ?, ?, ?)`).run(t.schemaVersion,t.extractorVersion,JSON.stringify(t)),n.prepare(`DELETE FROM ${W}`).run(),n.prepare(`DELETE FROM ${xe}`).run(),n.prepare(`DELETE FROM ${Se}`).run();let r=n.prepare(`INSERT INTO ${W}
9
- (id, protocol, action, role, strength, source_scope, resolution, file, start_line, end_line, owner_symbol, payload)
10
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let s of t.observations)r.run(s.id,s.protocol,s.action,s.role,s.strength,s.sourceScope,s.resolution,s.source.file,s.source.startLine,s.source.endLine,s.owner.symbol,JSON.stringify(s));let i=n.prepare(`INSERT INTO ${Se} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),a=n.prepare(`INSERT INTO ${xe} (group_id, observation_id, participant_role) VALUES (?, ?, ?)`);for(let s of t.relationGroups){i.run(s.id,s.protocol,s.joinRule,s.normalizedKey,JSON.stringify(s));for(let o of s.producerIds)a.run(s.id,o,"producer");for(let o of s.consumerIds)a.run(s.id,o,"consumer");for(let o of s.declarationIds)a.run(s.id,o,"declaration")}})()}finally{n.close()}}function pn(e,t={}){if(!fn(e,W))return ht(e)?.observations??[];let n=[],r=[];return ve(n,r,"protocol",t.protocols),ve(n,r,"action",t.actions),ve(n,r,"source_scope",t.sourceScopes),ve(n,r,"file",t.files),e.all(`SELECT payload FROM ${W}${n.length>0?` WHERE ${n.join(" AND ")}`:""} ORDER BY file, start_line, id`,...r).flatMap(a=>yn(a.payload))}function mn(e){e.exec(`
11
- CREATE TABLE IF NOT EXISTS ${W} (
12
- id TEXT PRIMARY KEY,
13
- protocol TEXT NOT NULL,
14
- action TEXT NOT NULL,
15
- role TEXT NOT NULL,
16
- strength TEXT NOT NULL,
17
- source_scope TEXT NOT NULL,
18
- resolution TEXT NOT NULL,
19
- file TEXT NOT NULL,
20
- start_line INTEGER NOT NULL,
21
- end_line INTEGER NOT NULL,
22
- owner_symbol TEXT,
23
- payload TEXT NOT NULL
24
- );
25
- CREATE INDEX IF NOT EXISTS idx_runtime_observations_protocol_action_scope
26
- ON ${W}(protocol, action, source_scope);
27
- CREATE INDEX IF NOT EXISTS idx_runtime_observations_file_line
28
- ON ${W}(file, start_line);
29
-
30
- CREATE TABLE IF NOT EXISTS ${Se} (
31
- id TEXT PRIMARY KEY,
32
- protocol TEXT NOT NULL,
33
- join_rule TEXT NOT NULL,
34
- normalized_key TEXT NOT NULL,
35
- payload TEXT NOT NULL
36
- );
37
- CREATE INDEX IF NOT EXISTS idx_runtime_groups_protocol_key
38
- ON ${Se}(protocol, join_rule, normalized_key);
39
-
40
- CREATE TABLE IF NOT EXISTS ${xe} (
41
- group_id TEXT NOT NULL,
42
- observation_id TEXT NOT NULL,
43
- participant_role TEXT NOT NULL,
44
- PRIMARY KEY (group_id, observation_id, participant_role)
45
- );
46
- CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
47
- ON ${xe}(observation_id, participant_role);
48
- `)}function fn(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function ve(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function yn(e){try{return[JSON.parse(e)]}catch{return[]}}function ht(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",be))return null;let n=e.get(`SELECT schema_version, payload FROM ${be} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}import{createHash as de}from"crypto";import{createRequire as zr}from"module";import{createHash as $n}from"crypto";var Re=8;function ee(e,t,n){return De(gt(e,t,Oe(n),0,new Set))}function Ae(e,t,n){return Le(e,t,n,0,new Set)}function gt(e,t,n,r,i){if(r>Re)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?vt(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?bt(e,t,n,r,i):[]}function vt(e,t,n,r,i,a){let s=[];for(let o of Le(e,t,n,i+1,new Set(a))){let l=M(o.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let c=u.childForFieldName("key")??u.namedChild(0);if(Sn(c)!==r)continue;let d=u.childForFieldName("value")??u.namedChild(1);d&&s.push(...gt(e,o.definition.relativePath,Oe(d.text),i+1,new Set(a)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let d=vn(e,o.definition.relativePath,r,u);s.push(...d.length>0?d:[hn(o.definition,r,u)]);continue}if(u.type==="spread_element"){let c=u.namedChild(0);if(!c)continue;for(let d of Le(e,o.definition.relativePath,Oe(c.text),i+1,new Set(a)))s.push(...vt(e,d.definition.relativePath,d.definition.leaf,r,i+1,new Set(a)))}}}return De(s)}function hn(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function Le(e,t,n,r,i){return r>Re||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:bt(e,t,n,r,i).flatMap(a=>{let s=O(e,a.relativePath)?.rootNode,o=s?bn(s,a.leaf):null;return o?[{definition:a,initializer:o}]:[]})}function bt(e,t,n,r,i){if(r>Re)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let s=T(e,t).filter(u=>u.leaf===n);if(s.length>0)return s;let o=gn(e,t,n);if(o.length>0)return o;let l=j(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return ke(e,l.sourcePath,u,r+1,new Set(i))}return ke(e,t,n,r+1,new Set(i))}function gn(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(ut(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function ke(e,t,n,r,i){if(r>Re)return[];let a=T(e,t).filter(s=>s.leaf===n);return a.length>0?a:De(pt(e,t).flatMap(s=>s.sourcePath?s.kind==="named"&&!s.names.includes(n)?[]:ke(e,s.sourcePath,n,r+1,new Set(i)):[]))}function vn(e,t,n,r){return T(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function bn(e,t){let n=null;return k(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Sn(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Oe(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function De(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}var xn=8;function V(e,t){return t?te(e,t,0,new Set):null}function te(e,t,n,r){if(n>xn)return U(t,"value-evaluation-depth");let i=M(t),a=Pn(i);if(a)return wn(e.file,i,a.term,a.value,a.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>te(e,u,n+1,new Set(r)));if(l.length>=2&&l.every(u=>u!==null)){let u={kind:"concat",parts:l.map(d=>d.term)},c=l.map(d=>d.value).join("");return En(e.file,i,u,c,l.some(d=>d.precision!=="literal")?"constrained-pattern":"literal",l)}}let s=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))return Bn(e,s,i,n,r);let o=Fn(i);return o?In(e,o.base,o.properties,i,n,r):i.type==="call_expression"||i.type==="call"?Rn(e,i,n,r):U(i,`unsupported-expression:${i.type}`)}function Rn(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",s=Cn(e,a);if(s.length!==1)return U(t,s.length===0?"call-target-unresolved":"call-target-ambiguous");let o=s[0],l=`${o.relativePath}\0${o.symbol}`;if(r.has(l))return U(t,"call-return-cycle");let u=O(e.db,o.relativePath)?.rootNode;if(!u)return U(t,"call-target-unparsed");let c=D(u,o.startLine,o.endLine);if(!c)return U(t,"call-target-syntax-unavailable");let d=Nn(c);if(!d)return U(t,"call-return-not-single-expression");let p=new Set(r);p.add(l);let m=te({db:e.db,file:o.relativePath,root:u},d,n+1,p);return m?Ce(t,"bounded-call-return",m,o.symbol):U(t,"call-return-unresolved")}function Cn(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=T(e.db,e.file).filter(s=>s.isFunctionLike&&s.leaf===t);if(i.length>0)return i;let a=j(e.db,e.file).find(s=>s.localName===t&&s.sourcePath&&s.kind!=="namespace");return a?.sourcePath?Z(e.db,a.sourcePath,a.importedName==="default"?t:a.importedName).filter(s=>s.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=j(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?Z(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function Nn(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return St(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function St(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)St(e,r,n)}}function Bn(e,t,n,r,i){let a=`${e.file}\0${t}`;if(i.has(a))return U(n,"value-cycle");i.add(a);let s=Me(e.root,t);if(s){let y=te(e,s,r+1,i);return y?Ce(n,"local-constant",y):U(n,"non-foldable-local")}let o=j(e.db,e.file).find(y=>y.localName===t&&y.sourcePath);if(!o?.sourcePath)return H(n,t,"unresolved-identifier");if(o.kind==="namespace")return H(n,t,"namespace-import-requires-property");let l=o.importedName==="default"?t:o.importedName,u=Z(e.db,o.sourcePath,l);if(u.length!==1)return H(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let c=u[0],d=O(e.db,c.relativePath)?.rootNode;if(!d)return H(n,c.symbol,"import-definition-unparsed");let p=Me(d,c.leaf);if(!p)return H(n,c.symbol,"import-definition-non-value");let m=te({db:e.db,file:c.relativePath,root:d},p,r+1,i);return m?Ce(n,"imported-constant",m,c.symbol):H(n,c.symbol,"import-value-unresolved")}function In(e,t,n,r,i,a){let s=j(e.db,e.file).find(m=>m.localName===t&&m.sourcePath),o=e.file,l=t,u;if(s?.sourcePath){s.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=s.importedName==="default"?t:s.importedName;let m=Z(e.db,s.sourcePath,l);if(m.length!==1)return H(r,`${t}.${n.join(".")}`,m.length===0?"member-definition-missing":"member-definition-ambiguous");o=m[0].relativePath,l=m[0].leaf,u=m[0].symbol}let c=o===e.file?e.root:O(e.db,o)?.rootNode;if(!c)return H(r,u??t,"member-definition-unparsed");let d=Me(c,l);if(!d)return H(r,u??t,"member-base-non-value");for(let m of n){let y=M(d);if(d=Tn(y,m),!d)return H(r,u??`${t}.${n.join(".")}`,`member-property-missing:${m}`)}let p=te({db:e.db,file:o,root:c},d,i+1,a);return p?Ce(r,"member-constant",p,u):H(r,u??t,"member-value-unresolved")}function Pn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],a=0,s=/\$\{([^}]*)\}/gu;for(let o of r.matchAll(s)){let l=o.index??0;l>a&&i.push({kind:"literal",value:r.slice(a,l)}),i.push({kind:"unknown",reason:`template-hole:${o[1]?.trim()||"expression"}`}),a=l+o[0].length}return a<r.length&&i.push({kind:"literal",value:r.slice(a)}),{term:{kind:"pattern",language:"template",value:r.replace(s,"{}")},value:r.replace(s,"{}"),precision:"constrained-pattern"}}function wn(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:Ne("direct-literal","direct",e,t)}}function En(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...Ne("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(s=>s.derivation.inputFactIds),sourceSpans:a.flatMap(s=>s.derivation.sourceSpans)}}}function Ce(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function H(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:Ne(n,"heuristic","",e)}}function U(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:Ne(t,"heuristic","",e)}}function Ne(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function Fn(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}function Me(e,t){let n=null;return k(e,r=>{if(n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t)return;let a=r.parent;!a||a.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(a.text)||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Tn(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}var _n=new WeakMap,wt=new Set(["delete","get","head","options","patch","post","put"]),Ln=/(?:^|\.)(?:app|router|server)$/u,kn=new Set(["findFirst","findMany","findUnique","from","get","select"]),On=new Set(["create","delete","insert","remove","update","upsert"]),An=new Set(["execute","query","raw"]),xt=/(?:\b(?:name|id)|['"`](?:name|id)['"`])\s*:/u,Rt=/(?:^\s*|[,{]\s*)(?:async\s+)?['"`]?(?:execute|handler|invoke|run)['"`]?\s*(?::|\([^)]*\)\s*\{)/mu,Ct=/\b[A-Za-z_$][\w$-]*[_-][\w$-]*\s*\(/u,Nt=/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s+[A-Za-z_$][\w$-]*\s*\(/iu,Ue=[Vn(),Hn(),Dn(),Un(),jn(),zn(),Kn()],Ve=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function Dn(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=Mn(e.source),n=[];return q(e.root,"call_expression",r=>{let i=oe(r);if(!i)return;let a=t.direct.get(i),s=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),o=s&&t.namespaces.has(s[1])?s[2]:null,l=a??o;if(!l||!Ve.has(l))return;let u=Y(r),c=A(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},d=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(E(e,r,"builtin.node-child-process",d,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...c}],"exact","node-child-process-import"))}),n}}}function Mn(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let l of e.matchAll(i))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Ve.has(c[1])&&t.set(c[2]??c[1],c[1])}let a=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(a))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Ve.has(c[1])&&t.set(c[2]??c[1],c[1])}let s=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(s))n.add(l[1]);let o=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(o))n.add(l[1]);return{direct:t,namespaces:n}}function L(e,t,n,r){let i=re(r,"runtime-boundaries.context.ast",t,()=>n===void 0?O(e,t):st(e,t,n)?.tree);if(!i)return null;let a=i.rootNode;n!==void 0&&_n.set(a,i);let s=n??pe(e,t),o,l,u,c=()=>(l!==void 0||(l=re(r,"runtime-boundaries.context.callable-sites",t,()=>{let d=fe(t);return(d?dt(a,d):null)??ct(e,t)})),l);return{db:e,file:t,source:s,root:a,get constants(){return u??=re(r,"runtime-boundaries.context.constants",t,()=>Qn(a)),u},ownerAt:d=>{let m=(o??=re(r,"runtime-boundaries.context.definitions",t,()=>T(e,t,{rangeCorrectionEvidence:{source:s,callables:c()}},(f,h)=>re(r,`runtime-boundaries.context.definitions.${f}`,t,h)))).filter(f=>f.startLine<=d&&f.endLine>=d).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];if(m)return{file:t,symbol:m.symbol,name:m.leaf,startLine:m.startLine,endLine:m.endLine};let v=(c()??[]).filter(f=>f.startLine<=d&&f.endLine>=d).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];return{file:t,symbol:null,name:v?.name??null,startLine:v?.startLine??d,endLine:v?.endLine??d}}}}function re(e,t,n,r){return e?e(t,r,{file:n}):r()}function Hn(){return{id:"builtin.effect-httpapi",supports:e=>ie(e,"HttpApiEndpoint").size>0||ie(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=ie(e.source,"HttpApiEndpoint"),r=ie(e.source,"HttpApiGroup"),i=ie(e.source,"HttpApiBuilder");return q(e.root,"call_expression",a=>{let s=Et(a);if(!s)return;let o=Y(a);if(n.has(s.receiver)&&wt.has(s.member)){let v=A(o[0],e),f=A(o[1],e),h=It(a,r,"make",0,e);if(!v||!f||!h)return;let g=s.member.toUpperCase();t.push(E(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:g,evidence:"literal"},{name:"path",...f}],G([{name:"path",...f}]),"effect-httpapi-endpoint-declaration")),t.push(E(e,a,"builtin.effect-httpapi","framework.declare",He(h,v),G(He(h,v)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(s.member))return;let l=It(a,i,"group",1,e),u=A(o[0],e),c=o[1];if(!l||!u||!c)return;let d=He(l,u),p=ee(e.db,e.file,c.text),m=E(e,a,"builtin.effect-httpapi","framework.handle",d,p.length===1?G(d):"candidate","effect-httpapi-handler-registration"),y=p[0];p.length===1&&y&&(m.owner={file:y.relativePath,symbol:y.symbol,name:y.leaf,startLine:y.startLine,endLine:y.endLine}),t.push(m)}),t}}}function He(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function ie(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(r)){let s=a[2]??"";if(Bt(s))for(let o of(a[1]??"").split(",")){let l=o.trim().replace(/^type\s+/u,""),u=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(l);u?.[1]===t&&n.add(u[2]??u[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(i)){let s=a[2]??"";s.endsWith(`/${t}`)&&Bt(s)&&n.add(a[1])}return n}function Bt(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function It(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let s=Pt(a,t,n,r,i);if(s)return s;let o=a.childForFieldName("function")??a.namedChild(0),l=null;if(o&&je(o,u=>{!l&&u.type==="call_expression"&&(l=Pt(u,t,n,r,i))}),l)return l}a=a.parent}return null}function Pt(e,t,n,r,i){let a=Et(e);return!a||a.member!==n||!t.has(a.receiver)?null:A(Y(e)[r],i)}function Et(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function Vn(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||ae(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return q(e.root,["decorator","call_expression"],n=>{if(n.type==="decorator"){let p=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!p||!ae(e.source,["fastapi","flask"]))return;t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:p[1].toUpperCase(),evidence:"literal"},{name:"path",value:p[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=oe(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",a=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",s=Y(n);if(i==="route"&&ae(e.source,["axum"])){let p=A(s[0],e),m=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(s[1]?.text??"")?.[1];if(!p||!m)return;t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:m.toUpperCase(),evidence:"literal"},{name:"path",...p}],G([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=A(s[0],e);if(!p)return;let y=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(s[1]?.text??"")?.[1]?.toUpperCase()??(s[1]?null:"GET"),v=[...y?[{name:"method",value:y,evidence:"literal"}]:[],{name:"path",...p}];t.push(E(e,n,"builtin.http","http.request",v,y?G(v):"candidate","call-expression"));return}if(!wt.has(i))return;let o=A(s[0],e);if(!o)return;let l=i.toUpperCase();if(Ln.test(a)&&ae(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],G([{name:"path",...o}]),"framework-adapter"));return}let c=Wn(e.source,["axios"]),d=a.split(".")[0]??"";c.has(d)&&t.push(E(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],G([{name:"path",...o}]),"client-adapter"))}),t}}}function Un(){return{id:"builtin.capability-registry",supports:e=>xt.test(e)&&Rt.test(e)||Ct.test(e)||Nt.test(e),extract:e=>{let t=[],n=new Set,r=[];return xt.test(e.source)&&Rt.test(e.source)&&r.push("pair"),(Ct.test(e.source)||Nt.test(e.source))&&r.push("string","string_literal","template_string"),q(e.root,r,i=>{if(i.type==="pair"){let s=i.childForFieldName("key")??i.namedChild(0),o=i.childForFieldName("value")??i.namedChild(1),l=s?.text.replace(/^['"`]|['"`]$/gu,"");if(l!=="name"&&l!=="id")return;let u=Ft(o,e),c=tr(i);if(!u||u.evidence!=="literal"||!c)return;let d=`handle\0${u.value}\0${c.startPosition.row}`;if(n.has(d))return;n.add(d),t.push(E(e,c,"builtin.capability-registry","registry.handle",[{name:"key",...u}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(i.type))return;let a=i.text.replace(/^['"`]|['"`]$/gu,"");for(let s of a.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let o=s[1];if(!Gn(a,o,s.index))continue;let l=`reference\0${o}\0${i.startPosition.row}`;n.has(l)||(n.add(l),t.push(E(e,i,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function Gn(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function jn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return q(e.root,["pair","call_expression"],n=>{if(n.type==="pair"){let a=er(n);if(!a)return;let s=n.childForFieldName("key")??n.namedChild(0),o=n.childForFieldName("value")??n.namedChild(1),l=Ft(s,e);if(!l||!o||!Tt(o))return;let u=Ge(o)?"exact":"candidate";t.push(E(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],G([{name:"key",...l}],u),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(E(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function zn(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=rr(e.root);return q(e.root,"call_expression",r=>{let i=oe(r);if(!i)return;let a=i.split("."),s=a.at(-1)??"",o=Y(r),l=o[0]?.text??"",u=nr(s,l);if(!u)return;let c=$t(a,n);if(!c)return;let d=qn(o[0],e)??ir(l),p=ar(c,a,s,d);if(!p)return;let m=s==="insert"?"persistence-insert":u==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(l)?"persistence-skip-locked-claim":"persistence-adapter";t.push(E(e,r,"builtin.persistence",u,[{name:"resource",...p}],G([{name:"resource",...p}]),m))}),t}}}function qn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:A(e,t)}function Kn(){return{id:"builtin.queue",supports:e=>ae(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return q(e.root,"call_expression",n=>{let r=oe(n);if(!r)return;let i=r.split(".").at(-1)??"",a=Y(n),s=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!s)return;let o=i==="send"||i==="subscribe"?Yn(a[0],"topic",e):A(a[0],e);o&&t.push(E(e,n,"builtin.queue",s,[{name:"address",...o}],G([{name:"address",...o}]),"framework-adapter"))}),t}}}function E(e,t,n,r,i,a,s){let o=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${$n("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:o,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:s,strength:a,protocol:r.split(".")[0]??r,role:Xn(r),executionDomain:Zn(e.file),derivation:{kind:a==="candidate"?"heuristic":a==="derived"?"mechanically-derived":"direct",rule:s,ruleVersion:"1",inputFactIds:i.flatMap(u=>u.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(u=>u.derivation?.sourceSpans??[])]},valuePrecision:i.some(u=>u.evidence==="expression")?"unknown":i.some(u=>u.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:ge(e.file)}}function Xn(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function Zn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function ae(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function Wn(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),a=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let s of e.matchAll(a)){let o=s[1]??s[2];o&&n.add(o)}}return n}function Be(e,t,n,r,i,a,s){return E(e,t,n,r,i,a,s)}function oe(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function Y(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function A(e,t){let n=V(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function Yn(e,t,n){if(!e)return null;let r=e.namedChildren.find(a=>a.type!=="pair"?!1:(a.childForFieldName("key")??a.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return A(i,n)}function Ft(e,t){if(!e)return null;let n=A(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function G(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function Jn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function Qn(e){let t=new Map;return je(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let a=Jn(i);a!==null&&t.set(r.text,a)}),t}function er(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function Ge(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function Tt(e){return Ge(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function tr(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),s=i?.text.replace(/^['"`]|['"`]$/gu,"");if(s&&["execute","handler","invoke","run"].includes(s)&&a&&Tt(a))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function $t(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function nr(e,t){if(kn.has(e))return"database.read";if(On.has(e))return"database.write";if(!An.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function rr(e){let t=new Set;return q(e,"call_expression",n=>{let r=oe(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!$t(i)))for(let a of Y(n)){if(!Ge(a))continue;let o=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=o?ot(o):null;l&&t.add(l)}}),t}function ir(e){let t=_t(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function ar(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let a=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return a?{value:a,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=_t(r.value);return i?{value:i,evidence:r.evidence}:null}function _t(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function je(e,t){t(e);for(let n of e.namedChildren)je(n,t)}function q(e,t,n){for(let r of e.descendantsOfType(t))n(r)}var or=Q("resolved-call-syntax",{clearGroups:[]}),ze=Q("resolved-call-sites",{clearGroups:[]}),sr=Q("resolved-call-sites-reference-evidence",{clearGroups:[]});function qe(e,t){return ze.get(e,t.symbolId,()=>kt(e,t,lr(e,t)))}function Lt(e,t){let n=[...new Map(t.map(a=>[a.symbolId,a])).values()],r=n.filter(a=>!ze.has(e,a.symbolId)),i=Ot(e,r);return new Map(n.map(a=>[a.symbolId,ze.get(e,a.symbolId,()=>kt(e,a,i.get(a.symbolId)??[]))]))}function kt(e,t,n){let r=[],i=[],a=new Set,s=new Set;for(let o of n){a.add(o.file);let l=or.get(e,o.file,()=>cr(e,o.file));if(!l){i.push({callee:t,file:o.file,line:o.startLine,reason:"ast-unavailable",candidates:0,referenceProvenance:o.provenance});continue}let u=(l.byLeaf.get(t.leaf)??[]).filter(({callNode:p})=>p.startPosition.row<=o.endLine&&p.endPosition.row>=o.startLine);if(u.length!==1){i.push({callee:t,file:o.file,line:o.startLine,reason:u.length===0?"call-not-found":"ambiguous-call",candidates:u.length,referenceProvenance:o.provenance});continue}let c=u[0],d=`${o.file}\0${c.callNode.startIndex}\0${c.callNode.endIndex}`;s.has(d)||(s.add(d),r.push({callee:t,caller:he(T(e,o.file),c.callNode.startPosition.row),file:o.file,line:c.callNode.startPosition.row,startLine:c.callNode.startPosition.row,endLine:c.callNode.endPosition.row,targetText:c.targetNode.text,callNode:c.callNode,targetNode:c.targetNode,arguments:c.arguments,referenceProvenance:o.provenance}))}return{sites:r,unresolved:i,filesVisited:a.size}}function lr(e,t){return Ot(e,[t]).get(t.symbolId)??[]}function Ot(e,t){if(!ur(e))return new Map(t.map(r=>[r.symbolId,yt(e,r,{semantic:!1}).map(i=>({file:i.file,startLine:i.line,endLine:i.line,provenance:i.provenance}))]));let n=new Map;for(let r of ft(e,t.map(i=>i.symbolId))){let i=n.get(r.symbol_id)??[];i.push({file:r.relative_path,startLine:r.chunk_start,endLine:r.chunk_end,provenance:"scip-reference-chunk"}),n.set(r.symbol_id,i)}return new Map(t.map(r=>[r.symbolId,n.get(r.symbolId)??[]]))}function ur(e){return sr.get(e,"project",()=>!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))}function cr(e,t){let n=O(e,t)?.rootNode;if(!n)return null;let r=new Map;return At(n,i=>{if(i.type!=="call_expression"&&i.type!=="call")return;let a=i.childForFieldName("function")??i.namedChild(0);if(!a)return;let s=lt(a);if(!s)return;let o=i.childForFieldName("arguments")??i.namedChildren.find(c=>c.type==="arguments"),l={callNode:i,targetNode:a,arguments:o?.namedChildren??[]},u=r.get(s);u?u.push(l):r.set(s,[l])}),{byLeaf:r}}function At(e,t){t(e);for(let n of e.namedChildren)At(n,t)}var dr=Q("call-parameter-value-flow",{clearGroups:[]});function se(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return dr.get(e,n,()=>pr(e,t))}function le(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function pr(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-unavailable",proof:n}))};let r=O(e,t.caller.relativePath)?.rootNode,i=r?D(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let a=X(i),s=[],o=[];return t.arguments.forEach((l,u)=>{let c=l.text.trim(),d=a.indexOf(c);d>=0?s.push({calleePosition:u,callerPosition:d,argumentText:c,proof:n}):o.push({calleePosition:u,argumentText:c,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:s,unknown:o}}var mr=8,fr=8;function Mt(e,t,n=[]){let r=[],i=yr(e,n,r),a=i.summaries,s=hr(e,t,a,r),o=gr(e,t,r);return{observations:Pr([...s.observations,...o]),bodySummaries:a.size,discriminatorSummaries:s.summaries,filesInspected:i.filesInspected,errors:r}}function yr(e,t,n){let r=new Map,i=[],a=new Map,s=o=>{if(a.has(o))return a.get(o)??null;let l=L(e,o);return a.set(o,l),l};for(let o of t){let l={...o,depth:0,proofSpans:[{file:o.definition.relativePath,startLine:o.definition.startLine,endLine:o.definition.endLine}]};r.set(o.definition.symbol,l),i.push(l)}for(;i.length>0;){let o=i.shift();if(!(o.depth>=mr))try{for(let l of qe(e,o.definition).sites){if(!s(l.file))continue;let c=l.caller;if(!c)continue;let d=le(se(e,l),o.parameterIndexes);if(d.length===0)continue;let p={definition:c,parameterIndexes:zt(d),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]};xr(r,p)&&i.push(r.get(c.symbol))}}catch(l){n.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${Ze(l)}`)}}return{summaries:r,filesInspected:new Set(t.map(o=>o.definition.relativePath)).size}}function hr(e,t,n,r){let i=new Map,a=[],s=[];for(let o of t){if(o.action!=="http.request"||o.strength==="candidate"||o.sourceScope!=="production")continue;let l=Vt(o);if(!l)continue;let u=L(e,o.source.file);if(!u)continue;let c=Ut(u.root,o.source.startLine),d=c.find(g=>g.startPosition.row===o.source.startLine)??c[0];if(!d)continue;let p=Xe(d);if(!p)continue;let m=ee(e,o.source.file,p.text);if(m.length!==1)continue;let y=n.get(m[0].symbol);if(!y)continue;let v=o.owner.symbol?T(e,o.owner.file).find(g=>g.symbol===o.owner.symbol):null;if(!v)continue;let f=Rr(u,v),h=Ie(d);for(let g of y.parameterIndexes){let R=Nr(u,h[g]);if(R)for(let x of Br(R)){let b=Gt(x),C=jt(x);if(!b||!C)continue;let P=f.indexOf(C.text.trim());if(P>=0){let F={definition:v,carrier:l,field:b,parameterIndex:P,depth:0,proofObservationIds:[o.id],proofSpans:[o.source,{file:o.source.file,startLine:x.startPosition.row,endLine:x.endPosition.row}]},$=Dt(F);i.has($)||(i.set($,F),a.push(F));continue}let w=V(u,C);!w||w.evidence==="expression"||s.push(Ke(u,x,"carrier.publish",l,b,w.value,[o.id]))}}}for(;a.length>0;){let o=a.shift();if(!(o.depth>=fr))try{for(let l of qe(e,o.definition).sites){let u=L(e,l.file);if(!u)continue;let c=l.callNode,d=Ie(c)[o.parameterIndex];if(!d)continue;let p=V(u,d);p&&p.evidence!=="expression"&&s.push(Ke(u,c,"carrier.publish",o.carrier,o.field,p.value,o.proofObservationIds));let m=l.caller;if(!m)continue;let y=se(e,l).transfers.find(h=>h.calleePosition===o.parameterIndex)?.callerPosition;if(y===void 0)continue;let v={...o,definition:m,parameterIndex:y,depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},f=Dt(v);i.has(f)||(i.set(f,v),a.push(v))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${o.definition.relativePath}: ${Ze(l)}`)}}return{observations:s,summaries:i.size}}function gr(e,t,n){let r=[],i=t.filter(a=>a.action==="registry.handle"&&a.strength!=="candidate"&&a.sourceScope==="production");for(let a of t){if(a.action!=="http.handle"||a.strength==="candidate"||a.sourceScope!=="production")continue;let s=Vt(a);if(!s)continue;let o=L(e,a.source.file);if(!o)continue;let l=Ut(o.root,a.source.startLine)[0];if(l)for(let u of Ie(l).slice(1)){let c=ee(e,a.source.file,u.text);for(let d of c)try{let p=L(e,d.relativePath);if(!p)continue;let m=D(p.root,d.startLine,d.endLine);if(!m)continue;k(m,y=>{if(y.type!=="call_expression")return;let v=Xe(y);if(!v)return;let f=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(v.text.trim());if(!f)return;let h=f[1],g=f[2],R=br(e,p,d,g);if(!R)return;let x=Sr(e,d.relativePath,h);for(let b of i){let C=b.keyParts.find($=>$.name==="registry")?.value,P=b.keyParts.find($=>$.name==="key")?.value;if(!C||!P||!x.some($=>$.file===b.source.file&&$.binding===C))continue;let w=L(e,b.source.file),F=w?Cr(w.root,b.source.startLine):null;!w||!F||r.push(Ke(w,F,"carrier.consume",s,R,P,[a.id,b.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${d.relativePath}: ${Ze(p)}`)}}}return r}function Ht(e){let t=T(e.db,e.file),n=new Map;return k(e.root,r=>{if(r.type!=="pair"||Gt(r)?.toLowerCase()!=="body")return;let i=jt(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=he(t,r.startPosition.row),s=vr(r);if(!a||!s)return;let o=X(s),l=new Set;Ir(i,o,l);let u=n.get(a.symbol)??new Set;o.forEach((c,d)=>{c&&l.has(c)&&u.add(d)}),u.size>0&&n.set(a.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[{definition:r,parameterIndexes:[...i].sort((a,s)=>a-s)}]:[]})}function vr(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function br(e,t,n,r){let i=D(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${me(r)}\\b`,"u");if(a.test(i.text))return r;let s=null;if(k(i,c=>{if(s||c.type!=="variable_declarator")return;let d=c.childForFieldName("name")??c.namedChild(0),p=c.childForFieldName("value")??c.namedChild(1);!d||!p||!new RegExp(`(?:^|[,{}])\\s*${me(r)}\\s*(?:[,}]|$)`,"u").test(d.text)||p.type==="call_expression"&&(s=Xe(p)?.text??null)}),!s)return null;let o=ee(e,n.relativePath,s);if(o.length!==1)return null;let l=L(e,o[0].relativePath),u=l?D(l.root,o[0].startLine,o[0].endLine):null;return u&&a.test(u.text)&&new RegExp(`\\b${me(r)}\\s*[,}]`,"u").test(u.text)?r:null}function Sr(e,t,n){let r=[];for(let i of Ae(e,t,n)){let a=M(i.initializer);if(a.type==="call_expression")for(let s of Ie(a)){let o=s.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))for(let l of Ae(e,i.definition.relativePath,o))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Ke(e,t,n,r,i,a,s){let l=Be(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:a,evidence:"constant",term:{kind:"literal",value:a}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...s],sourceSpans:[l.source]},l}function Vt(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function xr(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=zt([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function Dt(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function Rr(e,t){let n=D(e.root,t.startLine,t.endLine);return n?X(n):[]}function Cr(e,t){let n=null;return k(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function Ut(e,t){let n=[];return k(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function Xe(e){return e.childForFieldName("function")??e.namedChild(0)}function Ie(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Nr(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return M(t);let r=null;return k(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),r?M(r):M(t)}function Br(e){let t=M(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function Gt(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function jt(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function Ir(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function zt(e){return[...new Set(e)].sort((t,n)=>t-n)}function Pr(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Ze(e){return e instanceof Error?e.message:String(e)}import{createHash as wr}from"crypto";function qt(e,t){let n=new Map;for(let a of t){if(a.action!=="http.handle"||a.sourceScope!=="production")continue;let s=n.get(a.source.file)??[];s.push(a),n.set(a.source.file,s)}let r=[],i=Er(e);for(let a of i.mounts)for(let s of a.targetFiles)for(let o of n.get(s)??[]){let l=o.keyParts.find(p=>p.name==="path");if(!l||l.evidence==="expression")continue;let u=Tr(a.prefix.value,l.value),c=o.keyParts.map(p=>p.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[a.prefix.term??{kind:"literal",value:a.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line},...a.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:p),d=`${o.id}\0${a.file}\0${a.line}\0${u}`;r.push({...o,id:`boundary:${wr("sha256").update(d).digest("hex").slice(0,16)}`,keyParts:c,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line}]},resolution:"unresolved"}),o.strength="candidate",o.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function Er(e){let t=[],n=ye(e);for(let r of n){let i=pe(e,r);if(!$r(i))continue;let a=L(e,r);a&&Kt(a.root,s=>{if(s.type!=="call_expression")return;let o=s.childForFieldName("function")??s.namedChild(0);if(!o||!o.text.replace(/\s+/gu,"").endsWith(".use"))return;let l=_r(s);if(l.length<2)return;let u=V(a,l[0]);if(!u||u.evidence==="expression")return;let c=Fr(e,r,l[1]);c.length!==0&&t.push({file:r,line:s.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:c})})}return{mounts:t,filesInspected:n.length}}function Fr(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let a=j(e,t).find(l=>l.localName===i&&l.sourcePath);if(!a?.sourcePath)return[t];if(a.kind==="namespace")return[a.sourcePath];let s=a.importedName==="default"?i:a.importedName,o=Z(e,a.sourcePath,s);return[...new Set(o.map(l=>l.relativePath))]}function Tr(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function $r(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function _r(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Kt(e,t){t(e);for(let n of e.namedChildren)Kt(n,t)}import{createHash as Lr}from"crypto";function Pe(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}var Ee=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),kr=8,Xt=nt({kind:"runtime-boundary-http-roles",invalidation:rt("runtime-boundary-http-roles"),serialize:Mr,deserialize:Hr});function Yt(e,t,n){let r=n??((f,h)=>h()),i=new Map,a=[],s=[],o=new Set,l=[],u=[],c=new Map,d=new Map,p=new Map,m=f=>{if(c.has(f))return c.get(f)??null;let h=L(e,f);return c.set(f,h),h},y=f=>{let h=d.get(f);if(h)return h;let g=T(e,f);return d.set(f,g),g},v=(f,h)=>{let g=p.get(f.file);if(!g){let b=tt(e,f.file,f.source),C=Xt.read(e,f.file,b)??[];g={contentHash:b,roles:new Map(C.map(P=>[P.symbol,P])),dirty:!1},p.set(f.file,g)}let R=g.roles.get(h.symbol);if(R)return R;let x=Dr(f,h);return g.roles.set(h.symbol,{symbol:h.symbol,...x}),g.dirty=!0,x};for(r("runtime-boundaries.http-summary.seed",()=>{for(let f of t){if(f.action!=="http.request"||!f.owner.symbol||f.evidence!=="call-expression"&&f.evidence!=="client-adapter")continue;let h=y(f.owner.file).find(b=>b.symbol===f.owner.symbol);if(!h)continue;let g=m(h.relativePath);if(!g)continue;let R=v(g,h),x={definition:h,...R,constantMethods:f.keyParts.flatMap(b=>b.name==="method"&&b.evidence!=="expression"&&Ee.has(b.value.toUpperCase())?[b.value.toUpperCase()]:[]),depth:0,proofObservationIds:[f.id],proofSpans:[f.source]};Wt(i,x)&&a.push(i.get(h.symbol))}});a.length>0;){let f=a.splice(0,a.length),h=r("runtime-boundaries.http-summary.resolve-call-sites",()=>Lt(e,f.map(g=>g.definition)),{batchSize:f.length});r("runtime-boundaries.http-summary.process-call-sites",()=>{for(let g of f)if(!(g.depth>=kr))try{let R=h.get(g.definition.symbolId);if(!R)continue;u.push(...R.unresolved.map(x=>Or(g,x)));for(let x of R.sites){let b=m(x.file);if(!b)continue;o.add(x.file);let C=x.callNode,P=Ar(g,C,b);P&&s.push(P);let w=x.caller;if(!w)continue;let F=v(b,w),$=Vr(e,g,x),_={definition:w,pathParameterIndexes:we([...F.pathParameterIndexes,...$.pathParameterIndexes]),methodParameterIndexes:we([...F.methodParameterIndexes,...$.methodParameterIndexes]),constantMethods:ne([...g.constantMethods,...F.constantMethods]),depth:g.depth+1,proofObservationIds:ne([...g.proofObservationIds,...P?[P.id]:[]]),proofSpans:[...g.proofSpans,{file:x.file,startLine:x.startLine,endLine:x.endLine}]};Wt(i,_)&&a.push(i.get(w.symbol))}}catch(R){l.push(`builtin.http-summary failed for ${g.definition.relativePath}:${g.definition.startLine+1}: ${R instanceof Error?R.message:String(R)}`)}},{batchSize:f.length})}return Xt.writeBatch(e,[...p.entries()].flatMap(([f,h])=>h.dirty?[{relativePath:f,contentHash:h.contentHash,value:[...h.roles.values()].sort((g,R)=>g.symbol.localeCompare(R.symbol))}]:[])),{observations:s,frontiers:Pe(u),summaries:i.size,filesInspected:o.size,errors:l}}function Or(e,t){let n=ne([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${Lr("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:ge(t.file)}}function Ar(e,t,n){let r=Jt(t),i=e.pathParameterIndexes.flatMap(d=>{let p=V(n,r[d]);return p&&p.evidence!=="expression"&&Gr(p.value)?[{index:d,value:p}]:[]}),a=e.methodParameterIndexes.flatMap(d=>{let p=V(n,r[d]),m=p?.value.toUpperCase();return p&&m&&p.evidence!=="expression"&&Ee.has(m)?[{index:d,value:{...p,value:m}}]:[]}),s=ne([...e.constantMethods,...a.map(d=>d.value.value)]);if(i.length!==1||s.length!==1)return null;let o=i[0].value,l=a.find(d=>d.value.value===s[0])?.value,u=[{name:"method",value:s[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:s[0]},derivation:l?.derivation},{name:"path",value:o.value,evidence:"constant",term:o.term,derivation:o.derivation}],c=Be(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return c.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,c.source]},c}function Dr(e,t){let n=D(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=X(n),i=new Set,a=new Set,s=new Set;return k(n,o=>{if(o.type==="call_expression"&&((o.childForFieldName("function")??o.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let m=Jt(o);ue(m[0],r,i);let y=Ur(m[1],"method");if(y){ue(y,r,a);let v=V(e,y),f=v?.value.toUpperCase();f&&v?.evidence!=="expression"&&Ee.has(f)&&s.add(f)}else ue(m[1],r,a)}if(o.type!=="pair")return;let l=o.childForFieldName("key")??o.namedChild(0),u=o.childForFieldName("value")??o.namedChild(1),c=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(c==="url"||c==="path"||c==="endpoint")&&ue(u,r,i),(c==="init"||c==="requestinit"||c==="options")&&ue(u,r,a)}),{pathParameterIndexes:r.flatMap((o,l)=>o&&i.has(o)?[l]:[]),methodParameterIndexes:r.flatMap((o,l)=>o&&a.has(o)?[l]:[]),constantMethods:[...s].sort()}}function Mr(e){return e.map(t=>[encodeURIComponent(t.symbol),t.pathParameterIndexes.join(","),t.methodParameterIndexes.join(","),t.constantMethods.join(",")].join(" ")).join(`
49
- `)}function Hr(e){if(!e)return[];let t=[];for(let n of e.split(`
50
- `)){let r=n.split(" ");if(r.length!==4)return null;let i=Zt(r[1]),a=Zt(r[2]),s=r[3]?r[3].split(","):[];if(i===null||a===null||s.some(o=>!Ee.has(o)))return null;t.push({symbol:decodeURIComponent(r[0]),pathParameterIndexes:i,methodParameterIndexes:a,constantMethods:s})}return t}function Zt(e){if(!e)return[];let t=e.split(",").map(Number);return t.every(n=>Number.isSafeInteger(n)&&n>=0)?t:null}function Vr(e,t,n){let r=se(e,n);return{pathParameterIndexes:le(r,t.pathParameterIndexes),methodParameterIndexes:le(r,t.methodParameterIndexes)}}function Wt(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=we([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=we([...n.methodParameterIndexes,...t.methodParameterIndexes]),a=ne([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||a.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:a,depth:Math.min(n.depth,t.depth),proofObservationIds:ne([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function Ur(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function ue(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function Jt(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Gr(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function we(e){return[...new Set(e)].sort((t,n)=>t-n)}function ne(e){return[...new Set(e)].sort()}import{createHash as jr}from"crypto";function tn(e){let t=Qt(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=Qt(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?We(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[en(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?We(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[en(r,a,i,"queue.consume")]:[]}):[])}function Qt(e){let t=new Map;for(let n of e)for(let r of We(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function We(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function en(e,t,n,r){let i=`database:${n}`,a=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",s=[e.id,r,i,a].join("\0");return{...e,id:`boundary:${jr("sha256").update(s).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:a,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var Ye="runtime-boundaries-v19",qr=zr(import.meta.url),B=qr("typescript"),Kr=new Set([B.SyntaxKind.WhitespaceTrivia,B.SyntaxKind.NewLineTrivia,B.SyntaxKind.SingleLineCommentTrivia,B.SyntaxKind.MultiLineCommentTrivia]),Xr=new Set([B.SyntaxKind.NoSubstitutionTemplateLiteral,B.SyntaxKind.TemplateHead,B.SyntaxKind.TemplateMiddle,B.SyntaxKind.TemplateTail]),$e=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],Zr=64,on="builtin.http-summary",_e={HTTP_HANDLE:"http.handle",HTTP_REQUEST:"http.request",REGISTRY_HANDLE:"registry.handle"},Je=new Set(Object.values(_e));function Wr(e,t={}){let n=ye(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(hi)),a=t.previousGraph?.fileCoverage,s=i.size>0&&t.previousGraph?.extractorVersion===Ye&&a!==void 0&&a.length===t.previousGraph.coverage.filesScanned,o=s?a.filter(S=>r.has(S.file)&&!i.has(S.file)):[],l=new Set(o.flatMap(S=>S.observationIds)),u=s?t.previousGraph.observations.filter(S=>l.has(S.id)&&r.has(S.source.file)):[],c=s?n.filter(S=>i.has(S)):n,d=[],p=a?.reduce((S,N)=>S+N.observationIds.length,0)??0,m=performance.now(),y=ci(e,c,t.profileSpan);z(d,"direct-extraction",m,c.length,y.observations.length,{filesVisited:c.length,filesReused:o.length,factsReused:u.length,factsInvalidated:Math.max(0,p-u.length)});let v=[...o,...y.fileCoverage].sort((S,N)=>S.file.localeCompare(N.file)),f=yi(v),h=v.flatMap(S=>S.extractionErrors),g=ce([...u,...y.observations]);if(s&&!t.forceDerivedRebuild&&t.previousGraph&&Yr(a,y.fileCoverage,i)&&(!ri(e,t.previousGraph,i)||oi(a,y.fileCoverage,i)&&!si(t.previousGraph,i))){for(let N of t.previousGraph.coverage.extractors)f.has(N.id)||f.set(N.id,N);let S=ui(t.previousGraph.coverage.phases);return d.push(...S),{...t.previousGraph,observations:t.previousGraph.observations,relationGroups:t.previousGraph.relationGroups,links:t.previousGraph.links,frontiers:t.previousGraph.frontiers,coverage:{filesScanned:n.length,filesWithAst:v.filter(N=>N.hasAst).length,filesWithoutAst:v.filter(N=>!N.hasAst).length,filesReused:o.length,extractors:[...f.values()],extractionErrors:t.previousGraph.coverage.extractionErrors,phases:d},fileCoverage:v}}let R=ce([...g,...tn(g)]),x=s&&t.previousGraph!==void 0?Jr(t.previousGraph,a,y.fileCoverage,i,g):{reuse:!1,shapeUnchanged:!1,proofFilesUnchanged:!1,seedUnchanged:!1},b=x.reuse;t.profileSpan?.("runtime-boundaries.http-summary.reuse-decision",()=>{},x),m=performance.now();let C;if(b){let S=t.previousGraph.coverage.phases?.find(I=>I.id==="http-summary"),N=t.previousGraph.coverage.extractors.find(I=>I.id==="builtin.wrapper");C={observations:t.previousGraph.observations.filter(I=>I.extractor===on),frontiers:t.previousGraph.frontiers.filter(I=>I.kind==="call-resolution"&&I.action===_e.HTTP_REQUEST),summaries:0,filesInspected:S?.filesVisited??N?.applicableFiles??0,errors:t.previousGraph.coverage.extractionErrors.filter(I=>I.startsWith("builtin.http-summary failed"))},z(d,"http-summary",m,R.length,C.observations.length,{filesVisited:0,filesReused:C.filesInspected,factsReused:C.observations.length+C.frontiers.length,factsInvalidated:0}),N&&f.set(N.id,N)}else C=Yt(e,R,t.profileSpan),z(d,"http-summary",m,R.length,C.observations.length,{filesVisited:C.filesInspected}),f.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:C.filesInspected,observations:C.observations.length,errors:C.errors.length});h.push(...C.errors);let P=ce([...R,...C.observations]);m=performance.now();let w=qt(e,P);z(d,"http-mount",m,P.length,w.observations.length,{filesVisited:w.filesInspected});let F=ce([...P,...w.observations]);m=performance.now();let $=b&&t.previousGraph!==void 0&&Qr(t.previousGraph,a,y.fileCoverage,i),_;if($){let S=t.previousGraph.coverage.phases?.find(I=>I.id==="carrier"),N=t.previousGraph.coverage.extractors.find(I=>I.id==="builtin.carrier");_={observations:t.previousGraph.observations.filter(I=>I.extractor==="builtin.carrier"),bodySummaries:N?.applicableFiles??0,discriminatorSummaries:0,filesInspected:S?.filesVisited??0,errors:t.previousGraph.coverage.extractionErrors.filter(I=>I.startsWith("builtin.carrier"))},z(d,"carrier",m,F.length,_.observations.length,{filesVisited:0,filesReused:_.filesInspected,factsReused:_.observations.length,factsInvalidated:0}),N&&f.set(N.id,N)}else _=Mt(e,F,v.flatMap(S=>S.bodySummaries??[])),z(d,"carrier",m,F.length,_.observations.length,{filesVisited:_.filesInspected}),f.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:_.bodySummaries,observations:_.observations.length,errors:_.errors.length});h.push(..._.errors);let K=ce([...F,..._.observations]);m=performance.now();let J=gi(K);z(d,"relations",m,K.length,J.length),m=performance.now();let Qe=bi(K,J);z(d,"links",m,J.length,Qe.length),Si(K,J),m=performance.now();let et=Pe([...xi(K,J),...C.frontiers]);return z(d,"frontiers",m,K.length,et.length),{schemaVersion:2,extractorVersion:Ye,observations:K,relationGroups:J,links:Qe,frontiers:et,coverage:{filesScanned:n.length,filesWithAst:v.filter(S=>S.hasAst).length,filesWithoutAst:v.filter(S=>!S.hasAst).length,...s?{filesReused:o.length}:{},extractors:[...f.values()],extractionErrors:h,phases:d},fileCoverage:v}}function Yr(e,t,n){if(!e)return!1;let r=e.filter(a=>n.has(a.file)).filter(nn).map(rn).sort((a,s)=>a.file.localeCompare(s.file)),i=t.filter(nn).map(rn).sort((a,s)=>a.file.localeCompare(s.file));return JSON.stringify(r)===JSON.stringify(i)}function nn(e){return e.observationIds.length>0||e.extractionErrors.length>0}function rn(e){let{syntaxHash:t,shapeHash:n,bodySummaries:r,...i}=e;return i}function Jr(e,t,n,r,i){let a=ti(t,n,r),s=ni(e),l=![...sn(t,n)].some(p=>s.has(p)),u=new Set((t??[]).filter(p=>r.has(p.file)).flatMap(p=>p.observationIds)),c=new Set(n.flatMap(p=>p.observationIds)),d=an(e.observations,u)===an(i,c);return{reuse:a&&l&&d,shapeUnchanged:a,proofFilesUnchanged:l,seedUnchanged:d}}function sn(e,t){let n=new Map(e?.map(r=>[r.file,r.syntaxHash])??[]);return new Set(t.filter(r=>r.syntaxHash===void 0||n.get(r.file)!==r.syntaxHash).map(r=>r.file))}function Qr(e,t,n,r){if(!t)return!1;let i=t.filter(l=>r.has(l.file)).map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file)),a=n.map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file));if(JSON.stringify(i)!==JSON.stringify(a))return!1;let s=sn(t,n),o=ei(e,"builtin.carrier");return![...s].some(l=>o.has(l))}function ei(e,t){let n=new Set;for(let r of e.observations)if(r.extractor===t){n.add(r.source.file);for(let i of r.derivation.sourceSpans)n.add(i.file)}return n}function ti(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.shapeHash]));return t.length===n.size&&t.every(i=>i.shapeHash!==void 0&&r.get(i.file)===i.shapeHash)}function ni(e){let t=new Set;for(let n of e.observations)if(n.extractor===on){t.add(n.source.file);for(let r of n.derivation.sourceSpans)t.add(r.file)}for(let n of e.frontiers)n.kind==="call-resolution"&&n.action===_e.HTTP_REQUEST&&n.source&&t.add(n.source.file);return t}function an(e,t){return JSON.stringify(e.filter(n=>t.has(n.id)&&n.action===_e.HTTP_REQUEST&&n.owner.symbol!==null&&(n.evidence==="call-expression"||n.evidence==="client-adapter")).map(n=>({ownerSymbol:n.owner.symbol,evidence:n.evidence,methods:n.keyParts.filter(r=>r.name==="method"&&r.evidence!=="expression").map(r=>r.value.toUpperCase()).sort()})).sort((n,r)=>`${n.ownerSymbol}\0${n.evidence}\0${n.methods.join(",")}`.localeCompare(`${r.ownerSymbol}\0${r.evidence}\0${r.methods.join(",")}`)))}function ri(e,t,n){let r=ii(t),i=ai(t);if([...n].some(o=>r.has(o)))return!0;if(i.size===0||n.size===0)return!1;if(!!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))return!0;let s=[...n];for(let o=0;o<s.length;o+=750){let l=s.slice(o,o+750),u=l.map(()=>"?").join(",");if(e.all(`SELECT DISTINCT global_symbol.symbol
51
- FROM mentions mention
52
- JOIN chunks reference_chunk ON reference_chunk.id = mention.chunk_id
53
- JOIN documents reference_document ON reference_document.id = reference_chunk.document_id
54
- JOIN global_symbols global_symbol ON global_symbol.id = mention.symbol_id
55
- WHERE mention.role != 1
56
- AND reference_document.relative_path IN (${u})`,...l).some(d=>i.has(d.symbol)))return!0}return!1}function ii(e){let t=new Set;for(let n of e.observations)if(Je.has(n.action)){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)!n.action||!Je.has(n.action)||!n.source||t.add(n.source.file);return t}function ai(e){return new Set(e.observations.flatMap(t=>Je.has(t.action)&&t.owner.symbol?[t.owner.symbol]:[]))}function oi(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.syntaxHash]));return t.length===n.size&&t.every(i=>i.syntaxHash!==void 0&&r.get(i.file)===i.syntaxHash)}function si(e,t){let n=li(e);return[...t].some(r=>n.has(r))}function li(e){let t=new Set;for(let n of e.observations){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)n.source&&t.add(n.source.file);return t}function ui(e){return(e??[]).filter(t=>t.id!=="direct-extraction").map(t=>({...t,durationMs:0,filesVisited:0,filesReused:t.filesVisited??0,factsReused:t.outputFacts,factsInvalidated:0}))}function z(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}function ci(e,t,n){let r=[],i=[];for(let a of t){let s=it(e,a),o=Ue.filter(p=>p.supports(s)),l=/\bJSON\.stringify\s*\(/u.test(s)&&/\bbody\s*:/u.test(s),u=o.length>0||l?L(e,a,s,n):null,c=di(a,s),d={file:a,hasAst:u!==null||fi(a,s),syntaxHash:c.syntaxHash,shapeHash:c.shapeHash,bodySummaries:u&&l?Ht(u):[],observationIds:[],extractors:[],extractionErrors:[]};if(u)for(let p of o){let m={id:p.id,applicableFiles:1,observations:0,errors:0};try{let y=mi(n,`runtime-boundaries.extractor.${p.id}`,a,()=>p.extract(u));m.observations=y.length,r.push(...y),d.observationIds.push(...y.map(v=>v.id))}catch(y){m.errors=1,d.extractionErrors.push(`${p.id} failed for ${a}: ${y instanceof Error?y.message:String(y)}`)}d.extractors.push(m)}i.push(d)}return{observations:r,fileCoverage:i}}function di(e,t){if(!/\.(?:[cm]?[jt]sx?)$/iu.test(e)){let u=de("sha256").update(t).digest("hex");return{syntaxHash:u,shapeHash:u}}let n=/\.[jt]sx$/iu.test(e)?B.LanguageVariant.JSX:B.LanguageVariant.Standard,r=B.createScanner(B.ScriptTarget.Latest,!1,n,t),i=de("sha256"),a=de("sha256"),s=[],o=[0];for(let u=0;u<t.length;u+=1)t.charCodeAt(u)===10&&o.push(u+1);let l=0;for(let u=r.scan();u!==B.SyntaxKind.EndOfFileToken;u=r.scan()){if(u===B.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)===0&&(u=r.reScanTemplateToken(!1)),Kr.has(u))continue;let c=r.getTokenText();for(;o[l+1]!==void 0&&o[l+1]<=r.getTokenPos();)l+=1;i.update(String(u)),i.update("\0"),i.update(c),i.update("\0"),i.update(String(l)),i.update("\0"),a.update(String(u)),a.update("\0"),!Xr.has(u)&&!pi(u,c)&&a.update(c),a.update("\0"),a.update(String(l)),a.update("\0"),u===B.SyntaxKind.TemplateHead?s.push(0):u===B.SyntaxKind.TemplateTail?s.pop():u===B.SyntaxKind.OpenBraceToken&&s.length>0?s[s.length-1]+=1:u===B.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)>0&&(s[s.length-1]-=1)}return{syntaxHash:i.digest("hex"),shapeHash:a.digest("hex")}}function pi(e,t){if(e!==B.SyntaxKind.StringLiteral||t.length<2)return!1;let n=t.slice(1,-1);return n.startsWith("/")||n.includes("://")}function mi(e,t,n,r){return e?e(t,r,{file:n}):r()}function fi(e,t){return t?at(e)?/<script\b/iu.test(t):fe(e)!==null:!1}function yi(e){let t=new Map(Ue.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function hi(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function gi(e){let t=new Map;for(let n of $e){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let a=Ci(i,n.keyNames);if(!a)continue;let s=a.map(d=>`${d.name}=${un(d.name,d.value)}`).join("\0"),o=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${o}\0${s}`,u=`boundary-group:${de("sha256").update(l).digest("hex").slice(0,16)}`,c=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:s,keyParts:a,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&c.producerIds.push(i.id),n.consumerActions.includes(i.action)&&c.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&c.declarationIds.push(i.id),c.derivation.inputFactIds.push(i.id),c.derivation.sourceSpans.push(i.source),t.set(u,c)}}return[...t.values()].map(vi).sort(Bi)}function vi(e){return{...e,producerIds:Fe(e.producerIds),consumerIds:Fe(e.consumerIds),declarationIds:Fe(e.declarationIds),derivation:{...e.derivation,inputFactIds:Fe(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function bi(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=$e.find(o=>o.id===i.joinRule);if(!a?.traversable)continue;let s=a.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(s.length===0||i.consumerIds.length===0)&&!(a.requireUniquePair&&(s.length!==1||i.consumerIds.length!==1))&&!(a.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(s.length*i.consumerIds.length>Zr))for(let o of s)for(let l of i.consumerIds){let u=n.get(o),c=n.get(l);if(!u||!c||Ni(u,c))continue;let d=u.strength==="derived"||c.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${o}\0${l}`,m={id:`boundary-link:${de("sha256").update(p).digest("hex").slice(0,16)}`,from:o,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:d,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[o,l],sourceSpans:[u.source,c.source]}};r.set(m.id,m)}}return[...r.values()].sort(Ii)}function Si(e,t){let n=new Set(t.filter(ln).flatMap(Te)),r=new Set(t.filter(Ri).flatMap(Te));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function xi(e,t){let n=new Set(e.filter(a=>a.strength!=="candidate").map(a=>`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)),r=new Set(t.flatMap(Te)),i=new Set(t.filter(ln).flatMap(Te));return e.filter(a=>a.sourceScope==="production").filter(a=>a.strength!=="candidate"||!n.has(`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)).filter(a=>!i.has(a.id)).map(a=>{let s=a.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),o=s.length>0?`${a.extractor} observed ${a.action}, but ${s.join(", ")} remained symbolic or unknown.`:a.resolution==="ambiguous"?`${a.extractor} established the address for ${a.action}, but more than one indexed peer has the same runtime key.`:r.has(a.id)?`${a.extractor} established the address for ${a.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${a.extractor} observed ${a.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:a.id,reason:o,missingKeyParts:s,sourceScope:a.sourceScope}}).sort((a,s)=>a.observationId.localeCompare(s.observationId))}function Te(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function ln(e){let t=$e.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function Ri(e){let t=$e.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function Ci(e,t){let n=[];for(let r of t){let i=e.keyParts.find(a=>a.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:un(r,i.value)})}return n}function un(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function Ni(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function ce(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function Fe(e){return[...new Set(e)].sort()}function Bi(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function Ii(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}export{ge as a,V as b,qe as c,se as d,Ye as e,Wr as f,dn as g,pn as h,ht as i};
57
- //# sourceMappingURL=chunk-ANCHW2R4.js.map