scip-query 0.23.0 → 0.26.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 (650) hide show
  1. package/CHANGELOG.md +491 -2
  2. package/README.md +111 -122
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-PRVFAGTQ.js +2 -0
  5. package/dist/call-graph-DVPAQV2F.js +2 -0
  6. package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
  7. package/dist/chunk-2FSBGL5P.js +2 -0
  8. package/dist/chunk-2HLAFUCY.js +2 -0
  9. package/dist/chunk-2IWUT6CJ.js +3 -0
  10. package/dist/chunk-2KNN7GTQ.js +2 -0
  11. package/dist/chunk-2LHXRE2B.js +8 -0
  12. package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
  13. package/dist/chunk-36SGVCGX.js +2 -0
  14. package/dist/chunk-3ABBFPTP.js +2 -0
  15. package/dist/chunk-3IVFU4FD.js +3 -0
  16. package/dist/chunk-3JIQS44J.js +7 -0
  17. package/dist/chunk-3ZRB6DNK.js +7 -0
  18. package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
  19. package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
  20. package/dist/chunk-4BP3UBDG.js +2 -0
  21. package/dist/chunk-4D6RO7G4.js +2 -0
  22. package/dist/chunk-4FEWQ6RH.js +2 -0
  23. package/dist/chunk-4IGEOBG7.js +2 -0
  24. package/dist/chunk-4QZXBUKC.js +2 -0
  25. package/dist/chunk-4WBDEVX2.js +4 -0
  26. package/dist/chunk-4WCUBZU3.js +8 -0
  27. package/dist/chunk-4WTUBQ36.js +40 -0
  28. package/dist/chunk-4XQ4O6IM.js +3 -0
  29. package/dist/chunk-55UQAMZO.js +4 -0
  30. package/dist/chunk-5D2LVK7O.js +125 -0
  31. package/dist/chunk-5IYJ56TT.js +2 -0
  32. package/dist/chunk-5PLMJC7Q.js +2 -0
  33. package/dist/chunk-5TNQJUR2.js +5 -0
  34. package/dist/chunk-62BDNPMI.js +2 -0
  35. package/dist/chunk-64DZ5TXR.js +7 -0
  36. package/dist/chunk-65245JCM.js +2 -0
  37. package/dist/chunk-6FFVZZL4.js +2 -0
  38. package/dist/chunk-6KO5JHAR.js +2 -0
  39. package/dist/chunk-6LRXOOSX.js +2 -0
  40. package/dist/chunk-6LSEIIF7.js +2 -0
  41. package/dist/chunk-6YMNWD3H.js +6 -0
  42. package/dist/chunk-72AD6ZRR.js +5 -0
  43. package/dist/chunk-73AAKPUC.js +4 -0
  44. package/dist/chunk-76CZ77DF.js +2 -0
  45. package/dist/chunk-7VPEEAAG.js +2 -0
  46. package/dist/chunk-7WTPQ4NX.js +14 -0
  47. package/dist/chunk-7Y5T6XDP.js +2 -0
  48. package/dist/chunk-A2IIGFMJ.js +5 -0
  49. package/dist/chunk-AB5KCTEV.js +2 -0
  50. package/dist/chunk-AC566WBP.js +6 -0
  51. package/dist/chunk-AGWFSTXC.js +3 -0
  52. package/dist/chunk-AOSIYPTA.js +2 -0
  53. package/dist/chunk-AUVEWPIF.js +2 -0
  54. package/dist/chunk-B56T42J3.js +25 -0
  55. package/dist/chunk-BIQEF5NE.js +2 -0
  56. package/dist/chunk-BL6XJKTA.js +3 -0
  57. package/dist/chunk-BMKOQJRI.js +2 -0
  58. package/dist/chunk-BOZ4EXBB.js +3 -0
  59. package/dist/chunk-BUTWYEPH.js +2 -0
  60. package/dist/chunk-BZB4QPIP.js +2 -0
  61. package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
  62. package/dist/chunk-CFN45HFP.js +2 -0
  63. package/dist/chunk-CFYMZFXT.js +368 -0
  64. package/dist/chunk-CN5EH7O3.js +2 -0
  65. package/dist/chunk-D254DNNQ.js +4 -0
  66. package/dist/chunk-D3FDISIC.js +2 -0
  67. package/dist/chunk-D3NX5XIE.js +3 -0
  68. package/dist/chunk-DA7RPPDF.js +3 -0
  69. package/dist/chunk-DDMC3FON.js +3 -0
  70. package/dist/chunk-DIO3FUSG.js +2 -0
  71. package/dist/chunk-DJ2NNSUK.js +3 -0
  72. package/dist/chunk-DKYQIM3C.js +18 -0
  73. package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
  74. package/dist/chunk-DVFP6PZI.js +2 -0
  75. package/dist/chunk-E3FDPXZK.js +2 -0
  76. package/dist/chunk-E7YNJLCB.js +2 -0
  77. package/dist/chunk-EFGW5JPH.js +2 -0
  78. package/dist/chunk-EJVTR244.js +13 -0
  79. package/dist/chunk-EOV7RTRZ.js +2 -0
  80. package/dist/chunk-ETOIKRHO.js +2 -0
  81. package/dist/chunk-EYK3ZAO2.js +3 -0
  82. package/dist/chunk-F2V2LPET.js +52 -0
  83. package/dist/chunk-F4LUHJTF.js +2 -0
  84. package/dist/chunk-F4PUT6IT.js +2 -0
  85. package/dist/chunk-F56GCXXS.js +5 -0
  86. package/dist/chunk-FC2EVQRM.js +2 -0
  87. package/dist/chunk-FL7NBMHP.js +3 -0
  88. package/dist/chunk-FMRN2TRL.js +3 -0
  89. package/dist/chunk-FVULPZDF.js +20 -0
  90. package/dist/chunk-GCKCF5FL.js +43 -0
  91. package/dist/chunk-GH2PYF46.js +2 -0
  92. package/dist/chunk-GHJAGXIP.js +2 -0
  93. package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
  94. package/dist/chunk-GS6KDO4R.js +2 -0
  95. package/dist/chunk-GUUBXNN7.js +2 -0
  96. package/dist/chunk-GVWX5T43.js +80 -0
  97. package/dist/chunk-GZKFETP5.js +2 -0
  98. package/dist/chunk-H4EQHO6J.js +9 -0
  99. package/dist/chunk-H73WY2RM.js +2 -0
  100. package/dist/chunk-H75GSPRV.js +60 -0
  101. package/dist/chunk-HDR3AHSV.js +61 -0
  102. package/dist/chunk-HQBSL74Y.js +2 -0
  103. package/dist/chunk-HRRFKWPZ.js +2 -0
  104. package/dist/chunk-HXENDJC6.js +2 -0
  105. package/dist/chunk-IIBAZNSW.js +21 -0
  106. package/dist/chunk-INLMWEUU.js +12 -0
  107. package/dist/chunk-IWQPAF4F.js +2 -0
  108. package/dist/chunk-IZJ6YUKP.js +35 -0
  109. package/dist/chunk-J2TMAIN5.js +60 -0
  110. package/dist/chunk-J5FJMODQ.js +142 -0
  111. package/dist/chunk-J7HZPIO3.js +2 -0
  112. package/dist/chunk-JEVRKFRL.js +2 -0
  113. package/dist/chunk-JFXSGAEB.js +30 -0
  114. package/dist/chunk-JVRTHGFS.js +3 -0
  115. package/dist/chunk-JYWEX7RR.js +360 -0
  116. package/dist/chunk-K3YL22N6.js +2 -0
  117. package/dist/chunk-K4CN7GXK.js +12 -0
  118. package/dist/chunk-K5TBVXU4.js +30 -0
  119. package/dist/chunk-KDDIE2DP.js +9 -0
  120. package/dist/chunk-KHWRRPV4.js +2 -0
  121. package/dist/chunk-KI6NBKDY.js +14 -0
  122. package/dist/chunk-KU3QRSTH.js +2 -0
  123. package/dist/chunk-KZBJWZJB.js +2 -0
  124. package/dist/chunk-L7GFM3NP.js +3 -0
  125. package/dist/chunk-LMO6PK3V.js +35 -0
  126. package/dist/chunk-LN4YXJJU.js +2 -0
  127. package/dist/chunk-LOVIZBJ4.js +43 -0
  128. package/dist/chunk-LPCRK4A2.js +11 -0
  129. package/dist/chunk-MMHZKBFA.js +2 -0
  130. package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
  131. package/dist/chunk-N2WN6I3L.js +2 -0
  132. package/dist/chunk-N3ORQT7L.js +2 -0
  133. package/dist/chunk-NAZ3RAIW.js +2 -0
  134. package/dist/chunk-NDUNO5JQ.js +2 -0
  135. package/dist/chunk-NEIWRNAZ.js +4 -0
  136. package/dist/chunk-NJJMVD65.js +2 -0
  137. package/dist/chunk-NLOQOBXI.js +20 -0
  138. package/dist/chunk-NOLZOVCU.js +2 -0
  139. package/dist/chunk-NOWINRRN.js +2 -0
  140. package/dist/chunk-NZAXKGRL.js +16 -0
  141. package/dist/chunk-O2C4UILI.js +2 -0
  142. package/dist/chunk-O3RHA6ZT.js +3 -0
  143. package/dist/chunk-O4UZSPPI.js +3 -0
  144. package/dist/chunk-OGFV2BUX.js +2 -0
  145. package/dist/chunk-OZCJXZK6.js +499 -0
  146. package/dist/chunk-P6ODM7BY.js +2 -0
  147. package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
  148. package/dist/chunk-PH52RA7D.js +2 -0
  149. package/dist/chunk-PKN354TH.js +3 -0
  150. package/dist/chunk-PWOASWEG.js +11 -0
  151. package/dist/chunk-QIWXRW72.js +2 -0
  152. package/dist/chunk-QJRMOK5N.js +2 -0
  153. package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
  154. package/dist/chunk-QXEUDXBT.js +3 -0
  155. package/dist/chunk-QYUVVBMR.js +6 -0
  156. package/dist/chunk-QZ7KQZRN.js +2 -0
  157. package/dist/chunk-R6LQBUDH.js +2 -0
  158. package/dist/chunk-RBS42E55.js +20 -0
  159. package/dist/chunk-RSJKPCFX.js +26 -0
  160. package/dist/chunk-S6CZA3MV.js +2 -0
  161. package/dist/chunk-STMVAHJP.js +2 -0
  162. package/dist/chunk-SYVPTTVW.js +2 -0
  163. package/dist/chunk-T3I6NHBH.js +2 -0
  164. package/dist/chunk-T6DK3ZP7.js +2 -0
  165. package/dist/chunk-TKD34PHN.js +4 -0
  166. package/dist/chunk-TNNQFH7W.js +2 -0
  167. package/dist/chunk-TNV7SSUF.js +2 -0
  168. package/dist/chunk-TO7ZR3EH.js +8 -0
  169. package/dist/chunk-TOU3CHK4.js +2 -0
  170. package/dist/chunk-TRBI4UKT.js +2 -0
  171. package/dist/chunk-TZCVNCAN.js +4 -0
  172. package/dist/chunk-U4LZA5LL.js +3 -0
  173. package/dist/chunk-U5RIG3JP.js +3 -0
  174. package/dist/chunk-UP5KXN2I.js +2 -0
  175. package/dist/chunk-UQFR3NDH.js +5 -0
  176. package/dist/chunk-UXYXF7GV.js +2 -0
  177. package/dist/chunk-VB3GOKOS.js +2 -0
  178. package/dist/chunk-VF5JZICY.js +2 -0
  179. package/dist/chunk-VTY3VK6E.js +2 -0
  180. package/dist/chunk-VX2O4RIS.js +2 -0
  181. package/dist/chunk-WKPV2TDZ.js +2 -0
  182. package/dist/chunk-WOFQ5DTB.js +2 -0
  183. package/dist/chunk-WS4C6TCK.js +2 -0
  184. package/dist/chunk-WXU3DGPU.js +2 -0
  185. package/dist/chunk-X6RMKHJQ.js +81 -0
  186. package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
  187. package/dist/chunk-XHTVFLWW.js +2 -0
  188. package/dist/chunk-XKIDJCIK.js +2 -0
  189. package/dist/chunk-XTYTYZPT.js +2 -0
  190. package/dist/chunk-Y2JHHTTA.js +2 -0
  191. package/dist/chunk-YGVRMGYN.js +4 -0
  192. package/dist/chunk-YNQCGEQE.js +2 -0
  193. package/dist/chunk-YOQVEXVE.js +14 -0
  194. package/dist/chunk-YRT2WLYY.js +2 -0
  195. package/dist/chunk-YTAP5Y2G.js +2 -0
  196. package/dist/chunk-YTYWI7VB.js +2 -0
  197. package/dist/chunk-YULZRALL.js +2 -0
  198. package/dist/chunk-Z33WQG4Q.js +2 -0
  199. package/dist/chunk-ZGTYGDMF.js +16 -0
  200. package/dist/chunk-ZHMRSZFD.js +43 -0
  201. package/dist/chunk-ZHSP366W.js +10 -0
  202. package/dist/chunk-ZIBYCYKK.js +7 -0
  203. package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
  204. package/dist/chunk-ZO4YXUT6.js +4 -0
  205. package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
  206. package/dist/cli-main.js +6 -6
  207. package/dist/cli.js +1 -1
  208. package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
  209. package/dist/code-IL5WH3NZ.js +2 -0
  210. package/dist/code-result-json-ANTBEDFP.js +4 -0
  211. package/dist/command-descriptors-HEEMDHTU.js +222 -0
  212. package/dist/deps-EOWFC6FD.js +2 -0
  213. package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
  214. package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
  215. package/dist/files-K4AI3JUM.js +2 -0
  216. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  217. package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
  218. package/dist/hierarchy-6W5NDIFI.js +2 -0
  219. package/dist/imports-WH365QY4.js +2 -0
  220. package/dist/index.d.ts +13 -1
  221. package/dist/index.js +1 -1
  222. package/dist/members-K3PHMF5S.js +2 -0
  223. package/dist/methods-E7KVMBX4.js +2 -0
  224. package/dist/output-continuation-command-BJSY67SN.js +3 -0
  225. package/dist/output-pagination-UZJ5ACIX.js +24 -0
  226. package/dist/postinstall.js +1 -1
  227. package/dist/project-reindex-EP24WT4X.js +3 -0
  228. package/dist/queries/affected.js +1 -1
  229. package/dist/queries/architecture.d.ts +15 -4
  230. package/dist/queries/architecture.js +1 -1
  231. package/dist/queries/bottlenecks.js +1 -1
  232. package/dist/queries/by-kind.js +1 -1
  233. package/dist/queries/call-graph.d.ts +3 -1
  234. package/dist/queries/call-graph.js +1 -1
  235. package/dist/queries/change-surface.d.ts +1 -0
  236. package/dist/queries/change-surface.js +1 -1
  237. package/dist/queries/cleanup-plan.d.ts +3 -3
  238. package/dist/queries/cleanup-plan.js +1 -1
  239. package/dist/queries/co-change.d.ts +20 -2
  240. package/dist/queries/co-change.js +1 -1
  241. package/dist/queries/code.d.ts +1 -1
  242. package/dist/queries/code.js +1 -1
  243. package/dist/queries/complexity.d.ts +6 -3
  244. package/dist/queries/complexity.js +1 -1
  245. package/dist/queries/context.d.ts +1 -7
  246. package/dist/queries/context.js +1 -1
  247. package/dist/queries/coupling.js +1 -1
  248. package/dist/queries/cycles.js +1 -1
  249. package/dist/queries/dead.d.ts +2 -0
  250. package/dist/queries/dead.js +1 -1
  251. package/dist/queries/decorative-checkers.js +1 -1
  252. package/dist/queries/dependence-slice.d.ts +46 -22
  253. package/dist/queries/dependence-slice.js +1 -1
  254. package/dist/queries/dependency-depth.d.ts +1 -7
  255. package/dist/queries/dependency-depth.js +1 -1
  256. package/dist/queries/deps.js +1 -1
  257. package/dist/queries/diff-impact.d.ts +3 -1
  258. package/dist/queries/diff-impact.js +1 -1
  259. package/dist/queries/doc-drift.js +1 -1
  260. package/dist/queries/drift.d.ts +1 -1
  261. package/dist/queries/drift.js +1 -1
  262. package/dist/queries/duplicate-bodies.d.ts +29 -2
  263. package/dist/queries/duplicate-bodies.js +1 -1
  264. package/dist/queries/entry-map.d.ts +2 -4
  265. package/dist/queries/entry-map.js +1 -1
  266. package/dist/queries/evidence.d.ts +121 -61
  267. package/dist/queries/evidence.js +1 -1
  268. package/dist/queries/fan.js +1 -1
  269. package/dist/queries/files.js +1 -1
  270. package/dist/queries/health.d.ts +1 -1
  271. package/dist/queries/health.js +1 -1
  272. package/dist/queries/hierarchy.d.ts +2 -2
  273. package/dist/queries/hierarchy.js +1 -1
  274. package/dist/queries/hotspots.d.ts +1 -1
  275. package/dist/queries/hotspots.js +1 -1
  276. package/dist/queries/imports.d.ts +1 -0
  277. package/dist/queries/imports.js +1 -1
  278. package/dist/queries/incomplete-migration.d.ts +3 -3
  279. package/dist/queries/incomplete-migration.js +1 -1
  280. package/dist/queries/index.d.ts +17 -65
  281. package/dist/queries/index.js +1 -1
  282. package/dist/queries/locality-candidates.d.ts +4 -4
  283. package/dist/queries/locality-candidates.js +1 -1
  284. package/dist/queries/members.d.ts +2 -2
  285. package/dist/queries/members.js +1 -1
  286. package/dist/queries/methods.js +1 -1
  287. package/dist/queries/not-implemented.d.ts +2 -6
  288. package/dist/queries/not-implemented.js +1 -1
  289. package/dist/queries/outline.js +1 -1
  290. package/dist/queries/passthrough-candidates.d.ts +9 -1
  291. package/dist/queries/passthrough-candidates.js +1 -1
  292. package/dist/queries/react-component-duplicates.d.ts +19 -3
  293. package/dist/queries/react-component-duplicates.js +1 -1
  294. package/dist/queries/react-hook-candidates.d.ts +22 -3
  295. package/dist/queries/react-hook-candidates.js +1 -1
  296. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  297. package/dist/queries/react-large-component-pressure.js +1 -1
  298. package/dist/queries/recent-duplicates.js +1 -1
  299. package/dist/queries/redundant-reexports.d.ts +4 -14
  300. package/dist/queries/redundant-reexports.js +1 -1
  301. package/dist/queries/refs.d.ts +4 -1
  302. package/dist/queries/refs.js +1 -1
  303. package/dist/queries/review.d.ts +188 -0
  304. package/dist/queries/review.js +2 -0
  305. package/dist/queries/similar-files.d.ts +7 -10
  306. package/dist/queries/similar-files.js +1 -1
  307. package/dist/queries/similar-signatures.js +1 -1
  308. package/dist/queries/similar.d.ts +19 -1
  309. package/dist/queries/similar.js +1 -1
  310. package/dist/queries/slice-cohesion.d.ts +205 -0
  311. package/dist/queries/slice-cohesion.js +2 -0
  312. package/dist/queries/source-inspection.d.ts +6 -202
  313. package/dist/queries/source-inspection.js +1 -1
  314. package/dist/queries/source-search.d.ts +2 -3
  315. package/dist/queries/source-search.js +1 -1
  316. package/dist/queries/stats.d.ts +1 -0
  317. package/dist/queries/stats.js +1 -1
  318. package/dist/queries/surface.js +1 -1
  319. package/dist/queries/symbols.js +1 -1
  320. package/dist/queries/system.d.ts +4 -2
  321. package/dist/queries/system.js +1 -1
  322. package/dist/queries/test-quality.d.ts +1 -1
  323. package/dist/queries/test-quality.js +1 -1
  324. package/dist/queries/twin-drift.d.ts +23 -7
  325. package/dist/queries/twin-drift.js +1 -1
  326. package/dist/queries/unused-imports.js +1 -1
  327. package/dist/queries/unused-params.d.ts +3 -15
  328. package/dist/queries/unused-params.js +1 -1
  329. package/dist/queries/vue-component-duplicates.js +1 -1
  330. package/dist/queries/vue-composable-candidates.js +1 -1
  331. package/dist/queries/vue-large-view-pressure.js +1 -1
  332. package/dist/query-service-fastpath.js +5 -5
  333. package/dist/query-service-server.js +4 -4
  334. package/dist/refs-CCBJG7WK.js +2 -0
  335. package/dist/refs-pagination-DRNLVU4S.js +2 -0
  336. package/dist/reindex-worker.js +79 -29
  337. package/dist/reindex.js +45 -45
  338. package/dist/repository-cache-worker.js +2 -0
  339. package/dist/runtime.d.ts +8 -8
  340. package/dist/runtime.js +3 -4
  341. package/dist/rust-semantic-session-server.js +1 -1
  342. package/dist/rust-semantic-session-worker.js +1 -1
  343. package/dist/rust-semantic-worker.js +1 -1
  344. package/dist/service-queries-2WAJI7R6.js +6 -0
  345. package/dist/source-inspection-91U9zdO3.d.ts +341 -0
  346. package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
  347. package/dist/stats-G7DIV6VU.js +2 -0
  348. package/dist/surface-IO55UALI.js +2 -0
  349. package/dist/system-ZBMSHJXU.js +2 -0
  350. package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
  351. package/dist/typescript-indexer.js +2 -0
  352. package/dist/typescript-mailbox-worker.js +1 -1
  353. package/dist/watch-server.js +3 -3
  354. package/docs/AGENT_GUIDE.md +19 -128
  355. package/docs/CLI_JSON_OUTPUT.md +21 -17
  356. package/docs/COMMAND_REFERENCE.md +34 -49
  357. package/docs/CURRENT_COMMANDS.md +123 -0
  358. package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
  359. package/docs/DETECTOR_GUIDE.md +55 -12
  360. package/docs/PRODUCT_VISION.md +135 -0
  361. package/docs/PROPERTY_TESTING.md +73 -0
  362. package/docs/REVIEW.md +76 -0
  363. package/docs/SKILLS.md +51 -0
  364. package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
  365. package/docs/accuracy-audit-checklist.md +70 -13
  366. package/docs/analyzer-inventory.md +2 -2
  367. package/docs/locality-analyzer-design.md +9 -9
  368. package/package.json +18 -80
  369. package/scripts/evidence-product-contract.mjs +7 -3
  370. package/scripts/record-review-coverage.mjs +118 -0
  371. package/scripts/scip-windows-provenance.mjs +29 -19
  372. package/skills/scip-architecture-review/SKILL.md +57 -0
  373. package/skills/scip-architecture-review/agents/openai.yaml +4 -0
  374. package/skills/scip-architecture-review/references/design-checks.md +17 -0
  375. package/skills/scip-explore/SKILL.md +15 -59
  376. package/skills/scip-explore/agents/openai.yaml +3 -3
  377. package/skills/scip-explore/references/external-evidence.md +2 -2
  378. package/skills/scip-explore/references/information-model.md +26 -29
  379. package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
  380. package/skills/scip-integrity-audit/SKILL.md +53 -181
  381. package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
  382. package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
  383. package/skills/scip-plan/SKILL.md +39 -65
  384. package/skills/scip-plan/agents/openai.yaml +2 -2
  385. package/skills/scip-query/SKILL.md +28 -81
  386. package/skills/scip-query/agents/openai.yaml +2 -2
  387. package/skills/scip-query/references/command-guide.md +169 -0
  388. package/skills/scip-setup/SKILL.md +4 -2
  389. package/skills/scip-setup/agents/openai.yaml +3 -3
  390. package/dist/by-kind-XI2CSWEY.js +0 -2
  391. package/dist/call-graph-UONR6JR5.js +0 -2
  392. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  393. package/dist/chunk-26CT72HM.js +0 -2
  394. package/dist/chunk-2E7CX53V.js +0 -2
  395. package/dist/chunk-2GRUZAQF.js +0 -43
  396. package/dist/chunk-2LDBDR6J.js +0 -29
  397. package/dist/chunk-2OOY75BW.js +0 -2
  398. package/dist/chunk-2R3V3PSD.js +0 -4
  399. package/dist/chunk-2WC2OEDO.js +0 -4
  400. package/dist/chunk-35NLDRZC.js +0 -2
  401. package/dist/chunk-3AF4TUFK.js +0 -3
  402. package/dist/chunk-3D3QG236.js +0 -2
  403. package/dist/chunk-3FHOF22C.js +0 -21
  404. package/dist/chunk-3JKSW6LJ.js +0 -2
  405. package/dist/chunk-3L2ZBPEX.js +0 -133
  406. package/dist/chunk-3PJABJSU.js +0 -2
  407. package/dist/chunk-3SVF22I5.js +0 -2
  408. package/dist/chunk-3WR4E3A3.js +0 -3
  409. package/dist/chunk-4FTZ4P5G.js +0 -2
  410. package/dist/chunk-4UX2F3JX.js +0 -2
  411. package/dist/chunk-4WNW27SX.js +0 -2
  412. package/dist/chunk-5ENOG4VP.js +0 -61
  413. package/dist/chunk-64BFSI5I.js +0 -2
  414. package/dist/chunk-66DVSJQG.js +0 -455
  415. package/dist/chunk-6HFCYNYE.js +0 -9
  416. package/dist/chunk-6PQNKL3G.js +0 -3
  417. package/dist/chunk-6V5CNXL6.js +0 -2
  418. package/dist/chunk-6VVV4WRR.js +0 -4
  419. package/dist/chunk-7BWFZPPZ.js +0 -2
  420. package/dist/chunk-7CYG22FH.js +0 -2
  421. package/dist/chunk-7F45LJKI.js +0 -2
  422. package/dist/chunk-7IWV2EG3.js +0 -3
  423. package/dist/chunk-7KCZELVM.js +0 -2
  424. package/dist/chunk-AFHTBORT.js +0 -2
  425. package/dist/chunk-AVRYW5OZ.js +0 -2
  426. package/dist/chunk-B3X6KU75.js +0 -2
  427. package/dist/chunk-B5D7QPBE.js +0 -4
  428. package/dist/chunk-BBCIS4DX.js +0 -16
  429. package/dist/chunk-BDUVI7TO.js +0 -3
  430. package/dist/chunk-BE7ZZTMC.js +0 -2
  431. package/dist/chunk-BHVUJOCQ.js +0 -3
  432. package/dist/chunk-BJT7LSPK.js +0 -3
  433. package/dist/chunk-BKVWUP7Y.js +0 -2
  434. package/dist/chunk-BQGB4HBD.js +0 -2
  435. package/dist/chunk-BRV7PIFF.js +0 -2
  436. package/dist/chunk-CEEZJXEF.js +0 -2
  437. package/dist/chunk-CIYLO6SI.js +0 -7
  438. package/dist/chunk-CJZXN4NU.js +0 -2
  439. package/dist/chunk-CNO7TOKL.js +0 -2
  440. package/dist/chunk-COF23M5F.js +0 -2
  441. package/dist/chunk-CWFP7GM5.js +0 -2
  442. package/dist/chunk-D2DHWI3D.js +0 -2
  443. package/dist/chunk-D4N5SQ2M.js +0 -4
  444. package/dist/chunk-DBRSYFXR.js +0 -2
  445. package/dist/chunk-DHUIOLDT.js +0 -2
  446. package/dist/chunk-DIRJWYBM.js +0 -6
  447. package/dist/chunk-DIUFNHRJ.js +0 -35
  448. package/dist/chunk-DRENNWRG.js +0 -2
  449. package/dist/chunk-DTZCKZEU.js +0 -4
  450. package/dist/chunk-DULC3QFP.js +0 -5
  451. package/dist/chunk-DYGHBZ2N.js +0 -16
  452. package/dist/chunk-E5R6AQ73.js +0 -40
  453. package/dist/chunk-E73UNJTF.js +0 -38
  454. package/dist/chunk-EKV5HX33.js +0 -2
  455. package/dist/chunk-EQHFIL6T.js +0 -3
  456. package/dist/chunk-ESIQ66Z7.js +0 -2
  457. package/dist/chunk-EVFUMY4R.js +0 -3
  458. package/dist/chunk-F7DY272B.js +0 -2
  459. package/dist/chunk-FBN2FGXG.js +0 -2
  460. package/dist/chunk-FDLOBR6P.js +0 -4
  461. package/dist/chunk-FESCRNVV.js +0 -5
  462. package/dist/chunk-FFRKR4EQ.js +0 -2
  463. package/dist/chunk-FGA2U4OR.js +0 -8
  464. package/dist/chunk-FIQRSHVM.js +0 -2
  465. package/dist/chunk-FPYLNQPT.js +0 -2
  466. package/dist/chunk-FRUSVINH.js +0 -2
  467. package/dist/chunk-GSP44ENC.js +0 -2
  468. package/dist/chunk-GUFSG5TX.js +0 -2
  469. package/dist/chunk-GYIZ4NXB.js +0 -2
  470. package/dist/chunk-GZIUDL6G.js +0 -2
  471. package/dist/chunk-H5EXS3HM.js +0 -2
  472. package/dist/chunk-HCXEQRFF.js +0 -18
  473. package/dist/chunk-HEHOQQKH.js +0 -2
  474. package/dist/chunk-HKGFPJ4T.js +0 -4
  475. package/dist/chunk-HLZTEXRA.js +0 -2
  476. package/dist/chunk-HOENASQM.js +0 -3
  477. package/dist/chunk-HVF5VBG6.js +0 -2
  478. package/dist/chunk-I55I7XXP.js +0 -2
  479. package/dist/chunk-IDFEUFKS.js +0 -2
  480. package/dist/chunk-IHGQTTVW.js +0 -2
  481. package/dist/chunk-IICPE7B2.js +0 -20
  482. package/dist/chunk-IL676XCC.js +0 -18
  483. package/dist/chunk-IW5XQG5G.js +0 -2
  484. package/dist/chunk-IZDPJ2QI.js +0 -2
  485. package/dist/chunk-J66VOFW6.js +0 -5
  486. package/dist/chunk-JFMEXGFE.js +0 -2
  487. package/dist/chunk-JGKUET5J.js +0 -3
  488. package/dist/chunk-JS4PGXMV.js +0 -3
  489. package/dist/chunk-JWTGMPIT.js +0 -80
  490. package/dist/chunk-JYR66JN5.js +0 -5
  491. package/dist/chunk-KFOYCQAJ.js +0 -9
  492. package/dist/chunk-KLFEXGQA.js +0 -2
  493. package/dist/chunk-KMVGRIO2.js +0 -2
  494. package/dist/chunk-KYSDI3GE.js +0 -5
  495. package/dist/chunk-L6PJPETJ.js +0 -29
  496. package/dist/chunk-LDVT66YM.js +0 -2
  497. package/dist/chunk-LEECKFCJ.js +0 -2
  498. package/dist/chunk-LMZ5PRUV.js +0 -2
  499. package/dist/chunk-LQRQN2XA.js +0 -2
  500. package/dist/chunk-LXABEJX3.js +0 -2
  501. package/dist/chunk-MNV5FSBW.js +0 -3
  502. package/dist/chunk-MPQ4OTBM.js +0 -2
  503. package/dist/chunk-MTDBHTSF.js +0 -2
  504. package/dist/chunk-MV3CDXPI.js +0 -38
  505. package/dist/chunk-MWN53KRN.js +0 -60
  506. package/dist/chunk-MXNGIEPU.js +0 -3
  507. package/dist/chunk-N2ZSIIGR.js +0 -117
  508. package/dist/chunk-N5B2NILC.js +0 -5
  509. package/dist/chunk-NJITK2GP.js +0 -2
  510. package/dist/chunk-NOGJXYFO.js +0 -2
  511. package/dist/chunk-NOYBFVJA.js +0 -554
  512. package/dist/chunk-NWQXSFFU.js +0 -3
  513. package/dist/chunk-ODDUPDP7.js +0 -13
  514. package/dist/chunk-OLIWTZI3.js +0 -3
  515. package/dist/chunk-OLNV6I6U.js +0 -2
  516. package/dist/chunk-OR2E3AGZ.js +0 -2
  517. package/dist/chunk-OSR2GEHQ.js +0 -2
  518. package/dist/chunk-OSSESPDX.js +0 -3
  519. package/dist/chunk-OWOOWNJ5.js +0 -7
  520. package/dist/chunk-P42EIXTA.js +0 -2
  521. package/dist/chunk-PJFGPYTU.js +0 -2
  522. package/dist/chunk-PP7KNN7L.js +0 -2
  523. package/dist/chunk-PU7T5QYQ.js +0 -2
  524. package/dist/chunk-PWWAJSKV.js +0 -74
  525. package/dist/chunk-PZL5T7SU.js +0 -73
  526. package/dist/chunk-QBE3YX64.js +0 -23
  527. package/dist/chunk-QGVTFRY2.js +0 -7
  528. package/dist/chunk-QOJONDS7.js +0 -2
  529. package/dist/chunk-QU5XRYB5.js +0 -4
  530. package/dist/chunk-QUU5OBVK.js +0 -11
  531. package/dist/chunk-RBLQNW26.js +0 -20
  532. package/dist/chunk-RTQ7NEKG.js +0 -81
  533. package/dist/chunk-SQXRS7BG.js +0 -4
  534. package/dist/chunk-SSK6LDPC.js +0 -2
  535. package/dist/chunk-SZHGTCPP.js +0 -7
  536. package/dist/chunk-T4N4P2K5.js +0 -16
  537. package/dist/chunk-TA3QKLLU.js +0 -2
  538. package/dist/chunk-TEBQMNVI.js +0 -43
  539. package/dist/chunk-TPFHAQ2G.js +0 -2
  540. package/dist/chunk-TQPCBMWT.js +0 -5
  541. package/dist/chunk-TQZV7KV4.js +0 -2
  542. package/dist/chunk-TRNAEQ6P.js +0 -3
  543. package/dist/chunk-TY7CRN3Z.js +0 -2
  544. package/dist/chunk-UHFYCMZO.js +0 -35
  545. package/dist/chunk-UICY4GTQ.js +0 -7
  546. package/dist/chunk-UVGEWT4Y.js +0 -26
  547. package/dist/chunk-UXW33INU.js +0 -29
  548. package/dist/chunk-VMPRET3I.js +0 -5
  549. package/dist/chunk-VNLGKHS6.js +0 -6
  550. package/dist/chunk-VQILFTEH.js +0 -2
  551. package/dist/chunk-VUPHCS7Y.js +0 -57
  552. package/dist/chunk-VVZSBTSU.js +0 -23
  553. package/dist/chunk-VZRNID6A.js +0 -2
  554. package/dist/chunk-W5OXRYGE.js +0 -7
  555. package/dist/chunk-W6STWDQI.js +0 -57
  556. package/dist/chunk-W7CXK74K.js +0 -2
  557. package/dist/chunk-WB3WYIRE.js +0 -4
  558. package/dist/chunk-WDNVY4E7.js +0 -20
  559. package/dist/chunk-WK46TNUM.js +0 -3
  560. package/dist/chunk-WNTFFKAX.js +0 -12
  561. package/dist/chunk-WOIKCX6A.js +0 -2
  562. package/dist/chunk-WUN6KBHV.js +0 -2
  563. package/dist/chunk-WYCTJDVR.js +0 -2
  564. package/dist/chunk-WYPL7GF7.js +0 -2
  565. package/dist/chunk-XDAUYDFT.js +0 -2
  566. package/dist/chunk-XDQMU3BT.js +0 -2
  567. package/dist/chunk-XFA4SSO3.js +0 -3
  568. package/dist/chunk-XGZEP6GR.js +0 -8
  569. package/dist/chunk-XPDPNWTQ.js +0 -368
  570. package/dist/chunk-XRYABF57.js +0 -8
  571. package/dist/chunk-YBGKCQIS.js +0 -2
  572. package/dist/chunk-YEN6CYC7.js +0 -16
  573. package/dist/chunk-YF5IB2LF.js +0 -2
  574. package/dist/chunk-YI2AWIHC.js +0 -3
  575. package/dist/chunk-YPWBKGFU.js +0 -2
  576. package/dist/chunk-YPWHBBIS.js +0 -2
  577. package/dist/chunk-YSH6U3L4.js +0 -3
  578. package/dist/chunk-YU5DZUZI.js +0 -10
  579. package/dist/chunk-YWO5DDRC.js +0 -16
  580. package/dist/chunk-Z4CDXYNQ.js +0 -2
  581. package/dist/chunk-ZF5KHH7C.js +0 -2
  582. package/dist/chunk-ZOHS7AQV.js +0 -21
  583. package/dist/chunk-ZTI4SBFV.js +0 -3
  584. package/dist/code-MI6F2TTU.js +0 -2
  585. package/dist/code-result-json-FXALY4HE.js +0 -2
  586. package/dist/command-descriptors-P34VABY5.js +0 -343
  587. package/dist/dataflow-4KEMJPC6.js +0 -2
  588. package/dist/dependence-slice-R7FPWD5M.js +0 -2
  589. package/dist/deps-7EMQUYUT.js +0 -2
  590. package/dist/direct-navigation-6YO234F2.js +0 -3
  591. package/dist/entry-map-KOOLR26E.js +0 -2
  592. package/dist/files-OPIPJIGZ.js +0 -2
  593. package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
  594. package/dist/hierarchy-QPD2CAER.js +0 -2
  595. package/dist/imports-M6HUXRXC.js +0 -2
  596. package/dist/members-I5MEFOCT.js +0 -2
  597. package/dist/methods-5JYGGHXA.js +0 -2
  598. package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
  599. package/dist/output-continuation-command-UPQAAKBP.js +0 -3
  600. package/dist/output-pagination-3OFL2MJV.js +0 -19
  601. package/dist/project-reindex-UKKQ5PLS.js +0 -3
  602. package/dist/queries/anchors.d.ts +0 -123
  603. package/dist/queries/anchors.js +0 -2
  604. package/dist/queries/complexity-hotspots.d.ts +0 -40
  605. package/dist/queries/complexity-hotspots.js +0 -2
  606. package/dist/queries/convergence.d.ts +0 -33
  607. package/dist/queries/convergence.js +0 -2
  608. package/dist/queries/dataflow.d.ts +0 -77
  609. package/dist/queries/dataflow.js +0 -2
  610. package/dist/queries/deep-chains.d.ts +0 -5
  611. package/dist/queries/deep-chains.js +0 -2
  612. package/dist/queries/extract-candidates.d.ts +0 -52
  613. package/dist/queries/extract-candidates.js +0 -2
  614. package/dist/queries/isolated.d.ts +0 -24
  615. package/dist/queries/isolated.js +0 -2
  616. package/dist/queries/plan-context.d.ts +0 -33
  617. package/dist/queries/plan-context.js +0 -2
  618. package/dist/queries/reference-neighborhood.d.ts +0 -4
  619. package/dist/queries/reference-neighborhood.js +0 -2
  620. package/dist/queries/reference-reachability.d.ts +0 -48
  621. package/dist/queries/reference-reachability.js +0 -2
  622. package/dist/queries/self-audit.d.ts +0 -63
  623. package/dist/queries/self-audit.js +0 -2
  624. package/dist/queries/similar-chains.d.ts +0 -48
  625. package/dist/queries/similar-chains.js +0 -2
  626. package/dist/queries/slice.d.ts +0 -4
  627. package/dist/queries/slice.js +0 -2
  628. package/dist/queries/stale-abstractions.d.ts +0 -72
  629. package/dist/queries/stale-abstractions.js +0 -2
  630. package/dist/queries/system-map.d.ts +0 -449
  631. package/dist/queries/system-map.js +0 -2
  632. package/dist/queries/trace.js +0 -2
  633. package/dist/queries/twin-ab.d.ts +0 -66
  634. package/dist/queries/twin-ab.js +0 -2
  635. package/dist/queries/value-flow.d.ts +0 -43
  636. package/dist/queries/value-flow.js +0 -2
  637. package/dist/queries/wrapper-candidates.d.ts +0 -34
  638. package/dist/queries/wrapper-candidates.js +0 -2
  639. package/dist/refs-PSU4JZZW.js +0 -2
  640. package/dist/refs-pagination-JG6CJMRC.js +0 -2
  641. package/dist/slice-HYRATV64.js +0 -2
  642. package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
  643. package/dist/stats-OOJ74B32.js +0 -2
  644. package/dist/surface-VTGDYWF5.js +0 -2
  645. package/dist/symbol-resolution-WD5EU5JE.js +0 -2
  646. package/dist/system-LRQNFOR2.js +0 -2
  647. package/dist/trace-F4B6OLL4.js +0 -2
  648. package/dist/value-flow-VRPZY72V.js +0 -2
  649. package/skills/concrete-plan/SKILL.md +0 -8
  650. package/skills/concrete-plan/agents/openai.yaml +0 -4
@@ -1,3 +0,0 @@
1
- import{a as b}from"./chunk-3TNRNKAT.js";import{a as D}from"./chunk-XBGWL66K.js";import{a as F,b as S,e as C}from"./chunk-2WC2OEDO.js";import{c as P}from"./chunk-MV3CDXPI.js";import{a as I}from"./chunk-WYCTJDVR.js";import{b as M}from"./chunk-HOENASQM.js";import{c as g}from"./chunk-DRENNWRG.js";function re(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||T(s).includes(l)).sort(G)}function ie(e,n,o={}){let t=M(e,n);if(!t.match)return{kind:"missing",query:n};if(t.total>1)return{kind:"ambiguous",query:n,total:t.total,candidates:[{symbol:t.match.symbol,shortName:g(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let r=new C(e),l=r.definitionsForFile(t.match.relativePath).find(a=>a.symbol===t.match.symbol);if(!l?.isFunctionLike)return{kind:"not-entry",query:n,symbol:t.match.symbol,shortName:g(t.match.symbol),file:t.match.relativePath,reason:"The resolved symbol is not a callable definition."};let s=L(e,[l]),f=j(e,l,s.get(l.symbolId)??[]);if(!f)return{kind:"not-entry",query:n,symbol:l.symbol,shortName:g(l.symbol),file:l.relativePath,reason:"The callable is neither an external root nor an uncalled callable on a detected entry surface."};let m=K(e,r,l),i=new Set(o.expand??[]),c=z(m,i),d=new Set(c.regions.filter(a=>a.expanded).map(a=>a.id)),p=[...i].filter(a=>!d.has(a)).sort();return{kind:"matched",query:n,entry:f.result,regions:c.regions,regionEdges:c.regionEdges,unmatchedExpansions:p,coverage:{completeWithinIndexedStaticCallEdges:!0,completeWithinSelectedStaticEvidence:!0,candidateReachabilityIncluded:m.edges.some(a=>a.evidenceStrength==="candidate"),dynamicDispatchRepresented:!1,symbolCount:m.symbols.length,symbolEdgeCount:m.edges.length,exactSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="exact").length,candidateSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="candidate").length,regionCount:c.regions.length,regionEdgeCount:c.regionEdges.length,externalCallCount:m.externalCalls.length}}}function L(e,n){let o=n.filter(t=>B(e,t.relativePath)||S(e,t.symbol,t.relativePath).length>0);return P(e,o,{semantic:!1,semanticEvidence:I})}function j(e,n,o){let t=$(e,n),r=t.length>0,l=B(e,n.relativePath)&&o.length===0;if(!r&&!l)return null;let s=[...t];return l&&s.push("entry-surface-without-indexed-caller"),{definition:n,result:{symbol:n.symbol,shortName:g(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,documentation:n.documentation,confidence:r?"root":"candidate",evidence:s,indexedCallerCount:o.length}}}function B(e,n){return F(e,n)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(n)}function $(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function T(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
2
- `).toLocaleLowerCase()}function G(e,n){return N(e.confidence)-N(n.confidence)||e.file.localeCompare(n.file)||e.startLine-n.startLine||e.symbol.localeCompare(n.symbol)}function N(e){return e==="root"?0:1}function K(e,n,o){let t=new Map([[o.symbol,0]]),r=new Map,l=new Map([[o.symbol,o]]),s=new Map,f=new Map,m=[o];for(;m.length>0;){let i=n.calleeMap(m,{additive:!1,semantic:!1}),c=[];for(let d of m){let p=t.get(d.symbol)??0;r.set(d.symbol,k(d,p));for(let a of i.get(d.symbolId)??[]){let y=W(n,a,l);if(!y){let R=O(d,a);f.set(J(R),R);continue}let u=p+1,h=t.get(y.symbol);(h===void 0||u<h)&&t.set(y.symbol,u),r.set(y.symbol,k(y,Math.min(u,h??u)));let v=q(d,y,a);s.set(H(v),v),h===void 0&&c.push(y)}}m=c}return{symbols:[...r.values()].sort(Q),edges:[...s.values()].sort(U),externalCalls:[...f.values()].sort(V)}}function W(e,n,o){let t=o.get(n.symbol);if(t)return t;let r=e.definitionsForFile(n.file).find(l=>l.symbol===n.symbol)??null;return r&&o.set(r.symbol,r),r}function k(e,n){return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,depth:n}}function q(e,n,o){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),toFile:n.relativePath,source:o.source,evidenceStrength:o.source==="scip-chunk"?"candidate":"exact"}}function O(e,n){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),reportedFile:n.file,source:n.source,evidenceStrength:n.source==="scip-chunk"?"candidate":"exact"}}function z(e,n){let o=b(e.symbols,i=>i.file),t=b(e.edges.filter(i=>i.fromFile===i.toFile),i=>i.fromFile),r=b(e.externalCalls,i=>i.fromFile),l=A(e.edges.filter(i=>i.fromFile!==i.toFile)),s=b(l,i=>i.toRegionId),f=b(l,i=>i.fromRegionId);return{regions:[...o.entries()].map(([i,c])=>{let d=x(i),p=n.has(d),a=t.get(i)??[],y=r.get(i)??[];return{id:d,file:i,minDepth:Math.min(...c.map(u=>u.depth)),symbolCount:c.length,internalEdgeCount:a.length,externalCallCount:y.length,incomingRegionIds:E((s.get(d)??[]).map(u=>u.fromRegionId)),outgoingRegionIds:E((f.get(d)??[]).map(u=>u.toRegionId)),expanded:p,symbols:p?c:[],internalEdges:p?a:[],externalCalls:p?y:[]}}).sort((i,c)=>i.minDepth-c.minDepth||i.file.localeCompare(c.file)),regionEdges:l}}function A(e){let n=new Map;for(let o of e){let t=`${o.fromFile}\0${o.toFile}`,r=n.get(t)??[];r.push(o),n.set(t,r)}return[...n.values()].map(o=>{let t=o[0];return{fromRegionId:x(t.fromFile),fromFile:t.fromFile,toRegionId:x(t.toFile),toFile:t.toFile,callCount:o.length,exactCallCount:o.filter(r=>r.evidenceStrength==="exact").length,candidateCallCount:o.filter(r=>r.evidenceStrength==="candidate").length,fromSymbols:E(o.map(r=>r.fromShortName)),toSymbols:E(o.map(r=>r.toShortName)),evidence:E(o.map(r=>r.source))}}).sort((o,t)=>o.fromFile.localeCompare(t.fromFile)||o.toFile.localeCompare(t.toFile))}function x(e){return`file:${e}`}function E(e){return[...new Set(e)].sort()}function H(e){return`${e.fromSymbol}\0${e.toSymbol}`}function J(e){return`${e.fromSymbol}\0${e.toSymbol}`}function Q(e,n){return e.depth-n.depth||e.file.localeCompare(n.file)||e.symbol.localeCompare(n.symbol)}function U(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}function V(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}export{re as a,ie as b};
3
- //# sourceMappingURL=chunk-JS4PGXMV.js.map
@@ -1,80 +0,0 @@
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 +0,0 @@
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
- `).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
- `).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
- ${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-JYR66JN5.js.map
@@ -1,9 +0,0 @@
1
- var be=new Map([[8,"\u2408"],[9,"\u2409"],[10,"\u2424"],[13,"\u240D"]]),Rt=6500,At=8e3,It=6500,Lt=3500;function Se(e,t={}){let r=t.allowNewlines??!0,n=t.allowTabs??!0,i="";for(let o=0;o<e.length;){let s=e.charCodeAt(o);if(s===27){o=Fe(e,o);continue}if(s===155){o=U(e,o+1);continue}if(s===144||s===152||s===157||s===158||s===159){o=q(e,o+1);continue}if(we(s)){s===10&&r?i+=`
2
- `:s===9&&n?i+=" ":i+=be.get(s)??"\uFFFD",o+=1;continue}if(he(s)){i+="\uFFFD",o+=1;continue}i+=e[o],o+=1}return i}function Tt(e){return Se(e,{allowNewlines:!1,allowTabs:!1})}function Dt(e,t=r=>process.stdout.write(r)){t(`${e}
3
- `)}function Fe(e,t){let r=e.charCodeAt(t+1);if(Number.isNaN(r))return e.length;if(r===91)return U(e,t+2);if(r===80||r===88||r===93||r===94||r===95)return q(e,t+2);let n=t+1;for(;n<e.length&&xe(e.charCodeAt(n));)n+=1;return n<e.length&&ke(e.charCodeAt(n))?n+1:t+1}function U(e,t){let r=t;for(;r<e.length;){let n=e.charCodeAt(r);if(r+=1,n>=64&&n<=126)return r}return e.length}function q(e,t){let r=t;for(;r<e.length;){let n=e.charCodeAt(r);if(n===7||n===156)return r+1;if(n===27&&e.charCodeAt(r+1)===92)return r+2;r+=1}return e.length}function xe(e){return e>=32&&e<=47}function ke(e){return e>=48&&e<=126}function we(e){return e<=31||e>=127&&e<=159}function he(e){return e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297}import{closeSync as W,fstatSync as $,openSync as z,readFileSync as Ee,readSync as Pe}from"fs";import{createHash as _t}from"crypto";var J=8*1024*1024,Re=64*1024*1024,Ae=512*1024*1024,Ie=256*1024*1024,m=class extends Error{constructor(r,n,i,o,s){let c=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${c}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function j(e,t){K(t.maxBytes);let r=String(e),n=z(e,"r");try{let i=$(n);Le(i,t,r);let o=Ee(n),s=$(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new m(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{W(n)}}function Y(e,t,r="utf8"){return j(e,t).toString(r)}function b(e,t){return Y(e,{maxBytes:J,inputKind:t})}function G(e,t){K(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=Pe(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new m(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function X(e,t){let r=z(e,"r");try{return G(r,t)}finally{W(r)}}function P(e,t,r="utf8"){return X(e,t).toString(r)}function Le(e,t,r){if(!e.isFile())throw new m(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new m(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function K(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function Jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jt(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Yt(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Gt(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Te=/^[a-f0-9]{64}$/u;function Xt(e){return typeof e=="string"&&Te.test(e)}function Kt(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function Vt(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var De=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function R(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!De.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function x(e,t){return e.version===t.version&&e.pid===t.pid&&e.platform===t.platform&&e.startToken===t.startToken}import{execFileSync as Oe}from"child_process";import{platform as Ne}from"os";var ve=1e3,V=16*1024,A;function Z(e,t=Q){if(!Number.isSafeInteger(e)||e<=0)return null;let r=e===process.pid&&t===Q;if(r&&A)return{...A};try{let n=_e(e,t);if(!n)return null;let i={version:1,pid:e,platform:t.platform,startToken:n};return r&&(A=i),{...i}}catch{return null}}function _e(e,t){if(t.platform==="linux"||t.platform==="android")return Ce(t.readFile(`/proc/${e}/stat`));if(t.platform==="win32"){let r=`([DateTimeOffset](Get-Process -Id ${e} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return H(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",r]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?H(t.run("ps",["-p",String(e),"-o","lstart="])):null}function Ce(e){let t=e.lastIndexOf(")");if(t<0)return null;let n=e.slice(t+1).trim().split(/\s+/)[19];return n&&/^\d+$/.test(n)?n:null}function H(e){let t=e.trim();return t===""?null:t}var Q={platform:Ne(),readFile(e){return P(e,{maxBytes:V,inputKind:"process identity pseudo-file"})},run(e,t){return Oe(e,[...t],{encoding:"utf8",timeout:ve,maxBuffer:V,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function ee(e){try{return process.kill(e,0),!0}catch(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="EPERM"}}import{randomUUID as Me}from"crypto";import{closeSync as Be,fsyncSync as Ue,linkSync as qe,mkdirSync as $e,openSync as We,statSync as ze,unlinkSync as Je,writeSync as je}from"fs";import{dirname as O}from"path";function S(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function p(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var L="scip-query-process-lock",T=1,k=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:ee,readProcessIdentity:Z,randomToken:()=>Me(),makeDirectory:e=>$e(e,{recursive:!0}),openFile:(e,t,r)=>We(e,t,r),writeFile:(e,t,r,n)=>je(e,t,r,n),syncFile:e=>Ue(e),closeFile:e=>Be(e),linkFile:(e,t)=>qe(e,t),readFile:e=>b(e,"process lock record"),statFile:e=>{let t=ze(e);return{dev:t.dev,ino:t.ino,size:t.size,mtimeMs:t.mtimeMs}},removeFile:e=>Je(e)});function te(e,t){let r=t.runtime??k;r.makeDirectory(O(e));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:re(e,t,r),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=y(e,{parseLegacy:t.parseLegacy,runtime:r});if(i===0&&Ge(e,s,{creationGraceMs:t.creationGraceMs,parseLegacy:t.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:y(e,{parseLegacy:t.parseLegacy,runtime:r})}}function y(e,t={}){let r=t.runtime??k,n,i;try{n=r.statFile(e),i=r.readFile(e)}catch(l){return l.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=Ye(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:Ve(s),parsed:o};let c=t.parseLegacy?.(o)??null;return c?{state:"legacy",raw:i,identity:n,owner:c,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function Ye(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(t.protocol!==L||t.version!==T||typeof t.kind!="string"||t.kind.trim()===""||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.token!="string"||t.token.trim()===""||typeof t.startedAt!="string"||!Number.isFinite(Date.parse(t.startedAt))||t.detail!==void 0&&(typeof t.detail!="object"||t.detail===null||Array.isArray(t.detail)))return null;let r=t.processIdentity===void 0?null:R(t.processIdentity);return t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{protocol:L,version:T,kind:t.kind,pid:t.pid,token:t.token,...r?{processIdentity:r}:{},startedAt:t.startedAt,...t.detail?{detail:t.detail}:{}}}function Ge(e,t,r={}){let n=r.runtime??k;if(!D(t,n))return!1;let i=Ke(`${e}.reclaim`,n);if(!i)return!1;try{let o=y(e,{parseLegacy:r.parseLegacy,runtime:n});return!ie(t,o)||!D(o,n)?!1:N(e,n)}finally{i.release()}}function re(e,t,r){let n=t.directoryDurability??"durable",i=t.pid??process.pid,o=r.randomToken(),s=t.processIdentity===void 0?r.readProcessIdentity(i):t.processIdentity,c={protocol:L,version:T,kind:t.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(r.wallNow()).toISOString(),...t.detail?{detail:t.detail}:{}},l=`${e}.${o}.candidate`,a=r.openFile(l,"wx",384),u;try{S(a,Buffer.from(`${JSON.stringify(c)}
4
- `),r,"process lock"),r.syncFile(a)}catch(d){u=d}try{r.closeFile(a)}catch(d){u??=d}if(u!==void 0)throw I(l,r),u;try{r.linkFile(l,e)}catch(d){throw I(l,r),d}if(I(l,r),n==="durable")try{oe(O(e),r)}catch(d){throw Xe(e,c,r),d}let f=!1;return{path:e,record:c,release:()=>f?!1:(f=!0,ne(e,c,r,n))}}function Xe(e,t,r=k){return ne(e,t,r,"durable")}function ne(e,t,r,n){let i=y(e,{runtime:r});return i.state!=="valid"||!i.record||i.record.pid!==t.pid||i.record.token!==t.token||t.processIdentity&&(!i.record.processIdentity||!x(t.processIdentity,i.record.processIdentity))?!1:N(e,r,n)}function Ke(e,t){for(let r=0;r<2;r+=1)try{return re(e,{kind:"reclaim-guard",runtime:t},t)}catch(n){if(n.code!=="EEXIST")return null;let i=y(e,{runtime:t});if(r>0||!D(i,t))return null;let o=y(e,{runtime:t});if(!ie(i,o)||!N(e,t))return null}return null}function D(e,t){if(e.state==="missing")return!1;if(e.owner){if(!t.isProcessAlive(e.owner.pid))return!0;if(!e.owner.processIdentity)return!1;let r=t.readProcessIdentity(e.owner.pid);return r!==null&&!x(e.owner.processIdentity,r)}return!1}function ie(e,t){return e.state===t.state&&e.raw===t.raw&&e.identity!==void 0&&t.identity!==void 0&&e.identity.dev===t.identity.dev&&e.identity.ino===t.identity.ino&&e.identity.size===t.identity.size&&e.identity.mtimeMs===t.identity.mtimeMs}function Ve(e){return{pid:e.pid,...e.processIdentity?{processIdentity:e.processIdentity}:{}}}function oe(e,t){let r;try{r=t.openFile(e,"r")}catch(n){if(p(n,process.platform))return;throw n}try{t.syncFile(r)}catch(n){if(!p(n,process.platform))throw n}finally{t.closeFile(r)}}function N(e,t,r="durable"){try{return t.removeFile(e),r==="durable"&&oe(O(e),t),!0}catch{return!1}}function I(e,t){try{t.removeFile(e)}catch{}}import{randomUUID as rt}from"crypto";import{closeSync as nt,existsSync as it,fsyncSync as ot,linkSync as st,mkdirSync as ct,openSync as at,renameSync as lt,unlinkSync as ut,writeSync as dt}from"fs";import{dirname as ae}from"path";import{closeSync as He,existsSync as Qe,fsyncSync as Ze,mkdirSync as et,openSync as tt}from"fs";import{dirname as se}from"path";var ce=Object.freeze({platform:process.platform,pathExists:e=>Qe(e),makeDirectory:e=>et(e,{recursive:!0}),openFile:(e,t,r)=>tt(e,t,r),syncFile:e=>Ze(e),closeFile:e=>He(e)});function w(e,t=ce){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=se(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=F(i,g(se(o),t));return i}function g(e,t=ce){let r;try{r=t.openFile(e,"r")}catch(n){if(p(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(p(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function F(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}var le=Object.freeze({platform:process.platform,randomToken:()=>rt(),pathExists:e=>it(e),makeDirectory:e=>ct(e,{recursive:!0}),openFile:(e,t,r)=>at(e,t,r),writeFile:(e,t,r,n)=>dt(e,t,r,n),syncFile:e=>ot(e),closeFile:e=>nt(e),renameFile:(e,t)=>lt(e,t),linkFile:(e,t)=>st(e,t),removeFile:e=>ut(e)});function ue(e,t,r={}){let n=r.durability??"visibility",i=r.runtime??le,o=ae(e),s=n==="durable"?w(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,a,u=!1;try{a=i.openFile(c,"wx",r.mode??384),u=!0,S(a,l,i,"atomic file"),n==="durable"&&i.syncFile(a),i.closeFile(a),a=void 0,i.renameFile(c,e),u=!1;let f=n==="durable"?F(s,g(o,i)):"not-requested";return de(n,f)}finally{if(a!==void 0)try{i.closeFile(a)}catch{}if(u)try{i.removeFile(c)}catch{}}}function hr(e,t,r={}){let n=r.durability??"visibility",i=r.runtime??le;if(!i.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=ae(e),s=n==="durable"?w(o,i):(i.makeDirectory(o),"not-requested"),c=`${e}.tmp-${i.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,a,u=!1;try{a=i.openFile(c,"wx",r.mode??384),u=!0,S(a,l,i,"exclusive atomic file"),n==="durable"&&i.syncFile(a),i.closeFile(a),a=void 0,i.linkFile(c,e);let f=n==="durable"?g(o,i):"not-requested";i.removeFile(c),u=!1;let d=n==="durable"?F(s,f,g(o,i)):"not-requested";return de(n,d)}finally{if(a!==void 0)try{i.closeFile(a)}catch{}if(u)try{i.removeFile(c)}catch{}}}function de(e,t){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":t==="synced"?"directory-durable":"file-flushed",directorySync:t}}function h(e,t,r={}){ue(e,mt(t,r),{durability:"visibility",runtime:r.runtime})}function mt(e,t){let r=JSON.stringify(e,null,t.spacing);return t.trailingNewline?`${r}
5
- `:r}import{createHash as ft}from"crypto";import{existsSync as _,mkdirSync as pt,rmSync as yt}from"fs";import{tmpdir as gt}from"os";import{isAbsolute as bt,join as pe,resolve as E}from"path";var ye=1,St="SCIP_QUERY_SESSION",me="SCIP_QUERY_SESSION_DIR",Ft=128,xt=8,kt=32768,fe=new Map;function _r(e,t,r,n=!0,i){if(!n||e!=="anchors"&&e!=="system-map")return;let o=B();if(!o)return;let s=ge(t),c=M(s,o);if(e==="system-map"){r?yt(c,{force:!0}):_(c)&&i&&v(c,()=>{let l=C(c,s,o);l&&h(c,{...l,pendingMapContinuation:i,mapExecution:void 0,updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})});return}v(c,()=>{let l=wt(s,o),a={version:ye,projectRoot:s,sessionIdentity:o,mapRequired:!0,...l.length>0?{recommendedMapCommands:l}:{},updatedAt:new Date().toISOString()};h(c,a,{spacing:2,trailingNewline:!0})})}function Cr(e,t=!0){if(!t)return;let r=B();if(!r)return;let n=ge(e),i=M(n,r);_(i)&&v(i,()=>{let o=C(i,n,r);if(o){if(o.pendingMapContinuation)throw new Error(["MAP TRANSPORT INCOMPLETE","The selected system map has already been computed. Restarting it would repeat the same repository work.",`Continue exactly: ${o.pendingMapContinuation}`].join(`
6
- `));if(o.mapExecution&&Et(o.mapExecution.processId))throw new Error(["NAVIGATION MAP ALREADY RUNNING","A selected system map is already computing in this SCIP_QUERY_SESSION.","Poll the existing terminal execution. Do not launch a duplicate map or inspect in parallel."].join(`
7
- `));h(i,{...o,mapExecution:{processId:process.pid,startedAt:new Date().toISOString()},updatedAt:new Date().toISOString()},{spacing:2,trailingNewline:!0})}})}function Mr(e,t,r=!0){if(!r)return;let n=B();if(!n)return;let i=M(E(e),n);if(!_(i))return;let o=C(i,E(e),n);if(!o?.mapRequired)return;let s=o.recommendedMapCommands?.length?["This refusal is a recoverable protocol step, not evidence that the requested code cannot be explored.","Run exactly one of the ranked map commands below, then finish every emitted continuation:",...o.recommendedMapCommands.map((c,l)=>` [${l+1}] ${c}`)]:[`Do not retry ${t}. Run one printed next-abstraction system-map command and finish every emitted continuation first.`];throw new Error(["NAVIGATION MAP REQUIRED","An anchors locator completed in this SCIP_QUERY_SESSION, but its selected system map has not reached transport completion.",`Do not retry ${t}.`,...s,"The map must complete before the agent can choose source detail; map and detail exploration cannot run concurrently."].join(`
8
- `))}function C(e,t,r){try{let n=JSON.parse(b(e,"navigation session state"));return n.version===ye&&n.projectRoot===t&&n.sessionIdentity===r&&n.mapRequired===!0&&(n.recommendedMapCommands===void 0||Array.isArray(n.recommendedMapCommands)&&n.recommendedMapCommands.length<=xt&&n.recommendedMapCommands.every(i=>typeof i=="string"&&i.startsWith("scip-query system-map ")&&i.length<=kt))&&(n.pendingMapContinuation===void 0||typeof n.pendingMapContinuation=="string")&&(n.mapExecution===void 0||typeof n.mapExecution=="object"&&n.mapExecution!==null&&Number.isSafeInteger(n.mapExecution.processId)&&typeof n.mapExecution.startedAt=="string")?n:null}catch{return null}}function wt(e,t){let r=ht(e,t),n=fe.get(r)??[];return fe.delete(r),n}function ht(e,t){return`${e}\0${t}`}function Et(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function M(e,t){let r=Pt();pt(r,{recursive:!0,mode:448});let n=ft("sha256").update(e).update("\0").update(t).digest("hex");return pe(r,`navigation-${n}.json`)}function Pt(){let e=process.env[me];if(!e)return pe(gt(),`scip-query-source-sessions-${process.getuid?.()??"user"}`);if(!bt(e))throw new Error(`${me} must be an absolute path.`);return E(e)}function ge(e){let t=process.env.SCIP_QUERY_PROJECT_ROOT?.trim();return E(t||e)}function B(){let e=process.env[St]?.trim();if(e&&!(e.length>Ft||!/^[A-Za-z0-9._:-]+$/u.test(e)))return`explicit:${e}`}function v(e,t){let r=te(`${e}.lock`,{kind:"navigation-session",detail:{state:e.slice(-17,-5)}});if(r.kind!=="acquired")throw new Error("Navigation session state is busy. Retry the completed command.");try{t()}finally{r.lock.release()}}export{Rt as a,At as b,It as c,Lt as d,Tt as e,Dt as f,S as g,ce as h,w as i,g as j,F as k,J as l,m,Y as n,b as o,Jt as p,jt as q,Yt as r,Gt as s,Xt as t,Kt as u,Vt as v,R as w,x,Z as y,ee as z,te as A,y as B,hr as C,h as D,_r as E,Cr as F,Mr as G};
9
- //# sourceMappingURL=chunk-KFOYCQAJ.js.map
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
1
- function T(r,t){let e=new Set;for(let n of r)t.has(n)&&e.add(n);return e}function l(r,t){let e=new Set;for(let n of r)t.has(n)||e.add(n);return e}function S(r,t){if(r.size===0&&t.size===0)return 0;let e=0;for(let i of r)t.has(i)&&(e+=1);let n=r.size+t.size-e;return n===0?0:e/n}function p(r,t){if(r.size===0)return 0;let e=0;for(let n of r)t.has(n)&&(e+=1);return e/r.size}function M(r,t){if(t<=0)return new Map;let e=new Map;for(let[n,i]of r)i>0&&e.set(n,Math.log(t/i));return e}function g(r){let t=[...r.values()].sort((n,i)=>n-i);if(t.length===0)return 0;let e=Math.floor(t.length/2);return t.length%2===0?(t[e-1]+t[e])/2:t[e]}function b(r,t){let e=0;for(let n of r){let i=t.get(n)??0;e+=i*i}return Math.sqrt(e)}function w(r,t,e,n={}){let i=0,m=0,u=0,d=n.medianIdf??g(e),f=[],h=[];for(let s of r){let o=e.get(s)??0;m+=o*o,t.has(s)&&(i+=o*o,o>=d?f.push(s):h.push(s))}if(f.length===0&&h.length===0)return{similarity:0,significantShared:[],trivialShared:[]};for(let s of t){let o=e.get(s)??0;u+=o*o}let a=Math.sqrt(m)*Math.sqrt(u),c=a>0?i/a:0;return f.sort((s,o)=>(e.get(o)??0)-(e.get(s)??0)),{similarity:c,significantShared:f,trivialShared:h}}function x(r,t,e,n){let i=0,m=n.medianIdf??g(e),u=[],d=[];for(let a of r){if(!t.has(a))continue;let c=e.get(a)??0;i+=c*c,c>=m?u.push(a):d.push(a)}if(u.length===0&&d.length===0)return{similarity:0,significantShared:[],trivialShared:[]};let f=n.magnitudeA*n.magnitudeB,h=f>0?i/f:0;return u.sort((a,c)=>(e.get(c)??0)-(e.get(a)??0)),{similarity:h,significantShared:u,trivialShared:d}}export{T as a,l as b,S as c,p as d,M as e,g as f,b as g,w as h,x as i};
2
- //# sourceMappingURL=chunk-KMVGRIO2.js.map
@@ -1,5 +0,0 @@
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,29 +0,0 @@
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-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
- `).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
- `).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
- file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),s.length===0){console.log(`
6
- \u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550
7
- No compiler-owned constructs were found for ${JSON.stringify(o)}.`),console.log(`
8
- \u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550
9
- Missing compiler constructs do not establish that the current text file is empty or irrelevant.`),console.log(`
10
- \u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550
11
- Compiler ownership is unavailable or empty for this exact file selector.`),console.log(`
12
- \u2550\u2550\u2550 RECOVERY \u2550\u2550\u2550
13
- Read current source exactly with: scip-query code ${W(o)}`);return}function i(c,a){for(let l of c){let u=" ".repeat(a),p=r&&l.signature?` - ${Ee(l.signature)}`:"";console.log(`${u}${ee(l.startLine,l.endLine)} ${l.shortName}${p}`),i(l.children,a+1)}}console.log(`
14
- \u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550`),i(s,0),console.log(`
15
- \u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550
16
- These are compiler-owned identities and source ranges. Ownership and nesting do not establish execution or task relevance.`),console.log(`
17
- \u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550
18
- ${we(s)} compiler construct(s) returned in ${s.length} top-level tree(s).`),console.log(`
19
- \u2550\u2550\u2550 RECOVERY \u2550\u2550\u2550
20
- Every displayed file:line is an exact evidence root. Exact top-level symbol selectors:`);for(let c of s){let a=`'${c.symbol.replaceAll("'","'\\''")}'`;console.log(` ${c.shortName}: ${a}`)}});function we(t){return t.reduce((n,e)=>n+1+we(e.children),0)}function Ee(t){return t.length>120?`${t.slice(0,117)}...`:t}var We=ie("refs",({db:t,args:n,opts:e,budget:o})=>{let r=T(n,0),s=j(e,"cursor"),i=ae(e,"limit"),c=M(t),a=s?ye(s,{command:"refs",target:r,indexGeneration:c}):void 0,l=!a&&i===void 0,u=l?qe(t,r,o.semantic):a?.version===1?ze(t,r,a.offset,i??50,o.semantic):_e(t,r,{limit:i??50,cursor:a,semantic:a?.semanticEnrichment??R(e,"full"),indexGeneration:c}),{rows:p,continuation:d,coverage:m}=u;if(R(e,"json")){let f={...K(t,r,p,"references"),pagination:u.pagination};P("refs",n,e,f,{analysisBudget:o.analysisBudget,coverage:m});return}if(p.length===0)return E.empty(xe(t,r,"No references found."));if(Se(t,r),E.groupedByFile(p,f=>` line ${h(f.line)}`),u.pagination.producer==="complete-only"&&!l&&console.error(`
21
- This evidence provider required complete analysis; --limit bounded the returned rows, not analysis work.`),d){let f=m.totalKnown?`${m.omitted} omitted; `:"More references are available; ";console.log(`
22
- ${f}continue with --cursor ${d.cursor}`)}});function qe(t,n,e){let o=w(t,n,{semantic:e}).sort(b);return{rows:o,coverage:{complete:!0,totalKnown:!0,returned:o.length,total:o.length,omitted:0},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:e}}}function ze(t,n,e,o,r){let s=w(t,n,{semantic:r}).sort(b);if(e>s.length)throw new Error("This cursor points past the current result set. Run again without --cursor.");let i=s.slice(e,e+o),c=e+i.length,a=i[i.length-1],l=e===0&&i.length===s.length,u=c<s.length&&a?{cursor:J({command:"refs",target:n,after:a,producer:"complete-only",semanticEnrichment:r,indexGeneration:M(t)}),indexGeneration:M(t)}:void 0;return{rows:i,continuation:u,coverage:l?{complete:!0,totalKnown:!0,returned:i.length,total:i.length,omitted:0}:{complete:!1,totalKnown:!0,returned:i.length,total:s.length,omitted:s.length-i.length,...u?{continuation:u}:{}},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:r}}}function _e(t,n,e){let o=de(t,n,{limit:e.limit,after:e.cursor?.after,producer:e.cursor?.producer,semantic:e.semantic}),r=o.rows[o.rows.length-1],s=o.hasMore&&r?{cursor:J({command:"refs",target:n,after:r,producer:o.producer,semanticEnrichment:o.semanticEnrichment,indexGeneration:e.indexGeneration}),indexGeneration:e.indexGeneration}:void 0,i=!e.cursor&&!o.hasMore;return{rows:o.rows,continuation:s,coverage:i?{complete:!0,totalKnown:!0,returned:o.rows.length,total:o.rows.length,omitted:0}:{complete:!1,totalKnown:!1,returned:o.rows.length,...s?{continuation:s}:{}},pagination:{cursorVersion:2,producer:o.producer,semanticEnrichment:o.semanticEnrichment}}}var Qe=k(({db:t,args:n,opts:e})=>{oe(t.config.projectRoot,"code",e.session!==!1);let o=se(n,0),r=ce(e,"context",0),s=He(e),i=X(t,o,{context:r,members:s}),c=Re(i);if(R(e,"json")){if(c){let u=o[0];P("code",o,e,K(t,u,c,"code"),{resultOnly:be(t,u,c)});return}P("code",o,e,i,{coverage:{complete:!0,totalKnown:!0,returned:i.entries.length,total:i.requested,omitted:0},resultOnly:ve(i)});return}let a=c?et(c,i.bindingClosure,!0):Xe(i,!0);if(c){process.stdout.write(a);return}let l=i.entries[0];if(i.requested===1&&l?.status==="missing")return E.empty(U(l.selector,l.suggestions));process.stdout.write(a)}),Ye=k(({opts:t})=>{let n=R(t,"reset"),e=ne(n);if(!e.enabled){E.empty(e.reason??"Exploration-session deduplication is unavailable.");return}console.log(n?"Exploration-session ledger reset; subsequent exploration will emit evidence again.":`Exploration session: ${e.uniqueLines.toLocaleString()} unique source line(s) and ${e.evidenceItems.toLocaleString()} graph evidence item(s) delivered across ${e.emissions.toLocaleString()} emission(s).`),!n&&e.rows.length>0&&console.log(e.rows.join(`
23
- `))});function He(t){let n=j(t,"members")??"exported";if(n==="exported"||n==="all")return n;throw new RangeError(`--members must be "exported" or "all", got "${n}".`)}function Xe(t,n=!1){let e=["\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550",` ${t.entries.map(a=>a.selector).join(", ")}`,"",`\u2550\u2550\u2550 OBSERVED FACTS (${t.requested} requested: ${t.matched} matched, ${t.ambiguous} ambiguous, ${t.missing} missing) \u2550\u2550\u2550`],o=new Set;for(let a of t.entries)for(let l of a.results){let u=`${l.relativePath}:${l.startLine}:${l.endLine}`;if(o.has(u)){e.push("",` ${a.selector}: source already included at ${C(l.relativePath,l.startLine,l.endLine)}.`);continue}o.add(u),(t.requested>1||a.status==="ambiguous")&&e.push("",` selector ${a.selector}`),$e(e,l,n)}let r=t.entries.filter(a=>a.kind==="file-source");if(r.length>0){e.push("","\u2550\u2550\u2550 FILE SOURCE COVERAGE \u2550\u2550\u2550");for(let a of r)tt(e,a)}let s=t.entries.filter(a=>a.rangeCoverage);if(s.length>0){e.push("","\u2550\u2550\u2550 RANGE SOURCE COVERAGE \u2550\u2550\u2550");for(let a of s)Ze(e,a)}let i=t.entries.filter(a=>a.status==="ambiguous");if(i.length>0){e.push("","\u2550\u2550\u2550 AMBIGUOUS SELECTORS \u2550\u2550\u2550");for(let a of i)nt(e,a)}let c=t.entries.filter(a=>a.status==="missing");if(c.length>0){e.push("","\u2550\u2550\u2550 MISSING SELECTORS \u2550\u2550\u2550");for(let a of c){let l=a.suggestions.length>0?` Suggestions: ${a.suggestions.join(", ")}`:"";e.push(` ${a.selector}: ${a.reason==="definition-source-unreadable"?"definition source unreadable.":"no definition matched."}${l}`)}}return Oe(e,t.bindingClosure),Pe(e,t.entries.flatMap(a=>a.results)),ot(e,t),`${e.join(`
24
- `)}
25
- `}function Ze(t,n){let e=n.rangeCoverage;if(e&&(t.push(` ${n.selector} \u2014 requested lines returned plus ${e.returnedBodies} same-file callable body(ies), covering ${e.returnedDefinitions}/${e.referencedDefinitions} statically attributed same-file definition(s).`,` basis: ${e.basis}; dynamic calls and references outside the requested lines are not claimed`),e.omittedLedger.length!==0)){t.push(" OMITTED REFERENCED DEFINITIONS");for(let o of e.omittedLedger)t.push(` ${C(o.relativePath,o.startLine,o.endLine)} ${o.shortName}`)}}function et(t,n,e=!1){let o=["\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550",` resolved-selector=${t.symbol}`,"","\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550"];return $e(o,t,e),Oe(o,n),Pe(o,[t]),o.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550"," One exact selector resolved to the complete source body shown; callers and runtime relationships are not implied."),`${o.join(`
26
- `)}
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
- `);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-L6PJPETJ.js.map
@@ -1,2 +0,0 @@
1
- import{a as le}from"./chunk-JTQVMR42.js";import{a as de}from"./chunk-QGVTFRY2.js";import{a as pe}from"./chunk-HKGFPJ4T.js";import{a as he}from"./chunk-6YTSKJJ3.js";import{a as ge}from"./chunk-D2DHWI3D.js";import{a as se}from"./chunk-HVF5VBG6.js";import{a as ue}from"./chunk-LMZ5PRUV.js";import{a as ce}from"./chunk-F7DY272B.js";import{a as oe}from"./chunk-FFRKR4EQ.js";import{a as ae}from"./chunk-3JKSW6LJ.js";import{a as ne}from"./chunk-I55I7XXP.js";import{a as me}from"./chunk-PU7T5QYQ.js";import{a as ie}from"./chunk-3PJABJSU.js";import{a as re}from"./chunk-IL676XCC.js";import{a as J}from"./chunk-LQRQN2XA.js";import{b as ee}from"./chunk-4UX2F3JX.js";import{a as Z}from"./chunk-JGKUET5J.js";import{b as te}from"./chunk-XDAUYDFT.js";import{a as M,b as U}from"./chunk-EVFUMY4R.js";import{b as Y}from"./chunk-DHUIOLDT.js";import{a as K}from"./chunk-6HFCYNYE.js";import{a as X}from"./chunk-QU5XRYB5.js";import{f as Q}from"./chunk-TQPCBMWT.js";import{a as W}from"./chunk-GSP44ENC.js";import{f as A,h as T}from"./chunk-XRYABF57.js";import{a as G}from"./chunk-ODDUPDP7.js";import{D as O,z as j}from"./chunk-ZOHS7AQV.js";import{h as k}from"./chunk-FESCRNVV.js";import{Aa as q,Ba as z}from"./chunk-N5B2NILC.js";import{readdirSync as Ye}from"fs";import{basename as Xe,join as fe}from"path";function Qe(e,r,t={}){let i=new Set(e),n=new Set(r),o=[...n].filter(s=>!i.has(s)).sort(),a=t.allowExtra?[]:[...i].filter(s=>!n.has(s)).sort();return{missing:o,extra:a}}function Je(e,r){let t=Ze(e,r.file,r.keys);if(!t.ok)return{name:r.name,file:r.file,status:"unavailable",missing:[],extra:[],unavailableReason:t.reason};let i=ot(e.config.projectRoot,r.mustEqual),n=Qe(t.keys,i,{allowExtra:r.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:r.name,file:r.file,status:o,missing:n.missing,extra:n.extra}}function ve(e,r){return r.map(t=>Je(e,t))}function Ze(e,r,t){return t.type==="markdown-list"?nt(e,r,t.marker):et(e,r,t)}function et(e,r,t){if(!k(e,r))return{ok:!1,reason:`file not found: ${r}`};let n=j(r);if(!n)return{ok:!1,reason:`unsupported file type for ${t.type} extraction: ${r}`};let o=O(e,r);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${r}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let a=t.type==="object-literal-keys"?tt(o,t.identifier):it(o,t.identifier);return a===null?{ok:!1,reason:`no ${t.type==="object-literal-keys"?"object literal":"string array"} named "${t.identifier}" found in ${r}`}:{ok:!0,keys:a}}function be(e){let r=e.childForFieldName("value");return r?r.type==="as_expression"||r.type==="satisfies_expression"?r.namedChild(0):r:null}function tt(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type==="object")return rt(n)}return null}function rt(e){let r=new Set;for(let t of e.namedChildren)if(t.type==="pair"){let i=t.childForFieldName("key");i&&r.add(ye(i.text))}else t.type==="shorthand_property_identifier"&&r.add(t.text);return[...r].sort()}function it(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=be(t);if(n?.type!=="array")continue;let o=new Set;for(let a of n.namedChildren)a.type==="string"&&o.add(ye(a.text));return[...o].sort()}return null}function ye(e){return e.length>=2&&(e[0]==="'"&&e.endsWith("'")||e[0]==='"'&&e.endsWith('"'))?e.slice(1,-1):e}function nt(e,r,t){let i=k(e,r);if(!i)return{ok:!1,reason:`file not found: ${r}`};let n=Se(i,t);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${t} --> ... <!-- END GENERATED ${t} --> block in ${r}`}:{ok:!0,keys:xe(n)}}function Se(e,r){let t=G(r),n=new RegExp(`<!--\\s*BEGIN GENERATED ${t}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${t}\\s*-->`).exec(e);return n?n[1]:null}function xe(e){let r=new Set;for(let t of e.matchAll(/`([a-z][a-z0-9-]*)`/g))r.add(t[1]);for(let t of e.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))r.add(t[1]);return[...r].sort()}function ot(e,r){switch(r.type){case"top-level-dirs":return Ce(fe(e,r.path));case"file-glob":return[...new Set(W(e,r.pattern).map(t=>Xe(t)))].sort();case"registered-commands":return at(e);case"builtin-skills":return Ce(fe(e,"skills"))}}function Ce(e){let r;try{r=Ye(e,{withFileTypes:!0})}catch{return[]}return r.filter(t=>t.isDirectory()&&!t.name.startsWith(".")).map(t=>t.name).sort()}function at(e){let r;try{r=q(e,"docs/COMMAND_REFERENCE.md",{maxBytes:8*1024*1024,inputKind:"generated command reference"})}catch(i){if(!z(i))throw i;return[]}let t=Se(r,"COMMAND REFERENCE");return t?xe(t):[]}function h(e){return e.scoreCount??e.count}function B(e){let r=lt(e),{breakdown:t,pressure:i}=dt(e),n=He(t,"risk"),o=He(t,"hygiene");return{score:Math.min(n,o),riskScore:n,hygieneScore:o,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:h(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:h(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:h(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:st(e),validation:ut(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,detectorEvidence:e.detectorEvidence,warnings:e.warnings.length>0?e.warnings:void 0}}function st(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ct(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ct(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:p(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ut(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[v,g]of Object.entries(r))i.has(v)?n+=g.fixChanges:(o+=g.fixChanges,a+=1);let s=i.size>0?p(n/i.size):0,l=a>0?p(o/a):0,S={};for(let[v,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let b=0;for(let R of f)b+=r[R]?.fixChanges??0;let x=p(b/f.size);S[v]={flaggedFiles:f.size,fixDensity:x,lift:l>0?p(x/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?p(s/l):null,byCategory:S,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function p(e){return Math.round(e*100)/100}function Ee(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function E(e,r="existing shared infrastructure discount"){let t=h(e);return Math.abs(t-e.count)<.01?"":` (${Ee(t)} score-weighted after ${r})`}function y(e,r){let t=h(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${Ee(t)} score-weighted)`}function lt(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",evidenceContractId:"dead-visible-references",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",evidenceContractId:"isolated-visible-connectivity",description:`${e.isolated.count} symbols with no visible indexed or source-supported caller/callee after root exclusions \u2014 runtime reflection and generated dispatch remain disclosed blind spots`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${E(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${E(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",evidenceContractId:"wrapper-indirection-candidate",description:`${e.wrappers.count} single-consumer symbols${E(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",evidenceContractId:"passthrough-forwarding-candidate",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",evidenceContractId:"stale-abstraction-candidate",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+E({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let a=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-a}),r}var we={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function He(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function dt(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(d,w,C)=>{w>0&&i.push({axis:d,points:w,detail:C,kind:we[d]??"hygiene"})},a=(d,w,C,je,Oe,We,Ue)=>{let H=Math.max(je,1);if(C<=H)return;let D=C/H,P=Math.min(Oe,Math.ceil(Math.log2(D)*We));if(P<=0)return;let Ke=we[d]??"hygiene";n.push({axis:d,category:w,kind:Ke,count:C,threshold:p(H),ratio:p(D),extraPenalty:P}),o(d,P,`${C} ${Ue} exceed pressure threshold ${p(H)} (${p(D)}x)`)},s=e.dead.count/t;o("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;o("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let v=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(v*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let g=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(g*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let f=e.reactComponentDuplicates.count/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(f)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let b=h(e.reactHookCandidates),x=b/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(x)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let R=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(R/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Fe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Fe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let _=h(e.vueComposableCandidates),qe=_/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(qe)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ze=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(ze/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let I=h(e.wrappers);o("wrappers",Math.min(3,I),y(e.wrappers,"wrapper candidate(s)"));let F=h(e.passthroughs);o("passthroughs",Math.min(3,F),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Ge=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(Ge*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(d/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:d},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let d=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",d,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),a("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",b,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",_,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",I,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}var m={dead:{minLoc:1,skipBarrels:!1,deadCodeOnly:!1},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};import{getHeapStatistics as mt}from"v8";var pt=64*1024*1024;function $(){let e=globalThis.gc;if(!e)return;let r=mt();r.heap_size_limit-r.used_heap_size<pt||e()}var ht=[{id:"dead-visible-references",detector:"dead",claim:"The symbol has no visible repository reference after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework/source fallback references","rooted-symbol exclusions"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Absence of visible references does not prove absence of reflection, generated dispatch, or external use."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"isolated-visible-connectivity",detector:"isolated",claim:"The callable has no visible non-self caller or callee after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"identity",subtype:"references",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework contract exclusions","source fallback callers"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Visible graph isolation does not establish runtime unreachability through reflection or generated dispatch."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"wrapper-indirection-candidate",detector:"wrapper-candidates",claim:"A small callable has one visible consumer and wrapper-shaped delegation, after boundary evidence is disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["callable body shape","public and runtime-boundary signals","consumer fan-in"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Wrapper shape does not prove that an API, ownership, observability, or compatibility boundary is unnecessary."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"passthrough-forwarding-candidate",detector:"passthrough-candidates",claim:"A small callable visibly forwards to one callee, with public-facade and boundary signals disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"contract",subtype:"uses-contract-symbol",minimumStrength:"exact"}],structuralEvidence:["statement-complete forwarding shape","public facade evidence","runtime-boundary signals"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Literal forwarding does not prove the callable has no contract, naming, policy, or compatibility role."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"stale-abstraction-candidate",detector:"stale-abstractions",claim:"A type-like abstraction has zero or one visible real consumer after re-export and ownership distinctions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["definition kind","barrel-only consumer distinction","defining-file usage"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Low visible consumer count does not prove a public contract or runtime-registered type is obsolete."],recoverWith:"scip-query evidence --symbol <symbol> --edge identity --edge ownership --edge contract --direction both --depth 2 --max-edges 100"},{id:"complexity-control-pressure",detector:"complexity-hotspots",claim:"A callable concentrates local branch/control pressure and graph fan-in or fan-out.",relationRequirements:[{family:"execution",subtype:"predicate-consequence",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["AST branch count or disclosed regex fallback","call fan-in","callee count"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Structural complexity does not establish runtime frequency, latency, defect density, or a required refactor."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"decorative-checker-terminal-behavior",detector:"decorative-checkers",claim:"A checker-shaped callable lacks a visible failure terminal directly or through one resolved delegate.",relationRequirements:[{family:"execution",subtype:"returns",minimumStrength:"exact"},{family:"execution",subtype:"throws",minimumStrength:"exact"}],structuralEvidence:["checker naming shape","direct terminal behavior","one-hop delegate body"],calibration:"mixed",providerCoverage:"partial",nonClaims:["No visible terminal does not prove the checker cannot fail through an opaque call, exception, or process exit."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"duplicate-structural-candidate",detector:"duplicate and similarity detectors",claim:"Two source units share the detector-specific structural or token pattern.",relationRequirements:[],structuralEvidence:["normalized source/token/JSX/template similarity"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Structural similarity does not establish shared domain identity or justify consolidation."],recoverWith:"scip-query inspect --symbol <symbol-a> --symbol <symbol-b> --view behavior"}];function Le(e=new Set(["indexed-graph","source-facts"])){return ht.map(r=>{let t=r.relationRequirements.map(n=>{let o=te(n.family,n.subtype);if(!o)throw new Error(`Detector ${r.id} names an unregistered relation ${n.family}/${n.subtype}`);if(!o.relation.evidenceStrengths.includes(n.minimumStrength))throw new Error(`Detector ${r.id} requires unsupported strength ${n.minimumStrength} for ${n.family}/${n.subtype}`);return o.provider}),i=[...new Set(t.flatMap(n=>n.requirements))].filter(n=>!e.has(n));return{...r,status:i.length>0?"unsupported":r.calibration,providerIds:[...new Set(t.map(n=>n.id))],unavailableRequirements:i}})}var gt=50,ft=25e3,Ct=2500,Re=2500,De=50,vt=10,bt=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],Ae={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:xt(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:wt(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:Ht(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Et(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:Rt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:Dt(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Pt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:kt(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:At(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Tt(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Mt(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Bt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Lt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:$t(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:Vt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:Nt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:qt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:zt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:_t(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:It(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:Ft(e,t)})};function zr(e,r={}){return Te(e,r.full!==!1,(t,i)=>{let n=St(e,r.scope,t,i);return B(n)})}function Gr(e,r,t={}){return yt(e,[r],t)[0]}function yt(e,r,t={}){return Te(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(a=>Ae[a](e,t.scope,o,i))})}function Te(e,r,t){let i=he(e),n=Gt(i,r);try{return t(i,n)}finally{M(e,{semanticProvider:!0}),$()}}function jr(e){return B(Me(e))}function Me(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,detectorEvidence:Le(),dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Pe(e,"git-evidence")?.gitEvidence??null,suppressions:Pe(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Pe(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function St(e,r,t,i){return Me(bt.map(n=>Ae[n](e,r,i,t)))}function xt(e,r,t){return c(e,t,"dead",()=>{let i=U(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Wt(e,i.symbols))})}function wt(e,r,t){return c(e,t,"isolated",()=>{let i=ne(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return L(Ut(e,i))})}function Ht(e,r,t){return c(e,t,"cycles",()=>J(e,{scope:r}).filter(n=>n.kind==="real").length)}function Et(e,r,t){let i=c(e,t,"similar",()=>Q(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function Lt(e,r,t){return c(e,t,"extract-candidates",()=>ie(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function Rt(e,r,t){return c(e,t,"duplicate-bodies",()=>{let i=Z(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let a of i)for(let s of a.functions.slice(1))n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n]}})}function Dt(e,r,t){return c(e,t,"twin-drift",()=>{let i=ee(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(a=>a.relationship==="divergent"||a.relationship==="identical"),n=new Set,o=0;for(let a of i)for(let s of a.members)n.add(s.file),o+=s.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function Pt(e,r,t){return c(e,t,"react-component-duplicates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function kt(e,r,t){return c(e,t,"react-hook-candidates",()=>{let i=ae(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Yt)})}function At(e,r,t){return c(e,t,"react-large-component-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Kt(i)})}function Tt(e,r,t){return c(e,t,"vue-component-duplicates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Mt(e,r,t){return c(e,t,"vue-composable-candidates",()=>{let i=ue(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return $e(i,Xt)})}function Bt(e,r,t){return c(e,t,"vue-large-view-pressure",()=>{let i=le(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return L(i)})}function $t(e,r,t){return c(e,t,"wrapper-candidates",()=>{let i=de(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Qt)})}function Vt(e,r,t){return c(e,t,"passthrough-candidates",()=>{let i=me(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Be(i,Jt)})}function Nt(e,r,t){return c(e,t,"stale-abstractions",()=>{let i=pe(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,a)=>o+a.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function _t(e,r){return c(e,r,"git-evidence",()=>{let t=K(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=Y(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),a={};for(let[s,l]of i)a[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:N(o.findings.reduce((s,l)=>s+ke(l),0)),top:o.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:ke(s),subjectContext:s.subjectContext}))},fileStats:a,commitsScanned:n?.commits.length??0}})}function It(e,r){return c(e,r,"suppressions",()=>{let t=ge(e);return{total:t.total,byCategory:{...t.byCategory}}})}function Ft(e,r){return c(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=ve(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function qt(e,r,t){return c(e,t,"drift",()=>{let i=re(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(s=>s.kind!=="pattern-deviation"),o=n.filter(s=>s.actionTier==="direct").length,a=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:a}})}function zt(e,r,t){return c(e,t,"complexity-hotspots",()=>{let i=X(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:i.filter(n=>n.score>gt).length}})}function Gt(e,r){let t=e.symbols>=ft||e.documents>=Ct,i=r?Number.POSITIVE_INFINITY:De,n=r?Number.POSITIVE_INFINITY:vt;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:Re,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${Re} symbols and reported their top ${De} findings. Enable full mode for unbounded candidate counts.`]}}function jt(e,r){r.releaseCachesBetweenPhases&&(M(e),$())}function c(e,r,t,i){Ot(t);try{return i()}finally{jt(e,r)}}function Ot(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Wt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ut(e,r){return r.filter(t=>!A(e,t.relativePath)&&!T(e,t.symbol,t.relativePath))}function L(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function Be(e,r){return{...L(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Kt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function $e(e,r){return{...V(e),scoreCount:N(e.reduce((i,n)=>i+r(n),0))}}function Yt(e){let r=e.sharedHooks.length>0,t=Ve({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Ne(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Xt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=Ve({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Ne(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function Ve(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Ie.has(_e(r))).length+Math.min(e.functions.length,3)}function Ne(e,r,t){let i=[...e,...r,...t].map(_e);return i.length>0&&i.every(n=>Ie.has(n))}function _e(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Qt(e){return e.actionTier==="signal"?.25:1}function Jt(e){return e.actionTier==="signal"?.25:1}function ke(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function N(e){return Math.round(e*100)/100}var Ie=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{m as a,bt as b,zr as c,Gr as d,yt as e,jr as f};
2
- //# sourceMappingURL=chunk-LDVT66YM.js.map