scip-query 0.10.11 → 0.11.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 (374) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
  3. package/README.md +168 -55
  4. package/dist/augment-vue-worker.js +1 -1
  5. package/dist/chunk-2VSDXOG5.js +2 -0
  6. package/dist/chunk-343O6EVV.js +2 -0
  7. package/dist/chunk-3KDUITBE.js +7 -0
  8. package/dist/chunk-3T2FNHIU.js +2 -0
  9. package/dist/chunk-3V6JQQM5.js +2 -0
  10. package/dist/chunk-5AAAEZ2Z.js +2 -0
  11. package/dist/chunk-6Q6OFLFQ.js +8 -0
  12. package/dist/chunk-6XA4LDHY.js +2 -0
  13. package/dist/chunk-75X52JTA.js +2 -0
  14. package/dist/{chunk-54KGX7EX.js → chunk-7HB3CZFD.js} +2 -2
  15. package/dist/chunk-7JZRFDCU.js +2 -0
  16. package/dist/chunk-7XL7J7PT.js +3 -0
  17. package/dist/chunk-ALHNAPS2.js +2 -0
  18. package/dist/{chunk-JATUZIEH.js → chunk-BDRBPG7Y.js} +2 -2
  19. package/dist/chunk-BN5SXXQS.js +40 -0
  20. package/dist/chunk-C4ICAIJ4.js +3 -0
  21. package/dist/{chunk-LSET2TXH.js → chunk-CMHYBXJB.js} +2 -2
  22. package/dist/{chunk-YWYFU2V3.js → chunk-DRPAQAFM.js} +6 -6
  23. package/dist/chunk-FERAXG6Y.js +72 -0
  24. package/dist/chunk-FLJJLSGB.js +2 -0
  25. package/dist/chunk-FXG3PHVW.js +9 -0
  26. package/dist/chunk-GCN2P4EJ.js +2 -0
  27. package/dist/chunk-GHXRVCIY.js +21 -0
  28. package/dist/chunk-GNG622H3.js +3 -0
  29. package/dist/chunk-H4LUPLEJ.js +2 -0
  30. package/dist/{chunk-BASVXNY3.js → chunk-H56MGERE.js} +4 -4
  31. package/dist/chunk-H7NSJ7L2.js +5 -0
  32. package/dist/chunk-HINMXZ6J.js +2 -0
  33. package/dist/chunk-HXXMPYEF.js +2 -0
  34. package/dist/{chunk-Z3YYR4OS.js → chunk-HZKMEXA3.js} +2 -2
  35. package/dist/chunk-IFSX6YVU.js +4 -0
  36. package/dist/chunk-ISLWJ4PY.js +10 -0
  37. package/dist/chunk-J5WVNZ6O.js +2 -0
  38. package/dist/chunk-K2HYR5A7.js +3 -0
  39. package/dist/chunk-K6UI6EBZ.js +2 -0
  40. package/dist/chunk-KJCDEDQW.js +2 -0
  41. package/dist/{chunk-Z4HICZGY.js → chunk-KKMOB3OJ.js} +2 -2
  42. package/dist/{chunk-YWOOQ4FF.js → chunk-KMVGRIO2.js} +2 -2
  43. package/dist/chunk-LWOOTRHC.js +2 -0
  44. package/dist/{chunk-EY43NV4M.js → chunk-LZNLRE4X.js} +17 -8
  45. package/dist/chunk-M2YXL62V.js +23 -0
  46. package/dist/chunk-MNEJYEHW.js +3 -0
  47. package/dist/chunk-MTDBHTSF.js +2 -0
  48. package/dist/{chunk-ZQDIXAF5.js → chunk-N2Z3CU7X.js} +2 -2
  49. package/dist/chunk-N7PNFLGY.js +2 -0
  50. package/dist/chunk-NAH5EAZS.js +6 -0
  51. package/dist/chunk-NBXK32I6.js +2 -0
  52. package/dist/chunk-NJJ7AS4F.js +2 -0
  53. package/dist/{chunk-FDEQIPPK.js → chunk-NLMRJ7SI.js} +2 -2
  54. package/dist/chunk-ODVITBYU.js +26 -0
  55. package/dist/chunk-ORBRX2QJ.js +2 -0
  56. package/dist/chunk-P36UR5II.js +2 -0
  57. package/dist/chunk-PYZZBIEU.js +3 -0
  58. package/dist/chunk-PZS6J5YG.js +16 -0
  59. package/dist/{chunk-LM5SHAN4.js → chunk-QARYU7R3.js} +2 -2
  60. package/dist/chunk-QJ3FK4TB.js +38 -0
  61. package/dist/chunk-QXGTGE2C.js +35 -0
  62. package/dist/chunk-QZ4JVECJ.js +2 -0
  63. package/dist/chunk-R3JY4EZ4.js +102 -0
  64. package/dist/{chunk-VOYOYC5T.js → chunk-R5336VHZ.js} +2 -2
  65. package/dist/chunk-RJMXSHKM.js +2 -0
  66. package/dist/chunk-STBXCPKY.js +5 -0
  67. package/dist/chunk-T2FQ4GHD.js +9 -0
  68. package/dist/chunk-TFWDJDGO.js +2 -0
  69. package/dist/chunk-TG7QSYCJ.js +2 -0
  70. package/dist/{chunk-FKCGBZAC.js → chunk-TTS75UF2.js} +5 -5
  71. package/dist/{chunk-BVRS7RKQ.js → chunk-U7I373V4.js} +2 -2
  72. package/dist/chunk-UIKLA3F5.js +2 -0
  73. package/dist/{chunk-P753MDDE.js → chunk-UMPNL7T6.js} +2 -2
  74. package/dist/chunk-URSSPS5H.js +2 -0
  75. package/dist/chunk-VGMUFW3J.js +2 -0
  76. package/dist/chunk-VXTNADIW.js +18 -0
  77. package/dist/chunk-VYF5HA76.js +2 -0
  78. package/dist/chunk-WFGOH2UI.js +43 -0
  79. package/dist/chunk-WGA5BBTA.js +4 -0
  80. package/dist/chunk-WIBFXSYB.js +6 -0
  81. package/dist/chunk-WPSS37EW.js +2 -0
  82. package/dist/chunk-WQHWIVA7.js +3 -0
  83. package/dist/chunk-WS3Z6W3M.js +65 -0
  84. package/dist/chunk-WXVGNFAO.js +2 -0
  85. package/dist/{chunk-6LJHXREW.js → chunk-WZLPXFZU.js} +2 -2
  86. package/dist/chunk-X4O6K47U.js +2 -0
  87. package/dist/chunk-X6OGDTQH.js +2 -0
  88. package/dist/chunk-XEMQUN3Z.js +20 -0
  89. package/dist/{chunk-7B6LP46R.js → chunk-XHWLNQVZ.js} +2 -2
  90. package/dist/chunk-XMR747CP.js +2 -0
  91. package/dist/chunk-Y6L4LXPG.js +2 -0
  92. package/dist/chunk-YCPASUCX.js +2 -0
  93. package/dist/chunk-YZXV3CU3.js +60 -0
  94. package/dist/chunk-ZEKBR4OK.js +10 -0
  95. package/dist/chunk-ZMGBWSFZ.js +2 -0
  96. package/dist/cli.js +462 -274
  97. package/dist/{config-types-BDIWAYzr.d.ts → config-types-BrHl3Bge.d.ts} +61 -1
  98. package/dist/{db-Djj3Nqrb.d.ts → db-_Bdx0E1W.d.ts} +1 -1
  99. package/dist/diff-gate-types-CG2YQ_ei.d.ts +4 -0
  100. package/dist/{frontend-behavior-evidence-BxKpKWUu.d.ts → frontend-behavior-evidence-EfM4_9bc.d.ts} +1 -1
  101. package/dist/{health-D5J42g4D.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
  102. package/dist/index.d.ts +10 -70
  103. package/dist/index.js +2 -2
  104. package/dist/postinstall.js +1 -4
  105. package/dist/queries/affected.d.ts +2 -2
  106. package/dist/queries/affected.js +1 -1
  107. package/dist/queries/bottlenecks.d.ts +2 -2
  108. package/dist/queries/bottlenecks.js +1 -1
  109. package/dist/queries/by-kind.d.ts +2 -2
  110. package/dist/queries/by-kind.js +1 -1
  111. package/dist/queries/call-graph.d.ts +2 -2
  112. package/dist/queries/call-graph.js +1 -1
  113. package/dist/queries/change-surface.d.ts +2 -2
  114. package/dist/queries/change-surface.js +1 -1
  115. package/dist/queries/cleanup-plan.d.ts +2 -2
  116. package/dist/queries/cleanup-plan.js +1 -1
  117. package/dist/queries/co-change.d.ts +12 -2
  118. package/dist/queries/co-change.js +1 -1
  119. package/dist/queries/code.d.ts +2 -2
  120. package/dist/queries/code.js +1 -1
  121. package/dist/queries/complexity-hotspots.d.ts +7 -3
  122. package/dist/queries/complexity-hotspots.js +1 -1
  123. package/dist/queries/complexity.d.ts +42 -4
  124. package/dist/queries/complexity.js +1 -1
  125. package/dist/queries/convergence.d.ts +2 -2
  126. package/dist/queries/convergence.js +1 -1
  127. package/dist/queries/coupling.d.ts +2 -2
  128. package/dist/queries/coupling.js +1 -1
  129. package/dist/queries/cycles.d.ts +12 -3
  130. package/dist/queries/cycles.js +1 -1
  131. package/dist/queries/dataflow.d.ts +2 -2
  132. package/dist/queries/dataflow.js +1 -1
  133. package/dist/queries/dead.d.ts +3 -3
  134. package/dist/queries/dead.js +1 -1
  135. package/dist/queries/deep-chains.d.ts +2 -2
  136. package/dist/queries/deep-chains.js +1 -1
  137. package/dist/queries/deps.d.ts +2 -2
  138. package/dist/queries/deps.js +1 -1
  139. package/dist/queries/diff-gate.d.ts +65 -8
  140. package/dist/queries/diff-gate.js +1 -1
  141. package/dist/queries/diff-impact.d.ts +21 -3
  142. package/dist/queries/diff-impact.js +1 -1
  143. package/dist/queries/doc-drift.d.ts +29 -2
  144. package/dist/queries/doc-drift.js +1 -1
  145. package/dist/queries/drift.d.ts +15 -3
  146. package/dist/queries/drift.js +1 -1
  147. package/dist/queries/duplicate-bodies.d.ts +55 -0
  148. package/dist/queries/duplicate-bodies.js +2 -0
  149. package/dist/queries/extract-candidates.d.ts +2 -2
  150. package/dist/queries/extract-candidates.js +1 -1
  151. package/dist/queries/fan.d.ts +2 -2
  152. package/dist/queries/fan.js +1 -1
  153. package/dist/queries/files.d.ts +4 -3
  154. package/dist/queries/files.js +1 -1
  155. package/dist/queries/health.d.ts +3 -3
  156. package/dist/queries/health.js +1 -1
  157. package/dist/queries/hierarchy.d.ts +2 -2
  158. package/dist/queries/hierarchy.js +1 -1
  159. package/dist/queries/hotspots.d.ts +2 -2
  160. package/dist/queries/hotspots.js +1 -1
  161. package/dist/queries/imports.d.ts +2 -2
  162. package/dist/queries/imports.js +1 -1
  163. package/dist/queries/incomplete-migration.d.ts +3 -2
  164. package/dist/queries/incomplete-migration.js +1 -1
  165. package/dist/queries/index.d.ts +12 -7
  166. package/dist/queries/index.js +1 -1
  167. package/dist/queries/isolated.d.ts +2 -2
  168. package/dist/queries/isolated.js +1 -1
  169. package/dist/queries/locality-candidates.d.ts +2 -2
  170. package/dist/queries/locality-candidates.js +1 -1
  171. package/dist/queries/members.d.ts +2 -2
  172. package/dist/queries/members.js +1 -1
  173. package/dist/queries/methods.d.ts +2 -2
  174. package/dist/queries/methods.js +1 -1
  175. package/dist/queries/outline.d.ts +2 -2
  176. package/dist/queries/outline.js +1 -1
  177. package/dist/queries/passthrough-candidates.d.ts +11 -3
  178. package/dist/queries/passthrough-candidates.js +1 -1
  179. package/dist/queries/plan-context.d.ts +3 -2
  180. package/dist/queries/plan-context.js +1 -1
  181. package/dist/queries/react-component-duplicates.d.ts +7 -2
  182. package/dist/queries/react-component-duplicates.js +1 -1
  183. package/dist/queries/react-hook-candidates.d.ts +3 -3
  184. package/dist/queries/react-hook-candidates.js +1 -1
  185. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  186. package/dist/queries/react-large-component-pressure.js +1 -1
  187. package/dist/queries/recent-duplicates.d.ts +2 -2
  188. package/dist/queries/recent-duplicates.js +1 -1
  189. package/dist/queries/redundant-reexports.d.ts +2 -2
  190. package/dist/queries/redundant-reexports.js +1 -1
  191. package/dist/queries/refs.d.ts +2 -2
  192. package/dist/queries/refs.js +1 -1
  193. package/dist/queries/self-audit.d.ts +9 -4
  194. package/dist/queries/self-audit.js +1 -1
  195. package/dist/queries/similar-chains.d.ts +2 -2
  196. package/dist/queries/similar-chains.js +1 -1
  197. package/dist/queries/similar-files.d.ts +2 -2
  198. package/dist/queries/similar-files.js +1 -1
  199. package/dist/queries/similar-signatures.d.ts +17 -10
  200. package/dist/queries/similar-signatures.js +1 -1
  201. package/dist/queries/similar.d.ts +85 -17
  202. package/dist/queries/similar.js +1 -1
  203. package/dist/queries/slice.d.ts +2 -2
  204. package/dist/queries/slice.js +1 -1
  205. package/dist/queries/stale-abstractions.d.ts +2 -2
  206. package/dist/queries/stale-abstractions.js +1 -1
  207. package/dist/queries/stats.d.ts +2 -2
  208. package/dist/queries/surface.d.ts +2 -2
  209. package/dist/queries/surface.js +1 -1
  210. package/dist/queries/symbols.d.ts +2 -2
  211. package/dist/queries/symbols.js +1 -1
  212. package/dist/queries/system.d.ts +2 -2
  213. package/dist/queries/system.js +1 -1
  214. package/dist/queries/trace.d.ts +2 -2
  215. package/dist/queries/trace.js +1 -1
  216. package/dist/queries/twin-ab.d.ts +55 -0
  217. package/dist/queries/twin-ab.js +2 -0
  218. package/dist/queries/twin-drift.d.ts +97 -0
  219. package/dist/queries/twin-drift.js +2 -0
  220. package/dist/queries/unused-imports.d.ts +2 -2
  221. package/dist/queries/unused-imports.js +1 -1
  222. package/dist/queries/unused-params.d.ts +2 -2
  223. package/dist/queries/unused-params.js +1 -1
  224. package/dist/queries/vue-component-duplicates.d.ts +7 -2
  225. package/dist/queries/vue-component-duplicates.js +1 -1
  226. package/dist/queries/vue-composable-candidates.d.ts +3 -3
  227. package/dist/queries/vue-composable-candidates.js +1 -1
  228. package/dist/queries/vue-large-view-pressure.d.ts +6 -2
  229. package/dist/queries/vue-large-view-pressure.js +1 -1
  230. package/dist/queries/wrapper-candidates.d.ts +2 -2
  231. package/dist/queries/wrapper-candidates.js +1 -1
  232. package/dist/reindex-worker.js +9 -9
  233. package/dist/reindex.d.ts +30 -4
  234. package/dist/reindex.js +19 -19
  235. package/dist/runtime.d.ts +12 -6
  236. package/dist/runtime.js +2 -2
  237. package/dist/{scip-cli-CnK9Va4O.d.ts → scip-cli-C7cg4ZHR.d.ts} +1 -1
  238. package/dist/symbol-types-DaoeXKUt.d.ts +66 -0
  239. package/docs/AGENT_GUIDE.md +20 -18
  240. package/docs/AI_FAILURE_MODES.md +36 -13
  241. package/docs/API.md +1 -1
  242. package/docs/COMMAND_REFERENCE.md +57 -14
  243. package/docs/DETECTOR_GUIDE.md +20 -3
  244. package/docs/REGEX_POLICY.md +34 -0
  245. package/docs/analyzer-inventory.md +48 -3
  246. package/docs/analyzer-validation-ledger.md +41 -6
  247. package/package.json +23 -7
  248. package/scripts/build-scip-windows.mjs +10 -7
  249. package/scripts/evidence-product-contract.mjs +197 -0
  250. package/skills/_shared/SKILL.md +243 -0
  251. package/skills/_shared/agents/openai.yaml +4 -0
  252. package/skills/scip-api-impact/SKILL.md +55 -71
  253. package/skills/scip-claim-audit/SKILL.md +105 -0
  254. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  255. package/skills/scip-cleanup-audit/SKILL.md +122 -0
  256. package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
  257. package/skills/scip-cleanup-improve/SKILL.md +84 -0
  258. package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
  259. package/skills/scip-concrete-plan/SKILL.md +181 -0
  260. package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
  261. package/skills/scip-conductor/SKILL.md +133 -0
  262. package/skills/scip-conductor/agents/openai.yaml +4 -0
  263. package/skills/scip-debug/SKILL.md +60 -58
  264. package/skills/scip-diagram/SKILL.md +64 -94
  265. package/skills/scip-directory-architecture/SKILL.md +65 -107
  266. package/skills/scip-doc-reconcile/SKILL.md +56 -67
  267. package/skills/scip-explore/SKILL.md +78 -210
  268. package/skills/scip-hyper-optimization/SKILL.md +124 -198
  269. package/skills/scip-integrity-audit/SKILL.md +103 -0
  270. package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
  271. package/skills/scip-language-playbook/SKILL.md +56 -326
  272. package/skills/scip-maintainability/SKILL.md +80 -219
  273. package/skills/scip-probe-reachability/SKILL.md +92 -0
  274. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  275. package/skills/scip-query/SKILL.md +108 -124
  276. package/skills/scip-react-maintainability/SKILL.md +64 -82
  277. package/skills/scip-setup/SKILL.md +121 -0
  278. package/skills/scip-setup/agents/openai.yaml +4 -0
  279. package/skills/scip-tla-model-system/SKILL.md +138 -0
  280. package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
  281. package/skills/scip-triage-issue/SKILL.md +53 -41
  282. package/skills/scip-twin-drift/SKILL.md +107 -0
  283. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  284. package/skills/scip-verify/SKILL.md +70 -88
  285. package/skills/scip-vue-maintainability/SKILL.md +67 -94
  286. package/dist/chunk-2KHTSEIL.js +0 -102
  287. package/dist/chunk-3VD3JMK2.js +0 -2
  288. package/dist/chunk-4UZO3XCV.js +0 -35
  289. package/dist/chunk-5GOLFJEO.js +0 -8
  290. package/dist/chunk-5OST6GYB.js +0 -2
  291. package/dist/chunk-65AU3HFZ.js +0 -2
  292. package/dist/chunk-6GN7FXCH.js +0 -2
  293. package/dist/chunk-6IR2AOBM.js +0 -7
  294. package/dist/chunk-6JRV4MY2.js +0 -23
  295. package/dist/chunk-6QSOCTZT.js +0 -18
  296. package/dist/chunk-72KY2ZFO.js +0 -2
  297. package/dist/chunk-7GO4EQF5.js +0 -2
  298. package/dist/chunk-7IVSJJZU.js +0 -7
  299. package/dist/chunk-7TWLSZK5.js +0 -2
  300. package/dist/chunk-A536TEU4.js +0 -3
  301. package/dist/chunk-AVWPHM2Q.js +0 -4
  302. package/dist/chunk-B32FX5KB.js +0 -2
  303. package/dist/chunk-B6MJ5VQV.js +0 -2
  304. package/dist/chunk-BFXPG2VN.js +0 -2
  305. package/dist/chunk-BSN22NRK.js +0 -9
  306. package/dist/chunk-BZ53S4ZN.js +0 -2
  307. package/dist/chunk-C5CTSJ6X.js +0 -6
  308. package/dist/chunk-CO5GJRP7.js +0 -2
  309. package/dist/chunk-CW5YFOCP.js +0 -5
  310. package/dist/chunk-DS6QEB3G.js +0 -5
  311. package/dist/chunk-E35O7UCB.js +0 -2
  312. package/dist/chunk-EXDQ35NN.js +0 -2
  313. package/dist/chunk-FAYI6KZ5.js +0 -2
  314. package/dist/chunk-FFVIFETB.js +0 -2
  315. package/dist/chunk-FG4NT6VY.js +0 -2
  316. package/dist/chunk-FXNWFMKW.js +0 -25
  317. package/dist/chunk-G5UPYQGL.js +0 -4
  318. package/dist/chunk-GQBMH2TQ.js +0 -2
  319. package/dist/chunk-GRJY65YT.js +0 -2
  320. package/dist/chunk-HF25DFSC.js +0 -3
  321. package/dist/chunk-HHN2B5KA.js +0 -2
  322. package/dist/chunk-IHUETYFW.js +0 -2
  323. package/dist/chunk-JCLDUKT6.js +0 -38
  324. package/dist/chunk-JGN2ZFJR.js +0 -2
  325. package/dist/chunk-JM72FNGA.js +0 -2
  326. package/dist/chunk-JME7OWD3.js +0 -2
  327. package/dist/chunk-KDFONWTW.js +0 -40
  328. package/dist/chunk-LPL4MA6R.js +0 -2
  329. package/dist/chunk-LZHUWKGD.js +0 -2
  330. package/dist/chunk-M4COR2H6.js +0 -2
  331. package/dist/chunk-NOJAM5ZV.js +0 -21
  332. package/dist/chunk-O6ZH6C6Y.js +0 -2
  333. package/dist/chunk-OBGRLXWF.js +0 -3
  334. package/dist/chunk-OLTESY4K.js +0 -3
  335. package/dist/chunk-ONPCQ2PM.js +0 -6
  336. package/dist/chunk-P4KYUPBD.js +0 -4
  337. package/dist/chunk-P5RYBRIO.js +0 -4
  338. package/dist/chunk-P7AL7Y37.js +0 -2
  339. package/dist/chunk-PFOCOG57.js +0 -2
  340. package/dist/chunk-QLAUCRDJ.js +0 -2
  341. package/dist/chunk-QPU7EXAW.js +0 -2
  342. package/dist/chunk-QYB5P7GL.js +0 -2
  343. package/dist/chunk-RNM6LMCF.js +0 -2
  344. package/dist/chunk-RVWSAMTT.js +0 -2
  345. package/dist/chunk-TK7O5ER5.js +0 -3
  346. package/dist/chunk-TQ5W2H3S.js +0 -4
  347. package/dist/chunk-USPV3T5K.js +0 -2
  348. package/dist/chunk-UUBMFL3F.js +0 -59
  349. package/dist/chunk-VCQYSG2M.js +0 -10
  350. package/dist/chunk-VUKC6F77.js +0 -20
  351. package/dist/chunk-W2CBNBEL.js +0 -71
  352. package/dist/chunk-W6BVEKYC.js +0 -3
  353. package/dist/chunk-WUCEKFQC.js +0 -3
  354. package/dist/chunk-XUGQU7PM.js +0 -41
  355. package/dist/chunk-Y5NBHMQX.js +0 -2
  356. package/dist/chunk-YCOFCT4B.js +0 -2
  357. package/dist/chunk-YZA6PPZL.js +0 -3
  358. package/skills/concrete-plan/SKILL.md +0 -372
  359. package/skills/concrete-plan/agents/openai.yaml +0 -4
  360. package/skills/scip-adoption/SKILL.md +0 -122
  361. package/skills/scip-adoption/agents/openai.yaml +0 -4
  362. package/skills/scip-ai-cleanup/SKILL.md +0 -153
  363. package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
  364. package/skills/scip-debloat/SKILL.md +0 -439
  365. package/skills/scip-debloat/agents/openai.yaml +0 -4
  366. package/skills/scip-health-audit/SKILL.md +0 -162
  367. package/skills/scip-health-audit/agents/openai.yaml +0 -4
  368. package/skills/scip-health-improve/SKILL.md +0 -155
  369. package/skills/scip-health-improve/agents/openai.yaml +0 -4
  370. package/skills/scip-query-setup/SKILL.md +0 -170
  371. package/skills/scip-query-setup/agents/openai.yaml +0 -3
  372. package/vendor/scip/README.md +0 -6
  373. package/vendor/scip/win32-arm64/scip.exe +0 -0
  374. package/vendor/scip/win32-x64/scip.exe +0 -0
@@ -1,3 +0,0 @@
1
- import{a as p,b as k,e as g,g as b,i as C}from"./chunk-DS6QEB3G.js";import{b as y,d as S,e as v,j as _,k as l}from"./chunk-XUGQU7PM.js";import{c as T}from"./chunk-A536TEU4.js";import{e as N,f as x}from"./chunk-7S5E7KWT.js";import{extname as R}from"path";var G={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function d(e){return G[R(e).toLowerCase()]??null}function j(e){return R(e).toLowerCase()===".vue"}import{extname as Y}from"path";import{parse as Q}from"@vue/compiler-sfc";function w(e){let t=Q(e),n=t.descriptor.scriptSetup??t.descriptor.script;if(!n||n.src)return null;let s=b(n.lang??null);return s?{body:n.content,startLine:Math.max(0,n.loc.start.line-1),language:s}:null}var L=x("ast-trees",{clearGroups:["whole-project","source-file"]});function A(e,t){if(j(t))return X(e,t);let n=d(t);if(!n)return null;let s=p(e,t);return s?L.get(e,t,s,()=>g(n,s)):null}function X(e,t){let n=p(e,t);return n?L.get(e,t,n,()=>{let s=w(n);if(!s)return null;let o=`
2
- `.repeat(s.startLine)+s.body;return g(s.language,o)}):null}var ee=[".tsx",".jsx"],F=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),te=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),ne=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),se=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),oe=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),re=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),ae=new Set(["children","className","false","key","null","style","true","undefined"]),ie=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),ce=N("react-component-behavior-profiles");function et(e,t={}){let n=T(e,{extensions:ee}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>le(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function le(e,t){let n=t.replace(/\\/g,"/"),s=p(e,n);return ce.get(e,n,s,()=>ue(e,n,s)).map(pe)}function ue(e,t,n){let s=y(e,t,n),o=S(e,"react-component-behavior-profiles",t,s);if(o){let r=de(o);if(r)return r}let a=me(e,t);return v(e,"react-component-behavior-profiles",t,s,fe(a)),a}function me(e,t){let n=ge(t);if(!n)return[];let s=A(e,t);if(!s)return[];let o=k(e,t).length;return Ne(s.rootNode,n).filter(r=>r.kind==="hook"||$(r.bodyNode)).map(r=>{let i=ke(r.bodyNode),u=Re(r.bodyNode,n);return{file:t,name:r.name,kind:r.kind,startLine:r.node.startPosition.row,endLine:r.node.endPosition.row,loc:Math.max(1,r.node.endPosition.row-r.node.startPosition.row+1),fileLines:o,jsxTokens:i.tokens,behaviorTokens:u.tokens,componentNames:m(i.componentNames),nativeTags:m(i.nativeTags),propNames:m(i.propNames),eventNames:m(i.eventNames),hookNames:m(u.hookNames),requestNames:m(u.requestNames),stateNames:m(u.stateNames),effectNames:m(u.effectNames),handlerNames:m(u.handlerNames)}})}function pe(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function fe(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function de(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let s of t){let o=he(s);if(!o)return null;n.push(o)}return n}catch{return null}}function he(e){if(!_(e))return null;let{file:t,name:n,kind:s,startLine:o,endLine:a,loc:r,fileLines:i,jsxTokens:u,behaviorTokens:J,componentNames:z,nativeTags:D,propNames:I,eventNames:V,hookNames:H,requestNames:Z,stateNames:M,effectNames:K,handlerNames:U}=e;if(typeof t!="string"||typeof n!="string"||s!=="component"&&s!=="hook"||!h(o)||!h(a)||!h(r)||!h(i))return null;let c={jsxTokens:l(u),behaviorTokens:l(J),componentNames:l(z),nativeTags:l(D),propNames:l(I),eventNames:l(V),hookNames:l(H),requestNames:l(Z),stateNames:l(M),effectNames:l(K),handlerNames:l(U)};return Object.values(c).some(W=>W===null)?null:{file:t,name:n,kind:s,startLine:o,endLine:a,loc:r,fileLines:i,jsxTokens:new Set(c.jsxTokens),behaviorTokens:new Set(c.behaviorTokens),componentNames:c.componentNames,nativeTags:c.nativeTags,propNames:c.propNames,eventNames:c.eventNames,hookNames:c.hookNames,requestNames:c.requestNames,stateNames:c.stateNames,effectNames:c.effectNames,handlerNames:c.handlerNames}}function h(e){return typeof e=="number"&&Number.isFinite(e)}function ge(e){let t=Y(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:d(e)}function Ne(e,t){let n=[],s=new Set,o=a=>{let r=xe(a);if(r&&!Se(a)){let i=`${r.name}:${r.node.startIndex}:${r.node.endIndex}`;s.has(i)||(s.add(i),n.push(r));return}for(let i of a.namedChildren)o(i)};return(t==="tsx"||t==="javascript")&&o(e),n}function xe(e){if(e.type==="function_declaration"){let a=O(e);return!a||!B(a)?null:{name:a,kind:P(a),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),s=f(t);if(!s||!n||!B(s))return null;let o=ye(n);return o?{name:s,kind:P(s),node:e,bodyNode:o}:null}function B(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function P(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function ye(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=ve(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Se(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function O(e){return f(e.childForFieldName("name")??e.namedChild(0))}function ve(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function $(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some($)}function ke(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=s=>{s.type==="jsx_opening_element"||s.type==="jsx_self_closing_element"?be(s,t):s.type==="jsx_expression"?Ce(s,t):s.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of s.namedChildren)n(o)};return n(e),t}function be(e,t){let n=Te(e),s=!1;if(n){let o=E(n);s=Fe(o),s?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let a=_e(o);if(!a)continue;let r=E(a);if(r.startsWith("on")&&r.length>2){let i=r.slice(2).replace(/^[A-Z]/,u=>u.toLowerCase());t.eventNames.add(i),t.tokens.add(`event:${i}`)}else ie.has(r)||(t.propNames.add(r),t.tokens.add(`${s?"prop":"native-prop"}:${r}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add("prop:spread")}function Ce(e,t){let n=e.text;(n.includes("&&")||n.includes("?"))&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let s of Be(n))ae.has(s)||t.tokens.add(`binding:${s}`)}function Te(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function _e(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function Re(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},s=o=>{if(o.type==="call_expression"){let a=C(o,t);a&&je(a.calleeLeaf,n)}else if(o.type==="variable_declarator")Le(o,n);else if(o.type==="function_declaration"){let a=O(o);a&&q(a,n)}for(let a of o.namedChildren)s(a)};return s(e),n}function je(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!F.has(e)&&!se.has(e)&&t.tokens.add(`hook:${e}`)),F.has(e)&&t.tokens.add(`react-hook:${e}`),te.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),ne.has(e)&&t.tokens.add(`state-hook:${e}`),we(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function we(e){if(oe.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Le(e,t){let n=e.childForFieldName("name")??e.namedChild(0),s=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&s?.text.includes("useState")){let a=n.namedChildren.find(i=>f(i)),r=f(a);r&&(t.stateNames.add(r),t.tokens.add(`state:${r}`))}let o=f(n);o&&q(o,t)}function q(e,t){let n=Ae(e);!n||!re.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Ae(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function Fe(e){return/^[A-Z]/.test(e)||e.includes(".")}function E(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function f(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Be(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let s=n[0];t.includes(s)||t.push(s)}return t}function m(e){return[...e].sort()}export{d as a,j as b,w as c,A as d,et as e};
3
- //# sourceMappingURL=chunk-HF25DFSC.js.map
@@ -1,2 +0,0 @@
1
- import{c as o,d as a}from"./chunk-BZ53S4ZN.js";import{a as p}from"./chunk-3VD3JMK2.js";import{a as c,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{c as u}from"./chunk-YZA6PPZL.js";function D(n,i={}){let{minSimilarity:t=.62,minTokens:e=8,limit:l=20,scope:d,scanLimit:h,filePattern:k,focusFiles:g}=i,P=C(n,{scope:d,minTokens:e,scanLimit:h});return p({profiles:P,limit:l,filePattern:k,focusFiles:g,compare:(r,s)=>T(r,s,t),sort:(r,s)=>s.similarity-r.similarity||r.fileA.localeCompare(s.fileA)||r.fileB.localeCompare(s.fileB)})}function C(n,i){return u(n,{scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(t=>({file:t.file,tokens:t.templateTokens,loc:v(t)}))}function v(n){return n.totalLines}function T(n,i,t){let e=c(n.tokens,i.tokens);if(e.size<6||!b(e))return null;let l=f(n.tokens,i.tokens);return l<t?null:{fileA:n.file,fileB:i.file,similarity:l,sharedTokens:a(e),sharedComponents:o(e,"component:"),sharedProps:o(e,"prop:"),sharedEvents:o(e,"event:"),sharedDirectives:o(e,"directive:"),sharedSlots:o(e,"slot:"),sharedIdentifiers:o(e,"id:"),uniqueToA:a(m(n.tokens,i.tokens)).slice(0,25),uniqueToB:a(m(i.tokens,n.tokens)).slice(0,25),locA:n.loc,locB:i.loc}}function b(n){let i=0,t=0;for(let e of n)e.startsWith("component:")&&(i+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("directive:")||e.startsWith("slot:"))&&(t+=1);return i>=1||t>=3}export{D as a};
2
- //# sourceMappingURL=chunk-HHN2B5KA.js.map
@@ -1,2 +0,0 @@
1
- import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-5OST6GYB.js";import{a as f}from"./chunk-RNM6LMCF.js";import{a as c}from"./chunk-JCLDUKT6.js";import{c as m}from"./chunk-JM72FNGA.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
2
- //# sourceMappingURL=chunk-IHUETYFW.js.map
@@ -1,38 +0,0 @@
1
- import{b as J,g as B,h as W,i as U,p as Y}from"./chunk-KDFONWTW.js";import{a as K,b as z,d as Q,f as V}from"./chunk-OLTESY4K.js";import{a as q,b as C}from"./chunk-TQ5W2H3S.js";import{a as x}from"./chunk-VUKC6F77.js";import{f as H,g as $,l as j,m as G}from"./chunk-2KHTSEIL.js";import{d as F,f as P}from"./chunk-JM72FNGA.js";import{d as E}from"./chunk-72KY2ZFO.js";import{a as T}from"./chunk-HF25DFSC.js";import{a as R}from"./chunk-DS6QEB3G.js";import{a as k,b as w,f as N,h as O}from"./chunk-XUGQU7PM.js";import{c as A,d as D}from"./chunk-7S5E7KWT.js";function De(e,n,l={}){let o=X(e,[n],{additive:l.additive,semantic:l.semantic}),i=l.callableOnly?(o.get(n.symbolId)??[]).filter(a=>P(a.symbol)):o.get(n.symbolId)??[];return typeof l.limit=="number"?i.slice(0,l.limit):i}function ke(e,n,l={}){let o=oe(e)?le(e,n,{semantic:l.semantic!==!1}):ie(e).get(n.symbolId)??[];return typeof l.limit=="number"?o.slice(0,l.limit):o}var ne=D("caller-rows",{clearGroups:["whole-project"]}),te=2e4;function oe(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>te}function ie(e){return ne.get(e,()=>{let n=$(e),l=X(e,n),o=new Map;for(let r of n)o.set(r.symbol,r.symbolId);let i=new Map,a=new Map;for(let r of n){let s=l.get(r.symbolId);if(!(!s||s.length===0))for(let u of s){let m=o.get(u.symbol);if(m===void 0||m===r.symbolId)continue;let d=i.get(m);d||(d=[],i.set(m,d),a.set(m,new Set));let f=`${r.symbol}|${r.relativePath}`;a.get(m).has(f)||(a.get(m).add(f),d.push({symbol:r.symbol,file:r.relativePath,source:"caller-map-inversion"}))}}return i})}function le(e,n,l){let o=[],i=new Set,a=s=>{if(s.symbol===n.symbol)return;let u=`${s.symbol}|${s.file}`;i.has(u)||(i.add(u),o.push(s))};for(let s of Y(e,n))s.file!==n.relativePath&&a({symbol:s.enclosingSymbol??s.file,file:s.file,source:"resolved-reference"});let r=l.semantic?se(e,n):null;if(r)for(let s of Q(e,r)){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let u=G(H(e,s.file),s.line);a({symbol:u?.symbol??s.file,file:s.file,source:"semantic-reference"})}return o}function se(e,n){return e.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 (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
11
- CASE WHEN gs.kind IN (5, 8, 11) 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`,n.symbolId)??null}function X(e,n,l={}){if(n.length===0)return new Map;let o=l.additive??!1,i=[],a=[];for(let d of n)T(d.relativePath)&&E(e,d.relativePath)!==null?i.push(d):a.push(d);let r=new Map,s=new Map,u=d=>{for(let[f,t]of d){let g=r.get(f);g||(g=[],r.set(f,g));let c=s.get(f);c||(c=new Set,s.set(f,c));for(let p of t){let h=`${p.symbol}|${p.chunkId}`;c.has(h)||(c.add(h),g.push(p))}}};i.length>0&&u(de(e,i)),l.semantic!==!1&&u(be(ae(e,n)));let m=o?n:a;return m.length>0&&u(pe(e,m)),r}function ae(e,n){let l=q(),o=new Map,i=[],a=[],r=0,s=0,u=0,m=0;if(C("semantic.callees.cache-scan",()=>{for(let c of n){if(!K(c.relativePath)){l&&(r+=1);continue}let p=R(e,c.relativePath);if(!p){l&&(s+=1),a.push(c);continue}let h=w(e,c.relativePath,p),_=me(e,c.relativePath),b=N(e,c.relativePath,c.symbol,h,_);if(b!==null){let y=ce(b);if(y){l&&(u+=1),y.length>0&&o.set(c.symbolId,y);continue}l&&(m+=1)}i.push({def:c,contentHash:h,depsDigest:_})}},()=>({definitions:n.length,skippedNonTs:r,sourceMissing:s,cacheHits:u,parseFailures:m,misses:i.length,unkeyed:a.length,resultRows:o.size})),i.length===0&&a.length===0)return o;let d=[...a,...i.map(c=>c.def)],f=0,t=C("semantic.callees.compute-misses",()=>{let c=V(e,d);return f=c.size,c},()=>({definitions:d.length,misses:i.length,unkeyed:a.length,rows:f}));for(let[c,p]of t)o.set(c,p);if(z(e).availability().available){let c=i.map(p=>({relativePath:p.def.relativePath,symbol:p.def.symbol,contentHash:p.contentHash,depsDigest:p.depsDigest,payload:JSON.stringify(t.get(p.def.symbolId)??[])}));C("semantic.callees.cache-write",()=>O(e,c),()=>({entries:c.length}))}else C("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:i.length}));return o}function ce(e){try{return JSON.parse(e)}catch{return null}}var re=A("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function me(e,n){return re.get(e,n,()=>{let o=[...x(e).get(n)??[]].sort().map(i=>`${i}:${w(e,i,R(e,i))}`);return k(o.join("|"))})}function de(e,n){let l=new Map,o=ue(n,l),i=U(e);for(let[a,r]of o){let s=E(e,a);if(!s)continue;let u=j(r);for(let m of s){let d=u.get(m.line);if(!d)continue;let f=fe(e,a,i,m.calleeLeaf,m.memberAccess);f&&f.symbol!==d.symbol&&l.get(d.symbolId).push({symbol:f.symbol,file:f.file,chunkId:m.line,source:"ast-callsite"})}}return l}function ue(e,n){let l=new Map;for(let o of e){let i=l.get(o.relativePath);i?i.push(o):l.set(o.relativePath,[o]),n.set(o.symbolId,[])}for(let o of l.values())o.sort((i,a)=>i.endLine-i.startLine-(a.endLine-a.startLine));return l}function fe(e,n,l,o,i){let a=B(n,l.get(o)??[]);return a.length===0?null:W(e,n,a,i)}function pe(e,n){if(n.length===0)return new Map;let o=L(n.map(t=>t.documentId)).flatMap(t=>e.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 (${t.map(()=>"?").join(",")})`,...t)),i=new Map;for(let t of o)i.has(t.document_id)||i.set(t.document_id,[]),i.get(t.document_id).push(t);let r=L(o.map(t=>t.symbol_id)).flatMap(t=>e.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 (${t.map(()=>"?").join(",")})
34
- GROUP BY m.symbol_id
35
- ) def_chunk ON def_chunk.symbol_id = gs.id
36
- WHERE gs.id IN (${t.map(()=>"?").join(",")})`,...t,...t)),s=L([...n.map(t=>t.documentId),...r.flatMap(t=>t.document_id===null?[]:[t.document_id])]),u=new Map(s.flatMap(t=>e.all(`SELECT id, relative_path FROM documents
37
- WHERE id IN (${t.map(()=>"?").join(",")})`,...t).map(g=>[g.id,g.relative_path]))),m=new Map;for(let t of r)m.has(t.symbol_id)||m.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?u.get(t.document_id)??"":""});let d=new Map,f=u;for(let t of n){let g=i.get(t.documentId)??[],c=new Set,p=[],h=null,_=()=>{if(h)return h;let b=f.get(t.documentId)??"",y=new Set;if(b){let M=J(e,b),I=Math.max(0,t.startLine),v=Math.min(M.length-1,t.endLine);for(let S=I;S<=v;S+=1)for(let ee of M[S])y.add(ee)}return h=y,y};for(let b of g){if(b.symbol_id===t.symbolId)continue;let y=m.get(b.symbol_id);if(!y)continue;if(!(b.start_line>=t.startLine&&b.end_line<=t.endLine)){if(!(b.start_line<=t.endLine&&b.end_line>=t.startLine))continue;let S=F(y.symbol);if(!S||!_().has(S))continue}let I=`${y.symbol}|${b.chunk_id}`;c.has(I)||(c.add(I),p.push({...y,chunkId:b.chunk_id,source:"scip-chunk"}))}d.set(t.symbolId,p)}return d}var Z=500;function L(e){let n=[...new Set(e)],l=[];for(let o=0;o<n.length;o+=Z)l.push(n.slice(o,o+Z));return l}function be(e){let n=new Map;for(let[l,o]of e){let i=[];for(let a of o)i.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(l,i)}return n}export{De as a,ke as b,X as c};
38
- //# sourceMappingURL=chunk-JCLDUKT6.js.map
@@ -1,2 +0,0 @@
1
- import{a as I}from"./chunk-54KGX7EX.js";import{a as H}from"./chunk-LSET2TXH.js";import{a as p}from"./chunk-JME7OWD3.js";import{a as T}from"./chunk-ZQDIXAF5.js";import{a as G}from"./chunk-VOYOYC5T.js";import{a as k}from"./chunk-BFXPG2VN.js";import{a as v,b as F}from"./chunk-6LJHXREW.js";import{b as D}from"./chunk-65AU3HFZ.js";import{b as S}from"./chunk-BSN22NRK.js";import{a as j}from"./chunk-6IR2AOBM.js";import{a as w}from"./chunk-VCQYSG2M.js";import{a as P}from"./chunk-7TWLSZK5.js";import{a as A}from"./chunk-Z4HICZGY.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t);if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
2
- //# sourceMappingURL=chunk-JGN2ZFJR.js.map
@@ -1,2 +0,0 @@
1
- var d={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function l(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let s=t[0],i=t[1],r=e.slice(s.length+1+i.length+1),n;if(r.startsWith("`")){let f=r.indexOf("`",1);f===-1?(n=r.slice(1),r=""):(n=r.slice(1,f),r=r.slice(f+2))}else{let f=r.indexOf(" ");f===-1?(n=r,r=""):(n=r.slice(0,f),r=r.slice(f+1))}let o,c=r.indexOf(" ");c===-1?(o=r,r=""):(o=r.slice(0,c),r=r.slice(c+1));let a=m(r);return{scheme:s,manager:i,packageName:n,version:o,descriptors:a,raw:e}}function b(e){let t=l(e);if("kind"in t)return null;for(let s=t.descriptors.length-2;s>=0;s--){let i=t.descriptors[s];if(i?.suffix==="type")return i.name}return null}function m(e){let t=[],s=0;for(;s<e.length;){if(e[s]==="["){let n=e.indexOf("]",s+1);if(n===-1){t.push({name:e.slice(s+1),suffix:"type-param"});break}t.push({name:e.slice(s+1,n),suffix:"type-param"}),s=n+1;continue}if(e[s]==="("&&(t.length===0||s===0||u(e[s-1]))){let n=e.indexOf(")",s+1);if(n!==-1&&e[n+1]!=="."){t.push({name:e.slice(s+1,n),suffix:"parameter"}),s=n+1;continue}}let i;if(e[s]==="`"){let n=e.indexOf("`",s+1);if(n===-1){i=e.slice(s+1),t.push({name:i,suffix:"term"});break}i=e.slice(s+1,n),s=n+1}else{let n=s;for(;s<e.length&&!u(e[s]);)s++;i=e.slice(n,s)}if(s>=e.length){i&&t.push({name:i,suffix:"term"});break}let r=e[s];if(r==="("){let n=e.indexOf(")",s+1);n!==-1&&e[n+1]==="."?(t.push({name:i,suffix:"method"}),s=n+2):n!==-1?(t.push({name:i,suffix:"method"}),s=n+1):(t.push({name:i,suffix:"term"}),s++)}else{let n=d[r];n&&t.push({name:i,suffix:n}),s+=1}}return t}function u(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function y(e){let t=l(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let s=t;if(s.descriptors.length===0)return s.raw;let i=[];for(let r of s.descriptors){let n=g(r);n&&i.push(n)}return i.join(":")}function g(e){let t=e.suffix==="namespace"?x(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function x(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function k(e){let t=l(e);if("kind"in t&&t.kind==="local")return t.id;let s=t;return s.descriptors.length===0?"":s.descriptors[s.descriptors.length-1].name}function p(e){let t=l(e);if("kind"in t&&t.kind==="local")return null;let s=t;return s.descriptors[s.descriptors.length-1]?.suffix??null}function D(e){return e.endsWith("().")||p(e)==="method"}function $(e){let t=p(e);return t==="method"||t==="term"}function T(e){return p(e)==="namespace"}var h=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function M(e){return h.test(e)}var S=new Set(["test","tests","_tests"]);function O(e){let t=l(e);if("kind"in t)return!1;for(let s=0;s<t.descriptors.length-1;s+=1){let i=t.descriptors[s];if(i?.suffix==="namespace"&&i.name&&S.has(i.name))return!0}return!1}function j(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}function I(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length<=r.length)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}export{l as a,b,y as c,k as d,p as e,D as f,$ as g,T as h,M as i,O as j,j as k,I as l};
2
- //# sourceMappingURL=chunk-JM72FNGA.js.map
@@ -1,2 +0,0 @@
1
- import{a as u}from"./chunk-5OST6GYB.js";import{a as h}from"./chunk-JCLDUKT6.js";import{q as S}from"./chunk-KDFONWTW.js";import{a as d,b}from"./chunk-TK7O5ER5.js";import{m as y}from"./chunk-2KHTSEIL.js";import{c as m}from"./chunk-JM72FNGA.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.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 M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.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{v as a};
2
- //# sourceMappingURL=chunk-JME7OWD3.js.map
@@ -1,40 +0,0 @@
1
- import{d as F}from"./chunk-OLTESY4K.js";import{c as R}from"./chunk-TK7O5ER5.js";import{b as h}from"./chunk-P5RYBRIO.js";import{u as w}from"./chunk-OBGRLXWF.js";import{f as y,m as _}from"./chunk-2KHTSEIL.js";import{d}from"./chunk-JM72FNGA.js";import{a as S}from"./chunk-72KY2ZFO.js";import{a as k}from"./chunk-HF25DFSC.js";import{a as m}from"./chunk-DS6QEB3G.js";import{c as E}from"./chunk-A536TEU4.js";import{c as u,d as v}from"./chunk-7S5E7KWT.js";function I(e,t,n,r={}){if(!n)return[];let i=m(e,t);return i?i.indexOf(n)===-1?[]:(N(e,t).get(n)??[]).filter(s=>!J(s,r)):[]}function J(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var U=u("file-identifiers",{clearGroups:["whole-project","source-file"]});function A(e,t){let n=S(e,t);return n?n.fileIdentifiers:U.get(e,t,()=>new Set(N(e,t).keys()))}var Z=u("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,t){let n=S(e,t);return n?n.identifierLineMap:Z.get(e,t,()=>Y(e,t))}var W=u("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function me(e,t){let n=S(e,t);return n?n.identifiersByLine:W.get(e,t,()=>{let r=N(e,t),i=0;for(let s of r.values()){let o=s[s.length-1];o!==void 0&&o>i&&(i=o)}let a=new Array(i+1);for(let s=0;s<=i;s+=1)a[s]=new Set;for(let[s,o]of r)for(let c of o)a[c].add(s);return a})}function Y(e,t){let n=new Map,r=(o,c)=>{let l=n.get(o);if(!l){n.set(o,[c]);return}l[l.length-1]!==c&&l.push(c)},i=m(e,t);if(!i)return n;let a=w(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let o=0;o<a.length;o+=1){let c=a[o]??"";for(let l of c.matchAll(s))l[1]&&r(l[1],o)}return n}function pe(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
2
- m.symbol_id,
3
- d.relative_path,
4
- COUNT(*) AS ref_count
5
- FROM mentions m
6
- JOIN chunks c ON m.chunk_id = c.id
7
- JOIN documents d ON c.document_id = d.id
8
- WHERE m.role != 1
9
- ${r}
10
- ${e.pathExclusionsFor("d")}
11
- GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function ge(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
12
- FROM mentions m
13
- JOIN chunks c ON m.chunk_id = c.id
14
- JOIN documents d ON c.document_id = d.id
15
- WHERE m.role != 1
16
- ${r}
17
- ${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function O(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
18
- c.start_line AS chunk_start, c.end_line AS chunk_end
19
- FROM mentions m
20
- JOIN chunks c ON m.chunk_id = c.id
21
- JOIN documents d ON c.document_id = d.id
22
- WHERE m.role != 1
23
- ${r}
24
- ${e.pathExclusionsFor("d")}
25
- ORDER BY d.relative_path, c.start_line`,...n??[])})}function x(e,t,n){if(!t)return n();if(t.length===0)return[];let r=[];for(let i=0;i<t.length;i+=750)r.push(...n(t.slice(i,i+750)));return r}function L(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function p(e,t){return L(e)===L(t)}var Q=u("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function P(e,t){let n=L(t);return Q.get(e,n,()=>V(e,n))}function V(e,t){let n=new Map;for(let r of h(e,t)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&T(n,i,r.sourcePath),r.kind==="namespace")for(let a of r.usedMembers)T(n,a,r.sourcePath)}return n}function T(e,t,n){let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}function Ce(e,t){let n=$(e);return n?t.filter(r=>$(r.file)===n):t}function Me(e,t,n,r){let i=n.find(a=>a.file===t);if(i)return i;if(r){let a=new Set(h(e,t).map(s=>s.sourcePath).filter(s=>!!s));for(let s of n)for(let o of a)if(p(o,s.file))return s;return null}return n.length===1?n[0]:null}function $(e){let t=k(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var X=v("global-leaf-index",{clearGroups:["whole-project"]});function C(e){return X.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
26
- COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
27
- FROM global_symbols gs
28
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
29
- LEFT JOIN documents der_doc ON der_doc.id = der.document_id
30
- LEFT JOIN (
31
- SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
32
- FROM mentions m
33
- JOIN chunks c ON m.chunk_id = c.id
34
- JOIN documents d ON c.document_id = d.id
35
- WHERE m.role = 1
36
- GROUP BY m.symbol_id
37
- ) mention_doc ON mention_doc.symbol_id = gs.id
38
- WHERE 1 = 1
39
- ${e.symbolNoiseFor("gs")}`),n=new Map;for(let r of t){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=d(r.symbol);if(!i)continue;let a=n.get(i);a||(a=[],n.set(i,a)),a.some(s=>s.symbolId===r.id)||a.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return n})}var j=/[A-Za-z_$][A-Za-z0-9_$]*/g,q=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function M(e){let t=[],n=!1;for(let r of e)r&&(n=!0,q.test(r)||t.push(r));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:t}}function B(e,t){let n=K(t)?t:M(t);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;j.lastIndex=0;let r;for(;(r=j.exec(e))!==null;)if(n.candidateNames.has(r[0]))return!0;for(let i of n.nonIdentifierNames)if(e.includes(i))return!0;return!1}function K(e){return"candidateNames"in e}function D(e,t,n){let r=C(e).get(n);if(!r||r.length===0)return[];if(r.length===1)return[g(r[0])];let i=r.filter(c=>c.file===t);if(i.length>0)return i.map(g);let a=P(e,t),s=a.get(n);if(s)for(let c of s){let l=r.filter(f=>p(c,f.file));if(l.length>0)return l.map(g)}let o=new Set;for(let c of a.values())for(let l of c)o.add(l);for(let c of o){let l=r.filter(f=>p(c,f.file));if(l.length>0&&l.length===r.length)return l.map(g)}return[]}function Ge(e,t,n){let r=D(e,t,n);if(r.length>0)return r;let i=C(e).get(n);return!i||i.length===0?[]:i.map(g)}function G(e,t,n={}){let r=R(e,t);if(!r)return[];let i=d(r.symbol);if(!i)return[];if(n.semantic!==!1){let s=F(e,{...r,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let o=new Map;for(let c of s){let l=o.get(c.file)??[];l.push(c.line),o.set(c.file,l)}return H(e,o)}}let a=new Map;for(let s of E(e)){let o=m(e,s);if(!o||o.indexOf(i)===-1||s!==r.relativePath&&!D(e,s,i).some(f=>f.symbolId===r.symbolId))continue;let c=I(e,s,i,s===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{});c.length>0&&a.set(s,c)}return H(e,a)}function ze(e,t){let n=new Map;for(let o of t){if(!o.leaf)continue;let c=n.get(o.leaf)??[];c.push(o),n.set(o.leaf,c)}if(n.size===0)return new Map;let r=new Set(t.map(o=>o.symbolId)),i=new Set(n.keys()),a=M(i),s=new Map;for(let o of E(e)){if(!B(m(e,o),a))continue;let c=A(e,o);if(c.size!==0){for(let l of c)if(n.has(l))for(let f of D(e,o,l)){if(!r.has(f.symbolId)||o===f.relativePath)continue;let b=s.get(f.symbolId);b||(b=new Set,s.set(f.symbolId,b)),b.add(o)}}}return s}function g(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function H(e,t){let n=[],r=new Set;for(let[i,a]of t){let s=y(e,i);for(let o of a){let c=_(s,o),l=`${i}|${o}|${c?.symbol??""}`;r.has(l)||(r.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}function ee(e,t){let n=se(e,t);return n?ae(e,te(e,n.match,n.identifier)):[]}function Xe(e,t,n={}){return ne(e,t,n).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function ne(e,t,n={}){let r=G(e,t,{semantic:n.semantic}),i=r.length>0?z(r,"source-attribution"):z(ee(e,t),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(a=>!e.isIgnored(a.file))}function z(e,t){return e.map(n=>({...n,provenance:t}))}function te(e,t,n){let r=new Map;for(let[i,a]of re(e,t.symbolId))r.set(i,ie(e,i,a,t,n));return r}function re(e,t){let n=new Map;for(let r of O(e,[t])){if(e.isIgnored(r.relative_path))continue;let i=n.get(r.relative_path);i||(i=[],n.set(r.relative_path,i)),i.push({start_line:r.chunk_start,end_line:r.chunk_end})}return n}function ie(e,t,n,r,i){let a=t===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?I(e,t,i,a):[];return n.flatMap(o=>oe(s,o))}function oe(e,t){let n=e.filter(r=>r>=t.start_line&&r<=t.end_line);return n.length>0?n:[t.start_line]}function se(e,t){let n=R(e,t);return n?{match:n,identifier:d(n.symbol)||null}:null}function ae(e,t){let n=[],r=new Set;for(let[i,a]of t){let s=y(e,i);for(let o of a){let c=_(s,o),l=`${i}|${o}|${c?.symbol??""}`;r.has(l)||(r.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}export{N as a,me as b,pe as c,ge as d,O as e,p as f,Ce as g,Me as h,C as i,M as j,B as k,P as l,D as m,Ge as n,ze as o,ee as p,Xe as q};
40
- //# sourceMappingURL=chunk-KDFONWTW.js.map
@@ -1,2 +0,0 @@
1
- import{a as d}from"./chunk-3VD3JMK2.js";import{c as a}from"./chunk-YWOOQ4FF.js";import{a as c}from"./chunk-VUKC6F77.js";function F(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:f}=e,r=e.minDeps??(f?1:3),{profiles:s,distinctiveDeps:p}=m(t,{scope:n,minDeps:r});return d({profiles:s,limit:l,filePattern:f,overrunFactor:5,compare:(i,u)=>D(i,u,o,p)})}function m(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:f,distinctiveDeps:r}=g(n),s=[];for(let[p,i]of n)i.size>=l&&s.push({file:p,deps:new Set([...i].filter(u=>!f.has(u)))});return{profiles:s,distinctiveDeps:r}}function g(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let s of r)n.set(s,(n.get(s)??0)+1);let f=Math.max(3,Math.ceil(l*.03));for(let[r,s]of n)s>=5&&s/l>.3?e.add(r):s<=f&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function D(t,e,o,l){let n=new Set;for(let i of t.deps)e.deps.has(i)&&n.add(i);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let f=0;for(let i of n)l.has(i)&&f++;if(f<2)return null;let r=a(t.deps,e.deps);if(r<o)return null;let s=[];for(let i of t.deps)e.deps.has(i)||s.push(i);let p=[];for(let i of e.deps)t.deps.has(i)||p.push(i);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:s,uniqueToB:p}}export{F as a};
2
- //# sourceMappingURL=chunk-LPL4MA6R.js.map
@@ -1,2 +0,0 @@
1
- import{a as C,b as k,c as o,d as f}from"./chunk-BZ53S4ZN.js";import{a as V}from"./chunk-3VD3JMK2.js";import{a as B,b}from"./chunk-YWOOQ4FF.js";import{c as y}from"./chunk-YZA6PPZL.js";function L(e,i={}){let{minSimilarity:u=.45,minSharedBehaviors:a=6,limit:r=20,scope:n,scanLimit:c,filePattern:d,focusFiles:h}=i,t=y(e,{scope:n,minBehaviorTokens:Math.max(3,a),scanLimit:c}).map(s=>({file:s.file,tokens:s.behaviorTokens,profile:s}));return V({profiles:t,limit:r,filePattern:d,focusFiles:h,compare:(s,l)=>R(s,l,u,a),sort:(s,l)=>l.similarity-s.similarity||s.fileA.localeCompare(l.fileA)||s.fileB.localeCompare(l.fileB)})}function R(e,i,u,a){let r=B(e.tokens,i.tokens);if(r.size<a||!P(r))return null;let n=k(e.tokens,i.tokens);if(n<u)return null;let c=o(r,"composable:"),d=o(r,"store:"),h=o(r,"reactivity:"),t=o(r,"lifecycle:"),s=o(r,"request:"),l=o(r,"function:"),g=o(r,"function-verb:"),v=o(r,"template-binding:"),p=o(r,"template-event:"),m=F({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:t,sharedRequests:s,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p});return{fileA:e.file,fileB:i.file,similarity:n,sharedTokens:f(r),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:t,sharedRequests:s,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:f(b(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(b(i.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:s,sharedLifecycle:t,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v}),locA:e.profile.totalLines,locB:i.profile.totalLines}}function F(e){return C({genericWords:q,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:T})}function T(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let i=0,u=0,a=0,r=0,n=0,c=0,d=0;for(let s of e)s.startsWith("composable:")?i+=1:s.startsWith("store:")?u+=1:s.startsWith("request:")?a+=1:s.startsWith("lifecycle:")?r+=1:s.startsWith("function:")?n+=1:s.startsWith("reactivity:")?c+=1:(s.startsWith("function-verb:")||s.startsWith("template-binding:")||s.startsWith("template-event:"))&&(d+=1);let h=i+u,t=h+a+r+n+d;return a>=1&&t>=4||r>=1&&n>=2&&t>=4||h>=2&&(a>=1||n>=2)&&t>=5||n>=2&&c>=1&&t>=4}function S(e){let i=[];return e.sharedComposables.length&&i.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&i.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&i.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&i.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&i.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&i.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&i.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),i.join("; ")||"shared Vue behavior profile"}var q=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{L as a};
2
- //# sourceMappingURL=chunk-LZHUWKGD.js.map
@@ -1,2 +0,0 @@
1
- import{a as g}from"./chunk-PFOCOG57.js";import{a as m}from"./chunk-5OST6GYB.js";import{a as d}from"./chunk-BGBBVSH4.js";import{c as u}from"./chunk-JM72FNGA.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
- //# sourceMappingURL=chunk-M4COR2H6.js.map
@@ -1,21 +0,0 @@
1
- import{a as C}from"./chunk-5OST6GYB.js";import{e as S}from"./chunk-OLTESY4K.js";import{c as y,f as p,h as b}from"./chunk-JM72FNGA.js";import{execFileSync as g}from"child_process";import{existsSync as v,readFileSync as E}from"fs";import{basename as F}from"path";function R(e){let t=new Map;for(let i of e){let n=t.get(i.file);n||(n=[],t.set(i.file,n)),n.push(i)}return t}var B="Unable to compute git diff.";function ge(e,t={}){let i=t.plan??P(e,t);return i.note?A(i.note,i.changedFileLines):i.changedFiles.length===0?O(i.changedFileLines):T(i.changedFiles,[$(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function P(e,t={}){let{base:i="HEAD"}=t;try{let n=k(e.config.projectRoot,i),r=Y(e,n),s=j(e,z(e.config.projectRoot,i));return{changedFileLines:n,changedFiles:r,changedRanges:s,renamedFiles:H(e.config.projectRoot,i,r),note:n.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:B}}}function $(e,t,i,n=[]){let r=new C(e),s=new Set(i),a=R(n),o=[],d=new Map,f=t.flatMap(c=>r.definitionsForFile(c)).filter(te).filter(c=>Z(c,a)).sort((c,m)=>c.relativePath.localeCompare(m.relativePath)||c.startLine-m.startLine),l=f.map(c=>c.symbolId),u=X(e,l),M=ee(e,l,i),N=S(e,f.filter(c=>u.get(c.symbolId)===0));for(let c of f)Q(e,c,s,o,d,N.get(c.symbolId)??new Set,u.get(c.symbolId)??0,M.get(c.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...d.entries()].map(([c,m])=>({file:c,symbols:[...m].sort()}))}}function T(e,t){let i=new Map,n=t.flatMap(s=>s.changedSymbols);for(let s of t)for(let a of s.consumerEntries){let o=i.get(a.file);o||(o=new Set,i.set(a.file,o));for(let d of a.symbols)o.add(d)}let r=ne(i);return{changedFiles:[...e],changedSymbols:n,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:n.length,totalAffectedFiles:r.length}}}function A(e,t=[]){return{changedFiles:t,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:t.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function O(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function k(e,t){let i=g("git",["diff","--name-only",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-only","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([i,n,r].flatMap(s=>s.split(`
2
- `)).map(s=>s.trim()).filter(s=>s.length>0))]}function z(e,t){let i=g("git",["diff","--unified=0",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--unified=0","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return _([...D(i),...D(n)])}function h(e,t,i){try{return g("git",["show",`${t}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function ue(e,t,i=[]){let n=W(e,t,i);return r=>(n.has(r)||n.set(r,h(e,t,r)),n.get(r)??null)}function me(e,t=e.changedFiles){let i=new Map(e.renamedFiles.map(n=>[n.to,n.from]));return[...new Set(t.map(n=>i.get(n)??n))]}function W(e,t,i){let n=[...new Set(i)],r=new Map;if(n.length===0)return r;try{let s=n.map(o=>`${t}:./${o}
3
- `).join(""),a=g("git",["cat-file","--batch"],{cwd:e,input:s,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]});return U(a,n)}catch{for(let s of n)r.set(s,h(e,t,s));return r}}function U(e,t){let i=new Map,n=0;for(let r of t){let s=e.indexOf(10,n);if(s<0)throw new Error("git cat-file batch output ended before object header");let a=e.subarray(n,s).toString("utf-8");if(n=s+1,a.endsWith(" missing")){i.set(r,null);continue}let o=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(a);if(!o)throw new Error(`unexpected git cat-file batch header: ${a}`);let[,d,f]=o,l=Number(f);if(!Number.isFinite(l)||l<0)throw new Error(`unexpected git cat-file batch size: ${a}`);if(n+l>e.length)throw new Error("git cat-file batch output ended before blob payload");let u=e.subarray(n,n+l);i.set(r,d==="blob"?u.toString("utf-8"):null),n+=l,e[n]===10&&(n+=1)}return i}function H(e,t,i){if(i.length===0)return[];let n=new Map,r=new Set;for(let a of q(e,t))i.includes(a.to)&&(n.set(a.to,a),r.add(a.from));let s=J(e,t);if(s.length===0)return[...n.values()].sort((a,o)=>a.to.localeCompare(o.to));for(let a of i){if(n.has(a)||!v(`${e}/${a}`))continue;let o=s.filter(l=>!r.has(l)).filter(l=>F(l)===F(a));if(o.length===0)continue;let d=E(`${e}/${a}`,"utf-8"),f=o.map(l=>({from:l,to:a,similarity:G(h(e,t,l)??"",d)})).sort((l,u)=>u.similarity-l.similarity)[0];f&&f.similarity>=.45&&(n.set(a,f),r.add(f.from))}return[...n.values()].sort((a,o)=>a.to.localeCompare(o.to))}function J(e,t){let i=g("git",["diff","--name-only","--diff-filter=D",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-only","--diff-filter=D","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([...w(i),...w(n)])]}function q(e,t){let i=g("git",["diff","--name-status","--find-renames",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-status","--find-renames","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return[...i.split(`
4
- `),...n.split(`
5
- `)].map(r=>r.trim()).filter(r=>r.startsWith("R")).map(r=>r.split(" ")).filter(r=>r.length>=3).map(([r,s,a])=>({from:s,to:a,similarity:Number(r.slice(1))/100}))}function G(e,t){let i=new Set(I(e)),n=new Set(I(t));if(i.size===0&&n.size===0)return 1;if(i.size===0||n.size===0)return 0;let r=0;for(let s of i)n.has(s)&&(r+=1);return 2*r/(i.size+n.size)}function I(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function w(e){return e.split(`
6
- `).map(t=>t.trim()).filter(t=>t.length>0)}function Y(e,t){let i=x(e),n=[];for(let r of t){let s=i(r);s&&!e.isIgnored(s)&&n.push(s)}return n}function j(e,t){let i=x(e),n=[];for(let r of t){let s=i(r.file);s&&!e.isIgnored(s)&&n.push({...r,file:s})}return _(n)}function x(e){let t=e.all(`SELECT relative_path FROM documents
7
- ORDER BY id`).map(n=>n.relative_path),i=new Map(t.map(n=>[n,n]));return n=>{let r=n.replace(/\\/g,"/"),s=i.get(r);return s||(t.find(a=>a.endsWith(r))??null)}}function D(e){let t=[],i=null;for(let n of e.split(`
8
- `)){if(n.startsWith("+++ ")){i=V(n.slice(4).trim());continue}if(!i||!n.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(n);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);t.push({file:i,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return t}function V(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function _(e){let t=new Set,i=[];for(let n of e){let r=`${n.file}:${n.startLine}:${n.endLine}`;t.has(r)||(t.add(r),i.push(n))}return i}function Z(e,t){let i=t.get(e.relativePath);return!i||i.length===0?!0:i.some(n=>K(e.startLine,e.endLine,n.startLine,n.endLine))}function K(e,t,i,n){return e<=n&&i<=t}function Q(e,t,i,n,r,s,a,o){let d=Math.max(a,s.size);if(!ie(t,d))return;let f=y(t.symbol);n.push({symbol:t.symbol,shortName:f,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,fanIn:d});for(let l of o)L(e,i,r,l,f);for(let l of s)L(e,i,r,l,f)}function X(e,t){if(t.length===0)return new Map;let i=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
9
- FROM mentions m
10
- JOIN chunks c ON m.chunk_id = c.id
11
- WHERE m.symbol_id IN (${t.map(()=>"?").join(",")})
12
- AND m.role != 1
13
- GROUP BY m.symbol_id`,...t);return new Map(i.map(n=>[n.symbol_id,n.fan_in]))}function ee(e,t,i){if(t.length===0||i.length===0)return new Map;let n=e.all(`SELECT DISTINCT m.symbol_id, ref_d.relative_path
14
- FROM mentions m
15
- JOIN chunks c ON m.chunk_id = c.id
16
- JOIN documents ref_d ON c.document_id = ref_d.id
17
- WHERE m.symbol_id IN (${t.map(()=>"?").join(",")})
18
- AND m.role != 1
19
- AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
20
- ${e.pathExclusionsFor("ref_d")}`,...t,...i),r=new Map;for(let s of n){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function L(e,t,i,n,r){if(e.isIgnored(n)||t.has(n))return;let s=i.get(n);s||(s=new Set,i.set(n,s)),s.add(r)}function ne(e){return[...e.entries()].map(([t,i])=>({file:t,consumedSymbols:i.size})).sort((t,i)=>i.consumedSymbols-t.consumedSymbols)}function te(e){return!(b(e.symbol)||e.parentTypeName!==null&&!p(e.symbol))}function ie(e,t){return p(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&t>0}export{R as a,B as b,ge as c,P as d,$ as e,T as f,h as g,ue as h,me as i,W as j};
21
- //# sourceMappingURL=chunk-NOJAM5ZV.js.map
@@ -1,2 +0,0 @@
1
- import{b as h}from"./chunk-B75HZHUP.js";import{a as u}from"./chunk-5OST6GYB.js";import{a as o}from"./chunk-BGBBVSH4.js";import{e as p}from"./chunk-OLTESY4K.js";import{c as y}from"./chunk-JM72FNGA.js";function W(m,c={}){let{scope:I,minLoc:C=3,scanLimit:r}=c,s=new u(m),d=c.semantic!==!1,b=h(s.productionCallableDefinitions({scope:I,minLoc:C,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof r=="number"&&r>0}),r),l=s.symbolsWithNonSelfCallees(b,{additive:!1,semantic:!1}),i=b.filter(e=>!l.has(e.symbolId)),L=s.crossFileCallerMap(i,{semantic:!1}),a=new Set(L.keys());for(let e of s.frameworkReferencedSymbolIds(i))a.add(e);let t=i.filter(e=>!a.has(e.symbolId));if(d&&t.length>0){for(let e of p(m,t).keys())a.add(e);for(let e of s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))l.add(e);t=t.filter(e=>!a.has(e.symbolId)).filter(e=>!l.has(e.symbolId))}let S=s.sourceFallbackCallerFiles(t);for(let e of S.keys())a.add(e);let f=t.filter(e=>!a.has(e.symbolId)),v=s.symbolsWithNonSelfCallees(f,{additive:!0,semantic:d});for(let e of v)l.add(e);return f.filter(e=>!l.has(e.symbolId)).sort((e,n)=>o(n)-o(e)||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine).map(e=>({symbol:e.symbol,shortName:y(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o(e)}))}export{W as a};
2
- //# sourceMappingURL=chunk-O6ZH6C6Y.js.map
@@ -1,3 +0,0 @@
1
- import{a as w}from"./chunk-XUGQU7PM.js";import{a as v}from"./chunk-64MNV6AB.js";import{a as O,d as D,f as P}from"./chunk-7S5E7KWT.js";function V(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Rt=P("stripped-lines",{clearGroups:["whole-project","source-file"]});O({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,h=""},clearFile:()=>{_=null,h=""}});var _=null,h="";function Y(t){return _===t||(_=t,h=V(t)),h}function Ct(t,n,e){let r=Y(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function $t(t,n){return new RegExp(`\\b${X(n)}\\b`,"m").test(t)}function jt(t,n){let e=new Set,r=new RegExp(`\\b${X(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function X(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as K,dirname as S,extname as p,join as g,relative as m,resolve as u}from"path";var Q=D("indexed-paths",{clearGroups:[]}),Z=D("indexed-path-digest",{clearGroups:[]}),I=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],b=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],A=[".rs"],L=[".rb"],W=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],H=[".cs",".vb"],U=[".dart"],G=[".php"],q=new Set(I),R=new Set(b),J=new Set(k),C=new Set(A),$=new Set(L),M=new Set(W),B=new Set(H),j=new Set(U),F=new Set(G),tt=[{extensions:I,lookup:q},{extensions:b,lookup:R},{extensions:k,lookup:J},{extensions:A,lookup:C},{extensions:L,lookup:$},{extensions:W,lookup:M},{extensions:H,lookup:B},{extensions:U,lookup:j},{extensions:G,lookup:F}];function x(t,n){return n.has(p(t).toLowerCase())}function nt(t){return x(t,R)}function et(t){return x(t,J)}function rt(t){return x(t,C)}function ot(t){return x(t,$)}function st(t){return x(t,M)}function it(t){return x(t,B)}function kt(t){return p(t).toLowerCase()===".vb"}function ct(t){return x(t,j)}function at(t){return x(t,F)}function lt(t){let n=p(t).toLowerCase();for(let e of tt)if(e.lookup.has(n))return e.extensions;return I}function ut(t){return et(t)||it(t)||at(t)}function At(t,n,e){return nt(n)?pt(t,n,e):rt(n)?ft(t,n,e):ot(n)?St(t,n,e):st(n)?xt(t,n,e):ut(n)?dt(t,e.replace(/\\/g,"."),lt(n)):ct(n)?Et(t,n,e):gt(t,n,e)}function gt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=E(t);for(let c of _t(o)){let a=d(m(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(m(t.config.projectRoot,o))}function pt(t,n,e){let r=E(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of ht(o)){let c=d(m(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function ft(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),y(t,mt(s))}function St(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return y(t,It(o))}function xt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return y(t,o)}function dt(t,n,e){let r=E(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,N=[...r].find(z=>z.endsWith(l));if(N)return N}for(let i of e){let l=[...r].find(N=>K(N)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function Et(t,n,e){let r=E(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of Nt(s)){let a=d(m(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function ht(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function y(t,n){let e=E(t);for(let r of n){let o=d(m(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function mt(t){let n=p(t);return C.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function It(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function Nt(t){let n=p(t);return j.has(n)?[t]:[`${t}.dart`,t]}function _t(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of I)e.add(t.slice(0,-n.length)+r)}else for(let r of I)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function E(t){return Q.get(t,()=>new Set(v(t,{includeIgnored:!1}).map(d)))}function Lt(t){return Z.get(t,()=>w([...E(t)].sort().join(`
2
- `)))}function d(t){return t.replace(/\\/g,"/")}export{I as a,b,k as c,A as d,L as e,W as f,H as g,U as h,G as i,kt as j,lt as k,At as l,pt as m,ft as n,St as o,xt as p,dt as q,Et as r,Lt as s,d as t,V as u,Ct as v,$t as w,jt as x,yt as y};
3
- //# sourceMappingURL=chunk-OBGRLXWF.js.map
@@ -1,3 +0,0 @@
1
- import{a as k,b as S}from"./chunk-TQ5W2H3S.js";import{l as H}from"./chunk-OBGRLXWF.js";import{f as D}from"./chunk-2KHTSEIL.js";import{d as P,e as oe}from"./chunk-JM72FNGA.js";import{c as ne,g as ie,i as re}from"./chunk-XUGQU7PM.js";import{a as O}from"./chunk-64MNV6AB.js";import{a as ee,c as te}from"./chunk-7S5E7KWT.js";import{performance as m}from"perf_hooks";function b(r,t,e){if(r.has(t))return r.get(t);let n=e();return r.set(t,n),n}import se from"path";function Ae(r,t){return r.getReferences().map(e=>{let n=e.getNode();return U(n,t)})}function Oe(r){let t=r;return typeof t.findReferences=="function"?t.findReferences():[]}function ae(r,t,e,n){let i=[];for(let o of Oe(r))for(let s of Ae(o,n))s.file===t.relativePath&&s.line>=t.startLine&&s.line<=t.endLine||i.push(s);for(let o of e)i.push(o);return C(i)}function ce(r,t,e,n){let i=[],o=e?.getStart();for(let s of r.getReferences()){let a=s.getNode();N(n,a.getSourceFile().getFilePath())===t&&(o!==void 0&&a.getStart()===o||i.push({location:U(a,n),node:a}))}return i}function U(r,t){let e=r.getSourceFile(),n=e.getLineAndColumnAtPos(r.getStart());return{file:N(t,e.getFilePath())??e.getBaseName(),line:n.line-1,column:n.column-1}}function le(r,t,e){let n=r.getSourceFile(),i=$(n,r),o=r.getText(),s=new RegExp(`\\b${Ue(o)}\\b`,"g"),a=n.getFullText().split(`
2
- `),c=[];for(let l=0;l<a.length;l++){if(l===i)continue;let d=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(d))!==null;)c.push({file:t,line:l,column:p.index})}return C(c.filter(l=>N(e,se.join(e,l.file))===t))}function _(r){for(let t=r;t;t=t.getParent()){let e=t.getKindName();if(e.includes("Type")||e==="InterfaceDeclaration"||e==="TypeAliasDeclaration")return!0;if(e==="CallExpression"||e==="NewExpression"||e==="ExpressionStatement")return!1}return!1}function $(r,t){return r.getLineAndColumnAtPos(t.getStart()).line-1}function C(r){let t=new Set,e=[];for(let n of r){let i=`${n.file}:${n.line}:${n.column}`;t.has(i)||(t.add(i),e.push(n))}return e}function N(r,t){let e=se.relative(r||process.cwd(),t).replace(/\\/g,"/");return!e||e.startsWith("..")?null:e}function Ue(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(r,t,e,n){let i=We(t,n);return i.size===0?new Map:Be(r,e,i)}function We(r,t){let e=new Map;for(let n of D(r,t)){let i=P(n.symbol)??n.leaf;if(!i)continue;let o=e.get(i);o||(o=[],e.set(i,o)),o.push(n)}return e}function Be(r,t,e){let n=new Map,i=new Map;return t.forEachDescendant(o=>{for(let s of He(r,o)){let a=e.get(s);if(!a)continue;let c=$(t,o);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let d=Math.abs(c-l.startLine),p=i.get(l.symbolId);p!==void 0&&p<=d||(i.set(l.symbolId,d),n.set(l.symbolId,o))}}}),n}function He(r,t){let e=[],n=i=>{i&&!e.includes(i)&&e.push(i)};if("getNameNode"in t&&typeof t.getNameNode=="function"){let i=t.getNameNode();n(i?.getText())}if("getName"in t&&typeof t.getName=="function"){let i=t.getName();n(i)}return r.Node.isIdentifier(t)&&n(t.getText()),e}var _e=te("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function de(r,t,e,n){let i=me(r,t),o=pe(i.get(n)??[],e);if(o)return o;let s=[];for(let a of i.values())for(let c of a)((c.leaf||P(c.symbol)||"").includes(n)||c.symbol.includes(n))&&s.push(c);return pe(s,e)}function ue(r,t){let e=new Map;for(let[n,i]of me(r,t)){let o=i[0];o&&e.set(n,o)}return e}function me(r,t){return _e.get(r,t,()=>{let e=new Map;for(let n of D(r,t)){let i=n.leaf||P(n.symbol);if(!i)continue;let o=e.get(i);o||(o=[],e.set(i,o)),o.push({...n,leaf:i})}for(let n of e.values())n.sort((i,o)=>i.startLine-o.startLine||i.endLine-o.endLine||i.symbolId-o.symbolId);return e})}function pe(r,t){let e=null,n=Number.POSITIVE_INFINITY;for(let i of r){let o=Math.abs(i.startLine-t);(o<n||o===n&&e&&i.startLine<e.startLine)&&(e=i,n=o)}return e}import z from"path";var T=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function R(r){let t=r.toLowerCase();return T.some(e=>t.endsWith(e))}function ge(r,t){let e=new Map,n=null,i=null,o=()=>(i??=O(r,{extensions:T}),i),s=()=>(n??=S("typescript.source-file-index",()=>$e(r.config.projectRoot,t,o()),()=>({projects:t.length,indexedDocuments:o().length})),n),a=c=>R(c)?b(e,c,()=>{let l=w(z.resolve(r.config.projectRoot,c));for(let{project:d,sourceFiles:p}of s()){let f=p.get(l)??null;if(f||(f=d.addSourceFileAtPathIfExists(l)??null,f&&p.set(w(f.getFilePath()),f)),f)return{project:d,sourceFile:f}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:o}}function $e(r,t,e){let n=t.map(({project:i})=>({project:i,sourceFiles:new Map(i.getSourceFiles().map(o=>[w(o.getFilePath()),o]))}));for(let i of e){let o=w(z.resolve(r,i));for(let s of n){if(s.sourceFiles.has(o))break;let a=s.project.addSourceFileAtPathIfExists(o)??null;if(a){s.sourceFiles.set(w(a.getFilePath()),a);break}}}return n}function w(r){return z.resolve(r)}import F from"path";import{existsSync as W,readdirSync as ze,readFileSync as ye}from"fs";function he(r){let t=F.join(r,"package.json");if(!W(t))return[];let e;try{e=JSON.parse(ye(t,"utf8"))}catch{return[]}return(Array.isArray(e.workspaces)?e.workspaces:e.workspaces?.packages??[]).flatMap(i=>Ve(r,i)).flatMap(i=>qe(r,i))}function Ve(r,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let s=F.join(r,t);return W(F.join(s,"package.json"))?[s]:[]}let e=t.indexOf("*"),n=t.slice(0,e).replace(/\/$/,""),i=t.slice(e+1).replace(/^\//,""),o=F.join(r,n||".");if(!W(o))return[];try{return ze(o).map(s=>F.join(o,s,i)).filter(s=>W(F.join(s,"package.json")))}catch{return[]}}function qe(r,t){try{let e=JSON.parse(ye(F.join(t,"package.json"),"utf8"));if(!e.name)return[];let n=F.relative(r,t).replace(/\\/g,"/");return[{name:e.name,rootRelative:n,sourceRootRelative:`${n}/src`}]}catch{return[]}}function Se(r,t){for(let e of r)if(t===e.name||t.startsWith(`${e.name}/`))return e.name;return null}function be(r){return[`${r.sourceRootRelative}/index.ts`,`${r.sourceRootRelative}/index.tsx`,`${r.sourceRootRelative}/index.mts`,`${r.sourceRootRelative}/index.cts`]}import{existsSync as L,readFileSync as Je,readdirSync as Ke,statSync as Ge}from"fs";import h from"path";var q=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function J(r,t){let n=t?h.dirname(h.join(r,t)):r,i=h.resolve(r);for(;n.startsWith(i);){for(let s of q){let a=h.join(n,s);if(L(a))return a}let o=h.dirname(n);if(o===n)break;n=o}for(let o of q){let s=h.join(r,o);if(L(s))return s}return null}function Me(r){let t=r.config.projectRoot,e=new Set(Ye(t,r.config.semantic?.typescript?.tsconfigs)),n=O(r,{includeIgnored:!1,extensions:T});for(let i of n){let o=J(t,i);o&&e.add(h.resolve(o))}if(e.size===0){let i=J(t);i&&e.add(h.resolve(i))}return[...e].filter(i=>!Ie(t,i)).sort((i,o)=>i.localeCompare(o))}function Ye(r,t=[]){let e=new Set;for(let n of t){let i=h.isAbsolute(n)?n:h.join(r,n);L(i)&&e.add(h.resolve(i))}for(let n of Xe(r))for(let i of q){let o=h.join(n,i);L(o)&&e.add(h.resolve(o))}if(e.size===0){let n=J(r);n&&e.add(h.resolve(n))}return[...e].filter(n=>!Ie(r,n)).sort((n,i)=>n.localeCompare(i))}function Xe(r){let t=h.join(r,"package.json");if(!L(t))return[];let e;try{e=JSON.parse(Je(t,"utf8"))}catch{return[]}return(Array.isArray(e.workspaces)?e.workspaces:e.workspaces?.packages??[]).flatMap(i=>Qe(r,i))}function Qe(r,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let s=h.join(r,t);return V(s)?[s]:[]}let e=t.indexOf("*"),n=t.slice(0,e).replace(/\/$/,""),i=t.slice(e+1).replace(/^\//,""),o=h.join(r,n||".");return V(o)?Ke(o).map(s=>h.join(o,s,i)).filter(V):[]}function V(r){try{return Ge(r).isDirectory()}catch{return!1}}function Ie(r,t){let e=h.relative(r,t).replace(/\\/g,"/");return e.startsWith("..")||e.includes("/node_modules/")||e.startsWith("node_modules/")||e.includes("/dist/")||e.startsWith("dist/")}import{createRequire as Ze}from"module";var et=Ze(import.meta.url),j;function xe(){if(j!==void 0)return j;try{j=et("ts-morph")}catch{j=null}return j}function ke(r,t){return t.map(e=>({tsconfigPath:e,project:new r.Project({tsConfigFilePath:e,skipFileDependencyResolution:!0})}))}function B(r,t,e){return{language:"typescript",availability:()=>({available:!1,reason:r,tsconfigPath:t,tsconfigPaths:e}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var tt=32;function Ce(r,t){let e=S("typescript.provider.load",()=>xe());if(!e)return B("ts-morph is not installed");let n=S("typescript.provider.tsconfig-discovery",()=>Me(r));if(n.length===0)return B("no tsconfig found");try{let i=S("typescript.provider.project-bundles",()=>ke(e,n),()=>({tsconfigs:n.length}));return S("typescript.provider.construct",()=>new K(r,e,i),()=>({tsconfigs:n.length}))}catch(i){return B(i instanceof Error?i.message:String(i),n[0],n)}}var K=class{constructor(t,e,n){this.db=t;this.tsMorph=e;this.projects=n;this.workspacePackages=he(t.config.projectRoot),this.sourceFiles=ge(t,n)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(t=>t.tsconfigPath)}}importUsage(t){return b(this.importUsageCache,t,()=>{let e=this.sourceFiles.sourceFile(t);if(!e)return[];let n=it();return S("typescript.import-usage.file",()=>this.importUsageForSourceFile(t,e,n),()=>({file:t,...n}))})}referencesFor(t){return b(this.referencesCache,t.symbolId,()=>{let e=this.nodeForDefinition(t);return this.referencesForDefinitionNode(t,e)})}referencesForDefinitions(t){let e=new Map,n=k(),i=[];for(let c of t){let l=this.referencesCache.get(c.symbolId);l?e.set(c.symbolId,l):i.push(c)}if(i.length===0)return e;let o=i,s=i.filter(c=>!ve(c));if(s.length>=tt){let c=this.referencesForDefinitionsBySymbolScan(s);for(let l of s){let d=c.get(l.symbolId)??[];this.referencesCache.set(l.symbolId,d),e.set(l.symbolId,d)}if(o=i.filter(l=>ve(l)),o.length===0)return e}let a=new Map;for(let c of o){let l=a.get(c.relativePath);l?l.push(c):a.set(c.relativePath,[c])}for(let[c,l]of a){let d=De();S("typescript.references-map.file",()=>{let p=this.definitionNodesForFile(c);for(let f of l){n&&(d.cacheMisses+=1);let u=p.get(f.symbolId)??null;n&&(u?d.nodeHits+=1:d.nodeMisses+=1);let g=this.referencesForDefinitionNode(f,u,n?d:void 0);this.referencesCache.set(f.symbolId,g),e.set(f.symbolId,g)}},()=>({relativePath:c,definitions:l.length,...Re(d)}))}return e}referencesForDefinitionsBySymbolScan(t){let e=k(),n=De(),i=new Map,o=new Set(t.map(a=>a.symbolId)),s=new Map(t.map(a=>[a.symbolId,a]));for(let a of t)i.set(a.symbolId,[]);return S("typescript.references-map.inverted-scan",()=>{let a=e?m.now():0;for(let p of t){let f=this.packageImportReferencesForDefinition(p);if(f.length>0){let u=i.get(p.symbolId)??[];u.push(...f),i.set(p.symbolId,u)}e&&(n.packageReferenceCount+=f.length)}e&&(n.packageRefsMs+=m.now()-a);let c=new Map,l=new Set(t.map(p=>p.leaf).filter(Boolean)),d=e?m.now():0;for(let p of this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(p))continue;let f=this.sourceFiles.sourceFile(p);f&&(e&&(n.scanFiles+=1),this.addReferencesFromSourceFileScan(f,p,o,s,l,c,i,e?n:void 0))}e&&(n.scanMs+=m.now()-d);for(let[p,f]of i){let u=C(f);i.set(p,u),e&&(n.referenceCount+=u.length)}},()=>({definitions:t.length,...Re(n)})),i}addReferencesFromSourceFileScan(t,e,n,i,o,s,a,c){let l=this.compilerCheckerForSourceFile(t),d=t.compilerNode,p=st(t),f=u=>{if(this.tsMorph.ts.isIdentifier(u)){if(c&&(c.identifiers+=1),!o.has(u.text)&&!p.has(u.text)){this.tsMorph.ts.forEachChild(u,f);return}let g=this.compilerReferenceSymbol(l,u,c);if(g){let y;if(s.has(g)?y=s.get(g)??null:(y=this.definitionFromCompilerSymbol(g),s.set(g,y)),c&&(y?c.targetHits+=1:c.targetMisses+=1),y&&n.has(y.symbolId)){c&&(c.requestedHits+=1);let v=i.get(y.symbolId);if(v&&!ct(v,e,Fe(d,u))){let I=a.get(y.symbolId)??[],A=d.getLineAndCharacterOfPosition(u.getStart(d));I.push({file:e,line:A.line,column:A.character}),a.set(y.symbolId,I)}}}}this.tsMorph.ts.forEachChild(u,f)};f(d)}compilerReferenceSymbol(t,e,n){n&&(n.symbolLookups+=1);let i=t.getSymbolAtLocation(e);if(i){if((i.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return i;try{return n&&(n.aliasResolutions+=1),t.getAliasedSymbol(i)}catch{return i}}}calleesFor(t){return b(this.calleesCache,t.symbolId,()=>b(this.fileCalleesCache,t.relativePath,()=>this.calleeMapForFile(t.relativePath)).get(t.symbolId)??[])}calleesForDefinitions(t){let e=new Map,n=new Map;for(let i of t){let o=n.get(i.relativePath);o?o.push(i):n.set(i.relativePath,[i])}for(let[i,o]of n){let s=this.fileCalleesCache.get(i),a=new Set(o.map(l=>l.symbolId)),c=s??this.calleeMapForFile(i,a);for(let l of o){let d=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,d),e.set(l.symbolId,d)}}return e}referencesForDefinitionNode(t,e,n){let i=n?m.now():0,o=this.packageImportReferencesForDefinition(t);if(n&&(n.packageRefsMs+=m.now()-i,n.packageReferenceCount+=o.length),!e)return o;let s=n?m.now():0,a=ae(e,t,o,this.db.config.projectRoot);return n&&(n.semanticRefsMs+=m.now()-s,n.referenceCount+=a.length),a}signatureFor(t){return b(this.signatureCache,t.symbolId,()=>{let e=this.nodeForDefinition(t);if(!e||!this.tsMorph.Node.isFunctionDeclaration(e)&&!this.tsMorph.Node.isMethodDeclaration(e)&&!this.tsMorph.Node.isArrowFunction(e)&&!this.tsMorph.Node.isFunctionExpression(e)&&!this.tsMorph.Node.isConstructorDeclaration(e))return null;let n=e.getType().getCallSignatures()[0];if(!n)return null;let i=n.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return Pe(c)}),o=n.getReturnType().getText(e);return`(${i.join(",")})=>${Pe(o)}`})}importUsageForSourceFile(t,e,n){let i=[],o=new Map;for(let s of e.getImportDeclarations()){n.declarations+=1;let a=H(this.db,t,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of G(s)){n.entries+=1;let d=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(d?n.bindingSymbols+=1:n.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:d,references:[]};if(i.push(p),c||!l.localName||!d)continue;let f=o.get(l.localName);f?f.push(p):o.set(l.localName,[p])}}return o.size>0&&e.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=o.get(s.getText());if(!a||rt(s))return;n.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(n.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:U(s,this.db.config.projectRoot),node:s}),n.matchedReferences+=1;break}}}),i.map(s=>s.typeOnlyDeclaration?nt(t,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(n.fallbackEntries+=1,this.valueImportUsageForEntry(t,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(t,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(t,e,n){let i=n.identifier?n.identifier.findReferences():[],o=[];for(let s of i)for(let a of ce(s,t,n.identifier,this.db.config.projectRoot))o.push(a);return this.valueImportUsageFromLocations(t,e,n,o)}valueImportUsageFromLocations(t,e,n,i){let o=i.some(c=>!_(c.node)),s=i.some(c=>_(c.node)),a=n.isTypeOnly;return{importer:t,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:a,isUsed:a||i.length>0,isTypeUsed:a||s,isValueUsed:o,references:i.map(c=>c.location)}}packageImportReferencesForDefinition(t){return this.packageImportReferences().get(t.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let t=new Map,e=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(t,e,n);for(let[n,i]of t)t.set(n,C(i));return this.packageImportReferenceIndex=t,t}addPackageImportReferencesForDocument(t,e,n){if(this.db.isIgnored(n))return;let i=this.sourceFiles.sourceFileMatch(n);if(i)for(let o of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(t,e,n,o)}addPackageImportReferencesForDeclaration(t,e,n,i){let o=Se(this.workspacePackages,i.getModuleSpecifierValue());if(!o)return;let s=e.get(o);if(s)for(let a of G(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=le(a.identifier,n,this.db.config.projectRoot);l.length>0&&pt(t,c,l)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let t=new Map;for(let e of this.workspacePackages){let n=new Map;for(let i of be(e))this.collectPackageExports(e,i,n,new Set);n.size>0&&t.set(e.name,n)}return this.packageExportIndex=t,t}collectPackageExports(t,e,n,i){if(i.has(e))return;i.add(e);let o=this.sourceFiles.sourceFile(e);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?H(this.db,e,a):e;if(!c||!c.startsWith(`${t.sourceRootRelative}/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(t,c,n,i);continue}for(let d of l){let p=d.getNameNode().getText(),f=d.getAliasNode()?.getText()??p,u=this.indexedDefinitionByLeaf(c,p);if(!u)continue;let g=n.get(f);g||(g=new Set,n.set(f,g)),g.add(u.symbolId)}}}indexedDefinitionByLeaf(t,e){return b(this.indexedDefinitionLeafCache,t,()=>ue(this.db,t)).get(e)??null}nodeForDefinition(t){return b(this.definitionNodeCache,t.symbolId,()=>this.definitionNodesForFile(t.relativePath).get(t.symbolId)??null)}definitionNodesForFile(t){return b(this.fileDefinitionNodeCache,t,()=>{let e=this.sourceFiles.sourceFile(t);return e?fe(this.tsMorph,this.db,e,t):new Map})}definitionFromCompilerSymbol(t,e){let n=t.name,i=e?m.now():0,o=t.declarations??[];e&&(e.declarationsMs+=m.now()-i,e.declarationChecks+=o.length);for(let s of o){let a=e?m.now():0,c=s.getSourceFile(),l=N(this.db.config.projectRoot,c.fileName),d=c.getLineAndCharacterOfPosition(s.getStart(c)).line;if(e&&(e.declarationLocationMs+=m.now()-a),!l||this.db.isIgnored(l))continue;let p=e?m.now():0,f=de(this.db,l,d,n);if(e&&(e.indexedLookupMs+=m.now()-p),f)return{symbolId:f.symbolId,symbol:f.symbol,file:f.relativePath,line:f.startLine}}return null}calleeMapForFile(t,e){let n=k(),i=0,o=0,s=0,a=0,c=0,l=0,d=0,p=0,f=n?lt():void 0;return S("typescript.callee-map.file",()=>{let u=n?m.now():0,g=this.sourceFiles.sourceFile(t);if(n&&(c=Math.round(m.now()-u)),!g)return new Map;let y=n?m.now():0,v=D(this.db,t).sort((M,x)=>M.startLine-x.startLine||x.endLine-M.endLine);if(n&&(l=Math.round(m.now()-y)),i=v.length,v.length===0)return new Map;let I=new Map,A=n?m.now():0,Le=this.compilerCheckerForSourceFile(g),Q=g.compilerNode;n&&(d=Math.round(m.now()-A));let je=new Map,Z=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){n&&(o+=1);let x=this.semanticCalleeForCallNode(Le,Q,v,M,je,e,f);x&&(n&&(s+=1),ot(I,x.callerId,x.target))}this.tsMorph.ts.forEachChild(M,Z)},Ee=n?m.now():0;Z(Q),n&&(p=Math.round(m.now()-Ee));for(let[M,x]of I)I.set(M,dt(x));return a=I.size,I},()=>({relativePath:t,definitions:i,callNodes:o,resolvedCallees:s,outputRows:a,requestedDefinitions:e?.size??i,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:d,traversalMs:p,...f?ft(f):{}}))}semanticCalleeForCallNode(t,e,n,i,o,s,a){let c=a?m.now():0,l=at(n,Fe(e,i));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let d=i.expression,p=this.compilerSymbolForExpression(t,d,a),f=null;if(p)if(a&&(a.targetSymbolHits+=1),o.has(p))a&&(a.compilerSymbolCacheHits+=1),f=o.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let u=a?m.now():0;f=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-u),o.set(p,f)}else a&&(a.targetMisses+=1);return f?{callerId:l.symbolId,target:{symbol:f.symbol,file:f.file,line:f.line}}:null}compilerSymbolForExpression(t,e,n){let i=n?m.now():0,o=t.getSymbolAtLocation(e);if(n&&(n.expressionSymbolMs+=m.now()-i),o)return o;n&&(n.typeFallbacks+=1);let s=n?m.now():0,a=t.getTypeAtLocation(e).getSymbol();return n&&(n.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(t){let e=t.getProject(),n=this.compilerCheckerCache.get(e);return n||(n=e.getTypeChecker().compilerObject,this.compilerCheckerCache.set(e,n)),n}};function G(r){let t=[],e=r.getDefaultImport();e&&t.push({identifier:e,importedName:"default",localName:e.getText(),kind:"default",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});let n=r.getNamespaceImport();n&&t.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});for(let i of r.getNamedImports()){let o=i.getNameNode(),a=i.getAliasNode()??(o.getKindName()==="Identifier"?o:null);t.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(r.getImportClause()?.isTypeOnly()??!1)})}return t.length===0&&t.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),t}function nt(r,t,e){return{importer:r,sourcePath:t,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function it(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function rt(r){for(let t=r;t;t=t.getParent())if(t.getKindName()==="ImportDeclaration")return!0;return!1}function ot(r,t,e){let n=r.get(t);n||(n=[],r.set(t,n)),n.push(e)}function st(r){let t=new Set;for(let e of r.getImportDeclarations())for(let n of G(e))n.localName&&t.add(n.localName);return t}function at(r,t){let e=null;for(let n of r)t<n.startLine||t>n.endLine||(!e||n.startLine>=e.startLine)&&(e=n);return e}function Fe(r,t){return r.getLineAndCharacterOfPosition(t.getStart(r)).line}function ct(r,t,e){return t===r.relativePath&&e>=r.startLine&&e<=r.endLine}function ve(r){return r.symbol.includes("#")?oe(r.symbol)==="type"&&r.relativePath.endsWith(".d.ts"):!1}function lt(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function ft(r){return{...r,callerLookupMs:Math.round(r.callerLookupMs),expressionSymbolMs:Math.round(r.expressionSymbolMs),typeSymbolMs:Math.round(r.typeSymbolMs),targetLookupMs:Math.round(r.targetLookupMs),declarationsMs:Math.round(r.declarationsMs),declarationLocationMs:Math.round(r.declarationLocationMs),indexedLookupMs:Math.round(r.indexedLookupMs)}}function De(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0}}function Re(r){return{...r,scanMs:Math.round(r.scanMs),packageRefsMs:Math.round(r.packageRefsMs),semanticRefsMs:Math.round(r.semanticRefsMs)}}function pt(r,t,e){for(let n of t){let i=r.get(n)??[];i.push(...e),r.set(n,i)}}function dt(r){let t=new Set,e=[];for(let n of r){let i=`${n.symbol}|${n.file}|${n.line}`;t.has(i)||(t.add(i),e.push(n))}return e}function Pe(r){return r.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var Y=new WeakMap;ee({name:"semantic-provider",groups:["semantic-provider"],clearAll:r=>Y.delete(r)});function X(r,t){let e=`${r.config.projectRoot}:typescript-workspace`,n=Y.get(r);n||(n=new Map,Y.set(r,n));let i=n.get(e);if(i)return i;let o=Ce(r,t);return n.set(e,o),o}function dn(r,t){let e=E(r,t);return e?e.importUsage(t):[]}function un(r,t){let e=E(r,t.relativePath);return e?e.referencesFor(t):[]}function mn(r,t){let e=k(),n=new Map,i=ne(r),o=[],s=[],a=[],c=0,l=0,d=0,p=0;if(S("semantic.references.cache-scan",()=>{for(let f of t){if(!i||!R(f.relativePath)){e&&!R(f.relativePath)&&(c+=1),a.push(f);continue}let u=ie(r,f.relativePath,f.symbol,i);if(u!==null){let g=mt(u);if(g){e&&(l+=1),p+=Te(r,n,f,g);continue}e&&(d+=1)}s.push(f)}},()=>({definitions:t.length,skippedNonTs:c,cacheHits:l,parseFailures:d,misses:s.length,unkeyed:a.length,resultRows:n.size,callerFiles:p})),s.length>0||a.length>0){let f=[...a,...s],u=0,g=S("semantic.references.compute-misses",()=>{let y=ut(r,f);return u=y.size,y},()=>({definitions:f.length,misses:s.length,unkeyed:a.length,rows:u}));for(let y of f)p+=Te(r,n,y,g.get(y.symbolId)??[]);if(i)for(let y of s)o.push({relativePath:y.relativePath,symbol:y.symbol,projectFingerprint:i,payload:JSON.stringify(g.get(y.symbolId)??[])})}return o.length>0&&(X(r).availability().available?S("semantic.references.cache-write",()=>re(r,o),()=>({entries:o.length})):S("semantic.references.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",entries:o.length}))),n}function ut(r,t){let e=k(),n=new Map,i=0,o=0,s=0,a=0;return S("semantic.references.provider-loop",()=>{let c=new Map,l=[];for(let d of t){let p=E(r,d.relativePath);if(!p){e&&(o+=1);continue}if(e&&(i+=1),p.referencesForDefinitions){let f=c.get(p);f?f.push(d):c.set(p,[d])}else l.push({provider:p,definition:d})}for(let[d,p]of c){let f=d.referencesForDefinitions(p);for(let u of p){let g=f.get(u.symbolId)??[];Ne(n,u.symbolId,g,e,y=>{s+=1,a+=y})}}for(let{provider:d,definition:p}of l){let f=d.referencesFor(p);Ne(n,p.symbolId,f,e,u=>{s+=1,a+=u})}return n},()=>({definitions:t.length,providerHits:i,providerMisses:o,definitionsWithReferences:s,referenceCount:a,rows:n.size}))}function Ne(r,t,e,n,i){r.set(t,e),n&&e.length>0&&i(e.length)}function Te(r,t,e,n){let i=0;for(let o of n){if(o.file===e.relativePath||r.isIgnored(o.file))continue;let s=t.get(e.symbolId);s||(s=new Set,t.set(e.symbolId,s));let a=s.size;s.add(o.file),s.size!==a&&(i+=1)}return i}function mt(r){try{return JSON.parse(r)}catch{return null}}function gn(r,t){let e=k(),n=new Map,i=0,o=0,s=0,a=0;return S("semantic.callees.provider-loop",()=>{let c=new Map,l=[];for(let d of t){let p=E(r,d.relativePath);if(!p){e&&(o+=1);continue}e&&(i+=1);let f=d;if(p.calleesForDefinitions){let u=c.get(p);u?u.push(f):c.set(p,[f])}else l.push({provider:p,definition:f})}for(let[d,p]of c){let f=d.calleesForDefinitions(p);for(let u of p){let g=f.get(u.symbolId)??[];we(n,u.symbolId,g,e,y=>{s+=1,a+=y})}}for(let{provider:d,definition:p}of l){let f=d.calleesFor(p);we(n,p.symbolId,f,e,u=>{s+=1,a+=u})}return n},()=>({definitions:t.length,providerHits:i,providerMisses:o,definitionsWithCallees:s,calleeCount:a,rows:n.size}))}function we(r,t,e,n,i){e.length>0&&(r.set(t,e),n&&i(e.length))}function yn(r,t){let e=E(r,t.relativePath);return e?e.signatureFor(t):null}function E(r,t){if(!R(t))return null;let e=X(r,t);return e.availability().available?e:null}export{R as a,X as b,dn as c,un as d,mn as e,gn as f,yn as g};
3
- //# sourceMappingURL=chunk-OLTESY4K.js.map
@@ -1,6 +0,0 @@
1
- import{execFileSync as h}from"child_process";import{platform as y}from"os";var b=y()==="win32";function t(e){let r=b?"where":"which";try{return h(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as c}from"child_process";import{existsSync as g,readFileSync as I}from"fs";import{platform as o,arch as m}from"os";import{dirname as p,join as s}from"path";import{fileURLToPath as v}from"url";var d="v0.8.1",a="https://github.com/scip-code/scip",x={win32:{x64:s("vendor","scip","win32-x64","scip.exe"),arm64:s("vendor","scip","win32-arm64","scip.exe")}};function S(){let e=p(v(import.meta.url));for(;;){let r=s(e,"package.json");if(g(r))try{if(JSON.parse(I(r,"utf-8")).name==="scip-query")return e}catch{}let n=p(e);if(n===e)return null;e=n}}function f(){let e=x[o()]?.[m()];if(!e)return null;let r=S();if(!r)return null;let n=s(r,e);return g(n)?n:null}function w(){return t("scip")?"scip":f()}function H(){return w()!==null}function q(){let e=w();if(!e)return null;try{return c(e,["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function $(){let e=o(),r=m(),n,i,l;switch(e){case"darwin":n="darwin",l="tar.gz";break;case"linux":n="linux",l="tar.gz";break;default:return null}switch(r){case"arm64":i="arm64";break;case"x64":i="amd64";break;default:return null}let u=`scip-${n}-${i}.${l}`;return{url:`${a}/releases/download/${d}/${u}`,filename:u}}function U(){let e=$();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),o()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
2
- `),console.log("Or download manually:")):o()==="win32"?(console.log("Windows installs should include a managed scip.exe in the scip-query package."),console.log("Reinstall scip-query, or build the managed binary from source with:"),console.log(` npm run build:scip-windows
3
- `),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
4
- `:` ${a}/releases/tag/${d}
5
- `),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function D(e){let r=f();if(r)return e(`Using bundled scip CLI at ${r}`),!0;if(o()==="darwin"&&t("brew")){e("Installing scip CLI via Homebrew...");try{if(c("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(n){let i=n instanceof Error?n.message:String(n);e(`Homebrew install failed: ${i}`)}}if(t("go")){e("Installing scip CLI via go install...");try{if(c("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(n){let i=n instanceof Error?n.message:String(n);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${a}/releases`),!1}export{t as a,w as b,H as c,q as d,U as e,D as f};
6
- //# sourceMappingURL=chunk-ONPCQ2PM.js.map
@@ -1,4 +0,0 @@
1
- import{a as X,d as R}from"./chunk-BSN22NRK.js";import{a as P,b as z}from"./chunk-TQ5W2H3S.js";import{b as j,d as O,e as L,j as B,k as A}from"./chunk-XUGQU7PM.js";import{existsSync as G,readFileSync as F}from"fs";import{join as x}from"path";function U(t,n){let e=K(t,n)??Q(t,n)??V(t,n)??Y(t,n);return tt(t,e,n)}function K(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=w(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(w(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function w(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function Q(t,n){if(!I(t[n]??""))return null;let e=n;for(;e>0&&I(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&I(t[i]??"");)i+=1;return{start:e,end:i}}function I(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function V(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(v(o)!==null)break;if(E(o)!==null)return null;e-=1}if(e<0)return null;let i=v(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=v(o);if(s!==null){if(s<=i)break;r+=1;continue}if(E(o)!==null)break;r+=1}return{start:e,end:r}}function v(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function Y(t,n){let e=t[n]??"";if($(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&H(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&H(t[r]??"");)r+=1;return{start:i,end:r}}function H(t){return E(t)===null}function E(t){return t.trim().length===0?"blank":$(t)?"heading":w(t)?"fence":I(t)?"table":v(t)!==null?"list":null}function $(t){return/^#{1,6}\s+/.test(t.trim())}function tt(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
2
- `).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function _(t,n){return n.filter(e=>t.includes(e))}var b=/\.(?:md|mdx|rst|txt)$/i;function nt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var et=3,it=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function kt(t,n={}){let{doc:e,limit:i=20,minCoupling:r=et}=n,o=ct(t);if(!o)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let s=[];for(let c of o.docFiles){if(e!==void 0&&!c.includes(e)||e===void 0&&!W(t,c)||e!==void 0&&!G(x(t.config.projectRoot,c)))continue;let u=Math.max(0,...o.changeTimes.get(c)??[]),f=rt(t,c),d=new Map,{resolved:h,broken:l,citations:g}=dt(t,c,o.tracked,o.trackedBySuffix,o.everSeenInHistory),m=new Map(g.map(a=>[a.file,a.contexts]));for(let a of h){if(a===c||b.test(a))continue;let p=(o.changeTimes.get(a)??[]).filter(S=>S>u).length;p!==0&&d.set(a,{file:a,evidence:"reference",coChanges:0,changesSinceDocUpdate:p,...N("reference",f),citationContexts:m.get(a)})}for(let[a,p]of o.coupling.get(c)??[]){if(p<r||!o.tracked.has(a))continue;let S=(o.changeTimes.get(a)??[]).filter(T=>T>u).length;if(S===0)continue;let C=d.get(a);C?(C.evidence="both",C.coChanges=p,Object.assign(C,N("both",f))):d.set(a,{file:a,evidence:"co-change",coChanges:p,changesSinceDocUpdate:S,...N("co-change",f)})}if(d.size===0&&l.length===0)continue;let D=[...d.values()].sort((a,p)=>p.changesSinceDocUpdate-a.changesSinceDocUpdate);s.push({doc:c,docLastChangedAt:u,staleness:D.reduce((a,p)=>a+p.changesSinceDocUpdate,0)+l.length*10,subjects:D.slice(0,8),brokenReferences:l})}return s.sort((c,u)=>u.staleness-c.staleness),{available:!0,commitsAnalyzed:o.historyCommitCount,docsScanned:o.docFiles.length,findings:s.slice(0,i)}}function rt(t,n){let e;try{e=F(x(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
3
- ${e}`.toLowerCase(),r=_(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=_(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function N(t,n){return{actionTier:ot(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function ot(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function ct(t){let n=X(t);if(!n)return null;let e=R(t)??new Set,i=new Map,r=new Map,o=new Set;for(let s of n.commits){let c=[...new Set(s.files)],u=c.filter(d=>b.test(d)),f=c.filter(d=>!b.test(d));for(let d of c){o.add(d);let h=i.get(d)??[];h.push(s.timestamp),i.set(d,h)}for(let d of u){let h=r.get(d);h||(h=new Map,r.set(d,h));for(let l of f)h.set(l,(h.get(l)??0)+1)}}return{changeTimes:i,coupling:r,docFiles:[...e].filter(s=>b.test(s)),everSeenInHistory:o,historyCommitCount:n.commits.length,tracked:e,trackedBySuffix:Z(e)}}function At(t,n){if(n.size===0)return[];let e=P(),i=0,r=0,o=0,s=0,c=0,u=0;return z("doc-reference.docs-citing-files",()=>{let f=R(t)??new Set;i=f.size;let d=Z(f),h=st(n,d),l=[];for(let g of f){if(!W(t,g))continue;e&&(r+=1);let m;try{m=F(x(t.config.projectRoot,g),"utf-8")}catch{e&&(o+=1);continue}if(!ut(m,h)){e&&(s+=1);continue}let D=J(t,g,m);if(!D)continue;e&&(c+=1);let a=at(D.candidates,n,h,f,d);if(a.size===0)continue;let p=[...new Set([...a.values()].flatMap(y=>[...y]))],S=lt(D.contextsByCandidate,p),C=[...a].map(([y,k])=>({file:y,contexts:M([...k].flatMap(q=>S.get(q)??[])).slice(0,3)})).filter(y=>y.contexts.length>0),T=[...a.keys()];if(T.length>0){e&&(u+=1);let y=T.sort();l.push({doc:g,cited:y,citations:C,citedClaims:M(C.flatMap(k=>k.contexts)).slice(0,3)})}}return l},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:u}))}function W(t,n){return b.test(n)&&!nt(n)&&G(x(t.config.projectRoot,n))}function Z(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function st(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function at(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(i.has(s))c=s;else{let f=r.get(s);f?.length===1&&(c=f[0])}if(!c||!n.has(c))continue;let u=o.get(c)??new Set;u.add(s),o.set(c,u)}return o}function dt(t,n,e,i,r){let o=new Set,s=new Set,c=J(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let u=c.candidates,f=c.contextsByCandidate,d=new Map,h=(l,g)=>{let m=f.get(g);if(!m||m.length===0)return;let D=d.get(l)??[];D.push(...m),d.set(l,M(D).slice(0,3))};for(let l of u){if(e.has(l)){o.add(l),h(l,l);continue}let g=i.get(l);if(g&&g.length===1){o.add(g[0]),h(g[0],l);continue}g&&g.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...d].map(([l,g])=>({file:l,contexts:g}))}}function lt(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function J(t,n,e){let i=e;if(i===void 0)try{i=F(x(t.config.projectRoot,n),"utf-8")}catch{return null}let r=j(t,n,i),o=O(t,"doc-path-evidence",n,r);if(o!==null){let c=ht(o);if(c)return c}let s=ft(i);return L(t,"doc-path-evidence",n,r,gt(s)),s}function ut(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function ft(t){let n=t.split(/\r?\n/),e=new Set,i=new Map;for(let r=0;r<n.length;r+=1){let o=n[r]??"";for(let s of o.matchAll(it)){let c=s[0].replace(/^\.?\//,"");e.add(c);let u=U(n,r);if(u.length===0)continue;let f=i.get(c)??[];f.push(u),i.set(c,M(f).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i}}function gt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()]};return JSON.stringify(n)}function ht(t){try{let n=JSON.parse(t);if(!B(n))return null;let e=A(n.candidates),i=pt(n.contextsByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i)}}catch{return null}}function pt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=A(e[1]);if(!i)return null;n.push([e[0],i])}return n}function M(t){let n=[];for(let e of new Set(t))n.some(i=>mt(i,e))||n.push(e);return n}function mt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{U as a,_ as b,nt as c,kt as d,At as e};
4
- //# sourceMappingURL=chunk-P4KYUPBD.js.map
@@ -1,4 +0,0 @@
1
- import{a as oe,b as ie,c as P,d as ae,e as pe,f as ce,g as j,h as me,i as F,j as le,k as ue,l as _,m as U,n as T,o as G,p as Y,q as S,r as K,s as Z,t as J,v as R,w as h,x as M,y as ee}from"./chunk-OBGRLXWF.js";import{b as ge}from"./chunk-YZA6PPZL.js";import{a as de,b as fe,d as C}from"./chunk-HF25DFSC.js";import{a as v}from"./chunk-DS6QEB3G.js";import{b as B,d as V,e as Q}from"./chunk-XUGQU7PM.js";import{c as L}from"./chunk-7S5E7KWT.js";import{basename as Se}from"path";var je=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function y(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&je.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function b(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,ue(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function O(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function D(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=R(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=C(t,r);if(n){let o=e(n);if(o)return o}return s()}function z(t,r,e,s){let n=C(t,r),o=de(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function he(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=Se(o).replace(/\.[^.]+$/,"");return[$(o,i,Y(t,r,o),h(n,i))]})}function Me(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(m=>m.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=Se(i).replace(/\.[^.]+$/,"");n.push(f(i,a,Y(t,r,i),s))}return n}function xe(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=R(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:K(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function ye(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:K(t,r,o)})}return s}function Ne(t,r,e){return z(t,r,{csharp:s=>qe(t,r,s),vb:s=>$e(t,r,s)},()=>{let s=le(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),c=!!p,m=(c?p:a)?.trim()??i,l=m.split(".").pop()??m,u=c?a?.trim()??l:l;return[b(t,r,o,m,l,u,S(t,m,j))]})})}function $e(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,c=a.text,m=c.split(".").pop()??c,l=p?.text??m;n.push(f(m,l,S(t,c,j),s,p?"namespace":"named"))}return n}function qe(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let c=p.text,m=c.split(".").pop()??c,l=a?.text??m;n.push(f(m,l,S(t,c,j),s,a?"namespace":"named"))}return n}var Fe=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Ie(t,r){return Fe.get(t,r,()=>{let e=new Set,s=v(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function te(t,r,e){return I(t,r,s=>We(t,r,s),()=>Ue(t,r,e))}function Ue(t,r,e){return Ze(e).flatMap(s=>et(t,r,s.clause,s.specifier,s.start,s.end,e))}function We(t,r,e){let s=Je(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...ze(t,r,e,o,s));return n}function Je(t,r,e){let s=g(e,new Set(["import_statement"]));if(fe(r))for(let n of Ie(t,r))s.add(n);return s}function ze(t,r,e,s,n){let o=Qe(s);if(!o)return[];let i=_(t,r,o),a=y(s,"import_clause");return a?Xe(e,a,i,n,Ge(s.text)):[O("*",i)]}function Xe(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(He(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Be(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Ve(i,e,s,n));return o}function He(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Be(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Ke(t,i);return D("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Ve(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,c=a?.text??p;n.push(f(p,c,r,e,"named",{isTypeOnly:s||Ye(o.text)}))}return n}function Qe(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Ge(t){return/^\s*import\s+type\b/.test(t)}function Ye(t){return/^\s*type\b/.test(t.trim())}function Ke(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function Ze(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function et(t,r,e,s,n,o,i){let a=_(t,r,s),p=R(i,n,o);return e?tt(e).map(m=>({...m,sourcePath:a})).map(m=>{if(m.kind==="namespace"){let l=M(p,m.localName);return D(m.importedName,m.sourcePath,{localName:m.localName,usedMembers:l,used:l.length>0||h(p,m.localName),isTypeOnly:m.isTypeOnly})}return m.kind==="side-effect"?O(m.importedName,m.sourcePath):$(m.importedName,m.localName??"",m.sourcePath,m.localName?h(p,m.localName):!1,m.kind,[],{isTypeOnly:m.isTypeOnly})}):[O("*",a)]}function tt(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=rt(s),i=[];return n&&i.push(...Pe(n,e)),o&&i.push(...Pe(o,e)),i}function Pe(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?x(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,c]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(c??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function rt(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function re(t,r,e){let s=C(t,r);return s?pt(t,r,s):st(t,r,e)}function st(t,r,e){return[...nt(t,r,e),...ot(t,r,e),...it(t,r,e)]}function nt(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=x(i).map(l=>at(l.trim())).filter(l=>!!l),c=q(e,o.index),m=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:_(t,r,a),names:p,startLine:c,endLine:m})}return s}function ot(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function it(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function at(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function pt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=ct(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=mt(n,o,i,a);s.push(p)}return s}function ct(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return _(t,r,n.text)}function mt(t,r,e,s){let n=y(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),c=a.namedChild(1);p&&i.push((c??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return y(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function be(t,r,e){return z(t,r,{java:s=>lt(t,r,s),kotlin:s=>ut(t,r,s),scala:s=>dt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ft(t,r,o,n):[]}))}function lt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let c=p.text;if(i){n.push(D("*",S(t,c,P)));continue}let m=c.split(".").pop()??c;n.push(f(m,m,S(t,c,P),s))}return n}function ut(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(D("*",S(t,i.text,P)));continue}let c=i.text,m=c.split(".").pop()??c,u=p?.namedChild(0)?.text??m;n.push(f(m,u,S(t,c,P),s))}return n}function dt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(D("*",S(t,p,P)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let E=u.text,A=d?.text??E;if(E==="_")continue;n.push(f(E,A,S(t,`${p}.${E}`,P),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,P),s))}continue}let c=a[a.length-1]?.text??p,m=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(c,c,S(t,m&&a.length>1?`${m}.${c}`:p,P),s))}return n}function ft(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,c]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),m=p?.trim();if(!m||m==="_")return[];let l=(c??m.split(".").pop()??m).trim(),u=m==="_"?n:`${n}.${m}`.replace(/\.\./g,".");return[b(t,r,s,u,m,l)]})}return[b(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function _e(t,r,e){return I(t,r,s=>gt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,c]=a.split(/\s+as\s+/i),m=p?.trim()??a,l=m.split("\\").pop()??m,u=(c??l).trim();return[b(t,r,n,m,l,u,S(t,m.replace(/\\/g,"."),F))]}):[]}))}function gt(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),F),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(c=>c.type==="namespace_name")?.text??"";for(let c of a.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:m,localName:l,qualified:u}=Ee(c,p);m&&o(u,m,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:c,localName:m,qualified:l}=Ee(p,"");c&&o(l,c,m)}}return n}function Ee(t,r){let e=t.namedChildren.find(c=>c.type==="qualified_name"),s=t.namedChildren.filter(c=>c.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function Re(t,r,e){return I(t,r,s=>St(t,r,s),()=>xt(e).flatMap(s=>Nt(t,r,s,e)))}function St(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Te(i);if(!a)continue;let p=U(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ht(i);if(a===null)continue;let p=U(t,r,a);for(let c=1;c<o.namedChildCount;c+=1){let m=o.namedChild(c);if(m.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Te(m);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Te(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ht(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=y(t,"import_prefix")?.text??"",e=y(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function xt(t){let r=t.split(`
2
- `),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,c=a+o.length,m=ee(o);for(;n+1<r.length&&(m>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
3
- ${u}`,c+=1+u.length,m+=ee(u),s+=u.length+1}let l=yt(p);l&&e.push({...l,start:a,end:c})}return e}function yt(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function Nt(t,r,e,s){let n=R(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return x(o).flatMap(p=>{let c=p.trim().replace(/,$/,"");if(!c)return[];let[m,l]=c.split(/\s+as\s+/),u=m.trim(),d=(l??u.split(".")[0]??u).trim(),E=U(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:E,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?U(t,r,e.module):null,a=[];for(let p of x(o)){let c=p.trim().replace(/,$/,"");if(!c)continue;if(c==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[m,l]=c.split(/\s+as\s+/),u=(l??m).trim();a.push({importedName:m.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as It}from"path";function Ce(t,r,e){return I(t,r,s=>bt(t,r,s),()=>Pt(t,r,e))}function Pt(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?G(t,r,i):null;if(a){let p=Oe(i);return[$(p,p,a,h(n,p))]}return[O(i,a)]})}function bt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let c=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!c||c.type!=="string")continue;let l=c.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?G(t,r,l):null;if(u){let d=Oe(l);n.push(f(d,d,u,s))}else n.push(O(l,u))}return n}function Oe(t){return ge(It(t).replace(/\.[^.]+$/,""),/_/)}function De(t,r,e){return I(t,r,s=>Et(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?_t(t,r,o,n):[]}))}function Et(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of W(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function W(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:X(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:X(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=X(r,e.text),o=[];for(let i of s.namedChildren)o.push(...W(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...W(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=W(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:X(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function X(t,r){return t?r?`${t}::${r}`:t:r}function _t(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let m=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[E,A]=d.split(/\s+as\s+/),w=E?.trim();if(!w)return[];let we=(A??w.split("::").pop()??w).trim(),Le=`${m}::${w}`.replace(/::::/g,"::");return[b(t,r,s,Le,w.split("::").pop()??w,we,T(t,r,m))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),c=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[b(t,r,s,a,a.split("::").pop()??a,p,c)]}function ke(t,r,e){let s=C(t,r);if(s)return Tt(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Ct(t,r,i))}return n}function Tt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!Rt(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of W(o,""))i.importedName&&s.push(se(t,r,i.qualifiedName))}return s}function Rt(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Ct(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),c=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[se(t,r,c)]})}return[se(t,r,s)]}function se(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function Ae(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var Ot={language:"javascript",extensions:oe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:te,parseReExports:re},Dt=k({language:"python",extensions:ie,imports:"ast-with-regex-fallback",parseImports:Re}),kt=k({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:be}),At={language:"rust",extensions:ae,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:De,parseExports:ke},wt=k({language:"ruby",extensions:pe,imports:"ast-with-regex-fallback",parseImports:Ce}),Lt=k({language:"c/cpp",extensions:ce,imports:"ast-with-regex-fallback",parseImports:he}),jt=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:Ne}),vt={language:"dart",extensions:me,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:xe,parseExports:ye},Mt=k({language:"php",extensions:F,imports:"ast-with-regex-fallback",parseImports:_e}),$t=[Ot,Dt,kt,At,wt,Lt,jt,vt,Mt];function H(t){return Ae($t,t)}var ne={clearGroups:["whole-project","source-file"]},qt=L("source-imports",ne),Ft=L("source-exports",ne),Ut=L("source-reexports",ne);function ns(t,r){let e=J(r);return Ut.get(t,e,()=>{let s=H(e);if(!s?.parseReExports)return[];let n=v(t,e);if(!n)return[];let o=B(t,e,n),i=Z(t),a=V(t,"source-reexports",e,o);if(a!==null)try{let c=JSON.parse(a);if(c.resolutionFingerprint===i&&Array.isArray(c.reExports))return c.reExports}catch{}let p=s.parseReExports(t,e,n);return Q(t,"source-reexports",e,o,JSON.stringify({resolutionFingerprint:i,reExports:p})),p})}function os(t,r){let e=J(r);return qt.get(t,e,()=>{let s=H(e);if(!s)return[];let n=v(t,e);if(!n)return[];let o=B(t,e,n),i=Z(t),a=V(t,"source-imports",e,o);if(a!==null)try{let c=JSON.parse(a);if(c.resolutionFingerprint===i&&Array.isArray(c.imports))return c.imports}catch{}let p=s.parseImports(t,e,n);return Q(t,"source-imports",e,o,JSON.stringify({resolutionFingerprint:i,imports:p})),p})}function is(t,r){let e=J(r);return Ft.get(t,e,()=>{let s=H(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{ns as a,os as b,is as c};
4
- //# sourceMappingURL=chunk-P5RYBRIO.js.map
@@ -1,2 +0,0 @@
1
- import{a as oe}from"./chunk-FG4NT6VY.js";import{a as ne}from"./chunk-VOYOYC5T.js";import{a as te}from"./chunk-QPU7EXAW.js";import{a as ie}from"./chunk-LZHUWKGD.js";import{a as re}from"./chunk-HHN2B5KA.js";import{a as Z}from"./chunk-FAYI6KZ5.js";import{a as ee}from"./chunk-RVWSAMTT.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as J}from"./chunk-7IVSJJZU.js";import{a as X}from"./chunk-AVWPHM2Q.js";import{a as Q}from"./chunk-C2QSK7E7.js";import{d as Y}from"./chunk-CW5YFOCP.js";import{a as j}from"./chunk-O6ZH6C6Y.js";import{a as G}from"./chunk-WUCEKFQC.js";import{a as q}from"./chunk-M4COR2H6.js";import{a as W}from"./chunk-6QSOCTZT.js";import{a as T,b as U}from"./chunk-USPV3T5K.js";import{b as N}from"./chunk-65AU3HFZ.js";import{b as I,c as z}from"./chunk-BSN22NRK.js";import{a as K}from"./chunk-GQBMH2TQ.js";import{a as O}from"./chunk-QYB5P7GL.js";import{f as A,g as k}from"./chunk-C5CTSJ6X.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(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},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(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:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+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 ke(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:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.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()),o=0,n=0,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,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} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,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${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,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 extract or reuse the shared UI concept`,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${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=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`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",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((o,n)=>{let a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"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","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 se(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,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("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,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",L,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",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","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"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:We(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:qe(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:je(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Ge(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Xe(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Qe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Je(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Ke(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ze(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:et(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ye(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:tt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:rt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:it(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:at(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:st(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:ot(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:nt(e,t)})};function jt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Ue(e,r.scope,t,i);return M(o)})}function Gt(e,r,t={}){return Oe(e,[r],t)[0]}function Oe(e,r,t={}){return he(e,t.full!==!1,(i,o)=>{let n={...o,releaseCachesBetweenPhases:!1};return r.map(a=>me[a](e,t.scope,n,i))})}function he(e,r,t){let i=Q(e),o=ct(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Yt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Ue(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function We(e,r,t){return s(e,t,"dead",()=>{let i=U(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(dt(e,i.symbols))})}function qe(e,r,t){return s(e,t,"isolated",()=>{let i=j(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(pt(e,i))})}function je(e,r,t){return s(e,t,"cycles",()=>O(e,{scope:r}).filter(o=>o.kind==="real").length)}function Ge(e,r,t){return s(e,t,"similar",()=>Y(e,{scope:r,...p.similar,scanLimit:t.candidateScanLimit}))}function Ye(e,r,t){return s(e,t,"extract-candidates",()=>q(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Xe(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Qe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Je(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return mt(i)})}function Ke(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ze(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,gt)})}function et(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function tt(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=J(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=G(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,Ct)})}function it(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=X(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function ot(e,r){return s(e,r,"git-evidence",()=>{let t=I(e);if(!t)return null;let i=N(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:z(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function nt(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function at(e,r,t){return s(e,t,"drift",()=>{let i=W(e,{scope:r,...p.drift,includePatternDeviations:!1}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function st(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=K(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function ct(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ut(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){lt(t);try{return i()}finally{ut(e,r)}}function lt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function pt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath))}function R(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 fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function ht(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function gt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function ft(e){return e.actionTier==="signal"?.25:1}function Ct(e){return e.actionTier==="signal"?.25:1}function pe(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var He=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{Ne as a,jt as b,Gt as c,Oe as d,Yt as e};
2
- //# sourceMappingURL=chunk-P7AL7Y37.js.map
@@ -1,2 +0,0 @@
1
- import{b as d}from"./chunk-B75HZHUP.js";function u(e){let i=e.orderCandidates?[...e.candidates()].sort(e.orderCandidates):e.candidates(),a=d(i,e.scanLimit),r=e.prepare?.(a)??void 0,t=[];for(let s of a){let n=e.evaluate(s,r);n&&t.push(n)}return e.orderResults&&t.sort(e.orderResults),typeof e.limit=="number"?t.slice(0,e.limit):t}export{u as a};
2
- //# sourceMappingURL=chunk-PFOCOG57.js.map
@@ -1,2 +0,0 @@
1
- import{a as D}from"./chunk-LZHUWKGD.js";import{a as F}from"./chunk-HHN2B5KA.js";import{a as f}from"./chunk-FAYI6KZ5.js";import{a as g}from"./chunk-RVWSAMTT.js";import{c as y}from"./chunk-CW5YFOCP.js";import{e as h}from"./chunk-BSN22NRK.js";import{d as p}from"./chunk-A536TEU4.js";var v=.7,R=.62,S=.45;function Y(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=h(i);if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let l=I(s,e);if(l.size===0)return{available:!0,windowCommits:e,findings:[]};let d=A(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:l}).map(r=>w(r,s,e)).filter(r=>r!==null);d.sort((r,c)=>(r.kind===c.kind?0:r.kind==="echo"?-1:1)||c.similarity-r.similarity||r.echoFile.localeCompare(c.echoFile)||r.echoSymbol.localeCompare(c.echoSymbol)||r.domain.localeCompare(c.domain));let b=d.slice(0,n).map(T);return{available:!0,windowCommits:e,findings:b,rootCauseGroups:N(b)}}function A(i,t){let e=K(t.limit),n=[...B(i,{scope:t.scope,minSimilarity:t.minSimilarity??v,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=p(i,{scope:t.scope});return a.react&&n.push(...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function B(i,t){return y(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function k(i,t){return u(i,t,{query:f,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:P(...e.evidenceBuckets(n)),sharedCallees:[]}))}function E(i,t){return u(i,t,{query:g,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}function L(i,t){return u(i,t,{query:F,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function x(i,t){return u(i,t,{query:D,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function I(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function w(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let l=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:l?i.symbolA:i.symbolB,echoFile:l?i.fileA:i.fileB,echoAgeCommits:(l?n:a)??0,establishedSymbol:l?i.symbolB:i.symbolA,establishedFile:l?i.fileB:i.fileA,establishedAgeCommits:l?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function T(i){let t=C(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function C(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??C(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:O(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let l of n.sharedEvidence)s.sharedEvidence.add(l)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function O(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function P(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{Y as a};
2
- //# sourceMappingURL=chunk-QLAUCRDJ.js.map