scip-query 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/CHANGELOG.md +257 -0
  2. package/README.md +11 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-XI2CSWEY.js +2 -0
  5. package/dist/call-graph-UONR6JR5.js +2 -0
  6. package/dist/{chunk-FGNCOQUX.js → chunk-2E7CX53V.js} +2 -2
  7. package/dist/chunk-2GRUZAQF.js +43 -0
  8. package/dist/{chunk-DPWKKNKI.js → chunk-2LDBDR6J.js} +2 -2
  9. package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
  10. package/dist/{chunk-XGGBK66W.js → chunk-2R3V3PSD.js} +2 -2
  11. package/dist/chunk-2WC2OEDO.js +4 -0
  12. package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
  13. package/dist/{chunk-2RE5OCHZ.js → chunk-3D3QG236.js} +2 -2
  14. package/dist/{chunk-D2MVJSP4.js → chunk-3FHOF22C.js} +2 -2
  15. package/dist/{chunk-7XZGZBSQ.js → chunk-3JKSW6LJ.js} +2 -2
  16. package/dist/chunk-3L2ZBPEX.js +133 -0
  17. package/dist/{chunk-NVSZNESQ.js → chunk-3PJABJSU.js} +2 -2
  18. package/dist/{chunk-WOOAY3PA.js → chunk-3SVF22I5.js} +2 -2
  19. package/dist/{chunk-YAGYMBEX.js → chunk-3WR4E3A3.js} +2 -2
  20. package/dist/chunk-4FTZ4P5G.js +2 -0
  21. package/dist/{chunk-F24G5NBE.js → chunk-4ILJCCXV.js} +2 -2
  22. package/dist/chunk-4UX2F3JX.js +2 -0
  23. package/dist/chunk-4WNW27SX.js +2 -0
  24. package/dist/chunk-5ENOG4VP.js +61 -0
  25. package/dist/{chunk-RHHCLWQ6.js → chunk-64BFSI5I.js} +2 -2
  26. package/dist/chunk-66DVSJQG.js +455 -0
  27. package/dist/{chunk-ISWFRGJ6.js → chunk-6HFCYNYE.js} +2 -2
  28. package/dist/{chunk-Y2VM4CJC.js → chunk-6I6L7Z62.js} +2 -2
  29. package/dist/{chunk-CKRWA452.js → chunk-6PQNKL3G.js} +2 -2
  30. package/dist/{chunk-GPGRZJ3R.js → chunk-6V5CNXL6.js} +2 -2
  31. package/dist/chunk-6VVV4WRR.js +4 -0
  32. package/dist/{chunk-BDGTPN27.js → chunk-7BWFZPPZ.js} +2 -2
  33. package/dist/{chunk-25GWKRUZ.js → chunk-7CYG22FH.js} +2 -2
  34. package/dist/chunk-7F45LJKI.js +2 -0
  35. package/dist/{chunk-4TQU4TX2.js → chunk-7IWV2EG3.js} +2 -2
  36. package/dist/{chunk-UDY7MIAW.js → chunk-AFHTBORT.js} +2 -2
  37. package/dist/chunk-AVRYW5OZ.js +2 -0
  38. package/dist/chunk-B3PYOSCX.js +2 -0
  39. package/dist/{chunk-RNKPYYYE.js → chunk-B5D7QPBE.js} +2 -2
  40. package/dist/{chunk-FFJQZG6J.js → chunk-BBCIS4DX.js} +2 -2
  41. package/dist/chunk-BDUVI7TO.js +3 -0
  42. package/dist/{chunk-BVFYEEBH.js → chunk-BE7ZZTMC.js} +2 -2
  43. package/dist/{chunk-NEIQPFBI.js → chunk-BHVUJOCQ.js} +2 -2
  44. package/dist/chunk-BKVWUP7Y.js +2 -0
  45. package/dist/{chunk-IJMD6BRI.js → chunk-BQGB4HBD.js} +2 -2
  46. package/dist/{chunk-ERCYGVAM.js → chunk-BRV7PIFF.js} +2 -2
  47. package/dist/chunk-CEEZJXEF.js +2 -0
  48. package/dist/{chunk-BTVKZGWT.js → chunk-CIYLO6SI.js} +2 -2
  49. package/dist/chunk-CJZXN4NU.js +2 -0
  50. package/dist/{chunk-VXJJTQYE.js → chunk-CNO7TOKL.js} +2 -2
  51. package/dist/{chunk-ZZ3Z7D56.js → chunk-COF23M5F.js} +2 -2
  52. package/dist/{chunk-ZGW4HLPD.js → chunk-CWFP7GM5.js} +2 -2
  53. package/dist/chunk-D2DHWI3D.js +2 -0
  54. package/dist/{chunk-Q55NF3ZG.js → chunk-D4N5SQ2M.js} +2 -2
  55. package/dist/{chunk-LXQUF2RP.js → chunk-DBRSYFXR.js} +2 -2
  56. package/dist/{chunk-PXXYQK55.js → chunk-DHUIOLDT.js} +2 -2
  57. package/dist/{chunk-KZYID5KV.js → chunk-DIRJWYBM.js} +2 -2
  58. package/dist/{chunk-IKVNEGTW.js → chunk-DIUFNHRJ.js} +2 -2
  59. package/dist/{chunk-CLG6DWVS.js → chunk-DTZCKZEU.js} +2 -2
  60. package/dist/{chunk-Z2PZVKPR.js → chunk-DULC3QFP.js} +2 -2
  61. package/dist/{chunk-AYPDH2LU.js → chunk-DYGHBZ2N.js} +2 -2
  62. package/dist/{chunk-JJ62MTQH.js → chunk-E5R6AQ73.js} +2 -2
  63. package/dist/{chunk-BWVQP3LB.js → chunk-E73UNJTF.js} +2 -2
  64. package/dist/{chunk-GVOMSPGL.js → chunk-EG2CPZMJ.js} +2 -2
  65. package/dist/{chunk-56NQAEPJ.js → chunk-EKV5HX33.js} +2 -2
  66. package/dist/{chunk-GDRJB3SB.js → chunk-EQHFIL6T.js} +2 -2
  67. package/dist/{chunk-EWWY2ZFL.js → chunk-ESIQ66Z7.js} +2 -2
  68. package/dist/chunk-EVFUMY4R.js +3 -0
  69. package/dist/{chunk-ZYM4HOFA.js → chunk-F7DY272B.js} +2 -2
  70. package/dist/chunk-FBN2FGXG.js +2 -0
  71. package/dist/{chunk-AZS7YPCB.js → chunk-FDLOBR6P.js} +2 -2
  72. package/dist/chunk-FESCRNVV.js +5 -0
  73. package/dist/{chunk-URSGGIZX.js → chunk-FFRKR4EQ.js} +2 -2
  74. package/dist/chunk-FGA2U4OR.js +8 -0
  75. package/dist/{chunk-7YQOCABQ.js → chunk-FIQRSHVM.js} +2 -2
  76. package/dist/{chunk-KFVSJX25.js → chunk-FPYLNQPT.js} +2 -2
  77. package/dist/{chunk-FELGD32K.js → chunk-FRUSVINH.js} +2 -2
  78. package/dist/chunk-GAS2LJMP.js +3 -0
  79. package/dist/{chunk-OTSPRVNW.js → chunk-GSP44ENC.js} +2 -2
  80. package/dist/{chunk-K3XFWJI2.js → chunk-GUFSG5TX.js} +2 -2
  81. package/dist/chunk-GYIZ4NXB.js +2 -0
  82. package/dist/{chunk-2OXVP5U5.js → chunk-GZIUDL6G.js} +2 -2
  83. package/dist/chunk-HCXEQRFF.js +18 -0
  84. package/dist/{chunk-LO5JSW2C.js → chunk-HEHOQQKH.js} +2 -2
  85. package/dist/{chunk-U2N2KE7A.js → chunk-HKGFPJ4T.js} +2 -2
  86. package/dist/chunk-HLZTEXRA.js +2 -0
  87. package/dist/{chunk-EELPBR7E.js → chunk-HOENASQM.js} +2 -2
  88. package/dist/{chunk-VTCIYFEK.js → chunk-HVF5VBG6.js} +2 -2
  89. package/dist/{chunk-TH6IC56G.js → chunk-HYO3NP5Q.js} +2 -2
  90. package/dist/{chunk-OPSAW5DT.js → chunk-I55I7XXP.js} +2 -2
  91. package/dist/{chunk-DEAB5TGT.js → chunk-IDFEUFKS.js} +2 -2
  92. package/dist/{chunk-DJAO2OZJ.js → chunk-IHGQTTVW.js} +2 -2
  93. package/dist/{chunk-XU75YQN4.js → chunk-IICPE7B2.js} +2 -2
  94. package/dist/{chunk-GY7CCCEZ.js → chunk-IL676XCC.js} +2 -2
  95. package/dist/{chunk-4HE7MVWD.js → chunk-ILTDAWEF.js} +2 -2
  96. package/dist/chunk-IZDPJ2QI.js +2 -0
  97. package/dist/{chunk-5YRQIE2B.js → chunk-J66VOFW6.js} +2 -2
  98. package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
  99. package/dist/{chunk-QLBSG7U5.js → chunk-JGKUET5J.js} +2 -2
  100. package/dist/{chunk-VZ7NXSHV.js → chunk-JS4PGXMV.js} +2 -2
  101. package/dist/{chunk-ZAZGGSM3.js → chunk-JTQVMR42.js} +2 -2
  102. package/dist/chunk-JWTGMPIT.js +80 -0
  103. package/dist/{chunk-5ZMBRQFC.js → chunk-JYR66JN5.js} +2 -2
  104. package/dist/chunk-KLFEXGQA.js +2 -0
  105. package/dist/chunk-KYSDI3GE.js +5 -0
  106. package/dist/{chunk-MSR2QRUE.js → chunk-L6PJPETJ.js} +2 -2
  107. package/dist/{chunk-VU6LIWHT.js → chunk-LDVT66YM.js} +2 -2
  108. package/dist/chunk-LEECKFCJ.js +2 -0
  109. package/dist/{chunk-H7CG6LOE.js → chunk-LMZ5PRUV.js} +2 -2
  110. package/dist/{chunk-ZPASRBLF.js → chunk-LQRQN2XA.js} +2 -2
  111. package/dist/{chunk-HISEUIL2.js → chunk-LXABEJX3.js} +2 -2
  112. package/dist/{chunk-WHADK6OS.js → chunk-M2O5NY6W.js} +2 -2
  113. package/dist/{chunk-Y334QQU5.js → chunk-MNV5FSBW.js} +2 -2
  114. package/dist/{chunk-RYOYJMGF.js → chunk-MPQ4OTBM.js} +2 -2
  115. package/dist/{chunk-6NC3YSPY.js → chunk-MV3CDXPI.js} +2 -2
  116. package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
  117. package/dist/chunk-N2ZSIIGR.js +117 -0
  118. package/dist/chunk-N5B2NILC.js +5 -0
  119. package/dist/{chunk-Q6T2CAJL.js → chunk-NJITK2GP.js} +2 -2
  120. package/dist/{chunk-ENWQWA2R.js → chunk-NOGJXYFO.js} +2 -2
  121. package/dist/{chunk-V4NG5OMS.js → chunk-NOYBFVJA.js} +106 -106
  122. package/dist/chunk-NWQXSFFU.js +3 -0
  123. package/dist/chunk-ODDUPDP7.js +13 -0
  124. package/dist/{chunk-A77SCPW2.js → chunk-OLIWTZI3.js} +2 -2
  125. package/dist/{chunk-XFMVKFSF.js → chunk-OLNV6I6U.js} +2 -2
  126. package/dist/{chunk-QKT4UI2Y.js → chunk-OR2E3AGZ.js} +2 -2
  127. package/dist/chunk-OSR2GEHQ.js +2 -0
  128. package/dist/{chunk-5H5WTJSD.js → chunk-OSSESPDX.js} +2 -2
  129. package/dist/{chunk-KQHJEU6V.js → chunk-OWOOWNJ5.js} +2 -2
  130. package/dist/{chunk-GRX7JOXQ.js → chunk-P42EIXTA.js} +2 -2
  131. package/dist/{chunk-AQ2PORIO.js → chunk-PJFGPYTU.js} +2 -2
  132. package/dist/{chunk-LRI5OMPE.js → chunk-PP7KNN7L.js} +2 -2
  133. package/dist/{chunk-PLJUQFQN.js → chunk-PU7T5QYQ.js} +2 -2
  134. package/dist/{chunk-JUN5DOAK.js → chunk-PWWAJSKV.js} +2 -2
  135. package/dist/{chunk-7IQXARSQ.js → chunk-PZL5T7SU.js} +2 -2
  136. package/dist/{chunk-UAQ4T73O.js → chunk-QBE3YX64.js} +2 -2
  137. package/dist/{chunk-3TJY6M3B.js → chunk-QGVTFRY2.js} +2 -2
  138. package/dist/chunk-QOJONDS7.js +2 -0
  139. package/dist/chunk-QU5XRYB5.js +4 -0
  140. package/dist/{chunk-2KVU55CW.js → chunk-QUU5OBVK.js} +2 -2
  141. package/dist/{chunk-Q5TA4OY4.js → chunk-RBLQNW26.js} +2 -2
  142. package/dist/chunk-RTQ7NEKG.js +81 -0
  143. package/dist/{chunk-F24QUEQP.js → chunk-SQXRS7BG.js} +2 -2
  144. package/dist/chunk-SSK6LDPC.js +2 -0
  145. package/dist/chunk-SZHGTCPP.js +7 -0
  146. package/dist/chunk-T4N4P2K5.js +16 -0
  147. package/dist/chunk-TA3QKLLU.js +2 -0
  148. package/dist/chunk-TEBQMNVI.js +43 -0
  149. package/dist/{chunk-NK3JMP22.js → chunk-TPFHAQ2G.js} +2 -2
  150. package/dist/chunk-TQPCBMWT.js +5 -0
  151. package/dist/{chunk-HG722PO7.js → chunk-TRNAEQ6P.js} +2 -2
  152. package/dist/chunk-TY7CRN3Z.js +2 -0
  153. package/dist/{chunk-7XA3OM44.js → chunk-UHFYCMZO.js} +2 -2
  154. package/dist/{chunk-ARVO6TTW.js → chunk-UICY4GTQ.js} +2 -2
  155. package/dist/{chunk-SWK4XPUS.js → chunk-UVGEWT4Y.js} +2 -2
  156. package/dist/{chunk-GIQ6CSL4.js → chunk-UXW33INU.js} +2 -2
  157. package/dist/{chunk-RDULNRSJ.js → chunk-VMPRET3I.js} +2 -2
  158. package/dist/{chunk-I6UTXNHU.js → chunk-VNLGKHS6.js} +2 -2
  159. package/dist/{chunk-44T4DUAA.js → chunk-VQILFTEH.js} +2 -2
  160. package/dist/{chunk-N7FP5H5U.js → chunk-VUPHCS7Y.js} +8 -8
  161. package/dist/{chunk-JAT6C3VX.js → chunk-VVZSBTSU.js} +2 -2
  162. package/dist/{chunk-FBCVASUG.js → chunk-VZRNID6A.js} +2 -2
  163. package/dist/{chunk-TUQIPUDS.js → chunk-W5OXRYGE.js} +2 -2
  164. package/dist/chunk-W6STWDQI.js +57 -0
  165. package/dist/chunk-W7CXK74K.js +2 -0
  166. package/dist/chunk-WB3WYIRE.js +4 -0
  167. package/dist/{chunk-C76O5MDS.js → chunk-WDNVY4E7.js} +2 -2
  168. package/dist/{chunk-TAYD3AE7.js → chunk-WIWY3CRX.js} +2 -2
  169. package/dist/chunk-WK46TNUM.js +3 -0
  170. package/dist/chunk-WNTFFKAX.js +12 -0
  171. package/dist/{chunk-JFQBRL3J.js → chunk-WOIKCX6A.js} +2 -2
  172. package/dist/{chunk-PIFTZEEM.js → chunk-WUN6KBHV.js} +2 -2
  173. package/dist/chunk-WYCTJDVR.js +2 -0
  174. package/dist/chunk-WYPL7GF7.js +2 -0
  175. package/dist/{chunk-XN22RGSR.js → chunk-XBGWL66K.js} +2 -2
  176. package/dist/{chunk-R6M456QG.js → chunk-XDQMU3BT.js} +2 -2
  177. package/dist/{chunk-XJX6LGHL.js → chunk-XFA4SSO3.js} +2 -2
  178. package/dist/{chunk-2YC7YNKT.js → chunk-XGZEP6GR.js} +2 -2
  179. package/dist/chunk-XPDPNWTQ.js +368 -0
  180. package/dist/chunk-XRYABF57.js +8 -0
  181. package/dist/{chunk-YIHNPKWD.js → chunk-YBGKCQIS.js} +2 -2
  182. package/dist/{chunk-2XCGSDIT.js → chunk-YEN6CYC7.js} +2 -2
  183. package/dist/{chunk-VMWUV6WB.js → chunk-YF5IB2LF.js} +2 -2
  184. package/dist/{chunk-TNG2FYS5.js → chunk-YI2AWIHC.js} +2 -2
  185. package/dist/{chunk-EELG7D3Q.js → chunk-YPWBKGFU.js} +2 -2
  186. package/dist/{chunk-GQIDEID3.js → chunk-YPWHBBIS.js} +2 -2
  187. package/dist/{chunk-TKDNDQA7.js → chunk-YSH6U3L4.js} +2 -2
  188. package/dist/{chunk-BUTEIZKP.js → chunk-YU5DZUZI.js} +2 -2
  189. package/dist/chunk-YWO5DDRC.js +16 -0
  190. package/dist/{chunk-6HRZQLOI.js → chunk-Z4CDXYNQ.js} +2 -2
  191. package/dist/{chunk-XSWYJCAK.js → chunk-ZF5KHH7C.js} +2 -2
  192. package/dist/chunk-ZOHS7AQV.js +21 -0
  193. package/dist/{chunk-7U2YQSDE.js → chunk-ZTI4SBFV.js} +2 -2
  194. package/dist/cli-main.js +2 -2
  195. package/dist/code-MI6F2TTU.js +2 -0
  196. package/dist/code-result-json-FXALY4HE.js +2 -0
  197. package/dist/{command-descriptors-ORNTVNYV.js → command-descriptors-P34VABY5.js} +136 -135
  198. package/dist/dataflow-4KEMJPC6.js +2 -0
  199. package/dist/dependence-slice-R7FPWD5M.js +2 -0
  200. package/dist/deps-7EMQUYUT.js +2 -0
  201. package/dist/direct-navigation-6YO234F2.js +3 -0
  202. package/dist/entry-map-KOOLR26E.js +2 -0
  203. package/dist/files-OPIPJIGZ.js +2 -0
  204. package/dist/hierarchy-QPD2CAER.js +2 -0
  205. package/dist/imports-M6HUXRXC.js +2 -0
  206. package/dist/index.js +1 -1
  207. package/dist/members-I5MEFOCT.js +2 -0
  208. package/dist/methods-5JYGGHXA.js +2 -0
  209. package/dist/output-continuation-command-UPQAAKBP.js +3 -0
  210. package/dist/postinstall.js +1 -1
  211. package/dist/project-reindex-UKKQ5PLS.js +3 -0
  212. package/dist/queries/affected.js +1 -1
  213. package/dist/queries/anchors.js +1 -1
  214. package/dist/queries/architecture.js +1 -1
  215. package/dist/queries/bottlenecks.js +1 -1
  216. package/dist/queries/by-kind.js +1 -1
  217. package/dist/queries/call-graph.js +1 -1
  218. package/dist/queries/change-surface.js +1 -1
  219. package/dist/queries/cleanup-plan.js +1 -1
  220. package/dist/queries/co-change.js +1 -1
  221. package/dist/queries/code.js +1 -1
  222. package/dist/queries/complexity-hotspots.js +1 -1
  223. package/dist/queries/complexity.js +1 -1
  224. package/dist/queries/context.js +1 -1
  225. package/dist/queries/convergence.js +1 -1
  226. package/dist/queries/coupling.js +1 -1
  227. package/dist/queries/cycles.js +1 -1
  228. package/dist/queries/dataflow.js +1 -1
  229. package/dist/queries/dead.js +1 -1
  230. package/dist/queries/decorative-checkers.js +1 -1
  231. package/dist/queries/deep-chains.js +1 -1
  232. package/dist/queries/dependence-slice.js +1 -1
  233. package/dist/queries/dependency-depth.js +1 -1
  234. package/dist/queries/deps.js +1 -1
  235. package/dist/queries/diff-impact.d.ts +9 -0
  236. package/dist/queries/diff-impact.js +1 -1
  237. package/dist/queries/doc-drift.js +1 -1
  238. package/dist/queries/drift.js +1 -1
  239. package/dist/queries/duplicate-bodies.js +1 -1
  240. package/dist/queries/entry-map.js +1 -1
  241. package/dist/queries/evidence.js +1 -1
  242. package/dist/queries/extract-candidates.js +1 -1
  243. package/dist/queries/fan.js +1 -1
  244. package/dist/queries/files.js +1 -1
  245. package/dist/queries/health.js +1 -1
  246. package/dist/queries/hierarchy.js +1 -1
  247. package/dist/queries/hotspots.js +1 -1
  248. package/dist/queries/imports.js +1 -1
  249. package/dist/queries/incomplete-migration.js +1 -1
  250. package/dist/queries/index.js +1 -1
  251. package/dist/queries/isolated.js +1 -1
  252. package/dist/queries/locality-candidates.js +1 -1
  253. package/dist/queries/members.js +1 -1
  254. package/dist/queries/methods.js +1 -1
  255. package/dist/queries/not-implemented.js +1 -1
  256. package/dist/queries/outline.js +1 -1
  257. package/dist/queries/passthrough-candidates.js +1 -1
  258. package/dist/queries/plan-context.js +1 -1
  259. package/dist/queries/react-component-duplicates.js +1 -1
  260. package/dist/queries/react-hook-candidates.js +1 -1
  261. package/dist/queries/react-large-component-pressure.js +1 -1
  262. package/dist/queries/recent-duplicates.js +1 -1
  263. package/dist/queries/redundant-reexports.js +1 -1
  264. package/dist/queries/reference-neighborhood.js +1 -1
  265. package/dist/queries/reference-reachability.js +1 -1
  266. package/dist/queries/refs.js +1 -1
  267. package/dist/queries/self-audit.js +1 -1
  268. package/dist/queries/similar-chains.js +1 -1
  269. package/dist/queries/similar-files.js +1 -1
  270. package/dist/queries/similar-signatures.js +1 -1
  271. package/dist/queries/similar.js +1 -1
  272. package/dist/queries/slice.js +1 -1
  273. package/dist/queries/source-inspection.js +1 -1
  274. package/dist/queries/source-search.js +1 -1
  275. package/dist/queries/stale-abstractions.js +1 -1
  276. package/dist/queries/surface.js +1 -1
  277. package/dist/queries/symbols.js +1 -1
  278. package/dist/queries/system-map.js +1 -1
  279. package/dist/queries/system.js +1 -1
  280. package/dist/queries/test-quality.js +1 -1
  281. package/dist/queries/trace.js +1 -1
  282. package/dist/queries/twin-ab.js +1 -1
  283. package/dist/queries/twin-drift.js +1 -1
  284. package/dist/queries/unused-imports.js +1 -1
  285. package/dist/queries/unused-params.js +1 -1
  286. package/dist/queries/value-flow.js +1 -1
  287. package/dist/queries/vue-component-duplicates.js +1 -1
  288. package/dist/queries/vue-composable-candidates.js +1 -1
  289. package/dist/queries/vue-large-view-pressure.js +1 -1
  290. package/dist/queries/wrapper-candidates.js +1 -1
  291. package/dist/query-service-server.js +3 -3
  292. package/dist/refs-PSU4JZZW.js +2 -0
  293. package/dist/refs-pagination-JG6CJMRC.js +2 -0
  294. package/dist/reindex-worker.js +25 -25
  295. package/dist/reindex.d.ts +3 -2
  296. package/dist/reindex.js +35 -35
  297. package/dist/runtime.d.ts +34 -2
  298. package/dist/runtime.js +4 -4
  299. package/dist/rust-semantic-session-server.js +1 -1
  300. package/dist/rust-semantic-session-worker.js +1 -1
  301. package/dist/rust-semantic-worker.js +1 -1
  302. package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
  303. package/dist/slice-HYRATV64.js +2 -0
  304. package/dist/surface-VTGDYWF5.js +2 -0
  305. package/dist/symbol-resolution-WD5EU5JE.js +2 -0
  306. package/dist/system-LRQNFOR2.js +2 -0
  307. package/dist/trace-F4B6OLL4.js +2 -0
  308. package/dist/typescript-mailbox-worker.js +1 -1
  309. package/dist/value-flow-VRPZY72V.js +2 -0
  310. package/dist/watch-server.js +3 -3
  311. package/package.json +1 -1
  312. package/dist/by-kind-4IYG2SKW.js +0 -2
  313. package/dist/call-graph-WQNXMNNN.js +0 -2
  314. package/dist/chunk-2BTJALUS.js +0 -454
  315. package/dist/chunk-3QXC54FQ.js +0 -3
  316. package/dist/chunk-42W3LFUK.js +0 -13
  317. package/dist/chunk-4GAQ6FI4.js +0 -43
  318. package/dist/chunk-6VEFRPTD.js +0 -5
  319. package/dist/chunk-7C26EKLZ.js +0 -4
  320. package/dist/chunk-7JYHQAH2.js +0 -22
  321. package/dist/chunk-7KSO2OAP.js +0 -2
  322. package/dist/chunk-AK3PYTIK.js +0 -5
  323. package/dist/chunk-AMIMMNA4.js +0 -11
  324. package/dist/chunk-AUY5BL74.js +0 -2
  325. package/dist/chunk-BDHFVH2M.js +0 -18
  326. package/dist/chunk-BECZLYNU.js +0 -8
  327. package/dist/chunk-BYDAFMSR.js +0 -57
  328. package/dist/chunk-BZYSGZRK.js +0 -2
  329. package/dist/chunk-C7IJMOFP.js +0 -134
  330. package/dist/chunk-CBBHFNLX.js +0 -2
  331. package/dist/chunk-D35XIZGN.js +0 -2
  332. package/dist/chunk-DKM723YF.js +0 -79
  333. package/dist/chunk-E44IVWIJ.js +0 -367
  334. package/dist/chunk-EDMB6SSO.js +0 -7
  335. package/dist/chunk-EETGXQY7.js +0 -3
  336. package/dist/chunk-FKGQOTKD.js +0 -2
  337. package/dist/chunk-GH5YSGZL.js +0 -5
  338. package/dist/chunk-HCVJR2V4.js +0 -3
  339. package/dist/chunk-HXOU4XNH.js +0 -3
  340. package/dist/chunk-IMKZEXZG.js +0 -2
  341. package/dist/chunk-ISIQLPJ2.js +0 -61
  342. package/dist/chunk-IXESDH3J.js +0 -2
  343. package/dist/chunk-JT6XX7QY.js +0 -8
  344. package/dist/chunk-MHIEP7EG.js +0 -4
  345. package/dist/chunk-OJNK5ALA.js +0 -2
  346. package/dist/chunk-OXYAWIEA.js +0 -2
  347. package/dist/chunk-OZETODHH.js +0 -2
  348. package/dist/chunk-PBUH2P5S.js +0 -3
  349. package/dist/chunk-PLYUVM4F.js +0 -2
  350. package/dist/chunk-Q7GBK5T7.js +0 -81
  351. package/dist/chunk-QWKHW6VZ.js +0 -2
  352. package/dist/chunk-RPL3ARU7.js +0 -16
  353. package/dist/chunk-SVHTMVA4.js +0 -4
  354. package/dist/chunk-T6QD2ZQB.js +0 -43
  355. package/dist/chunk-TD7VKJ2Y.js +0 -117
  356. package/dist/chunk-TUSPIVZ3.js +0 -4
  357. package/dist/chunk-UT7TADJX.js +0 -2
  358. package/dist/chunk-VUSKPCUB.js +0 -2
  359. package/dist/chunk-WN3TCGJ4.js +0 -2
  360. package/dist/chunk-WSLEJSFR.js +0 -2
  361. package/dist/chunk-WYZIHUPZ.js +0 -16
  362. package/dist/chunk-XE33FV5W.js +0 -2
  363. package/dist/chunk-Z2AWCTN6.js +0 -2
  364. package/dist/chunk-ZOXKSQQB.js +0 -2
  365. package/dist/code-EQJFDT6I.js +0 -2
  366. package/dist/code-result-json-7UWIWBOO.js +0 -2
  367. package/dist/dataflow-6VL54GX5.js +0 -2
  368. package/dist/dependence-slice-DT2NUHD2.js +0 -2
  369. package/dist/deps-DB7H5IKC.js +0 -2
  370. package/dist/direct-navigation-O3LUAYWQ.js +0 -3
  371. package/dist/entry-map-6K62RV3D.js +0 -2
  372. package/dist/files-MSLD7MO6.js +0 -2
  373. package/dist/hierarchy-IVBXAKFA.js +0 -2
  374. package/dist/imports-FRAVZ3Y2.js +0 -2
  375. package/dist/members-KJOJDYGO.js +0 -2
  376. package/dist/methods-2AYABBT3.js +0 -2
  377. package/dist/output-continuation-command-JHMPH6NC.js +0 -3
  378. package/dist/project-reindex-HYO4WD7Z.js +0 -3
  379. package/dist/refs-ARMA6XUJ.js +0 -2
  380. package/dist/refs-pagination-VUGIWN6U.js +0 -2
  381. package/dist/slice-YOB5YFAM.js +0 -2
  382. package/dist/surface-VY5EFWTW.js +0 -2
  383. package/dist/symbol-resolution-DGQN4XIV.js +0 -2
  384. package/dist/system-2KQ3QD2P.js +0 -2
  385. package/dist/trace-HTIPTXAE.js +0 -2
  386. package/dist/value-flow-5FV3VQI7.js +0 -2
@@ -1,2 +1,2 @@
1
- import{d}from"./chunk-B3X6KU75.js";import{P as p}from"./chunk-7JYHQAH2.js";function y(t,e={}){let{minTotalLines:i=800,minTemplateLines:n=300,minScriptLines:r=300,minStyleLines:u=500,limit:o=20,scope:a,scanLimit:l,filePattern:m}=e;return p(t).vueProfiles({scope:a,scanLimit:l}).filter(s=>!m||s.file.includes(m)).map(s=>L(s,{minTotalLines:i,minTemplateLines:n,minScriptLines:r,minStyleLines:u})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(t,e){let i=d(t,b(e),"total"),{reasons:n}=i;if(n.length===0)return null;let r=i.dominantPressure,u=i.pressureKinds.includes("total")?[...new Set([...i.pressureKinds,r])]:i.pressureKinds,o=g(t.file),a=x(r,o),l=t.totalLines+t.delegatedComposableLines;return{file:t.file,totalLines:l,sfcLines:t.sfcLines,templateLines:t.templateLines,scriptLines:t.scriptLines,styleLines:t.styleLines,externalScriptLines:t.externalScriptLines,externalScriptPaths:t.externalScriptPaths,customBlockLines:t.customBlockLines,delegatedComposableLines:t.delegatedComposableLines,delegatedComposablePaths:t.delegatedComposablePaths,dominantPressure:r,pressureKinds:u,contextKind:o,recommendationKind:a,recommendation:f(a,o),reasons:n,loc:l}}function b(t){return[{axis:"total",value:e=>e.totalLines+e.delegatedComposableLines,qualifies:(e,i)=>i>=t.minTotalLines,reason:(e,i)=>e.delegatedComposableLines>0?`${i} total line(s) (${e.totalLines} component + ${e.delegatedComposableLines} delegated composable line(s) across ${e.delegatedComposablePaths.length} file(s))`:`${i} total component line(s)`,dominantEligible:!1},{axis:"template",value:e=>e.templateLines,qualifies:(e,i)=>i>=t.minTemplateLines,reason:(e,i)=>`${i} template line(s)`},{axis:"script",value:e=>e.scriptLines-e.externalScriptLines,qualifies:e=>e.scriptLines>=t.minScriptLines,reason:e=>`${e.scriptLines} script line(s)`},{axis:"style",value:e=>e.styleLines,qualifies:(e,i)=>i>=t.minStyleLines,reason:(e,i)=>`${i} style line(s)`},{axis:"external-script",value:e=>e.externalScriptLines,qualifies:(e,i)=>i>=t.minScriptLines},{axis:"custom-block",value:e=>e.customBlockLines,qualifies:()=>!1}]}function g(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(n=>w.has(n))||/(?:view|page|route)\.vue$/i.test(t)||/(?:^|\/)(views|pages|routes)\//i.test(t)?"route-page":"component"}function x(t,e){return t==="style"?"style-decomposition":t==="template"?"template-decomposition":t==="external-script"?"external-script-boundary":t==="custom-block"?"custom-block-review":e==="route-page"?"route-page-decomposition":t==="script"?"script-behavior-extraction":"total-size-review"}function f(t,e){switch(t){case"template-decomposition":return e==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{y as a};
2
- //# sourceMappingURL=chunk-ZAZGGSM3.js.map
1
+ import{d}from"./chunk-B3X6KU75.js";import{P as p}from"./chunk-ZOHS7AQV.js";function y(t,e={}){let{minTotalLines:i=800,minTemplateLines:n=300,minScriptLines:r=300,minStyleLines:u=500,limit:o=20,scope:a,scanLimit:l,filePattern:m}=e;return p(t).vueProfiles({scope:a,scanLimit:l}).filter(s=>!m||s.file.includes(m)).map(s=>L(s,{minTotalLines:i,minTemplateLines:n,minScriptLines:r,minStyleLines:u})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(t,e){let i=d(t,b(e),"total"),{reasons:n}=i;if(n.length===0)return null;let r=i.dominantPressure,u=i.pressureKinds.includes("total")?[...new Set([...i.pressureKinds,r])]:i.pressureKinds,o=g(t.file),a=x(r,o),l=t.totalLines+t.delegatedComposableLines;return{file:t.file,totalLines:l,sfcLines:t.sfcLines,templateLines:t.templateLines,scriptLines:t.scriptLines,styleLines:t.styleLines,externalScriptLines:t.externalScriptLines,externalScriptPaths:t.externalScriptPaths,customBlockLines:t.customBlockLines,delegatedComposableLines:t.delegatedComposableLines,delegatedComposablePaths:t.delegatedComposablePaths,dominantPressure:r,pressureKinds:u,contextKind:o,recommendationKind:a,recommendation:f(a,o),reasons:n,loc:l}}function b(t){return[{axis:"total",value:e=>e.totalLines+e.delegatedComposableLines,qualifies:(e,i)=>i>=t.minTotalLines,reason:(e,i)=>e.delegatedComposableLines>0?`${i} total line(s) (${e.totalLines} component + ${e.delegatedComposableLines} delegated composable line(s) across ${e.delegatedComposablePaths.length} file(s))`:`${i} total component line(s)`,dominantEligible:!1},{axis:"template",value:e=>e.templateLines,qualifies:(e,i)=>i>=t.minTemplateLines,reason:(e,i)=>`${i} template line(s)`},{axis:"script",value:e=>e.scriptLines-e.externalScriptLines,qualifies:e=>e.scriptLines>=t.minScriptLines,reason:e=>`${e.scriptLines} script line(s)`},{axis:"style",value:e=>e.styleLines,qualifies:(e,i)=>i>=t.minStyleLines,reason:(e,i)=>`${i} style line(s)`},{axis:"external-script",value:e=>e.externalScriptLines,qualifies:(e,i)=>i>=t.minScriptLines},{axis:"custom-block",value:e=>e.customBlockLines,qualifies:()=>!1}]}function g(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(n=>w.has(n))||/(?:view|page|route)\.vue$/i.test(t)||/(?:^|\/)(views|pages|routes)\//i.test(t)?"route-page":"component"}function x(t,e){return t==="style"?"style-decomposition":t==="template"?"template-decomposition":t==="external-script"?"external-script-boundary":t==="custom-block"?"custom-block-review":e==="route-page"?"route-page-decomposition":t==="script"?"script-behavior-extraction":"total-size-review"}function f(t,e){switch(t){case"template-decomposition":return e==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{y as a};
2
+ //# sourceMappingURL=chunk-JTQVMR42.js.map
@@ -0,0 +1,80 @@
1
+ import{x as A}from"./chunk-N5B2NILC.js";var O=[];function y(n){n.groups.length>0&&O.push(n)}function me(n,e){let t=new Set(e.groups);for(let a of O)a.groups.some(r=>t.has(r))&&(e.file!==void 0&&a.clearFile?a.clearFile(n,e.file):a.clearAll(n))}var I=256;function w(n){let e=n.maxEntries;if(e!==void 0){if(!Number.isSafeInteger(e)||e<1)throw new Error(`Per-database cache maxEntries must be a positive safe integer; received ${e}.`);return e}return n.clearGroups.includes("source-file")?I:void 0}function P(n,e,t){n.delete(e),n.set(e,t)}function x(n,e){if(e!==void 0)for(;n.size>e;){let t=n.keys().next().value;if(t===void 0)return;n.delete(t)}}function M(){let n=new WeakMap;return{cache:n,ensure(e){let t=n.get(e);return t||(t=new Map,n.set(e,t)),t}}}function C(n,e){let{cache:t,ensure:a}=M(),r=w(e),i={get(o,c,_){let p=a(o);if(p.has(c)){let E=p.get(c);return P(p,c,E),E}let u=_();return p.set(c,u),x(p,r),u},has(o,c){return t.get(o)?.has(c)??!1},invalidate(o,c){t.get(o)?.delete(c)},invalidateAll(o){t.delete(o)},size(o){return t.get(o)?.size??0}};return y({name:n,groups:e.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,c)=>i.invalidate(o,c)}),i}function Ne(n,e){let t=new WeakMap,a={get(r,i){let o=t.get(r);if(o)return o.value;let c=i();return t.set(r,{value:c}),c},invalidate(r){t.delete(r)},has(r){return t.has(r)}};return y({name:n,groups:e.clearGroups,clearAll:r=>a.invalidate(r)}),a}var ee={clearGroups:["whole-project","source-file"],maxEntries:I};function Te(n){return te(n,ee)}function te(n,e){let{cache:t,ensure:a}=M(),r=w(e),i={get(o,c,_,p){let u=a(o),E=u.get(c);if(E&&E.source===_)return P(u,c,E),E.value;let F=p();return u.set(c,{source:_,value:F}),x(u,r),F},invalidate(o,c){t.get(o)?.delete(c)},invalidateAll(o){t.delete(o)}};return y({name:n,groups:e.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,c)=>i.invalidate(o,c)}),i}import{createHash as ne}from"crypto";import{existsSync as Le,mkdirSync as re}from"fs";import{dirname as k,join as ae}from"path";import V from"better-sqlite3";var ie="evidence.db";var oe=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],D=new Set(oe);var we=512*1024*1024,ce=6e4,m=new WeakMap,se=C("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),le=C("evidence-project-fingerprint",{clearGroups:["whole-project"]}),s="evidence-v1",f="version NOT LIKE 'evidence-%'";function K(n){return ne("sha256").update(n).digest("hex")}function Pe(n,e,t){return se.get(n,e,()=>K(t))}function xe(n){return le.get(n,"current",()=>{try{if(!n.generation.metadataRaw)return null;let e=A(n.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let t=e.metadata,a=[...t.indexedLanguages??[]].sort();return K(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:a,status:t.status}))}catch(e){return h("project fingerprint unavailable",e),null}})}function h(n,e){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${n}: ${e instanceof Error?e.message:String(e)}`)}function l(n){if(m.has(n))return m.get(n)??null;let e=null;try{let t=new V(n.config.evidenceDbPath??ae(k(n.config.dbPath),ie));t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 5000"),t.pragma("synchronous = NORMAL"),t.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS project_evidence (
11
+ kind TEXT NOT NULL,
12
+ cache_key TEXT NOT NULL,
13
+ project_fingerprint TEXT NOT NULL,
14
+ version TEXT NOT NULL,
15
+ payload TEXT NOT NULL,
16
+ PRIMARY KEY (kind, cache_key)
17
+ );
18
+ CREATE TABLE IF NOT EXISTS semantic_callees (
19
+ relative_path TEXT NOT NULL,
20
+ symbol TEXT NOT NULL,
21
+ content_hash TEXT NOT NULL,
22
+ deps_digest TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS semantic_references (
28
+ relative_path TEXT NOT NULL,
29
+ symbol TEXT NOT NULL,
30
+ project_fingerprint TEXT NOT NULL,
31
+ version TEXT NOT NULL,
32
+ payload TEXT NOT NULL,
33
+ PRIMARY KEY (relative_path, symbol)
34
+ );
35
+ `),e={evidence:t,shared:de(n.config.sharedEvidenceDbPath),readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:t.prepare(`SELECT payload FROM file_evidence
36
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${f}
37
+ ORDER BY version DESC
38
+ LIMIT 1`),existsFileEvidence:t.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsLegacyFileEvidence:t.prepare(`SELECT 1 AS present FROM file_evidence
39
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${f}
40
+ LIMIT 1`),writeFileEvidence:t.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:t.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:t.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:t.prepare(`SELECT payload FROM project_evidence
41
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${f}
42
+ ORDER BY version DESC
43
+ LIMIT 1`),writeProjectEvidence:t.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:t.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:t.prepare(`SELECT payload FROM semantic_callees
44
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:t.prepare(`SELECT payload FROM semantic_callees
45
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${f}
46
+ ORDER BY version DESC
47
+ LIMIT 1`),readCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
48
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
49
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${f}
50
+ ORDER BY symbol, version DESC`),writeCallees:t.prepare(`INSERT OR REPLACE INTO semantic_callees
51
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:t.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:t.prepare(`SELECT payload FROM semantic_references
52
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:t.prepare(`SELECT payload FROM semantic_references
53
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${f}
54
+ ORDER BY version DESC
55
+ LIMIT 1`),readReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
56
+ WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
57
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${f}
58
+ ORDER BY symbol, version DESC`),writeReferences:t.prepare(`INSERT OR REPLACE INTO semantic_references
59
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:t.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(t){h("disabled (open failed)",t)}return m.set(n,e),e}function d(n,e,t){h(`disabled (${e})`,t),m.set(n,null)}function de(n){if(!n)return null;try{re(k(n),{recursive:!0});let e=new V(n);return e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 250"),e.pragma("synchronous = NORMAL"),e.exec(`
60
+ CREATE TABLE IF NOT EXISTS file_evidence (
61
+ kind TEXT NOT NULL,
62
+ relative_path TEXT NOT NULL,
63
+ content_hash TEXT NOT NULL,
64
+ version TEXT NOT NULL,
65
+ payload TEXT NOT NULL,
66
+ last_accessed_at INTEGER NOT NULL,
67
+ PRIMARY KEY (kind, relative_path, content_hash, version)
68
+ );
69
+ CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
70
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
71
+ `),{evidence:e,readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsFileEvidence:e.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:e.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
72
+ VALUES (?, ?, ?, ?, ?, ?)
73
+ ON CONFLICT(kind, relative_path, content_hash, version)
74
+ DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:e.prepare(`UPDATE file_evidence
75
+ SET last_accessed_at = ?
76
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
77
+ AND last_accessed_at < ?`)}}catch(e){return h("shared cache disabled (open failed)",e),null}}function S(n,e,t){h(`shared cache disabled (${e})`,t);try{n.shared?.evidence.close()}catch{}n.shared=null}function Me(n,e,t,a){let r=l(n);if(!r)return null;try{let i=r.readFileEvidence.get(e,t,a,s)??r.readLegacyFileEvidence.get(e,t,a);if(i?.payload!==void 0)return i.payload;if(!D.has(e)||!r.shared)return null;try{let o=r.shared.readFileEvidence.get(e,t,a,s);return o?.payload!==void 0&&U(r.shared,e,t,a),o?.payload??null}catch(o){return S(r,"file_evidence read",o),null}}catch(i){return d(n,"file_evidence read",i),null}}function ke(n,e,t,a){let r=l(n);if(!r)return!1;try{if((r.existsFileEvidence.get(e,t,a,s)??r.existsLegacyFileEvidence.get(e,t,a))?.present!==void 0)return!0;if(!D.has(e)||!r.shared)return!1;try{return r.shared.existsFileEvidence.get(e,t,a,s)?.present===void 0?!1:(U(r.shared,e,t,a),!0)}catch(o){return S(r,"file_evidence exists",o),!1}}catch(i){return d(n,"file_evidence exists",i),!1}}function U(n,e,t,a){let r=Date.now();try{n.touchFileEvidence.run(r,e,t,a,s,r-ce)}catch(i){h("shared file_evidence recency touch skipped",i)}}function Ve(n,e,t,a,r){let i=l(n);if(i)try{if(i.writeFileEvidence.run(e,t,a,s,r),D.has(e)&&i.shared)try{i.shared.writeFileEvidence.run(e,t,a,s,r,Date.now())}catch(o){S(i,"file_evidence write",o)}}catch(o){d(n,"file_evidence write",o)}}function Ke(n,e){if(e.length===0)return;let t=l(n);if(t)try{t.evidence.transaction(()=>{for(let r of e)t.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,s,r.payload)})();try{t.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let a=e.filter(r=>D.has(r.kind));if(a.length>0&&t.shared)try{t.shared.evidence.transaction(()=>{for(let r of a)t.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,s,r.payload,Date.now())})()}catch(r){S(t,"file_evidence batch write",r)}}catch(a){d(n,"file_evidence batch write",a)}}function Ue(n,e,t,a){let r=l(n);if(!r)return null;try{return(r.readProjectEvidence.get(e,t,a,s)??r.readLegacyProjectEvidence.get(e,t,a))?.payload??null}catch(i){return d(n,"project_evidence read",i),null}}function je(n,e,t,a,r){let i=l(n);if(i)try{i.writeProjectEvidence.run(e,t,a,s,r)}catch(o){d(n,"project_evidence write",o)}}function He(n,e,t,a){if(t===a)return 0;let r=l(n);if(!r)return 0;try{return r.rekeyProjectEvidenceKind.run(a,s,e,t).changes}catch(i){return d(n,"project_evidence kind rekey",i),0}}function We(n,e,t,a){let r=l(n);if(!r)return new Map;try{let i=r.readCalleesForFile.all(e,t,a,s),o=r.readLegacyCalleesForFile.all(e,t,a);return j([...o,...i])}catch(i){return d(n,"semantic_callees bulk read",i),new Map}}function Xe(n,e,t){let a=l(n);if(!a)return new Map;try{let r=a.readReferencesForFile.all(e,t,s),i=a.readLegacyReferencesForFile.all(e,t);return j([...i,...r])}catch(r){return d(n,"semantic_references bulk read",r),new Map}}function j(n){let e=new Map;for(let t of n)e.set(t.symbol,t.payload);return e}function Ye(n,e){if(e.length===0)return;let t=l(n);if(t)try{t.evidence.transaction(()=>{let a=new Set;for(let r of e){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),t.dropStaleCallees.run(r.relativePath,r.contentHash)),t.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,s,r.payload)}})()}catch(a){d(n,"semantic_callees write",a)}}function Be(n,e){if(e.length===0)return;let t=l(n);if(t)try{t.evidence.transaction(()=>{let a=new Set;for(let r of e){let i=`${r.relativePath}\0${r.projectFingerprint}`;a.has(i)||(a.add(i),t.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),t.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,s,r.payload)}})()}catch(a){d(n,"semantic_references write",a)}}import{appendFileSync as pe,mkdirSync as ue}from"fs";import{createHash as Ee,randomUUID as fe}from"crypto";import{dirname as he}from"path";import{performance as v}from"perf_hooks";var Y="SCIP_QUERY_PROFILE",B="SCIP_QUERY_PROFILE_OUT",$="SCIP_QUERY_PROFILE_COMMAND",G="SCIP_QUERY_PROFILE_CACHE_STATE",R="SCIP_QUERY_PROFILE_RUN_ID",b="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",L="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",Q=[Y,B,$,G,R,b,L],qe=new Set(Q),H=new Set,W=new Map,X=!1;function g(){let n=process.env[Y];return n==="1"||n==="true"}function ve(){return process.env[B]}function z(){return process.env[$]}function ge(){return process.env[G]}function J(){let n=process.env[R];if(n)return n;if(!g())return;let e=fe();return process.env[R]=e,e}function q(){return process.env[b]}function _e(n){let e=q();if(e)return e;if(!g())return;let t=J();if(!t)return;let a=n.projectFingerprint?"published-project":"run-only",r=Z(["profile-workload-v1",n.toolVersion,n.command,n.projectFingerprint??t]);return process.env[b]=r,process.env[L]=a,r}function Z(n){return Ee("sha256").update(JSON.stringify(n)).digest("hex").slice(0,24)}function Ze(){return Object.fromEntries(Q.flatMap(n=>{let e=process.env[n];return e===void 0?[]:[[n,e]]}))}function et(n,e,t){if(!g())return e();let a=v.now();try{let r=e();return N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!0,...T(t)??{}}),r}catch(r){throw N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!1,error:r instanceof Error?r.message:String(r),...T(t)??{}}),r}}async function tt(n,e,t){if(!g())return e();let a=v.now();try{let r=await e();return N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!0,...T(t)??{}}),r}catch(r){throw N({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!1,error:r instanceof Error?r.message:String(r),...T(t)??{}}),r}}function N(n,e=ve()){let t=ye(n),a={timestamp:new Date().toISOString(),pid:process.pid,runId:J(),command:z(),cacheState:ge(),...t,...n},r=`${JSON.stringify(a)}
78
+ `;if(e)try{let i=he(e);H.has(i)||(ue(i,{recursive:!0}),H.add(i)),pe(e,r);return}catch(i){X||(X=!0,process.stderr.write(`[profile] failed to write ${e}: ${i instanceof Error?i.message:String(i)}
79
+ `));return}g()&&process.stderr.write(r)}function ye(n){let e=q()??_e({command:z()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!e)return{};let t=process.env[L],a=typeof n.name=="string"?n.name:void 0;if(!a)return{workloadIdentity:e,workloadIdentityKind:t};let r=a.split(/[.:]/,1)[0]??a,i=`${e}\0${a}`,o=W.get(i);return o||(o=Z(["profile-subsystem-v1",e,a]),W.set(i,o)),{workloadIdentity:e,workloadIdentityKind:t,subsystem:r,subsystemWorkIdentity:o}}function T(n){return typeof n=="function"?n():n}export{y as a,me as b,C as c,Ne as d,Te as e,te as f,ie as g,K as h,Pe as i,xe as j,Me as k,ke as l,Ve as m,Ke as n,Ue as o,je as p,He as q,We as r,Xe as s,Ye as t,Be as u,g as v,Z as w,Ze as x,et as y,tt as z,N as A};
80
+ //# sourceMappingURL=chunk-JWTGMPIT.js.map
@@ -1,5 +1,5 @@
1
- import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-ISWFRGJ6.js";import{a as G}from"./chunk-SV2LEFVM.js";import{B as T,i as H,p as K,q as L,r as z,t as $,w as X,y as U}from"./chunk-Q7GBK5T7.js";import{ta as F,xa as O,za as S}from"./chunk-GH5YSGZL.js";function I(t,n){let e=et(t,n)??it(t,n)??rt(t,n)??ot(t,n);return st(t,e,n)}function et(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=N(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(N(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function N(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function it(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function rt(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(E(o)!==null)break;if(P(o)!==null)return null;e-=1}if(e<0)return null;let i=E(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=E(o);if(s!==null){if(s<=i)break;r+=1;continue}if(P(o)!==null)break;r+=1}return{start:e,end:r}}function E(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function ot(t,n){let e=t[n]??"";if(W(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&V(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&V(t[r]??"");)r+=1;return{start:i,end:r}}function V(t){return P(t)===null}function P(t){return t.trim().length===0?"blank":W(t)?"heading":N(t)?"fence":w(t)?"table":E(t)!==null?"list":null}function W(t){return/^#{1,6}\s+/.test(t.trim())}function st(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
1
+ import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-6HFCYNYE.js";import{a as G}from"./chunk-SV2LEFVM.js";import{a as K,b as L,c as X,e as U,h as T}from"./chunk-FESCRNVV.js";import{i as H,v as z,y as $}from"./chunk-JWTGMPIT.js";import{Aa as O,Ca as S,wa as F}from"./chunk-N5B2NILC.js";function I(t,n){let e=et(t,n)??it(t,n)??rt(t,n)??ot(t,n);return st(t,e,n)}function et(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=N(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(N(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function N(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function it(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function rt(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(E(o)!==null)break;if(P(o)!==null)return null;e-=1}if(e<0)return null;let i=E(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=E(o);if(s!==null){if(s<=i)break;r+=1;continue}if(P(o)!==null)break;r+=1}return{start:e,end:r}}function E(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function ot(t,n){let e=t[n]??"";if(W(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&V(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&V(t[r]??"");)r+=1;return{start:i,end:r}}function V(t){return P(t)===null}function P(t){return t.trim().length===0?"blank":W(t)?"heading":N(t)?"fence":w(t)?"table":E(t)!==null?"list":null}function W(t){return/^#{1,6}\s+/.test(t.trim())}function st(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
2
2
  `).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function A(t,n){return n.filter(e=>t.includes(e))}var ct=/<!--\s*scip-query:\s*snapshot\s*-->/i;function Z(t,n){if((t.config.docs?.snapshotPaths??[]).some(r=>G(r,n)))return!0;let i=T(t,n);return i.length>0&&ct.test(i)}var J={classifyCitation:lt,citationContexts:dt,citationKindLabel:ft,citationRemediation:gt,referenceTargets:ht,hasLineAnchoredCitation:at};function at(t){return t.some(n=>(n.lineReferences?.length??0)>0)}function lt(t){let n=t.join(`
3
3
  `).toLowerCase(),e=[],i=A(n,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(i.length>0)return e.push(`configuration/example terms near citation: ${i.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:e};let r=A(n,["accepted","intentional","intentionally","retained","historical"]);if(r.length>0)return e.push(`intentional-record terms near citation: ${r.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:e};let o=A(n,["command","cli","usage","example","run","workflow"]);return o.length>0?(e.push(`guide/reference terms near citation: ${o.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:e}):(e.push(t.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:e})}function dt(t,n,e){let i=T(t,n);if(!i&&!S(t.config.projectRoot,n))return[];let r=i.split(/\r?\n/),o=e.flatMap(ut),s=[];for(let c=0;c<r.length;c+=1){let a=r[c]??"";o.some(d=>a.includes(d))&&s.push(I(r,c))}return s}function ut(t){let n=t.split("/");return[t,`./${t}`,n.slice(-3).join("/"),n.slice(-2).join("/")].filter((e,i,r)=>e.length>0&&r.indexOf(e)===i)}function ft(t){switch(t){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function gt(t,n){switch(t){case"behavioral-claim":return`Re-read ${n} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${n} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${n} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${n} is still meant to name this file.`}}function ht(t,n,e){let i=q(e),r=new Set;for(let o of n)pt(t,o,i.get(o)??[])&&r.add(o);return r}function pt(t,n,e){if(!mt.test(n)||!S(t.config.projectRoot,n))return!0;if(e.length===0)return!1;let i=O(t.config.projectRoot,n,{inputKind:"changed source file"}).split(/\r?\n/),r=yt(i);for(let o of e)for(let s=o.startLine;s<=o.endLine;s+=1)if((i[s]??"").trim()!==""&&!r.has(s))return!0;return!1}var mt=/\.(?:[cm]?[jt]sx?)$/i;function yt(t){let n=new Set,e=!1;for(let i=0;i<t.length;i+=1){let r=t[i].trim();!e&&Ct(r)&&(e=!0),e&&(n.add(i),r.endsWith(";")&&(e=!1))}return n}function Ct(t){return/^import(?:\s|$)/.test(t)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(t)}var Q=X({kind:"doc-path-evidence",invalidation:U("doc-path-evidence"),serialize:jt,deserialize:Lt}),v=/\.(?:md|mdx|rst|txt)$/i;function Dt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var bt=3,St=/([A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6})(?::([1-9][0-9]*))?\b/g;function en(t,n={}){let{doc:e,limit:i=20,minCoupling:r=bt,includeSnapshotExcluded:o=!1}=n,s=At(t,n.historyMode??"bounded");if(!s)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let a of s.docFiles){if(e!==void 0&&!a.includes(e)||e===void 0&&!Y(t,a)||e!==void 0&&!S(t.config.projectRoot,a))continue;let d=Z(t,a);if(d&&!o)continue;let{value:m,estimated:y}=xt(t,a,s.changeTimes.get(a)),g=Rt(t,a),u=new Map,{resolved:l,broken:h,citations:b}=wt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),x=new Map(b.map(f=>[f.file,f]));for(let f of l){if(f===a||v.test(f))continue;let C=(s.changeTimes.get(f)??[]).filter(D=>D>m).length;if(C===0)continue;let p=x.get(f);u.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...B("reference",g,p?.contexts),citationContexts:p?.contexts,citedLines:p?.lineReferences})}for(let[f,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(f))continue;let p=(s.changeTimes.get(f)??[]).filter(M=>M>m).length;if(p===0)continue;let D=u.get(f);D?(D.evidence="both",D.coChanges=C,Object.assign(D,B("both",g,D.citationContexts))):u.set(f,{file:f,evidence:"co-change",coChanges:C,changesSinceDocUpdate:p,...B("co-change",g)})}if(u.size===0&&h.length===0)continue;let R=[...u.values()].sort((f,C)=>C.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:m,staleness:R.reduce((f,C)=>f+C.changesSinceDocUpdate,0)+h.length*10,subjects:R.slice(0,8),brokenReferences:h,...d?{snapshotExcluded:!0}:{},...y?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,d)=>d.staleness-a.staleness),{available:!0,commitsAnalyzed:s.historyCommitCount,docsScanned:s.docFiles.length,findings:c.slice(0,i)}}function xt(t,n,e){if(e&&e.length>0)return{value:Math.max(...e),estimated:!1};try{return{value:Math.floor(F(t.config.projectRoot,n).mtimeMs/1e3),estimated:!0}}catch(i){if(S(t.config.projectRoot,n))throw i;return{value:0,estimated:!1}}}function Rt(t,n){let e=T(t,n).slice(0,6e3);if(!e)return{docIntent:"unknown",reasons:["doc text unavailable"]};let i=`${n}
4
4
  ${e}`.toLowerCase(),r=A(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=A(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function B(t,n,e=[]){let i=t==="co-change"||e.length===0?null:J.classifyCitation(e);return{actionTier:Tt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function Tt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function At(t,n){let e=_(t,{historyMode:n}),i=e.commitHistory();if(!i)return null;let r=e.trackedFiles()??new Set,o=new Map,s=new Map,c=new Set;for(let a of i.commits){let d=[...new Set(a.files)],m=d.filter(g=>v.test(g)),y=d.filter(g=>!v.test(g));for(let g of d){c.add(g);let u=o.get(g)??[];u.push(a.timestamp),o.set(g,u)}for(let g of m){let u=s.get(g);u||(u=new Map,s.set(g,u));for(let l of y)u.set(l,(u.get(l)??0)+1)}}return{changeTimes:o,coupling:s,docFiles:[...r].filter(a=>v.test(a)),everSeenInHistory:c,historyCommitCount:i.commits.length,tracked:r,trackedBySuffix:tt(r)}}function rn(t,n){if(n.size===0)return[];let e=z(),i=0,r=0,o=0,s=0,c=0,a=0;return $("doc-reference.docs-citing-files",()=>{let d=_(t).trackedFiles()??new Set;i=d.size;let m=tt(d),y=Mt(n,m),g=[];for(let u of d){if(!Y(t,u))continue;e&&(r+=1);let l=T(t,u);if(!l&&!S(t.config.projectRoot,u)){e&&(o+=1);continue}if(!It(l,y)){e&&(s+=1);continue}let h=nt(t,u,l);if(!h)continue;e&&(c+=1);let b=vt(h.candidates,n,y,d,m);if(b.size===0)continue;let x=[...new Set([...b.values()].flatMap(p=>[...p]))],R=Et(h.contextsByCandidate,x),f=[...b].map(([p,D])=>({file:p,contexts:k([...D].flatMap(M=>R.get(M)??[])).slice(0,3),lineReferences:j([...D].flatMap(M=>h.lineReferencesByCandidate.get(M)??[]))})).filter(p=>p.contexts.length>0),C=[...b.keys()];if(C.length>0){e&&(a+=1);let p=C.sort();g.push({doc:u,cited:p,citations:f,citedClaims:k(f.flatMap(D=>D.contexts)).slice(0,3)})}}return g},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function Y(t,n){return v.test(n)&&!Dt(n)&&S(t.config.projectRoot,n)}function tt(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function Mt(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function vt(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(n.has(s))c=s;else if(i.has(s))c=s;else{let d=r.get(s);d?.length===1&&(c=d[0])}if(!c||!n.has(c))continue;let a=o.get(c)??new Set;a.add(s),o.set(c,a)}return o}function wt(t,n,e,i,r){let o=new Set,s=new Set,c=nt(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let a=c.candidates,d=c.contextsByCandidate,m=c.lineReferencesByCandidate,y=new Map,g=new Map,u=(l,h)=>{let b=d.get(h);if(b&&b.length>0){let R=y.get(l)??[];R.push(...b),y.set(l,k(R).slice(0,3))}let x=m.get(h);x&&x.length>0&&g.set(l,j([...g.get(l)??[],...x]))};for(let l of a){if(e.has(l)){o.add(l),u(l,l);continue}let h=i.get(l);if(h&&h.length===1){o.add(h[0]),u(h[0],l);continue}h&&h.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...y].map(([l,h])=>({file:l,contexts:h,lineReferences:g.get(l)}))}}function Et(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function nt(t,n,e){let i=e;if(i===void 0&&(i=T(t,n),!i&&!S(t.config.projectRoot,n)))return null;let r=H(t,n,i),o=Q.read(t,n,r);if(o)return o;let s=kt(i);return Q.write(t,n,r,s),s}function It(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function kt(t){let n=t.split(/\r?\n/),e=new Set,i=new Map,r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o]??"";for(let c of s.matchAll(St)){let a=(c[1]??"").replace(/^\.?\//,"");if(a.length===0)continue;e.add(a);let d=c[2]?Number(c[2]):null;d!==null&&Number.isSafeInteger(d)&&r.set(a,j([...r.get(a)??[],d]));let m=I(n,o);if(m.length===0)continue;let y=i.get(a)??[];y.push(m),i.set(a,k(y).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i,lineReferencesByCandidate:r}}function jt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()],lineReferencesByCandidate:[...t.lineReferencesByCandidate.entries()]};return JSON.stringify(n)}function Lt(t){try{let n=JSON.parse(t);if(!K(n))return null;let e=L(n.candidates),i=Nt(n.contextsByCandidate),r=_t(n.lineReferencesByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i),lineReferencesByCandidate:new Map(r??[])}}catch{return null}}function _t(t){if(t===void 0)return[];if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||!Array.isArray(e[1]))return null;let i=[];for(let r of e[1]){if(typeof r!="number"||!Number.isSafeInteger(r))return null;i.push(r)}n.push([e[0],j(i)])}return n}function Nt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=L(e[1]);if(!i)return null;n.push([e[0],i])}return n}function k(t){let n=[];for(let e of new Set(t))n.some(i=>Pt(i,e))||n.push(e);return n}function j(t){return[...new Set(t)].sort((n,e)=>n-e)}function Pt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{Dt as a,en as b,rn as c};
5
- //# sourceMappingURL=chunk-5ZMBRQFC.js.map
5
+ //# sourceMappingURL=chunk-JYR66JN5.js.map
@@ -0,0 +1,2 @@
1
+ import{a as h}from"./chunk-IICPE7B2.js";import{c as y,d as x}from"./chunk-TY7CRN3Z.js";import{z as b}from"./chunk-IZDPJ2QI.js";import{a as S}from"./chunk-MWN53KRN.js";import{y as g}from"./chunk-KYSDI3GE.js";import{h as m}from"./chunk-7F45LJKI.js";import{existsSync as E,statSync as V}from"fs";import{join as j}from"path";import{existsSync as w,readdirSync as D}from"fs";import{createHash as O}from"crypto";import{join as f}from"path";function l(t){let r=0,e=0,n=0,o=0,i=0,a=[];for(let s of t)switch(s.state){case"legacy":r+=1;break;case"current":e+=1;break;case"unsupported-older":n+=1,a.push(u(s));break;case"unsupported-future":o+=1,a.push(u(s));break;case"malformed":i+=1,a.push(u(s));break}let c=r+e,p=n+o+i;return{complete:p===0,total:t.length,accepted:c,legacy:r,current:e,unsupportedOlder:n,unsupportedFuture:o,malformed:i,omitted:p,issues:a}}function u(t){if(t.state==="legacy"||t.state==="current")throw new Error(`accepted record ${t.path} cannot become a compatibility issue`);return{path:t.path,state:t.state,reason:t.reason??t.state}}var F=f(".scipquery","suppressions"),C="scip-query-suppression",P=1,d=2;function v(t){return f(t,F)}function _(t){if(t.id&&t.id.trim()!=="")return`${t.id.trim()}.json`;let r=`${t.check??""}\0${t.file??""}`;return`CHECK-${O("sha256").update(r).digest("hex").slice(0,12).toUpperCase()}.json`}function A(t){return _(t).slice(0,-5)}function $(t,r){if(typeof t!="object"||t===null||Array.isArray(t))return{state:"malformed",error:"not a suppression object"};let e=t;if(e.schemaVersion===void 0&&(e.kind!==void 0||e.suppressionIdentity!==void 0||e.writer!==void 0))return{state:"malformed",error:"suppression envelope metadata requires schemaVersion"};if(e.schemaVersion!==void 0){if(!Number.isSafeInteger(e.schemaVersion))return{state:"malformed",error:"schemaVersion must be a positive safe integer"};if(e.schemaVersion!==P&&e.schemaVersion!==d)return{state:e.schemaVersion>d?"unsupported-future":"unsupported-older",error:`unsupported schemaVersion ${String(e.schemaVersion)}`};if(e.kind!==void 0&&e.kind!==C)return{state:"malformed",error:`kind must be ${C}`}}if(e.schemaVersion===P&&e.decision!==void 0)return{state:"malformed",error:"schemaVersion 1 cannot carry automated adjudication metadata"};if(e.schemaVersion===d&&!y(e.decision))return{state:"malformed",error:"schemaVersion 2 requires a valid automated adjudication decision"};if(typeof e.reason!="string"||e.reason.trim()==="")return{state:"malformed",error:"missing reason"};if(!e.id&&!e.check)return{state:"malformed",error:"needs an id or a check"};let n=N(e);if(e.schemaVersion===void 0)return{state:"legacy",suppression:n,record:e,schemaVersion:0};let o=A(n);return e.suppressionIdentity!==o||r!==void 0&&e.suppressionIdentity!==r?{state:"malformed",error:"suppressionIdentity does not match the suppression target or filename"}:!e.writer||e.writer.tool!=="scip-query"||typeof e.writer.version!="string"||e.writer.version.trim()===""?{state:"malformed",error:"missing valid writer metadata"}:typeof e.createdAt!="string"||!Number.isFinite(Date.parse(e.createdAt))?{state:"malformed",error:"missing valid createdAt timestamp"}:e.updatedAt!==void 0&&(typeof e.updatedAt!="string"||!Number.isFinite(Date.parse(e.updatedAt)))?{state:"malformed",error:"invalid updatedAt timestamp"}:{state:e.schemaVersion===d?"current":"legacy",suppression:n,record:e,schemaVersion:e.schemaVersion}}function R(t){let r=v(t);if(!w(r))return{suppressions:[],compatibility:l([]),warnings:[]};let e=[],n=[];for(let i of D(r).sort()){if(!i.endsWith(".json"))continue;let a=f(r,i),c=`${F}/${i}`,p;try{p=JSON.parse(m(a,"suppression record"))}catch{n.push({path:c,state:"malformed",reason:"malformed JSON"});continue}let s=$(p,i.slice(0,-5));if("error"in s){n.push({path:c,state:s.state,reason:s.error});continue}n.push({path:c,state:s.state}),e.push(s.suppression)}let o=l(n);return{suppressions:e,compatibility:o,warnings:o.issues.map(i=>`${i.path}: ${i.reason} \u2014 ignored`)}}function N(t){return{...typeof t.id=="string"?{id:t.id}:{},...typeof t.check=="string"?{check:t.check}:{},...typeof t.file=="string"?{file:t.file}:{},reason:t.reason,...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.createdAt=="string"?{createdAt:t.createdAt}:{},...t.decision?{decision:t.decision}:{}}}function W(){return process.env.SCIP_QUERY_PROJECT_ROOT??process.cwd()}var I;function L(t=W(),r=void 0){if(r===void 0&&I?.projectRoot===t)return I;let e=x(t),n=g(t,e),o=process.env.SCIP_QUERY_INDEX_DB;if(o)return{projectRoot:t,config:e,paths:n,dbPath:o,dbPathSource:"env",gitContext:r};if(E(n.dbPath))return{projectRoot:t,config:e,paths:n,dbPath:n.dbPath,dbPathSource:"configured",gitContext:r};let i=j(t,"index.db");return{projectRoot:t,config:e,paths:n,dbPath:i,dbPathSource:"root-fallback",rootFallbackWarning:G(i,n.dbPath),gitContext:r}}function oe(t,r={}){let{config:e,paths:n,dbPath:o,dbPathSource:i,rootFallbackWarning:a,gitContext:c}=L(t);if(!E(o))throw new Error("No index.db found. Run: scip-query reindex");r.warnOnRootFallback&&i==="root-fallback"&&a&&console.error(a);let p=R(t).suppressions,s={dbPath:o,indexPath:process.env.SCIP_QUERY_INDEX_SCIP??n.indexPath,projectRoot:t,collaborationDomainId:e.collaborationDomainId,sharedEvidenceDbPath:b(t,e,c),entryRoots:e.entryRoots,semantic:e.semantic,suppressions:[...e.suppressions??[],...p],declaredCouplings:e.declaredCouplings,locality:e.locality,architecture:e.architecture,coverageContracts:e.coverageContracts,docs:e.docs},k=S(t);return new h(s,k)}function G(t,r){let e="unknown time";try{e=V(t).mtime.toISOString()}catch{}return`warning: using legacy project-root index.db (${t}, modified ${e}) because the configured index was not found at ${r}. This fallback may be stale; run 'scip-query reindex' to refresh the configured index.`}export{oe as a};
2
+ //# sourceMappingURL=chunk-KLFEXGQA.js.map
@@ -0,0 +1,5 @@
1
+ import{f as Ue,h as V,k as qe,m as Y,n as X,o as fe}from"./chunk-7F45LJKI.js";import{isAbsolute as Je,relative as rn}from"path";var g=class extends Error{constructor(n,r){super(`refusing unsafe project file path ${JSON.stringify(n)} (${r})`);this.relativePath=n;this.reason=r;this.name="UnsafeProjectPathError"}relativePath;reason;code="SCIP_QUERY_UNSAFE_PROJECT_PATH"};function de(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function li(e){return e.replace(/\\/g,"/")}function pi(e,t){return de(e)===de(t)}function j(e,t){let n=rn(e,t);return n===""||!n.startsWith("..")&&!Je(n)}function I(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=de(e);if(t.split("/").some(r=>r===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}import{createHash as Ze,randomUUID as dn}from"crypto";import{chmodSync as et,existsSync as _,linkSync as gn,lstatSync as te,readdirSync as he,realpathSync as C,unlinkSync as hn,writeSync as mn}from"fs";import{homedir as yn}from"os";import{basename as Sn,dirname as ne,isAbsolute as Xe,join as y,resolve as re}from"path";import{closeSync as on,existsSync as sn,fsyncSync as cn,mkdirSync as an,openSync as un}from"fs";import{dirname as Ke}from"path";var M=Object.freeze({platform:process.platform,pathExists:e=>sn(e),makeDirectory:e=>an(e,{recursive:!0}),openFile:(e,t,n)=>un(e,t,n),syncFile:e=>cn(e),closeFile:e=>on(e)});function Ve(e,t=M){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=Ke(r);if(o===r)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);r=o}let i="synced";for(let o of n.reverse())t.makeDirectory(o),i=Z(i,Q(Ke(o),t));return i}function Q(e,t=M){let n;try{n=t.openFile(e,"r")}catch(r){if(fe(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(fe(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function Z(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as ln}from"module";var pn=ln(import.meta.url),Ye=fn().version;function fn(){for(let e of["../package.json","../../package.json"])try{return pn(e)}catch{}return{version:"0.0.0"}}var tt=1,W=".scip-query-cache-owner.json",jn=16*1024,nt=Object.freeze({...M,randomToken:()=>dn(),linkFile:(e,t)=>gn(e,t),removeFile:e=>hn(e),writeFile:(e,t,n,r)=>mn(e,t,n,r)});function ee(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"SCIP_QUERY_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function F(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"SCIP_QUERY_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function bn(e,t){let n=C(e);return xn(n,me(n,t))}function me(e,t){let n=C(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?re(r):t?.dbPath?Fn(n,t.dbPath):Pn(n)}function rt(){let e=process.env.XDG_CACHE_HOME;return y(e||y(yn(),".cache"),"scip-query")}function Pn(e){let t=re(e);try{t=C(t)}catch{}let n=Ze("sha256").update(t).digest("hex").slice(0,12);return y(rt(),"projects",n)}function Ei(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(rt(),"repositories",e);return st(t),C(t)}function vi(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function Ri(e,t){let n=bn(e,t);return{cacheDir:n,dbPath:y(n,"index.db"),indexPath:y(n,"index.scip"),metaPath:y(n,"meta.json")}}function xn(e,t,n=nt){return Cn(e,t,n).cacheDir}function Cn(e,t,n=nt){let r=C(e),i=_(t)?"synced":st(t,n),o=C(t),s=y(o,W);if(_(s))return ge(r,o),ye(s),z(o),{kind:"existing",cacheDir:o};Qe(o),vn(o),Qe(o);let a=`${JSON.stringify({schemaVersion:tt,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:Ye},null,2)}
2
+ `;try{let u=Rn(s,a,n),p=Z(i,u);return{kind:"published",cacheDir:o,achievedDurability:p==="synced"?"directory-durable":"file-flushed",directorySync:p}}catch(u){if(On(u))return ge(r,o),{kind:"existing",cacheDir:o};throw u}}function ge(e,t){let n=C(e),r=C(t);return kn(r,n,r)}function Ti(e,t){return _(y(t,W))?(ge(e,t),it(t),!0):!1}function Fn(e,t){let n;try{n=I(t)}catch(s){throw s instanceof g?ee(t,s.reason):s}let r=re(e,...n.split("/"));if(r===e||!j(e,r))throw ee(t,"outside-project");let i=wn(r),o=C(i);if(!j(e,o)&&o!==e)throw ee(t,"symlink-escape");return r}function wn(e){let t=e;for(;!_(t);){let n=ne(t);if(n===t)throw ee(e,"no-existing-ancestor");t=n}return t}function kn(e,t,n){let r=y(e,W);if(!_(r)||te(r).isSymbolicLink())throw F(e,"missing regular ownership record");let i=te(r);if(!i.isFile()||i.size>jn)throw F(e,"invalid ownership record file");let o=V(r,"cache ownership record"),s=In(o,e);if(t!==void 0&&s.canonicalProjectRoot!==t)throw F(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==n)throw F(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Ze("sha256").update(o).digest("hex"),physicalCacheDir:e}}function In(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==tt||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!Xe(n.canonicalProjectRoot)||!Xe(n.canonicalCacheDir))throw new Error("invalid fields");return n}catch(n){throw F(t,`malformed ownership record: ${n instanceof Error?n.message:String(n)}`)}}function Qe(e){let t=he(e).filter(n=>n!==W&&!En(n));if(t.length>0)throw F(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function En(e){return e.startsWith(`${W}.tmp-`)||e.startsWith("git-worktree-context.json.tmp-")||[".scipquery-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","git-worktree-context.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","typescript-shard-costs.json","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function vn(e){for(let t of he(e)){let n=y(e,t);try{let r=te(n);if(r.isSymbolicLink())throw F(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())z(n);else if(r.isFile())ye(n);else throw F(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(ot(r))continue;throw r}}z(e)}function it(e,t=!1){try{let n=te(e);if(n.isSymbolicLink())throw F(e,"managed cache tree contains a symlink");if(n.isFile()){ye(e);return}if(!n.isDirectory())throw F(e,"managed cache tree contains a special file");z(e);for(let r of he(e))it(y(e,r),!0)}catch(n){if(t&&ot(n))return;throw n}}function ot(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function st(e,t=M){let n=Ve(e,t);return z(e),n}function Rn(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,X(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=Q(ne(e),n);return n.removeFile(r),o=!1,Z(s,Q(ne(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function z(e){process.platform!=="win32"&&et(e,448)}function ye(e){process.platform!=="win32"&&et(e,384)}function Tn(e){if(_(e))return C(e);let t=C(ne(e));return y(t,Sn(e))}function Oi(e){return Tn(re(e))}function On(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as _n}from"child_process";import{createHash as Ln}from"crypto";import{existsSync as Nn,lstatSync as Gn,realpathSync as An}from"fs";import{dirname as Bn,isAbsolute as Mn,join as zn,relative as Bi,resolve as oe,sep as Mi}from"path";var ct=Symbol.for("scip-query.project-file-listing-context.v1"),at=globalThis,Se=at[ct],E=Se&&typeof Se=="object"?Se:{};at[ct]=E;function ut(e,t){let n=E.active?E.canonicalProjectRoots:void 0,r=n?.get(e);if(r!==void 0)return r;let i=t();return n?.set(e,i),i}function lt(){return E.sequence??0}function pt(e,t,n){let r=E.active,i=r?.get(e);if(i&&i.pathBytes<=t)return i;let o=Dn(n(),(E.sequence??0)+1);if(E.sequence=o.sequence,o.pathBytes>t)throw new RangeError(`Git project file listing exceeded ${t} path bytes.`);return r?.set(e,o),o}function ft(e,t){let n=E.active?.get(e);return n&&n.sequence>t?n.indexAllowsTreeFingerprintReuse:void 0}function*dt(e){let t=0;for(;t<e.taggedOutput.length;){let n=e.taggedOutput.indexOf("\0",t);if(n<0)return;yield e.taggedOutput.slice(t+2,n),t=n+1}}function Dn(e,t){let n=0,r=0,i=!0;for(;n<e.length;){let o=e.indexOf("\0",n);if(o<0||o<=n+2||e[n+1]!==" ")throw new Error("Git returned a malformed tagged project file listing.");let s=e[n];i&&=s==="H"||s==="?",r+=1,n=o+1}return{taggedOutput:e,pathBytes:Buffer.byteLength(e,"utf8")-r*2,indexAllowsTreeFingerprintReuse:i,sequence:t}}var v={run(e,t){let n=ht(e,t);return n.kind==="success"?n.output:void 0},runResult:ht},Wn=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],Pe=["status","--porcelain=v2","--branch","-z","--untracked-files=all"],je=/^[0-9a-f]{40,64}$/;function Wi(e,t=v){return Hn(e,t)?.context}function Hn(e,t=v){let n=t.runResult(e,Wn);if(n.kind==="success"){let i=$n(n.output);if(i){let o=Un(i,t);if(o)return gt(o)}}let r=qn(e,t);return r?gt(r):void 0}function Hi(e,t=v){if(!e.headCommit)return;let n=t.run(e.projectRoot,Pe);if(n===void 0)return;let r=xe(n);if(!(!r?.headCommit||r.headCommit!==e.headCommit))return{...e,clean:r.clean}}function $i(e,t=v,n={}){let r=t===v&&n.cachedInventoryAfterSequence!==void 0?ft(e,n.cachedInventoryAfterSequence):void 0;if(r!==void 0)return r;let i=t.run(e,["ls-files","-v","-z"]);return i===void 0?!1:i.split("\0").filter(Boolean).every(o=>o.startsWith("H "))}function gt(e){return{context:e,projectFileInventorySequence:lt()}}function xe(e){let t=e.split("\0").filter(Boolean),n=t.find(i=>i.startsWith("# branch.oid "))?.slice(13),r=n==="(initial)"?void 0:n;if(!(r!==void 0&&!je.test(r))&&n!==void 0)return{headCommit:r,clean:t.every(i=>i.startsWith("# "))}}function $n(e){let t=e.split(`
3
+ `).map(a=>a.trim());if(t.length!==5)return;let[n,r,i,o,s]=t;if(!n||!r||!i||!o||!s||!je.test(o)||!je.test(s))return;let c=w(n);return{root:c,gitDir:w(ie(c,r)),commonDir:w(ie(c,i)),headCommit:o,treeOid:s}}function Un(e,t){let n=t.run(e.root,Pe);if(n===void 0)return;let r=xe(n);return r?.headCommit!==e.headCommit?void 0:{...mt(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Ce("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.clean}}function qn(e,t){let n=Jn(e,t);if(n.kind!=="worktree")return;let r=n.identity,i=r.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=w(ie(i,o)),c=be(t.run(i,["rev-parse","--verify","HEAD"])),a=be(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,Pe);if(u===void 0)return;let p=xe(u);if(!(!p||p.headCommit!==c))return{...r,commonDir:s,repositoryId:Ce("repository",s),headCommit:c,treeOid:a,clean:p.clean}}function Jn(e,t=v){let n=t.runResult(e,["rev-parse","--show-toplevel"]);if(n.kind==="not-repository")return{kind:"non-git"};if(n.kind==="error")return n;let r=n.output.trim();if(!r)return{kind:"error",message:"Git returned an empty worktree root."};let i=w(r),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=w(ie(i,o));return{kind:"worktree",identity:mt(i,s)}}function mt(e,t){return{projectRoot:e,gitDir:t,worktreeId:Ce("worktree",`${e}\0${t}`)}}function Ui(e,t=v){let n=t.run(e,["worktree","list","--porcelain","-z"]);return n===void 0?[]:Kn(n)}function Kn(e){let t=[],n;for(let r of e.split("\0")){if(r===""){n&&t.push(n),n=void 0;continue}let i=r.indexOf(" "),o=i<0?r:r.slice(0,i),s=i<0?"":r.slice(i+1);if(o==="worktree"){n&&t.push(n),n={path:w(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}n&&(o==="HEAD"?n.head=s:o==="branch"?n.branch=s:o==="detached"?n.detached=!0:o==="bare"?n.bare=!0:o==="prunable"?n.prunable=!0:o==="locked"&&(n.locked=!0))}return n&&t.push(n),t}function qi(e,t,n=v){return be(n.run(e,t))}function ie(e,t){return Mn(t)?t:oe(e,t)}function w(e){try{return An(e)}catch{return oe(e)}}function Ce(e,t){return Ln("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function be(e){return e?.trim()||void 0}function ht(e,t){let n=_n("git",["-C",e,...t],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],timeout:3e4,killSignal:"SIGKILL"});if(n.status===0)return{kind:"success",output:n.stdout.trimEnd()};let i=(typeof n.stderr=="string"?n.stderr.trim():"")||n.error?.message||`git exited with status ${n.status??"unknown"}`,o=n.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&Nn(oe(e)))&&!Vn(e)?{kind:"not-repository"}:{kind:"error",message:i}}function Vn(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=oe(e);for(;;){try{return Gn(zn(t,".git")),!0}catch(r){let i=r.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let n=Bn(t);if(n===t)return!1;t=n}}import{execFileSync as Gr}from"child_process";import{isUtf8 as Yt}from"buffer";import{createHash as Ge}from"crypto";import{closeSync as Zt,fstatSync as $,lstatSync as Be,openSync as en,readdirSync as Ar,readFileSync as Br,readSync as Xt,readlinkSync as Mr,realpathSync as q}from"fs";import{isAbsolute as zr,join as Me,relative as Wr,resolve as Hr,sep as $r}from"path";function ce(e,t,n=[]){let r=Fe(e);if(Ct.has(r)||n.some(o=>se(r,o))||t.some(o=>Ft(r,o)))return"config";if(t.some(kt)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return"ambient";let i=wt(r);return t.some(o=>(It[o]??[]).includes(i))?"source":"other"}function xt(e,t,n){let r=Fe(e);if(Ct.has(r)||n?.some(o=>se(r,o))||Ft(r,t)||kt(t)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return!0;let i=wt(r);return(It[t]??[]).includes(i)}function Ki(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!St(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!St(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(Yn)?null:t}function yt(e){return{...e,files:e.files.map(({semanticHash:t,...n})=>n)}}function Vi(e,t){return!e||!t?e===t:JSON.stringify(yt(e))===JSON.stringify(yt(t))}function Yi(e,t){let n=new Map((e?.files??[]).map(c=>[c.path,c])),r=new Map(t.files.map(c=>[c.path,c])),i=new Set([...n.keys(),...r.keys()]),o=[];for(let c of[...i].sort()){let a=n.get(c),u=r.get(c),p=ce(c,t.languages);!a&&u?o.push({kind:"added",path:c,inputKind:p,after:u}):a&&!u?o.push({kind:"deleted",path:c,inputKind:p,before:a}):a&&u&&(a.hash!==u.hash||a.size!==u.size)&&o.push({kind:"modified",path:c,inputKind:p,before:a,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(jt(e?.files??[])||jt(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Xn)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Qn(e,t):!0,uncertainty:[...s].sort()}}function St(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function jt(e){return new Set(e.map(t=>t.path)).size!==e.length}function Yn(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function Xn(e){return e.hash==="unreadable"||e.size<0}function Qn(e,t){return bt(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&bt(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function bt(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((i,o)=>i===r[o])}var Ct=new Set([".scipquery.json"]),Zn={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},er={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Pt=new Map;function Ft(e,t){return Zn[t].some(n=>se(e,n))||er[t].some(n=>se(e,n))}function se(e,t){let n=Fe(t).replace(/^\.\//,"");if(!n)return!1;let r=e.split("/").at(-1)??e,i=n.includes("/")?e:r;if(!n.includes("*")&&!n.includes("?"))return i===n;let o=Pt.get(n);if(!o){let s=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Pt.set(n,o)}return o.test(i)}function Fe(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function wt(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function kt(e){return e==="typescript"||e==="javascript"}var It={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{AsyncLocalStorage as tr}from"async_hooks";var nr=new tr;function R(e,t){let n=ae(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function T(e,t){let n=ae(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function Et(e,t){return ae(e)?.fingerprints.get(t)}function O(e){return ae(e)?.paths}function ae(e){let t=nr.getStore();if(t)return t.projectRoot===w(e)?t:void 0}import{createRequire as rr}from"module";import{existsSync as ir,lstatSync as vt,readdirSync as or,statSync as sr}from"fs";import f from"path";var cr=rr(import.meta.url),Rt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]),ar=18003;function ue(e,t=[]){let n=f.resolve(e),r=t.flatMap(a=>pr(n,a));if(r.length>0)return Tt(n,Dt(r));let i=lr(n),o=Dt(i),s=fr(n,o)?[n,...o]:o,c=s.length>0?s:[n];return Tt(n,c)}function _t(e){return new Set(e.map(t=>t==="."?"tsconfig.json":`${t.replace(/\/$/u,"")}/tsconfig.json`))}function Lt(e){let t=e.split("/").at(-1)?.toLowerCase();return t?.startsWith("tsconfig")===!0&&t.endsWith(".json")}var ur=/^\.scipquery-compiler-shard-\d+\.tsconfig\.json$/;function co(e){return`.scipquery-compiler-shard-${e}.tsconfig.json`}function Nt(e){return ur.test(e)}function Gt(e,t,n=[]){let r;try{r=cr("@ts-morph/common/dist/typescript.js")}catch{return null}let i=f.resolve(e),o=t==="workspace"?ue(i,n):["."],s=new Set;for(let c of o){let a=c==="."?i:f.join(i,c),u=f.join(a,"tsconfig.json"),p=gr(r,i);if(!p.fileExists(u))return null;let l=r.readConfigFile(u,p.readFile);if(l.error)return null;let d=r.parseJsonConfigFileContent(l.config,p,a);if(d.errors.some(m=>m.code!==ar))return null;for(let m of d.fileNames){let h=f.resolve(m);j(i,h)&&s.add(f.relative(i,h).split(f.sep).join("/"))}}return s}function ao(e,t,n,r){let i=f.resolve(e),o=new Set(r);for(let c of n){let a=f.resolve(i,c);if(j(i,a))try{let u=vt(a);if(u.isSymbolicLink()||u.isFile()&&!o.has(D(i,a)))return!1}catch{}}let s=t==="workspace"?ue(i,n):["."];for(let c of s){let a=c==="."?i:f.join(i,c),u=f.join(a,"tsconfig.json");if(!Bt(i,u))continue;let p=D(i,u);if(!o.has(p))return!1;try{if(vt(u).isSymbolicLink())return!1;let l=Mt(i,u);if(l.includes("extends")||l.includes("\\"))return!1}catch{return!1}}return!0}function Tt(e,t){return[...new Set(t.map(n=>D(e,n)))].sort((n,r)=>n.localeCompare(r))}function lr(e){let t=O(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>Rt.has(s)))return[];let o=f.join(e,...i.split("/"));return Ot(e,o)?[f.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=or(i,{withFileTypes:!0})}catch{continue}for(let s of o){let c=f.join(i,s.name);if(s.isDirectory()){!Rt.has(s.name)&&!s.name.startsWith(".")&&r.push(c);continue}s.isFile()&&Ot(e,c)&&n.push(f.dirname(c))}}return n}function pr(e,t){let n=t.trim();if(!n)return[];let r=f.resolve(e,n);if(!j(e,r))return[];let i=O(e);if(i){let o=D(e,r);if(i.includes(o)&&we(f.basename(r)))return[f.dirname(r)];let s=o==="."?"":`${o}/`;return i.some(c=>c.startsWith(s))?[r]:[]}try{let o=sr(r);if(o.isDirectory())return[r];if(o.isFile()&&we(f.basename(r)))return[f.dirname(r)]}catch{return[]}return[]}function Ot(e,t){if(!we(f.basename(t)))return!1;let n=At(e,t);return n?f.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function we(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Dt(e){let t=[...new Set(e.map(n=>f.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&mr(n,r)))}function fr(e,t){if(t.length===0||t.some(r=>f.resolve(r)===e))return!1;let n=f.join(e,"tsconfig.json");return Bt(e,n)&&dr(e,n)}function dr(e,t){let r=At(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!f.extname(i))):!1}function At(e,t){try{let n=JSON.parse(Mt(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Bt(e,t){let n=D(e,t),r=T(e,n);return r?r==="present":ir(t)}function Mt(e,t){let n=D(e,t);if(O(e)){let i=R(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return V(t,"TypeScript project config")}function gr(e,t){let n=O(t);if(!n)return e.sys;let r=f.resolve(t),i=new Set(n),o=hr(r,n),s=e,c=a=>{let u=f.resolve(a);return j(r,u)?D(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(a){let u=c(a);return u===null?e.sys.fileExists(a):i.has(u)},readFile(a){let u=c(a);return u===null?e.sys.readFile(a):R(r,u)?.content.toString("utf8")},readDirectory(a,u,p,l,d){let m=f.resolve(a);return j(r,m)?s.matchFiles(m,u,p,l,e.sys.useCaseSensitiveFileNames,r,d,h=>o.get(f.resolve(h))??{files:[],directories:[]},h=>h):e.sys.readDirectory(a,u,p,l,d)}}}function hr(e,t){let n=new Map,r=new Map,i=o=>{n.has(o)||n.set(o,new Set),r.has(o)||r.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),c=e;for(let a=0;a<s.length-1;a+=1){let u=s[a];i(c),r.get(c).add(u),c=f.join(c,u),i(c)}n.get(c).add(s.at(-1))}return new Map([...n].map(([o,s])=>[o,{files:[...s].sort(),directories:[...r.get(o)??[]].sort()}]))}function D(e,t){let n=f.relative(e,t);return n?n.split(f.sep).join("/"):"."}function mr(e,t){let n=f.relative(e,t);return!!n&&!n.startsWith("..")&&!f.isAbsolute(n)}import{createHash as Ee}from"crypto";import{execFileSync as zt}from"child_process";import{createRequire as yr}from"module";var Sr=yr(import.meta.url),jr=/\.(?:[cm]?[jt]sx?)$/iu,br=/\.[jt]sx$/iu,Wt=/(?:^|\/)package\.json$/iu,H,ke=new Map;function Ht(e,t){if(!ve(e))return;let n=Pr();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=br.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=Ee("sha256").update(`typescript-semantic-v1\0${i}\0`),c=!1,a=!1;for(;;){let u=o.scan();if(u===n.SyntaxKind.EndOfFileToken)break;if(u===n.SyntaxKind.WhitespaceTrivia)continue;if(u===n.SyntaxKind.NewLineTrivia){c&&(a=!0);continue}a&&s.update("line-break\0");let p=o.getTokenText();s.update(`${u}\0${Buffer.byteLength(p)}\0`).update(p).update("\0"),c=!0,a=!1}return s.digest("hex")}catch{return}}function ve(e){return jr.test(e)}function Re(e,t){if(Wt.test(e))try{let n=JSON.parse(typeof t=="string"?t:t.toString("utf8"));if(typeof n!="object"||n===null||Array.isArray(n))return;let{scripts:r,...i}=n;return Ee("sha256").update("typescript-package-json-v1\0").update(Ie(i)).digest("hex")}catch{return}}function Te(e){return Wt.test(e)}function go(e,t,n){if(!Te(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(ke.has(r))return ke.get(r);let i;try{let o=zt("git",["-C",e,"log","--all","--format=%H","--max-count=64","--",t],{encoding:"utf8",maxBuffer:1048576,timeout:5e3}).split(/\r?\n/u).filter(Boolean);for(let s of o){let c=zt("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(Ee("sha256").update(c).digest("hex")===n){i=Re(t,c);break}}}catch{i=void 0}return ke.set(r,i),i}function Pr(){if(H!==void 0)return H;try{H=Sr("typescript")}catch{H=null}return H}function Ie(e){return Array.isArray(e)?`[${e.map(Ie).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${Ie(n)}`).join(",")}}`:JSON.stringify(e)}import{closeSync as $t,existsSync as De,openSync as xr,realpathSync as Cr,renameSync as Fr,unlinkSync as Ut,writeSync as wr}from"fs";import{dirname as kr,join as Ir}from"path";var Er="fingerprint-stat-cache.json",qt=1,vr=8*1024*1024,Oe=new Map;function _e(e,t,n,r){let i=Jt(e),o=i.files.get(t);if(!(!o||!Kt(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function Le(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=Jt(e),s={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size,...i.semanticHash===void 0?{}:{semanticHash:i.semanticHash}},c=o.files.get(t);c&&Lr(c,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function Ne(e){let t=Oe.get(Vt(e));if(!(!t?.dirty||!t.cachePath))try{let n=kr(t.cachePath);if(!De(n))return;Nr(t.cachePath,Or(t)),t.dirty=!1}catch{}}function Jt(e){let t=Vt(e),n=Oe.get(t);if(n)return n;let r=Rr(t),i=Tr(r),o={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return Oe.set(t,o),o}function Rr(e){try{let t=me(e);return De(t)?Ir(t,Er):null}catch{return null}}function Tr(e){let t=new Map;if(!e||!De(e))return t;try{let n=JSON.parse(Ue(e,{inputKind:"fingerprint stat cache",maxBytes:vr}).toString("utf8"));if(!Dr(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function Or(e){return{version:qt,files:Object.fromEntries(e.files)}}function Dr(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==qt||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(_r)}function _r(e){if(typeof e!="object"||e===null)return!1;let t=e;return(t.kind==="file"||t.kind==="symlink")&&Number.isFinite(t.dev)&&Number.isFinite(t.ino)&&Number.isFinite(t.mtimeMs)&&Number.isFinite(t.ctimeMs)&&Number.isFinite(t.size)&&Number.isFinite(t.fingerprintSize)&&typeof t.hash=="string"&&t.hash!=="unreadable"&&(t.semanticHash===void 0||typeof t.semanticHash=="string")}function Kt(e,t,n){return e.kind===t&&e.dev===n.dev&&e.ino===n.ino&&e.mtimeMs===n.mtimeMs&&e.ctimeMs===n.ctimeMs&&e.size===n.size}function Lr(e,t){return Kt(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function Nr(e,t){let n=`${e}.${process.pid}.tmp`;try{Ut(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
4
+ `,"utf8"),i=xr(n,"wx",384);try{X(i,r,{writeFile:(o,s,c,a)=>wr(o,s,c,a)},"fingerprint stat cache")}catch(o){throw $t(i),Ut(n),o}$t(i),Fr(n,e)}function Vt(e){return Cr(e)}var J=64*1024*1024,Ur=1024*1024,qr=1024,L=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function Jr(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function ze(e,t,n={}){let r=I(t),i=ut(e,()=>q(e)),o=Hr(i,...r.split("/"));if(!j(i,o)||o===i)throw new g(t,"outside-project");let s=q(o);if(!j(i,s)||s===i)throw new g(t,"outside-project");let c=Be(s);if(!c.isFile())throw new g(t,"not-a-file");let a={projectRoot:i,relativePath:r,absolutePath:s,size:c.size,mtimeMs:c.mtimeMs,device:c.dev,inode:c.ino},u=n.maxBytes??J;if(Y(u),a.size>u)throw new L(n.inputKind??"project file",a.relativePath,a.size,u);return a}function Kr(e,t,n={}){let r=I(t),i=T(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let a=R(e,r);if(!a)throw new g(r,"changed-during-read");let u=n.maxBytes??J;if(Y(u),a.size>u)throw new L(n.inputKind??"project file",r,a.size,u);return Buffer.from(a.content)}let o=ze(e,t,n),s=n.maxBytes??J,c=en(o.absolutePath,"r");try{let a=$(c);if(U(a,o,t),a.size>s)throw new L(n.inputKind??"project file",o.relativePath,a.size,s);let u=Br(c),p=$(c);if(U(p,o,t),u.byteLength!==a.size)throw new g(t,"changed-during-read");return u}finally{Zt(c)}}function Lo(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=Vr(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function Vr(e,t,n,r={}){if(n.length===0||n.some(a=>a.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=I(t),o=T(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let a=R(e,i);if(!a)throw new g(i,"changed-during-read");let u=r.maxBytes??J;if(Y(u),a.size>u)throw new L(r.inputKind??"project file",i,a.size,u);let p=!a.content.includes(0)&&Yt(a.content),l=n.map(Qt),d=p?Xr(a.content,n,l):[];return{byteLength:a.size,isUtf8Text:p,matchedLiteralIndexes:d,bytes:d.length>0?Buffer.from(a.content):null,...r.computeSha256?{sha256:a.sha256}:{}}}let s=ze(e,t,r),c=en(s.absolutePath,"r");try{let a=$(c);U(a,s,t);let u=r.computeSha256?Ge("sha256"):null,p=r.scratchBuffer??Buffer.allocUnsafe(Ur);if(p.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let l=0,d=n.map(()=>!1),m=!1,h=!0,b=Buffer.alloc(0),K=n.map(()=>Buffer.alloc(0)),N=n.map(Qt);for(;l<a.size;){let P=Xt(c,p,0,Math.min(p.byteLength,a.size-l),l);if(P<=0)throw new g(t,"changed-during-read");let x=p.subarray(0,P);if(u?.update(x),m||=x.includes(0),h){let S=b.byteLength>0?Buffer.concat([b,x]):x,B=Yr(S);h=Yt(S.subarray(0,B)),b=Buffer.from(S.subarray(B))}for(let S=0;S<n.length;S+=1){if(d[S])continue;let B=n[S],$e=K[S];d[S]=Qr(x,B,$e,N[S]),K[S]=Zr(x,B,$e)}l+=P}h&&=b.byteLength===0,U($(c),s,t);let G=!m&&h,A=G?d.flatMap((P,x)=>P?[x]:[]):[],k=null;if(A.length>0){k=Buffer.allocUnsafe(a.size);let P=0;for(;P<k.byteLength;){let x=Xt(c,k,P,k.byteLength-P,P);if(x<=0)throw new g(t,"changed-during-read");P+=x}U($(c),s,t)}return{byteLength:a.size,isUtf8Text:G,matchedLiteralIndexes:A,bytes:k,...u?{sha256:u.digest("hex")}:{}}}finally{Zt(c)}}function No(e,t,n={}){return Kr(e,t,n).toString("utf8")}function U(e,t,n){if(!e.isFile()||e.dev!==t.device||e.ino!==t.inode||e.size!==t.size)throw new g(n,"changed-during-read")}function Yr(e){if(e.byteLength===0)return 0;let t=e.byteLength-1,n=0;for(;t>=0&&n<3&&(e[t]&192)===128;)n+=1,t-=1;if(t<0)return e.byteLength;let r=e[t];return((r&128)===0?1:(r&224)===192?2:(r&240)===224?3:(r&248)===240?4:0)>e.byteLength-t?t:e.byteLength}function Xr(e,t,n){return t.flatMap((r,i)=>Ae(e,r,n[i])?[i]:[])}function Qr(e,t,n,r){if(Ae(e,t,r))return!0;if(n.byteLength===0||t.byteLength===1)return!1;let i=e.subarray(0,Math.min(e.byteLength,t.byteLength-1));return Ae(Buffer.concat([n,i]),t,r)}function Ae(e,t,n){if(n<0)return e.includes(t);let r=t[n],i=e.indexOf(r),o=0;for(;i>=0;){if(o+=1,o>qr)return e.includes(t);let s=i-n;if(s>=0&&s+t.byteLength<=e.byteLength&&e.compare(t,0,t.byteLength,s,s+t.byteLength)===0)return!0;i=e.indexOf(r,i+1)}return!1}function Qt(e){for(let n=1;n<e.byteLength;n+=1){let r=e[n];if(r>=65&&r<=90)return n}let t=e[0];return t>=65&&t<=90?0:-1}function Zr(e,t,n){let r=t.byteLength-1;if(r===0)return Buffer.alloc(0);if(e.byteLength>=r)return Buffer.from(e.subarray(e.byteLength-r));let i=Buffer.concat([n,e]);return Buffer.from(i.subarray(Math.max(0,i.byteLength-r)))}function We(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Go(e,t){try{return ze(e,t),!0}catch(n){if(We(n))return!1;throw n}}function ei(e){let t=O(e);return t?t.filter(n=>n&&!pe(n)).sort():(si(e)??ci(e)).filter(n=>n&&!pe(n)).sort()}function ti(e,t={}){let n=(t.includePaths??[]).map(I),r=[...new Set([...ei(e),...n])].filter(s=>!pe(s)).filter(s=>!t.language||xt(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,c)=>s.localeCompare(c)),i=q(e),o=r.flatMap(s=>tn(e,i,s));return Ne(i),o}function tn(e,t,n){let r=Et(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(T(e,n)==="present"){let o=R(e,n);if(o)return[{path:n,size:o.fingerprintSize??o.size,hash:o.sha256}]}let i=Me(e,n);try{let o=Be(i);if(o.isSymbolicLink()){let b=_e(t,n,"symlink",le(o));if(b)return[{path:n,size:b.size,hash:b.hash}];let K=q(i),N=Wr(t,K);if(N===".."||N.startsWith(`..${$r}`)||zr(N))throw new Error("external symlink");let G=Mr(i),A=Ge("sha256").update("symlink\0").update(G).digest("hex"),k=Buffer.byteLength(G);return Le(t,n,"symlink",le(o),{hash:A,size:k}),[{path:n,size:k,hash:A}]}let s=ve(n)||Te(n),c=_e(t,n,"file",le(o));if(c&&(!s||c.semanticHash!==void 0))return[{path:n,size:c.size,hash:c.hash,...c.semanticHash===void 0?{}:{semanticHash:c.semanticHash}}];let a=Ge("sha256"),u=s,p=[],l=qe(i,{inputKind:"project fingerprint input",maxBytes:J},b=>{a.update(b),u&&p.push(Buffer.from(b))}),d=a.digest("hex"),m=u?Buffer.concat(p,l):void 0,h=m?Ht(n,m)??Re(n,m):void 0;return Le(t,n,"file",le(o),{hash:d,size:l,...h===void 0?{}:{semanticHash:h}}),[{path:n,size:l,hash:d,...h===void 0?{}:{semanticHash:h}}]}catch(o){return We(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function le(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function nn(e,t,n){let r=He(t,n),i=[...r.typescriptProjects.filter(a=>ii(e,a)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?Gt(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?ue(e,r.typescriptProjects):["."]:[],c=_t(s);return{...r,files:ti(e,{includePath:a=>{if(a===".scipquery.json")return!1;let u=ce(a,t,i);return u==="other"||u==="config"&&Lt(a)&&!c.has(a)?!1:u!=="source"||!ri(a)||!o?!0:o.has(a)},includePaths:i})}}function Ao(e,t){let n=new Set(t.files.map(o=>o.path)),r=nn(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...He(t.languages,t),files:[...t.files.flatMap(o=>{let s=i.get(o.path);return s?[s]:[]}),...r.files.filter(o=>!n.has(o.path))]}}function Bo(e,t,n,r,i,o){let s=l=>({mode:"full",fingerprint:nn(e,t,n),reason:l});if(!i)return s("change-journal-unavailable");if(!i.complete)return s(`change-journal-incomplete:${i.incompleteReason??"unknown"}`);if(!o)return s("accepted-generation-unavailable");if(i.baseGeneration!==o)return s("change-journal-base-mismatch");if(!r)return s("prior-project-input-snapshot-unavailable");let c=He(t,n);if(!ni(r,c))return s("project-input-configuration-changed");if(new Set(r.files.map(l=>l.path)).size!==r.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...c,files:[...r.files].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:[]};let a=[...c.typescriptProjects,...c.clojureConfigPath?[c.clojureConfigPath]:[]],u=new Map(r.files.map(l=>[l.path,l]));for(let l of i.entries){let d=u.get(l.path);if(ce(l.path,t,a)!=="source")return s("non-source-project-input-changed");if(l.kind==="add"&&d)return s("added-path-already-in-prior-project-input-snapshot");if(l.kind==="delete"&&!d)return s("deleted-path-not-in-prior-project-input-snapshot");if(l.kind==="change"&&!d)return s("changed-path-not-in-prior-project-input-snapshot");if(d&&(d.hash==="unreadable"||d.size<0))return s("changed-path-was-unreadable")}let p=q(e);for(let l of i.entries){let d=tn(e,p,l.path);if(l.kind==="delete"){if(d.length!==0)return s("deleted-source-is-still-readable");u.delete(l.path);continue}if(d.length!==1||d[0].hash==="unreadable"||d[0].size<0)return s(l.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(l.path,d[0])}return Ne(p),{mode:"delta",fingerprint:{...c,files:[...u.values()].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:i.entries.map(l=>l.path).sort()}}function ni(e,t){return e.version===t.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function ri(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function ii(e,t){let n;try{n=I(t)}catch{return!1}let r=T(e,n);if(r)return r==="present";try{return Be(Me(e,n)).isFile()}catch(i){if(We(i))return!1;throw i}}function He(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Jr(t.typescriptProjects),clojureConfigPath:oi(t.clojureConfigPath)}}function oi(e){return e?.trim()||void 0}function si(e){try{let t=pt(e,52428800,()=>Gr("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...dt(t)]}catch{return null}}function ci(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?Me(e,r):e,o;try{o=Ar(i,{withFileTypes:!0})}catch{continue}for(let s of o){let c=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){pe(c)||n.push(c);continue}t.push(c)}}return t}function pe(e){let t=e.split("/");return e==="meta.json"||Nt(e)||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>ai.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ai=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{ce as a,xt as b,Ki as c,yt as d,Vi as e,Yi as f,Yn as g,Zn as h,M as i,Ve as j,Q as k,Z as l,g as m,de as n,li as o,pi as p,j as q,I as r,Ye as s,me as t,rt as u,Pn as v,Ei as w,vi as x,Ri as y,Ti as z,Oi as A,go as B,pt as C,dt as D,v as E,Wi as F,Hi as G,$i as H,Jn as I,Ui as J,qi as K,ie as L,w as M,ue as N,_t as O,Lt as P,co as Q,Nt as R,Gt as S,ao as T,L as U,Jr as V,ze as W,Kr as X,Lo as Y,Vr as Z,No as _,We as $,Go as aa,ei as ba,ti as ca,nn as da,Ao as ea,Bo as fa,He as ga};
5
+ //# sourceMappingURL=chunk-KYSDI3GE.js.map
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{A as R,C as ce,F as P,a as y,b as re,i as k,j as ie,v as T,w as se,y as j,z as ae}from"./chunk-CKRWA452.js";import{$b as E,Jb as Z,Xb as h,Yb as ee,Zb as C,oc as te,q as H,qc as ne,r as X,uc as oe,y as w}from"./chunk-V4NG5OMS.js";import{Pc as D,Qc as x,Sc as I,Xb as q,dd as _,ed as Q,gd as Y,oc as L,sc as z}from"./chunk-2BTJALUS.js";function de(t,n,e){if(!Number.isSafeInteger(e.limit)||e.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=D(t,n);if(!o)return{rows:[],hasMore:!1,producer:e.producer??"source-keyset",semanticEnrichment:!1};if(e.producer==="complete-only"||e.semantic===!0||o.relativePath.endsWith(".rb"))return B(t,n,e);let s=_(t,o);if(!s)return B(t,n,e);let i=ue(t,o),c=De(t,i),a=[],l=e.producer==="source-keyset";for(let u of c){if(e.after&&u<e.after.relativePath)continue;e.instrumentation?.fileScanned?.(u);let p=Q(t,s,u);p.length>0&&(l=!0);let d=new Set(p);i?.relativePath===u&&d.add(i.line);for(let m of[...d].sort((f,Ne)=>f-Ne)){let f={relativePath:u,line:m};if(!(e.after&&b(f,e.after)<=0)&&(a.push(f),e.instrumentation?.rowAccepted?.(f),l&&a.length>e.limit))return le(a,e.limit)}}return l?le(a,e.limit):B(t,n,e,i)}function b(t,n){return(t.relativePath<n.relativePath?-1:t.relativePath>n.relativePath?1:0)||t.line-n.line}function le(t,n){return{rows:t.slice(0,n),hasMore:t.length>n,producer:"source-keyset",semanticEnrichment:!1}}function B(t,n,e,o){let r=D(t,n),s=e.semantic===!0||r?.relativePath.endsWith(".rb")?w(t,n,{semantic:e.semantic}):Le(t,n,o),i=Ie(s).filter(c=>!e.after||b(c,e.after)>0);for(let c of i.slice(0,e.limit+1))e.instrumentation?.rowAccepted?.(c);return{rows:i.slice(0,e.limit),hasMore:i.length>e.limit,producer:"complete-only",semanticEnrichment:e.semantic===!0}}function Le(t,n,e){let o=D(t,n);if(!o)return[];let r=e===void 0?ue(t,o):e,s=Y(t,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function ue(t,n){return!z(n.symbol)&&!t.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function De(t,n){let e=q(t);return!n||e.includes(n.relativePath)?e:[...e,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Ie(t){let n=new Map;for(let e of t)n.set(`${e.relativePath}\0${e.line}`,e);return[...n.values()].sort(b)}import{InvalidArgumentError as v}from"commander";var gt=Z,ke=/^[+-]?\d+$/u,Ae=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,pt=(t=>G(t,"an integer")),me=(t=>{let n=G(t,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${t}".`);return n}),fe=(t=>{let n=G(t,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${t}".`);return n}),ht=(t=>{if(!Ae.test(t))throw new v(`Expected a number, got "${t}".`);let n=Number(t);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${t}".`);return n});function G(t,n){if(!ke.test(t))throw new v(`Expected ${n}, got "${t}".`);let e=Number(t);if(!Number.isSafeInteger(e))throw new v(`Expected ${n}, got "${t}".`);return e}function g(t,n,e,...o){return o.length>0?{flags:t,description:n,parser:e,defaultValue:o[0]}:{flags:t,description:n,parser:e}}function Me(){return g("--json","Output as JSON for programmatic consumption")}function Te(){return g("--compact","Emit minified one-line JSON (use with --json)")}function je(){return g("--result-only","Emit only the command-owned result (use with --json)")}function ge(t=[]){return A(t)}function A(t=[]){let n=[Me(),je(),Te()],e=new Set(n.map(o=>o.flags));return[...t.filter(o=>!e.has(o.flags)),...n]}function $(t,n=[]){return{category:t,examples:n}}function Ct(t,n){return{origin:"mixed",observedSources:t,producerValidation:{status:"not-evaluated"},families:n}}function yt(t,n){return{origin:t,observedSources:n,producerValidation:{status:"not-evaluated"}}}function Rt(t,n,e){return{id:t,selector:n,origin:{kind:"fixed",origin:e}}}function bt(t,n,e,o){return{id:t,selector:n,origin:{kind:"result-field",field:e,values:o}}}function O(t,n,e,o,r,s,i){return{answers:typeof t=="string"?[t]:t,returns:typeof n=="string"?[n]:n,inputs:e,coverage:o,operation:s,semantic:i,...r?{scope:r}:{}}}function vt(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,F(i.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function pe(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,Be(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function he(t,n,e={ranking:"identity-only"}){return{kind:"locator",locates:t,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...e}}function St(t){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...t}}function Ce(t,n,e,o={}){return{kind:"source-read",reads:t,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...e?{compatibility:e}:{},...o}}function F(t,n,e,o,r={}){return{kind:"analysis",analysis:t,resultMeaning:n,nonClaims:e,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Be(t,n,e,o={}){return{kind:"maintenance",effect:t,nonClaims:n,outputCost:"variable",frontierClosure:[],...e?{compatibility:e}:{},...o}}function V(t){return Buffer.from(JSON.stringify(t),"utf8").toString("base64url")}function M(t){return t.generation.identity}function J(t){return"after"in t?V({version:2,...t}):V({version:1,...t})}function ye(t,n){let e=Ve(t);if(!Ge(e)&&!Fe(e))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Je(e,n),e}function Ge(t){if(!t||typeof t!="object")return!1;let n=t;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Fe(t){if(!t||typeof t!="object")return!1;let n=t,e=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!e&&typeof e.relativePath=="string"&&e.relativePath.length>0&&Number.isSafeInteger(e.line)&&(e.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ve(t){try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Je(t,n){if(t.command!==n.command||t.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(t.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function N(t,n){let e=x(t,n);return e.match?{matched:!0,resolved:{symbol:e.match.symbol,shortName:L(e.match.symbol),relativePath:e.match.relativePath},otherMatches:e.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:e.total}:{matched:!1,suggestions:I(t,n,5)}}function Re(t){let n=t.entries[0];return t.requested===1&&n?.status==="matched"&&n.kind==="source"&&(!n.rangeCoverage||n.rangeCoverage.referencedDefinitions===0)&&n.results.length===1?n.results[0]:null}function be(t,n,e){if(!e)return N(t,n);let o={file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
2
+ import{A as R,C as ce,F as P,a as y,b as re,i as k,j as ie,v as T,w as se,y as j,z as ae}from"./chunk-6PQNKL3G.js";import{Kb as Z,Yb as h,Zb as ee,_b as C,ac as E,pc as te,q as H,r as X,rc as ne,vc as oe,y as w}from"./chunk-NOYBFVJA.js";import{$c as D,_b as q,ad as x,cd as I,ld as _,md as Q,od as Y,tc as L,xc as z}from"./chunk-66DVSJQG.js";function de(t,n,e){if(!Number.isSafeInteger(e.limit)||e.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=D(t,n);if(!o)return{rows:[],hasMore:!1,producer:e.producer??"source-keyset",semanticEnrichment:!1};if(e.producer==="complete-only"||e.semantic===!0||o.relativePath.endsWith(".rb"))return B(t,n,e);let s=_(t,o);if(!s)return B(t,n,e);let i=ue(t,o),c=De(t,i),a=[],l=e.producer==="source-keyset";for(let u of c){if(e.after&&u<e.after.relativePath)continue;e.instrumentation?.fileScanned?.(u);let p=Q(t,s,u);p.length>0&&(l=!0);let d=new Set(p);i?.relativePath===u&&d.add(i.line);for(let m of[...d].sort((f,Ne)=>f-Ne)){let f={relativePath:u,line:m};if(!(e.after&&b(f,e.after)<=0)&&(a.push(f),e.instrumentation?.rowAccepted?.(f),l&&a.length>e.limit))return le(a,e.limit)}}return l?le(a,e.limit):B(t,n,e,i)}function b(t,n){return(t.relativePath<n.relativePath?-1:t.relativePath>n.relativePath?1:0)||t.line-n.line}function le(t,n){return{rows:t.slice(0,n),hasMore:t.length>n,producer:"source-keyset",semanticEnrichment:!1}}function B(t,n,e,o){let r=D(t,n),s=e.semantic===!0||r?.relativePath.endsWith(".rb")?w(t,n,{semantic:e.semantic}):Le(t,n,o),i=Ie(s).filter(c=>!e.after||b(c,e.after)>0);for(let c of i.slice(0,e.limit+1))e.instrumentation?.rowAccepted?.(c);return{rows:i.slice(0,e.limit),hasMore:i.length>e.limit,producer:"complete-only",semanticEnrichment:e.semantic===!0}}function Le(t,n,e){let o=D(t,n);if(!o)return[];let r=e===void 0?ue(t,o):e,s=Y(t,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function ue(t,n){return!z(n.symbol)&&!t.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function De(t,n){let e=q(t);return!n||e.includes(n.relativePath)?e:[...e,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Ie(t){let n=new Map;for(let e of t)n.set(`${e.relativePath}\0${e.line}`,e);return[...n.values()].sort(b)}import{InvalidArgumentError as v}from"commander";var gt=Z,ke=/^[+-]?\d+$/u,Ae=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,pt=(t=>G(t,"an integer")),me=(t=>{let n=G(t,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${t}".`);return n}),fe=(t=>{let n=G(t,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${t}".`);return n}),ht=(t=>{if(!Ae.test(t))throw new v(`Expected a number, got "${t}".`);let n=Number(t);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${t}".`);return n});function G(t,n){if(!ke.test(t))throw new v(`Expected ${n}, got "${t}".`);let e=Number(t);if(!Number.isSafeInteger(e))throw new v(`Expected ${n}, got "${t}".`);return e}function g(t,n,e,...o){return o.length>0?{flags:t,description:n,parser:e,defaultValue:o[0]}:{flags:t,description:n,parser:e}}function Me(){return g("--json","Output as JSON for programmatic consumption")}function Te(){return g("--compact","Emit minified one-line JSON (use with --json)")}function je(){return g("--result-only","Emit only the command-owned result (use with --json)")}function ge(t=[]){return A(t)}function A(t=[]){let n=[Me(),je(),Te()],e=new Set(n.map(o=>o.flags));return[...t.filter(o=>!e.has(o.flags)),...n]}function $(t,n=[]){return{category:t,examples:n}}function Ct(t,n){return{origin:"mixed",observedSources:t,producerValidation:{status:"not-evaluated"},families:n}}function yt(t,n){return{origin:t,observedSources:n,producerValidation:{status:"not-evaluated"}}}function Rt(t,n,e){return{id:t,selector:n,origin:{kind:"fixed",origin:e}}}function bt(t,n,e,o){return{id:t,selector:n,origin:{kind:"result-field",field:e,values:o}}}function O(t,n,e,o,r,s,i){return{answers:typeof t=="string"?[t]:t,returns:typeof n=="string"?[n]:n,inputs:e,coverage:o,operation:s,semantic:i,...r?{scope:r}:{}}}function vt(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,F(i.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function pe(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,Be(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function he(t,n,e={ranking:"identity-only"}){return{kind:"locator",locates:t,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...e}}function St(t){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...t}}function Ce(t,n,e,o={}){return{kind:"source-read",reads:t,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...e?{compatibility:e}:{},...o}}function F(t,n,e,o,r={}){return{kind:"analysis",analysis:t,resultMeaning:n,nonClaims:e,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Be(t,n,e,o={}){return{kind:"maintenance",effect:t,nonClaims:n,outputCost:"variable",frontierClosure:[],...e?{compatibility:e}:{},...o}}function V(t){return Buffer.from(JSON.stringify(t),"utf8").toString("base64url")}function M(t){return t.generation.identity}function J(t){return"after"in t?V({version:2,...t}):V({version:1,...t})}function ye(t,n){let e=Ve(t);if(!Ge(e)&&!Fe(e))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Je(e,n),e}function Ge(t){if(!t||typeof t!="object")return!1;let n=t;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Fe(t){if(!t||typeof t!="object")return!1;let n=t,e=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!e&&typeof e.relativePath=="string"&&e.relativePath.length>0&&Number.isSafeInteger(e.line)&&(e.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ve(t){try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Je(t,n){if(t.command!==n.command||t.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(t.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function N(t,n){let e=x(t,n);return e.match?{matched:!0,resolved:{symbol:e.match.symbol,shortName:L(e.match.symbol),relativePath:e.match.relativePath},otherMatches:e.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:e.total}:{matched:!1,suggestions:I(t,n,5)}}function Re(t){let n=t.entries[0];return t.requested===1&&n?.status==="matched"&&n.kind==="source"&&(!n.rangeCoverage||n.rangeCoverage.referencedDefinitions===0)&&n.results.length===1?n.results[0]:null}function be(t,n,e){if(!e)return N(t,n);let o={file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
3
3
  `).map((i,c)=>({line:S(e.startLine+c),text:i}))},r=N(t,n),s=r.totalMatches??0;return!r.matched||!r.resolved||s<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:s}}}function ve(t){return{requested:t.requested,matched:t.matched,ambiguous:t.ambiguous,missing:t.missing,entries:t.entries.map(n=>({selector:n.selector,status:n.status,kind:n.kind,totalCandidates:n.totalCandidates,sources:n.results.map(e=>({file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
4
4
  `).map((o,r)=>({line:S(e.startLine+r),text:o}))})),definitions:n.definitions,...n.fileCoverage?{fileCoverage:n.fileCoverage}:{},...n.rangeCoverage?{rangeCoverage:n.rangeCoverage}:{},candidates:n.candidates,omittedCandidates:n.omittedCandidates,suggestions:n.suggestions,...n.reason?{reason:n.reason}:{}})),literalValues:t.bindingClosure.inline}}function S(t){return t+1}function Se(t,n){let e=x(t,n),o=Ke(e);for(let r of o)console.log(r)}function xe(t,n,e="No results found for resolved symbol."){return x(t,n).match?e:U(n,I(t,n,5))}function K(t,n,e,o){return{...N(t,n),[o]:e}}function U(t,n){let e=`No definition matched '${t}'.`;return n.length>0?`${e} Suggestions: ${n.join(", ")}`:e}function Ke(t){if(!t.match||t.total<=1)return[];let n=t.match,e=Math.max(0,t.total-1),o=[`Resolved: ${L(n.symbol)} (${n.relativePath}) -- ${e} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=t.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${h(s.startLine)})`).join("; ")}`),o.push(""),o}var Ue=k(({db:t,args:n,opts:e})=>{let o=T(n,0),r=R(e,"signatures"),s=H(t,o);if(R(e,"json")){P("outline",n,e,s);return}if(console.log(`\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550
5
5
  file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),s.length===0){console.log(`
@@ -26,4 +26,4 @@ ${f}continue with --cursor ${d.cursor}`)}});function qe(t,n,e){let o=w(t,n,{sema
26
26
  `)}
27
27
  `}function Pe(t,n){let e=n.flatMap(r=>r.freshness?[r.freshness]:[]);if(t.push("","\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550"," Source bodies are exact working-tree bytes; compiler identity and bindings are limited to reported semantic coverage."),e.length===0){t.push(" No source-freshness overlay was available.");return}let o={aligned:e.filter(r=>r.semantic.state==="aligned").length,stale:e.filter(r=>r.semantic.state==="stale").length,unavailable:e.filter(r=>r.semantic.state==="unavailable").length};t.push(` Freshness: ${e.length}/${n.length} text current; semantics ${o.aligned} aligned, ${o.stale} stale, ${o.unavailable} unavailable.`)}function $e(t,n,e){if(e){t.push(te({relativePath:n.relativePath,startLine:n.startLine,source:n.source,sessionPolicy:"exact-unit",ownerSymbol:n.shortName,headerSuffix:` ${n.shortName} [${n.language??"unknown"}]`,indent:"",sourceIndent:" ",showFocusMarker:!1,lineNumberWidth:4,blankAfterHeader:!0}));return}t.push(`${C(n.relativePath,n.startLine,n.endLine)} ${n.shortName} [${n.language??"unknown"}]`,"");let o=n.source.split(`
28
28
  `);for(let r=0;r<o.length;r++)t.push(` ${String(h(n.startLine+r)).padStart(4)} ${o[r]}`)}function tt(t,n){let e=n.fileCoverage;if(!e||(t.push(` ${n.selector} \u2014 ${e.returnedBodies} source body(ies) cover ${e.returnedDefinitions}/${e.totalDefinitions} indexed definition(s); ${e.omittedDefinitions} omitted definition(s) disclosed below.`,` basis: ${e.basis}; members=${e.members}`),e.omittedLedger.length===0))return;t.push(" OMITTED FILE-LOCAL DEFINITIONS");for(let r of e.omittedLedger){let s=r.signature?` \u2014 ${Ee(r.signature)}`:"",i=r.nestedDefinitions>0?` (+${r.nestedDefinitions} nested definition(s))`:"";t.push(` ${" ".repeat(r.depth)}${C(r.relativePath,r.startLine,r.endLine)} ${r.shortName}${s}${i}`)}let o=e.omittedLedger.filter(r=>r.depth===0);for(let r=0;r<o.length;r+=24){let s=o.slice(r,r+24);t.push(` Read omitted units together: scip-query code ${s.map(i=>W(`${i.relativePath}:${h(i.startLine)}-${h(i.endLine)}`)).join(" ")}`)}}function nt(t,n){t.push(` ${n.selector} \u2014 ${n.totalCandidates} candidate(s); ${n.results.length>0?"all candidate bodies returned above":"no body selected"}.`);for(let e of n.candidates)t.push(` ${C(e.relativePath,e.startLine,e.endLine)} ${e.shortName}`);n.omittedCandidates>0&&t.push(` ... ${n.omittedCandidates} additional candidate identity(ies).`),n.candidates.length>0&&t.push(` Read shown candidates together: scip-query code ${n.candidates.map(e=>W(`${e.relativePath}:${h(e.startLine)}-${h(e.endLine)}`)).join(" ")}`)}function Oe(t,n){if(!(!n||n.inline.length===0)){t.push("","LITERAL VALUES");for(let e of n.inline)t.push(` inline ${e.name} @ ${C(e.relativePath,e.startLine,e.endLine)}`),t.push(` ${e.source??""}`)}}function ot(t,n){let e=n.entries.flatMap(d=>d.fileCoverage?[d.fileCoverage]:[]),o=n.entries.flatMap(d=>d.rangeCoverage?[d.rangeCoverage]:[]);if(e.length===0&&o.length===0){t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selector(s) resolved to shown source bodies; referenced definitions and runtime relationships are not claimed. Source lines use absolute file line numbers and are citation-ready.`);return}let r=e.reduce((d,m)=>d+m.returnedBodies,0),s=e.reduce((d,m)=>d+m.returnedDefinitions,0),i=e.reduce((d,m)=>d+m.totalDefinitions,0),c=e.reduce((d,m)=>d+m.omittedDefinitions,0),a=o.reduce((d,m)=>d+m.referencedDefinitions,0),l=o.reduce((d,m)=>d+m.returnedDefinitions,0),u=o.reduce((d,m)=>d+m.omittedDefinitions,0),p=[...e.length>0?[`${e.length} file selector(s) returned ${r} source body(ies) covering ${s}/${i} indexed definition(s); ${c} file-local definition(s) omitted and disclosed`]:[],...o.length>0?[`${o.length} range selector(s) covered ${l}/${a} statically attributed same-file definition(s); ${u} referenced definition(s) omitted and disclosed`]:[]];t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selectors resolved; ${p.join("; ")}. Source lines use absolute file line numbers and are citation-ready.`)}function W(t){return`'${t.replaceAll("'","'\\''")}'`}var Qt=[{id:"session",command:"session",description:"Show evidence already delivered in this agent exploration session",options:[g("--reset","Clear this agent exploration-session ledger")],agent:pe("Which indexed source ranges and graph facts have already been delivered in this exploration session?","prior command ordinals, exact source ranges, and content-bound graph receipts",[],"complete","repository",re("repository-observation",[{when:{kind:"option",name:"reset",equals:!0},role:"mutation"}])),renderShape:"custom",docs:$("Navigation"),handler:Ye},{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:ge([g("--full","Run unbounded semantic analysis on large indexes"),g("-n, --limit <n>","Maximum reference sites to return",fe),g("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{operation:y,answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",semantic:F("Resolve the exact reference sites attributed to one compiler symbol identity.","Referencing file paths and reference line numbers grouped by file.",["Reference sites do not establish runtime execution, data flow, or task relevance."]),contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:$("Navigation",["scip-query refs login"]),handler:We},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:{...O("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete",void 0,y,he(["file","symbol","construct"],["File ownership and nesting do not establish execution or task relevance."],{ranking:"identity-only",manualInput:"One exact current project file path.",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay."})),contrasts:[{command:"search",distinction:"outline enumerates constructs in one known file; search locates exact text across current project text."},{command:"code",distinction:"outline returns identities and ranges; code materializes exact source for selected identities."}]},options:A([g("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:$("Navigation"),handler:Ue},{id:"code",command:"code <selectors...>",description:"Read exact definitions, ranges with local call closure, or file export surfaces",agent:{...O("What exact source defines these symbols, ranges, or file surfaces?","per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",[["symbol","file"]],"complete",void 0,y,Ce(["construct","exact-source"],["Source materialization does not establish callers, runtime reachability, or task relevance by itself."],void 0,{manualInput:"One or more exact symbols, file:line ranges, or file paths.",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed."})),resultUnits:{kind:"field",field:"code"},contrasts:[{command:"inspect",distinction:"code materializes complete exact source; inspect batches bounded behavior or source gaps."},{command:"outline",distinction:"code reads selected implementations; outline enumerates file structure without reading every body."}]},options:A([g("-C, --context <n>","Extra lines of context above/below",me,0),g("--members <exported|all>","For file selectors, return the exported surface or the complete file",void 0,"exported")]),renderShape:"custom",docs:$("Navigation",["scip-query code parseRequest handleRequest","scip-query code src/api.ts src/web.ts"]),handler:Qe}];export{gt as a,pt as b,me as c,fe as d,ht as e,g as f,Te as g,ge as h,A as i,$ as j,Ct as k,yt as l,Rt as m,bt as n,O as o,vt as p,pe as q,he as r,St as s,Ce as t,F as u,N as v,Se as w,xe as x,K as y,Qt as z};
29
- //# sourceMappingURL=chunk-MSR2QRUE.js.map
29
+ //# sourceMappingURL=chunk-L6PJPETJ.js.map