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{a as Je,f as V,h as X,k as Ke,m as Q,n as Z,o as ge}from"./chunk-7F45LJKI.js";import{isAbsolute as Ye,relative as sn}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 he(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function di(e){return e.replace(/\\/g,"/")}function gi(e,t){return he(e)===he(t)}function j(e,t){let n=sn(e,t);return n===""||!n.startsWith("..")&&!Ye(n)}function I(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(Ye(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=he(e);if(t.split("/").some(r=>r===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}import{createHash as tt,randomUUID as mn}from"crypto";import{chmodSync as nt,existsSync as _,linkSync as yn,lstatSync as re,readdirSync as ye,realpathSync as C,unlinkSync as Sn,writeSync as jn}from"fs";import{homedir as bn}from"os";import{basename as Pn,dirname as ie,isAbsolute as Ze,join as y,resolve as oe}from"path";import{closeSync as cn,existsSync as an,fsyncSync as un,mkdirSync as ln,openSync as pn}from"fs";import{dirname as Ve}from"path";var M=Object.freeze({platform:process.platform,pathExists:e=>an(e),makeDirectory:e=>ln(e,{recursive:!0}),openFile:(e,t,n)=>pn(e,t,n),syncFile:e=>un(e),closeFile:e=>cn(e)});function Xe(e,t=M){let n=[],r=e;for(;!t.pathExists(r);){n.push(r);let o=Ve(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=te(i,ee(Ve(o),t));return i}function ee(e,t=M){let n;try{n=t.openFile(e,"r")}catch(r){if(ge(r,t.platform))return"unsupported";throw r}try{t.syncFile(n)}catch(r){try{t.closeFile(n)}catch{}if(ge(r,t.platform))return"unsupported";throw r}return t.closeFile(n),"synced"}function te(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createHash as fn}from"crypto";import{createRequire as dn}from"module";var gn=dn(import.meta.url),Qe=hn().version,z;function Ci(){if(z!==void 0)return z;let e=process.argv[1];try{z=e?fn("sha256").update(V(e,{maxBytes:Je,inputKind:"CLI entry bundle"})).digest("hex").slice(0,16):"source"}catch{z="source"}return z}function hn(){for(let e of["../package.json","../../package.json"])try{return gn(e)}catch{}return{version:"0.0.0"}}var rt=1,H=".scip-query-cache-owner.json",xn=16*1024,it=Object.freeze({...M,randomToken:()=>mn(),linkFile:(e,t)=>yn(e,t),removeFile:e=>Sn(e),writeFile:(e,t,n,r)=>jn(e,t,n,r)});function ne(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 Cn(e,t){let n=C(e);return wn(n,Se(n,t))}function Se(e,t){let n=C(e),r=process.env.SCIP_QUERY_CACHE_DIR;return r?oe(r):t?.dbPath?In(n,t.dbPath):Fn(n)}function ot(){let e=process.env.XDG_CACHE_HOME;return y(e||y(bn(),".cache"),"scip-query")}function Fn(e){let t=oe(e);try{t=C(t)}catch{}let n=tt("sha256").update(t).digest("hex").slice(0,12);return y(ot(),"projects",n)}function _i(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(ot(),"repositories",e);return at(t),C(t)}function Li(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function Ni(e,t){let n=Cn(e,t);return{cacheDir:n,dbPath:y(n,"index.db"),indexPath:y(n,"index.scip"),metaPath:y(n,"meta.json")}}function wn(e,t,n=it){return kn(e,t,n).cacheDir}function kn(e,t,n=it){let r=C(e),i=_(t)?"synced":at(t,n),o=C(t),s=y(o,H);if(_(s))return me(r,o),je(s),W(o),{kind:"existing",cacheDir:o};et(o),On(o),et(o);let a=`${JSON.stringify({schemaVersion:rt,canonicalProjectRoot:r,canonicalCacheDir:o,creatorVersion:Qe},null,2)}
2
- `;try{let u=Dn(s,a,n),p=te(i,u);return{kind:"published",cacheDir:o,achievedDurability:p==="synced"?"directory-durable":"file-flushed",directorySync:p}}catch(u){if(Ln(u))return me(r,o),{kind:"existing",cacheDir:o};throw u}}function me(e,t){let n=C(e),r=C(t);return vn(r,n,r)}function Gi(e,t){return _(y(t,H))?(me(e,t),st(t),!0):!1}function In(e,t){let n;try{n=I(t)}catch(s){throw s instanceof g?ne(t,s.reason):s}let r=oe(e,...n.split("/"));if(r===e||!j(e,r))throw ne(t,"outside-project");let i=En(r),o=C(i);if(!j(e,o)&&o!==e)throw ne(t,"symlink-escape");return r}function En(e){let t=e;for(;!_(t);){let n=ie(t);if(n===t)throw ne(e,"no-existing-ancestor");t=n}return t}function vn(e,t,n){let r=y(e,H);if(!_(r)||re(r).isSymbolicLink())throw F(e,"missing regular ownership record");let i=re(r);if(!i.isFile()||i.size>xn)throw F(e,"invalid ownership record file");let o=X(r,"cache ownership record"),s=Rn(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:tt("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Rn(e,t){try{let n=JSON.parse(e);if(n.schemaVersion!==rt||typeof n.canonicalProjectRoot!="string"||typeof n.canonicalCacheDir!="string"||typeof n.creatorVersion!="string"||!Ze(n.canonicalProjectRoot)||!Ze(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 et(e){let t=ye(e).filter(n=>n!==H&&!Tn(n));if(t.length>0)throw F(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function Tn(e){return e.startsWith(`${H}.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 On(e){for(let t of ye(e)){let n=y(e,t);try{let r=re(n);if(r.isSymbolicLink())throw F(e,`legacy cache entry ${t} is a symlink`);if(r.isDirectory())W(n);else if(r.isFile())je(n);else throw F(e,`legacy cache entry ${t} is not a file or directory`)}catch(r){if(ct(r))continue;throw r}}W(e)}function st(e,t=!1){try{let n=re(e);if(n.isSymbolicLink())throw F(e,"managed cache tree contains a symlink");if(n.isFile()){je(e);return}if(!n.isDirectory())throw F(e,"managed cache tree contains a special file");W(e);for(let r of ye(e))st(y(e,r),!0)}catch(n){if(t&&ct(n))return;throw n}}function ct(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function at(e,t=M){let n=Xe(e,t);return W(e),n}function Dn(e,t,n){let r=`${e}.tmp-${process.pid}-${n.randomToken()}`,i,o=!1;try{i=n.openFile(r,"wx",384),o=!0,Z(i,Buffer.from(t),n,"cache ownership record"),n.syncFile(i),n.closeFile(i),i=void 0,n.linkFile(r,e);let s=ee(ie(e),n);return n.removeFile(r),o=!1,te(s,ee(ie(e),n))}finally{if(i!==void 0)try{n.closeFile(i)}catch{}if(o)try{n.removeFile(r)}catch{}}}function W(e){process.platform!=="win32"&&nt(e,448)}function je(e){process.platform!=="win32"&&nt(e,384)}function _n(e){if(_(e))return C(e);let t=C(ie(e));return y(t,Pn(e))}function Ai(e){return _n(oe(e))}function Ln(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as Gn}from"child_process";import{createHash as An}from"crypto";import{existsSync as Bn,lstatSync as Mn,realpathSync as zn}from"fs";import{dirname as Wn,isAbsolute as Hn,join as $n,relative as Ui,resolve as ce,sep as qi}from"path";var ut=Symbol.for("scip-query.project-file-listing-context.v1"),lt=globalThis,be=lt[ut],E=be&&typeof be=="object"?be:{};lt[ut]=E;function pt(e,t){let n=E.active?E.canonicalProjectRoots:void 0,r=n?.get(e);if(r!==void 0)return r;let i=t();return n?.set(e,i),i}function ft(){return E.sequence??0}function dt(e,t,n){let r=E.active,i=r?.get(e);if(i&&i.pathBytes<=t)return i;let o=Nn(n(),(E.sequence??0)+1);if(E.sequence=o.sequence,o.pathBytes>t)throw new RangeError(`Git project file listing exceeded ${t} path bytes.`);return r?.set(e,o),o}function gt(e,t){let n=E.active?.get(e);return n&&n.sequence>t?n.indexAllowsTreeFingerprintReuse:void 0}function*ht(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 Nn(e,t){let n=0,r=0,i=!0;for(;n<e.length;){let o=e.indexOf("\0",n);if(o<0||o<=n+2||e[n+1]!==" ")throw new Error("Git returned a malformed tagged project file listing.");let s=e[n];i&&=s==="H"||s==="?",r+=1,n=o+1}return{taggedOutput:e,pathBytes:Buffer.byteLength(e,"utf8")-r*2,indexAllowsTreeFingerprintReuse:i,sequence:t}}var v={run(e,t){let n=yt(e,t);return n.kind==="success"?n.output:void 0},runResult:yt},Un=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],Ce=["status","--porcelain=v2","--branch","-z","--untracked-files=all"],Pe=/^[0-9a-f]{40,64}$/;function Ki(e,t=v){return qn(e,t)?.context}function qn(e,t=v){let n=t.runResult(e,Un);if(n.kind==="success"){let i=Jn(n.output);if(i){let o=Kn(i,t);if(o)return mt(o)}}let r=Yn(e,t);return r?mt(r):void 0}function Yi(e,t=v){if(!e.headCommit)return;let n=t.run(e.projectRoot,Ce);if(n===void 0)return;let r=Fe(n);if(!(!r?.headCommit||r.headCommit!==e.headCommit))return{...e,clean:r.clean}}function Vi(e,t=v,n={}){let r=t===v&&n.cachedInventoryAfterSequence!==void 0?gt(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 mt(e){return{context:e,projectFileInventorySequence:ft()}}function Fe(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&&!Pe.test(r))&&n!==void 0)return{headCommit:r,clean:t.every(i=>i.startsWith("# "))}}function Jn(e){let t=e.split(`
3
- `).map(a=>a.trim());if(t.length!==5)return;let[n,r,i,o,s]=t;if(!n||!r||!i||!o||!s||!Pe.test(o)||!Pe.test(s))return;let c=w(n);return{root:c,gitDir:w(se(c,r)),commonDir:w(se(c,i)),headCommit:o,treeOid:s}}function Kn(e,t){let n=t.run(e.root,Ce);if(n===void 0)return;let r=Fe(n);return r?.headCommit!==e.headCommit?void 0:{...St(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:we("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.clean}}function Yn(e,t){let n=Vn(e,t);if(n.kind!=="worktree")return;let r=n.identity,i=r.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=w(se(i,o)),c=xe(t.run(i,["rev-parse","--verify","HEAD"])),a=xe(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,Ce);if(u===void 0)return;let p=Fe(u);if(!(!p||p.headCommit!==c))return{...r,commonDir:s,repositoryId:we("repository",s),headCommit:c,treeOid:a,clean:p.clean}}function Vn(e,t=v){let n=t.runResult(e,["rev-parse","--show-toplevel"]);if(n.kind==="not-repository")return{kind:"non-git"};if(n.kind==="error")return n;let r=n.output.trim();if(!r)return{kind:"error",message:"Git returned an empty worktree root."};let i=w(r),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=w(se(i,o));return{kind:"worktree",identity:St(i,s)}}function St(e,t){return{projectRoot:e,gitDir:t,worktreeId:we("worktree",`${e}\0${t}`)}}function Xi(e,t=v){let n=t.run(e,["worktree","list","--porcelain","-z"]);return n===void 0?[]:Xn(n)}function Xn(e){let t=[],n;for(let r of e.split("\0")){if(r===""){n&&t.push(n),n=void 0;continue}let i=r.indexOf(" "),o=i<0?r:r.slice(0,i),s=i<0?"":r.slice(i+1);if(o==="worktree"){n&&t.push(n),n={path:w(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}n&&(o==="HEAD"?n.head=s:o==="branch"?n.branch=s:o==="detached"?n.detached=!0:o==="bare"?n.bare=!0:o==="prunable"?n.prunable=!0:o==="locked"&&(n.locked=!0))}return n&&t.push(n),t}function Qi(e,t,n=v){return xe(n.run(e,t))}function se(e,t){return Hn(t)?t:ce(e,t)}function w(e){try{return zn(e)}catch{return ce(e)}}function we(e,t){return An("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function xe(e){return e?.trim()||void 0}function yt(e,t){let n=Gn("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"&&Bn(ce(e)))&&!Qn(e)?{kind:"not-repository"}:{kind:"error",message:i}}function Qn(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=ce(e);for(;;){try{return Mn($n(t,".git")),!0}catch(r){let i=r.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let n=Wn(t);if(n===t)return!1;t=n}}import{execFileSync as Mr}from"child_process";import{isUtf8 as Qt}from"buffer";import{createHash as Be}from"crypto";import{closeSync as tn,fstatSync as U,lstatSync as ze,openSync as nn,readdirSync as zr,readFileSync as Wr,readSync as Zt,readlinkSync as Hr,realpathSync as J}from"fs";import{isAbsolute as $r,join as We,relative as Ur,resolve as qr,sep as Jr}from"path";function ue(e,t,n=[]){let r=ke(e);if(wt.has(r)||n.some(o=>ae(r,o))||t.some(o=>kt(r,o)))return"config";if(t.some(Et)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return"ambient";let i=It(r);return t.some(o=>(vt[o]??[]).includes(i))?"source":"other"}function Ft(e,t,n){let r=ke(e);if(wt.has(r)||n?.some(o=>ae(r,o))||kt(r,t)||Et(t)&&/\.d\.(?:ts|mts|cts)$/.test(r.toLowerCase()))return!0;let i=It(r);return(vt[t]??[]).includes(i)}function eo(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!bt(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!bt(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(Zn)?null:t}function jt(e){return{...e,files:e.files.map(({semanticHash:t,...n})=>n)}}function to(e,t){return!e||!t?e===t:JSON.stringify(jt(e))===JSON.stringify(jt(t))}function no(e,t){let n=new Map((e?.files??[]).map(c=>[c.path,c])),r=new Map(t.files.map(c=>[c.path,c])),i=new Set([...n.keys(),...r.keys()]),o=[];for(let c of[...i].sort()){let a=n.get(c),u=r.get(c),p=ue(c,t.languages);!a&&u?o.push({kind:"added",path:c,inputKind:p,after:u}):a&&!u?o.push({kind:"deleted",path:c,inputKind:p,before:a}):a&&u&&(a.hash!==u.hash||a.size!==u.size)&&o.push({kind:"modified",path:c,inputKind:p,before:a,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Pt(e?.files??[])||Pt(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(er)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!tr(e,t):!0,uncertainty:[...s].sort()}}function bt(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Pt(e){return new Set(e.map(t=>t.path)).size!==e.length}function Zn(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 er(e){return e.hash==="unreadable"||e.size<0}function tr(e,t){return xt(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&xt(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function xt(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 wt=new Set([".scipquery.json"]),nr={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"]},rr={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:[]},Ct=new Map;function kt(e,t){return nr[t].some(n=>ae(e,n))||rr[t].some(n=>ae(e,n))}function ae(e,t){let n=ke(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=Ct.get(n);if(!o){let s=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Ct.set(n,o)}return o.test(i)}function ke(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function It(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function Et(e){return e==="typescript"||e==="javascript"}var vt={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{AsyncLocalStorage as ir}from"async_hooks";var or=new ir;function R(e,t){let n=le(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function T(e,t){let n=le(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function Rt(e,t){return le(e)?.fingerprints.get(t)}function O(e){return le(e)?.paths}function le(e){let t=or.getStore();if(t)return t.projectRoot===w(e)?t:void 0}import{createRequire as sr}from"module";import{existsSync as cr,lstatSync as Tt,readdirSync as ar,statSync as ur}from"fs";import f from"path";var lr=sr(import.meta.url),Ot=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]),pr=18003;function pe(e,t=[]){let n=f.resolve(e),r=t.flatMap(a=>gr(n,a));if(r.length>0)return Dt(n,Lt(r));let i=dr(n),o=Lt(i),s=hr(n,o)?[n,...o]:o,c=s.length>0?s:[n];return Dt(n,c)}function Nt(e){return new Set(e.map(t=>t==="."?"tsconfig.json":`${t.replace(/\/$/u,"")}/tsconfig.json`))}function Gt(e){let t=e.split("/").at(-1)?.toLowerCase();return t?.startsWith("tsconfig")===!0&&t.endsWith(".json")}var fr=/^\.scipquery-compiler-shard-\d+\.tsconfig\.json$/;function go(e){return`.scipquery-compiler-shard-${e}.tsconfig.json`}function At(e){return fr.test(e)}function Bt(e,t,n=[]){let r;try{r=lr("@ts-morph/common/dist/typescript.js")}catch{return null}let i=f.resolve(e),o=t==="workspace"?pe(i,n):["."],s=new Set;for(let c of o){let a=c==="."?i:f.join(i,c),u=f.join(a,"tsconfig.json"),p=yr(r,i);if(!p.fileExists(u))return null;let l=r.readConfigFile(u,p.readFile);if(l.error)return null;let d=r.parseJsonConfigFileContent(l.config,p,a);if(d.errors.some(m=>m.code!==pr))return null;for(let m of d.fileNames){let h=f.resolve(m);j(i,h)&&s.add(f.relative(i,h).split(f.sep).join("/"))}}return s}function ho(e,t,n,r){let i=f.resolve(e),o=new Set(r);for(let c of n){let a=f.resolve(i,c);if(j(i,a))try{let u=Tt(a);if(u.isSymbolicLink()||u.isFile()&&!o.has(D(i,a)))return!1}catch{}}let s=t==="workspace"?pe(i,n):["."];for(let c of s){let a=c==="."?i:f.join(i,c),u=f.join(a,"tsconfig.json");if(!zt(i,u))continue;let p=D(i,u);if(!o.has(p))return!1;try{if(Tt(u).isSymbolicLink())return!1;let l=Wt(i,u);if(l.includes("extends")||l.includes("\\"))return!1}catch{return!1}}return!0}function Dt(e,t){return[...new Set(t.map(n=>D(e,n)))].sort((n,r)=>n.localeCompare(r))}function dr(e){let t=O(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>Ot.has(s)))return[];let o=f.join(e,...i.split("/"));return _t(e,o)?[f.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=ar(i,{withFileTypes:!0})}catch{continue}for(let s of o){let c=f.join(i,s.name);if(s.isDirectory()){!Ot.has(s.name)&&!s.name.startsWith(".")&&r.push(c);continue}s.isFile()&&_t(e,c)&&n.push(f.dirname(c))}}return n}function gr(e,t){let n=t.trim();if(!n)return[];let r=f.resolve(e,n);if(!j(e,r))return[];let i=O(e);if(i){let o=D(e,r);if(i.includes(o)&&Ie(f.basename(r)))return[f.dirname(r)];let s=o==="."?"":`${o}/`;return i.some(c=>c.startsWith(s))?[r]:[]}try{let o=ur(r);if(o.isDirectory())return[r];if(o.isFile()&&Ie(f.basename(r)))return[f.dirname(r)]}catch{return[]}return[]}function _t(e,t){if(!Ie(f.basename(t)))return!1;let n=Mt(e,t);return n?f.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function Ie(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Lt(e){let t=[...new Set(e.map(n=>f.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&jr(n,r)))}function hr(e,t){if(t.length===0||t.some(r=>f.resolve(r)===e))return!1;let n=f.join(e,"tsconfig.json");return zt(e,n)&&mr(e,n)}function mr(e,t){let r=Mt(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!f.extname(i))):!1}function Mt(e,t){try{let n=JSON.parse(Wt(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function zt(e,t){let n=D(e,t),r=T(e,n);return r?r==="present":cr(t)}function Wt(e,t){let n=D(e,t);if(O(e)){let i=R(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return X(t,"TypeScript project config")}function yr(e,t){let n=O(t);if(!n)return e.sys;let r=f.resolve(t),i=new Set(n),o=Sr(r,n),s=e,c=a=>{let u=f.resolve(a);return j(r,u)?D(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(a){let u=c(a);return u===null?e.sys.fileExists(a):i.has(u)},readFile(a){let u=c(a);return u===null?e.sys.readFile(a):R(r,u)?.content.toString("utf8")},readDirectory(a,u,p,l,d){let m=f.resolve(a);return j(r,m)?s.matchFiles(m,u,p,l,e.sys.useCaseSensitiveFileNames,r,d,h=>o.get(f.resolve(h))??{files:[],directories:[]},h=>h):e.sys.readDirectory(a,u,p,l,d)}}}function Sr(e,t){let n=new Map,r=new Map,i=o=>{n.has(o)||n.set(o,new Set),r.has(o)||r.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),c=e;for(let a=0;a<s.length-1;a+=1){let u=s[a];i(c),r.get(c).add(u),c=f.join(c,u),i(c)}n.get(c).add(s.at(-1))}return new Map([...n].map(([o,s])=>[o,{files:[...s].sort(),directories:[...r.get(o)??[]].sort()}]))}function D(e,t){let n=f.relative(e,t);return n?n.split(f.sep).join("/"):"."}function jr(e,t){let n=f.relative(e,t);return!!n&&!n.startsWith("..")&&!f.isAbsolute(n)}import{createHash as Re}from"crypto";import{execFileSync as Ht}from"child_process";import{createRequire as br}from"module";var Pr=br(import.meta.url),xr=/\.(?:[cm]?[jt]sx?)$/iu,Cr=/\.[jt]sx$/iu,$t=/(?:^|\/)package\.json$/iu,$,Ee=new Map;function Ut(e,t){if(!Te(e))return;let n=Fr();if(n)try{let r=typeof t=="string"?t:t.toString("utf8"),i=Cr.test(e)?n.LanguageVariant.JSX:n.LanguageVariant.Standard,o=n.createScanner(n.ScriptTarget.Latest,!1,i,r),s=Re("sha256").update(`typescript-semantic-v1\0${i}\0`),c=!1,a=!1;for(;;){let u=o.scan();if(u===n.SyntaxKind.EndOfFileToken)break;if(u===n.SyntaxKind.WhitespaceTrivia)continue;if(u===n.SyntaxKind.NewLineTrivia){c&&(a=!0);continue}a&&s.update("line-break\0");let p=o.getTokenText();s.update(`${u}\0${Buffer.byteLength(p)}\0`).update(p).update("\0"),c=!0,a=!1}return s.digest("hex")}catch{return}}function Te(e){return xr.test(e)}function Oe(e,t){if($t.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 Re("sha256").update("typescript-package-json-v1\0").update(ve(i)).digest("hex")}catch{return}}function De(e){return $t.test(e)}function bo(e,t,n){if(!De(t)||!/^[a-f0-9]{64}$/u.test(n))return;let r=`${e}\0${t}\0${n}`;if(Ee.has(r))return Ee.get(r);let i;try{let o=Ht("git",["-C",e,"log","--all","--format=%H","--max-count=64","--",t],{encoding:"utf8",maxBuffer:1048576,timeout:5e3}).split(/\r?\n/u).filter(Boolean);for(let s of o){let c=Ht("git",["-C",e,"show",`${s}:${t}`],{encoding:null,maxBuffer:4194304,timeout:5e3});if(Re("sha256").update(c).digest("hex")===n){i=Oe(t,c);break}}}catch{i=void 0}return Ee.set(r,i),i}function Fr(){if($!==void 0)return $;try{$=Pr("typescript")}catch{$=null}return $}function ve(e){return Array.isArray(e)?`[${e.map(ve).join(",")}]`:typeof e=="object"&&e!==null?`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${ve(n)}`).join(",")}}`:JSON.stringify(e)}import{closeSync as qt,existsSync as Le,openSync as wr,realpathSync as kr,renameSync as Ir,unlinkSync as Jt,writeSync as Er}from"fs";import{dirname as vr,join as Rr}from"path";var Tr="fingerprint-stat-cache.json",Kt=1,Or=8*1024*1024,_e=new Map;function Ne(e,t,n,r){let i=Yt(e),o=i.files.get(t);if(!(!o||!Vt(o,n,r)))return i.hits+=1,{hash:o.hash,size:o.fingerprintSize,...o.semanticHash===void 0?{}:{semanticHash:o.semanticHash}}}function Ge(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let o=Yt(e),s={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size,...i.semanticHash===void 0?{}:{semanticHash:i.semanticHash}},c=o.files.get(t);c&&Ar(c,s)||(o.files.set(t,s),o.stores+=1,o.dirty=!0)}function Ae(e){let t=_e.get(Xt(e));if(!(!t?.dirty||!t.cachePath))try{let n=vr(t.cachePath);if(!Le(n))return;Br(t.cachePath,Lr(t)),t.dirty=!1}catch{}}function Yt(e){let t=Xt(e),n=_e.get(t);if(n)return n;let r=Dr(t),i=_r(r),o={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return _e.set(t,o),o}function Dr(e){try{let t=Se(e);return Le(t)?Rr(t,Tr):null}catch{return null}}function _r(e){let t=new Map;if(!e||!Le(e))return t;try{let n=JSON.parse(V(e,{inputKind:"fingerprint stat cache",maxBytes:Or}).toString("utf8"));if(!Nr(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function Lr(e){return{version:Kt,files:Object.fromEntries(e.files)}}function Nr(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==Kt||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(Gr)}function Gr(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 Vt(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 Ar(e,t){return Vt(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize&&e.semanticHash===t.semanticHash}function Br(e,t){let n=`${e}.${process.pid}.tmp`;try{Jt(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
4
- `,"utf8"),i=wr(n,"wx",384);try{Z(i,r,{writeFile:(o,s,c,a)=>Er(o,s,c,a)},"fingerprint stat cache")}catch(o){throw qt(i),Jt(n),o}qt(i),Ir(n,e)}function Xt(e){return kr(e)}var K=64*1024*1024,Kr=1024*1024,Yr=1024,L=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function Vr(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function He(e,t,n={}){let r=I(t),i=pt(e,()=>J(e)),o=qr(i,...r.split("/"));if(!j(i,o)||o===i)throw new g(t,"outside-project");let s=J(o);if(!j(i,s)||s===i)throw new g(t,"outside-project");let c=ze(s);if(!c.isFile())throw new g(t,"not-a-file");let a={projectRoot:i,relativePath:r,absolutePath:s,size:c.size,mtimeMs:c.mtimeMs,device:c.dev,inode:c.ino},u=n.maxBytes??K;if(Q(u),a.size>u)throw new L(n.inputKind??"project file",a.relativePath,a.size,u);return a}function Xr(e,t,n={}){let r=I(t),i=T(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let a=R(e,r);if(!a)throw new g(r,"changed-during-read");let u=n.maxBytes??K;if(Q(u),a.size>u)throw new L(n.inputKind??"project file",r,a.size,u);return Buffer.from(a.content)}let o=He(e,t,n),s=n.maxBytes??K,c=nn(o.absolutePath,"r");try{let a=U(c);if(q(a,o,t),a.size>s)throw new L(n.inputKind??"project file",o.relativePath,a.size,s);let u=Wr(c),p=U(c);if(q(p,o,t),u.byteLength!==a.size)throw new g(t,"changed-during-read");return u}finally{tn(c)}}function zo(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...o}=Qr(e,t,[n],r);return{...o,includesLiteral:i.length>0}}function Qr(e,t,n,r={}){if(n.length===0||n.some(a=>a.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=I(t),o=T(e,i);if(o){if(o==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let a=R(e,i);if(!a)throw new g(i,"changed-during-read");let u=r.maxBytes??K;if(Q(u),a.size>u)throw new L(r.inputKind??"project file",i,a.size,u);let p=!a.content.includes(0)&&Qt(a.content),l=n.map(en),d=p?ei(a.content,n,l):[];return{byteLength:a.size,isUtf8Text:p,matchedLiteralIndexes:d,bytes:d.length>0?Buffer.from(a.content):null,...r.computeSha256?{sha256:a.sha256}:{}}}let s=He(e,t,r),c=nn(s.absolutePath,"r");try{let a=U(c);q(a,s,t);let u=r.computeSha256?Be("sha256"):null,p=r.scratchBuffer??Buffer.allocUnsafe(Kr);if(p.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let l=0,d=n.map(()=>!1),m=!1,h=!0,b=Buffer.alloc(0),Y=n.map(()=>Buffer.alloc(0)),N=n.map(en);for(;l<a.size;){let P=Zt(c,p,0,Math.min(p.byteLength,a.size-l),l);if(P<=0)throw new g(t,"changed-during-read");let x=p.subarray(0,P);if(u?.update(x),m||=x.includes(0),h){let S=b.byteLength>0?Buffer.concat([b,x]):x,B=Zr(S);h=Qt(S.subarray(0,B)),b=Buffer.from(S.subarray(B))}for(let S=0;S<n.length;S+=1){if(d[S])continue;let B=n[S],qe=Y[S];d[S]=ti(x,B,qe,N[S]),Y[S]=ni(x,B,qe)}l+=P}h&&=b.byteLength===0,q(U(c),s,t);let G=!m&&h,A=G?d.flatMap((P,x)=>P?[x]:[]):[],k=null;if(A.length>0){k=Buffer.allocUnsafe(a.size);let P=0;for(;P<k.byteLength;){let x=Zt(c,k,P,k.byteLength-P,P);if(x<=0)throw new g(t,"changed-during-read");P+=x}q(U(c),s,t)}return{byteLength:a.size,isUtf8Text:G,matchedLiteralIndexes:A,bytes:k,...u?{sha256:u.digest("hex")}:{}}}finally{tn(c)}}function Wo(e,t,n={}){return Xr(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 Zr(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 ei(e,t,n){return t.flatMap((r,i)=>Me(e,r,n[i])?[i]:[])}function ti(e,t,n,r){if(Me(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 Me(Buffer.concat([n,i]),t,r)}function Me(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>Yr)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 en(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 ni(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 $e(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Ho(e,t){try{return He(e,t),!0}catch(n){if($e(n))return!1;throw n}}function ri(e){let t=O(e);return t?t.filter(n=>n&&!de(n)).sort():(ui(e)??li(e)).filter(n=>n&&!de(n)).sort()}function ii(e,t={}){let n=(t.includePaths??[]).map(I),r=[...new Set([...ri(e),...n])].filter(s=>!de(s)).filter(s=>!t.language||Ft(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort((s,c)=>s.localeCompare(c)),i=J(e),o=r.flatMap(s=>rn(e,i,s));return Ae(i),o}function rn(e,t,n){let r=Rt(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(T(e,n)==="present"){let o=R(e,n);if(o)return[{path:n,size:o.fingerprintSize??o.size,hash:o.sha256}]}let i=We(e,n);try{let o=ze(i);if(o.isSymbolicLink()){let b=Ne(t,n,"symlink",fe(o));if(b)return[{path:n,size:b.size,hash:b.hash}];let Y=J(i),N=Ur(t,Y);if(N===".."||N.startsWith(`..${Jr}`)||$r(N))throw new Error("external symlink");let G=Hr(i),A=Be("sha256").update("symlink\0").update(G).digest("hex"),k=Buffer.byteLength(G);return Ge(t,n,"symlink",fe(o),{hash:A,size:k}),[{path:n,size:k,hash:A}]}let s=Te(n)||De(n),c=Ne(t,n,"file",fe(o));if(c&&(!s||c.semanticHash!==void 0))return[{path:n,size:c.size,hash:c.hash,...c.semanticHash===void 0?{}:{semanticHash:c.semanticHash}}];let a=Be("sha256"),u=s,p=[],l=Ke(i,{inputKind:"project fingerprint input",maxBytes:K},b=>{a.update(b),u&&p.push(Buffer.from(b))}),d=a.digest("hex"),m=u?Buffer.concat(p,l):void 0,h=m?Ut(n,m)??Oe(n,m):void 0;return Ge(t,n,"file",fe(o),{hash:d,size:l,...h===void 0?{}:{semanticHash:h}}),[{path:n,size:l,hash:d,...h===void 0?{}:{semanticHash:h}}]}catch(o){return $e(o)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function fe(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function on(e,t,n){let r=Ue(t,n),i=[...r.typescriptProjects.filter(a=>ci(e,a)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?Bt(e,r.typescriptProjectMode,r.typescriptProjects):null,s=r.languages.includes("typescript")?r.typescriptProjectMode==="workspace"?pe(e,r.typescriptProjects):["."]:[],c=Nt(s);return{...r,files:ii(e,{includePath:a=>{if(a===".scipquery.json")return!1;let u=ue(a,t,i);return u==="other"||u==="config"&&Gt(a)&&!c.has(a)?!1:u!=="source"||!si(a)||!o?!0:o.has(a)},includePaths:i})}}function $o(e,t){let n=new Set(t.files.map(o=>o.path)),r=on(e,t.languages,t),i=new Map(r.files.map(o=>[o.path,o]));return{...Ue(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 Uo(e,t,n,r,i,o){let s=l=>({mode:"full",fingerprint:on(e,t,n),reason:l});if(!i)return s("change-journal-unavailable");if(!i.complete)return s(`change-journal-incomplete:${i.incompleteReason??"unknown"}`);if(!o)return s("accepted-generation-unavailable");if(i.baseGeneration!==o)return s("change-journal-base-mismatch");if(!r)return s("prior-project-input-snapshot-unavailable");let c=Ue(t,n);if(!oi(r,c))return s("project-input-configuration-changed");if(new Set(r.files.map(l=>l.path)).size!==r.files.length)return s("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...c,files:[...r.files].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:[]};let a=[...c.typescriptProjects,...c.clojureConfigPath?[c.clojureConfigPath]:[]],u=new Map(r.files.map(l=>[l.path,l]));for(let l of i.entries){let d=u.get(l.path);if(ue(l.path,t,a)!=="source")return s("non-source-project-input-changed");if(l.kind==="add"&&d)return s("added-path-already-in-prior-project-input-snapshot");if(l.kind==="delete"&&!d)return s("deleted-path-not-in-prior-project-input-snapshot");if(l.kind==="change"&&!d)return s("changed-path-not-in-prior-project-input-snapshot");if(d&&(d.hash==="unreadable"||d.size<0))return s("changed-path-was-unreadable")}let p=J(e);for(let l of i.entries){let d=rn(e,p,l.path);if(l.kind==="delete"){if(d.length!==0)return s("deleted-source-is-still-readable");u.delete(l.path);continue}if(d.length!==1||d[0].hash==="unreadable"||d[0].size<0)return s(l.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(l.path,d[0])}return Ae(p),{mode:"delta",fingerprint:{...c,files:[...u.values()].sort((l,d)=>l.path.localeCompare(d.path))},changedPaths:i.entries.map(l=>l.path).sort()}}function oi(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 si(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function ci(e,t){let n;try{n=I(t)}catch{return!1}let r=T(e,n);if(r)return r==="present";try{return ze(We(e,n)).isFile()}catch(i){if($e(i))return!1;throw i}}function Ue(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Vr(t.typescriptProjects),clojureConfigPath:ai(t.clojureConfigPath)}}function ai(e){return e?.trim()||void 0}function ui(e){try{let t=dt(e,52428800,()=>Mr("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...ht(t)]}catch{return null}}function li(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?We(e,r):e,o;try{o=zr(i,{withFileTypes:!0})}catch{continue}for(let s of o){let c=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){de(c)||n.push(c);continue}t.push(c)}}return t}function de(e){let t=e.split("/");return e==="meta.json"||At(e)||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>pi.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var pi=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{ue as a,Ft as b,eo as c,jt as d,to as e,no as f,Zn as g,nr as h,M as i,Xe as j,ee as k,te as l,g as m,he as n,di as o,gi as p,j as q,I as r,Qe as s,Ci as t,Se as u,ot as v,Fn as w,_i as x,Li as y,Ni as z,Gi as A,Ai as B,bo as C,dt as D,ht as E,v as F,Ki as G,Yi as H,Vi as I,Vn as J,Xi as K,Qi as L,se as M,w as N,pe as O,Nt as P,Gt as Q,go as R,At as S,Bt as T,ho as U,L as V,Vr as W,He as X,Xr as Y,zo as Z,Qr as _,Wo as $,$e as aa,Ho as ba,ri as ca,ii as da,on as ea,$o as fa,Uo as ga,Ue as ha};
5
- //# sourceMappingURL=chunk-7HXT6YLU.js.map
@@ -1,2 +0,0 @@
1
- function i(e){let n=new Set,t=[];for(let o of e){let r=`${o.symbol}|${o.file}`;n.has(r)||(n.add(r),t.push(o))}return t}function u(e){return[...new Set((e??[]).map(n=>n.trim()).filter(Boolean))]}function f(e){return e.replace(/^#/u,"").replace(/\(\)$/u,"")}export{i as a,u as b,f as c};
2
- //# sourceMappingURL=chunk-7KCZELVM.js.map
@@ -1,6 +0,0 @@
1
- import{a as J,b as se,d as ee,e as ne,f as H}from"./chunk-Y5DFAW5W.js";import{h as re}from"./chunk-NU3KFF2O.js";import{c as W,e as Z}from"./chunk-U3SXIMII.js";import{a as G}from"./chunk-SKKXTABJ.js";import{n as Y}from"./chunk-RBAD4GJ2.js";import{E as ae}from"./chunk-ZLMXIQLC.js";import{k as X}from"./chunk-ETC674NS.js";var he=16,Se=4,Le=3e3,be=800,ve=new Set(["assignment","const_declaration","const_item","field_declaration","lexical_declaration","local_declaration_statement","local_variable_declaration","static_item","variable_declaration"]);function Xe(t,n,r={}){let c=r.maxSteps??he;if(!Number.isSafeInteger(c)||c<=0)throw new RangeError(`maxSteps must be a positive safe integer; received ${c}`);let g=new Map(n.nodes.map(e=>[e.id,e])),f=we(r.focusLocations??[]),s=new Set,d=new Map(n.edges.map(e=>[e.id,e])),u=O(n.paths.flatMap(e=>e.nodeIds)),h=O(n.anchors.filter(e=>e.status==="matched").flatMap(e=>e.nodeIds)),v=n.nodes.filter(e=>e.disposition==="emitted"&&e.attributes.upstreamCausalPath===!0).sort((e,L)=>Number(L.attributes.upstreamCausalDistance??0)-Number(e.attributes.upstreamCausalDistance??0)||e.id.localeCompare(L.id)).map(e=>e.id),a=new Set(v),y=Math.max(0,c-h.length),w=Ne(n,h,f,y).slice(0,y),k=new Set(w),P=new Set(w),b=new Set([...u,...v,...h]),l=n.edges.filter(e=>e.disposition==="emitted"&&e.kind!=="structural-membership"),p=n.edges.filter(e=>e.disposition!=="excluded"&&e.disposition!=="unsupported"&&e.kind!=="structural-membership"),x=new Set([...n.paths.flatMap(e=>e.edgeIds),...l.filter(e=>a.has(e.fromNodeId)&&a.has(e.toNodeId)).map(e=>e.id)]),C=n.paths.some(e=>e.edgeIds.length>0),N=new Set(h);for(let e of w)N.add(e);for(let e of n.paths){let L=e.nodeIds[0],I=d.get(e.edgeIds[0]??""),$=e.nodeIds[1];L&&$&&I?.fromNodeId===L&&I.toNodeId===$&&N.add(L)}if(n.paths.every(e=>e.nodeIds.length===0))for(let e of n.anchors)for(let L of e.nodeIds)N.add(L);let R=ke(h,p,g,Se),E=O(l.filter(e=>e.kind==="call"&&h.includes(e.fromNodeId)).map(e=>e.toNodeId)),S=new Set(O([...R,...C?[]:E]));for(let e of S)N.add(e);let T=O(l.flatMap(e=>b.has(e.fromNodeId)||b.has(e.toNodeId)?[e.fromNodeId,e.toNodeId]:[])),_=n.nodes.filter(e=>e.disposition==="emitted"&&e.kind!=="structural-region"&&l.some(L=>L.fromNodeId===e.id||L.toNodeId===e.id)).map(e=>e.id),A=O([...v,...u,...h,...w,...S,...T,..._]).filter(e=>g.has(e)),F=[];for(let e of A)C&&!b.has(e)&&!k.has(e)&&!S.has(e)||F.length>=c&&!b.has(e)||F.push(e);let o=new Set(F),i=new Map(F.map(e=>[e,Pe(e)])),m=new Set([...u,...v]),j=new Set(n.anchors.flatMap(e=>e.nodeIds)),D=F.map((e,L)=>{let I=g.get(e),$=Ee(I,f);for(let z of $)s.add(V(I.location.file,z));return{id:i.get(e),nodeId:e,order:L,role:j.has(e)?"anchor":m.has(e)?"connector":"junction",kind:I.kind,label:I.label,location:I.location,behavior:Ie(t,I,j.has(e),[...new Set([...$,...Ce(t,I,p,g,x,N)])],$,N.has(I.id)&&($.length===0||j.has(I.id)),S.has(I.id),P.has(I.id)&&$.length===0)}}),U=new Map;for(let e of n.paths)for(let L=0;L<e.edgeIds.length;L+=1){let I=d.get(e.edgeIds[L]),$=e.nodeIds[L],z=e.nodeIds[L+1];!I||!$||!z||U.set(I.id,I.fromNodeId===$&&I.toNodeId===z?"forward":"reverse")}let B=p.filter(e=>o.has(e.fromNodeId)&&o.has(e.toNodeId)).sort((e,L)=>_e(e,L,n)).map((e,L)=>({id:Ae(e.id),edgeId:e.id,order:L,kind:e.kind,fromStepId:i.get(e.fromNodeId),toStepId:i.get(e.toNodeId),directed:!0,pathTraversal:U.get(e.id)??"adjacent",evidence:e.evidence})),q=new Map(B.map(e=>[e.edgeId,e.id])),K=n.paths.map(e=>({id:e.id,status:e.status,stepIds:e.nodeIds.flatMap(L=>{let I=i.get(L);return I?[I]:[]}),transitionIds:e.edgeIds.flatMap(L=>{let I=q.get(L);return I?[I]:[]})})),oe=D.flatMap(e=>e.location?[`${e.location.file}:${e.location.line+1}`]:[]),me=n.anchors.some(e=>e.status==="ambiguous"),ge=K.some(e=>e.status==="connected"||e.status==="candidate"),ie=K.some(e=>e.status==="partial");return{status:D.length===0?"unavailable":me?"ambiguous":ge&&!ie?"connected":ie?"partial":"connected",steps:D,transitions:B,paths:K,coverage:{candidateNodes:A.length,returnedNodes:F.length,omittedNodeIds:A.filter(e=>!o.has(e)),returnedTransitions:B.length,withheldStatements:D.reduce((e,L)=>e+(L.behavior?.coverage.omittedStatements??0),0),requestedFocusLocations:f,matchedFocusLocations:f.filter(e=>s.has(V(e.file,e.line))),unmatchedFocusLocations:f.filter(e=>!s.has(V(e.file,e.line)))},behaviorCommand:pe(oe,"behavior"),exactSourceCommand:pe(oe,"source")}}function Ne(t,n,r,c){if(c<=0||r.length===0)return[];let g=new Set(n),f=new Set(r.map(s=>V(s.file,s.line)));return O(t.edges.filter(s=>s.disposition!=="excluded"&&s.disposition!=="unsupported"&&["call","runtime-boundary"].includes(s.kind)&&g.has(s.fromNodeId)&&s.evidence.some(d=>!["candidate","unknown"].includes(d.strength)&&d.location&&f.has(V(d.location.file,d.location.line)))).sort((s,d)=>{let u=s.evidence.find(v=>v.location)?.location,h=d.evidence.find(v=>v.location)?.location;return(u?.file??"").localeCompare(h?.file??"")||(u?.line??Number.MAX_SAFE_INTEGER)-(h?.line??Number.MAX_SAFE_INTEGER)||s.id.localeCompare(d.id)}).map(s=>s.toNodeId)).slice(0,c)}function Ie(t,n,r,c,g,f,s,d){if(!n.location||!["symbol","source-construct","runtime-boundary-participant"].includes(n.kind))return null;let u=n.location.endLine??n.location.line,h=X(t,n.location.file),v=c.length>0?c:[n.location.line],a=n.kind==="runtime-boundary-participant"?ee(t,n.location.file,0,Math.max(0,h.length-1),[n.location.line]):ee(t,n.location.file,n.location.line,u,v),y=c.filter(S=>S>=a.startLine&&S<=a.endLine),M=J(t,n.location.file,a.startLine,a.endLine,y),w=M??(y.length>0?J(t,n.location.file,a.startLine,a.endLine,y,{requireSavings:!1}):null),k=y.length>0?Te(t,n,a.startLine,a.endLine,y,w,f):null,P=h.slice(a.startLine,a.endLine+1).join(`
2
- `).length,b=H(t,n.location.file,a.startLine,a.endLine),l=h.slice(a.startLine,a.endLine+1).some((S,T)=>S.length>be&&(b.get(a.startLine+T)??[]).some(_=>["binding","branch","loop","call","return","throw","mutation"].includes(_))),p=S=>ye(t,n,a.startLine,a.endLine,g.filter(T=>T>=a.startLine&&T<=a.endLine),S),x=(s||n.kind==="runtime-boundary-participant"||n.anchorIds.length>0)&&P<=Le,C=r&&(y.length===0||x);if(M&&(d||C))return p(ce(M));if(!d&&!C&&k&&!l&&!x&&k.renderedCharacters<(w?.outlineCharacters??P))return p(k);if(M)return p(ce(M));let N=h.slice(a.startLine,a.endLine+1),R=N.join(`
3
- `),E=H(t,n.location.file,a.startLine,a.endLine);return p({kind:"source",constructKind:"source construct",signature:N.find(S=>S.trim().length>0)?.trim()??n.label,lines:N.map((S,T)=>({line:a.startLine+T,endLine:a.startLine+T,depth:0,signals:E.get(a.startLine+T)??[],text:S,copied:!0})),coverage:{sourceStatements:N.length,representedStatements:N.length,copiedStatements:N.length,omittedStatements:0},rawCharacters:R.length,renderedCharacters:R.length})}function ye(t,n,r,c,g,f){if(!n.location)return f;let s=W(t,n.location.file,r,c);if(!s.available)return f;let d=H(t,n.location.file,r,c),u=X(t,n.location.file),h=new Set(g);for(let l of g){let p=Q(u[l]??"");if(!p)continue;let x=G(t,n.location.file,p).find(C=>C>l&&C<=c);x!==void 0&&h.add(x)}let v=[...new Map(s.targets.flatMap(l=>{let p=l.definition,x=p.relativePath===n.location.file&&p.startLine<=c&&p.endLine>=r;if(p.isTypeLike||x)return[];let C=Z(t,p),N=g.length>0&&C&&d.get(l.sourceLine)?.includes("return"),R=C&&h.has(l.sourceLine);return C&&!N&&!R?[]:[[p.symbol,{definition:p,kind:N?"return-value-transformer":R?"focused-causal-target":"compiler-referenced-declaration"}]]})).values()].sort((l,p)=>l.definition.relativePath.localeCompare(p.definition.relativePath)||l.definition.startLine-p.definition.startLine||l.definition.symbol.localeCompare(p.definition.symbol)),a=[],y=v.filter(({kind:l})=>l!=="compiler-referenced-declaration").map(({definition:l})=>({owner:l,depth:1})),M=new Set,w=new Set(v.map(({definition:l})=>l.symbol));for(;y.length>0;){let l=y.shift();if(!l||M.has(l.owner.symbol))continue;M.add(l.owner.symbol);let{owner:p,depth:x}=l,C=W(t,p.relativePath,p.startLine,p.endLine);if(!C.available)continue;let N=H(t,p.relativePath,p.startLine,p.endLine),R=X(t,p.relativePath);for(let E of C.targets){let S=E.definition,T=S.relativePath===p.relativePath&&S.startLine<=p.endLine&&S.endLine>=p.startLine;if(S.isTypeLike||T)continue;let _=Z(t,S),A=Q(R[E.sourceLine]??""),F=_&&A!==null&&G(t,p.relativePath,A).some(i=>i>E.sourceLine&&i<=p.endLine&&(N.get(i)??[]).some(m=>["branch","return","throw"].includes(m))),o=_&&((N.get(E.sourceLine)??[]).some(i=>["branch","return","throw"].includes(i))||F);_&&!o||(w.has(S.symbol)||(w.add(S.symbol),a.push({definition:S,kind:_?"focused-causal-target":"compiler-referenced-declaration"})),_&&x<2&&y.push({owner:S,depth:x+1}))}}let k=[...new Map([...v,...a].map(l=>[l.definition.symbol,l])).values()].sort((l,p)=>l.definition.relativePath.localeCompare(p.definition.relativePath)||l.definition.startLine-p.definition.startLine||l.definition.symbol.localeCompare(p.definition.symbol)),P=[],b=[];for(let{definition:l,kind:p}of k){let x=p==="compiler-referenced-declaration"?xe(t,l.relativePath,l.startLine,l.endLine):{startLine:l.startLine,endLine:l.endLine},C=X(t,l.relativePath).slice(x.startLine,x.endLine+1).join(`
4
- `),N=p==="compiler-referenced-declaration"?null:J(t,l.relativePath,l.startLine,l.endLine,[]),R=N?[N.signature,...N.lines.map(A=>`${A.line+1}${A.signals.length>0?`[${A.signals.join(",")}]`:""} ${A.text}`)].join(" | "):null,E=R&&R.length<C.length?R:C,S={symbol:l.symbol,label:l.leaf,file:l.relativePath,line:x.startLine,endLine:x.endLine},T=p==="compiler-referenced-declaration"?1e3:8e3,_=p==="compiler-referenced-declaration"?12:120;if(E.length>T||x.endLine-x.startLine>_){b.push({...S,reason:"source-too-large"});continue}P.push({kind:p,...S,text:E})}return{...f,...P.length===0?{}:{supportingDeclarations:P},...b.length===0?{}:{omittedSupportingDeclarations:b}}}function xe(t,n,r,c){let g=ae(t,n);if(!g)return{startLine:r,endLine:c};let f=[];fe(g.rootNode,d=>{ve.has(d.type)&&d.startPosition.row<=r&&d.endPosition.row>=c&&f.push(d)});let s=f.sort((d,u)=>d.endPosition.row-d.startPosition.row-(u.endPosition.row-u.startPosition.row)||d.endIndex-d.startIndex-(u.endIndex-u.startIndex))[0];return s?{startLine:s.startPosition.row,endLine:s.endPosition.row}:{startLine:r,endLine:c}}function fe(t,n){n(t);for(let r of t.namedChildren)fe(r,n)}function ce(t){return{kind:"outline",constructKind:t.constructKind,signature:t.signature,lines:t.lines,coverage:t.coverage,rawCharacters:t.rawCharacters,renderedCharacters:t.outlineCharacters}}function Ce(t,n,r,c,g,f){if(!n.location||!["symbol","source-construct","runtime-boundary-participant"].includes(n.kind))return[];let s=new Set,d=new Set(Y(t,n.location.file)?.callSites.map(u=>u.line)??[]);if(n.kind==="runtime-boundary-participant"&&s.add(n.location.line),f.has(n.id))for(let u of re(t,{files:[n.location.file]}))u.source.startLine>=n.location.line&&u.source.startLine<=(n.location.endLine??n.location.line)&&s.add(u.source.startLine);for(let u of r){if(u.fromNodeId!==n.id&&u.toNodeId!==n.id)continue;let h=c.get(u.fromNodeId===n.id?u.toNodeId:u.fromNodeId),v=f.has(n.id)&&["call","reference","runtime-boundary"].includes(u.kind)&&u.fromNodeId===n.id,a=(h?.anchorIds.length??0)>0;if(!g.has(u.id)&&!v&&!a)continue;let y=u.evidence.flatMap(b=>b.location?.file===n.location.file?[b.location.line]:[]),M=y.filter(b=>d.has(b));for(let b of M.length>0?M:y)s.add(b);let w=h?.attributes.leaf;if(typeof w!="string"||w.length===0)continue;let k=G(t,n.location.file,w).filter(b=>b>=n.location.line&&b<=(n.location.endLine??n.location.line)),P=k.find(b=>d.has(b))??k[0];P!==void 0&&s.add(P)}return[...s].sort((u,h)=>u-h)}function Ee(t,n){if(!t.location)return[];let r=t.location.endLine??t.location.line;return n.filter(c=>c.file===t.location.file&&c.line>=t.location.line&&c.line<=r).map(c=>c.line)}function we(t){let n=new Map;for(let r of t){if(!r.file||!Number.isSafeInteger(r.line)||r.line<0)throw new RangeError(`Behavior focus locations require a repository file and non-negative line; received ${JSON.stringify(r)}.`);n.set(V(r.file,r.line),{file:r.file,line:r.line})}return[...n.values()].sort((r,c)=>r.file.localeCompare(c.file)||r.line-c.line)}function V(t,n){return`${t}\0${n}`}function Te(t,n,r,c,g,f,s){if(!n.location)return null;let d=X(t,n.location.file),u=H(t,n.location.file,r,c),h=[...u].filter(([,o])=>o.length>0).map(([o])=>o).sort((o,i)=>o-i),v=g.map(o=>(u.get(o)??[]).length>0?o:h.find(i=>i>o&&i-o<=8)??o),a=new Set([...g,...v]),y=s?ne(t,n.location.file,r,c,{minimumBodyLines:0}):null,M=f?[...new Map(v.flatMap(o=>f.lines.filter(i=>i.text.length<=500&&i.signals.some(m=>["branch","loop","catch","finally"].includes(m))&&o>=i.line&&o<=i.endLine).sort((i,m)=>i.endLine-i.line-(m.endLine-m.line)||i.line-m.line).slice(0,2).map(i=>[`${i.line}\0${i.endLine}`,i]))).values()]:se(t,n.location.file,r,c,v);for(let o of y?.lines??[])a.add(o.line);for(let o of M)a.add(o.line);for(let[o,i]of u)i.includes("call")&&i.includes("shape")&&a.add(o);let w=[];for(let o of v){let i=Q(d[o]??"");if(!i)continue;let m=G(t,n.location.file,i).filter(B=>B>o&&B<=c),j=m[0];j!==void 0&&a.add(j);let D=m.find(B=>(u.get(B)??[]).some(q=>q==="branch"||q==="loop"));if(D===void 0)continue;a.add(D);let U=(f?.lines??[]).find(B=>B.line===D)??{line:D,endLine:Math.min(c,D+40),depth:0,signals:u.get(D)??[],text:(d[D]??"").trim(),copied:!0},te=f?.lines??d.slice(U.line,U.endLine+1).map((B,q)=>{let K=U.line+q;return{line:K,endLine:K,depth:0,signals:u.get(K)??[],text:B.trim(),copied:!0}});w.push({focusLine:o,governingUse:D,lines:te.filter(B=>B.line>=U.line&&B.line<=U.endLine&&B.text.length<=500&&B.signals.some(q=>["binding","branch","call","mutation"].includes(q)))})}for(let o of w.sort((i,m)=>m.governingUse-m.focusLine-(i.governingUse-i.focusLine)||i.focusLine-m.focusLine).slice(0,2))for(let i of o.lines.slice(0,14))a.add(i.line);let k=new Set(["binding","branch","loop","call","return","throw","mutation"]);for(let o of M)for(let i of f?.lines??[])i.line<o.line||i.line>o.endLine||i.signals.some(m=>k.has(m))&&a.add(i.line);let P=d.slice(r,c+1).flatMap((o,i)=>{let m=Q(o);return m?[{name:m,line:r+i}]:[]}),b=!0;for(;b;){b=!1;for(let o of P)if([...a].some(m=>Me(d[m]??"",o.name))){a.has(o.line)||(a.add(o.line),b=!0);for(let m of G(t,n.location.file,o.name))m<r||m>c||a.has(m)||(u.get(m)??[]).some(j=>k.has(j))&&(a.add(m),b=!0)}}for(let o of f?.lines??[])if(o.signals.some(i=>["branch","loop","catch","finally"].includes(i))&&a.has(o.line))for(let i of f?.lines??[])i.line<o.line||i.line>o.endLine||i.signals.some(m=>k.has(m))&&a.add(i.line);let l=Y(t,n.location.file),p=new Set(l?.callSites.map(o=>o.line)??[]),x=u,C=new Map([...f?.lines??[],...M].filter(o=>o.signals.some(i=>["branch","loop","catch","finally"].includes(i))).map(o=>[o.line,o])),N=new Map((f?.lines??[]).filter(o=>o.text.length<=500&&o.signals.includes("shape")&&(o.signals.includes("call")||o.signals.includes("mutation")||o.signals.includes("return"))).sort((o,i)=>o.endLine-o.line-(i.endLine-i.line)||o.line-i.line).map(o=>[o.line,o])),R=new Map((y?.lines??[]).map(o=>[o.line,o.signals.filter(i=>i!=="lifecycle")])),E=[...a].filter(o=>o>=r&&o<=c).sort((o,i)=>o-i).map(o=>{let i=C.get(o)??N.get(o);return{line:o,endLine:i?.endLine??o,depth:i?.depth??0,signals:Be([...x.get(o)??[],...f?.lines.filter(m=>o>=m.line&&o<=m.endLine).flatMap(m=>m.signals)??[],...R.get(o)??[],...g.includes(o)?["anchor"]:[],...p.has(o)?["call"]:[]]),text:i?.text??(d[o]??"").trim(),copied:i?.copied??!0}}).filter(o=>o.text.length>0);if(E.length===0)return null;let S=y?.candidateLines??ne(t,n.location.file,r,c,{minimumBodyLines:0})?.candidateLines??0,T=Math.max(f?.coverage.sourceStatements??0,S,E.length),_=f?.signature??(d[r]??n.label).trim(),A=_.length+E.reduce((o,i)=>o+i.text.length+i.signals.join(",").length+12,0),F=d.slice(r,c+1).join(`
5
- `).length;return{kind:"connector-slice",constructKind:f?.constructKind??"source construct",signature:_,lines:E,coverage:{sourceStatements:T,representedStatements:E.length,copiedStatements:E.length,omittedStatements:Math.max(0,T-E.length)},rawCharacters:F,renderedCharacters:A}}function Be(t){let n=["anchor","signature","binding","branch","loop","call","await","return","throw","mutation","shape","spread","catch","finally"],r=new Set(t);return n.filter(c=>r.has(c))}function Q(t){return/\b(?:const|let|var)\s+([\p{L}_$][\p{L}\p{N}_$]*)\s*(?:=|\bof\b|\bin\b)/u.exec(t)?.[1]??null}function Me(t,n){let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:^|[^\\p{L}\\p{N}_$])${r}(?:$|[^\\p{L}\\p{N}_$])`,"u").test(t)}function Re(t,n,r){return O(t.flatMap(c=>{let g=r.get(c),f=n.filter(s=>s.kind==="call"&&s.toNodeId===c).map(s=>({edge:s,node:r.get(s.fromNodeId)})).filter(s=>s.node!==void 0&&["symbol","source-construct","runtime-boundary-participant"].includes(s.node.kind)&&s.node.location!==null).sort((s,d)=>{let u=le(d.edge)-le(s.edge);if(u!==0)return u;let h=de(s.node,g)?0:1,v=de(d.node,g)?0:1,a=(s.node.location?.endLine??s.node.location?.line??0)-(s.node.location?.line??0),y=(d.node.location?.endLine??d.node.location?.line??0)-(d.node.location?.line??0);return h-v||a-y||s.node.label.localeCompare(d.node.label)});return f[0]?[f[0].node.id]:[]}))}function le(t){let n={exact:4,mixed:3,derived:2,candidate:1,unknown:0};return Math.max(0,...t.evidence.map(r=>n[r.strength]))}function de(t,n){return!t.location||!n?.location?!1:ue(t.location.file)===ue(n.location.file)}function ue(t){return t.split("/").filter(Boolean).slice(0,2).join("/")}function ke(t,n,r,c){let g=new Set(t),f=new Set,s=[],d=O(t);for(let u=0;u<c&&d.length>0;u+=1){let h=d.filter(a=>!f.has(a));for(let a of h)f.add(a);let v=Re(h,n,r);d=[];for(let a of v)!g.has(a)&&!s.includes(a)&&s.push(a),f.has(a)||d.push(a)}return s}function _e(t,n,r){let c=new Map(r.paths.flatMap(g=>g.edgeIds).map((g,f)=>[g,f]));return(c.get(t.id)??Number.MAX_SAFE_INTEGER)-(c.get(n.id)??Number.MAX_SAFE_INTEGER)||t.id.localeCompare(n.id)}function Pe(t){return`step:${t}`}function Ae(t){return`transition:${t}`}function pe(t,n){return t.length===0?null:`scip-query inspect ${t.map(r=>`--at ${De(r)}`).join(" ")} --view ${n}`}function De(t){return`'${t.replace(/'/gu,`'"'"'`)}'`}function O(t){return[...new Set(t)]}export{Le as a,Xe as b};
6
- //# sourceMappingURL=chunk-7R4V5ES6.js.map
@@ -1,7 +0,0 @@
1
- import{a as U,b as j}from"./chunk-2OOY75BW.js";import{a as J}from"./chunk-CKBUBRYD.js";import{b as K}from"./chunk-3AF4TUFK.js";import{b as z,e as I,i as B}from"./chunk-H5EXS3HM.js";import{d as X}from"./chunk-JFMEXGFE.js";import{d as S,e as N,f as F,h as G}from"./chunk-7F45LJKI.js";var V=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{existsSync as ee,statSync as Se}from"fs";import{dirname as re,join as ie}from"path";import{appendFileSync as ce,existsSync as ge,mkdirSync as fe,renameSync as me,rmSync as pe,statSync as ye,truncateSync as Re}from"fs";import{basename as be,dirname as xe}from"path";var T=".previous",Be=".rotation.lock",Ae=2e3,M=class extends Error{constructor(n,r){super(`Timed out after ${r}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=r;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},C=class extends Error{constructor(n){super(`Rotating JSONL lock ownership changed before release: ${n}`);this.lockPath=n;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},q=Object.freeze({monotonicNow:X,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=K(e,{kind:"rotating-jsonl",detail:{target:be(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){fe(e,{recursive:!0})},exists:ge,readBytes(e){return F(e,{maxBytes:S,inputKind:"rotating JSONL segment"})},size(e){return ye(e).size},truncate:Re,remove(e){pe(e,{force:!0})},rename:me,append:ce});function Y(e,t,n){let r=n.runtime??q,a=JSON.stringify(t);if(a===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let s=Buffer.from(`${a}
2
- `),i=Math.max(1,Math.floor(n.maxSegmentBytes),s.length);return Z(e,n.lockTimeoutMs,r,()=>{r.makeDirectory(xe(e));let c=he(e,S,r);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??T}`,l=!1,g=!1;return r.exists(e)&&r.size(e)+s.length>i&&(r.exists(o)&&(r.remove(o),g=!0),n.onPhase?.("previous-pruned"),r.rename(e,o),l=!0,n.onPhase?.("current-rotated")),r.append(e,s),n.onPhase?.("record-appended"),{lineBytes:s.length,segmentLimitBytes:i,repairedTailBytes:c,rotated:l,prunedPrevious:g}})}function H(e,t={}){let n=t.runtime??q,r=ve(t.maxSegmentBytes);return Z(e,t.lockTimeoutMs,n,()=>{let a=[],s=0,i=`${e}${t.previousSuffix??T}`;for(let c of[i,e]){if(!n.exists(c))continue;let o=Le(Q(c,r,n));a.push(...o.lines),s+=o.partialTailBytes}return{lines:a,ignoredPartialTailBytes:s}})}function Z(e,t,n,r){let a=`${e}${Be}`,s=Math.max(0,t??Ae),i=n.monotonicNow()+s,c;for(;;){let u=n.tryAcquireLock(a,e);if(u.kind==="acquired"){c=u.lock;break}let y=i-n.monotonicNow();if(y<=0)throw new M(a,s);n.wait(Math.min(5,y))}let o=!1,l,g;try{g=r()}catch(u){o=!0,l=u}let m=!1;try{m=c.release()}catch(u){if(!o)throw u}if(o)throw l;if(!m)throw new C(a);return g}function he(e,t,n){if(!n.exists(e))return 0;let r=Q(e,t,n);if(r.length===0||r[r.length-1]===10)return 0;let a=r.lastIndexOf(10),s=a<0?0:a+1;return n.truncate(e,s),r.length-s}function ve(e){let t=e??S;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function Q(e,t,n){let r=n.size(e);if(r>t)throw new N("rotating JSONL segment",e,"too-large",r,t);let a=n.readBytes(e),s=n.size(e);if(s!==r||a.byteLength!==r)throw new N("rotating JSONL segment",e,"changed-during-read",s,t);return a}function Le(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
3
- `).filter(a=>a.length>0),partialTailBytes:e.length-n}}var Te="reindex-activity.jsonl",O=T,Oe=1024*1024,ke=1440*60*1e3,te=e=>G(e,"reindex activity segment");function k(e){return ie(re(e),Te)}function ae(e){if(e.reused)return 0;let n=(e.shards?.some(r=>!r.reused&&r.strategy==="incremental")??!1?0:W(e.indexPath))+W(e.dbPath);for(let r of e.shards??[]){if(r.reused)continue;let a=r.producedOutputBytes??r.outputBytes;a!==null&&(n+=a)}return n}function Pe(e){let t=ae(e),n=e.writeTelemetry;return n?Math.max(0,t-n.reflinkedBytes)+n.fallbackCopiedBytes+(n.incrementalWrittenBytes??0):t}function ot(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let r=ae(t);return D(k(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:r,estimatedWriteBytes:Pe(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:We(t)})}function ut(e,t){return D(k(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function dt(e,t,n=new Date){return D(k(e),{version:1,event:"suppressed",recordedAt:n.toISOString(),trigger:t,reason:"completed-index-is-fresh"})}function Ee(e,t,n=Oe,r){Y(e,t,{maxSegmentBytes:n,previousSuffix:O,...r?{runtime:r}:{}})}function _e(e,t=new Date,n=ke,r=te){let a=t.getTime(),s=a-n,i={confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(s).toISOString(),windowEndedAt:t.toISOString(),runs:0,rebuilt:0,fullRebuilds:0,reused:0,failed:0,suppressed:0,estimatedLogicalOutputBytes:0,estimatedWriteBytes:0,reflinkedBytes:0,fallbackCopiedBytes:0,languageAttribution:"complete",attributedRuns:0,unattributedRuns:0,invalidLanguageDetails:0,byLanguage:{},byTrigger:{},automatic:{runs:0,rebuilt:0,fullRebuilds:0,estimatedWriteBytes:0}},c=i.automatic,o=k(e),l=[];if(r===te){if(!ee(o)&&!ee(`${o}${O}`))return i;try{let g=H(o,{previousSuffix:O});l=g.lines,i.ignoredPartialTailBytes=g.ignoredPartialTailBytes}catch{i.readErrors+=1,i.confidence="unavailable"}}else{let g=0;for(let m of[`${o}${O}`,o])try{l.push(...je(r(m))),g+=1}catch{i.readErrors+=1}g===0?i.confidence="unavailable":i.readErrors>0&&(i.confidence="partial")}for(let g of l){i.recordsRead+=1;let m=we(g);if(!m){i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial");continue}let{record:u}=m,y=Date.parse(u.recordedAt);if(y<s||y>a){i.skippedRecords+=1;continue}if(i.invalidLanguageDetails=(i.invalidLanguageDetails??0)+m.invalidLanguageDetails,i.byTrigger[u.trigger.kind]=(i.byTrigger[u.trigger.kind]??0)+1,u.event==="suppressed"){i.suppressed+=1;continue}i.runs+=1,i[u.result]+=1,i.estimatedLogicalOutputBytes+=u.estimatedLogicalOutputBytes;let b=Ne(u);i.estimatedWriteBytes=(i.estimatedWriteBytes??0)+b,i.reflinkedBytes=(i.reflinkedBytes??0)+(u.reflinkedBytes??0),i.fallbackCopiedBytes=(i.fallbackCopiedBytes??0)+(u.fallbackCopiedBytes??0),u.result!=="failed"&&(m.hasLanguageDetails?i.attributedRuns=(i.attributedRuns??0)+1:i.unattributedRuns=(i.unattributedRuns??0)+1);for(let[R,A]of se(u.byLanguage)){let x=(i.byLanguage??={})[R]??=Ge();x.runs+=1,x[A.result]+=1,x.producedOutputBytes+=A.producedOutputBytes,x.durationMs+=A.durationMs}let p=Me(u);p&&i.oldestRebuildAt===void 0&&(i.oldestRebuildAt=u.recordedAt),p&&(i.fullRebuilds=(i.fullRebuilds??0)+1),b>0&&i.oldestWriteAt===void 0&&(i.oldestWriteAt=u.recordedAt),Ie(u.trigger)&&(c.runs+=1,u.result==="rebuilt"&&(c.rebuilt+=1),p&&(c.fullRebuilds+=1,c.oldestRebuildAt??=u.recordedAt),c.estimatedWriteBytes+=b,b>0&&(c.oldestWriteAt??=u.recordedAt))}return i.ignoredPartialTailBytes>0&&i.confidence!=="unavailable"&&(i.confidence="partial"),i.languageAttribution=Ue(i),i}function D(e,t){try{return Ee(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function we(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(n.version!==1||!z(n.recordedAt)||!n.trigger||!Ce(n.trigger.kind))return null;if(n.event==="suppressed")return n.reason==="completed-index-is-fresh"?{record:n,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(n.event!=="run"||n.result!=="rebuilt"&&n.result!=="reused"&&n.result!=="failed"||!B(n.durationMs)||!B(n.estimatedLogicalOutputBytes)||n.estimatedWriteBytes!==void 0&&!B(n.estimatedWriteBytes)||n.reflinkedBytes!==void 0&&!B(n.reflinkedBytes)||n.fallbackCopiedBytes!==void 0&&!B(n.fallbackCopiedBytes)||n.incrementalWrittenBytes!==void 0&&!B(n.incrementalWrittenBytes))return null;let r=n,{byLanguage:a,...s}=r,i=De(a);return{record:{...s,...i.byLanguage?{byLanguage:i.byLanguage}:{}},hasLanguageDetails:i.hasLanguageDetails,invalidLanguageDetails:i.invalidLanguageDetails}}catch{return null}}function Ne(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function lt(e,t,n=new Date){return t.enabled?Je(_e(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function Ie(e){return e.kind.startsWith("watch-")}function Je(e,t,n){let r=e.automatic??{fullRebuilds:e.fullRebuilds??e.rebuilt,estimatedWriteBytes:e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,oldestRebuildAt:e.oldestRebuildAt,oldestWriteAt:e.oldestWriteAt},a=r.estimatedWriteBytes,s=r.fullRebuilds,i={rebuilt:s,estimatedWriteBytes:a};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...i,detail:`reindex activity evidence is ${e.confidence}`}:s>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:ne(r.oldestRebuildAt,t.windowMs,n),...i,detail:`${s}/${t.maxRebuilds} expensive full rebuild slots consumed by automatic refreshes`}:a>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:ne(r.oldestWriteAt,t.windowMs,n),...i,detail:`${a}/${t.maxEstimatedWriteBytes} estimated write bytes consumed by automatic refreshes`}:{state:"allowed",...i}:{state:"allowed",...i}}function Me(e){if(e.result!=="rebuilt")return!1;let t=se(e.byLanguage);return t.length===0?!0:t.some(([,n])=>n.result==="rebuilt"&&n.strategy!=="incremental"&&n.strategy!=="reused")}function ne(e,t,n){let r=e?Date.parse(e):Number.NaN;return Number.isFinite(r)&&r+t>n?r+t:n+t}function Ce(e){return e==="manual-cli"||e==="setup"||e==="watch-source"||e==="watch-startup"||e==="watch-demand"||e==="watch-git-head"||e==="watch-git-index"||e==="watch-git-state"||e==="unknown"}function W(e){try{return Se(e).size}catch{return 0}}function We(e){let t={};for(let n of e.languages){let r=(e.shards??[]).filter(l=>l.language===n),a=r.find(l=>l.id===n),s=e.reused||(a?a.reused:r.length>0&&r.every(l=>l.reused)),i=W(ie(re(e.dbPath),"language-indexes",`${n}.scip`)),c=i>0?i:a?.outputBytes??i,o=s?0:a?.durationMs??r.filter(l=>!l.reused).reduce((l,g)=>l+g.durationMs,0);t[n]={result:s?"reused":"rebuilt",strategy:s?"reused":a?.strategy??"full",...a?.strategy==="full"&&(a.fallbackReason??a.missReason)?{fallbackReason:a.fallbackReason??a.missReason}:{},outputBytes:c,producedOutputBytes:s?0:a?.producedOutputBytes??c,durationMs:o}}return t}function De(e){if(e===void 0)return{hasLanguageDetails:!1,invalidLanguageDetails:0};if(!e||typeof e!="object"||Array.isArray(e))return{hasLanguageDetails:!1,invalidLanguageDetails:1};let t={},n=0;for(let[a,s]of Object.entries(e)){if(!Fe(a)||!$e(s)){n+=1;continue}t[a]=s}let r=Object.keys(t).length>0;return{...r?{byLanguage:t}:{},hasLanguageDetails:r,invalidLanguageDetails:n}}function $e(e){if(!e||typeof e!="object")return!1;let t=e;return(t.result==="rebuilt"||t.result==="reused")&&(t.strategy===void 0||t.strategy==="reused"||t.strategy==="incremental"||t.strategy==="full")&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")&&I(t.outputBytes)&&I(t.producedOutputBytes)&&B(t.durationMs)&&(t.result!=="reused"||t.producedOutputBytes===0&&t.durationMs===0)&&t.producedOutputBytes<=t.outputBytes}function Fe(e){return J.includes(e)}function se(e){return e?J.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function Ge(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function Ue(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function je(e){return e.endsWith(`
4
- `)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
5
- `)+1))),e.split(`
6
- `).filter(t=>t.length>0)}function gt(e){let t=JSON.stringify(e);return Buffer.byteLength(t)<=65536?t:void 0}function ft(e){if(!(!e||Buffer.byteLength(e)>65536))try{return ze(JSON.parse(e))}catch{return}}function ze(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e;if(t.version!==1||t.baseGeneration!==null&&typeof t.baseGeneration!="string"||typeof t.complete!="boolean"||!Array.isArray(t.entries)||t.entries.length>1024||t.incompleteReason!==void 0&&typeof t.incompleteReason!="string")return;let n=[],r=new Set;for(let a of t.entries){if(!a||typeof a!="object"||Array.isArray(a))return;let s=a;if(typeof s.path!="string"||!Xe(s.path)||s.kind!=="add"&&s.kind!=="change"&&s.kind!=="delete"||r.has(s.path))return;r.add(s.path),n.push({path:s.path,kind:s.kind})}if(!(t.complete&&t.incompleteReason!==void 0)&&!(!t.complete&&(!t.incompleteReason||t.incompleteReason.trim()==="")))return{version:1,baseGeneration:t.baseGeneration,complete:t.complete,...t.incompleteReason===void 0?{}:{incompleteReason:t.incompleteReason},entries:n}}function Xe(e){return!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:\//.test(e)?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}import{spawn as Ke}from"child_process";import{platform as oe}from"os";import{performance as ue}from"perf_hooks";var xt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},L=class extends Error{constructor(n,r,a,s={}){super(a,s.cause===void 0?void 0:{cause:s.cause});this.kind=n;this.label=r;this.name="BoundedProcessError",this.timedOut=s.timedOut??!1,this.reaped=s.reaped??!1,this.stdout=s.stdout??"",this.stderr=s.stderr??"",this.stdoutTruncated=s.stdoutTruncated??!1,this.stderrTruncated=s.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function v(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function de(e,t,n,r){let a=Math.max(0,r-n);a>0&&e.push(t.subarray(0,a))}function le(e,t,n){let r=Buffer.concat([...e,t]);e.length=0,e.push(r.subarray(Math.max(0,r.length-n)))}function Bt(e){v(e.timeoutMs,"timeoutMs"),v(e.maxStdoutBytes,"maxStdoutBytes"),v(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;v(t,"terminationGraceMs");let n=e.terminationForceMs??t;return v(n,"terminationForceMs"),new Promise((r,a)=>{let s=ue.now(),i=oe()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",c=oe()!=="win32"&&!i,o;try{o=Ke(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:c?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(d){let f=d instanceof Error?d.message:String(d);a(new L("spawn",e.label,`${e.label} could not start: ${f}`,{cause:d,reaped:!0}));return}let l=[],g=[],m=0,u=0,y=!1,b=!1,p=null,R=!1,A=o.pid===void 0?null:U(o.pid,c),x=()=>{clearTimeout($),e.signal?.removeEventListener("abort",E)},P=d=>{if(R||!p)return;R=!0,x();let f=Buffer.concat(l).toString("utf8"),_=Buffer.concat(g).toString("utf8"),w=d.reaped||!d.detail?"":` Process-tree cleanup failed: ${d.detail}`;a(new L(p.kind,e.label,`${p.message}${w}`,{timedOut:p.timedOut,reaped:d.reaped,stdout:f,stderr:_,stdoutTruncated:y,stderrTruncated:b}))},h=d=>{if(!(p||R)){if(p=d,!A){P({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}j(A,{gracefulMs:t,forceMs:n}).then(P,f=>{P({reaped:!1,reason:"signal-failed",detail:f instanceof Error?f.message:String(f)})})}},$=setTimeout(()=>{h({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);$.unref();let E=()=>{h({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",E,{once:!0}),e.signal?.aborted&&E(),o.stdout.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?le(l,f,e.maxStdoutBytes):de(l,f,m,e.maxStdoutBytes),m+=f.length,m>e.maxStdoutBytes&&(y=!0,e.outputLimitBehavior!=="truncate-tail"&&h({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),o.stderr.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?le(g,f,e.maxStderrBytes):de(g,f,u,e.maxStderrBytes),u+=f.length,u>e.maxStderrBytes&&(b=!0,e.outputLimitBehavior!=="truncate-tail"&&h({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),o.on("error",d=>{if(!R&&!p){if(o.pid===void 0){x(),R=!0,a(new L("spawn",e.label,`${e.label} could not start: ${d.message}`,{cause:d,reaped:!0}));return}h({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${d.message}`})}}),o.on("close",(d,f)=>{if(R||p)return;R=!0,x();let _=Buffer.concat(l).toString("utf8"),w=Buffer.concat(g).toString("utf8");r({status:d,signal:f,stdout:_,stderr:w,timedOut:!1,durationMs:ue.now()-s,stdoutTruncated:y,stderrTruncated:b})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}export{xt as a,L as b,Bt as c,V as d,T as e,Y as f,Te as g,ot as h,ut as i,dt as j,_e as k,lt as l,gt as m,ft as n};
7
- //# sourceMappingURL=chunk-7RIRIADH.js.map
@@ -1,2 +0,0 @@
1
- import{a as D,b}from"./chunk-V2RBODHL.js";import{a as E,b as F,c as R,d as w}from"./chunk-ZMCQIHI4.js";import{a as A,c as B,e as l,f as g}from"./chunk-B3X6KU75.js";import{a as T,b as k,c as x}from"./chunk-KMVGRIO2.js";import{Q as y}from"./chunk-ZLMXIQLC.js";function K(e,t={}){return O(e,t).results}function O(e,t={}){let{minSimilarity:i=.62,minTokens:o=8,limit:s=20,scope:d,scanLimit:u,filePattern:m,focusFiles:f}=t,p=E(e),c=new F,a=y(e).reactProfiles({scope:d,minJsxTokens:o,scanLimit:u}).filter(n=>n.kind==="component").filter(n=>p.roleOf(n.file)!=="test"?!0:(c.record("test-files",R.testFiles),!1)).map(n=>({file:n.file,component:n.name,tokens:n.jsxTokens,profile:n})),v=D(a,n=>n.tokens);return{results:b({profiles:a,limit:s,filePattern:m,focusFiles:f,candidateIndex:v,profile:{name:"react-component-duplicates"},compare:(n,r)=>{let h=p.pairContext(n.file,r.file),P=N(n,r,i,h);return P?h==="ui-kit-pair"?(c.record("ui-kit-pairs",R.uiKitPairs),null):P:null},sort:(n,r)=>S(n.actionTier)-S(r.actionTier)||r.similarity-n.similarity||n.fileA.localeCompare(r.fileA)||n.componentA.localeCompare(r.componentA)||n.fileB.localeCompare(r.fileB)||n.componentB.localeCompare(r.componentB)}),exclusions:c.list()}}function S(e){return e==="signal"?0:1}function N(e,t,i,o){let s=T(e.tokens,t.tokens);if(s.size<6||!j(s))return null;let d=x(e.tokens,t.tokens);if(d<i)return null;let u=l(s,"component:"),m=l(s,"native:"),f=l(s,"prop:"),p=l(s,"event:"),c=l(s,"binding:"),a=M({sharedComponents:u,sharedNativeTags:m,sharedProps:f,sharedEvents:p,sharedBindings:c}),v=w(o),C=_(e.component,t.component,u),n=C?{actionTier:"support",recommendation:W}:I(o,a.actionTier,a.recommendation),r=[v,C].filter(h=>h!==null);return{fileA:e.file,componentA:e.component,fileB:t.file,componentB:t.component,similarity:d,tokenCountA:e.tokens.size,tokenCountB:t.tokens.size,sharedTokens:g(s),sharedComponents:u,sharedNativeTags:m,sharedProps:f,sharedEvents:p,sharedBindings:c,evidenceClass:a.evidenceClass,actionTier:n.actionTier,evidenceClassReasons:[...r,...a.reasons],recommendation:n.recommendation,pairContext:o,uniqueToA:g(k(e.tokens,t.tokens)).slice(0,25),uniqueToB:g(k(t.tokens,e.tokens)).slice(0,25),locA:e.profile.loc,locB:t.profile.loc}}function I(e,t,i){switch(e){case"framework-route-pair":return{actionTier:"support",recommendation:"Framework route entries share routing scaffolding by design; consolidate only a repeated non-routing body, and keep each route file as the framework entry."};case"intercepting-route-pair":return{actionTier:t,recommendation:"Render one shared view component from both the intercepting route and its target route; the routes are meant to show the same content, not to duplicate its body."};case"ui-kit-pair":case"product":return{actionTier:t,recommendation:i}}}function _(e,t,i){return!L.test(e)||!L.test(t)||!i.every(o=>G.has(o))?null:"both components are loading placeholders sharing only skeleton primitives"}var L=/(?:Skeleton|Loading|Placeholder|Fallback)(?:[A-Z][A-Za-z0-9]*)?$|^Loading[A-Z]/,G=new Set(["Skeleton","Spinner","Loader","Loader2","Placeholder"]),W="Loading placeholders mirror the surface they stand in for; share a skeleton primitive only if the covered layouts are themselves shared.";function j(e){let t=0,i=0;for(let o of e)o.startsWith("component:")&&(t+=1),(o.startsWith("prop:")||o.startsWith("event:")||o.startsWith("native:")||o.startsWith("jsx:"))&&(i+=1);return B([{name:"component",count:t},{name:"shape",count:i}],[{min:{component:1},reason:"shared custom component"},{min:{shape:4},reason:"shared JSX structure"}]).pass}function M(e){return A({genericWords:z,primitiveGroups:[{values:e.sharedNativeTags,reasonPrefix:"shared native tags",bucket:"generic"},{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"}],recommendation:q})}function q(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific UI primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var z=new Set(["actions","app","button","card","children","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{K as a,O as b};
2
- //# sourceMappingURL=chunk-7ZLWLOGT.js.map
@@ -1,38 +0,0 @@
1
- import{d as re,e as ie}from"./chunk-MTDBHTSF.js";import{c as ee,d as P,e as ne,f as te,o as oe}from"./chunk-FI7VGOR4.js";import{a as X}from"./chunk-L7KTFEAV.js";import{C as A,G as F,K as z,M as Q,T as N,U as _,Z,_ as q,p as k}from"./chunk-2VAHDDLM.js";import{d as w,f as V}from"./chunk-BL6DCHQP.js";import{c as Y,d as R}from"./chunk-IW5XQG5G.js";import{p as T}from"./chunk-7HXT6YLU.js";import{c as U,f as J}from"./chunk-7F45LJKI.js";import{existsSync as Me}from"fs";import{SymbolRole as Oe}from"@c4312/scip";import{deserializeSCIP as ge}from"@c4312/scip";function ce(n,e){return ge(J(n,{inputKind:e,maxBytes:U}))}import{fromBinary as ye}from"@bufbuild/protobuf";import{DocumentSchema as Se,SymbolRole as j}from"@c4312/scip";import{zstdDecompressSync as Ce}from"zlib";var he=Y("scip-chunk-occurrence-targets",{clearGroups:["whole-project","definition-catalog","source-file"],maxEntries:256}),Le=R("scip-chunk-occurrence-definitions",{clearGroups:["whole-project","definition-catalog"]}),le=1,Ee=R("scip-chunk-occurrence-data-present",{clearGroups:["whole-project"]});function B(n){return Ee.get(n,()=>{let e=n.get("SELECT length(occurrences) AS size FROM chunks LIMIT 1");return e!==void 0&&(e.size??0)>le})}function ae(n,e){return he.get(n,e,()=>Ie(n,e))}function K(n,e){return`${n}\0${e}`}function Ie(n,e){let t=n.get("SELECT id FROM documents WHERE relative_path = ?",e);if(!t)return{available:!1,reason:"no-document"};let r=n.all("SELECT occurrences FROM chunks WHERE document_id = ? ORDER BY chunk_index",t.id);if(r.length===0)return B(n)?{available:!0,targets:[],externalLeafKeys:new Set,locals:[]}:{available:!1,reason:"no-occurrence-data"};let i=Le.get(n,()=>new Map(_(n).map(u=>[u.symbol,u]))),c=[],a=new Set,s=[];try{for(let u of r){let d=u.occurrences;if(!d||d.length<=le)return{available:!1,reason:"no-occurrence-data"};let l=ye(Se,new Uint8Array(Ce(d)));for(let m of l.occurrences){if(!m.symbol)continue;let b=m.range[0];if(!Number.isInteger(b))continue;if(m.symbol.startsWith("local ")){s.push(Re(m.symbol,m.range,m.symbolRoles));continue}if((m.symbolRoles&j.Definition)!==0)continue;let o=i.get(m.symbol);if(o){c.push({sourceLine:b,definition:o});continue}let f=_e(m.symbol);f&&a.add(K(b,f))}}}catch{return{available:!1,reason:"no-occurrence-data"}}return{available:!0,targets:c,externalLeafKeys:a,locals:s}}function Re(n,e,t){let r=e.length===4;return{symbol:n,line:e[0],startChar:e[1]??0,endLine:r?e[2]:e[0],endChar:r?e[3]??0:e[2]??0,definition:(t&j.Definition)!==0,write:(t&j.WriteAccess)!==0}}function _e(n){if(n.startsWith("local "))return null;try{let e=w(n);return e.length>0?e:null}catch{return null}}var $=new WeakMap;function M(n,e){let t=ae(n,e);if(t.available)return{targets:t.targets,externalLeafKeys:t.externalLeafKeys,locals:t.locals};if(t.reason==="no-document")return null;if(B(n))return{targets:[],externalLeafKeys:new Set,locals:[]};let r=ve(n);return r?{targets:r.byFile.get(e)??[],externalLeafKeys:new Set,locals:[]}:null}function mn(n,e,t,r){let i=A(n,e),c=(i?.callSites??[]).filter(o=>o.line>=t&&o.line<=r);if(!i||c.length===0)return{available:!!i,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let a=M(n,e);if(!a)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:c.length};let s=a.targets.filter(o=>o.sourceLine>=t&&o.sourceLine<=r).map(o=>({...o,calleeLeaf:o.definition.leaf})),u=se(c.map(o=>({line:o.line,leaf:o.calleeLeaf}))),d=se(s.map(o=>({line:o.sourceLine,leaf:o.calleeLeaf}))),l=new Set([...u].flatMap(([o,f])=>d.get(o)===f?[o]:[])),m=s.filter(o=>l.has(ue(o.sourceLine,o.calleeLeaf))),b=[...l].reduce((o,f)=>o+(u.get(f)??0),0);return{available:!0,targets:m,resolvedCallsites:b,unresolvedCallsites:Math.max(0,c.length-b)}}function fn(n,e,t,r){let i=M(n,e);return i?{available:!0,targets:i.targets.filter(c=>c.sourceLine>=t&&c.sourceLine<=r)}:{available:!1,targets:[]}}function dn(n,e,t,r){let i=M(n,e);return i?{available:!0,targets:i.targets.filter(c=>c.sourceLine>=t&&c.sourceLine<=r&&xe(n,c.definition)).map(c=>({...c,calleeLeaf:c.definition.leaf}))}:{available:!1,targets:[]}}function ve(n){if($.has(n))return $.get(n)??null;let e=we(n);return $.set(n,e),e}function we(n){if(!n.generation.indexPath||!Me(n.generation.indexPath))return null;try{let e=_(n),t=new Map(e.map(c=>[c.symbol,c])),r=ce(n.generation.indexPath,"SCIP source-range call-target index"),i=new Map;for(let c of r.documents??[]){let a=c.relativePath;if(!a||n.isIgnored(a))continue;let s=[];for(let u of c.occurrences??[]){if(!u.symbol||(u.symbolRoles&Oe.Definition)!==0)continue;let d=t.get(u.symbol),l=u.range?.[0];!d||!Number.isInteger(l)||s.push({sourceLine:l,definition:d})}i.set(a,s)}return{byFile:i}}catch{return null}}function xe(n,e){if(!e.isFunctionLike)return!1;let t=A(n,e.relativePath);return!t||t.callables.some(r=>r.name===e.leaf&&r.startLine===e.startLine&&r.endLine===e.endLine)?!0:De(e)}function De(n){let e=n.documentation;if(!e)return!1;let t=n.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${t}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(e)||new RegExp(`\\b(?:const|let|var)\\s+${t}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(e)}function se(n){let e=new Map;for(let t of n){let r=ue(t.line,t.leaf);e.set(r,(e.get(r)??0)+1)}return e}function ue(n,e){return`${n}\0${e}`}function vn(n,e,t={}){let r=fe(n,[e],{additive:t.additive,semantic:t.semantic,semanticEvidence:t.semanticEvidence}),i=t.callableOnly?(r.get(e.symbolId)??[]).filter(c=>V(c.symbol)||c.source==="ast-callsite"||c.source==="scip-occurrence"):r.get(e.symbolId)??[];return typeof t.limit=="number"?i.slice(0,t.limit):i}function wn(n,e,t){return Te(n,[e],t).get(e.symbolId)??[]}function Te(n,e,t){let r=Ne(n)?je(n,e,{semantic:t.semantic!==!1,semanticEvidence:t.semanticEvidence}):Pe(n,t.semanticEvidence);return typeof t.limit!="number"?new Map(e.map(i=>[i.symbolId,r.get(i.symbolId)??[]])):new Map(e.map(i=>[i.symbolId,(r.get(i.symbolId)??[]).slice(0,t.limit)]))}var ke=R("caller-rows",{clearGroups:["whole-project"]}),Ae=R("targeted-caller-strategy",{clearGroups:["whole-project"]}),Fe=2e4;function Ne(n){return Ae.get(n,()=>(n.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Fe)}function Pe(n,e){return ke.get(n,()=>{let t=_(n),r=fe(n,t,{semanticEvidence:e}),i=new Map;for(let s of t)i.set(s.symbol,s.symbolId);let c=new Map,a=new Map;for(let s of t){let u=r.get(s.symbolId);if(!(!u||u.length===0))for(let d of u){let l=i.get(d.symbol);if(l===void 0||l===s.symbolId)continue;let m=c.get(l);m||(m=[],c.set(l,m),a.set(l,new Set));let b=`${s.symbol}|${s.relativePath}`;a.get(l).has(b)||(a.get(l).add(b),m.push({symbol:s.symbol,file:s.relativePath,source:"caller-map-inversion",callEvidence:d.source}))}}return c})}function je(n,e,t){let r=t.semantic&&t.semanticEvidence?e.flatMap(o=>{let f=Be(n,o);return f?[f]:[]}):[],i=new Map(r.map(o=>[o.symbolId,o])),c=t.semanticEvidence?.referenceMap(n,r)??new Map,a=oe(n,e),s=new Set(e.map(o=>o.symbol)),d=[...new Set(e.flatMap(o=>X(n,"reverse",[o.relativePath])))].flatMap(o=>N(n,o)),l=new Map,m=de(n,d);for(let o of d)for(let f of m.get(o.symbolId)??[]){if(!s.has(f.symbol))continue;let S=l.get(f.symbol)??[];S.push({symbol:o.symbol,file:o.relativePath,source:"caller-map-inversion",callEvidence:f.source}),l.set(f.symbol,S)}let b=new Map;for(let o of e){let f=[],S=new Set,C=p=>{if(p.symbol===o.symbol)return;let h=`${p.symbol}|${p.file}`;S.has(h)||(S.add(h),f.push(p))};for(let p of l.get(o.symbol)??[])C(p);for(let p of a.get(o.symbolId)??[])p.file!==o.relativePath&&C({symbol:p.enclosingSymbol??p.file,file:p.file,source:"resolved-reference"});let O=i.get(o.symbolId);if(O)for(let p of c.get(O.symbolId)??[]){if(p.file===o.relativePath||n.isIgnored(p.file))continue;let h=q(N(n,p.file),p.line);C({symbol:h?.symbol??p.file,file:p.file,source:"semantic-reference"})}b.set(o.symbolId,f)}return b}function Be(n,e){let t=re().join(", "),r=ie().join(", ");return n.get(`SELECT
2
- d.id AS documentId,
3
- gs.id AS symbolId,
4
- gs.symbol,
5
- d.relative_path AS relativePath,
6
- COALESCE(der.start_line, c.start_line) AS startLine,
7
- COALESCE(der.end_line, c.end_line) AS endLine,
8
- COALESCE(gs.display_name, '') AS leaf,
9
- NULL AS parentTypeName,
10
- CASE WHEN gs.kind IN (${t}) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
11
- CASE WHEN gs.kind IN (${r}) THEN 1 ELSE 0 END AS isTypeLike,
12
- gs.kind AS kind,
13
- gs.documentation AS documentation,
14
- gs.enclosing_symbol AS enclosingSymbol
15
- FROM global_symbols gs
16
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
17
- LEFT JOIN chunks c ON c.document_id = der.document_id
18
- JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
19
- WHERE gs.id = ?
20
- LIMIT 1`,e.symbolId)??null}function fe(n,e,t={}){if(e.length===0)return new Map;let r=t.additive??!1,i=[],c=[];for(let l of e)k(l.relativePath)&&F(n,l.relativePath)!==null?i.push(l):c.push(l);let a=new Map,s=new Map,u=l=>{for(let[m,b]of l){let o=a.get(m);o||(o=[],a.set(m,o));let f=s.get(m);f||(f=new Set,s.set(m,f));for(let S of b){let C=`${S.symbol}|${S.chunkId}`;f.has(C)||(f.add(C),o.push(S))}}};i.length>0&&u(de(n,i)),t.semantic!==!1&&t.semanticEvidence&&u(Ye(t.semanticEvidence.calleeMap(n,e)));let d=r?e:c;return d.length>0&&u(Ue(n,d)),a}function de(n,e){let t=new Map,r=He(e,t),i=te(n);for(let[c,a]of r){let s=F(n,c);if(!s)continue;let u=Z(a),d=Ke(M(n,c));for(let l of s){let m=u.get(l.line);if(!m)continue;let b=d?$e(d,l):null,o=b??(d?.externalLeafKeys.has(K(l.line,l.calleeLeaf))?null:We(n,c,i,l));o&&o.symbol!==m.symbol&&t.get(m.symbolId).push({symbol:o.symbol,file:o.file,chunkId:l.line,source:b?"scip-occurrence":"ast-callsite",callsiteLine:l.line,...l.kind==="jsx-render"?{kind:"jsx-render"}:{}})}}return t}function Ke(n){if(!n)return null;let e=new Map;for(let t of n.targets){let r=e.get(t.sourceLine);r?r.push(t.definition):e.set(t.sourceLine,[t.definition])}return{targetsByLine:e,externalLeafKeys:n.externalLeafKeys}}function $e(n,e){let t=n.targetsByLine.get(e.line);if(!t)return null;let r=null;for(let i of t)if(i.leaf===e.calleeLeaf){if(r&&r.symbol!==i.symbol)return null;r=i}return r?{symbol:r.symbol,file:r.relativePath}:null}function He(n,e){let t=new Map;for(let r of n){let i=t.get(r.relativePath);i?i.push(r):t.set(r.relativePath,[r]),e.set(r.symbolId,[])}for(let r of t.values())r.sort((i,c)=>i.endLine-i.startLine-(c.endLine-c.startLine));return t}function We(n,e,t,r){let i=Q(n,e,r.calleeLeaf);if(i){let s=P(e,t.get(i.importedName)??[]).filter(u=>T(i.sourcePath,u.file));return s.length===1?s[0]:null}let c=P(e,t.get(r.calleeLeaf)??[]);if(c.length===0)return null;let a=Ge(n,e,c,r.calleeQualifier);return a||ne(n,e,c,r.memberAccess,r.calleeQualifier)}function Ge(n,e,t,r){if(!r||k(e)!=="clojure")return null;let c=z(n,e).filter(a=>a.kind==="namespace"&&a.localName===r&&a.sourcePath).map(a=>a.sourcePath);for(let a of c){let s=t.find(u=>T(a,u.file));if(s)return s}return t.find(a=>/`([^`]+)`\//.exec(a.symbol)?.[1]===r)??null}function Ue(n,e){if(e.length===0)return new Map;let r=H(e.map(o=>o.documentId)).flatMap(o=>n.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
21
- FROM mentions m
22
- JOIN chunks c ON m.chunk_id = c.id
23
- WHERE m.role != 1
24
- AND c.document_id IN (${o.map(()=>"?").join(",")})`,...o)),i=new Map;for(let o of r)i.has(o.document_id)||i.set(o.document_id,[]),i.get(o.document_id).push(o);let a=H(r.map(o=>o.symbol_id)).flatMap(o=>n.all(`SELECT gs.id AS symbol_id, gs.symbol,
25
- COALESCE(der.document_id, def_chunk.document_id) AS document_id
26
- FROM global_symbols gs
27
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
28
- LEFT JOIN (
29
- SELECT m.symbol_id, MIN(c.document_id) AS document_id
30
- FROM mentions m
31
- JOIN chunks c ON m.chunk_id = c.id
32
- WHERE m.role = 1
33
- AND m.symbol_id IN (${o.map(()=>"?").join(",")})
34
- GROUP BY m.symbol_id
35
- ) def_chunk ON def_chunk.symbol_id = gs.id
36
- WHERE gs.id IN (${o.map(()=>"?").join(",")})`,...o,...o)),s=H([...e.map(o=>o.documentId),...a.flatMap(o=>o.document_id===null?[]:[o.document_id])]),u=new Map(s.flatMap(o=>n.all(`SELECT id, relative_path FROM documents
37
- WHERE id IN (${o.map(()=>"?").join(",")})`,...o).map(f=>[f.id,f.relative_path]))),d=new Map;for(let o of a)d.has(o.symbol_id)||d.set(o.symbol_id,{symbol:o.symbol,file:o.document_id!==null?u.get(o.document_id)??"":""});let l=new Map,m=u,b=Je(e);for(let[o,f]of b){let C=[...i.get(o)??[]].sort((g,L)=>g.start_line-L.start_line||g.end_line-L.end_line),O=[...f].sort((g,L)=>g.startLine-L.startLine||g.endLine-L.endLine),p=new Set,h=0;for(let g of O){for(;h<C.length&&C[h].start_line<=g.endLine;)p.add(C[h]),h+=1;for(let y of p)y.end_line<g.startLine&&p.delete(y);let L=new Set,W=[],x=null,pe=()=>{if(x)return x;let y=m.get(g.documentId)??"",E=new Set;if(y){let D=ee(n,y),v=Math.max(0,g.startLine),G=Math.min(D.length-1,g.endLine);for(let I=v;I<=G;I+=1)for(let be of D[I])E.add(be)}return x=E,E};for(let y of p){if(y.symbol_id===g.symbolId)continue;let E=d.get(y.symbol_id);if(!E)continue;if(!(y.start_line>=g.startLine&&y.end_line<=g.endLine)){if(!(y.start_line<=g.endLine&&y.end_line>=g.startLine))continue;let I=w(E.symbol);if(!I||!pe().has(I))continue}let v=`${E.symbol}|${y.chunk_id}`;L.has(v)||(L.add(v),W.push({...E,chunkId:y.chunk_id,source:"scip-chunk"}))}l.set(g.symbolId,W)}}return l}var me=500;function H(n){let e=[...new Set(n)],t=[];for(let r=0;r<e.length;r+=me)t.push(e.slice(r,r+me));return t}function Je(n){let e=new Map;for(let t of n){let r=e.get(t.documentId);r?r.push(t):e.set(t.documentId,[t])}return e}function Ye(n){let e=new Map;for(let[t,r]of n){let i=[];for(let c of r)i.push({symbol:c.symbol,file:c.file,chunkId:-1,source:"semantic-callee",...c.callsiteLine===void 0?{}:{callsiteLine:c.callsiteLine},...c.kind==="jsx-render"?{kind:"jsx-render"}:{}});e.set(t,i)}return e}export{mn as a,fn as b,dn as c,xe as d,vn as e,wn as f,Te as g,fe as h};
38
- //# sourceMappingURL=chunk-AADQLOQ4.js.map
@@ -1,2 +0,0 @@
1
- import{e as p}from"./chunk-JFMI5SGB.js";import{e as h}from"./chunk-AADQLOQ4.js";import{a as y}from"./chunk-WDSFQDPN.js";import{p as u}from"./chunk-FI7VGOR4.js";import{a as S,c as b}from"./chunk-2USA3S3P.js";import{_ as d}from"./chunk-2VAHDDLM.js";import{c as m}from"./chunk-BL6DCHQP.js";function x(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,l=S(e,o);return l?c==="backward"?k(e,l,s,{semantic:r.semantic!==!1}):D(e,l,{semantic:r.semantic!==!1}):null}function j(e,o,r={}){return x(e,o,r)}function k(e,o,r,c){let s=[],l=new Set([o.symbol]),t=[o];for(let n=1;n<=r&&t.length!==0;n++){let i=[];for(let g of t){let w=h(e,g,{semantic:c.semantic,semanticEvidence:y});for(let a of w){if(l.has(a.symbol))continue;l.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function D(e,o,r){let c=new Set,s=[],l=new p(e);for(let t of u(e,o,{semantic:r.semantic,semanticEvidence:y})){if(s.length>=30)break;let n=t.enclosingSymbol??d(l.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{x as a,j as b};
2
- //# sourceMappingURL=chunk-AN76MGUE.js.map
@@ -1,2 +0,0 @@
1
- import{a as de,c as Xe,d as et}from"./chunk-JCSAZ35V.js";import{a as it}from"./chunk-WRQXLNYE.js";import{a as ft,b as pt,c as dt,d as ye,i as V,j as Z,k as St,l as Q,n as gt}from"./chunk-5BIKR67W.js";import{j as ut}from"./chunk-CZW5MZ5B.js";import{h as mt}from"./chunk-ODPDP7A4.js";import{b as yt}from"./chunk-MOKUWRHO.js";import{b as Qe}from"./chunk-FVFDOIM3.js";import{C as G,I as Ve,K as Ze,T as rt,U as K,b as me,c as fe,d as q,n as pe,p as Ge,y as Ke}from"./chunk-2VAHDDLM.js";import{d as tt,g as nt,i as Se}from"./chunk-BL6DCHQP.js";import{c as lt,d as ge}from"./chunk-EHYDXE3Z.js";import{a as X,b as bt}from"./chunk-U6KCHXJ4.js";import{b as ue,d as Y,n as Je,p as Ye}from"./chunk-ATXPTSEI.js";import{a as $e,d as le}from"./chunk-IW5XQG5G.js";import{f as st,j as ot,k as at,l as ct}from"./chunk-T3CZAZSI.js";import{a as qe}from"./chunk-B3PYOSCX.js";import{a as ce,c as je,e as E}from"./chunk-HGFDYOVB.js";import{b as Ne,c as Be,d as J}from"./chunk-JFMEXGFE.js";import{$ as ze,N as We,aa as He}from"./chunk-7HXT6YLU.js";import{c as Ue,f as Le,g as Oe}from"./chunk-7F45LJKI.js";import{randomUUID as Yt}from"crypto";import{existsSync as Gt}from"fs";import{dirname as Kt}from"path";function Rt(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e;if(typeof t.available!="boolean"||t.dependencyAvailable!==void 0&&typeof t.dependencyAvailable!="boolean"||t.tsconfigPath!==void 0&&typeof t.tsconfigPath!="string"||t.tsconfigPaths!==void 0&&(!Array.isArray(t.tsconfigPaths)||!t.tsconfigPaths.every(n=>typeof n=="string"))||t.resolvedBinary!==void 0&&typeof t.resolvedBinary!="string"||t.note!==void 0&&typeof t.note!="string")return null;if(t.available===!0){if(t.reason!==void 0)return null}else if(typeof t.reason!="string"||t.reason.length===0)return null;return t}var Vt=12e4,Zt=5;function Ct(e,t,n={}){let r=n.requester??new Re(e,n),i=null,s=null,o=process.env.SCIP_QUERY_SKIP_WATCH_SERVICE==="1",a=null,c=()=>(i??=yt(e,t),i),l=(p,S,h)=>(o=!0,nn(e)?S():(a=p instanceof Error?p.message:String(p),console.error(`TypeScript semantic service request failed (${a}); semantic enrichment is disabled for the rest of this run because the index is too large for an in-process compiler.`),h())),m=(p,S,h,v=h)=>{if(a!==null)return v();if(o)return h();try{return S(r.request(p))}catch(M){return vt(M)?v():l(M,h,v)}},f=(p,S,h,v)=>{if(a!==null)return new Map;if(o)return v();let M=w=>{try{return h(r.request(S(w)))}catch(b){if(!Qt(b))throw b;let D=Xt(w);if(!D)throw b;return new Map([...M(D[0]),...M(D[1])])}};try{return M(p)}catch(w){return vt(w)?new Map:l(w,v,()=>new Map)}},d=(p,S)=>f(p,h=>({kind:"references",definitions:[...h],...S?.exact?{exact:!0}:{}}),h=>be(h),()=>c().referencesForDefinitions?.(p,S)??new Map(p.map(h=>[h.symbolId,c().referencesFor(h)]))),R=p=>f(p,S=>({kind:"callees",definitions:[...S]}),S=>be(S),()=>c().calleesForDefinitions?.(p)??new Map(p.map(S=>[S.symbolId,c().calleesFor(S)])));return{language:"typescript",availability:()=>(s??=m({kind:"availability"},an,()=>c().availability(),()=>({available:!1,reason:`TypeScript semantic service declined: ${a??"unknown"}`})),s),importUsage:p=>m({kind:"import-usage",file:p},S=>S,()=>c().importUsage(p),()=>[]),referencesFor:p=>d([p]).get(p.symbolId)??[],referencesForDefinitions:d,referenceFragmentsForFiles:p=>m({kind:"reference-fragments",files:[...p]},S=>on(S),()=>c().referenceFragmentsForFiles?.(p)??new Map,()=>new Map),calleesFor:p=>R([p]).get(p.symbolId)??[],calleesForDefinitions:R,calleeCoverageForDefinitions:p=>f(p,S=>({kind:"callee-coverage",definitions:[...S]}),S=>be(S),()=>c().calleeCoverageForDefinitions?.(p)??new Map),signatureFor:p=>m({kind:"signature",definition:p},cn,()=>c().signatureFor(p),()=>null),dispose:()=>i?.dispose?.()}}function Qt(e){let t=e instanceof Error?e.message:String(e);return/memory limit|heap out of memory|worker terminated|worker failed/iu.test(t)}function Xt(e){let t=[...new Set(e.map(r=>r.relativePath))].sort();if(t.length<2)return null;let n=new Set(t.slice(0,Math.ceil(t.length/2)));return[e.filter(r=>n.has(r.relativePath)),e.filter(r=>!n.has(r.relativePath))]}function vt(e){let t=e instanceof Error?e.message:String(e);return t.includes("invalid mailbox request")||t.includes("Unhandled TypeScript semantic request")||t.includes("compiler project is file-scoped")}var en=2500,tn=25e3,ht=new WeakMap;function nn(e){let t=ht.get(e);if(t!==void 0)return t;let n=rn(e);return ht.set(e,n),n}function rn(e){try{let t=e.get("SELECT (SELECT count(*) FROM documents) AS documents, (SELECT count(*) FROM global_symbols) AS symbols");return!t||t.documents<en&&t.symbols<tn}catch{return!0}}var Re=class{constructor(t,n={}){this.db=t;this.runtime=n.runtime??un,this.timeoutMs=n.timeoutMs??ln(),this.mailboxLimits=n.mailboxLimits??{},this.cacheDir=Kt(t.config.dbPath),this.projectRoot=We(t.config.projectRoot)}db;runtime;timeoutMs;cacheDir;projectRoot;mailboxLimits;request(t){let n=lt(this.cacheDir),r=bt(this.cacheDir),i=ge(n.statePath);if(!It(i,this.projectRoot,this.runtime))throw new Error("Compatible TypeScript semantic service is not running.");let s=this.db.generation.identity;if(!s)throw new Error("Published TypeScript generation identity is unavailable.");let o=this.runtime.now(),a=o+this.timeoutMs,c=(this.runtime.monotonicNow??J)()+this.timeoutMs,l=je(),m=ot("typescript-semantic-v3",{generation:s,profileEnvironment:l,request:t}),f=at(m),d=ct(r,{mailboxVersion:st,operationKey:m,clientId:this.runtime.randomId(),enqueuedAtMs:o,deadlineAtMs:a,protocolVersion:X,id:f,generation:s,profileEnvironment:l,request:t},{nowMs:o,limits:this.mailboxLimits});for(;(this.runtime.monotonicNow??J)()<=c;){if(Gt(d.responsePath))return sn(Oe(d.responsePath,{maxBytes:this.mailboxLimits.maxItemBytes??64*1024*1024,inputKind:"TypeScript semantic mailbox response"}),f,s,m);let R=ge(n.statePath);if(!It(R,this.projectRoot,this.runtime))throw new Error("TypeScript semantic service stopped while processing a request.");this.runtime.sleep(Zt)}throw new Error(`TypeScript semantic service timed out after ${this.timeoutMs}ms.`)}};function It(e,t,n){let r=e?.processIdentity?n.readProcessIdentity?.(e.pid):null;return e!==null&&e.projectRoot===t&&e.typescriptSemantic?.protocolVersion===X&&n.isProcessAlive(e.pid)&&(!e.processIdentity||r!=null&&Ne(e.processIdentity,r))}function sn(e,t,n,r){let i=JSON.parse(e);if(i.protocolVersion!==X||i.id!==t||i.operationKey!==r||i.ok===!0&&i.generation!==n)throw new Error("TypeScript semantic service wrote an incompatible response.");if(i.ok===!0)return i.response;throw new Error(typeof i.error=="string"?i.error:"TypeScript semantic service request failed.")}function be(e){if(!Array.isArray(e))throw new Error("TypeScript semantic service wrote an invalid numeric map.");return new Map(e)}function on(e){if(!Array.isArray(e))throw new Error("TypeScript semantic service wrote an invalid string map.");return new Map(e)}function an(e){let t=Rt(e);if(!t)throw new Error("TypeScript semantic service wrote invalid availability.");return t}function cn(e){if(e!==null&&typeof e!="string")throw new Error("TypeScript semantic service wrote an invalid signature.");return e}function ln(){let e=Number(process.env.SCIP_TYPESCRIPT_SEMANTIC_TIMEOUT_MS);return Number.isInteger(e)&&e>0?e:Vt}var un={now:Date.now,monotonicNow:J,randomId:Yt,sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)},isProcessAlive:qe,readProcessIdentity:Be};function Dt(e){let t=new Map,n=fn(e),r=new Map;return i=>{let s=mn(i),o=r.get(s);if(o!==void 0)return o;if(!n.has(i.file))return r.set(s,i.symbol),i.symbol;let a=t.get(i.file);a||(a=pn(rt(e,i.file)),t.set(i.file,a));let c=dn(a,i);return r.set(s,c),c}}function mn(e){return`${e.file}\0${e.symbol}\0${e.line}`}function fn(e){return new Set(e.all("SELECT relative_path FROM documents").map(t=>t.relative_path))}function pn(e){let t=new Map,n=new Map;for(let r of e){let i=t.get(r.leaf);i?i.push(r):t.set(r.leaf,[r]);let s=n.get(r.startLine);s?s.push(r):n.set(r.startLine,[r])}return{definitions:e,byLeaf:t,byStartLine:n}}function dn(e,t){if(e.definitions.length===0)return t.symbol;let n=yn(t.symbol),r=Sn(e.byLeaf,n),i=gn(r,t.line);if(i)return i.symbol;let s=e.byStartLine.get(t.line)??[];return s.length===1?s[0].symbol:t.symbol}function Sn(e,t){let n=[],r=new Set;for(let i of t)for(let s of e.get(i)??[])r.has(s.symbolId)||(r.add(s.symbolId),n.push(s));return n}function gn(e,t){let n=null;for(let r of e)if(!(r.startLine>t||r.endLine<t)){if(r.startLine===t)return r;(!n||r.endLine-r.startLine<n.endLine-n.startLine)&&(n=r)}return n}function yn(e){let t=new Set([e]),r=e.split(/::|\.|#/).filter(Boolean).at(-1);return r&&t.add(r),t}function Mt(e,t){let r=Ze(e,t).map(i=>Rn(t,i));return{usage:r,positions:vn(e,t,r)}}function xt(e,t){return{importUsage(n){let r=e.importUsageFacts(n);if(!t||r.positions.length===0)return r.usage;let i=t.importDefinitionsForFile(n,r.positions);return i.available?bn(r.usage,i.sourcePaths):r.usage}}}function bn(e,t){return e.map((n,r)=>{let i=t.get(String(r));return i?{...n,sourcePath:i}:n})}function Rn(e,t){let n=t.isTypeOnly===!0,r=t.kind==="side-effect"||n||t.used;return{importer:e,sourcePath:t.sourcePath,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:n,isUsed:r,isTypeUsed:n,isValueUsed:t.kind==="side-effect"||!n&&t.used,references:[]}}function vn(e,t,n){let r=Ke(e,t);if(!r)return[];let i=hn(r.rootNode),s=new Map;for(let a of i){let c=s.get(he(a.importedName,a.localName));c?c.push(a.position):s.set(he(a.importedName,a.localName),[a.position])}let o=[];return n.forEach((a,c)=>{let l=s.get(he(a.importedName,a.localName??a.importedName))?.shift();l&&o.push({...l,id:String(c),file:t})}),o}function hn(e){let t=[];for(let n of e.descendantsOfType("use_declaration")){let r=n.namedChildren.find(i=>i.type!=="visibility_modifier");r&&t.push(...ee(r,""))}return t.filter(n=>n.importedName!=="*")}function ee(e,t){switch(e.type){case"identifier":case"super":case"self":case"crate":return[{importedName:e.text,localName:e.text,position:ve(e,e.text)}];case"scoped_identifier":{let n=e.text.split("::").pop()??e.text;return[{importedName:n,localName:n,position:ve(e,n)}]}case"scoped_use_list":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=Ve(t,n.text);return r.namedChildren.flatMap(s=>ee(s,i))}case"use_list":return e.namedChildren.flatMap(n=>ee(n,t));case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);return!n||!r?[]:ee(n,t).map(i=>({...i,localName:r.text}))}case"use_wildcard":{let n=e.namedChild(0),r="*";return[{importedName:r,localName:r,position:ve(n??e,r)}]}default:return[]}}function ve(e,t){let n=Math.max(0,e.text.lastIndexOf(t));return{id:"",file:"",line:e.startPosition.row,column:e.startPosition.column+n+In(t)}}function In(e){return Math.max(0,Math.min(e.length-1,1))}function he(e,t){return`${e}\0${t}`}import{spawnSync as Ie}from"child_process";import{existsSync as Ce}from"fs";import{fileURLToPath as Cn}from"url";var De=15e3,Me=8;function Et(e,t={}){let n=t.status??dt,r=xn(e,n),i=Pn(e,n),s=wn(e,n),o=t.referenceResolver||t.calleeResolver||t.signatureResolver||!Dn(t)?null:St(e,n,{fallbackReferenceResolver:r,fallbackCalleeResolver:i,fallbackSignatureResolver:s}),a=t.referenceResolver??o??r,c=t.calleeResolver??o??i,l=t.signatureResolver??o??s,m=t.importUsageResolver??xt(t.sourceImportUsageResolver??Mn(),t.importDefinitionResolver??o),f=t.calleeSymbolResolver,d=t.sourceZeroCalleeOracle,R=t.scipOccurrenceCalleeOracle,p=new Map,S=new Map,h=null,v=null,M=()=>(h??=n(e),h),w=()=>{let y=M();return y.dependencyAvailable?v??y:y},b=y=>{if(y.length===0)return new Map;let u=z(y);try{let g=a.referencesForDefinitions(u),I=M();return v=te(I,g),g.available?new Map(g.references):V(u,g.references)}catch(g){let I=M();return v=W(I,g),L(u)}},D=y=>{if(y.length===0)return new Map;let u=z(y),g=u.filter(Pt);if(g.length===0)return O(u);let I=new Map,k=Tt(g,R),A=[];for(let C of g)S.has(C.symbolId)?I.set(C.symbolId,S.get(C.symbolId)??[]):k.has(C.symbolId)?I.set(C.symbolId,k.get(C.symbolId)??[]):wt(C,d)?I.set(C.symbolId,[]):A.push(C);if(A.length===0)return N(u,I,void 0);try{let C=c.calleesForDefinitions(A),F=M();v=te(F,C);let T=N(A,C.callees,f);for(let[j,se]of T)I.set(j,se);return N(u,I,void 0)}catch(C){let F=M();return v=W(F,C),O(u)}},P=(y,u)=>{let g=z(y),I=z(u),k=I.filter(Pt),A=new Map,C=Tt(k,R),F=[];for(let T of k)C.has(T.symbolId)?A.set(T.symbolId,C.get(T.symbolId)??[]):wt(T,d)?A.set(T.symbolId,[]):F.push(T);if(g.length===0&&F.length===0)return{references:L(g),callees:N(I,A,void 0)};try{let T=o?o.referencesAndCalleesForDefinitions(g,F):Fn(a,c,{referenceDefinitions:g,calleeDefinitions:F}),j=M();v=te(j,T);let se=T.available?new Map(T.references):V(g,T.references);for(let[oe,ae]of T.callees)A.set(oe,ae);let ke=N(I,A,f);for(let[oe,ae]of ke)S.set(oe,ae);return{references:se,callees:ke}}catch(T){let j=M();return v=W(j,T),{references:L(g),callees:O(I)}}},x=y=>{if(y.length===0)return new Map;let u=z(y);try{let g=l.signaturesForDefinitions(u),I=M();return v=te(I,g),At(u,g.signatures)}catch(g){let I=M();return v=W(I,g),ne(u)}};return{language:"rust",availability:w,dispose:()=>{o?.dispose()},importUsage:y=>{let u=p.get(y);if(u)return u;try{let g=m.importUsage(y);return p.set(y,g),g}catch(g){let I=M();return v=W(I,g),[]}},referencesFor:y=>b([y]).get(y.symbolId)??[],referencesForDefinitions:b,referencesAndCalleesForDefinitions:P,calleesFor:y=>D([y]).get(y.symbolId)??[],calleesForDefinitions:D,signatureFor:y=>x([y]).get(y.symbolId)??null}}function te(e,t){let n={dependencyAvailable:e.dependencyAvailable,resolvedBinary:t.resolvedBinary??e.resolvedBinary,...e.note?{note:e.note}:{}};return t.available?{available:!0,...n}:{available:!1,reason:t.reason,...n}}function W(e,t){return{available:!1,dependencyAvailable:e.dependencyAvailable,resolvedBinary:e.resolvedBinary,...e.note?{note:e.note}:{},reason:t instanceof Error?t.message:String(t)}}function Dn(e){if(e.usePersistentSession!==void 0)return e.usePersistentSession;let t=process.env.SCIP_RUST_SEMANTIC_SESSION;return t!=="0"&&t!=="false"}function Mn(){return{importUsageFacts:()=>({usage:[],positions:[]})}}function z(e){return e.map(t=>{let n=t;return{...t,leaf:typeof n.leaf=="string"?n.leaf:tt(t.symbol),parentTypeName:n.parentTypeName??null,isFunctionLike:typeof n.isFunctionLike=="boolean"?n.isFunctionLike:nt(t.symbol),isTypeLike:n.isTypeLike??!1,kind:n.kind??null,documentation:n.documentation??null,enclosingSymbol:n.enclosingSymbol??null}})}function Pt(e){return e.isFunctionLike}function wt(e,t){if(!t)return!1;try{return t(e)}catch{return!1}}function Tt(e,t){if(!t||e.length===0)return new Map;try{return t(e)}catch{return new Map}}function xn(e,t){return{referencesForDefinitions:n=>Tn(e,t,n)}}function Pn(e,t){return{calleesForDefinitions:n=>En(e,t,n)}}function wn(e,t){return{signaturesForDefinitions:n=>An(e,t,n)}}function Tn(e,t,n){let r=t(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:we(r),references:L(n)};let i=xe();if(!Ce(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,references:L(n)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,De),o=re(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),a=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,Me),c=re(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:n.length,includeReferences:!0}),m={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...n],requestTimeoutMs:s,...o>0?{referenceRetryTimeoutMs:o}:{},diagnosticsTimeoutMs:c,settleDelayMs:l,concurrency:a},f=Ie(process.execPath,[i],{cwd:e,input:JSON.stringify(m),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(n.length,gt(s,m.referenceRetryTimeoutMs),a)}),d=Te(f.stdout);if(d)return{...Pe(d),resolvedBinary:r.resolvedBinary,references:V(n,new Map(d.references),new Set(d.incompleteReferenceSymbolIds??[]))};let R=f.error instanceof Error?f.error.message:f.stderr.trim()||`Rust semantic worker exited with status ${f.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:R,references:L(n)}}function En(e,t,n){let r=t(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:we(r),callees:O(n)};let i=xe();if(!Ce(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,callees:O(n)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,De),o=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,Me),a=re(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),c=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:n.length,includeReferences:!1,includeCallees:!0}),l={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...n],requestTimeoutMs:s,diagnosticsTimeoutMs:a,settleDelayMs:c,concurrency:o,includeReferences:!1,includeCallees:!0},m=Ie(process.execPath,[i],{cwd:e,input:JSON.stringify(l),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(n.length,s,o)}),f=Te(m.stdout);if(f)return{...Pe(f),resolvedBinary:r.resolvedBinary,callees:N(n,new Map(f.callees??[]),void 0)};let d=m.error instanceof Error?m.error.message:m.stderr.trim()||`Rust semantic worker exited with status ${m.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:d,callees:O(n)}}function An(e,t,n){let r=t(e);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:we(r),signatures:ne(n)};let i=xe();if(!Ce(i))return{available:!1,resolvedBinary:r.resolvedBinary,reason:`Rust semantic worker was not found at ${i}. Run npm run build before using built semantic Rust queries.`,signatures:ne(n)};let s=B(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,De),o=B(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,Me),a=re(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),c=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:n.length,includeReferences:!1,includeCallees:!1,includeSignatures:!0}),l={projectRoot:e,rustAnalyzerBinary:r.resolvedBinary,definitions:[...n],requestTimeoutMs:s,diagnosticsTimeoutMs:a,settleDelayMs:c,concurrency:o,includeReferences:!1,includeCallees:!1,includeSignatures:!0},m=Ie(process.execPath,[i],{cwd:e,input:JSON.stringify(l),encoding:"utf8",maxBuffer:50*1024*1024,timeout:Z(n.length,s,o)}),f=Te(m.stdout);if(f)return{...Pe(f),resolvedBinary:r.resolvedBinary,signatures:At(n,new Map(f.signatures??[]))};let d=m.error instanceof Error?m.error.message:m.stderr.trim()||`Rust semantic worker exited with status ${m.status??"unknown"}.`;return{available:!1,resolvedBinary:r.resolvedBinary,reason:d,signatures:ne(n)}}function Fn(e,t,n){let r=n.referenceDefinitions.length>0?e.referencesForDefinitions(n.referenceDefinitions):{available:!0,references:L(n.referenceDefinitions)},i=n.calleeDefinitions.length>0?t.calleesForDefinitions(n.calleeDefinitions):{available:!0,callees:O(n.calleeDefinitions)},s={resolvedBinary:r.resolvedBinary??i.resolvedBinary,references:r.references,callees:i.callees};return r.available&&i.available?{available:!0,...s}:{available:!1,reason:(r.available?void 0:r.reason)??(i.available?void 0:i.reason)??"Rust semantic resolution was unavailable.",...s}}function L(e){return new Map(e.map(t=>[t.symbolId,[]]))}function O(e){return new Map(e.map(t=>[t.symbolId,[]]))}function ne(e){return new Map(e.map(t=>[t.symbolId,null]))}function N(e,t,n){let r=0,i=0;return E("rust.semantic.callees.complete-map",()=>{let s=new Map;for(let o of e){let a=t.get(o.symbolId)??[];a.length>0&&(r+=1),i+=a.length,s.set(o.symbolId,a.map(c=>({...c,symbol:n?n(c):c.symbol})))}return s},()=>({definitions:e.length,rows:r,callees:i,resolveSymbols:!!n}))}function At(e,t){return new Map(e.map(n=>[n.symbolId,t.get(n.symbolId)??null]))}function xe(){return Cn(new URL("./rust-semantic-worker.js",import.meta.url))}function Pe(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function we(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function Te(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(typeof n.available!="boolean"||!Array.isArray(n.references)||n.available===!1&&typeof n.reason!="string"||n.available===!0&&n.reason!==void 0)return null;let r={references:n.references,incompleteReferenceSymbolIds:Array.isArray(n.incompleteReferenceSymbolIds)?n.incompleteReferenceSymbolIds.filter(i=>typeof i=="number"):void 0,callees:Array.isArray(n.callees)?n.callees:void 0,signatures:Array.isArray(n.signatures)?n.signatures:void 0};return n.available===!0?{available:!0,...r}:{available:!1,reason:String(n.reason),...r}}catch{return null}}function B(e,t){return ut(e)??t}function re(e,t){if(!e)return t;let n=Number(e);return Number.isInteger(n)&&n>=0?n:t}import{existsSync as _n}from"fs";import{deserializeSCIP as kn,SymbolRole as Un}from"@c4312/scip";var Ee=new WeakMap;function _t(e,t){let n=t.filter(Ln);if(n.length===0)return new Map;let r=!1,i=0,s=0;return E("rust.scip-occurrence.callees",()=>{let o=Bn(e);if(r=!!o,!o)return new Map;let a=new Map;for(let c of n){let l=On(e,o,c);l!==null&&(a.set(c.symbolId,l),i+=1,s+=l.length)}return a},()=>({definitions:t.length,candidates:n.length,indexAvailable:r,resolvedDefinitions:i,resolvedCallees:s}))}function Ln(e){return!(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||!e.isFunctionLike||e.leaf==="main"||Se(e.symbol))}function On(e,t,n){let r=G(e,n.relativePath);if(!r||r.language!=="rust")return null;let i=r.callables.find(l=>l.startLine!==n.startLine||l.endLine!==n.endLine?!1:l.name===n.leaf||n.leaf.endsWith(l.name)||l.name.endsWith(n.leaf));if(!i)return null;let s=r.callSites.filter(l=>l.line>=i.startLine&&l.line<=i.endLine);if(s.length===0)return null;let o=(t.occurrencesByFile.get(n.relativePath)??[]).filter(l=>l.line>=i.startLine&&l.line<=i.endLine&&l.callee.symbol!==n.symbol);if(o.some(l=>l.traitImplMember)||!Nn(s,o))return null;let a=[],c=new Set;for(let l of o){let m=`${l.callee.symbol}\0${l.callee.file}\0${l.callee.line}`;c.has(m)||(c.add(m),a.push(l.callee))}return a}function Nn(e,t){let n=Ft(e),r=Ft(t);if(n.size!==r.size)return!1;for(let[i,s]of n)if(r.get(i)!==s)return!1;return!0}function Ft(e){let t=new Map;for(let n of e){let r=n.calleeLeaf??n.leaf;if(!r)continue;let i=`${n.line}\0${r}`;t.set(i,(t.get(i)??0)+1)}return t}function Bn(e){if(Ee.has(e))return Ee.get(e)??null;let t=jn(e);return Ee.set(e,t),t}function jn(e){if(!e.generation.indexPath||!_n(e.generation.indexPath))return null;try{let t=K(e).filter(s=>s.symbol.startsWith("rust-analyzer ")&&s.relativePath.endsWith(".rs")&&s.isFunctionLike),n=new Map(t.map(s=>[s.symbol,s])),r=kn(Le(e.generation.indexPath,{inputKind:"SCIP occurrence-callee index",maxBytes:Ue})),i=new Map;for(let s of r.documents??[]){let o=s.relativePath;if(!o||!o.endsWith(".rs")||e.isIgnored(o))continue;let a=[];for(let c of s.occurrences??[]){if(!c.symbol||(c.symbolRoles&Un.Definition)!==0)continue;let l=n.get(c.symbol);if(!l)continue;let m=c.range?.[0];Number.isInteger(m)&&a.push({line:m,leaf:l.leaf,traitImplMember:Se(l.symbol),callee:{symbol:l.symbol,file:l.relativePath,line:l.startLine,callsiteLine:m}})}i.set(o,a)}return{occurrencesByFile:i}}catch{return null}}var ie=class{sessions=new WeakMap;getOrCreate(t,n,r){let i=qn(t,n),s=this.sessions.get(t);s||(s=new Map,this.sessions.set(t,s));let o=s.get(i);if(o)return o.hits+=1,o.lastUsedAtMs=Date.now(),o.provider;let a=Date.now(),c=r();return s.set(i,{key:i,language:n,projectRoot:t.config.projectRoot,provider:c,createdAtMs:a,lastUsedAtMs:a,hits:1}),c}sessionsFor(t){return[...this.sessions.get(t)?.values()??[]]}clear(t){let n=this.sessions.get(t);if(n)for(let r of n.values())r.provider.dispose?.();this.sessions.delete(t)}};function qn(e,t){return`${e.config.projectRoot}:${t}-workspace`}var kt=new ie;$e({name:"semantic-provider",groups:["semantic-provider"],clearAll:e=>kt.clear(e)});function H(e,t){let n=_(t)??"typescript";return kt.getOrCreate(e,n,()=>n==="rust"?Et(e.config.projectRoot,{sourceImportUsageResolver:{importUsageFacts:r=>Mt(e,r)},calleeSymbolResolver:Dt(e),sourceZeroCalleeOracle:r=>Wn(e,r),scipOccurrenceCalleeOracle:r=>_t(e,r)}):Ct(e,t))}function _(e){return e?Ge(e)==="rust"?"rust":Qe(e)?"typescript":null:"typescript"}function Wn(e,t){let n=G(e,t.relativePath);if(!n||n.language!=="rust")return!1;let r=n.callables.find(i=>i.startLine===t.startLine&&i.endLine===t.endLine&&i.name===t.leaf)??n.callables.find(i=>i.startLine===t.startLine&&i.endLine===t.endLine);return r?!n.callSites.some(i=>i.line>=r.startLine&&i.line<=r.endLine):!1}import{resolve as Di}from"path";var zn=/^[A-Za-z_][A-Za-z0-9_]*$/,Ut=/\bDefault::default\b/g,Hn=/^\.\.\s*Default::default\b/;function Lt(e,t){let n=new Map,r=new Map;for(let i of t){let s=Ae(e,i,r);s!==null&&n.set(i.symbolId,s)}return n}function Ae(e,t,n=new Map){let r=Jn(t.symbol);if(!r)return null;let i=it(e,[t.symbolId]);if(i.length===0)return null;let s=new RegExp(`(^|[^A-Za-z0-9_])${pe(r)}::default\\b`,"g"),o=new RegExp(`(^|[^A-Za-z0-9_])${pe(r)}\\s*$`),a=$n(e,t.symbolId),c=[];for(let l of i){let m=Yn(e,l.relative_path,n);if(m===null)return null;let f=m.split(/\r?\n/),d=0,R=[],p=0;for(let S=l.chunk_start;S<=l.chunk_end&&S<f.length;S+=1){let v=f[S]??"",M=new Set;s.lastIndex=0;let w;for(;w=s.exec(v);)c.push({file:l.relative_path,line:S,column:w.index+w[1].length+r.length+2}),p+=1;for(let b=0;b<v.length;b+=1){let D=Hn.exec(v.slice(b));if(D){if(a&&R.includes(d)){let x=b+D[0].lastIndexOf("default");c.push({file:l.relative_path,line:S,column:x}),M.add(x),p+=1}b+=D[0].length-1;continue}let P=v[b];if(P==="{"){let x=o.test(v.slice(0,b));d+=1,x&&R.push(d);continue}if(P==="}")for(d=Math.max(0,d-1);R.length>0&&R[R.length-1]>d;)R.pop()}for(Ut.lastIndex=0;w=Ut.exec(v);){let b=w.index+9;if(!M.has(b))return null}}if(p===0)return null}return mt(c)}function $n(e,t){return e.get("SELECT 1 AS present FROM mentions WHERE symbol_id = ? AND role = 1 LIMIT 1",t)?.present===1}function Jn(e){let t=/impl#\[([^\]]+)\]\[Default\]default\(\)\./.exec(e)?.[1]??null;return!t||!zn.test(t)?null:t}function Yn(e,t,n){if(n.has(t))return n.get(t)??null;let r=e.get("SELECT text FROM documents WHERE relative_path = ?",t),i=typeof r?.text=="string"?r.text:Gn(e,t);return n.set(t,i),i}function Gn(e,t){try{return ze(e.config.projectRoot,t,{inputKind:"indexed Rust source file"})}catch(n){if(!He(n))throw n;return null}}function Ot(e){let t=new Map;for(let n of e){let r=t.get(n.relativePath)??[];r.push(n),t.set(n.relativePath,r)}return t}var Kn="typescript-import-usage-v1",Vn="typescript-signatures-v1",Fe=le("semantic-prefetched-callees",{clearGroups:["whole-project","source-file","semantic-provider"]}),Nt=fe({kind:"semantic-import-usage",invalidation:q("semantic-import-usage"),serialize:e=>JSON.stringify(e),deserialize:$t}),Bt=fe({kind:"semantic-signatures",invalidation:q("semantic-signatures"),serialize:e=>JSON.stringify(e),deserialize:fr}),jt=me({kind:"typescript-import-usage",invalidation:q("typescript-import-usage"),serialize:e=>JSON.stringify(e),deserialize:$t}),qt=me({kind:"typescript-signatures",invalidation:q("typescript-signatures"),serialize:e=>JSON.stringify(e),deserialize:pr});var Zn=le("typescript-reference-map",{clearGroups:["whole-project"]});function Qn(e){return Zn.get(e,()=>{let t=Y(e);if(!t)return null;let n=K(e).filter(i=>_(i.relativePath)==="typescript"),r=et(e,n,i=>H(e,i));return r?{projectFingerprint:t,references:r.references,files:r.files,cacheHits:r.cacheHits,cacheMisses:r.cacheMisses,computedFiles:r.computedFiles}:null})}function _e(e){let t=new Map,n=new Set;return{capability:(r,i)=>Jt(e,r,i),importUsage:r=>er(e,r),references:r=>tr(e,r),materializeReferences:(r,i)=>zt(e,r,t,n,i),callerMap:r=>nr(e,r,t,n),calleeMap:r=>ar(e,r),signature:r=>ur(e,r)}}function Xn(e,t){if(t.size===0)return;let n=Fe.get(e,()=>new Map);for(let[r,i]of t)n.set(r,[...i])}function ki(e,t){if(!Fe.has(e))return{hits:[],misses:[...t]};let n=Fe.get(e,()=>new Map),r=[],i=[];for(let s of t)n.has(s.symbolId)?r.push({definition:s,callees:n.get(s.symbolId)??[]}):i.push(s);return{hits:r,misses:i}}function Ui(e,t){return _e(e).importUsage(t)}function er(e,t){if(_(t)==="typescript"){let s="fallback",o=0,a=0,c=0,l=0;return E("typescript.import-usage.materialize",()=>{let m=de(e,t,Kn);if(m?.key){o=1;let d=jt.read(e,t,m.key);if(d)return s="hit",a=1,d;c=1;let R=U(e,t);if(!R)return s="unavailable",[];let p=R.importUsage(t);return jt.write(e,t,m.key,p),s="computed",p}l=1;let f=U(e,t);return f?(s="direct-fallback",f.importUsage(t)):(s="unavailable",[])},()=>({state:s,eligible:o,cacheHits:a,cacheMisses:c,fallbacks:l}))}let n=Ht(e,"semantic-import-usage",t);if(n){let s=Nt.read(e,t,n);if(s)return s}let r=U(e,t);if(!r)return[];let i=r.importUsage(t);return n&&Nt.write(e,t,n,i),i}function Li(e,t){return _e(e).references(t)}function tr(e,t){let n=Ae(e,t);if(n)return n;let r=pt(e,t);if(r)return r;let i=U(e,t.relativePath);return i?i.referencesFor(t):[]}function nr(e,t,n=new Map,r=new Set){let i=new Map,s=zt(e,t,n,r),o=0;return E("semantic.callers.from-references",()=>{for(let a of t)o+=sr(e,i,a,n.get(a.symbolId)??[])},()=>({definitions:t.length,materialized:s.definitions,inMemoryHits:s.inMemoryHits,incompleteInMemoryHits:s.incompleteInMemoryHits,resultRows:i.size,callerFiles:o})),i}function zt(e,t,n,r,i={}){let s=Y(e),o=[],a=[],c=[],l=0,m=0,f=0,d=0,R=0,p=0,S=0,h=0,v=0,M=0,w=0,b=0,D=[],P=new Map,x=t.filter(u=>_(u.relativePath)==="typescript"&&!n.has(u.symbolId)&&!r.has(u.symbolId)),y=x.length>0?Qn(e):null;if(y){v=x.length,M=y.cacheHits,w=y.cacheMisses,b=y.computedFiles;for(let u of x)n.set(u.symbolId,y.references.get(u.symbolId)??[])}if(E("semantic.references.cache-scan",()=>{for(let[u,g]of Ot(t)){let I=[];for(let C of g)n.has(C.symbolId)?m+=1:r.has(C.symbolId)?h+=1:I.push(C);if(I.length===0){S+=1;continue}let k=rr(e,s,u);if(!k){for(let C of I)_(C.relativePath)||(l+=1),c.push(C);continue}p+=1;let A=Je(e,u,k);for(let C of I){let F=A.get(C.symbol)??null;if(F!==null){let T=or(F);if(T){f+=1,n.set(C.symbolId,T);continue}d+=1}a.push({definition:C,cacheFingerprint:k})}}},()=>({definitions:t.length,skippedUnsupportedLanguage:l,cacheHits:f,parseFailures:d,misses:a.length,unkeyed:c.length,inMemoryHits:m,incompleteInMemoryHits:h,fullyInMemoryFiles:S,cacheReadFiles:p})),a.length>0||c.length>0){D=[...c,...a.map(u=>u.definition)],P=E("semantic.references.compute-misses",()=>{let u=ir(e,D,i);return R=u.size,u},()=>({definitions:D.length,misses:a.length,unkeyed:c.length,rows:R}));for(let u of D)P.has(u.symbolId)?(n.set(u.symbolId,P.get(u.symbolId)??[]),r.delete(u.symbolId)):r.add(u.symbolId);for(let{definition:u,cacheFingerprint:g}of a)P.has(u.symbolId)&&Jt(e,"semantic-references",u.relativePath).available&&o.push({relativePath:u.relativePath,symbol:u.symbol,projectFingerprint:g,payload:JSON.stringify(P.get(u.symbolId)??[])})}return o.length>0&&E("semantic.references.cache-write",()=>Ye(e,o),()=>({entries:o.length})),P.size>0&&Xe(e,D,P,u=>H(e,u)),{definitions:t.length,inMemoryHits:m,incompleteInMemoryHits:h,cacheHits:f,misses:a.length,unkeyed:c.length,skippedUnsupportedLanguage:l,parseFailures:d,computed:R,incomplete:r.size,cacheWrites:o.length,fragmentDefinitions:v,fragmentCacheHits:M,fragmentCacheMisses:w,fragmentComputedFiles:b}}function rr(e,t,n){if(!t)return null;let r=_(n);return r==="typescript"?t:r==="rust"?ue(JSON.stringify({kind:"semantic-references",language:r,engine:ye(e.config.projectRoot),projectFingerprint:t})):null}function ir(e,t,n={}){let r=ce(),i=new Map,s=0,o=0,a=0,c=0,l=0,m=0,f=0,d=0,R=0;return E("semantic.references.provider-loop",()=>{let p=Lt(e,t),S=ft(e,t),h=new Map,v=n.prefetchCallees?new Map:null,M=[];for(let b of t){let D,P=()=>(D??=U(e,b.relativePath),D);if(v){let g=P();if(g?.referencesAndCalleesForDefinitions){let I=v.get(g);I?I.push(b):v.set(g,[b]),R+=1}}let x=p.get(b.symbolId);if(x){a+=1,c+=x.length,$(i,b.symbolId,x,r,g=>{f+=1,d+=g});continue}let y=S.get(b.symbolId);if(y){l+=1,m+=y.length,$(i,b.symbolId,y,r,g=>{f+=1,d+=g});continue}let u=P();if(!u){r&&(o+=1);continue}if(r&&(s+=1),u.referencesForDefinitions){let g=h.get(u);g?g.push(b):h.set(u,[b])}else M.push({provider:u,definition:b})}let w=new Set;if(v)for(let[b,D]of v){if(!b.referencesAndCalleesForDefinitions)continue;let P=h.get(b)??[],x=b.referencesAndCalleesForDefinitions(P,D);w.add(b),Xn(e,x.callees);for(let y of P){if(!x.references.has(y.symbolId))continue;let u=x.references.get(y.symbolId)??[];$(i,y.symbolId,u,r,g=>{f+=1,d+=g})}}for(let[b,D]of h){if(w.has(b))continue;let P=b.referencesForDefinitions(D);for(let x of D){if(!P.has(x.symbolId))continue;let y=P.get(x.symbolId)??[];$(i,x.symbolId,y,r,u=>{f+=1,d+=u})}}for(let{provider:b,definition:D}of M){let P=b.referencesFor(D);$(i,D.symbolId,P,r,x=>{f+=1,d+=x})}return i},()=>({definitions:t.length,providerHits:s,providerMisses:o,rustDefaultFastPathRows:a,rustDefaultFastPathReferences:c,rustScipOccurrenceFastPathRows:l,rustScipOccurrenceFastPathReferences:m,prefetchCalleeDefinitions:R,definitionsWithReferences:f,referenceCount:d,rows:i.size}))}function $(e,t,n,r,i){e.set(t,n),r&&n.length>0&&i(n.length)}function sr(e,t,n,r){let i=0;for(let s of r){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let o=t.get(n.symbolId);o||(o=new Set,t.set(n.symbolId,o));let a=o.size;o.add(s.file),o.size!==a&&(i+=1)}return i}function or(e){try{return JSON.parse(e)}catch{return null}}function Oi(e,t){return _e(e).calleeMap(t)}function ar(e,t){let n=ce(),r=new Map,i=0,s=0,o=0,a=0;return E("semantic.callees.provider-loop",()=>{let c=new Map,l=[];for(let m of t){let f=U(e,m.relativePath);if(!f){n&&(s+=1);continue}n&&(i+=1);let d=m;if(f.calleesForDefinitions){let R=c.get(f);R?R.push(d):c.set(f,[d])}else l.push({provider:f,definition:d})}for(let[m,f]of c)for(let d of lr(f)){let R=m.calleesForDefinitions(d);for(let p of d){let S=R.get(p.symbolId)??[];Wt(r,p.symbolId,S,n,h=>{o+=1,a+=h})}}for(let{provider:m,definition:f}of l){let d=m.calleesFor(f);Wt(r,f.symbolId,d,n,R=>{o+=1,a+=R})}return r},()=>({definitions:t.length,providerHits:i,providerMisses:s,definitionsWithCallees:o,calleeCount:a,rows:r.size}))}var cr=256;function lr(e){let t=new Map;for(let i of e){let s=t.get(i.relativePath);s?s.push(i):t.set(i.relativePath,[i])}let n=[],r=[];for(let i of t.values())r.length>0&&r.length+i.length>cr&&(n.push(r),r=[]),r.push(...i);return r.length>0&&n.push(r),n}function Wt(e,t,n,r,i){n.length>0&&(e.set(t,n),r&&i(n.length))}function ur(e,t){if(_(t.relativePath)==="typescript"){let o="fallback",a=0,c=0,l=0,m=0;return E("typescript.signature.materialize",()=>{let f=de(e,t.relativePath,Vn);if(f?.key){a=1;let R=qt.read(e,t.relativePath,f.key)??{};if(Object.prototype.hasOwnProperty.call(R,t.symbol))return o="hit",c=1,R[t.symbol]??null;l=1;let p=U(e,t.relativePath);if(!p)return o="unavailable",null;let S=p.signatureFor(t);return qt.write(e,t.relativePath,f.key,{...R,[t.symbol]:S}),o="computed",S}m=1;let d=U(e,t.relativePath);return d?(o="direct-fallback",d.signatureFor(t)):(o="unavailable",null)},()=>({state:o,eligible:a,cacheHits:c,cacheMisses:l,fallbacks:m}))}let n=Ht(e,"semantic-signatures",t.relativePath),r=mr(t);if(n){let o=Bt.read(e,r,n);if(o)return o.signature}let i=U(e,t.relativePath);if(!i)return null;let s=i.signatureFor(t);return n&&Bt.write(e,r,n,{signature:s}),s}function Ht(e,t,n){let r=Y(e);if(!r)return null;let i=_(n);return i!=="rust"?null:ue(JSON.stringify({kind:t,language:i,engine:ye(e.config.projectRoot),projectFingerprint:r}))}function mr(e){return`${e.relativePath}\0${e.symbol}`}function $t(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function fr(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t.signature;return n!==null&&typeof n!="string"?null:{signature:n}}catch{return null}}function pr(e){try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;for(let n of Object.values(t))if(n!==null&&typeof n!="string")return null;return t}catch{return null}}function Jt(e,t,n){let r=_(n);if(!r)return{slot:t,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript or Rust files"};try{return{slot:t,language:r,...H(e,n).availability()}}catch(i){return{slot:t,language:r,available:!1,reason:i instanceof Error?i.message:String(i)}}}function U(e,t){if(!_(t))return null;let n=H(e,t);return n.availability().available?n:null}export{Ot as a,H as b,_ as c,_e as d,ki as e,Ui as f,Li as g,ir as h,Oi as i};
2
- //# sourceMappingURL=chunk-ANLNLY66.js.map
@@ -1,2 +0,0 @@
1
- import{b as v}from"./chunk-BOJ5SVE2.js";import{c as h}from"./chunk-2BMSSRBH.js";import{a as p}from"./chunk-BJWFVAA5.js";import{f as g,h as y}from"./chunk-U3SXIMII.js";import{d as b}from"./chunk-C7C6AKAT.js";function x(i,n={}){let{limit:f=20,scope:l,minFanIn:c=2,minFanOut:m=2,scanLimit:o}=n,a=new h(i),r=v(a.productionCallableDefinitions({scope:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof o=="number"&&o>0}),o),s=n.semantic!==!1,d=y(i,r,{limit:500,semantic:s,semanticEvidence:p});return r.map(e=>S(i,e,s,d.get(e.symbolId)??[])).filter(e=>e.fanIn>=c&&e.fanOut>=m).sort((e,t)=>t.score-e.score||t.fanIn-e.fanIn).slice(0,f)}function B(i,n={}){return x(i,n)}function S(i,n,f,l){let c=[...new Set(l.map(e=>e.file))].sort(),m=[...new Set(l.filter(e=>e.source!=="caller-map-inversion"||e.callEvidence==="scip-chunk").map(e=>e.file))].sort(),o=new Map;for(let e of g(i,n,{limit:500,semantic:f,semanticEvidence:p})){if(e.file===n.relativePath)continue;let t=`${e.symbol}|${e.file}`;o.has(t)||o.set(t,{symbol:e.symbol,shortName:b(e.symbol),file:e.file,evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source})}let a=[...o.values()].sort((e,t)=>e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)),r=c.length,s=a.length,d=r*s,u=a.filter(e=>e.evidenceStrength==="candidate").map(e=>e.symbol);return{symbol:n.symbol,shortName:b(n.symbol),fanIn:r,fanOut:s,callerFiles:c,candidateCallerFiles:m,externalCallees:a.map(({symbol:e,shortName:t,file:C})=>({symbol:e,shortName:t,file:C})),externalCalleeEvidence:a,candidateExternalCallees:u,inputBasis:"mixed-static-call-or-reference-evidence",score:d,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${r} incoming file(s) reference this symbol`,`${s} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${d} (fan-in * fan-out)`,`${m.length} incoming file(s) and ${u.length} outgoing target(s) rely on candidate rather than exact call evidence`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{x as a,B as b};
2
- //# sourceMappingURL=chunk-AX7IDVFT.js.map
@@ -1,2 +0,0 @@
1
- import{a as u,c as g}from"./chunk-KMVGRIO2.js";function v(e){let r=[],i=[],s=[];for(let t of e.primitiveGroups)t.values.length!==0&&f(t.bucket,i,s).push(`${t.reasonPrefix}: ${t.values.join(", ")}`);for(let t of e.nameGroups)p(t.names,t.label,e.genericWords,e.stripPrefixes??[],r,f(t.fallbackBucket,i,s));let l=r.length>0,c=i.length>0,o=s.length>0,a=l?c||o?"mixed":"domain-behavior":o?"shared-abstraction":"generic-workflow-scaffolding";return{actionTier:a==="domain-behavior"||a==="mixed"?"signal":"support",evidenceClass:a,reasons:[...r,...s,...i].slice(0,6),recommendation:e.recommendation(a)}}function x(e,r){if(e.size===0||r.size===0)return 0;let l=u(e,r).size/Math.min(e.size,r.size)*Math.min(1,Math.min(e.size,r.size)/(.35*Math.max(e.size,r.size)));return Math.max(g(e,r),l)}function b(e,r){let i=Object.fromEntries(e.map(s=>[s.name,s.count]));for(let s of r)if(Object.entries(s.min).every(([c,o])=>(i[c]??0)>=o))return{pass:!0,reason:s.reason,counts:i};return{pass:!1,reason:"shared tokens did not meet calibrated overlap thresholds",counts:i}}function P(e,r,i){let s=r.map(n=>{let t=n.value(e),d=n.weightedValue?n.weightedValue(e,t):t;return{axis:n,value:t,weighted:d,qualifies:n.qualifies?n.qualifies(e,t):t>0}}),l=s.filter(n=>n.qualifies&&n.axis.reason).map(n=>n.axis.reason(e,n.value)),c=s.filter(n=>n.qualifies&&n.axis.dominantEligible!==!1).sort((n,t)=>t.weighted-n.weighted)[0],o=c&&c.weighted>0?c.axis.axis:i,a=[...new Set(s.filter(n=>n.qualifies).map(n=>n.axis.axis).concat(l.length>0?[]:[o]))];return{dominantPressure:o,pressureKinds:a,reasons:l}}function A(e,r){return[...e].filter(i=>i.startsWith(r)).map(i=>i.slice(r.length)).sort()}function E(e){return[...e].sort()}function p(e,r,i,s,l,c){let o=[],a=[];for(let n of e)m(n,s).filter(d=>!i.has(d)).length>0?o.push(n):a.push(n);o.length&&l.push(`${r} has domain term(s): ${o.slice(0,6).join(", ")}`),a.length&&c.push(`${r} is generic workflow: ${a.slice(0,6).join(", ")}`)}function m(e,r){let i=e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2");for(let s of r)i=i.replace(s,"");return i.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function f(e,r,i){return e==="generic"?r:i}export{v as a,x as b,b as c,P as d,A as e,E as f};
2
- //# sourceMappingURL=chunk-B3X6KU75.js.map
@@ -1,3 +0,0 @@
1
- import{a as fe}from"./chunk-OHIV323X.js";import{a as Ce}from"./chunk-T6HRIROJ.js";import{a as ve}from"./chunk-Q5JRIHT3.js";import{a as ye}from"./chunk-6YTSKJJ3.js";import{a as xe}from"./chunk-SCPMZ73U.js";import{b as me}from"./chunk-4KBTHJLP.js";import{a as ge}from"./chunk-WLMP3OCW.js";import{a as he}from"./chunk-SSRFUQBD.js";import{b as de}from"./chunk-7ZLWLOGT.js";import{b as pe}from"./chunk-6O7FACKB.js";import{a as le}from"./chunk-OYKU4B3Y.js";import{a as be}from"./chunk-NODFZ6ED.js";import{a as ue}from"./chunk-E4PKTOL3.js";import{a as ce}from"./chunk-EHVEIEQN.js";import{a as ne}from"./chunk-BBB5FBX4.js";import{b as ae}from"./chunk-GG45PK4S.js";import{b as oe}from"./chunk-OIOC5EHF.js";import{b as se}from"./chunk-XDAUYDFT.js";import{a as _,b as Z}from"./chunk-OIAPEKMT.js";import{c as te}from"./chunk-KVQCECPR.js";import{a as ee,b as R}from"./chunk-XKXTR6ZI.js";import{a as re}from"./chunk-EPX6NQN6.js";import{f as ie}from"./chunk-ZFVPWH62.js";import{q as W}from"./chunk-SYVJEEUJ.js";import{a as J}from"./chunk-TAA7HXHE.js";import{f as B,h as $}from"./chunk-NJQISBL4.js";import{a as Q}from"./chunk-RBAD4GJ2.js";import{A as Y,E as X}from"./chunk-ZLMXIQLC.js";import{h as M}from"./chunk-ETC674NS.js";import{Ba as U,Ca as K}from"./chunk-JZ2A7LDM.js";function Se(e){let r;try{r=R(e,["rev-parse","HEAD"]).trim()}catch{return null}return/^[0-9a-f]{40,64}$/u.test(r)?{head:r,branch:at(e),dirtyPaths:st(e)}:null}function at(e){try{let r=R(e,["rev-parse","--abbrev-ref","HEAD"]).trim();return r&&r!=="HEAD"?r:null}catch{return null}}function st(e){try{return R(e,["status","--porcelain"]).split(`
2
- `).filter(r=>r.length>0).length}catch{return 0}}import{readdirSync as ct}from"fs";import{basename as ut,join as we}from"path";function lt(e,r,t={}){let i=new Set(e),n=new Set(r),o=[...n].filter(c=>!i.has(c)).sort(),a=t.allowExtra?[]:[...i].filter(c=>!n.has(c)).sort();return{missing:o,extra:a}}function dt(e,r){let t=pt(e,r.file,r.keys);if(!t.ok)return{name:r.name,file:r.file,status:"unavailable",missing:[],extra:[],unavailableReason:t.reason};let i=bt(e.config.projectRoot,r.mustEqual),n=lt(t.keys,i,{allowExtra:r.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:r.name,file:r.file,status:o,missing:n.missing,extra:n.extra}}function He(e,r){return r.map(t=>dt(e,t))}function pt(e,r,t){return t.type==="markdown-list"?Ct(e,r,t.marker):mt(e,r,t)}function mt(e,r,t){if(!M(e,r))return{ok:!1,reason:`file not found: ${r}`};let n=Y(r);if(!n)return{ok:!1,reason:`unsupported file type for ${t.type} extraction: ${r}`};let o=X(e,r);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${r}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let a=t.type==="object-literal-keys"?ht(o,t.identifier):ft(o,t.identifier);return a===null?{ok:!1,reason:`no ${t.type==="object-literal-keys"?"object literal":"string array"} named "${t.identifier}" found in ${r}`}:{ok:!0,keys:a}}function Re(e){let r=e.childForFieldName("value");return r?r.type==="as_expression"||r.type==="satisfies_expression"?r.namedChild(0):r:null}function ht(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=Re(t);if(n?.type==="object")return gt(n)}return null}function gt(e){let r=new Set;for(let t of e.namedChildren)if(t.type==="pair"){let i=t.childForFieldName("key");i&&r.add(Le(i.text))}else t.type==="shorthand_property_identifier"&&r.add(t.text);return[...r].sort()}function ft(e,r){for(let t of e.rootNode.descendantsOfType("variable_declarator")){if(t.childForFieldName("name")?.text!==r)continue;let n=Re(t);if(n?.type!=="array")continue;let o=new Set;for(let a of n.namedChildren)a.type==="string"&&o.add(Le(a.text));return[...o].sort()}return null}function Le(e){return e.length>=2&&(e[0]==="'"&&e.endsWith("'")||e[0]==='"'&&e.endsWith('"'))?e.slice(1,-1):e}function Ct(e,r,t){let i=M(e,r);if(!i)return{ok:!1,reason:`file not found: ${r}`};let n=De(i,t);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${t} --> ... <!-- END GENERATED ${t} --> block in ${r}`}:{ok:!0,keys:Pe(n)}}function De(e,r){let t=Q(r),n=new RegExp(`<!--\\s*BEGIN GENERATED ${t}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${t}\\s*-->`).exec(e);return n?n[1]:null}function Pe(e){let r=new Set;for(let t of e.matchAll(/`([a-z][a-z0-9-]*)`/g))r.add(t[1]);for(let t of e.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))r.add(t[1]);return[...r].sort()}function bt(e,r){switch(r.type){case"top-level-dirs":return Ee(we(e,r.path));case"file-glob":return[...new Set(J(e,r.pattern).map(t=>ut(t)))].sort();case"registered-commands":return vt(e);case"builtin-skills":return Ee(we(e,"skills"))}}function Ee(e){let r;try{r=ct(e,{withFileTypes:!0})}catch{return[]}return r.filter(t=>t.isDirectory()&&!t.name.startsWith(".")).map(t=>t.name).sort()}function vt(e){let r;try{r=U(e,"docs/COMMAND_REFERENCE.md",{maxBytes:8*1024*1024,inputKind:"generated command reference"})}catch(i){if(!K(i))throw i;return[]}let t=De(r,"COMMAND REFERENCE");return t?Pe(t):[]}function f(e){return e.scoreCount??e.count}function N(e,r){let t=Ht(e),{breakdown:i,pressure:n}=Rt(e),o=Ae(i,"risk"),a=Ae(i,"hygiene");return{score:Math.min(o,a),riskScore:o,hygieneScore:a,scoreBreakdown:i,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},...r?{provenance:r}:{},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:f(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:f(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:f(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:St(e),validation:Et(e),suppressions:e.suppressions,actions:t,pressure:n,policyExclusions:xt(e),topComplexity:e.complexity.top,detectorEvidence:e.detectorEvidence,warnings:e.warnings.length>0?e.warnings:void 0}}var yt=[["react-component-duplicates",e=>e.reactComponentDuplicates],["react-hook-candidates",e=>e.reactHookCandidates],["react-large-component-pressure",e=>e.reactLargeComponentPressure],["wrapper-candidates",e=>e.wrappers],["duplicate-bodies",e=>e.duplicateBodies],["dead",e=>e.dead]];function xt(e){let r=[],t=(i,n)=>{for(let o of n??[])o.count<=0||r.push({detector:i,reason:o.reason,detail:o.detail,count:o.count})};for(let[i,n]of yt)t(i,n(e).exclusions);return t("extract-candidates",e.extractExclusions),t("complexity-hotspots",e.complexity.exclusions),t("co-change",e.gitEvidence?.hiddenCoupling.exclusions),r}function St(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:wt(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function wt(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:C(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Et(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[s,u]of Object.entries(r))i.has(s)?n+=u.fixChanges:(o+=u.fixChanges,a+=1);let c=i.size>0?C(n/i.size):0,p=a>0?C(o/a):0,b={};for(let[s,u]of Object.entries(t)){let g=new Set(u);if(g.size===0)continue;let w=0;for(let k of g)w+=r[k]?.fixChanges??0;let x=C(w/g.size);b[s]={flaggedFiles:g.size,fixDensity:x,lift:p>0?C(x/p):null}}return{flaggedFiles:i.size,flaggedFixDensity:c,baselineFixDensity:p,ratio:i.size>0&&p>0?C(c/p):null,byCategory:b,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function C(e){return Math.round(e*100)/100}function Te(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function S(e,r="existing shared infrastructure discount"){let t=f(e);return Math.abs(t-e.count)<.01?"":` (${Te(t)} score-weighted after ${r})`}function y(e,r){let t=f(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${Te(t)} score-weighted)`}function Ht(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",evidenceContractId:"dead-visible-references",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",evidenceContractId:"isolated-visible-connectivity",description:`${e.isolated.count} symbols with no visible indexed or source-supported caller/callee after root exclusions \u2014 runtime reflection and generated dispatch remain disclosed blind spots`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",evidenceContractId:"duplicate-structural-candidate",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure${S(e.reactComponentDuplicates,"support-tier discount")} \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${S(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${S(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with a contiguous region whose callees appear nowhere else in the body \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",evidenceContractId:"wrapper-indirection-candidate",description:`${e.wrappers.count} wrapper-shaped single-consumer callables${S(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",evidenceContractId:"passthrough-forwarding-candidate",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",evidenceContractId:"stale-abstraction-candidate",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+S({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let a=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-a}),r}var ke={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function Ae(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function Rt(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(m,E,v)=>{E>0&&i.push({axis:m,points:E,detail:v,kind:ke[m]??"hygiene"})},a=(m,E,v,tt,rt,it,nt)=>{let H=Math.max(tt,1);if(v<=H)return;let A=v/H,T=Math.min(rt,Math.ceil(Math.log2(A)*it));if(T<=0)return;let ot=ke[m]??"hygiene";n.push({axis:m,category:E,kind:ot,count:v,threshold:C(H),ratio:C(A),extraPenalty:T}),o(m,T,`${v} ${nt} exceed pressure threshold ${C(H)} (${C(A)}x)`)},c=e.dead.count/t;o("dead-code",Math.min(20,Math.round(c*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let p=e.isolated.count/t;o("isolated",Math.min(10,Math.round(p*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let b=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(b)),`${e.similarCount} similar function pair(s)`);let s=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(s*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let u=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(u*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let g=f(e.reactComponentDuplicates),w=g/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(w)),y(e.reactComponentDuplicates,"duplicated React component pair(s)"));let x=f(e.reactHookCandidates),k=x/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(k)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let Ye=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(Ye/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Xe=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(Xe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let G=f(e.vueComposableCandidates),Je=G/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(Je)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Ze=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(Ze/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let O=f(e.wrappers);o("wrappers",Math.min(3,O),y(e.wrappers,"wrapper candidate(s)"));let j=f(e.passthroughs);o("passthroughs",Math.min(3,j),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let et=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(et*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let m=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(m/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:m},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,Math.max(3,Math.round(r*.005)),5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let m=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",m,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),a("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),a("react-component-duplicates-pressure","Duplicated React components",g,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",x,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",G,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",O,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",j,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}var h={dead:{minLoc:1,skipBarrels:!1,deadCodeOnly:!1},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};import{getHeapStatistics as Lt}from"v8";var Dt=64*1024*1024;function I(){let e=globalThis.gc;if(!e)return;let r=Lt();r.heap_size_limit-r.used_heap_size<Dt||e()}var Pt=[{id:"dead-visible-references",detector:"dead",claim:"The symbol has no visible repository reference after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework/source fallback references","rooted-symbol exclusions"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Absence of visible references does not prove absence of reflection, generated dispatch, or external use."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"isolated-visible-connectivity",detector:"isolated",claim:"The callable has no visible non-self caller or callee after entry, framework, and rooted-symbol exclusions.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"identity",subtype:"references",minimumStrength:"exact"}],structuralEvidence:["entry-surface exclusions","framework contract exclusions","source fallback callers"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Visible graph isolation does not establish runtime unreachability through reflection or generated dispatch."],recoverWith:"scip-query evidence --symbol <symbol> --edge execution --edge runtime --edge identity --direction both --depth 2 --max-edges 100"},{id:"wrapper-indirection-candidate",detector:"wrapper-candidates",claim:"A small callable has one visible consumer and wrapper-shaped delegation, after boundary evidence is disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["callable body shape","public and runtime-boundary signals","consumer fan-in"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Wrapper shape does not prove that an API, ownership, observability, or compatibility boundary is unnecessary."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"passthrough-forwarding-candidate",detector:"passthrough-candidates",claim:"A small callable visibly forwards to one callee, with public-facade and boundary signals disclosed.",relationRequirements:[{family:"execution",subtype:"call",minimumStrength:"exact"},{family:"contract",subtype:"uses-contract-symbol",minimumStrength:"exact"}],structuralEvidence:["statement-complete forwarding shape","public facade evidence","runtime-boundary signals"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Literal forwarding does not prove the callable has no contract, naming, policy, or compatibility role."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"stale-abstraction-candidate",detector:"stale-abstractions",claim:"A type-like abstraction has zero or one visible real consumer after re-export and ownership distinctions.",relationRequirements:[{family:"identity",subtype:"references",minimumStrength:"exact"},{family:"ownership",subtype:"contains",minimumStrength:"exact"}],structuralEvidence:["definition kind","barrel-only consumer distinction","defining-file usage"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Low visible consumer count does not prove a public contract or runtime-registered type is obsolete."],recoverWith:"scip-query evidence --symbol <symbol> --edge identity --edge ownership --edge contract --direction both --depth 2 --max-edges 100"},{id:"complexity-control-pressure",detector:"complexity-hotspots",claim:"A callable concentrates local branch/control pressure and graph fan-in or fan-out.",relationRequirements:[{family:"execution",subtype:"predicate-consequence",minimumStrength:"exact"},{family:"execution",subtype:"call",minimumStrength:"exact"}],structuralEvidence:["AST branch count or disclosed regex fallback","call fan-in","callee count"],calibration:"mixed",providerCoverage:"partial",nonClaims:["Structural complexity does not establish runtime frequency, latency, defect density, or a required refactor."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"decorative-checker-terminal-behavior",detector:"decorative-checkers",claim:"A checker-shaped callable lacks a visible failure terminal directly or through one resolved delegate.",relationRequirements:[{family:"execution",subtype:"returns",minimumStrength:"exact"},{family:"execution",subtype:"throws",minimumStrength:"exact"}],structuralEvidence:["checker naming shape","direct terminal behavior","one-hop delegate body"],calibration:"mixed",providerCoverage:"partial",nonClaims:["No visible terminal does not prove the checker cannot fail through an opaque call, exception, or process exit."],recoverWith:"scip-query inspect --symbol <symbol> --view behavior"},{id:"duplicate-structural-candidate",detector:"duplicate and similarity detectors",claim:"Two source units share the detector-specific structural or token pattern.",relationRequirements:[],structuralEvidence:["normalized source/token/JSX/template similarity"],calibration:"candidate",providerCoverage:"partial",nonClaims:["Structural similarity does not establish shared domain identity or justify consolidation."],recoverWith:"scip-query inspect --symbol <symbol-a> --symbol <symbol-b> --view behavior"}];function Me(e=new Set(["indexed-graph","source-facts"])){return Pt.map(r=>{let t=r.relationRequirements.map(n=>{let o=se(n.family,n.subtype);if(!o)throw new Error(`Detector ${r.id} names an unregistered relation ${n.family}/${n.subtype}`);if(!o.relation.evidenceStrengths.includes(n.minimumStrength))throw new Error(`Detector ${r.id} requires unsupported strength ${n.minimumStrength} for ${n.family}/${n.subtype}`);return o.provider}),i=[...new Set(t.flatMap(n=>n.requirements))].filter(n=>!e.has(n));return{...r,status:i.length>0?"unsupported":r.calibration,providerIds:[...new Set(t.map(n=>n.id))],unavailableRequirements:i}})}var Be=50,V=10,kt=25e3,At=2500,$e=2500,_e=50,Tt=10,Mt=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],Ve={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:_t(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:Nt(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:It(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Vt(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:qt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:zt(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Gt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Ot(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:jt(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Wt(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ut(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Kt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",...Ft(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:Qt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:Yt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:Xt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:tr(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:rr(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:Jt(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:Zt(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:er(e,t)})};function ci(e,r={}){return qe(e,r.full!==!1,(t,i)=>{let n=$t(e,r.scope,t,i);return N(n,Fe(e))})}function Fe(e){let r=e.generation.identity,t=W(e.config.dbPath),i=t?.currentGeneration===r?t:null;return{computedAt:new Date().toISOString(),generation:{identity:r,publishedAt:i?.publishedAt??null,mode:i?.publication?.mode??null},git:Se(e.config.projectRoot)}}function ui(e,r,t={}){return Bt(e,[r],t)[0]}function Bt(e,r,t={}){return qe(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(a=>Ve[a](e,t.scope,o,i))})}function qe(e,r,t){let i=ye(e),n=ir(i,r);try{return t(i,n)}finally{_(e,{semanticProvider:!0}),I()}}function li(e,r){return N(ze(e),r?Fe(r):void 0)}function ze(e){let r=l(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,detectorEvidence:Me(),dead:l(e,"dead").dead,isolated:l(e,"isolated").isolated,realCycleCount:l(e,"cycles").realCycleCount,similarCount:l(e,"similar").similarCount,duplicateBodies:l(e,"duplicate-bodies").duplicateBodies,twinDrift:l(e,"twin-drift").twinDrift,reactComponentDuplicates:l(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:l(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:l(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:l(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:l(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:l(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:l(e,"extract-candidates").extractCount,extractExclusions:l(e,"extract-candidates").extractExclusions,wrappers:l(e,"wrapper-candidates").wrappers,passthroughs:l(e,"passthrough-candidates").passthroughs,stale:l(e,"stale-abstractions").stale,drift:l(e,"drift").drift,complexity:l(e,"complexity-hotspots").complexity,gitEvidence:Ne(e,"git-evidence")?.gitEvidence??null,suppressions:Ne(e,"suppressions")?.suppressions??null,coverageContracts:l(e,"coverage-contracts").coverageContracts}}function Ne(e,r){return e.find(t=>t.phase===r)}function l(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function $t(e,r,t,i){return ze(Mt.map(n=>Ve[n](e,r,i,t)))}function _t(e,r,t){return d(e,t,"dead",()=>{let i=Z(e,{scope:r,...h.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.applicability;return{...D(ar(e,i.symbols)),exclusions:P([{reason:"entry-surface-symbols",detail:"zero-reference symbols in framework entry surfaces (route handlers, pages, scheduled tasks, live barrels) that the framework invokes",count:n.entrySurfaceExcluded},{reason:"generated-artifact-symbols",detail:"zero-reference symbols in generated artifacts (migration dumps, codegen output) owned by their generator",count:n.generatedArtifactExcluded??0}])}})}function Nt(e,r,t){return d(e,t,"isolated",()=>{let i=le(e,{scope:r,...h.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return D(sr(e,i))})}function It(e,r,t){return d(e,t,"cycles",()=>ne(e,{scope:r}).filter(n=>n.kind==="real").length)}function Vt(e,r,t){let i=d(e,t,"similar",()=>ie(e,{scope:r,...h.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function Ft(e,r,t){return d(e,t,"extract-candidates",()=>{let i=ue(e,{scope:r,...h.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.actionTier==="support").length;return{extractCount:i.length-n,extractExclusions:n>0?[{reason:"wide-interface-regions",detail:"largest region would take more than five locals in or hand more than two back; listed by extract-candidates at support tier",count:n}]:[]}})}function qt(e,r,t){return d(e,t,"duplicate-bodies",()=>{let i=oe(e,{scope:r,...h.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let a of i.groups)for(let c of a.functions.slice(1))n.add(c.file),o+=c.loc;return{count:i.groups.length,loc:o,files:[...n],exclusions:i.exclusions.map(a=>({reason:a.reason,detail:`${a.detail}; group members removed before counting`,count:a.count}))}})}function zt(e,r,t){return d(e,t,"twin-drift",()=>{let i=ae(e,{scope:r,...h.twinDrift,scanLimit:t.candidateScanLimit}).filter(a=>a.relationship==="divergent"||a.relationship==="identical"),n=new Set,o=0;for(let a of i)for(let c of a.members)n.add(c.file),o+=c.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function Gt(e,r,t){return d(e,t,"react-component-duplicates",()=>{let i=de(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=i.results.filter(o=>Ie(o)>0);return{...q(n,Ie),exclusions:P(i.exclusions,[{reason:"support-tier-pairs",detail:"support-tier pairs (generic structure only, or framework route scaffolding); listed by react-component-duplicates but not counted",count:i.results.length-n.length}])}})}function Ot(e,r,t){return d(e,t,"react-hook-candidates",()=>{let i=pe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=[],o=new Map;for(let a of i.results){let c=je(a);if(c.weight>0){n.push(a);continue}let p=o.get(c.reason)??{reason:c.reason,detail:c.detail,count:0};p.count+=1,o.set(c.reason,p)}return{...q(n,ur),exclusions:P(i.exclusions,[...o.values()])}})}function jt(e,r,t){return d(e,t,"react-large-component-pressure",()=>{let i=me(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return{...cr(i.results),exclusions:P(i.exclusions,[])}})}function Wt(e,r,t){return d(e,t,"vue-component-duplicates",()=>{let i=he(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Oe(i)})}function Ut(e,r,t){return d(e,t,"vue-composable-candidates",()=>{let i=ge(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return q(i,lr)})}function Kt(e,r,t){return d(e,t,"vue-large-view-pressure",()=>{let i=fe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return D(i)})}function Qt(e,r,t){return d(e,t,"wrapper-candidates",()=>{let i=Ce(e,{scope:r,...h.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(a=>a.bodyShape==="forwarding"),o=i.length-n.length;return{...Ge(n,mr),exclusions:o>0?[{reason:"single-consumer-helpers",detail:"single-consumer callables whose body computes or branches instead of forwarding one call; listed by wrapper-candidates as signal tier",count:o}]:[]}})}function Yt(e,r,t){return d(e,t,"passthrough-candidates",()=>{let i=be(e,{scope:r,...h.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return Ge(i,hr)})}function Xt(e,r,t){return d(e,t,"stale-abstractions",()=>{let i=ve(e,{scope:r,...h.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,a)=>o+a.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function Jt(e,r){return d(e,r,"git-evidence",()=>{let t=ee(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=te(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),a={};for(let[s,u]of i)a[s]={changes:u.changes,fixChanges:u.fixChanges};let c=o.findings.filter(s=>F(s).counted),p=new Map;for(let s of o.findings){let u=F(s);if(u.counted)continue;let g=p.get(u.reason)??{reason:u.reason,detail:u.detail,count:0};g.count+=1,p.set(u.reason,g)}let b=[...c].sort((s,u)=>L(u)-L(s)||u.together-s.together);return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:c.length,scoreCount:z(c.reduce((s,u)=>s+L(u),0)),exclusions:[...p.values()].sort((s,u)=>s.reason.localeCompare(u.reason)),top:b.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:L(s),subjectContext:s.subjectContext}))},fileStats:a,commitsScanned:n?.commits.length??0}})}function Zt(e,r){return d(e,r,"suppressions",()=>{let t=xe(e);return{total:t.total,byCategory:{...t.byCategory}}})}function er(e,r){return d(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=He(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function tr(e,r,t){return d(e,t,"drift",()=>{let i=ce(e,{scope:r,...h.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(c=>c.kind!=="pattern-deviation"),o=n.filter(c=>c.actionTier==="direct").length,a=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:a}})}function rr(e,r,t){return d(e,t,"complexity-hotspots",()=>{let i=re(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(a=>a.score>Be&&a.branches>=V),o=i.filter(a=>a.score>Be&&a.branches<V).length;return{top:i.slice(0,5).map(a=>({symbol:a.shortName,score:a.score,file:a.file})),extremeCount:n.length,exclusions:o>0?[{reason:"popular-low-branch-callables",detail:`callables above the extreme score only through fan-in, with fewer than ${V} branches`,count:o}]:[]}})}function ir(e,r){let t=e.symbols>=kt||e.documents>=At,i=r?Number.POSITIVE_INFINITY:_e,n=r?Number.POSITIVE_INFINITY:Tt;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:$e,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${$e} symbols and reported their top ${_e} findings. Enable full mode for unbounded candidate counts.`]}}function nr(e,r){r.releaseCachesBetweenPhases&&(_(e),I())}function d(e,r,t,i){or(t);try{return i()}finally{nr(e,r)}}function or(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function ar(e,r){return r.filter(t=>!B(e,t.relativePath)&&!$(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function sr(e,r){return r.filter(t=>!B(e,t.relativePath)&&!$(e,t.symbol,t.relativePath))}function D(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function Ge(e,r){return{...D(e),scoreCount:z(e.reduce((i,n)=>i+r(n),0))}}function cr(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Oe(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function q(e,r){return{...Oe(e),scoreCount:z(e.reduce((i,n)=>i+r(n),0))}}function Ie(e){return e.actionTier==="signal"?1:0}function ur(e){return je(e).weight}function je(e){if(e.evidenceClass==="generic-workflow-scaffolding")return{weight:0,reason:"generic-workflow-pairs",detail:"pairs whose shared behavior is only generic React mechanics (open/close/submit state and handlers)"};let r=e.sharedHooks.some(n=>!dr.has(n)),t=We({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});if(r&&t<=2)return{weight:0,reason:"shared-hook-covered-pairs",detail:"pairs whose concrete shared behavior is already carried by a project hook both sides call"};if(!r&&t===0)return{weight:0,reason:"generic-workflow-pairs",detail:"pairs whose shared behavior is only generic React mechanics (open/close/submit state and handlers)"};let i={reason:"counted",detail:"counted"};return r?{weight:.5,...i}:Ue(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?{weight:.25,...i}:{weight:t>=2?1:.5,...i}}function P(...e){let r=new Map;for(let t of e)for(let i of t){if(i.count<=0)continue;let n=r.get(i.reason);n?n.count+=i.count:r.set(i.reason,{...i})}return[...r.values()].sort((t,i)=>t.reason.localeCompare(i.reason))}function lr(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=We({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Ue(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function We(e){return e.requests.filter(t=>!pr.has(t)).length*2+e.lifecycle.length+e.namedState.filter(t=>!Qe.has(Ke(t))).length+Math.min(e.functions.length,3)}var dr=new Set(["useForm","useFormContext","useInfiniteQuery","useMutation","useParams","usePathname","useQuery","useQueryClient","useRouter","useSearchParams","useSelector","useDispatch","useSuspenseQuery","useTheme","useTranslation"]),pr=new Set(["axios","fetch","gql","graphql","mutate","query","request","useInfiniteQuery","useMutation","useQuery","useSuspenseQuery"]);function Ue(e,r,t){let i=[...e,...r,...t].map(Ke);return i.length>0&&i.every(n=>Qe.has(n))}function Ke(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function mr(e){return e.actionTier==="signal"?.25:1}function hr(e){return e.actionTier==="signal"?.25:1}function L(e){return F(e).counted?e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5:0}function F(e){if(e.actionTier==="signal"&&e.partnerClass!=="doc-code"&&e.partnerClass!=="generated-artifact")return{counted:!1,reason:"sweep-only-pairs",detail:"pairs whose shared commits were only broad sweeps, stale pairs with at most two focused co-changes, and configuration or schema partners; listed by co-change at signal tier"};switch(e.partnerClass){case"doc-code":return{counted:!1,reason:"doc-sync-pairs",detail:"documentation that changes alongside the code it describes (doc-drift owns stale docs)"};case"generated-artifact":return{counted:!1,reason:"generated-artifact-pairs",detail:"generated artifacts (migration journals, snapshots, codegen output) rewritten from their source"};default:return{counted:!0,reason:"counted",detail:"counted"}}}function z(e){return Math.round(e*100)/100}var Qe=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{h as a,Mt as b,ci as c,Fe as d,ui as e,Bt as f,li as g};
3
- //# sourceMappingURL=chunk-B7MPDEAK.js.map
@@ -1,2 +0,0 @@
1
- import{a as y}from"./chunk-35NLDRZC.js";import{c as d}from"./chunk-NJQISBL4.js";import{b as u}from"./chunk-FLMTCX5R.js";import{b as f}from"./chunk-BOW7SSQH.js";function W(n,e={}){return B(n,e).cycles}function B(n,e={}){return C(n,e)}function M(n,e={}){return C(n,e).cycles}function C(n,e={}){let{scope:t,maxDepth:c=10,edgeBasis:i="symbol-references"}=e,s=f(n,t,i==="imports"?{scipEdges:"imports-only",sourceEdges:"imports-only"}:void 0),{components:l}=y(s),a=l.filter(r=>S(s,r)).map(r=>{let o=[...r].sort(),{path:D,kind:p}=R(s,o);return{path:D,component:o,edgeBasis:i,witness:!0,classification:p==="real"?"dependency-cycle":"module-structure-candidate",kind:p}});return a.sort((r,o)=>r.kind!==o.kind?r.kind==="real"?-1:1:r.path.length-o.path.length),{cycles:a,truncated:!1,edgeBasis:i,maxDepth:c}}function R(n,e){let t=g(n,e),c=new Set(e.filter(r=>x(r)));if(c.size===0)return{path:t,kind:h(t)};let i=new Set(e),s=new Map;for(let r of e)c.has(r)||s.set(r,new Set([...n.get(r)??[]].filter(o=>i.has(o)&&!c.has(o))));let l=y(s).components.filter(r=>S(s,r)).map(r=>[...r].sort()).sort((r,o)=>r[0].localeCompare(o[0]))[0];if(!l)return{path:t,kind:"module-hierarchy"};let a=g(s,l);return{path:a,kind:h(a)}}function x(n){let e=u(n);return e==="test"||e==="barrel"||e==="entry"||d(n)}function S(n,e){if(e.length>1)return!0;let t=e[0];return t!==void 0&&n.get(t)?.has(t)===!0}function g(n,e){let t=e[0];if(!t)return[];let c=new Set(e);for(let i of[...n.get(t)??[]].filter(s=>c.has(s)).sort()){if(i===t)return[t,t];let s=k(n,i,t,c);if(s)return[t,...s]}throw new Error(`Cyclic component did not contain a witness path from ${t}.`)}function k(n,e,t,c){let i=[e],s=new Map([[e,null]]);for(let l=0;l<i.length;l+=1){let a=i[l];if(a===t){let r=[];for(let o=a;o!==null;o=s.get(o)??null)r.push(o);return r.reverse()}for(let r of[...n.get(a)??[]].filter(o=>c.has(o)).sort())s.has(r)||(s.set(r,a),i.push(r))}return null}function h(n){for(let c of n){let i=u(c);if(i==="test"||i==="barrel"||i==="entry")return"module-hierarchy"}if(n.length!==3)return"real";let[e,t]=n;return!e||!t?"real":d(e)||d(t)||m(e,t)||m(t,e)||b(e,t)||b(t,e)||u(e)==="entry"||u(t)==="entry"?"module-hierarchy":"real"}function m(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=e.replace(/\.rs$/,"/");return n.startsWith(t)?!n.slice(t.length).includes("/"):!1}function b(n,e){if(!n.endsWith(".rs")||!e.endsWith(".rs"))return!1;let t=n.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(t===c+"_tests"||t===c+"/tests")return!0;let i=n.split("/"),s=e.split("/");if(i.length===s.length&&i.includes("tests")&&s.includes("src")){let l=i[i.length-1],a=s[s.length-1];if(l&&l===a)return!0}return!1}export{W as a,B as b,M as c,C as d};
2
- //# sourceMappingURL=chunk-BBB5FBX4.js.map
@@ -1,3 +0,0 @@
1
- import{a as d}from"./chunk-YXPUP5G2.js";import{c as S}from"./chunk-IW5XQG5G.js";import{readdirSync as m}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var h=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],L=[".vue"],f=[".tsx",".jsx"],g=[".vue"],b=[...f,...g],U=new Set(f),F=new Set(g),p=new Set(h.map(e=>e.toLowerCase())),_=[...p].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function X(e,t={}){let i=t.includeIndexed??!0,r=t.includeAuxiliary??!0,n=t.extensions?.map(c=>c.toLowerCase()),o=n?new Set(n):p,u=n?[...o].sort().join(","):_,s=`${i?"1":"0"}|${r?"1":"0"}|${u}`;return I.get(e,s,()=>{let c=new Set;if(i)for(let a of d(e,{includeIgnored:!1}))o.has(l(a).toLowerCase())&&c.add(a);if(r)for(let a of C(e.config.projectRoot,o))e.isIgnored(a)||i&&c.has(a)||c.add(a);return[...c].sort()})}var I=S("source-files",{clearGroups:[]});function C(e,t){return O(e,t)??w(e,t)}function O(e,t){try{let i=x("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"]}),r=new Set;for(let n of i.split(`
2
- `)){let o=n.trim();o&&(R(o)||t.has(l(o).toLowerCase())&&r.add(o))}return r}catch{return null}}function R(e){return e.split("/").some(t=>E.has(t))}function w(e,t){let i=new Set,r=n=>{let o=n?y(e,n):e,u;try{u=m(o,{withFileTypes:!0})}catch{return}for(let s of u)if(!E.has(s.name)){if(s.isDirectory()){r(n?`${n}/${s.name}`:s.name);continue}t.has(l(s.name).toLowerCase())&&i.add(n?`${n}/${s.name}`:s.name)}};return r(""),i}export{L as a,E as b,X as c};
3
- //# sourceMappingURL=chunk-BJT7LSPK.js.map