scip-query 0.24.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 (661) hide show
  1. package/CHANGELOG.md +247 -1
  2. package/README.md +111 -124
  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-BociKRpF.d.ts → call-graph-evidence-CUtj8V2I.d.ts} +1 -1
  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-E65ELFKU.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-BHKK5RJY.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-6ILKOOGH.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-OHIV323X.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-2GJSD5GY.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-A4WEAK35.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-GHNPACNP.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-T6DK3ZP7.js +2 -0
  164. package/dist/chunk-TKD34PHN.js +4 -0
  165. package/dist/chunk-TNNQFH7W.js +2 -0
  166. package/dist/chunk-TNV7SSUF.js +2 -0
  167. package/dist/chunk-TO7ZR3EH.js +8 -0
  168. package/dist/chunk-TOU3CHK4.js +2 -0
  169. package/dist/chunk-TRBI4UKT.js +2 -0
  170. package/dist/chunk-TZCVNCAN.js +4 -0
  171. package/dist/chunk-U4LZA5LL.js +3 -0
  172. package/dist/chunk-U5RIG3JP.js +3 -0
  173. package/dist/chunk-UP5KXN2I.js +2 -0
  174. package/dist/chunk-UQFR3NDH.js +5 -0
  175. package/dist/chunk-UXYXF7GV.js +2 -0
  176. package/dist/chunk-VB3GOKOS.js +2 -0
  177. package/dist/{chunk-4FR6GQIT.js → chunk-VF5JZICY.js} +2 -2
  178. package/dist/chunk-VTY3VK6E.js +2 -0
  179. package/dist/chunk-VX2O4RIS.js +2 -0
  180. package/dist/chunk-WKPV2TDZ.js +2 -0
  181. package/dist/chunk-WOFQ5DTB.js +2 -0
  182. package/dist/chunk-WS4C6TCK.js +2 -0
  183. package/dist/chunk-WXU3DGPU.js +2 -0
  184. package/dist/{chunk-ATXPTSEI.js → chunk-X6RMKHJQ.js} +7 -7
  185. package/dist/{chunk-44IETFOU.js → chunk-XHMN6ZX7.js} +2 -2
  186. package/dist/chunk-XHTVFLWW.js +2 -0
  187. package/dist/chunk-XKIDJCIK.js +2 -0
  188. package/dist/chunk-XTYTYZPT.js +2 -0
  189. package/dist/chunk-Y2JHHTTA.js +2 -0
  190. package/dist/chunk-YGVRMGYN.js +4 -0
  191. package/dist/chunk-YNQCGEQE.js +2 -0
  192. package/dist/chunk-YOQVEXVE.js +14 -0
  193. package/dist/chunk-YRT2WLYY.js +2 -0
  194. package/dist/chunk-YTAP5Y2G.js +2 -0
  195. package/dist/chunk-YTYWI7VB.js +2 -0
  196. package/dist/chunk-YULZRALL.js +2 -0
  197. package/dist/chunk-Z33WQG4Q.js +2 -0
  198. package/dist/chunk-ZGTYGDMF.js +16 -0
  199. package/dist/chunk-ZHMRSZFD.js +43 -0
  200. package/dist/chunk-ZHSP366W.js +10 -0
  201. package/dist/chunk-ZIBYCYKK.js +7 -0
  202. package/dist/chunk-ZLADLUE6.js +3 -0
  203. package/dist/chunk-ZO4YXUT6.js +4 -0
  204. package/dist/{chunk-MZPXPSUJ.js → chunk-ZR4HBC2H.js} +2 -2
  205. package/dist/cli-main.js +6 -6
  206. package/dist/cli.js +1 -1
  207. package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
  208. package/dist/code-IL5WH3NZ.js +2 -0
  209. package/dist/code-result-json-ANTBEDFP.js +4 -0
  210. package/dist/command-descriptors-HEEMDHTU.js +222 -0
  211. package/dist/deps-EOWFC6FD.js +2 -0
  212. package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
  213. package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
  214. package/dist/files-K4AI3JUM.js +2 -0
  215. package/dist/{health-BI2a9WPy.d.ts → health-BtfmNrfa.d.ts} +5 -79
  216. package/dist/hierarchy-6W5NDIFI.js +2 -0
  217. package/dist/imports-WH365QY4.js +2 -0
  218. package/dist/index.d.ts +13 -1
  219. package/dist/index.js +1 -1
  220. package/dist/members-K3PHMF5S.js +2 -0
  221. package/dist/methods-E7KVMBX4.js +2 -0
  222. package/dist/output-continuation-command-BJSY67SN.js +3 -0
  223. package/dist/output-pagination-UZJ5ACIX.js +24 -0
  224. package/dist/postinstall.js +1 -1
  225. package/dist/project-reindex-EP24WT4X.js +3 -0
  226. package/dist/queries/affected.js +1 -1
  227. package/dist/queries/architecture.d.ts +15 -4
  228. package/dist/queries/architecture.js +1 -1
  229. package/dist/queries/bottlenecks.js +1 -1
  230. package/dist/queries/by-kind.js +1 -1
  231. package/dist/queries/call-graph.d.ts +1 -1
  232. package/dist/queries/call-graph.js +1 -1
  233. package/dist/queries/change-surface.d.ts +1 -0
  234. package/dist/queries/change-surface.js +1 -1
  235. package/dist/queries/cleanup-plan.d.ts +3 -3
  236. package/dist/queries/cleanup-plan.js +1 -1
  237. package/dist/queries/co-change.js +1 -1
  238. package/dist/queries/code.d.ts +1 -1
  239. package/dist/queries/code.js +1 -1
  240. package/dist/queries/complexity.d.ts +6 -3
  241. package/dist/queries/complexity.js +1 -1
  242. package/dist/queries/context.d.ts +1 -7
  243. package/dist/queries/context.js +1 -1
  244. package/dist/queries/coupling.js +1 -1
  245. package/dist/queries/cycles.js +1 -1
  246. package/dist/queries/dead.js +1 -1
  247. package/dist/queries/decorative-checkers.js +1 -1
  248. package/dist/queries/dependence-slice.d.ts +46 -22
  249. package/dist/queries/dependence-slice.js +1 -1
  250. package/dist/queries/dependency-depth.d.ts +1 -7
  251. package/dist/queries/dependency-depth.js +1 -1
  252. package/dist/queries/deps.js +1 -1
  253. package/dist/queries/diff-impact.d.ts +3 -1
  254. package/dist/queries/diff-impact.js +1 -1
  255. package/dist/queries/doc-drift.js +1 -1
  256. package/dist/queries/drift.d.ts +1 -1
  257. package/dist/queries/drift.js +1 -1
  258. package/dist/queries/duplicate-bodies.d.ts +1 -1
  259. package/dist/queries/duplicate-bodies.js +1 -1
  260. package/dist/queries/entry-map.d.ts +2 -4
  261. package/dist/queries/entry-map.js +1 -1
  262. package/dist/queries/evidence.d.ts +121 -61
  263. package/dist/queries/evidence.js +1 -1
  264. package/dist/queries/fan.js +1 -1
  265. package/dist/queries/files.js +1 -1
  266. package/dist/queries/health.d.ts +1 -1
  267. package/dist/queries/health.js +1 -1
  268. package/dist/queries/hierarchy.d.ts +2 -2
  269. package/dist/queries/hierarchy.js +1 -1
  270. package/dist/queries/hotspots.d.ts +1 -1
  271. package/dist/queries/hotspots.js +1 -1
  272. package/dist/queries/imports.d.ts +1 -0
  273. package/dist/queries/imports.js +1 -1
  274. package/dist/queries/incomplete-migration.d.ts +3 -3
  275. package/dist/queries/incomplete-migration.js +1 -1
  276. package/dist/queries/index.d.ts +15 -64
  277. package/dist/queries/index.js +1 -1
  278. package/dist/queries/locality-candidates.d.ts +4 -4
  279. package/dist/queries/locality-candidates.js +1 -1
  280. package/dist/queries/members.d.ts +2 -2
  281. package/dist/queries/members.js +1 -1
  282. package/dist/queries/methods.js +1 -1
  283. package/dist/queries/not-implemented.d.ts +2 -6
  284. package/dist/queries/not-implemented.js +1 -1
  285. package/dist/queries/outline.js +1 -1
  286. package/dist/queries/passthrough-candidates.js +1 -1
  287. package/dist/queries/react-component-duplicates.js +1 -1
  288. package/dist/queries/react-hook-candidates.js +1 -1
  289. package/dist/queries/react-large-component-pressure.js +1 -1
  290. package/dist/queries/recent-duplicates.js +1 -1
  291. package/dist/queries/redundant-reexports.d.ts +4 -14
  292. package/dist/queries/redundant-reexports.js +1 -1
  293. package/dist/queries/refs.d.ts +4 -1
  294. package/dist/queries/refs.js +1 -1
  295. package/dist/queries/review.d.ts +188 -0
  296. package/dist/queries/review.js +2 -0
  297. package/dist/queries/similar-files.d.ts +7 -10
  298. package/dist/queries/similar-files.js +1 -1
  299. package/dist/queries/similar-signatures.js +1 -1
  300. package/dist/queries/similar.d.ts +19 -1
  301. package/dist/queries/similar.js +1 -1
  302. package/dist/queries/slice-cohesion.d.ts +205 -0
  303. package/dist/queries/slice-cohesion.js +2 -0
  304. package/dist/queries/source-inspection.d.ts +6 -202
  305. package/dist/queries/source-inspection.js +1 -1
  306. package/dist/queries/source-search.d.ts +2 -3
  307. package/dist/queries/source-search.js +1 -1
  308. package/dist/queries/stats.d.ts +1 -0
  309. package/dist/queries/stats.js +1 -1
  310. package/dist/queries/surface.js +1 -1
  311. package/dist/queries/symbols.js +1 -1
  312. package/dist/queries/system.d.ts +4 -2
  313. package/dist/queries/system.js +1 -1
  314. package/dist/queries/test-quality.d.ts +1 -1
  315. package/dist/queries/test-quality.js +1 -1
  316. package/dist/queries/twin-drift.d.ts +1 -1
  317. package/dist/queries/twin-drift.js +1 -1
  318. package/dist/queries/unused-imports.js +1 -1
  319. package/dist/queries/unused-params.d.ts +3 -15
  320. package/dist/queries/unused-params.js +1 -1
  321. package/dist/queries/vue-component-duplicates.js +1 -1
  322. package/dist/queries/vue-composable-candidates.js +1 -1
  323. package/dist/queries/vue-large-view-pressure.js +1 -1
  324. package/dist/query-service-fastpath.js +5 -5
  325. package/dist/query-service-server.js +4 -4
  326. package/dist/refs-CCBJG7WK.js +2 -0
  327. package/dist/refs-pagination-DRNLVU4S.js +2 -0
  328. package/dist/reindex-worker.js +79 -29
  329. package/dist/reindex.js +45 -45
  330. package/dist/repository-cache-worker.js +2 -0
  331. package/dist/runtime.d.ts +8 -8
  332. package/dist/runtime.js +3 -4
  333. package/dist/rust-semantic-session-server.js +1 -1
  334. package/dist/rust-semantic-session-worker.js +1 -1
  335. package/dist/rust-semantic-worker.js +1 -1
  336. package/dist/service-queries-2WAJI7R6.js +6 -0
  337. package/dist/source-inspection-91U9zdO3.d.ts +341 -0
  338. package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
  339. package/dist/stats-G7DIV6VU.js +2 -0
  340. package/dist/surface-IO55UALI.js +2 -0
  341. package/dist/system-ZBMSHJXU.js +2 -0
  342. package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
  343. package/dist/typescript-indexer.js +2 -0
  344. package/dist/typescript-mailbox-worker.js +1 -1
  345. package/dist/watch-server.js +3 -3
  346. package/docs/AGENT_GUIDE.md +19 -128
  347. package/docs/CLI_JSON_OUTPUT.md +21 -17
  348. package/docs/COMMAND_REFERENCE.md +34 -49
  349. package/docs/CURRENT_COMMANDS.md +123 -0
  350. package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
  351. package/docs/DETECTOR_GUIDE.md +27 -23
  352. package/docs/PRODUCT_VISION.md +135 -0
  353. package/docs/PROPERTY_TESTING.md +73 -0
  354. package/docs/REVIEW.md +76 -0
  355. package/docs/SKILLS.md +51 -0
  356. package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
  357. package/docs/accuracy-audit-checklist.md +34 -0
  358. package/docs/analyzer-inventory.md +2 -2
  359. package/package.json +18 -80
  360. package/scripts/evidence-product-contract.mjs +7 -3
  361. package/scripts/record-review-coverage.mjs +118 -0
  362. package/scripts/scip-windows-provenance.mjs +29 -19
  363. package/skills/scip-architecture-review/SKILL.md +57 -0
  364. package/skills/scip-architecture-review/agents/openai.yaml +4 -0
  365. package/skills/scip-architecture-review/references/design-checks.md +17 -0
  366. package/skills/scip-explore/SKILL.md +15 -59
  367. package/skills/scip-explore/agents/openai.yaml +3 -3
  368. package/skills/scip-explore/references/external-evidence.md +2 -2
  369. package/skills/scip-explore/references/information-model.md +26 -29
  370. package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
  371. package/skills/scip-integrity-audit/SKILL.md +53 -181
  372. package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
  373. package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
  374. package/skills/scip-plan/SKILL.md +39 -65
  375. package/skills/scip-plan/agents/openai.yaml +2 -2
  376. package/skills/scip-query/SKILL.md +28 -81
  377. package/skills/scip-query/agents/openai.yaml +2 -2
  378. package/skills/scip-query/references/command-guide.md +169 -0
  379. package/skills/scip-setup/SKILL.md +4 -2
  380. package/skills/scip-setup/agents/openai.yaml +3 -3
  381. package/dist/by-kind-H3P6BR5G.js +0 -2
  382. package/dist/call-graph-VTG2CUOQ.js +0 -2
  383. package/dist/chunk-26CT72HM.js +0 -2
  384. package/dist/chunk-2BMSSRBH.js +0 -2
  385. package/dist/chunk-2M2LSIMY.js +0 -7
  386. package/dist/chunk-2N6WBNDC.js +0 -29
  387. package/dist/chunk-2OOY75BW.js +0 -2
  388. package/dist/chunk-2USA3S3P.js +0 -3
  389. package/dist/chunk-2VAHDDLM.js +0 -133
  390. package/dist/chunk-2XWIUW5Z.js +0 -455
  391. package/dist/chunk-35NLDRZC.js +0 -2
  392. package/dist/chunk-3AF4TUFK.js +0 -3
  393. package/dist/chunk-3D4BOXW6.js +0 -20
  394. package/dist/chunk-3LO4FST5.js +0 -16
  395. package/dist/chunk-3WTY4LP2.js +0 -3
  396. package/dist/chunk-3Z5AMSK6.js +0 -29
  397. package/dist/chunk-4KBTHJLP.js +0 -2
  398. package/dist/chunk-5BIKR67W.js +0 -2
  399. package/dist/chunk-5PROPLHI.js +0 -2
  400. package/dist/chunk-5V7EPTII.js +0 -2
  401. package/dist/chunk-62LPZCBQ.js +0 -3
  402. package/dist/chunk-64O2JHQA.js +0 -2
  403. package/dist/chunk-6D4F5VWG.js +0 -10
  404. package/dist/chunk-6ERFBC3X.js +0 -3
  405. package/dist/chunk-6MFXCMZC.js +0 -2
  406. package/dist/chunk-6O7FACKB.js +0 -2
  407. package/dist/chunk-6TS3KOXR.js +0 -2
  408. package/dist/chunk-76QOU4PK.js +0 -3
  409. package/dist/chunk-7DUI77BN.js +0 -2
  410. package/dist/chunk-7F45LJKI.js +0 -2
  411. package/dist/chunk-7F7T6DCR.js +0 -2
  412. package/dist/chunk-7H6VHWWJ.js +0 -2
  413. package/dist/chunk-7HXT6YLU.js +0 -5
  414. package/dist/chunk-7KCZELVM.js +0 -2
  415. package/dist/chunk-7R4V5ES6.js +0 -6
  416. package/dist/chunk-7RIRIADH.js +0 -7
  417. package/dist/chunk-7ZLWLOGT.js +0 -2
  418. package/dist/chunk-AADQLOQ4.js +0 -38
  419. package/dist/chunk-AN76MGUE.js +0 -2
  420. package/dist/chunk-ANLNLY66.js +0 -2
  421. package/dist/chunk-AX7IDVFT.js +0 -2
  422. package/dist/chunk-B3X6KU75.js +0 -2
  423. package/dist/chunk-B7MPDEAK.js +0 -3
  424. package/dist/chunk-BBB5FBX4.js +0 -2
  425. package/dist/chunk-BJT7LSPK.js +0 -3
  426. package/dist/chunk-BJWFVAA5.js +0 -2
  427. package/dist/chunk-BKVWUP7Y.js +0 -2
  428. package/dist/chunk-BKZYTLGE.js +0 -35
  429. package/dist/chunk-BL6DCHQP.js +0 -2
  430. package/dist/chunk-BOW7SSQH.js +0 -43
  431. package/dist/chunk-C4RHHCKL.js +0 -7
  432. package/dist/chunk-C7C6AKAT.js +0 -117
  433. package/dist/chunk-CD6M6LS2.js +0 -16
  434. package/dist/chunk-CFE6PSG6.js +0 -2
  435. package/dist/chunk-CFNIGQMT.js +0 -2
  436. package/dist/chunk-CKBUBRYD.js +0 -2
  437. package/dist/chunk-CZW5MZ5B.js +0 -2
  438. package/dist/chunk-DBBZ63ZX.js +0 -2
  439. package/dist/chunk-DBN7DMJB.js +0 -18
  440. package/dist/chunk-DUULLZHZ.js +0 -3
  441. package/dist/chunk-DV5Y5NOS.js +0 -2
  442. package/dist/chunk-DZOIKCTM.js +0 -3
  443. package/dist/chunk-E4PKTOL3.js +0 -2
  444. package/dist/chunk-E7QR35ST.js +0 -2
  445. package/dist/chunk-EFSXAINW.js +0 -2
  446. package/dist/chunk-EHVEIEQN.js +0 -18
  447. package/dist/chunk-EHYDXE3Z.js +0 -2
  448. package/dist/chunk-EP63Y6LD.js +0 -2
  449. package/dist/chunk-EPX6NQN6.js +0 -4
  450. package/dist/chunk-ETC674NS.js +0 -5
  451. package/dist/chunk-F5GSBHC6.js +0 -3
  452. package/dist/chunk-FH3DGXC6.js +0 -2
  453. package/dist/chunk-FI7VGOR4.js +0 -16
  454. package/dist/chunk-FJF6VO2P.js +0 -2
  455. package/dist/chunk-FLMTCX5R.js +0 -2
  456. package/dist/chunk-FVFDOIM3.js +0 -2
  457. package/dist/chunk-G2HU5WRN.js +0 -2
  458. package/dist/chunk-G4ALYS4J.js +0 -2
  459. package/dist/chunk-G56I7K4W.js +0 -26
  460. package/dist/chunk-GC4DG2V5.js +0 -2
  461. package/dist/chunk-GG45PK4S.js +0 -4
  462. package/dist/chunk-GINH3YQU.js +0 -20
  463. package/dist/chunk-GTZZVLKJ.js +0 -2
  464. package/dist/chunk-GXXW5ZHH.js +0 -2
  465. package/dist/chunk-H5EXS3HM.js +0 -2
  466. package/dist/chunk-HAXXKRTD.js +0 -4
  467. package/dist/chunk-HEZWBAZY.js +0 -2
  468. package/dist/chunk-HMEWLMML.js +0 -2
  469. package/dist/chunk-HOBOVYPO.js +0 -11
  470. package/dist/chunk-HRFQ6GW5.js +0 -8
  471. package/dist/chunk-HX4X7KG3.js +0 -2
  472. package/dist/chunk-HYT2R7LX.js +0 -4
  473. package/dist/chunk-IKQVBVQL.js +0 -40
  474. package/dist/chunk-IW5XQG5G.js +0 -2
  475. package/dist/chunk-J6GLBBRK.js +0 -4
  476. package/dist/chunk-J7A4PWFX.js +0 -3
  477. package/dist/chunk-JCSAZ35V.js +0 -2
  478. package/dist/chunk-JDU2IV3A.js +0 -2
  479. package/dist/chunk-JFMEXGFE.js +0 -2
  480. package/dist/chunk-JFMI5SGB.js +0 -4
  481. package/dist/chunk-JJP37RGX.js +0 -57
  482. package/dist/chunk-JZ2A7LDM.js +0 -5
  483. package/dist/chunk-KMVGRIO2.js +0 -2
  484. package/dist/chunk-KNLQGXVH.js +0 -80
  485. package/dist/chunk-KVQCECPR.js +0 -2
  486. package/dist/chunk-KXXORBZ2.js +0 -4
  487. package/dist/chunk-L5KYH6U3.js +0 -35
  488. package/dist/chunk-L6XHYJPZ.js +0 -21
  489. package/dist/chunk-L7KTFEAV.js +0 -43
  490. package/dist/chunk-LDXHR5EL.js +0 -23
  491. package/dist/chunk-LEECKFCJ.js +0 -2
  492. package/dist/chunk-MHGDSBFX.js +0 -2
  493. package/dist/chunk-MLQVVDG3.js +0 -74
  494. package/dist/chunk-MOKUWRHO.js +0 -3
  495. package/dist/chunk-MPYAPMNE.js +0 -2
  496. package/dist/chunk-MTDBHTSF.js +0 -2
  497. package/dist/chunk-MV6SPXCR.js +0 -7
  498. package/dist/chunk-MWN53KRN.js +0 -60
  499. package/dist/chunk-MXNGIEPU.js +0 -3
  500. package/dist/chunk-N55KIE46.js +0 -2
  501. package/dist/chunk-NB4D3BNM.js +0 -2
  502. package/dist/chunk-NGKBOT6G.js +0 -23
  503. package/dist/chunk-NJGKXKQF.js +0 -2
  504. package/dist/chunk-NJQISBL4.js +0 -8
  505. package/dist/chunk-NJT3ZEKY.js +0 -16
  506. package/dist/chunk-NKMKZP6A.js +0 -2
  507. package/dist/chunk-NODFZ6ED.js +0 -2
  508. package/dist/chunk-NSM5IEVW.js +0 -2
  509. package/dist/chunk-NTGUVNR2.js +0 -3
  510. package/dist/chunk-NU3KFF2O.js +0 -57
  511. package/dist/chunk-NWLVNU66.js +0 -557
  512. package/dist/chunk-NYKZMCRC.js +0 -4
  513. package/dist/chunk-O6BUXZEH.js +0 -6
  514. package/dist/chunk-ODPDP7A4.js +0 -3
  515. package/dist/chunk-OIAPEKMT.js +0 -3
  516. package/dist/chunk-OIOC5EHF.js +0 -3
  517. package/dist/chunk-ONPPQM4G.js +0 -2
  518. package/dist/chunk-OUHEZBYI.js +0 -2
  519. package/dist/chunk-OVGYW7UD.js +0 -29
  520. package/dist/chunk-OYKU4B3Y.js +0 -2
  521. package/dist/chunk-POBJ6FR2.js +0 -5
  522. package/dist/chunk-PSZPMMWN.js +0 -2
  523. package/dist/chunk-PXTRBKRK.js +0 -3
  524. package/dist/chunk-Q5JRIHT3.js +0 -4
  525. package/dist/chunk-Q7ATHARX.js +0 -2
  526. package/dist/chunk-Q7CSKIDM.js +0 -5
  527. package/dist/chunk-QBQE7ZJ5.js +0 -3
  528. package/dist/chunk-QH22UIXP.js +0 -5
  529. package/dist/chunk-QXCKQTKR.js +0 -60
  530. package/dist/chunk-RBAD4GJ2.js +0 -13
  531. package/dist/chunk-RMDPFPNW.js +0 -2
  532. package/dist/chunk-ROPJDEJZ.js +0 -4
  533. package/dist/chunk-RVZC6TJE.js +0 -2
  534. package/dist/chunk-S4QZBKSR.js +0 -3
  535. package/dist/chunk-SCPMZ73U.js +0 -2
  536. package/dist/chunk-SIAP5RGI.js +0 -73
  537. package/dist/chunk-SIX4RFR3.js +0 -3
  538. package/dist/chunk-SKKXTABJ.js +0 -16
  539. package/dist/chunk-SSRFUQBD.js +0 -2
  540. package/dist/chunk-SYVJEEUJ.js +0 -3
  541. package/dist/chunk-T3CZAZSI.js +0 -8
  542. package/dist/chunk-T6DWDI5E.js +0 -3
  543. package/dist/chunk-T6HRIROJ.js +0 -7
  544. package/dist/chunk-TAA7HXHE.js +0 -2
  545. package/dist/chunk-TJ2JQYT3.js +0 -2
  546. package/dist/chunk-TULNMD5T.js +0 -368
  547. package/dist/chunk-U2FPY5XA.js +0 -3
  548. package/dist/chunk-U3SXIMII.js +0 -38
  549. package/dist/chunk-U6KCHXJ4.js +0 -2
  550. package/dist/chunk-UH3XSKS5.js +0 -9
  551. package/dist/chunk-UIFUZVCC.js +0 -2
  552. package/dist/chunk-UXKURIVI.js +0 -2
  553. package/dist/chunk-V2RBODHL.js +0 -2
  554. package/dist/chunk-VBKUWB6N.js +0 -2
  555. package/dist/chunk-VBV6ALJE.js +0 -2
  556. package/dist/chunk-VDGFWCQV.js +0 -2
  557. package/dist/chunk-VDSDOEWF.js +0 -2
  558. package/dist/chunk-VZPWVCLN.js +0 -20
  559. package/dist/chunk-WDSFQDPN.js +0 -2
  560. package/dist/chunk-WFA35BGR.js +0 -7
  561. package/dist/chunk-WLMP3OCW.js +0 -2
  562. package/dist/chunk-WSA52GOR.js +0 -2
  563. package/dist/chunk-WYPL7GF7.js +0 -2
  564. package/dist/chunk-X3YVZAKZ.js +0 -5
  565. package/dist/chunk-X6OGVFIT.js +0 -2
  566. package/dist/chunk-XDAUYDFT.js +0 -2
  567. package/dist/chunk-XKXTR6ZI.js +0 -9
  568. package/dist/chunk-Y5DFAW5W.js +0 -4
  569. package/dist/chunk-YSYPDRD5.js +0 -3
  570. package/dist/chunk-ZFVPWH62.js +0 -5
  571. package/dist/chunk-ZGIHTH27.js +0 -2
  572. package/dist/chunk-ZGIQN2SX.js +0 -2
  573. package/dist/chunk-ZHG4WAHR.js +0 -12
  574. package/dist/chunk-ZKB2XUEN.js +0 -4
  575. package/dist/chunk-ZLMXIQLC.js +0 -21
  576. package/dist/chunk-ZMCQIHI4.js +0 -2
  577. package/dist/code-TAVIKWJI.js +0 -2
  578. package/dist/code-result-json-5FEFQCAQ.js +0 -2
  579. package/dist/command-descriptors-7BKH53Y3.js +0 -343
  580. package/dist/dataflow-GFBTVDH3.js +0 -2
  581. package/dist/dependence-slice-GWGQCODG.js +0 -2
  582. package/dist/deps-4QHVDPYA.js +0 -2
  583. package/dist/direct-navigation-4UBC6HNW.js +0 -3
  584. package/dist/entry-map-QCTF4RVY.js +0 -2
  585. package/dist/files-M2UBF5HJ.js +0 -2
  586. package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
  587. package/dist/hierarchy-2UIHRLW4.js +0 -2
  588. package/dist/imports-WIE3YZOB.js +0 -2
  589. package/dist/members-YKD636DA.js +0 -2
  590. package/dist/methods-VDF4IMYG.js +0 -2
  591. package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
  592. package/dist/output-continuation-command-4UMDOOLO.js +0 -3
  593. package/dist/output-pagination-2GME6OPY.js +0 -19
  594. package/dist/project-reindex-XEQTRCV5.js +0 -3
  595. package/dist/queries/anchors.d.ts +0 -123
  596. package/dist/queries/anchors.js +0 -2
  597. package/dist/queries/complexity-hotspots.d.ts +0 -40
  598. package/dist/queries/complexity-hotspots.js +0 -2
  599. package/dist/queries/convergence.d.ts +0 -33
  600. package/dist/queries/convergence.js +0 -2
  601. package/dist/queries/dataflow.d.ts +0 -77
  602. package/dist/queries/dataflow.js +0 -2
  603. package/dist/queries/deep-chains.d.ts +0 -5
  604. package/dist/queries/deep-chains.js +0 -2
  605. package/dist/queries/extract-candidates.d.ts +0 -79
  606. package/dist/queries/extract-candidates.js +0 -2
  607. package/dist/queries/isolated.d.ts +0 -24
  608. package/dist/queries/isolated.js +0 -2
  609. package/dist/queries/plan-context.d.ts +0 -33
  610. package/dist/queries/plan-context.js +0 -2
  611. package/dist/queries/reference-neighborhood.d.ts +0 -4
  612. package/dist/queries/reference-neighborhood.js +0 -2
  613. package/dist/queries/reference-reachability.d.ts +0 -48
  614. package/dist/queries/reference-reachability.js +0 -2
  615. package/dist/queries/self-audit.d.ts +0 -69
  616. package/dist/queries/self-audit.js +0 -2
  617. package/dist/queries/similar-chains.d.ts +0 -48
  618. package/dist/queries/similar-chains.js +0 -2
  619. package/dist/queries/slice.d.ts +0 -4
  620. package/dist/queries/slice.js +0 -2
  621. package/dist/queries/stale-abstractions.d.ts +0 -72
  622. package/dist/queries/stale-abstractions.js +0 -2
  623. package/dist/queries/system-map.d.ts +0 -449
  624. package/dist/queries/system-map.js +0 -2
  625. package/dist/queries/trace.js +0 -2
  626. package/dist/queries/twin-ab.d.ts +0 -66
  627. package/dist/queries/twin-ab.js +0 -2
  628. package/dist/queries/value-flow.d.ts +0 -43
  629. package/dist/queries/value-flow.js +0 -2
  630. package/dist/queries/wrapper-candidates.d.ts +0 -49
  631. package/dist/queries/wrapper-candidates.js +0 -2
  632. package/dist/refs-JNK5CLM7.js +0 -2
  633. package/dist/refs-pagination-6BLRYGMV.js +0 -2
  634. package/dist/slice-PHPVNCWX.js +0 -2
  635. package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
  636. package/dist/stats-OOJ74B32.js +0 -2
  637. package/dist/surface-MQX5MPIV.js +0 -2
  638. package/dist/symbol-resolution-DBLVXLBC.js +0 -2
  639. package/dist/system-JOPKV4OG.js +0 -2
  640. package/dist/trace-I2P2YFH4.js +0 -2
  641. package/dist/value-flow-JJVMF7NP.js +0 -2
  642. package/skills/concrete-plan/SKILL.md +0 -8
  643. package/skills/concrete-plan/agents/openai.yaml +0 -4
  644. package/skills/conductor/SKILL.md +0 -110
  645. package/skills/conductor/agents/openai.yaml +0 -4
  646. package/skills/principal-maintainability-review/SKILL.md +0 -273
  647. package/skills/principal-maintainability-review/agents/openai.yaml +0 -4
  648. package/skills/scip-calibrate/SKILL.md +0 -102
  649. package/skills/scip-calibrate/agents/openai.yaml +0 -4
  650. package/skills/scip-claim-audit/SKILL.md +0 -113
  651. package/skills/scip-claim-audit/agents/openai.yaml +0 -4
  652. package/skills/scip-probe-reachability/SKILL.md +0 -93
  653. package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
  654. package/skills/scip-root-cause/SKILL.md +0 -160
  655. package/skills/scip-root-cause/agents/openai.yaml +0 -4
  656. package/skills/scip-system-compression/SKILL.md +0 -252
  657. package/skills/scip-system-compression/agents/openai.yaml +0 -4
  658. package/skills/scip-system-compression/references/compression-atlas.md +0 -116
  659. package/skills/scip-system-compression/references/compression-patterns.md +0 -87
  660. package/skills/scip-twin-drift/SKILL.md +0 -109
  661. package/skills/scip-twin-drift/agents/openai.yaml +0 -4
@@ -1,5 +0,0 @@
1
- import{isAbsolute as st,relative as Cn}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 Pe(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function $i(e){return e.replace(/\\/g,"/")}function Ui(e,t){return Pe(e)===Pe(t)}function b(e,t){let n=Cn(e,t);return n===""||!n.startsWith("..")&&!st(n)}function w(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(st(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=Pe(e);if(t.split("/").some(r=>r===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}function re(e,t,n=[]){let r=Ce(e);if(ft.has(r)||n.some(o=>ne(r,o))||t.some(o=>gt(r,o)))return"config";if(t.some(mt)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return"ambient";let i=ht(r);return t.some(o=>(yt[o]??[]).includes(i))?"source":"other"}function lt(e,t,n){let r=Ce(e);if(ft.has(r)||n?.some(o=>ne(r,o))||gt(r,t)||mt(t)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return!0;let i=ht(r);return(yt[t]??[]).includes(i)}function Ji(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!ct(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!ct(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(je)?null:t}function at(e){return{...e,files:e.files.map(({semanticHash:t,...n})=>n)}}function Vi(e,t){return!e||!t?e===t:JSON.stringify(at(e))===JSON.stringify(at(t))}function Ki(e,t){let n=new Map((e?.files??[]).map(a=>[a.path,a])),r=new Map(t.files.map(a=>[a.path,a])),i=new Set([...n.keys(),...r.keys()]),o=[];for(let a of[...i].sort()){let c=n.get(a),u=r.get(a),d=re(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:d,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:d,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:d,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(ut(e?.files??[])||ut(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Fn)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!kn(e,t):!0,uncertainty:[...s].sort()}}function ct(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ut(e){return new Set(e.map(t=>t.path)).size!==e.length}function je(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 Fn(e){return e.hash==="unreadable"||e.size<0}function kn(e,t){return pt(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&pt(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function pt(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 ft=new Set([".scipquery.json"]),wn={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"]},Rn={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:[]},dt=new Map;function gt(e,t){return wn[t].some(n=>ne(e,n))||Rn[t].some(n=>ne(e,n))}function ne(e,t){let n=Ce(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=dt.get(n);if(!o){let s=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),dt.set(n,o)}return o.test(i)}function Ce(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function ht(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function mt(e){return e==="typescript"||e==="javascript"}var yt={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"]};function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function St(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function Xi(e){return typeof e=="string"&&e.length>0}function Qi(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Zi(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var En=/^[a-f0-9]{64}$/u;function eo(e){return typeof e=="string"&&En.test(e)}function to(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function no(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var bt=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var Fe=2,A=3;var ke=new Set(bt);function uo(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){return{kind:"malformed",reason:`invalid JSON: ${_n(s)}`}}if(!R(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let n=t.version;if(!Number.isInteger(n))return{kind:"malformed",reason:"version must be an integer"};if(n!==Fe&&n!==A)return{kind:"unsupported",version:n,direction:n<Fe?"older":"future"};let r=vn(t,n);if(r)return{kind:"malformed",reason:r};let i=t,o={metadata:i,capabilities:In(i)};return n===Fe?{kind:"legacy",...o,metadata:i}:{kind:"supported",...o,metadata:i}}function po(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function lo(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===A?t.sqliteLayoutVersion:void 0})}function In(e){let t=e.fingerprint!==void 0,n=R(e.fingerprint),r=e.indexedLanguages!==void 0,i=e.status==="complete",o=e.version===A?e:null;return{usableForQuery:r,usableForEvidenceCache:t,publishableGeneration:i&&n&&r,stableGenerationIdentity:i&&t&&typeof e.updatedAt=="string",languageShardReuse:!!o?.languageFingerprints,typescriptProjectShardReuse:!!o?.typescriptProjectShards}}function vn(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!St(e.updatedAt))return"updatedAt must be a valid timestamp";for(let n of["requestedLanguages","indexedLanguages"])if(e[n]!==void 0&&!Tn(e[n]))return`${n} must contain unique supported languages`;return e.skipped!==void 0&&!An(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===A&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===A&&e.languageFingerprints!==void 0&&!Ln(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===A&&e.typescriptProjectShards!==void 0&&!On(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function fo(e){return e.version===A&&e.sqliteLayoutVersion===1}function Tn(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&ke.has(t))?!1:new Set(e).size===e.length}function An(e){return Array.isArray(e)&&e.every(t=>R(t)&&typeof t.language=="string"&&ke.has(t.language)&&typeof t.reason=="string")}function Ln(e){return R(e)&&Object.entries(e).every(([t,n])=>ke.has(t)&&R(n))}function On(e){return R(e)&&Object.values(e).every(t=>R(t)&&Array.isArray(t.files)&&t.files.every(je))}function _n(e){return e instanceof Error?e.message:String(e)}import{closeSync as we,fstatSync as ie,openSync as Re,readFileSync as Dn,readSync as xt}from"fs";import{createHash as Bn}from"crypto";var oe=8*1024*1024,Pt=64*1024*1024,Mn=512*1024*1024,Nn=256*1024*1024,E=class extends Error{constructor(n,r,i,o,s){let a=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(`${n} ${JSON.stringify(r)} ${a}`);this.inputKind=n;this.inputPath=r;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="SCIP_QUERY_BOUNDED_FILE_READ"};function M(e,t){L(t.maxBytes);let n=String(e),r=Re(e,"r");try{let i=ie(r);Ct(i,t,n);let o=Dn(r),s=ie(r);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new E(t.inputKind,n,"changed-during-read",s.size,t.maxBytes);return o}finally{we(r)}}function Ee(e,t,n="utf8"){return M(e,t).toString(n)}function U(e,t){return Ee(e,{maxBytes:oe,inputKind:t})}function Gn(e,t){return Ee(e,{maxBytes:Pt,inputKind:t})}function Ie(e,t){L(t.maxBytes);let n=[],r=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=xt(e,r,0,r.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new E(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);n.push(Buffer.from(r.subarray(0,o)))}return Buffer.concat(n,i)}function Wn(e,t,n="utf8"){return Ie(e,t).toString(n)}function jt(e,t){let n=Re(e,"r");try{return Ie(n,t)}finally{we(n)}}function zn(e,t,n="utf8"){return jt(e,t).toString(n)}function se(e,t,n){L(t.maxBytes);let r=String(e),i=Re(e,"r");try{let o=ie(i);Ct(o,t,r);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=xt(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;n(s.subarray(0,u)),a+=u}let c=ie(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new E(t.inputKind,r,"changed-during-read",c.size,t.maxBytes);return a}finally{we(i)}}function Hn(e,t){let n=Bn("sha256");return se(e,t,r=>n.update(r)),n.digest("hex")}function Ct(e,t,n){if(!e.isFile())throw new E(t.inputKind,n,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new E(t.inputKind,n,"too-large",Number(e.size),t.maxBytes)}function L(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}import{spawnSync as Un}from"child_process";import{createHash as qn}from"crypto";import{existsSync as Jn,lstatSync as Vn,realpathSync as Kn}from"fs";import{dirname as Yn,isAbsolute as Xn,join as Qn,relative as wo,resolve as ue,sep as Ro}from"path";var Ft=Symbol.for("scip-query.project-file-listing-context.v1"),kt=globalThis,ve=kt[Ft],I=ve&&typeof ve=="object"?ve:{};kt[Ft]=I;function wt(e,t){let n=I.active?I.canonicalProjectRoots:void 0,r=n?.get(e);if(r!==void 0)return r;let i=t();return n?.set(e,i),i}function Rt(){return I.sequence??0}function Et(e,t,n){let r=I.active,i=r?.get(e);if(i&&i.pathBytes<=t)return i;let o=$n(n(),(I.sequence??0)+1);if(I.sequence=o.sequence,o.pathBytes>t)throw new RangeError(`Git project file listing exceeded ${t} path bytes.`);return r?.set(e,o),o}function It(e,t){let n=I.active?.get(e);return n&&n.sequence>t?n.indexAllowsTreeFingerprintReuse:void 0}function*vt(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 $n(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 T={run(e,t){let n=At(e,t);return n.kind==="success"?n.output:void 0},runResult:At},Zn=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],Ae=["status","--porcelain=v2","--branch","-z","--untracked-files=all"],ae=/^[0-9a-f]{40,64}$/;function Io(e,t,n=T){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let r=n.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(r.kind!=="success"||!ae.test(r.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return r.output}function vo(e,t=T){return er(e,t)?.context}function er(e,t=T){let n=t.runResult(e,Zn);if(n.kind==="success"){let i=tr(n.output);if(i){let o=nr(i,t);if(o)return Tt(o)}}let r=rr(e,t);return r?Tt(r):void 0}function To(e,t=T){if(!e.headCommit)return;let n=t.run(e.projectRoot,Ae);if(n===void 0)return;let r=Le(n);if(!(!r?.headCommit||r.headCommit!==e.headCommit))return{...e,clean:r.clean}}function Ao(e,t=T,n={}){let r=t===T&&n.cachedInventoryAfterSequence!==void 0?It(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 Tt(e){return{context:e,projectFileInventorySequence:Rt()}}function Le(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&&!ae.test(r))&&n!==void 0)return{headCommit:r,clean:t.every(i=>i.startsWith("# "))}}function tr(e){let t=e.split(`
2
- `).map(c=>c.trim());if(t.length!==5)return;let[n,r,i,o,s]=t;if(!n||!r||!i||!o||!s||!ae.test(o)||!ae.test(s))return;let a=v(n);return{root:a,gitDir:v(ce(a,r)),commonDir:v(ce(a,i)),headCommit:o,treeOid:s}}function nr(e,t){let n=t.run(e.root,Ae);if(n===void 0)return;let r=Le(n);return r?.headCommit!==e.headCommit?void 0:{...Lt(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Oe("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.clean}}function rr(e,t){let n=ir(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=v(ce(i,o)),a=Te(t.run(i,["rev-parse","--verify","HEAD"])),c=Te(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,Ae);if(u===void 0)return;let d=Le(u);if(!(!d||d.headCommit!==a))return{...r,commonDir:s,repositoryId:Oe("repository",s),headCommit:a,treeOid:c,clean:d.clean}}function ir(e,t=T){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=v(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=v(ce(i,o));return{kind:"worktree",identity:Lt(i,s)}}function Lt(e,t){return{projectRoot:e,gitDir:t,worktreeId:Oe("worktree",`${e}\0${t}`)}}function Lo(e,t,n=T){return Te(n.run(e,t))}function ce(e,t){return Xn(t)?t:ue(e,t)}function v(e){try{return Kn(e)}catch{return ue(e)}}function Oe(e,t){return qn("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function Te(e){return e?.trim()||void 0}function At(e,t){let n=Un("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"&&Jn(ue(e)))&&!or(e)?{kind:"not-repository"}:{kind:"error",message:i}}function or(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=ue(e);for(;;){try{return Vn(Qn(t,".git")),!0}catch(r){let i=r.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let n=Yn(t);if(n===t)return!1;t=n}}import{createRequire as cr}from"module";import{existsSync as ur,lstatSync as _t,readdirSync as pr,statSync as dr}from"fs";import l from"path";import{AsyncLocalStorage as sr}from"async_hooks";var ar=new sr;function O(e,t){let n=pe(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 _(e,t){let n=pe(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function Ot(e,t){return pe(e)?.fingerprints.get(t)}function D(e){return pe(e)?.paths}function pe(e){let t=ar.getStore();if(t)return t.projectRoot===v(e)?t:void 0}var lr=cr(import.meta.url),Dt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]),fr=18003;function de(e,t=[]){let n=l.resolve(e),r=t.flatMap(c=>mr(n,c));if(r.length>0)return Bt(n,Nt(r));let i=hr(n),o=Nt(i),s=yr(n,o)?[n,...o]:o,a=s.length>0?s:[n];return Bt(n,a)}function Gt(e){return new Set(e.map(t=>t==="."?"tsconfig.json":`${t.replace(/\/$/u,"")}/tsconfig.json`))}function Wt(e){let t=e.split("/").at(-1)?.toLowerCase();return t?.startsWith("tsconfig")===!0&&t.endsWith(".json")}var gr=/^\.scipquery-compiler-shard-\d+\.tsconfig\.json$/;function $o(e){return`.scipquery-compiler-shard-${e}.tsconfig.json`}function zt(e){return gr.test(e)}function Ht(e,t,n=[]){let r;try{r=lr("@ts-morph/common/dist/typescript.js")}catch{return null}let i=l.resolve(e),o=t==="workspace"?de(i,n):["."],s=new Set;for(let a of o){let c=a==="."?i:l.join(i,a),u=l.join(c,"tsconfig.json"),d=br(r,i);if(!d.fileExists(u))return null;let p=r.readConfigFile(u,d.readFile);if(p.error)return null;let f=r.parseJsonConfigFileContent(p.config,d,c);if(f.errors.some(m=>m.code!==fr))return null;for(let m of f.fileNames){let h=l.resolve(m);b(i,h)&&s.add(l.relative(i,h).split(l.sep).join("/"))}}return s}function Uo(e,t,n,r){let i=l.resolve(e),o=new Set(r);for(let a of n){let c=l.resolve(i,a);if(b(i,c))try{let u=_t(c);if(u.isSymbolicLink()||u.isFile()&&!o.has(B(i,c)))return!1}catch{}}let s=t==="workspace"?de(i,n):["."];for(let a of s){let c=a==="."?i:l.join(i,a),u=l.join(c,"tsconfig.json");if(!Ut(i,u))continue;let d=B(i,u);if(!o.has(d))return!1;try{if(_t(u).isSymbolicLink())return!1;let p=qt(i,u);if(p.includes("extends")||p.includes("\\"))return!1}catch{return!1}}return!0}function Bt(e,t){return[...new Set(t.map(n=>B(e,n)))].sort((n,r)=>n.localeCompare(r))}function hr(e){let t=D(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>Dt.has(s)))return[];let o=l.join(e,...i.split("/"));return Mt(e,o)?[l.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=pr(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=l.join(i,s.name);if(s.isDirectory()){!Dt.has(s.name)&&!s.name.startsWith(".")&&r.push(a);continue}s.isFile()&&Mt(e,a)&&n.push(l.dirname(a))}}return n}function mr(e,t){let n=t.trim();if(!n)return[];let r=l.resolve(e,n);if(!b(e,r))return[];let i=D(e);if(i){let o=B(e,r);if(i.includes(o)&&_e(l.basename(r)))return[l.dirname(r)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[r]:[]}try{let o=dr(r);if(o.isDirectory())return[r];if(o.isFile()&&_e(l.basename(r)))return[l.dirname(r)]}catch{return[]}return[]}function Mt(e,t){if(!_e(l.basename(t)))return!1;let n=$t(e,t);return n?l.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function _e(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Nt(e){let t=[...new Set(e.map(n=>l.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&Pr(n,r)))}function yr(e,t){if(t.length===0||t.some(r=>l.resolve(r)===e))return!1;let n=l.join(e,"tsconfig.json");return Ut(e,n)&&Sr(e,n)}function Sr(e,t){let r=$t(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!l.extname(i))):!1}function $t(e,t){try{let n=JSON.parse(qt(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Ut(e,t){let n=B(e,t),r=_(e,n);return r?r==="present":ur(t)}function qt(e,t){let n=B(e,t);if(D(e)){let i=O(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return U(t,"TypeScript project config")}function br(e,t){let n=D(t);if(!n)return e.sys;let r=l.resolve(t),i=new Set(n),o=xr(r,n),s=e,a=c=>{let u=l.resolve(c);return b(r,u)?B(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):O(r,u)?.content.toString("utf8")},readDirectory(c,u,d,p,f){let m=l.resolve(c);return b(r,m)?s.matchFiles(m,u,d,p,e.sys.useCaseSensitiveFileNames,r,f,h=>o.get(l.resolve(h))??{files:[],directories:[]},h=>h):e.sys.readDirectory(c,u,d,p,f)}}}function xr(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("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),r.get(a).add(u),a=l.join(a,u),i(a)}n.get(a).add(s.at(-1))}return new Map([...n].map(([o,s])=>[o,{files:[...s].sort(),directories:[...r.get(o)??[]].sort()}]))}function B(e,t){let n=l.relative(e,t);return n?n.split(l.sep).join("/"):"."}function Pr(e,t){let n=l.relative(e,t);return!!n&&!n.startsWith("..")&&!l.isAbsolute(n)}import{createHash as Me}from"crypto";import{execFileSync as Jt}from"child_process";import{createRequire as jr}from"module";var Cr=jr(import.meta.url),Fr=/\.(?:[cm]?[jt]sx?)$/iu,kr=/\.[jt]sx$/iu,Vt=/(?:^|\/)package\.json$/iu,q,De=new Map;function Kt(e,t){if(!Ne(e))return;let n=wr();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=kr.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=Me("sha256").update(`typescript-semantic-v1\0${i}\0`),a=!1,c=!1;for(;;){let u=o.scan();if(u===n.SyntaxKind.EndOfFileToken)break;if(u===n.SyntaxKind.WhitespaceTrivia)continue;if(u===n.SyntaxKind.NewLineTrivia){a&&(c=!0);continue}c&&s.update("line-break\0");let d=o.getTokenText();s.update(`${u}\0${Buffer.byteLength(d)}\0`).update(d).update("\0"),a=!0,c=!1}return s.digest("hex")}catch{return}}function Ne(e){return Fr.test(e)}function Ge(e,t){if(Vt.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 Me("sha256").update("typescript-package-json-v1\0").update(Be(i)).digest("hex")}catch{return}}function We(e){return Vt.test(e)}function Yo(e,t,n){if(!We(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(De.has(r))return De.get(r);let i;try{let o=Jt("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 a=Jt("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(Me("sha256").update(a).digest("hex")===n){i=Ge(t,a);break}}}catch{i=void 0}return De.set(r,i),i}function wr(){if(q!==void 0)return q;try{q=Cr("typescript")}catch{q=null}return q}function Be(e){return Array.isArray(e)?`[${e.map(Be).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${Be(n)}`).join(",")}}`:JSON.stringify(e)}import{createHash as tn,randomUUID as Dr}from"crypto";import{chmodSync as nn,existsSync as N,linkSync as Br,lstatSync as me,readdirSync as $e,realpathSync as C,unlinkSync as Mr,writeSync as Nr}from"fs";import{homedir as Gr}from"os";import{basename as Wr,dirname as ye,isAbsolute as Zt,join as y,resolve as Se}from"path";import{closeSync as Rr,existsSync as Er,fsyncSync as Ir,mkdirSync as vr,openSync as Tr}from"fs";import{dirname as Yt}from"path";function le(e,t,n,r){let i=0;for(;i<t.length;){let o=n.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${r} write did not make valid forward progress`);i+=o}}function ze(e,t){if(t!=="win32")return!1;let n=e.code;return n==="EACCES"||n==="EBADF"||n==="EINVAL"||n==="EISDIR"||n==="EPERM"}var J=Object.freeze({platform:process.platform,pathExists:e=>Er(e),makeDirectory:e=>vr(e,{recursive:!0}),openFile:(e,t,n)=>Tr(e,t,n),syncFile:e=>Ir(e),closeFile:e=>Rr(e)});function Xt(e,t=J){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=Yt(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=ge(i,fe(Yt(o),t));return i}function fe(e,t=J){let n;try{n=t.openFile(e,"r")}catch(r){if(ze(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(ze(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function ge(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createHash as Ar}from"crypto";import{createRequire as Lr}from"module";var Or=Lr(import.meta.url),Qt=_r().version,V;function ss(){if(V!==void 0)return V;let e=process.argv[1];try{V=e?Ar("sha256").update(M(e,{maxBytes:oe,inputKind:"CLI entry bundle"})).digest("hex").slice(0,16):"source"}catch{V="source"}return V}function _r(){for(let e of["../package.json","../../package.json"])try{return Or(e)}catch{}return{version:"0.0.0"}}var rn=1,Y=".scip-query-cache-owner.json",zr=16*1024,on=Object.freeze({...J,randomToken:()=>Dr(),linkFile:(e,t)=>Br(e,t),removeFile:e=>Mr(e),writeFile:(e,t,n,r)=>Nr(e,t,n,r)});function he(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 Hr(e,t){let n=C(e);return Ur(n,Ue(n,t))}function Ue(e,t){let n=C(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?Se(r):t?.dbPath?Jr(n,t.dbPath):$r(n)}function sn(){let e=process.env.XDG_CACHE_HOME;return y(e||y(Gr(),".cache"),"scip-query")}function $r(e){let t=Se(e);try{t=C(t)}catch{}let n=tn("sha256").update(t).digest("hex").slice(0,12);return y(sn(),"projects",n)}function ys(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(sn(),"repositories",e);return un(t),C(t)}function Ss(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function bs(e,t){let n=Hr(e,t);return{cacheDir:n,dbPath:y(n,"index.db"),indexPath:y(n,"index.scip"),metaPath:y(n,"meta.json")}}function Ur(e,t,n=on){return qr(e,t,n).cacheDir}function qr(e,t,n=on){let r=C(e),i=N(t)?"synced":un(t,n),o=C(t),s=y(o,Y);if(N(s))return He(r,o),qe(s),K(o),{kind:"existing",cacheDir:o};en(o),Qr(o),en(o);let c=`${JSON.stringify({schemaVersion:rn,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:Qt},null,2)}
3
- `;try{let u=Zr(s,c,n),d=ge(i,u);return{kind:"published",cacheDir:o,achievedDurability:d==="synced"?"directory-durable":"file-flushed",directorySync:d}}catch(u){if(ti(u))return He(r,o),{kind:"existing",cacheDir:o};throw u}}function He(e,t){let n=C(e),r=C(t);return Kr(r,n,r)}function xs(e,t){return N(y(t,Y))?(He(e,t),an(t),!0):!1}function Jr(e,t){let n;try{n=w(t)}catch(s){throw s instanceof g?he(t,s.reason):s}let r=Se(e,...n.split("/"));if(r===e||!b(e,r))throw he(t,"outside-project");let i=Vr(r),o=C(i);if(!b(e,o)&&o!==e)throw he(t,"symlink-escape");return r}function Vr(e){let t=e;for(;!N(t);){let n=ye(t);if(n===t)throw he(e,"no-existing-ancestor");t=n}return t}function Kr(e,t,n){let r=y(e,Y);if(!N(r)||me(r).isSymbolicLink())throw F(e,"missing regular ownership record");let i=me(r);if(!i.isFile()||i.size>zr)throw F(e,"invalid ownership record file");let o=U(r,"cache ownership record"),s=Yr(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:tn("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Yr(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==rn||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!Zt(n.canonicalProjectRoot)||!Zt(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 en(e){let t=$e(e).filter(n=>n!==Y&&!Xr(n));if(t.length>0)throw F(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function Xr(e){return e.startsWith(`${Y}.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 Qr(e){for(let t of $e(e)){let n=y(e,t);try{let r=me(n);if(r.isSymbolicLink())throw F(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())K(n);else if(r.isFile())qe(n);else throw F(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(cn(r))continue;throw r}}K(e)}function an(e,t=!1){try{let n=me(e);if(n.isSymbolicLink())throw F(e,"managed cache tree contains a symlink");if(n.isFile()){qe(e);return}if(!n.isDirectory())throw F(e,"managed cache tree contains a special file");K(e);for(let r of $e(e))an(y(e,r),!0)}catch(n){if(t&&cn(n))return;throw n}}function cn(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function un(e,t=J){let n=Xt(e,t);return K(e),n}function Zr(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,le(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=fe(ye(e),n);return n.removeFile(r),o=!1,ge(s,fe(ye(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function K(e){process.platform!=="win32"&&nn(e,448)}function qe(e){process.platform!=="win32"&&nn(e,384)}function ei(e){if(N(e))return C(e);let t=C(ye(e));return y(t,Wr(e))}function Ps(e){return ei(Se(e))}function ti(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{execFileSync as yi}from"child_process";import{isUtf8 as mn}from"buffer";import{createHash as Qe}from"crypto";import{closeSync as bn,fstatSync as X,lstatSync as et,openSync as xn,readdirSync as Si,readFileSync as bi,readSync as yn,readlinkSync as xi,realpathSync as Z}from"fs";import{isAbsolute as Pi,join as tt,relative as ji,resolve as Ci,sep as Fi}from"path";import{closeSync as pn,existsSync as Ve,openSync as ni,realpathSync as ri,renameSync as ii,unlinkSync as dn,writeSync as oi}from"fs";import{dirname as si,join as ai}from"path";var ci="fingerprint-stat-cache.json",ln=1,ui=8*1024*1024,Je=new Map;function Ke(e,t,n,r){let i=fn(e),o=i.files.get(t);if(!(!o||!gn(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function Ye(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=fn(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}},a=o.files.get(t);a&&hi(a,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function Xe(e){let t=Je.get(hn(e));if(!(!t?.dirty||!t.cachePath))try{let n=si(t.cachePath);if(!Ve(n))return;mi(t.cachePath,li(t)),t.dirty=!1}catch{}}function fn(e){let t=hn(e),n=Je.get(t);if(n)return n;let r=pi(t),i=di(r),o={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return Je.set(t,o),o}function pi(e){try{let t=Ue(e);return Ve(t)?ai(t,ci):null}catch{return null}}function di(e){let t=new Map;if(!e||!Ve(e))return t;try{let n=JSON.parse(M(e,{inputKind:"fingerprint stat cache",maxBytes:ui}).toString("utf8"));if(!fi(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function li(e){return{version:ln,files:Object.fromEntries(e.files)}}function fi(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==ln||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(gi)}function gi(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 gn(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 hi(e,t){return gn(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function mi(e,t){let n=`${e}.${process.pid}.tmp`;try{dn(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
4
- `,"utf8"),i=ni(n,"wx",384);try{le(i,r,{writeFile:(o,s,a,c)=>oi(o,s,a,c)},"fingerprint stat cache")}catch(o){throw pn(i),dn(n),o}pn(i),ii(n,e)}function hn(e){return ri(e)}var ee=64*1024*1024,ki=1024*1024,wi=1024,G=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 Ri(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function nt(e,t,n={}){let r=w(t),i=wt(e,()=>Z(e)),o=Ci(i,...r.split("/"));if(!b(i,o)||o===i)throw new g(t,"outside-project");let s=Z(o);if(!b(i,s)||s===i)throw new g(t,"outside-project");let a=et(s);if(!a.isFile())throw new g(t,"not-a-file");let c={projectRoot:i,relativePath:r,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=n.maxBytes??ee;if(L(u),c.size>u)throw new G(n.inputKind??"project file",c.relativePath,c.size,u);return c}function Ei(e,t,n={}){let r=w(t),i=_(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let c=O(e,r);if(!c)throw new g(r,"changed-during-read");let u=n.maxBytes??ee;if(L(u),c.size>u)throw new G(n.inputKind??"project file",r,c.size,u);return Buffer.from(c.content)}let o=nt(e,t,n),s=n.maxBytes??ee,a=xn(o.absolutePath,"r");try{let c=X(a);if(Q(c,o,t),c.size>s)throw new G(n.inputKind??"project file",o.relativePath,c.size,s);let u=bi(a),d=X(a);if(Q(d,o,t),u.byteLength!==c.size)throw new g(t,"changed-during-read");return u}finally{bn(a)}}function zs(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=Ii(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function Ii(e,t,n,r={}){if(n.length===0||n.some(c=>c.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=w(t),o=_(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let c=O(e,i);if(!c)throw new g(i,"changed-during-read");let u=r.maxBytes??ee;if(L(u),c.size>u)throw new G(r.inputKind??"project file",i,c.size,u);let d=!c.content.includes(0)&&mn(c.content),p=n.map(Sn),f=d?Ti(c.content,n,p):[];return{byteLength:c.size,isUtf8Text:d,matchedLiteralIndexes:f,bytes:f.length>0?Buffer.from(c.content):null,...r.computeSha256?{sha256:c.sha256}:{}}}let s=nt(e,t,r),a=xn(s.absolutePath,"r");try{let c=X(a);Q(c,s,t);let u=r.computeSha256?Qe("sha256"):null,d=r.scratchBuffer??Buffer.allocUnsafe(ki);if(d.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let p=0,f=n.map(()=>!1),m=!1,h=!0,x=Buffer.alloc(0),te=n.map(()=>Buffer.alloc(0)),W=n.map(Sn);for(;p<c.size;){let P=yn(a,d,0,Math.min(d.byteLength,c.size-p),p);if(P<=0)throw new g(t,"changed-during-read");let j=d.subarray(0,P);if(u?.update(j),m||=j.includes(0),h){let S=x.byteLength>0?Buffer.concat([x,j]):j,$=vi(S);h=mn(S.subarray(0,$)),x=Buffer.from(S.subarray($))}for(let S=0;S<n.length;S+=1){if(f[S])continue;let $=n[S],ot=te[S];f[S]=Ai(j,$,ot,W[S]),te[S]=Li(j,$,ot)}p+=P}h&&=x.byteLength===0,Q(X(a),s,t);let z=!m&&h,H=z?f.flatMap((P,j)=>P?[j]:[]):[],k=null;if(H.length>0){k=Buffer.allocUnsafe(c.size);let P=0;for(;P<k.byteLength;){let j=yn(a,k,P,k.byteLength-P,P);if(j<=0)throw new g(t,"changed-during-read");P+=j}Q(X(a),s,t)}return{byteLength:c.size,isUtf8Text:z,matchedLiteralIndexes:H,bytes:k,...u?{sha256:u.digest("hex")}:{}}}finally{bn(a)}}function Hs(e,t,n={}){return Ei(e,t,n).toString("utf8")}function Q(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 vi(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 Ti(e,t,n){return t.flatMap((r,i)=>Ze(e,r,n[i])?[i]:[])}function Ai(e,t,n,r){if(Ze(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 Ze(Buffer.concat([n,i]),t,r)}function Ze(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>wi)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 Sn(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 Li(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 rt(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function $s(e,t){try{return nt(e,t),!0}catch(n){if(rt(n))return!1;throw n}}function Oi(e){let t=D(e);return t?t.filter(n=>n&&!xe(n)).sort():(Gi(e)??Wi(e)).filter(n=>n&&!xe(n)).sort()}function _i(e,t={}){let n=(t.includePaths??[]).map(w),r=[...new Set([...Oi(e),...n])].filter(s=>!xe(s)).filter(s=>!t.language||lt(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,a)=>s.localeCompare(a)),i=Z(e),o=r.flatMap(s=>Pn(e,i,s));return Xe(i),o}function Pn(e,t,n){let r=Ot(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(_(e,n)==="present"){let o=O(e,n);if(o)return[{path:n,size:o.fingerprintSize??o.size,hash:o.sha256}]}let i=tt(e,n);try{let o=et(i);if(o.isSymbolicLink()){let x=Ke(t,n,"symlink",be(o));if(x)return[{path:n,size:x.size,hash:x.hash}];let te=Z(i),W=ji(t,te);if(W===".."||W.startsWith(`..${Fi}`)||Pi(W))throw new Error("external symlink");let z=xi(i),H=Qe("sha256").update("symlink\0").update(z).digest("hex"),k=Buffer.byteLength(z);return Ye(t,n,"symlink",be(o),{hash:H,size:k}),[{path:n,size:k,hash:H}]}let s=Ne(n)||We(n),a=Ke(t,n,"file",be(o));if(a&&(!s||a.semanticHash!==void 0))return[{path:n,size:a.size,hash:a.hash,...a.semanticHash===void 0?{}:{semanticHash:a.semanticHash}}];let c=Qe("sha256"),u=s,d=[],p=se(i,{inputKind:"project fingerprint input",maxBytes:ee},x=>{c.update(x),u&&d.push(Buffer.from(x))}),f=c.digest("hex"),m=u?Buffer.concat(d,p):void 0,h=m?Kt(n,m)??Ge(n,m):void 0;return Ye(t,n,"file",be(o),{hash:f,size:p,...h===void 0?{}:{semanticHash:h}}),[{path:n,size:p,hash:f,...h===void 0?{}:{semanticHash:h}}]}catch(o){return rt(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function be(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function jn(e,t,n){let r=it(t,n),i=[...r.typescriptProjects.filter(c=>Mi(e,c)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?Ht(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?de(e,r.typescriptProjects):["."]:[],a=Gt(s);return{...r,files:_i(e,{includePath:c=>{if(c===".scipquery.json")return!1;let u=re(c,t,i);return u==="other"||u==="config"&&Wt(c)&&!a.has(c)?!1:u!=="source"||!Bi(c)||!o?!0:o.has(c)},includePaths:i})}}function Us(e,t){let n=new Set(t.files.map(o=>o.path)),r=jn(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...it(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 qs(e,t,n,r,i,o){let s=p=>({mode:"full",fingerprint:jn(e,t,n),reason:p});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 a=it(t,n);if(!Di(r,a))return s("project-input-configuration-changed");if(new Set(r.files.map(p=>p.path)).size!==r.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...a,files:[...r.files].sort((p,f)=>p.path.localeCompare(f.path))},changedPaths:[]};let c=[...a.typescriptProjects,...a.clojureConfigPath?[a.clojureConfigPath]:[]],u=new Map(r.files.map(p=>[p.path,p]));for(let p of i.entries){let f=u.get(p.path);if(re(p.path,t,c)!=="source")return s("non-source-project-input-changed");if(p.kind==="add"&&f)return s("added-path-already-in-prior-project-input-snapshot");if(p.kind==="delete"&&!f)return s("deleted-path-not-in-prior-project-input-snapshot");if(p.kind==="change"&&!f)return s("changed-path-not-in-prior-project-input-snapshot");if(f&&(f.hash==="unreadable"||f.size<0))return s("changed-path-was-unreadable")}let d=Z(e);for(let p of i.entries){let f=Pn(e,d,p.path);if(p.kind==="delete"){if(f.length!==0)return s("deleted-source-is-still-readable");u.delete(p.path);continue}if(f.length!==1||f[0].hash==="unreadable"||f[0].size<0)return s(p.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(p.path,f[0])}return Xe(d),{mode:"delta",fingerprint:{...a,files:[...u.values()].sort((p,f)=>p.path.localeCompare(f.path))},changedPaths:i.entries.map(p=>p.path).sort()}}function Di(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 Bi(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function Mi(e,t){let n;try{n=w(t)}catch{return!1}let r=_(e,n);if(r)return r==="present";try{return et(tt(e,n)).isFile()}catch(i){if(rt(i))return!1;throw i}}function it(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Ri(t.typescriptProjects),clojureConfigPath:Ni(t.clojureConfigPath)}}function Ni(e){return e?.trim()||void 0}function Gi(e){try{let t=Et(e,52428800,()=>yi("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...vt(t)]}catch{return null}}function Wi(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?tt(e,r):e,o;try{o=Si(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){xe(a)||n.push(a);continue}t.push(a)}}return t}function xe(e){let t=e.split("/");return e==="meta.json"||zt(e)||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>zi.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var zi=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{g as a,Pe as b,$i as c,Ui as d,b as e,w as f,re as g,lt as h,Ji as i,at as j,Vi as k,Ki as l,wn as m,R as n,St as o,Xi as p,Qi as q,Zi as r,eo as s,to as t,no as u,bt as v,A as w,uo as x,po as y,lo as z,In as A,fo as B,oe as C,Pt as D,Mn as E,Nn as F,E as G,M as H,Ee as I,U as J,Gn as K,Wn as L,zn as M,se as N,Hn as O,le as P,ze as Q,J as R,Xt as S,fe as T,ge as U,Et as V,vt as W,T as X,Io as Y,vo as Z,To as _,Ao as $,Lo as aa,ce as ba,v as ca,de as da,Gt as ea,Wt as fa,$o as ga,zt as ha,Ht as ia,Uo as ja,Yo as ka,Qt as la,ss as ma,Ue as na,sn as oa,$r as pa,ys as qa,Ss as ra,bs as sa,xs as ta,Ps as ua,G as va,Ri as wa,nt as xa,Ei as ya,zs as za,Ii as Aa,Hs as Ba,rt as Ca,$s as Da,Oi as Ea,_i as Fa,jn as Ga,Us as Ha,qs as Ia,it as Ja};
5
- //# sourceMappingURL=chunk-JZ2A7LDM.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,80 +0,0 @@
1
- import{ma as I,x as O}from"./chunk-JZ2A7LDM.js";var w=[];function m(n){n.groups.length>0&&w.push(n)}function Ne(n,t){let e=new Set(t.groups);for(let a of w)a.groups.some(r=>e.has(r))&&(t.file!==void 0&&a.clearFile?a.clearFile(n,t.file):a.clearAll(n))}var P=256;function x(n){let t=n.maxEntries;if(t!==void 0){if(!Number.isSafeInteger(t)||t<1)throw new Error(`Per-database cache maxEntries must be a positive safe integer; received ${t}.`);return t}return n.clearGroups.includes("source-file")?P:void 0}function M(n,t,e){n.delete(t),n.set(t,e)}function k(n,t){if(t!==void 0)for(;n.size>t;){let e=n.keys().next().value;if(e===void 0)return;n.delete(e)}}function V(){let n=new WeakMap;return{cache:n,ensure(t){let e=n.get(t);return e||(e=new Map,n.set(t,e)),e}}}function R(n,t){let{cache:e,ensure:a}=V(),r=x(t),i={get(o,c,y){let p=a(o);if(p.has(c)){let E=p.get(c);return M(p,c,E),E}let u=y();return p.set(c,u),k(p,r),u},has(o,c){return e.get(o)?.has(c)??!1},invalidate(o,c){e.get(o)?.delete(c)},invalidateAll(o){e.delete(o)},size(o){return e.get(o)?.size??0}};return m({name:n,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,c)=>i.invalidate(o,c)}),i}function Re(n,t){let e=new WeakMap,a={get(r,i){let o=e.get(r);if(o)return o.value;let c=i();return e.set(r,{value:c}),c},invalidate(r){e.delete(r)},has(r){return e.has(r)}};return m({name:n,groups:t.clearGroups,clearAll:r=>a.invalidate(r)}),a}var re={clearGroups:["whole-project","source-file"],maxEntries:P};function be(n){return ae(n,re)}function ae(n,t){let{cache:e,ensure:a}=V(),r=x(t),i={get(o,c,y,p){let u=a(o),E=u.get(c);if(E&&E.source===y)return M(u,c,E),E.value;let A=p();return u.set(c,{source:y,value:A}),k(u,r),A},invalidate(o,c){e.get(o)?.delete(c)},invalidateAll(o){e.delete(o)}};return m({name:n,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,c)=>i.invalidate(o,c)}),i}import{createHash as ie}from"crypto";import{existsSync as Oe,mkdirSync as oe}from"fs";import{dirname as U,join as ce}from"path";import j from"better-sqlite3";var se="evidence.db";var le=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],S=new Set(le);var ke=512*1024*1024,de=6e4,D=new WeakMap,pe=R("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),ue=R("evidence-project-fingerprint",{clearGroups:["whole-project"]}),g="evidence-v1",f="version NOT LIKE 'evidence-%'",K=null;function s(){return K??=`${g}+${I()}`,K}function H(n){return ie("sha256").update(n).digest("hex")}function Ve(n,t,e){return pe.get(n,t,()=>H(e))}function Ke(n){return ue.get(n,"current",()=>{try{if(!n.generation.metadataRaw)return null;let t=O(n.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let e=t.metadata,a=[...e.indexedLanguages??[]].sort();return H(JSON.stringify({fingerprint:e.fingerprint,indexedLanguages:a,status:e.status}))}catch(t){return h("project fingerprint unavailable",t),null}})}function h(n,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${n}: ${t instanceof Error?t.message:String(t)}`)}function l(n){if(D.has(n))return D.get(n)??null;let t=null;try{let e=new j(n.config.evidenceDbPath??ce(U(n.config.dbPath),se));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.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
- `);for(let a of["file_evidence","project_evidence"])e.prepare(`DELETE FROM ${a} WHERE version LIKE 'evidence-%' AND version != ?`).run(s());t={evidence:e,shared:Ee(n.config.sharedEvidenceDbPath),readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.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:e.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsLegacyFileEvidence:e.prepare(`SELECT 1 AS present FROM file_evidence
39
- WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${f}
40
- LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:e.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:e.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:e.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:e.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:e.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
44
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.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:e.prepare(`SELECT symbol, payload FROM semantic_callees
48
- WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:e.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:e.prepare(`INSERT OR REPLACE INTO semantic_callees
51
- (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
52
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.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:e.prepare(`SELECT symbol, payload FROM semantic_references
56
- WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
57
- WHERE relative_path = ? AND project_fingerprint = ? AND ${f}
58
- ORDER BY symbol, version DESC`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
59
- (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(e){h("disabled (open failed)",e)}return D.set(n,t),t}function d(n,t,e){h(`disabled (${t})`,e),D.set(n,null)}function Ee(n){if(!n)return null;try{oe(U(n),{recursive:!0});let t=new j(n);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.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:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsFileEvidence:t.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.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:t.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(t){return h("shared cache disabled (open failed)",t),null}}function N(n,t,e){h(`shared cache disabled (${t})`,e);try{n.shared?.evidence.close()}catch{}n.shared=null}function Ue(n,t,e,a){let r=l(n);if(!r)return null;try{let i=r.readFileEvidence.get(t,e,a,s())??r.readLegacyFileEvidence.get(t,e,a);if(i?.payload!==void 0)return i.payload;if(!S.has(t)||!r.shared)return null;try{let o=r.shared.readFileEvidence.get(t,e,a,s());return o?.payload!==void 0&&W(r.shared,t,e,a),o?.payload??null}catch(o){return N(r,"file_evidence read",o),null}}catch(i){return d(n,"file_evidence read",i),null}}function je(n,t,e,a){let r=l(n);if(!r)return!1;try{if((r.existsFileEvidence.get(t,e,a,s())??r.existsLegacyFileEvidence.get(t,e,a))?.present!==void 0)return!0;if(!S.has(t)||!r.shared)return!1;try{return r.shared.existsFileEvidence.get(t,e,a,s())?.present===void 0?!1:(W(r.shared,t,e,a),!0)}catch(o){return N(r,"file_evidence exists",o),!1}}catch(i){return d(n,"file_evidence exists",i),!1}}function W(n,t,e,a){let r=Date.now();try{n.touchFileEvidence.run(r,t,e,a,s(),r-de)}catch(i){h("shared file_evidence recency touch skipped",i)}}function He(n,t,e,a,r){let i=l(n);if(i)try{if(i.writeFileEvidence.run(t,e,a,s(),r),S.has(t)&&i.shared)try{i.shared.writeFileEvidence.run(t,e,a,s(),r,Date.now())}catch(o){N(i,"file_evidence write",o)}}catch(o){d(n,"file_evidence write",o)}}function We(n,t){if(t.length===0)return;let e=l(n);if(e)try{e.evidence.transaction(()=>{for(let r of t)e.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,s(),r.payload)})();try{e.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let a=t.filter(r=>S.has(r.kind));if(a.length>0&&e.shared)try{e.shared.evidence.transaction(()=>{for(let r of a)e.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,s(),r.payload,Date.now())})()}catch(r){N(e,"file_evidence batch write",r)}}catch(a){d(n,"file_evidence batch write",a)}}function Xe(n,t,e,a){let r=l(n);if(!r)return null;try{return(r.readProjectEvidence.get(t,e,a,s())??r.readLegacyProjectEvidence.get(t,e,a))?.payload??null}catch(i){return d(n,"project_evidence read",i),null}}function Ye(n,t,e,a,r){let i=l(n);if(i)try{i.writeProjectEvidence.run(t,e,a,s(),r)}catch(o){d(n,"project_evidence write",o)}}function Be(n,t,e,a){if(e===a)return 0;let r=l(n);if(!r)return 0;try{return r.rekeyProjectEvidenceKind.run(a,s(),t,e).changes}catch(i){return d(n,"project_evidence kind rekey",i),0}}function $e(n,t,e,a){let r=l(n);if(!r)return new Map;try{let i=r.readCalleesForFile.all(t,e,a,g),o=r.readLegacyCalleesForFile.all(t,e,a);return X([...o,...i])}catch(i){return d(n,"semantic_callees bulk read",i),new Map}}function Ge(n,t,e){let a=l(n);if(!a)return new Map;try{let r=a.readReferencesForFile.all(t,e,g),i=a.readLegacyReferencesForFile.all(t,e);return X([...i,...r])}catch(r){return d(n,"semantic_references bulk read",r),new Map}}function X(n){let t=new Map;for(let e of n)t.set(e.symbol,e.payload);return t}function Qe(n,t){if(t.length===0)return;let e=l(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(r.relativePath,r.contentHash)),e.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,g,r.payload)}})()}catch(a){d(n,"semantic_callees write",a)}}function ze(n,t){if(t.length===0)return;let e=l(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t){let i=`${r.relativePath}\0${r.projectFingerprint}`;a.has(i)||(a.add(i),e.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),e.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,g,r.payload)}})()}catch(a){d(n,"semantic_references write",a)}}import{appendFileSync as fe,mkdirSync as he}from"fs";import{createHash as ve,randomUUID as ge}from"crypto";import{dirname as _e}from"path";import{performance as v}from"perf_hooks";var G="SCIP_QUERY_PROFILE",Q="SCIP_QUERY_PROFILE_OUT",z="SCIP_QUERY_PROFILE_COMMAND",J="SCIP_QUERY_PROFILE_CACHE_STATE",b="SCIP_QUERY_PROFILE_RUN_ID",L="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",F="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",q=[G,Q,z,J,b,L,F],nt=new Set(q),Y=new Set,B=new Map,$=!1;function _(){let n=process.env[G];return n==="1"||n==="true"}function ye(){return process.env[Q]}function Z(){return process.env[z]}function me(){return process.env[J]}function ee(){let n=process.env[b];if(n)return n;if(!_())return;let t=ge();return process.env[b]=t,t}function te(){return process.env[L]}function De(n){let t=te();if(t)return t;if(!_())return;let e=ee();if(!e)return;let a=n.projectFingerprint?"published-project":"run-only",r=ne(["profile-workload-v1",n.toolVersion,n.command,n.projectFingerprint??e]);return process.env[L]=r,process.env[F]=a,r}function ne(n){return ve("sha256").update(JSON.stringify(n)).digest("hex").slice(0,24)}function rt(){return Object.fromEntries(q.flatMap(n=>{let t=process.env[n];return t===void 0?[]:[[n,t]]}))}function at(n,t,e){if(!_())return t();let a=v.now();try{let r=t();return T({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!0,...C(e)??{}}),r}catch(r){throw T({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!1,error:r instanceof Error?r.message:String(r),...C(e)??{}}),r}}async function it(n,t,e){if(!_())return t();let a=v.now();try{let r=await t();return T({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!0,...C(e)??{}}),r}catch(r){throw T({type:"span",name:n,durationMs:Math.round(v.now()-a),ok:!1,error:r instanceof Error?r.message:String(r),...C(e)??{}}),r}}function T(n,t=ye()){let e=Se(n),a={timestamp:new Date().toISOString(),pid:process.pid,runId:ee(),command:Z(),cacheState:me(),...e,...n},r=`${JSON.stringify(a)}
78
- `;if(t)try{let i=_e(t);Y.has(i)||(he(i,{recursive:!0}),Y.add(i)),fe(t,r);return}catch(i){$||($=!0,process.stderr.write(`[profile] failed to write ${t}: ${i instanceof Error?i.message:String(i)}
79
- `));return}_()&&process.stderr.write(r)}function Se(n){let t=te()??De({command:Z()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!t)return{};let e=process.env[F],a=typeof n.name=="string"?n.name:void 0;if(!a)return{workloadIdentity:t,workloadIdentityKind:e};let r=a.split(/[.:]/,1)[0]??a,i=`${t}\0${a}`,o=B.get(i);return o||(o=ne(["profile-subsystem-v1",t,a]),B.set(i,o)),{workloadIdentity:t,workloadIdentityKind:e,subsystem:r,subsystemWorkIdentity:o}}function C(n){return typeof n=="function"?n():n}export{m as a,Ne as b,R as c,Re as d,be as e,ae as f,se as g,H as h,Ve as i,Ke as j,Ue as k,je as l,He as m,We as n,Xe as o,Ye as p,Be as q,$e as r,Ge as s,Qe as t,ze as u,_ as v,ne as w,rt as x,at as y,it as z,T as A};
80
- //# sourceMappingURL=chunk-KNLQGXVH.js.map
@@ -1,2 +0,0 @@
1
- import{a as x}from"./chunk-XKXTR6ZI.js";import{a as b}from"./chunk-4FR6GQIT.js";import{b as h}from"./chunk-FLMTCX5R.js";import{b as p}from"./chunk-BOW7SSQH.js";import{Da as T}from"./chunk-JZ2A7LDM.js";function $(t,e){return e==="config-code"||e==="doc-code"||e==="generated-artifact"||e==="schema-script"?{actionTier:"signal",tierReason:`${e} partner: configuration, documentation, schema, and generated files change alongside many sources`}:t.focusedTogether===0?{actionTier:"signal",tierReason:"every shared commit was a broad sweep; no focused change touched both files"}:t.recency==="stale"&&t.focusedTogether<=2?{actionTier:"signal",tierReason:"at most two focused co-changes, none of them recent"}:{actionTier:"direct",tierReason:`${t.focusedTogether} focused co-change(s)`}}function se(t){return y.test(t)}var y=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|uv\.lock|poetry\.lock|Pipfile\.lock|bun\.lockb?|\.SRCINFO|CHANGELOG(?:\.[a-z]+)?|.*\.(?:map|tsbuildinfo))$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function oe(t,e,n={}){let{minTogether:s=4,minConfidence:o=.6,limit:a=30,maxFilesPerCommit:l=20}=n,g=x(t,{historyMode:n.historyMode,...n.head?{head:n.head}:{}}),r=g.commitHistory(),c=e!==void 0,d=g.coChangePairs({minTogether:c?Math.min(s,2):s,minConfidence:c?0:o,maxFilesPerCommit:l});if(!r||!d)return{available:!1,commitsAnalyzed:0,findings:[]};let f=typeof n.scanLimit=="number"?d.slice(0,n.scanLimit):d,j=p(t),w=E(t),L=I(t,j,w),v=n.includeLinked===!0||c,m=[];for(let i of f){if(y.test(i.fileA)||y.test(i.fileB)||!P(t,i.fileA)||!P(t,i.fileB)||c&&!i.fileA.includes(e)&&!i.fileB.includes(e)||!c&&(h(i.fileA)==="test"||h(i.fileB)==="test"||B(i.fileA,i.fileB)||O(i.fileA,i.fileB)))continue;let C=L(i.fileA,i.fileB);if(!v&&C)continue;let u=F(i.fileA,i.fileB),S=_(i,u,C);if(m.push({...i,structurallyLinked:C,partnerClass:u.partnerClass,partnerClassReasons:u.reasons,...$(i,u.partnerClass),...S?{declaredCouplingSuggestion:S}:{}}),m.length>=a)break}return{available:!0,commitsAnalyzed:r.commits.length,findings:m}}function P(t,e){return T(t.config.projectRoot,e)}function F(t,e){let n=R(t),s=R(e),o=[],a=r=>{o.includes(r)||o.push(r)},l=(r,c)=>n.tags.has(r)&&s.tags.has(c)||n.tags.has(c)&&s.tags.has(r);if(n.tags.has("generated")||s.tags.has("generated"))return a("one side is a generated artifact (migration journal, snapshot, or codegen output) that a tool rewrites whenever its source changes"),{partnerClass:"generated-artifact",reasons:o};if(l("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:o};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:o};if(l("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:o};if(l("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:o};if(l("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:o};let g=V(n.tokens,s.tokens).filter(r=>!K.has(r));return k(t,e)||g.length>=2?(a(k(t,e)?"both files live in the same directory":`files share feature tokens: ${g.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:o}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:o})}function _(t,e,n){if(n||t.together<4||t.confidence<.75||t.commitScope==="broad-sweep"||t.recency==="stale"||!J.has(e.partnerClass))return;let s=[t.fileA,t.fileB].sort();return{name:`co-change ${e.partnerClass}: ${Q(s)}`,files:s,reason:`${e.partnerClass} pair changed together ${t.together}x with ${Math.round(t.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function I(t,e=p(t),n=E(t)){return(s,o)=>M(e,n,s,o)}var N=/(?:^|\/)(?:locales|i18n)\//i;function A(t){return N.test(t)}function O(t,e){return A(t)&&A(e)?!0:D(t,e)}function D(t,e){if(!t.endsWith(".json")||!e.endsWith(".json"))return!1;let n=t.lastIndexOf("/"),s=e.lastIndexOf("/");if(n<0||s<0)return!1;let o=t.slice(0,n),a=e.slice(0,s);if(o===a)return!1;let l=t.slice(n+1),g=e.slice(s+1);if(l!==g)return!1;let r=o.lastIndexOf("/"),c=a.lastIndexOf("/"),d=r>=0?o.slice(0,r):"",f=c>=0?a.slice(0,c):"";return d===f}function B(t,e){let n=t.lastIndexOf("/"),s=e.lastIndexOf("/");if(t.slice(0,n)!==e.slice(0,s))return!1;let o=t.slice(n+1).split(".")[0],a=e.slice(s+1).split(".")[0];return o!==""&&o===a}function E(t){return(t.config.declaredCouplings??[]).filter(e=>Array.isArray(e.files)&&e.files.length>=2).map(e=>new Set(e.files))}function M(t,e,n,s){return t.get(n)?.has(s)===!0||t.get(s)?.has(n)===!0?!0:e.some(o=>o.has(n)&&o.has(s))}var G=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,z=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,H=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,q=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,W=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,Z=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,J=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),K=new Set(["src","lib","app","apps","packages","frontend","backend","examples","python","typescript","javascript","test","tests","spec","index","main","utils","util","types","type","config","docs","doc","package","requirements","ts","tsx","js","jsx","mjs","cjs","vue","py","md","mdx","json","yaml","yml","toml","txt"]);function R(t){let e=t.replace(/\\/g,"/"),n=new Set;return b(e)&&n.add("generated"),G.test(e)&&n.add("doc"),z.test(e)&&n.add("config"),H.test(e)&&n.add("schema"),q.test(e)&&n.add("script"),W.test(e)&&n.add("model"),Z.test(e)&&n.add("view"),h(e)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:U(e)}}function k(t,e){let n=t.lastIndexOf("/"),s=e.lastIndexOf("/"),o=n>=0?t.slice(0,n):"",a=s>=0?e.slice(0,s):"";return o!==""&&o===a}function U(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(e=>e.toLowerCase()).filter(e=>e.length>=2)}function V(t,e){let n=new Set(e);return[...new Set(t.filter(s=>n.has(s)))].sort()}function Q(t){return t.map(e=>e.split("/").pop()?.replace(/\.[^.]+$/,"")||e).join(" + ")}export{$ as a,se as b,oe as c,F as d,_ as e,I as f};
2
- //# sourceMappingURL=chunk-KVQCECPR.js.map
@@ -1,4 +0,0 @@
1
- import{b as i}from"./chunk-NSM5IEVW.js";import{a as o}from"./chunk-BOW7SSQH.js";import{A as l}from"./chunk-C7C6AKAT.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
2
- WHERE relative_path IN (${a})
3
- ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
4
- //# sourceMappingURL=chunk-KXXORBZ2.js.map
@@ -1,35 +0,0 @@
1
- import{a as p}from"./chunk-RVZC6TJE.js";import{f as g}from"./chunk-ANLNLY66.js";import{a as f}from"./chunk-2USA3S3P.js";import{K as d,i as b,p as l}from"./chunk-2VAHDDLM.js";import{a as I}from"./chunk-YXPUP5G2.js";import{c as u,d as _,h as N}from"./chunk-BL6DCHQP.js";import{o as c}from"./chunk-7HXT6YLU.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=p(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d ON c.document_id = d.id
5
- JOIN global_symbols gs ON m.symbol_id = gs.id
6
- WHERE gs.symbol LIKE ?
7
- AND m.role = 2
8
- ORDER BY d.relative_path`,`%${t}%`).filter(s=>!e.isIgnored(s.importer)).map(s=>({symbol:s.symbol,shortName:u(s.symbol),fromFile:s.importer}))}function k(e,t,r=f(e,t)){let s=r?.relativePath??null,o=r?_(r.symbol):t.replace(/\(\)$/,""),n=r?N(r.symbol):!1,i=new Set;for(let a of I(e,{includeIgnored:!1}))for(let F of d(e,a))M(F,a,{targetFile:s,targetLeaf:o,targetIsModule:n,targetPattern:t})&&i.add(a);let m=h(t)?t.trim():null;return[...i].sort().map(a=>({symbol:m??r?.symbol??o,shortName:m??(r?u(r.symbol):o),fromFile:a}))}function x(e){return!!(e&&(e.symbol.startsWith("scip-clojure ")||l(e.relativePath)==="clojure"))}function D(e){let t=new Set,r=[];for(let s of e){let o=`${s.symbol}|${s.fromFile}`;t.has(o)||(t.add(o),r.push(s))}return r.sort((s,o)=>s.fromFile.localeCompare(o.fromFile)||s.shortName.localeCompare(o.shortName))}function M(e,t,r){return!e.sourcePath||r.targetFile&&c(e.sourcePath)!==c(r.targetFile)?!1:e.kind==="side-effect"||r.targetFile&&$(t)||e.kind==="namespace"&&P(e,r.targetPattern)||r.targetIsModule||e.kind==="named"&&e.importedName===r.targetLeaf?!0:e.kind==="namespace"&&e.usedMembers.includes(r.targetLeaf)}function P(e,t){let r=t.trim().replace(/\(\)$/,"");return h(r)?e.importedName===r||e.localName===r:!1}function h(e){let t=e.trim().replace(/\(\)$/,"");return t.includes(".")&&!t.includes("/")&&!t.includes(":")}function T(e,t,r={}){let s=p(e,t);return s?L(e,s,r)??(r.semantic===!1?null:E(e,s))??S(e,s):null}function L(e,t,r){let o=e.all(`SELECT DISTINCT
9
- gs.symbol,
10
- def_d.relative_path AS from_file,
11
- imp_d.relative_path AS importer,
12
- EXISTS (
13
- SELECT 1
14
- FROM mentions ref_m
15
- JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
16
- WHERE ref_m.symbol_id = gs.id
17
- AND ref_m.role != 1
18
- AND ref_c.document_id = imp_d.id
19
- ) AS used
20
- FROM mentions m
21
- JOIN chunks c ON m.chunk_id = c.id
22
- JOIN documents imp_d ON c.document_id = imp_d.id
23
- JOIN global_symbols gs ON m.symbol_id = gs.id
24
- LEFT JOIN (
25
- SELECT m2.symbol_id, c2.document_id
26
- FROM mentions m2
27
- JOIN chunks c2 ON m2.chunk_id = c2.id
28
- WHERE m2.role = 1
29
- GROUP BY m2.symbol_id
30
- ) sym_def ON sym_def.symbol_id = gs.id
31
- LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
32
- WHERE imp_d.relative_path = ?
33
- AND m.role = 2
34
- ORDER BY def_d.relative_path, gs.symbol`,t).filter(n=>!e.isIgnored(n.importer));if(o.length>0){let n=r.semantic===!1?[]:g(e,t);return o.map(i=>({symbol:i.symbol,shortName:u(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function E(e,t){let r=g(e,t);return r.length>0?r.map(s=>{let o=y(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function S(e,t){let r=A(t,b(e,t));return d(e,t).map(s=>{let o=y(s.importedName,s.localName,s.kind),n=s.kind==="side-effect"||v(t,s)||r.has(s.localName??s.importedName)?!0:s.used;return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:n}})}function A(e,t){let r=new Set;if(l(e)!=="python")return r;let s=/(?:^|\n)\s*__all__\s*(?:\+?=)\s*[[(]([\s\S]*?)[\])]/g;for(let o of t.matchAll(s)){let n=o[1]??"";for(let i of n.matchAll(/(['"])([A-Za-z_]\w*)\1/g))r.add(i[2])}return r}function v(e,t){if(l(e)!=="rust"||t.used||t.kind==="side-effect")return!1;let r=t.localName??t.importedName;return r==="_"||/^[A-Z]/.test(r)}function y(e,t,r){return r==="namespace"&&e==="*"&&t?`* as ${t}`:r==="default"&&t?`default as ${t}`:r==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function $(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{Y as a,Z as b,G as c};
35
- //# sourceMappingURL=chunk-L5KYH6U3.js.map