scip-query 0.10.12 → 0.12.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 (354) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
  3. package/README.md +164 -49
  4. package/dist/augment-vue-worker.js +1 -1
  5. package/dist/{chunk-RUV5IY25.js → chunk-2LQWMYG4.js} +2 -2
  6. package/dist/{chunk-KZ4MG5NY.js → chunk-2QGE5AEP.js} +2 -2
  7. package/dist/chunk-4D54JIU3.js +2 -0
  8. package/dist/{chunk-2GLNBCHB.js → chunk-52Q4JFDW.js} +2 -2
  9. package/dist/chunk-5AAAEZ2Z.js +2 -0
  10. package/dist/chunk-64PRNLKP.js +2 -0
  11. package/dist/chunk-6XA4LDHY.js +2 -0
  12. package/dist/chunk-72MFTCU5.js +38 -0
  13. package/dist/chunk-75X52JTA.js +2 -0
  14. package/dist/{chunk-LEHVP4DY.js → chunk-7ITCOJGD.js} +2 -2
  15. package/dist/chunk-7JZRFDCU.js +2 -0
  16. package/dist/{chunk-XRUGSM76.js → chunk-AZLKLZ5S.js} +2 -2
  17. package/dist/chunk-B4VYXRCQ.js +26 -0
  18. package/dist/chunk-BCNT6ODA.js +5 -0
  19. package/dist/chunk-BP2NAIAZ.js +2 -0
  20. package/dist/chunk-BVNO67DB.js +2 -0
  21. package/dist/{chunk-XHMVZFA6.js → chunk-CW3KZ7UF.js} +2 -2
  22. package/dist/{chunk-6BN3EHQE.js → chunk-D64L53WX.js} +2 -2
  23. package/dist/{chunk-T3AEVJBG.js → chunk-D7J6GZAG.js} +2 -2
  24. package/dist/chunk-ECVXWZ4Q.js +3 -0
  25. package/dist/chunk-EDB7Y442.js +2 -0
  26. package/dist/{chunk-4ISHQ7UW.js → chunk-ETU2I5JM.js} +4 -4
  27. package/dist/chunk-EXKLAEB4.js +18 -0
  28. package/dist/chunk-EZ5WDZ2Q.js +3 -0
  29. package/dist/{chunk-S2MRVIJ5.js → chunk-F5BJSNU5.js} +6 -6
  30. package/dist/chunk-FBCOFKEC.js +2 -0
  31. package/dist/chunk-FERAXG6Y.js +72 -0
  32. package/dist/chunk-FXG3PHVW.js +9 -0
  33. package/dist/{chunk-XUCZ3RQ5.js → chunk-G2UBOONK.js} +4 -4
  34. package/dist/chunk-GNG622H3.js +3 -0
  35. package/dist/{chunk-JS6B76AQ.js → chunk-H2NMIZFD.js} +2 -2
  36. package/dist/chunk-H7NSJ7L2.js +5 -0
  37. package/dist/chunk-HSU3M25J.js +21 -0
  38. package/dist/chunk-HXXMPYEF.js +2 -0
  39. package/dist/chunk-IRJDYTNZ.js +3 -0
  40. package/dist/chunk-ISLWJ4PY.js +10 -0
  41. package/dist/chunk-J5WVNZ6O.js +2 -0
  42. package/dist/{chunk-UVPY3RUZ.js → chunk-K6UI6EBZ.js} +2 -2
  43. package/dist/{chunk-MNCQPMCH.js → chunk-KJCDEDQW.js} +2 -2
  44. package/dist/{chunk-ELC77ZDE.js → chunk-KMVGRIO2.js} +2 -2
  45. package/dist/chunk-KSUZS77X.js +16 -0
  46. package/dist/{chunk-A4UTLKHU.js → chunk-L2CX5GHZ.js} +2 -2
  47. package/dist/chunk-LFM3O5KX.js +2 -0
  48. package/dist/{chunk-ZUUNREKS.js → chunk-M72ZFN6E.js} +5 -5
  49. package/dist/chunk-MBKJ7GHT.js +102 -0
  50. package/dist/chunk-MJKJMWIM.js +2 -0
  51. package/dist/chunk-MKM7NBZK.js +43 -0
  52. package/dist/chunk-MTDBHTSF.js +2 -0
  53. package/dist/chunk-NAH5EAZS.js +6 -0
  54. package/dist/chunk-NJJ7AS4F.js +2 -0
  55. package/dist/{chunk-EOLGSSDR.js → chunk-NKT5EMEX.js} +2 -2
  56. package/dist/{chunk-ANUEY5WV.js → chunk-NLMRJ7SI.js} +2 -2
  57. package/dist/chunk-NQ75OVUU.js +40 -0
  58. package/dist/{chunk-TBCHRDAC.js → chunk-O3WDE26W.js} +2 -2
  59. package/dist/{chunk-VB2EZZPA.js → chunk-OPE5YXFE.js} +2 -2
  60. package/dist/chunk-ORBRX2QJ.js +2 -0
  61. package/dist/{chunk-OFXN2BCT.js → chunk-OSWF3HSF.js} +2 -2
  62. package/dist/{chunk-JJ5SAWBT.js → chunk-OVMUVXKQ.js} +2 -2
  63. package/dist/{chunk-NTSR6SRP.js → chunk-PH7ZFK6L.js} +2 -2
  64. package/dist/chunk-PXHPCWX5.js +2 -0
  65. package/dist/chunk-Q3B3FNCU.js +3 -0
  66. package/dist/{chunk-SQNHOOJ5.js → chunk-Q7S2DADC.js} +2 -2
  67. package/dist/{chunk-3XSNW5XB.js → chunk-QARYU7R3.js} +2 -2
  68. package/dist/chunk-QZ4JVECJ.js +2 -0
  69. package/dist/{chunk-FX6ULETZ.js → chunk-R5336VHZ.js} +2 -2
  70. package/dist/chunk-RA5MTIOO.js +2 -0
  71. package/dist/{chunk-RXINFVBN.js → chunk-RIQED5OU.js} +2 -2
  72. package/dist/chunk-T2FQ4GHD.js +9 -0
  73. package/dist/chunk-T6NGEV5I.js +2 -0
  74. package/dist/chunk-T7VQG55Q.js +2 -0
  75. package/dist/chunk-TFWDJDGO.js +2 -0
  76. package/dist/chunk-TG7QSYCJ.js +2 -0
  77. package/dist/{chunk-DQ6433ZG.js → chunk-TTMKELT7.js} +17 -8
  78. package/dist/{chunk-DDQONX6B.js → chunk-U7I373V4.js} +2 -2
  79. package/dist/chunk-UAHZ57BR.js +2 -0
  80. package/dist/chunk-URSSPS5H.js +2 -0
  81. package/dist/chunk-V3Z3IOWO.js +2 -0
  82. package/dist/{chunk-7C6JBBE4.js → chunk-V7CVBPWX.js} +2 -2
  83. package/dist/{chunk-PWAK75BU.js → chunk-VYF5HA76.js} +2 -2
  84. package/dist/chunk-WIBFXSYB.js +6 -0
  85. package/dist/chunk-WS3Z6W3M.js +65 -0
  86. package/dist/chunk-WXVGNFAO.js +2 -0
  87. package/dist/chunk-XEMQUN3Z.js +20 -0
  88. package/dist/chunk-YCPASUCX.js +2 -0
  89. package/dist/chunk-YDDGCJJG.js +3 -0
  90. package/dist/{chunk-2UVCH7CQ.js → chunk-YPKBZ77R.js} +2 -2
  91. package/dist/chunk-YZXV3CU3.js +60 -0
  92. package/dist/chunk-Z3IPJKJP.js +4 -0
  93. package/dist/chunk-ZMGBWSFZ.js +2 -0
  94. package/dist/{chunk-GKB4JJDU.js → chunk-ZOIPAYRP.js} +2 -2
  95. package/dist/chunk-ZRIOGL7F.js +8 -0
  96. package/dist/cli.js +446 -280
  97. package/dist/{config-types-dvHOz0zU.d.ts → config-types-BrHl3Bge.d.ts} +57 -0
  98. package/dist/{db-rMZO5JFK.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-CtTIGh6H.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
  102. package/dist/index.d.ts +4 -68
  103. package/dist/index.js +1 -1
  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 +4 -2
  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 +42 -3
  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 +23 -4
  234. package/dist/reindex.js +19 -19
  235. package/dist/runtime.d.ts +11 -6
  236. package/dist/runtime.js +2 -2
  237. package/dist/{scip-cli-trnNvymv.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 +40 -3
  246. package/docs/analyzer-validation-ledger.md +34 -6
  247. package/package.json +39 -7
  248. package/scripts/build-scip-windows.mjs +10 -7
  249. package/skills/_shared/SKILL.md +243 -0
  250. package/skills/_shared/agents/openai.yaml +4 -0
  251. package/skills/scip-api-impact/SKILL.md +55 -71
  252. package/skills/scip-claim-audit/SKILL.md +105 -0
  253. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  254. package/skills/scip-cleanup-audit/SKILL.md +122 -0
  255. package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
  256. package/skills/scip-cleanup-improve/SKILL.md +84 -0
  257. package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
  258. package/skills/scip-concrete-plan/SKILL.md +181 -0
  259. package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
  260. package/skills/scip-conductor/SKILL.md +133 -0
  261. package/skills/scip-conductor/agents/openai.yaml +4 -0
  262. package/skills/scip-debug/SKILL.md +60 -58
  263. package/skills/scip-diagram/SKILL.md +64 -94
  264. package/skills/scip-directory-architecture/SKILL.md +65 -107
  265. package/skills/scip-doc-reconcile/SKILL.md +56 -67
  266. package/skills/scip-explore/SKILL.md +78 -210
  267. package/skills/scip-hyper-optimization/SKILL.md +124 -198
  268. package/skills/scip-integrity-audit/SKILL.md +103 -0
  269. package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
  270. package/skills/scip-language-playbook/SKILL.md +56 -326
  271. package/skills/scip-maintainability/SKILL.md +80 -219
  272. package/skills/scip-probe-reachability/SKILL.md +92 -0
  273. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  274. package/skills/scip-query/SKILL.md +108 -124
  275. package/skills/scip-react-maintainability/SKILL.md +64 -82
  276. package/skills/scip-setup/SKILL.md +121 -0
  277. package/skills/scip-setup/agents/openai.yaml +4 -0
  278. package/skills/scip-tla-model-system/SKILL.md +150 -0
  279. package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
  280. package/skills/scip-triage-issue/SKILL.md +53 -41
  281. package/skills/scip-twin-drift/SKILL.md +107 -0
  282. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  283. package/skills/scip-verify/SKILL.md +70 -88
  284. package/skills/scip-vue-maintainability/SKILL.md +67 -94
  285. package/dist/chunk-2DOW7QCA.js +0 -71
  286. package/dist/chunk-2FMFF4RI.js +0 -2
  287. package/dist/chunk-5GXTUANY.js +0 -2
  288. package/dist/chunk-5JHEN5VN.js +0 -25
  289. package/dist/chunk-62ULXMQ7.js +0 -18
  290. package/dist/chunk-63CI3IXR.js +0 -102
  291. package/dist/chunk-7EK7OSWS.js +0 -2
  292. package/dist/chunk-7IWIMNHI.js +0 -2
  293. package/dist/chunk-7XTO4YXB.js +0 -8
  294. package/dist/chunk-AOWFUGDL.js +0 -2
  295. package/dist/chunk-AREANYIA.js +0 -3
  296. package/dist/chunk-AZBELWZQ.js +0 -7
  297. package/dist/chunk-B32FX5KB.js +0 -2
  298. package/dist/chunk-B6MJ5VQV.js +0 -2
  299. package/dist/chunk-CXWCLVYL.js +0 -2
  300. package/dist/chunk-CYHIKTJN.js +0 -3
  301. package/dist/chunk-DFSEARAU.js +0 -2
  302. package/dist/chunk-DVFP6PZI.js +0 -2
  303. package/dist/chunk-E3ADDB43.js +0 -2
  304. package/dist/chunk-F6IXELII.js +0 -20
  305. package/dist/chunk-FMGVZBS2.js +0 -2
  306. package/dist/chunk-GG5LHT27.js +0 -2
  307. package/dist/chunk-H7JF2CKK.js +0 -2
  308. package/dist/chunk-HHOMJCP5.js +0 -4
  309. package/dist/chunk-HRDSU5FN.js +0 -9
  310. package/dist/chunk-HWVYTJOV.js +0 -2
  311. package/dist/chunk-JNMLBL36.js +0 -2
  312. package/dist/chunk-L446VQYQ.js +0 -2
  313. package/dist/chunk-LDJUB7XW.js +0 -2
  314. package/dist/chunk-MYTUWXHK.js +0 -4
  315. package/dist/chunk-N25HPUOK.js +0 -2
  316. package/dist/chunk-NABVR6B7.js +0 -2
  317. package/dist/chunk-NBNEVLRC.js +0 -3
  318. package/dist/chunk-ONPCQ2PM.js +0 -6
  319. package/dist/chunk-Q5P7NOVM.js +0 -2
  320. package/dist/chunk-RGKRYO22.js +0 -4
  321. package/dist/chunk-RM2WQ75T.js +0 -2
  322. package/dist/chunk-ROGZXWN2.js +0 -2
  323. package/dist/chunk-RSSXKJ6J.js +0 -38
  324. package/dist/chunk-RVGEZYMQ.js +0 -2
  325. package/dist/chunk-SA3DPTHT.js +0 -7
  326. package/dist/chunk-SGTKURU6.js +0 -52
  327. package/dist/chunk-T4N2ZRVY.js +0 -21
  328. package/dist/chunk-THB6AM3V.js +0 -11
  329. package/dist/chunk-ULHLDOD6.js +0 -4
  330. package/dist/chunk-UQ73QF5D.js +0 -43
  331. package/dist/chunk-UUBMFL3F.js +0 -59
  332. package/dist/chunk-V5FGK3DZ.js +0 -2
  333. package/dist/chunk-WTY5FERW.js +0 -2
  334. package/dist/chunk-WUOB4DHH.js +0 -6
  335. package/dist/chunk-YFQIKYOP.js +0 -2
  336. package/dist/chunk-Z2LDWIJV.js +0 -5
  337. package/dist/chunk-ZNWWVYQL.js +0 -3
  338. package/skills/concrete-plan/SKILL.md +0 -372
  339. package/skills/concrete-plan/agents/openai.yaml +0 -4
  340. package/skills/scip-adoption/SKILL.md +0 -122
  341. package/skills/scip-adoption/agents/openai.yaml +0 -4
  342. package/skills/scip-ai-cleanup/SKILL.md +0 -153
  343. package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
  344. package/skills/scip-debloat/SKILL.md +0 -439
  345. package/skills/scip-debloat/agents/openai.yaml +0 -4
  346. package/skills/scip-health-audit/SKILL.md +0 -162
  347. package/skills/scip-health-audit/agents/openai.yaml +0 -4
  348. package/skills/scip-health-improve/SKILL.md +0 -155
  349. package/skills/scip-health-improve/agents/openai.yaml +0 -4
  350. package/skills/scip-query-setup/SKILL.md +0 -170
  351. package/skills/scip-query-setup/agents/openai.yaml +0 -3
  352. package/vendor/scip/README.md +0 -6
  353. package/vendor/scip/win32-arm64/scip.exe +0 -0
  354. package/vendor/scip/win32-x64/scip.exe +0 -0
@@ -0,0 +1,9 @@
1
+ import{A as R,B as We,C as he,D as He,E as Je,c as je,d as De,e as _,f as Oe,g as Me,h as ve,i as B,j as $e,k as H,l as Ue,m as qe,n as Be,o as L,p as J,q as A,r as me,s as de,t as S,u as fe,v as ze,w as ge,x as Q,y as G,z as Ve}from"./chunk-ISLWJ4PY.js";import{b as W,i as Se,m as K,o as X,p as k}from"./chunk-WS3Z6W3M.js";import{b as ne}from"./chunk-GNG622H3.js";import{a as we,c as q,f as re}from"./chunk-7S5E7KWT.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _t(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function w(e){return e.replace(/[^\r\n]/g," ")}var $n=re("stripped-lines",{clearGroups:["whole-project","source-file"]});we({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{se=null,Y=""},clearFile:()=>{se=null,Y=""}});var se=null,Y="";function Rt(e){return se===e||(se=e,Y=_t(e)),Y}function j(e,r,t){let n=Rt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function z(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xe(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}var Et=new Set(["identifier","type_identifier","field_identifier"]),Tt=new Set(["identifier"]),Ft=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Lt=new Set(["rust","python"]),At=/\{([^{}]*)\}/g,kt=/\b([A-Za-z_][\w]*)\b/g;function Ke(e,r){return wt(r).has(e.type)}function Xe(e,r){return Lt.has(r)&&e.type==="string_content"}function ye(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function wt(e){return e==="rust"?Et:e==="python"?Tt:Ft}function Qe(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(At)){let s=n[1]??"";for(let o of s.matchAll(kt))o[1]&&r(o[1],t)}}var jt=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Dt=/^#!?\[\s*serde\s*\(/,Ot=/^#!?\[\s*schemars\s*\(/,Mt=/^#!?\[\s*validate\s*\(/,vt=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Ge(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=he(n);if(!s||!vt.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function Ye(e,r){let t=Dt.test(e),n=Ot.test(e),s=Mt.test(e);if(!(!t&&!n&&!s))for(let o of jt){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function Ze(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(l=>l.type==="identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="block");if(c)for(let l of c.descendantsOfType("type"))for(let p of l.descendantsOfType("identifier"))p.text!==a&&n(p.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var $t=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),be=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function et(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
2
+ `){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=ie(e,a);continue}if(l==='"'){let h=ee(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,Ut(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Ne(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Ie(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let d={text:m,line:p};qt(o[o.length-1],d),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:Ht(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Ut(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=$t.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(Bt(e,r),!n||be.has(t.text)||be.has(n)||n.startsWith(":"))return;let o=Wt(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function qt(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function Bt(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of oe(e))Z(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of oe(e)){n&&Z(r,n,"extension",s,"extension-method");let o=Vt(e,s.startLine);o&&o!==n&&Z(r,o,"extension",s,"extension-method")}}}function oe(e){return e.children.filter(zt)}function zt(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!be.has(r)&&!r.startsWith(":"))}function Z(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function Vt(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Wt(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function ie(e,r){let t=r;for(;t<e.length&&e[t]!==`
3
+ `;)t+=1;return t}function ee(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
4
+ `&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Ne(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ie(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ht(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var Jt=re("source-facts",{clearGroups:["whole-project","source-file"]}),Ce=K({kind:"source-facts",invalidation:X("source-facts"),serialize:Gt,deserialize:Yt});function T(e,r){return Kt(e,r).facts}function Kt(e,r){let t=k(e,r);if(!t)return{facts:null};let n=Xt(e,r,t);return n?Jt.get(e,r,t,()=>Qt(e,r,n,t)):{facts:null}}function Xt(e,r,t){return G(r)?Ve(e,r,t)?.language??null:Q(r)}function Qt(e,r,t,n){let s=W(e,r,n),o=Ce.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=et(n);return Ce.write(e,r,s,c),{facts:c}}let i=R(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=rr(i,t);return Ce.write(e,r,s,a),{facts:a}}function Gt(e){let r={language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function Yt(e){try{let r=JSON.parse(e);if(r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:ye(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function Zt(e,r,t,n){let s=T(e,r);return s?tr(s,t,n)?.isLiteralPassthrough??!0:!0}function er(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:T(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function tr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function rr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=He(l,r);p&&t.push(p);let u=We(l,r);u&&n.push(u),Ge(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&Ye(l.text,s),Ke(l,r)&&a(l.text,l.startPosition.row),Xe(l,r)&&Qe(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:Ze(e,r),identifierLineMap:i,identifiersByLine:ye(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var tt=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function nr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function sr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callSites}function or(e,r){return T(e,r)?.typeContainerMap??new Map}function ir(e,r,t={}){let n=T(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as rt}from"path";var ar=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&ar.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function E(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,Be(r)),kind:"named",used:x(t,o),usedMembers:[]}}function f(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function F(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function M(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function v(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=j(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n){let s=R(e,r);if(s){let o=t(s);if(o)return o}return n()}function ae(e,r,t,n){let s=R(e,r),o=Q(r),i=o?t[o]:void 0;return s&&i?i(s):n()}function nt(e,r,t){return C(e,r,n=>lr(e,r,n),()=>cr(e,r,t))}function cr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=rt(o).replace(/\.[^.]+$/,"");return[F(o,i,de(e,r,o),x(s,i))]})}function lr(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=rt(i).replace(/\.[^.]+$/,"");s.push(f(i,a,de(e,r,i),n))}return s}var pr=new Set([":require",":require-macros",":use"]),Re=String.raw`A-Za-z0-9_$*+!?.<>=-`;function ot(e,r,t){let n=Nr(t);if(!n)return[];let s=br(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=P(i.children[0]);if(a){if(pr.has(a)){for(let c of dr(i.children.slice(1)))o.push(...mr(e,c,s));continue}if(a===":import")for(let c of gr(i.children.slice(1)))o.push(c)}}return o}function ur(e){return e.type==="list"&&P(e.children[0])==="ns"}function mr(e,r,t){let n=ze(e,r.namespace),s=r.alias??r.namespace,o=hr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||xr(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:yr(t,a),usedMembers:[]});return i}function dr(e){return e.flatMap(r=>ce(r,null))}function ce(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:_e(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&P(e.children[0])===null?e.children.flatMap(t=>ce(t,r)):fr(e,r);if(e.type==="list"&&e.children.length>0){let t=P(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ce(n,_e(r,t))):e.children.flatMap(n=>ce(n,r))}return[]}function fr(e,r){let t=P(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:_e(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=P(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=P(i),s+=1;continue}o===":refer"&&i&&(P(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(P).filter(Sr)),s+=1)}return[n]}function gr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(F(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=P(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=P(s);o&&r.push(F(`${n}.${o}`,o,null,!0))}}return r}function _e(e,r){return e?`${e}.${r}`:r}function P(e){return e?.type==="atom"?e.text:null}function Sr(e){return!!(e&&!e.startsWith(":"))}function hr(e,r){let t=new Set,n=new RegExp(`${Ee()}${O(r)}\\s*/\\s*([${Re}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xr(e,r){return new RegExp(`${Ee()}${O(r)}\\s*/`,"m").test(e)}function yr(e,r){return new RegExp(`${Ee()}${O(r)}(?![${Re}])`,"m").test(e)}function Ee(){return`(?<![${Re}])`}function br(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
5
+ `?`
6
+ `:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ie(e,s);n+=st(e.slice(s,i)),s=i;continue}if(o==='"'){let i=ee(e,s,0).index;n+=st(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Nr(e){let r=0;for(;r<e.length&&(r=Te(e,r),!(r>=e.length));){let t=le(e,r);if(!t){r+=1;continue}if(ur(t.form))return t.form;r=t.index}return null}function le(e,r){let t=Te(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Ir(e,t);if(e.startsWith("#_",t)){let s=le(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Ne(e[t]);)t+=1;let n=e[t];return n?n==="("?Pe(e,t,"list",")"):n==="["?Pe(e,t,"vector","]"):n==="{"?Pe(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:ee(e,t,0).index},index:ee(e,t,0).index}:Pr(e,t):null}function Ir(e,r){let t=e.startsWith("#?@",r)?3:2,n=le(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Cr(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Cr(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Pe(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Te(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=le(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Pr(e,r){let t=r;for(;t<e.length&&!Ie(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Te(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ie(e,t);continue}break}return t}function st(e){return e.replace(/[^\r\n]/g," ")}function it(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=j(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:fe(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function at(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:fe(e,r,o)})}return n}function ct(e,r,t){return ae(e,r,{csharp:n=>Rr(e,r,n),vb:n=>_r(e,r,n)},()=>{let n=qe(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[E(e,r,o,p,u,m,S(e,p,B))]})})}function _r(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(f(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Rr(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(f(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var Er=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function lt(e,r){return Er.get(e,r,()=>{let t=new Set,n=k(e,r);if(!n)return t;let o=n.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))t.add(i[0]);return t})}function Fe(e,r,t){return C(e,r,n=>Fr(e,r,n),()=>Tr(e,r,t))}function Tr(e,r,t){return Ur(t).flatMap(n=>qr(e,r,n.clause,n.specifier,n.start,n.end,t))}function Fr(e,r,t){let n=Lr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Ar(e,r,t,o,n));return s}function Lr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of lt(e,r))n.add(s);return n}function Ar(e,r,t,n,s){let o=Or(n);if(!o)return[];let i=L(e,r,o),a=b(n,"import_clause");return a?kr(t,a,i,s,Mr(n.text)):[M("*",i)]}function kr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(wr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=jr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Dr(i,t,n,s));return o}function wr(e,r,t,n){return f("default",e,r,t,"default",{isTypeOnly:n})}function jr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=$r(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Dr(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(f(c,l,r,t,"named",{isTypeOnly:n||vr(o.text)}))}return s}function Or(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function Mr(e){return/^\s*import\s+type\b/.test(e)}function vr(e){return/^\s*type\b/.test(e.trim())}function $r(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Ur(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function qr(e,r,t,n,s,o,i){let a=L(e,r,n),c=j(i,s,o);return t?Br(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):F(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Br(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=zr(n),i=[];return s&&i.push(...pt(s,t)),o&&i.push(...pt(o,t)),i}function pt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function zr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function Le(e,r,t){let n=R(e,r);return n?Xr(e,r,n):Vr(e,r,t)}function Vr(e,r,t){return[...Wr(e,r,t),...Hr(e,r,t),...Jr(e,r,t)]}function Wr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Kr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:L(e,r,a),names:c,startLine:l,endLine:p})}return n}function Hr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Jr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Kr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Xr(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=Qr(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=Gr(s,o,i,a);n.push(c)}return n}function Qr(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return L(e,r,s.text)}function Gr(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return b(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function ut(e,r,t){return ae(e,r,{java:n=>Yr(e,r,n),kotlin:n=>Zr(e,r,n),scala:n=>en(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?tn(e,r,o,s):[]}))}function Yr(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(f(p,p,S(e,l,_),n))}return s}function Zr(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.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"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(f(p,m,S(e,l,_),n))}return s}function en(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,d]=u.namedChildren;if(!m)continue;let h=m.text,$=d?.text??h;if(h==="_")continue;s.push(f(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(f(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(f(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function tn(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[E(e,r,n,m,p,u)]})}return[E(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function dt(e,r,t){return C(e,r,n=>rn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[E(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}))}function rn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(f(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=mt(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=mt(c,"");l&&o(u,l,p)}}return s}function mt(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function gt(e,r,t){return C(e,r,n=>nn(e,r,n),()=>on(t).flatMap(n=>cn(e,r,n,t)))}function nn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=ft(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=sn(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=ft(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function ft(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function sn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function on(e){let r=e.split(`
7
+ `),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=xe(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
8
+ ${m}`,l+=1+m.length,p+=xe(m),n+=m.length+1}let u=an(c);u&&t.push({...u,start:a,end:l})}return t}function an(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function cn(e,r,t,n){let s=j(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),d=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,d);return[{importedName:m,localName:d,sourcePath:h,kind:"namespace",used:x(s,d)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as ln}from"path";function St(e,r,t){return C(e,r,n=>un(e,r,n),()=>pn(e,r,t))}function pn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?me(e,r,i):null;if(a){let c=ht(i);return[F(c,c,a,x(s,c))]}return[M(i,a)]})}function un(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(d=>d.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?me(e,r,u):null;if(m){let d=ht(u);s.push(f(d,d,m,n))}else s.push(M(u,m))}return s}function ht(e){return Je(ln(e).replace(/\.[^.]+$/,""),/_/)}function xt(e,r,t){return C(e,r,n=>mn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?dn(e,r,o,s):[]}))}function mn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of te(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=A(e,r,a.qualifiedName)??A(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(f(a.importedName,a.localName,c,n))}}return s}function te(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:pe(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:pe(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=pe(r,t.text),o=[];for(let i of n.namedChildren)o.push(...te(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...te(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=te(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:pe(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function pe(e,r){return e?r?`${e}::${r}`:e:r}function dn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let d=m.trim();if(!d||d==="self")return[];let[h,$]=d.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Ct=($??U.split("::").pop()??U).trim(),Pt=`${p}::${U}`.replace(/::::/g,"::");return[E(e,r,n,Pt,U.split("::").pop()??U,Ct,A(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=A(e,r,a)??A(e,r,a.split("::").slice(0,-1).join("::"));return[E(e,r,n,a,a.split("::").pop()??a,c,l)]}function yt(e,r,t){let n=R(e,r);if(n)return fn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Sn(e,r,i))}return s}function fn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!gn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of te(o,""))i.importedName&&n.push(Ae(e,r,i.qualifiedName))}return n}function gn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Sn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[Ae(e,r,l)]})}return[Ae(e,r,n)]}function Ae(e,r,t){return{specifier:t,sourcePath:A(e,r,t)??A(e,r,t.split("::").slice(0,-1).join("::"))}}function D({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function bt(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var hn={language:"javascript",extensions:je,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Fe,parseReExports:Le},xn=D({language:"python",extensions:De,imports:"ast-with-regex-fallback",parseImports:gt}),yn=D({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:ut}),bn={language:"rust",extensions:Oe,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:xt,parseExports:yt},Nn=D({language:"ruby",extensions:Me,imports:"ast-with-regex-fallback",parseImports:St}),In=D({language:"c/cpp",extensions:ve,imports:"ast-with-regex-fallback",parseImports:nt}),Cn=D({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:ct}),Pn={language:"dart",extensions:$e,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:it,parseExports:at},_n=D({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:dt}),Rn=D({language:"clojure",extensions:Ue,imports:"regex-only",parseImports:ot}),En=[hn,xn,yn,bn,Nn,In,Cn,Pn,_n,Rn];function ue(e){return bt(En,e)}var ke={clearGroups:["whole-project","source-file"]},Tn=q("source-imports",ke),Fn=q("source-exports",ke),Ln=q("source-reexports",ke),Nt=K({kind:"source-imports",invalidation:X("source-imports"),serialize:An,deserialize:kn}),It=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:wn,deserialize:jn});function zo(e,r){let t=ne(r);return Ln.get(e,t,()=>{let n=ue(t);if(!n?.parseReExports)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=It.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return It.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Vo(e,r){let t=ne(r);return Tn.get(e,t,()=>{let n=ue(t);if(!n)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=Nt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Nt.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Wo(e,r){let t=ne(r);return Fn.get(e,t,()=>{let n=ue(t);if(!n?.parseExports)return[];let s=k(e,t);return s?n.parseExports(e,t,s):[]})}function An(e){return JSON.stringify(e)}function kn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function wn(e){return JSON.stringify(e)}function jn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,_t as b,xe as c,T as d,Kt as e,Zt as f,er as g,nr as h,sr as i,or as j,ir as k,zo as l,Vo as m,Wo as n};
9
+ //# sourceMappingURL=chunk-T2FQ4GHD.js.map
@@ -0,0 +1,2 @@
1
+ import{e as S}from"./chunk-YDDGCJJG.js";import{a as f,e as D}from"./chunk-HXXMPYEF.js";import{x as F}from"./chunk-ISLWJ4PY.js";import{b as C,l as g,m as v,o as y}from"./chunk-WS3Z6W3M.js";import{c as d}from"./chunk-7S5E7KWT.js";var E=d("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]}),b=v({kind:"consumer-file-usage",invalidation:y("consumer-file-usage"),serialize:O,deserialize:k});function B(n,e){return{forDefinitions(i,r){return M(n,e,i,r)}}}function J(n){let e=new Map;for(let[i,r]of n)e.set(i,new Set(r.files.map(t=>t.file)));return e}function q(n,e,i){return L(n,e,i).partition}function M(n,e,i,r){let t=x(i.length);return g("consumer-evidence.product",()=>{let o=w(n,e,i,r),s=new Map;t={...t,...o.counters};for(let a of i){let c=o.sources.get(a.symbolId)??new Map,l=L(n,a,[...c.keys()],c);t.realFiles+=l.partition.realConsumers.length,t.reexportOnlyFiles+=l.partition.barrelConsumers,t.importOnlyFiles+=l.partition.importOnlyConsumers,s.set(a.symbolId,{definition:a,files:l.files,...l.partition})}return s},()=>({...t}))}function x(n){return{definitions:n,indexedFiles:0,semanticFiles:0,fallbackFiles:0,totalFiles:0,realFiles:0,reexportOnlyFiles:0,importOnlyFiles:0}}function w(n,e,i,r){let t=x(i.length),o=new Map;return m(o,t,"indexed",e.crossFileCallerMap(i,{semantic:!1})),r.semantic&&m(o,t,"semantic",S(n,i)),r.sourceFallback!==!1&&m(o,t,"source-fallback",e.sourceFallbackCallerFiles(i)),t.totalFiles=[...o.values()].reduce((s,a)=>s+a.size,0),{sources:o,counters:t}}function m(n,e,i,r){let t=0;for(let[o,s]of r){let a=n.get(o);a||(a=new Map,n.set(o,a));for(let c of s){t++;let l=a.get(c)??new Set;l.add(i),a.set(c,l)}}i==="indexed"?e.indexedFiles+=t:i==="semantic"?e.semanticFiles+=t:e.fallbackFiles+=t}function L(n,e,i,r=new Map){let t=[],o=0,s=0,a=D(e.symbol),c=[];for(let l of i){let u;_(n,l,e.relativePath,a)?(o++,u="reexport-only"):h(n,l,a)?(s++,u="import-only"):(t.push(l),u="real"),c.push({file:l,sources:[...r.get(l)??[]],classification:u})}return{partition:{realConsumers:t,barrelConsumers:o,importOnlyConsumers:s},files:c}}function h(n,e,i){if(!i)return!1;let r=F(e);if(!r)return!1;let t=E.get(n,e,()=>P(n,e,r));return t.importedLeaves.has(i)&&!t.usedLeaves.has(i)}function P(n,e,i){let r=f(n).forFile(e,{text:!0,ast:!0}),t=r.text;if(!t)return U();let o=C(n,e,t),s=b.read(n,e,o);if(s)return s;let a=I(r.ast,i);return b.write(n,e,o,a),a}function I(n,e){let i=new Set,r=new Set;if(!n)return{importedLeaves:i,usedLeaves:r};let t=e==="rust"?new Set(["use_declaration"]):e==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),o=(s,a)=>{let c=a||t.has(s.type);(s.type==="identifier"||s.type==="type_identifier"||s.type==="property_identifier"||s.type==="field_identifier")&&(c?i.add(s.text):r.add(s.text));for(let l of s.children)o(l,c)};return o(n.rootNode,!1),{importedLeaves:i,usedLeaves:r}}function U(){return{importedLeaves:new Set,usedLeaves:new Set}}function O(n){return JSON.stringify({importedLeaves:[...n.importedLeaves],usedLeaves:[...n.usedLeaves]})}function k(n){try{let e=JSON.parse(n);return!Array.isArray(e.importedLeaves)||!Array.isArray(e.usedLeaves)?null:{importedLeaves:new Set(e.importedLeaves.filter(i=>typeof i=="string")),usedLeaves:new Set(e.usedLeaves.filter(i=>typeof i=="string"))}}catch{return null}}function _(n,e,i,r){if(!r)return!1;let t=f(n).forFile(e,{lines:!0,reexports:!0}),o=t.lines??[];if(o.length===0)return!1;let s=t.reexports??[];if(s.length===0)return!1;let a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=new RegExp(`\\b${a}\\b`),l=0;for(let u=0;u<o.length;u++){if(!c.test(o[u]??""))continue;if(l++,!s.find(p=>p.startLine<=u&&u<=p.endLine))return!1}return l>0}export{B as a,J as b,q as c,h as d};
2
+ //# sourceMappingURL=chunk-T6NGEV5I.js.map
@@ -0,0 +1,2 @@
1
+ import{a as u}from"./chunk-UAHZ57BR.js";import{a as h}from"./chunk-72MFTCU5.js";import{q as S}from"./chunk-MKM7NBZK.js";import{a as d,c as b}from"./chunk-ECVXWZ4Q.js";import{m as y}from"./chunk-MBKJ7GHT.js";import{d as m}from"./chunk-HXXMPYEF.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-T7VQG55Q.js.map
@@ -0,0 +1,2 @@
1
+ import{execFileSync as t}from"child_process";import{platform as l}from"os";var c=l()==="win32";function n(e){let r=c?"where":"which";try{return t(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as o}from"child_process";import{createRequire as a}from"module";import{existsSync as p}from"fs";import{platform as s,arch as u}from"os";var g="https://github.com/sourcegraph/scip",f="SCIP_QUERY_SCIP_BIN";function m(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let r=e.env[f];if(r&&e.fileExists(r))return{source:"env",path:r};if(e.platform==="win32"){let i=e.resolveSidecar(e.arch);if(i&&e.fileExists(i))return{source:"sidecar",path:i}}return null}function d(e){let r=a(import.meta.url);for(let i of e==="arm64"?["arm64","x64"]:[e])try{return r.resolve(`scip-query-scip-windows/scip-win32-${i}.exe`)}catch{}return null}function P(e=process.env){return m({platform:s(),arch:u(),env:e,isOnPath:n,fileExists:p,resolveSidecar:d})?.path??null}function B(e){if(s()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(o("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(o("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${g}/releases`),!1}export{n as a,P as b,B as c};
2
+ //# sourceMappingURL=chunk-TFWDJDGO.js.map
@@ -0,0 +1,2 @@
1
+ import{a as P,b as y}from"./chunk-KJCDEDQW.js";import{a as C,c as b,e as o,f}from"./chunk-6XA4LDHY.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{F as v}from"./chunk-ISLWJ4PY.js";function L(e,i={}){let{minSimilarity:r=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=T(e,{scope:l,minTokens:n,scanLimit:u}),p=P(s,t=>t.tokens);return y({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,r),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function T(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(r=>({file:r.file,tokens:r.templateTokens,loc:B(r)}))}function B(e){return e.totalLines}function V(e,i,r){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<r)return null;let l=o(n,"component:"),u=o(n,"prop:"),m=o(n,"event:"),d=o(n,"directive:"),s=o(n,"slot:"),p=o(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,r=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(r+=1);return b([{name:"component",count:i},{name:"behavior",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return C({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
2
+ //# sourceMappingURL=chunk-TG7QSYCJ.js.map
@@ -1,8 +1,16 @@
1
- import{a as r}from"./chunk-OFXN2BCT.js";import{a as l}from"./chunk-NBNEVLRC.js";import{a as c}from"./chunk-F6IXELII.js";import{d}from"./chunk-NABVR6B7.js";function p(e,t){let o=l(e,t);if(!o)return[];let n=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
1
+ import{a as _}from"./chunk-OSWF3HSF.js";import{a as r}from"./chunk-ECVXWZ4Q.js";import{a as l}from"./chunk-XEMQUN3Z.js";import{d as c}from"./chunk-HXXMPYEF.js";function y(e,s){let o=r(e,s);if(!o)return[];let t=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN (
5
+ SELECT m2.symbol_id, c2.document_id
6
+ FROM mentions m2
7
+ JOIN chunks c2 ON m2.chunk_id = c2.id
8
+ WHERE m2.role = 1
9
+ GROUP BY m2.symbol_id
10
+ ) sym_def ON sym_def.symbol_id = m.symbol_id
4
11
  WHERE m.symbol_id = ?
5
- AND m.role != 1`,o.symbolId);return[{name:d(o.symbol),count:n?.file_count??0}]}function b(e,t){let o=r(e,t);if(!o)return[];let s=e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
12
+ AND m.role != 1
13
+ AND sym_def.document_id != c.document_id`,o.symbolId);return[{name:c(o.symbol),count:t?.file_count??0}]}function p(e,s){let o=_(e,s);if(!o)return[];let n=e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
6
14
  FROM mentions m
7
15
  JOIN chunks c ON m.chunk_id = c.id
8
16
  JOIN documents d ON c.document_id = d.id
@@ -19,7 +27,7 @@ import{a as r}from"./chunk-OFXN2BCT.js";import{a as l}from"./chunk-NBNEVLRC.js";
19
27
  AND m.role != 1
20
28
  AND def_d.id != d.id
21
29
  GROUP BY d.id
22
- ORDER BY symbol_count DESC`,o).filter(m=>!e.isIgnored(m.relative_path)).map(m=>({name:m.relative_path,count:m.symbol_count}));if(s.length>0)return s;let i=c(e).get(o);return!i||i.size===0?[]:[{name:o,count:i.size}]}function y(e,t={}){return _(e,t).map(o=>({name:d(o.symbol),count:o.file_count}))}function _(e,t){let{limit:o=30,scope:n}=t,s=n?`AND def_d.relative_path LIKE '%${n}%'`:"";return e.all(`SELECT gs.symbol, COUNT(DISTINCT c.document_id) AS file_count
30
+ ORDER BY symbol_count DESC`,o).filter(i=>!e.isIgnored(i.relative_path)).map(i=>({name:i.relative_path,count:i.symbol_count}));if(n.length>0)return n;let d=l(e).get(o);return!d||d.size===0?[]:[{name:o,count:d.size}]}function b(e,s={}){return u(e,s).map(o=>({name:c(o.symbol),count:o.file_count}))}function u(e,s){let{limit:o=30,scope:t}=s,n=t?"AND def_d.relative_path LIKE ?":"",m=t?[`%${t}%`]:[];return e.all(`SELECT gs.symbol, COUNT(DISTINCT c.document_id) AS file_count
23
31
  FROM mentions m
24
32
  JOIN chunks c ON m.chunk_id = c.id
25
33
  JOIN global_symbols gs ON m.symbol_id = gs.id
@@ -32,13 +40,14 @@ import{a as r}from"./chunk-OFXN2BCT.js";import{a as l}from"./chunk-NBNEVLRC.js";
32
40
  ) sym_def ON sym_def.symbol_id = gs.id
33
41
  JOIN documents def_d ON sym_def.document_id = def_d.id
34
42
  WHERE m.role != 1
43
+ AND def_d.id != c.document_id
35
44
  ${e.pathExclusionsFor("def_d")}
36
45
  ${e.symbolNoiseFor("gs")}
37
- ${s}
46
+ ${n}
38
47
  GROUP BY gs.id
39
48
  HAVING file_count > 1
40
49
  ORDER BY file_count DESC
41
- LIMIT ?`,o)}function I(e,t={}){let{limit:o=30,scope:n}=t,s=n?`AND d.relative_path LIKE '%${n}%'`:"";return e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
50
+ LIMIT ?`,...m,o)}function E(e,s={}){let{limit:o=30,scope:t}=s,n=t?"AND d.relative_path LIKE ?":"",m=t?[`%${t}%`]:[];return e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
42
51
  FROM mentions m
43
52
  JOIN chunks c ON m.chunk_id = c.id
44
53
  JOIN documents d ON c.document_id = d.id
@@ -55,8 +64,8 @@ import{a as r}from"./chunk-OFXN2BCT.js";import{a as l}from"./chunk-NBNEVLRC.js";
55
64
  AND def_d.id != d.id
56
65
  ${e.pathExclusionsFor("d")}
57
66
  ${e.symbolNoiseFor("gs")}
58
- ${s}
67
+ ${n}
59
68
  GROUP BY d.id
60
69
  ORDER BY symbol_count DESC
61
- LIMIT ?`,o).filter(i=>!e.isIgnored(i.relative_path)).map(i=>({name:i.relative_path,count:i.symbol_count}))}export{p as a,b,y as c,I as d};
62
- //# sourceMappingURL=chunk-DQ6433ZG.js.map
70
+ LIMIT ?`,...m,o).filter(i=>!e.isIgnored(i.relative_path)).map(i=>({name:i.relative_path,count:i.symbol_count}))}export{y as a,p as b,b as c,E as d};
71
+ //# sourceMappingURL=chunk-TTMKELT7.js.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-F6IXELII.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
2
- //# sourceMappingURL=chunk-DDQONX6B.js.map
1
+ import{a as k}from"./chunk-XEMQUN3Z.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
2
+ //# sourceMappingURL=chunk-U7I373V4.js.map
@@ -0,0 +1,2 @@
1
+ import{b as D,f as H,g as O}from"./chunk-NAH5EAZS.js";import{a as x}from"./chunk-BGBBVSH4.js";import{b as U,d as X,e as Z,f as $}from"./chunk-72MFTCU5.js";import{a as _,j as z,k as J,m as N,n as Q}from"./chunk-MKM7NBZK.js";import{a as B}from"./chunk-XEMQUN3Z.js";import{f as I,h as W,i as Y,j as P}from"./chunk-MBKJ7GHT.js";import{a as j,g as k,h as T,j as V,k as G}from"./chunk-HXXMPYEF.js";import{k as F}from"./chunk-T2FQ4GHD.js";import{x as R,y as E}from"./chunk-ISLWJ4PY.js";import{l as w,p as A,s as h}from"./chunk-WS3Z6W3M.js";import{g as K}from"./chunk-GNG622H3.js";import{a as q}from"./chunk-64MNV6AB.js";function ee(n,e,t){let r=e.identifierResolution==="strict"?N:Q,l=e.candidateNames?z(e.candidateNames):null,o=0,f=0,m=0,p=0,y="";for(let a of e.paths)if(o+=1,y=a,!(!R(a)&&!(e.includeVueSfc&&E(a)))&&!n.isIgnored(a)&&!e.skipPath?.(a))try{if(l&&!J(A(n,a),l))continue;f+=1;let S=(s,u,v,b)=>{if(e.candidateNames&&!e.candidateNames.has(s))return;m+=1;let g=e.resolveTargets?e.resolveTargets({sourceFile:a,name:s,kind:u,defaultTargets:b}):b();for(let L of g)p+=1,t({sourceFile:a,name:s,target:L,occurrences:v,kind:u})},M=_(n,a);for(let[s,u]of M)S(s,"identifier",u.length,()=>r(n,a,s));for(let s of F(n,a,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let u=s.kind==="cross-language-dispatch"?()=>N(n,a,s.name):()=>r(n,a,s.name);S(s.name,s.kind,s.occurrences,u)}}finally{e.afterPath?.(a),o%10===0&&w("source-reference-scan.progress",()=>{},()=>({scannedPaths:o,currentPath:y,candidateMatchedPaths:f,visitedNames:m,visitedHits:p}))}}function ne(n,e={}){let{scope:t,files:r,minLoc:l=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:f,excludeEntrySurfaces:m=!1,excludeTypesFiles:p=!1,excludeRootedSymbols:y=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:C=!1,excludeRustTraitImplMembers:S=!1,includeSuppressed:M=!1,sortByLocDesc:s=!1}=e,u=[],v=re(n,{scope:t,files:r,requireFunctionLikeSymbol:a,requireCallableSymbol:C}),b=new Map,g=new Map,L=i=>{let c=b.get(i);if(c!==void 0)return c;let d=H(n,i);return b.set(i,d),d},ie=i=>{let c=g.get(i);if(c!==void 0)return c;let d=D(i);return g.set(i,d),d};for(let i of v){let c=i.relativePath;if(n.isIgnored(c)||m&&L(c)||!oe(i,{requireFunctionLikeSymbol:a,requireCallableSymbol:C})||f!==void 0&&i.symbol===f)continue;let d=x(i);d<l||d>o||p&&ae(c)||y&&O(n,i.symbol,c)||S&&V(i.symbol)||ie(c)!=="test"&&(G(i.symbol)||!M&&h(n,c,i.startLine)||u.push(i))}return s?u.sort((i,c)=>x(c)-x(i)):u}function re(n,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>I(n,r)):e.requireCallableSymbol?P(n,{scope:e.scope,symbolMatches:k,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?P(n,{scope:e.scope,symbolMatches:T,sqlPrefilter:"function-like"}):Y(n,e.scope)}function oe(n,e){return e.requireCallableSymbol?k(n.symbol):e.requireFunctionLikeSymbol?T(n.symbol):n.isFunctionLike}function ae(n){return(n.split("/").pop()??"").includes("types")}var te=class{constructor(e){this.db=e}db;scopedDefinitions(e){return W(this.db,e)}definitionsForFile(e){return I(this.db,e)}productionCallableDefinitions(e={}){return ne(this.db,e)}calleeMap(e,t={}){return U(this.db,e,t)}crossFileCallerMap(e,t={}){return X(this.db,e,t)}sourceFallbackCallerFiles(e,t={}){return Z(this.db,e,t)}callerFileMap(e,t={}){return $(this.db,e,t)}frameworkReferencedSymbolIds(e){let t=new Map;for(let l of e){if(!l.leaf)continue;let o=t.get(l.leaf)??[];o.push(l.symbolId),t.set(l.leaf,o)}let r=new Set;for(let l of q(this.db,{includeIgnored:!1}))if(R(l)==="rust")for(let{name:o}of F(this.db,l,{includeRustAttributeNames:!0}))for(let f of t.get(o)??[])r.add(f);return r}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let r=new Map(e.map(o=>[o.symbolId,o.symbol])),l=this.calleeMap(e,t);return new Set([...l.entries()].filter(([o,f])=>{let m=r.get(o);return f.some(p=>p.symbol!==m)}).map(([o])=>o))}fileDependencyGraph(e){return B(this.db,e)}fileKind(e){return D(e)}hasSuppressionComment(e){return h(this.db,e.relativePath,e.startLine)}sourceFiles(){return K(this.db)}scanSourceReferences(e,t){ee(this.db,e,t)}callableSignature(e){let t=j(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{te as a};
2
+ //# sourceMappingURL=chunk-UAHZ57BR.js.map
@@ -0,0 +1,2 @@
1
+ import{a as R,b as F}from"./chunk-KJCDEDQW.js";import{a as k,b as C,c as V,e as a,f as v}from"./chunk-6XA4LDHY.js";import{a as B,b as g}from"./chunk-KMVGRIO2.js";import{F as y}from"./chunk-ISLWJ4PY.js";function j(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:t=6,limit:i=20,scope:l,scanLimit:c,filePattern:d,focusFiles:h}=s,u=y(e).vueProfiles({scope:l,minBehaviorTokens:Math.max(3,t),scanLimit:c}).map(n=>({file:n.file,tokens:n.behaviorTokens,profile:n})),r=R(u,n=>n.tokens);return F({profiles:u,limit:i,filePattern:d,focusFiles:h,candidateIndex:r,profile:{name:"vue-composable-candidates"},compare:(n,o)=>T(n,o,m,t),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.fileB.localeCompare(o.fileB)})}function T(e,s,m,t){let i=B(e.tokens,s.tokens);if(i.size<t||!P(i))return null;let l=C(e.tokens,s.tokens);if(l<m)return null;let c=a(i,"composable:"),d=a(i,"store:"),h=a(i,"reactivity:"),u=a(i,"lifecycle:"),r=a(i,"request:"),n=a(i,"function:"),o=a(i,"function-verb:"),b=a(i,"template-binding:"),p=a(i,"template-event:"),f=q({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:l,sharedTokens:v(i),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(g(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:r,sharedLifecycle:u,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function q(e){return k({genericWords:E,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:w})}function w(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 s=0,m=0,t=0,i=0,l=0,c=0,d=0;for(let r of e)r.startsWith("composable:")?s+=1:r.startsWith("store:")?m+=1:r.startsWith("request:")?t+=1:r.startsWith("lifecycle:")?i+=1:r.startsWith("function:")?l+=1:r.startsWith("reactivity:")?c+=1:(r.startsWith("function-verb:")||r.startsWith("template-binding:")||r.startsWith("template-event:"))&&(d+=1);let h=s+m,u=h+t+i+l+d;return V([{name:"requests",count:t},{name:"lifecycle",count:i},{name:"functions",count:l},{name:"reusableHooks",count:h},{name:"reactivity",count:c},{name:"namedBehavior",count:u}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{lifecycle:1,functions:2,namedBehavior:4},reason:"shared lifecycle workflow"},{min:{reusableHooks:2,requests:1,namedBehavior:5},reason:"shared reusable Vue hooks and requests"},{min:{reusableHooks:2,functions:2,namedBehavior:5},reason:"shared reusable Vue hooks and functions"},{min:{functions:2,reactivity:1,namedBehavior:4},reason:"shared reactive functions"}]).pass}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var E=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{j as a};
2
+ //# sourceMappingURL=chunk-URSSPS5H.js.map
@@ -0,0 +1,2 @@
1
+ import{a as F,b as A}from"./chunk-T6NGEV5I.js";import{a as C}from"./chunk-UAHZ57BR.js";import{a as k}from"./chunk-ECVXWZ4Q.js";import{d as S}from"./chunk-HXXMPYEF.js";import{a as y}from"./chunk-GNG622H3.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as h}from"path";var _=20,G=1,O=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),q=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Ce(e,n={}){let t=L(n.limit,_),i=L(n.minConsumers,G),r=new C(e),s=r.fileDependencyGraph(n.scope),o=ge(p(e,{includeIgnored:!1})),a=pe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?K(e,r,n.target):J(e,n.scope,n.scanLimit)).map(c=>Q(e,r,s,c,n,o,a)).filter(c=>c.consumerFiles.length>=i||n.target).sort(me).slice(0,t)}function K(e,n,t){let i=Z(e,t);if(i)return[I(i)];let r=k(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ee(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:S(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function J(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),r=L(t,i.length);return i.slice(0,r).map(s=>I(s))}function Q(e,n,t,i,r,s,o){let a=i.definition?V(e,n,i.definition,r.semantic):X(t,i.unit.file),d=i.definition?a.length>0?"exact":"none":a.length>0?"file-level":"none",f=i.unit.file,c=l(h.dirname(f)),u=te(a),B=ne(c),W=w([...T(c),...u?T(u):[]]),b=ie(i.unit,c,u,a),g=re(b,i.unit,c,u,a,s,o),j=le(i.unit,d,u,a,c,g.whyNoSuggestedHome),z=ue(i.unit,c,u,a,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:f,currentDirectory:c,directoryAncestry:B,consumerFiles:a,consumerCoverage:d,nearestCommonOwner:u,boundaryMarkers:W,recommendedTier:b,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:j,reasons:z,recommendation:de(b,g.suggestedHome,d)}}function V(e,n,t,i){let r=A(F(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}));return E(r.get(t.symbolId)??[])}function X(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return E(t)}function Z(e,n){let t=y(n),i=p(e,{includeIgnored:!1}),r=i.find(o=>o===t);if(r)return r;let s=i.find(o=>o.endsWith(`/${t}`));return s||(i.find(o=>o.includes(t))??null)}function ee(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:S(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function I(e){return{unit:{kind:"file",file:e,shortName:h.basename(e)}}}function ne(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:D(r)})}return n}function T(e){return e==="."?[]:$(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function D(e){return w($(e).map(({marker:n})=>n))}function $(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=O.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function te(e){if(e.length===0)return null;let n=e.map(i=>l(h.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),s=[],o=Math.min(t.length,r.length);for(let a=0;a<o&&t[a]===r[a];a+=1)s.push(t[a]);t=s}return t.length===0?".":t.join("/")}function ie(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":U(t,"package")?"package-level-shared":U(t,"app")?"app-level-shared":N(t,["feature","domain","module"])||N(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function re(e,n,t,i,r,s,o){let a=oe(e,i);if(a)return m(a);let d=fe(n.file),f=se(e,t,d,r,o);if(f)return f;let c=i;if(l(t)===l(c))return m(`${t} is already the nearest common owner for its consumers.`);let u=ae(c,t,d,o);return u||ce(c,t,d,s,o)}function oe(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function se(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?v(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=l(h.dirname(i[0])),o=H(n,t,s,r);return o?m(o):v(s)}return null}function ae(e,n,t,i){return be(e)?P(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function ce(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=P(s,n,t,r,`Proposed home ${s} is outside source root ${t}.`);return o.confidence==="withheld"||i.has(s)?o:m(`${s} does not exist in the indexed project.`)}function P(e,n,t,i,r){if(!M(e,t))return m(r);let s=H(n,t,e,i);return s?m(s):v(e)}function v(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function le(e,n,t,i,r,s){let o=["Report-only signal; review ownership before moving files."];return n==="none"&&o.push("No consumers were found in the current index."),n==="file-level"&&o.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&o.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&o.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&o.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&o.push("Candidate already lives under the nearest common owner."),s&&o.push(`No exact suggested home: ${s}`),o}function ue(e,n,t,i,r,s){let o=[];return o.push(`${e.shortName} currently lives in ${n}.`),t?o.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):o.push("No consumer owner could be inferred from the current index."),r?o.push(`Suggested home is ${r}.`):s&&o.push(`No exact suggested home: ${s}`),o}function de(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function me(e,n){return R(n)-R(e)||e.candidatePath.localeCompare(n.candidatePath)}function R(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-exact-consumers"&&(n*=.05),n}function ge(e){let n=new Set(["."]);for(let t of e){let i=l(h.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=l(h.dirname(i))}return n}function fe(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function M(e,n){let t=l(e),i=l(n);return i==="."||t===i||t.startsWith(`${i}/`)}function he(e,n,t){let i=x(e),r=x(n);return(M(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function H(e,n,t,i){return l(e)===l(t)||!he(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function pe(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=ye(i);r&&n.add(r)}return n}function ye(e){let n=e.trim().toLowerCase();return n===""?null:n}function U(e,n){return D(e).includes(n)}function N(e,n){let t=D(e);return n.some(i=>t.includes(i))}function be(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?q.has(t):!1}function l(e){let n=y(e);return n===""?".":n}function x(e){let n=y(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function E(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{Ce as a};
2
+ //# sourceMappingURL=chunk-V3Z3IOWO.js.map
@@ -1,4 +1,4 @@
1
- import{a as b,b as y,c as m}from"./chunk-DVFP6PZI.js";import{g as p}from"./chunk-63CI3IXR.js";import{b as f,d as g,f as d}from"./chunk-NABVR6B7.js";import{a as c}from"./chunk-64MNV6AB.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
1
+ import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{g as p}from"./chunk-MBKJ7GHT.js";import{b as f,d as g,f as d}from"./chunk-HXXMPYEF.js";import{a as c}from"./chunk-64MNV6AB.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
2
2
  FROM defn_enclosing_ranges der
3
3
  JOIN global_symbols gs ON der.symbol_id = gs.id
4
4
  JOIN documents d ON der.document_id = d.id
@@ -20,4 +20,4 @@ import{a as b,b as y,c as m}from"./chunk-DVFP6PZI.js";import{g as p}from"./chunk
20
20
  ${n.symbolNoiseFor("gs")}
21
21
  AND d.relative_path IN (${i})
22
22
  ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...e))}return t}function N(n){let s=[];for(let t=0;t<n.length;t+=_)s.push(n.slice(t,t+_));return s}function R(n){return{symbol:n.symbol,kind:n.kind,documentation:n.documentation,enclosing_symbol:n.enclosingSymbol,relative_path:n.relativePath,start_line:n.startLine,end_line:n.endLine}}function k(n){return n.kind!==null&&n.kind!==0?D(n.kind,n.symbol,n.documentation):C(n.symbol,n.documentation,n.enclosing_symbol)}function D(n,s,t){let e=(t??"").toLowerCase();if(d(s)==="type"){if(e.includes("type "))return o.TypeAlias;if(e.includes("interface "))return o.Interface;if(e.includes("struct "))return o.Struct;if(e.includes("trait "))return o.Trait;if(e.includes("class "))return o.Class}return n}function C(n,s,t){let e=f(n);if("kind"in e)return null;let i=e.descriptors,l=i[i.length-2]??null,u=d(n),r=(s??"").toLowerCase();return u==="type"?r.includes("type ")?o.TypeAlias:r.includes("interface ")?o.Interface:r.includes("struct ")?o.Struct:r.includes("trait ")?o.Trait:r.includes("class ")?o.Class:o.Class:u==="method"?l?.suffix==="type"?o.Method:o.Function:u==="namespace"?o.Module:u!=="term"?null:r.includes("async def ")||r.includes("def ")?o.Function:(t?d(t):l?.suffix??null)==="type"?o.Field:o.Variable}export{v as a,T as b};
23
- //# sourceMappingURL=chunk-7C6JBBE4.js.map
23
+ //# sourceMappingURL=chunk-V7CVBPWX.js.map
@@ -1,2 +1,2 @@
1
- import{a as d,b as m}from"./chunk-MNCQPMCH.js";import{c as u}from"./chunk-ELC77ZDE.js";import{a as c}from"./chunk-F6IXELII.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>P(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(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 i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function P(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
2
- //# sourceMappingURL=chunk-PWAK75BU.js.map
1
+ import{a as d,b as m}from"./chunk-KJCDEDQW.js";import{c as u}from"./chunk-KMVGRIO2.js";import{a as c}from"./chunk-XEMQUN3Z.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>F(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(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 i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function F(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
2
+ //# sourceMappingURL=chunk-VYF5HA76.js.map
@@ -0,0 +1,6 @@
1
+ import{execFileSync as m}from"child_process";import{platform as d}from"os";var h=d()==="win32";function n(e){let r=h?"where":"which";try{return m(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as l}from"child_process";import{createRequire as y}from"module";import{existsSync as S}from"fs";import{platform as o,arch as p}from"os";var u="v0.8.1",c="https://github.com/sourcegraph/scip",g="SCIP_QUERY_SCIP_BIN";function w(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let r=e.env[g];if(r&&e.fileExists(r))return{source:"env",path:r};if(e.platform==="win32"){let i=e.resolveSidecar(e.arch);if(i&&e.fileExists(i))return{source:"sidecar",path:i}}return null}function v(e){let r=y(import.meta.url);for(let i of e==="arm64"?["arm64","x64"]:[e])try{return r.resolve(`scip-query-scip-windows/scip-win32-${i}.exe`)}catch{}return null}function f(e=process.env){return w({platform:o(),arch:p(),env:e,isOnPath:n,fileExists:S,resolveSidecar:v})?.path??null}function N(){return f()!==null}function q(){let e=f();if(!e)return null;try{return l(e,["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function x(){let e=o(),r=p(),i,s,t;switch(e){case"darwin":i="darwin",t="tar.gz";break;case"linux":i="linux",t="tar.gz";break;default:return null}switch(r){case"arm64":s="arm64";break;case"x64":s="amd64";break;default:return null}let a=`scip-${i}-${s}.${t}`;return{url:`${c}/releases/download/${u}/${a}`,filename:a}}function L(){let e=x();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("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(" npm install -g scip-query-scip-windows"),console.log(`Or set ${g} to a local scip.exe path.
3
+ `),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
4
+ `:` ${c}/releases/tag/${u}
5
+ `),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function O(e){if(o()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(l("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(l("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${c}/releases`),!1}export{n as a,f as b,N as c,q as d,L as e,O as f};
6
+ //# sourceMappingURL=chunk-WIBFXSYB.js.map
@@ -0,0 +1,65 @@
1
+ import{c as p}from"./chunk-7S5E7KWT.js";import{createHash as w}from"crypto";import{readFileSync as k}from"fs";import{dirname as m,join as y}from"path";import F from"better-sqlite3";var I="evidence.db";var g=new WeakMap,b=p("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),j=p("evidence-project-fingerprint",{clearGroups:["whole-project"]}),l="evidence-v1",E="version NOT LIKE 'evidence-%'";function T(e){return w("sha256").update(e).digest("hex")}function ce(e,n,t){return b.get(e,n,()=>T(t))}function de(e){return j.get(e,"current",()=>{try{let n=JSON.parse(k(y(m(e.config.dbPath),"meta.json"),"utf-8"));if(n.version!==2&&n.version!==3||n.status!=="complete"||n.fingerprint===void 0)return null;let t=Array.isArray(n.indexedLanguages)?[...n.indexedLanguages].sort():[];return T(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:t}))}catch(n){return f("project fingerprint unavailable",n),null}})}function f(e,n){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${e}: ${n instanceof Error?n.message:String(n)}`)}function c(e){if(g.has(e))return g.get(e)??null;let n=null;try{let t=new F(y(m(e.config.dbPath),I));t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 5000"),t.pragma("synchronous = NORMAL"),t.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS project_evidence (
11
+ kind TEXT NOT NULL,
12
+ cache_key TEXT NOT NULL,
13
+ project_fingerprint TEXT NOT NULL,
14
+ version TEXT NOT NULL,
15
+ payload TEXT NOT NULL,
16
+ PRIMARY KEY (kind, cache_key)
17
+ );
18
+ CREATE TABLE IF NOT EXISTS semantic_callees (
19
+ relative_path TEXT NOT NULL,
20
+ symbol TEXT NOT NULL,
21
+ content_hash TEXT NOT NULL,
22
+ deps_digest TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS semantic_references (
28
+ relative_path TEXT NOT NULL,
29
+ symbol TEXT NOT NULL,
30
+ project_fingerprint TEXT NOT NULL,
31
+ version TEXT NOT NULL,
32
+ payload TEXT NOT NULL,
33
+ PRIMARY KEY (relative_path, symbol)
34
+ );
35
+ CREATE TABLE IF NOT EXISTS finding_outcome_ledger (
36
+ check_name TEXT NOT NULL,
37
+ finding_id TEXT NOT NULL,
38
+ first_seen INTEGER NOT NULL,
39
+ last_seen INTEGER NOT NULL,
40
+ times_shown INTEGER NOT NULL,
41
+ outcome TEXT NOT NULL,
42
+ PRIMARY KEY (check_name, finding_id)
43
+ );
44
+ `),n={evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:t.prepare(`SELECT payload FROM file_evidence
45
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${E}
46
+ ORDER BY version DESC
47
+ LIMIT 1`),writeFileEvidence:t.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:t.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:t.prepare(`SELECT payload FROM project_evidence
48
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${E}
49
+ ORDER BY version DESC
50
+ LIMIT 1`),writeProjectEvidence:t.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:t.prepare(`SELECT payload FROM semantic_callees
51
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:t.prepare(`SELECT payload FROM semantic_callees
52
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${E}
53
+ ORDER BY version DESC
54
+ LIMIT 1`),writeCallees:t.prepare(`INSERT OR REPLACE INTO semantic_callees
55
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:t.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:t.prepare(`SELECT payload FROM semantic_references
56
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:t.prepare(`SELECT payload FROM semantic_references
57
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${E}
58
+ ORDER BY version DESC
59
+ LIMIT 1`),writeReferences:t.prepare(`INSERT OR REPLACE INTO semantic_references
60
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:t.prepare("DELETE FROM semantic_references WHERE project_fingerprint != ?"),readFindingOutcomeLedger:t.prepare("SELECT check_name, finding_id, first_seen, last_seen, times_shown, outcome FROM finding_outcome_ledger"),deleteFindingOutcomeLedgerForCheck:t.prepare("DELETE FROM finding_outcome_ledger WHERE check_name = ?"),writeFindingOutcomeLedgerRow:t.prepare(`INSERT INTO finding_outcome_ledger
61
+ (check_name, finding_id, first_seen, last_seen, times_shown, outcome) VALUES (?, ?, ?, ?, ?, ?)`)}}catch(t){f("disabled (open failed)",t)}return g.set(e,n),n}function d(e,n,t){f(`disabled (${n})`,t),g.set(e,null)}function _(e,n,t,i){let r=c(e);if(!r)return null;try{return(r.readFileEvidence.get(n,t,i,l)??r.readLegacyFileEvidence.get(n,t,i))?.payload??null}catch(a){return d(e,"file_evidence read",a),null}}function S(e,n,t,i,r){let a=c(e);if(a)try{a.writeFileEvidence.run(n,t,i,l,r)}catch(o){d(e,"file_evidence write",o)}}function N(e,n,t,i){let r=c(e);if(!r)return null;try{return(r.readProjectEvidence.get(n,t,i,l)??r.readLegacyProjectEvidence.get(n,t,i))?.payload??null}catch(a){return d(e,"project_evidence read",a),null}}function P(e,n,t,i,r){let a=c(e);if(a)try{a.writeProjectEvidence.run(n,t,i,l,r)}catch(o){d(e,"project_evidence write",o)}}function le(e,n,t,i,r){let a=c(e);if(!a)return null;try{return(a.readCallees.get(n,t,i,r,l)??a.readLegacyCallees.get(n,t,i,r))?.payload??null}catch(o){return d(e,"semantic_callees read",o),null}}function pe(e,n,t,i){let r=c(e);if(!r)return null;try{return(r.readReferences.get(n,t,i,l)??r.readLegacyReferences.get(n,t,i))?.payload??null}catch(a){return d(e,"semantic_references read",a),null}}function ue(e,n){if(n.length===0)return;let t=c(e);if(t)try{t.evidence.transaction(()=>{let i=new Set;for(let r of n){let a=`${r.relativePath}\0${r.contentHash}`;i.has(a)||(i.add(a),t.dropStaleCallees.run(r.relativePath,r.contentHash)),t.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,l,r.payload)}})()}catch(i){d(e,"semantic_callees write",i)}}function Ee(e,n){if(n.length===0)return;let t=c(e);if(t)try{t.evidence.transaction(()=>{let i=new Set;for(let r of n)i.has(r.projectFingerprint)||(i.add(r.projectFingerprint),t.dropStaleReferences.run(r.projectFingerprint)),t.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,l,r.payload)})()}catch(i){d(e,"semantic_references write",i)}}function ge(e){let n=c(e);if(!n)return[];try{return n.readFindingOutcomeLedger.all().map(i=>({check:i.check_name,findingId:i.finding_id,firstSeen:i.first_seen,lastSeen:i.last_seen,timesShown:i.times_shown,outcome:i.outcome}))}catch(t){return d(e,"finding_outcome_ledger read",t),[]}}function ve(e){return typeof e=="object"&&e!==null}function he(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:null}import{appendFileSync as A,mkdirSync as x}from"fs";import{dirname as M}from"path";import{performance as v}from"perf_hooks";var U="SCIP_QUERY_PROFILE",H="SCIP_QUERY_PROFILE_OUT",K="SCIP_QUERY_PROFILE_COMMAND",V="SCIP_QUERY_PROFILE_CACHE_STATE",L=new Set,O=!1;function C(){let e=process.env[U];return e==="1"||e==="true"}function X(){return process.env[H]}function W(){return process.env[K]}function Y(){return process.env[V]}function h(e,n,t){if(!C())return n();let i=v.now();try{let r=n();return R({type:"span",name:e,durationMs:Math.round(v.now()-i),ok:!0,...D(t)??{}}),r}catch(r){throw R({type:"span",name:e,durationMs:Math.round(v.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...D(t)??{}}),r}}function R(e,n=X()){let t={timestamp:new Date().toISOString(),pid:process.pid,command:W(),cacheState:Y(),...e},i=`${JSON.stringify(t)}
62
+ `;if(n)try{let r=M(n);L.has(r)||(x(r,{recursive:!0}),L.add(r)),A(n,i);return}catch(r){O||(O=!0,process.stderr.write(`[profile] failed to write ${n}: ${r instanceof Error?r.message:String(r)}
63
+ `));return}C()&&process.stderr.write(i)}function D(e){return typeof e=="function"?e():e}var $=[s("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),s("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),s("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),s("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),s("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),s("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),s("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),s("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),s("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),s("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),s("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),B("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"})];function Re(e){return{kind:e.kind,read(n,t,i){let r=!1,a=0;return h("evidence-product.file.read",()=>{let o=_(n,e.kind,t,i);if(o===null)return null;a=o.length;try{let u=e.deserialize(o);return r=u!==null,u}catch{return null}},()=>({scope:"file",kind:e.kind,available:!0,hit:r,payloadBytes:a}))},write(n,t,i,r){S(n,e.kind,t,i,e.serialize(r))}}}function De(e){return{kind:e.kind,read(n,t,i){let r=!1,a=0;return h("evidence-product.project.read",()=>{let o=N(n,e.kind,t,i);if(o===null)return null;a=o.length;try{let u=e.deserialize(o);return r=u!==null,u}catch{return null}},()=>({scope:"project",kind:e.kind,available:!0,hit:r,payloadBytes:a}))},write(n,t,i,r){P(n,e.kind,t,i,e.serialize(r))}}}function Ce(e){let n=$.find(t=>t.kind===e);if(!n)throw new Error(`missing evidence product manifest entry for ${e}`);return n.invalidation}function s(e,n){return{scope:"file",kind:e,invalidation:{scope:"file",...n}}}function B(e,n){return{scope:"project",kind:e,invalidation:{scope:"project",...n}}}import{readFileSync as G}from"fs";import{join as z}from"path";var J=p("source-text",{clearGroups:["whole-project","source-file"]}),Q=p("source-lines",{clearGroups:["whole-project","source-file"]});function q(e,n){let t=n.replace(/\\/g,"/");return J.get(e,t,()=>{let i=z(e.config.projectRoot,t);try{return G(i,"utf-8")}catch(r){if(Z(r))return"";throw r}})}function Z(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function ee(e,n){let t=n.replace(/\\/g,"/");return Q.get(e,t,()=>{let i=q(e,t);return i?i.split(`
64
+ `):[]})}var te=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar))?\b/i;function ne(e){let n=te.exec(e);return n?n[1]??"":null}function be(e,n,t){if(t<=0)return!1;let i=ee(e,n);if(i.length===0)return!1;for(let r=t-1;r>=0&&r>=t-5;r-=1){let a=(i[r]??"").trim();if(a!==""){if(ne(a)!==null)return!0;if(!a.startsWith("//")&&!a.startsWith("*")&&!a.startsWith("/*")&&!a.startsWith("@")&&!a.startsWith("#"))return!1}}return!1}export{T as a,ce as b,de as c,le as d,pe as e,ue as f,Ee as g,ge as h,ve as i,he as j,C as k,h as l,Re as m,De as n,Ce as o,q as p,ee as q,ne as r,be as s};
65
+ //# sourceMappingURL=chunk-WS3Z6W3M.js.map
@@ -0,0 +1,2 @@
1
+ function i(t){let n=new Map;for(let a of t){let e=n.get(a.file);e||(e=[],n.set(a.file,e)),e.push(a)}return n}export{i as a};
2
+ //# sourceMappingURL=chunk-WXVGNFAO.js.map
@@ -0,0 +1,20 @@
1
+ import{m as P}from"./chunk-T2FQ4GHD.js";import{a as E,c as F,l,n as I,o as _}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as h}from"./chunk-7S5E7KWT.js";var D=I({kind:"file-dependency-graph",invalidation:_("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:w}),C=h("file-dep-graph",{clearGroups:["whole-project"]});function T(e,r){return C.get(e,r??"",()=>{let i=new Set(S(e,{includeIgnored:!1})),n=F(e),s=A(r),o=0,a=0,u=null,m=!1,c=0,f=0;return l("file-dep-graph.product",()=>{if(n){let t=D.read(e,s,n);if(t){m=!0;let p=b(t);return o=t.sourceFileCount,a=t.sourceEdgeCount,c=t.scipEdgeCount,f=p.size,u=t.sourceImportFingerprint,p}}let d=l("file-dep-graph.source-imports",()=>{let t=N(e,i,r);return o=t.files.length,a=t.edges.length,u=t.fingerprint,t},()=>({scope:r??null,files:o,edges:a})),g=new Map,y=(t,p)=>J(e,g,i,t,p);l("file-dep-graph.scip-edges",()=>{for(let t of k(e,r))c+=1,y(t.from_file,t.to_file)},()=>({scope:r??null,edges:c}));for(let t of d.edges)y(t.fromFile,t.toFile);return f=g.size,n&&D.write(e,s,n,{sourceImportFingerprint:d.fingerprint,sourceFileCount:d.files.length,sourceEdgeCount:d.edges.length,scipEdgeCount:c,graph:G(g)}),g},()=>({scope:r??null,available:n!==null,hit:m,files:o,sourceEdges:a,scipEdges:c,graphFiles:f,sourceImportFingerprint:u}))})}function N(e,r,i){let n=[],s=[];for(let o of r)if(!(i&&!o.includes(i))){n.push(o);for(let a of P(e,o))a.sourcePath&&s.push({fromFile:o,toFile:a.sourcePath})}return{files:n,edges:s,fingerprint:O(n,s)}}function O(e,r){let i=r.map(n=>`${n.fromFile}\0${n.toFile}`).sort();return E(JSON.stringify({files:e,edges:i}))}function A(e){return e??"<all>"}function G(e){return[...e].map(([r,i])=>[r,[...i]])}function b(e){return new Map(e.graph.map(([r,i])=>[r,new Set(i)]))}function w(e){let r=JSON.parse(e);return v(r)?r:null}function v(e){if(!e||typeof e!="object")return!1;let r=e;return typeof r.sourceImportFingerprint=="string"&&typeof r.sourceFileCount=="number"&&typeof r.sourceEdgeCount=="number"&&typeof r.scipEdgeCount=="number"&&Array.isArray(r.graph)&&r.graph.every(R)}function R(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(r=>typeof r=="string")}function k(e,r){let i=r?"AND d1.relative_path LIKE ?":"",n=r?[`%${r}%`]:[];return e.all(`SELECT DISTINCT
2
+ d1.relative_path AS from_file,
3
+ d2.relative_path AS to_file
4
+ FROM mentions m
5
+ JOIN chunks c ON m.chunk_id = c.id
6
+ JOIN documents d1 ON c.document_id = d1.id
7
+ JOIN global_symbols gs ON m.symbol_id = gs.id
8
+ JOIN (
9
+ SELECT m2.symbol_id, c2.document_id
10
+ FROM mentions m2
11
+ JOIN chunks c2 ON m2.chunk_id = c2.id
12
+ WHERE m2.role = 1
13
+ GROUP BY m2.symbol_id
14
+ ) sym_def ON sym_def.symbol_id = gs.id
15
+ JOIN documents d2 ON sym_def.document_id = d2.id
16
+ WHERE d1.id != d2.id
17
+ AND m.role != 1
18
+ ${e.pathExclusionsFor("d1","d2")}
19
+ ${i}`,...n)}function J(e,r,i,n,s){if(n===s||e.isIgnored(n)||e.isIgnored(s)||!i.has(s))return;let o=r.get(n);o||(o=new Set,r.set(n,o)),o.add(s)}export{T as a};
20
+ //# sourceMappingURL=chunk-XEMQUN3Z.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-64MNV6AB.js";function l(e){return/[*?]/.test(e)?e.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_"):`%${e}%`}function g(e,r){let i=l(r);return t(e,{like:i,includeIgnored:!1}).filter(n=>o(r,n)).map(n=>({relativePath:n}))}function o(e,r){if(!/[*?]/.test(e))return r.includes(e);let i=e.includes("/")?e:`**/${e}`;return s(i.split("/"),r.split("/"))}function s(e,r){if(e.length===0)return r.length===0;let[i,...n]=e;return i==="**"?s(n,r)||r.length>0&&s(e,r.slice(1)):r.length===0||!c(i??"",r[0]??"")?!1:s(n,r.slice(1))}function c(e,r){let i="^";for(let n of e)n==="*"?i+="[^/]*":n==="?"?i+="[^/]":i+=f(n);return i+="$",new RegExp(i).test(r)}function f(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,o as b};
2
+ //# sourceMappingURL=chunk-YCPASUCX.js.map
@@ -0,0 +1,3 @@
1
+ import{f as k}from"./chunk-MBKJ7GHT.js";import{e as C,f as se}from"./chunk-HXXMPYEF.js";import{a as oe}from"./chunk-T2FQ4GHD.js";import{a as ie,b as re,o as W}from"./chunk-ISLWJ4PY.js";import{c as ee,e as te,g as ne,k as v,l as S}from"./chunk-WS3Z6W3M.js";import{a as U}from"./chunk-64MNV6AB.js";import{a as Q,c as Z}from"./chunk-7S5E7KWT.js";import{performance as m}from"perf_hooks";function b(i,e,t){if(i.has(e))return i.get(e);let n=t();return i.set(e,n),n}import ae from"path";function Ae(i,e){return i.getReferences().map(t=>{let n=t.getNode();return O(n,e)})}function Ue(i){let e=i;return typeof e.findReferences=="function"?e.findReferences():[]}function ce(i,e,t,n){let r=[];for(let o of Ue(i))for(let a of Ae(o,n))a.file===e.relativePath&&a.line>=e.startLine&&a.line<=e.endLine||r.push(a);for(let o of t)r.push(o);return R(r)}function le(i,e,t,n){let r=[],o=t?.getStart();for(let a of i.getReferences()){let s=a.getNode();P(n,s.getSourceFile().getFilePath())===e&&(o!==void 0&&s.getStart()===o||r.push({location:O(s,n),node:s}))}return r}function O(i,e){let t=i.getSourceFile(),n=t.getLineAndColumnAtPos(i.getStart());return{file:P(e,t.getFilePath())??t.getBaseName(),line:n.line-1,column:n.column-1}}function fe(i,e,t){let n=i.getSourceFile(),r=_(n,i),o=i.getText(),a=new RegExp(`\\b${oe(o)}\\b`,"g"),s=n.getFullText().split(`
2
+ `),c=[];for(let l=0;l<s.length;l++){if(l===r)continue;let d=s[l]??"";a.lastIndex=0;let p;for(;(p=a.exec(d))!==null;)c.push({file:e,line:l,column:p.index})}return R(c.filter(l=>P(t,ae.join(t,l.file))===e))}function H(i){for(let e=i;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function _(i,e){return i.getLineAndColumnAtPos(e.getStart()).line-1}function R(i){let e=new Set,t=[];for(let n of i){let r=`${n.file}:${n.line}:${n.column}`;e.has(r)||(e.add(r),t.push(n))}return t}function P(i,e){let t=ae.relative(i||process.cwd(),e).replace(/\\/g,"/");return!t||t.startsWith("..")?null:t}function pe(i,e,t,n){let r=Oe(e,n);return r.size===0?new Map:Be(i,t,r)}function Oe(i,e){let t=new Map;for(let n of k(i,e)){let r=C(n.symbol)??n.leaf;if(!r)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.push(n)}return t}function Be(i,e,t){let n=new Map,r=new Map;return e.forEachDescendant(o=>{for(let a of We(i,o)){let s=t.get(a);if(!s)continue;let c=_(e,o);for(let l of s){if(c<l.startLine-1||c>l.endLine+1)continue;let d=Math.abs(c-l.startLine),p=r.get(l.symbolId);p!==void 0&&p<=d||(r.set(l.symbolId,d),n.set(l.symbolId,o))}}}),n}function We(i,e){let t=[],n=r=>{r&&!t.includes(r)&&t.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();n(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();n(r)}return i.Node.isIdentifier(e)&&n(e.getText()),t}var He=Z("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ue(i,e,t,n){let r=ge(i,e),o=de(r.get(n)??[],t);if(o)return o;let a=[];for(let s of r.values())for(let c of s)((c.leaf||C(c.symbol)||"").includes(n)||c.symbol.includes(n))&&a.push(c);return de(a,t)}function me(i,e){let t=new Map;for(let[n,r]of ge(i,e)){let o=r[0];o&&t.set(n,o)}return t}function ge(i,e){return He.get(i,e,()=>{let t=new Map;for(let n of k(i,e)){let r=n.leaf||C(n.symbol);if(!r)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.push({...n,leaf:r})}for(let n of t.values())n.sort((r,o)=>r.startLine-o.startLine||r.endLine-o.endLine||r.symbolId-o.symbolId);return t})}function de(i,e){let t=null,n=Number.POSITIVE_INFINITY;for(let r of i){let o=Math.abs(r.startLine-e);(o<n||o===n&&t&&r.startLine<t.startLine)&&(t=r,n=o)}return t}import z from"path";var N=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function D(i){let e=i.toLowerCase();return N.some(t=>e.endsWith(t))}function ye(i,e){let t=new Map,n=null,r=null,o=()=>(r??=U(i,{extensions:N}),r),a=()=>(n??=S("typescript.source-file-index",()=>_e(i.config.projectRoot,e,o()),()=>({projects:e.length,indexedDocuments:o().length})),n),s=c=>D(c)?b(t,c,()=>{let l=T(z.resolve(i.config.projectRoot,c));for(let{project:d,sourceFiles:p}of a()){let f=p.get(l)??null;if(f||(f=d.addSourceFileAtPathIfExists(l)??null,f&&p.set(T(f.getFilePath()),f)),f)return{project:d,sourceFile:f}}return null}):null;return{sourceFile:c=>s(c)?.sourceFile??null,sourceFileMatch:s,indexedTypeScriptLikeDocuments:o}}function _e(i,e,t){let n=e.map(({project:r})=>({project:r,sourceFiles:new Map(r.getSourceFiles().map(o=>[T(o.getFilePath()),o]))}));for(let r of t){let o=T(z.resolve(i,r));for(let a of n){if(a.sourceFiles.has(o))break;let s=a.project.addSourceFileAtPathIfExists(o)??null;if(s){a.sourceFiles.set(T(s.getFilePath()),s);break}}}return n}function T(i){return z.resolve(i)}function Se(i,e){for(let t of i)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function he(i){let e=`${i.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}import{existsSync as w,readFileSync as ze}from"fs";import h from"path";var $=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function V(i,e){let n=e?h.dirname(h.join(i,e)):i,r=h.resolve(i);for(;n.startsWith(r);){for(let a of $){let s=h.join(n,a);if(w(s))return s}let o=h.dirname(n);if(o===n)break;n=o}for(let o of $){let a=h.join(i,o);if(w(a))return a}return null}function be(i){let e=i.config.projectRoot,t=new Set($e(e,i.config.semantic?.typescript?.tsconfigs)),n=U(i,{includeIgnored:!1,extensions:N});for(let r of n){let o=V(e,r);o&&t.add(h.resolve(o))}if(t.size===0){let r=V(e);r&&t.add(h.resolve(r))}return[...t].filter(r=>!Me(e,r)).sort((r,o)=>r.localeCompare(o))}function $e(i,e=[]){let t=new Set;for(let n of e){let r=h.isAbsolute(n)?n:h.join(i,n);w(r)&&t.add(h.resolve(r))}for(let n of Ve(i))for(let r of $){let o=h.join(n,r);w(o)&&t.add(h.resolve(o))}if(t.size===0){let n=V(i);n&&t.add(h.resolve(n))}return[...t].filter(n=>!Me(i,n)).sort((n,r)=>n.localeCompare(r))}function Ve(i){let e=h.join(i,"package.json");if(!w(e))return[];let t;try{t=JSON.parse(ze(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(r=>re(i,r))}function Me(i,e){let t=h.relative(i,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}import{createRequire as qe}from"module";var Ke=qe(import.meta.url),L;function Ie(){if(L!==void 0)return L;try{L=Ke("ts-morph")}catch{L=null}return L}function xe(i,e){return e.map(t=>({tsconfigPath:t,project:new i.Project({tsConfigFilePath:t,skipFileDependencyResolution:!0})}))}function B(i,e,t){return{language:"typescript",availability:()=>({available:!1,reason:i,tsconfigPath:e,tsconfigPaths:t}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var Ge=32;function Re(i,e){let t=S("typescript.provider.load",()=>Ie());if(!t)return B("ts-morph is not installed");let n=S("typescript.provider.tsconfig-discovery",()=>be(i));if(n.length===0)return B("no tsconfig found");try{let r=S("typescript.provider.project-bundles",()=>xe(t,n),()=>({tsconfigs:n.length}));return S("typescript.provider.construct",()=>new q(i,t,r),()=>({tsconfigs:n.length}))}catch(r){return B(r instanceof Error?r.message:String(r),n[0],n)}}var q=class{constructor(e,t,n){this.db=e;this.tsMorph=t;this.projects=n;this.workspacePackages=ie(e.config.projectRoot),this.sourceFiles=ye(e,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(e=>e.tsconfigPath)}}importUsage(e){return b(this.importUsageCache,e,()=>{let t=this.sourceFiles.sourceFile(e);if(!t)return[];let n=Ye();return S("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,t,n),()=>({file:e,...n}))})}referencesFor(e){return b(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,t)})}referencesForDefinitions(e){let t=new Map,n=v(),r=[];for(let c of e){let l=this.referencesCache.get(c.symbolId);l?t.set(c.symbolId,l):r.push(c)}if(r.length===0)return t;let o=r,a=r.filter(c=>!De(c));if(a.length>=Ge){let c=this.referencesForDefinitionsBySymbolScan(a);for(let l of a){let d=c.get(l.symbolId)??[];this.referencesCache.set(l.symbolId,d),t.set(l.symbolId,d)}if(o=r.filter(l=>De(l)),o.length===0)return t}let s=new Map;for(let c of o){let l=s.get(c.relativePath);l?l.push(c):s.set(c.relativePath,[c])}for(let[c,l]of s){let d=Fe();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),t.set(f.symbolId,g)}},()=>({relativePath:c,definitions:l.length,...ke(d)}))}return t}referencesForDefinitionsBySymbolScan(e){let t=v(),n=Fe(),r=new Map,o=new Set(e.map(s=>s.symbolId)),a=new Map(e.map(s=>[s.symbolId,s]));for(let s of e)r.set(s.symbolId,[]);return S("typescript.references-map.inverted-scan",()=>{let s=t?m.now():0;for(let p of e){let f=this.packageImportReferencesForDefinition(p);if(f.length>0){let u=r.get(p.symbolId)??[];u.push(...f),r.set(p.symbolId,u)}t&&(n.packageReferenceCount+=f.length)}t&&(n.packageRefsMs+=m.now()-s);let c=new Map,l=new Set(e.map(p=>p.leaf).filter(Boolean)),d=t?m.now():0;for(let p of this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(p))continue;let f=this.sourceFiles.sourceFile(p);f&&(t&&(n.scanFiles+=1),this.addReferencesFromSourceFileScan(f,p,o,a,l,c,r,t?n:void 0))}t&&(n.scanMs+=m.now()-d);for(let[p,f]of r){let u=R(f);r.set(p,u),t&&(n.referenceCount+=u.length)}},()=>({definitions:e.length,...ke(n)})),r}addReferencesFromSourceFileScan(e,t,n,r,o,a,s,c){let l=this.compilerCheckerForSourceFile(e),d=e.compilerNode,p=Ze(e),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(a.has(g)?y=a.get(g)??null:(y=this.definitionFromCompilerSymbol(g),a.set(g,y)),c&&(y?c.targetHits+=1:c.targetMisses+=1),y&&n.has(y.symbolId)){c&&(c.requestedHits+=1);let F=r.get(y.symbolId);if(F&&!tt(F,t,ve(d,u))){let I=s.get(y.symbolId)??[],A=d.getLineAndCharacterOfPosition(u.getStart(d));I.push({file:t,line:A.line,column:A.character}),s.set(y.symbolId,I)}}}}this.tsMorph.ts.forEachChild(u,f)};f(d)}compilerReferenceSymbol(e,t,n){n&&(n.symbolLookups+=1);let r=e.getSymbolAtLocation(t);if(r){if((r.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return r;try{return n&&(n.aliasResolutions+=1),e.getAliasedSymbol(r)}catch{return r}}}calleesFor(e){return b(this.calleesCache,e.symbolId,()=>b(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let t=new Map,n=new Map;for(let r of e){let o=n.get(r.relativePath);o?o.push(r):n.set(r.relativePath,[r])}for(let[r,o]of n){let a=this.fileCalleesCache.get(r),s=new Set(o.map(l=>l.symbolId)),c=a??this.calleeMapForFile(r,s);for(let l of o){let d=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,d),t.set(l.symbolId,d)}}return t}referencesForDefinitionNode(e,t,n){let r=n?m.now():0,o=this.packageImportReferencesForDefinition(e);if(n&&(n.packageRefsMs+=m.now()-r,n.packageReferenceCount+=o.length),!t)return o;let a=n?m.now():0,s=ce(t,e,o,this.db.config.projectRoot);return n&&(n.semanticRefsMs+=m.now()-a,n.referenceCount+=s.length),s}signatureFor(e){return b(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let n=t.getType().getCallSignatures()[0];if(!n)return null;let r=n.getParameters().map(a=>{let s=a.getDeclarations()[0],c=s?a.getTypeAtLocation(s).getText(s):a.getValueDeclaration()?.getType().getText()??"unknown";return Ce(c)}),o=n.getReturnType().getText(t);return`(${r.join(",")})=>${Ce(o)}`})}importUsageForSourceFile(e,t,n){let r=[],o=new Map;for(let a of t.getImportDeclarations()){n.declarations+=1;let s=W(this.db,e,a.getModuleSpecifierValue()),c=a.getImportClause()?.isTypeOnly()??!1;for(let l of K(a)){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:s,entry:l,typeOnlyDeclaration:c,bindingSymbol:d,references:[]};if(r.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&&t.forEachDescendant(a=>{if(a.getKindName()!=="Identifier")return;let s=o.get(a.getText());if(!s||Xe(a))return;n.scannedIdentifiers+=1;let c=a.getSymbol()?.compilerSymbol;if(n.symbolLookups+=1,!!c){for(let l of s)if(l.bindingSymbol===c){l.references.push({location:O(a,this.db.config.projectRoot),node:a}),n.matchedReferences+=1;break}}}),r.map(a=>a.typeOnlyDeclaration?Je(e,a.sourcePath,a.entry):a.entry.identifier&&!a.bindingSymbol?(n.fallbackEntries+=1,this.valueImportUsageForEntry(e,a.sourcePath,a.entry)):this.valueImportUsageFromLocations(e,a.sourcePath,a.entry,a.references))}valueImportUsageForEntry(e,t,n){let r=n.identifier?n.identifier.findReferences():[],o=[];for(let a of r)for(let s of le(a,e,n.identifier,this.db.config.projectRoot))o.push(s);return this.valueImportUsageFromLocations(e,t,n,o)}valueImportUsageFromLocations(e,t,n,r){let o=r.some(c=>!H(c.node)),a=r.some(c=>H(c.node)),s=n.isTypeOnly;return{importer:e,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:s,isUsed:s||r.length>0,isTypeUsed:s||a,isValueUsed:o,references:r.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,n);for(let[n,r]of e)e.set(n,R(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,t,n){if(this.db.isIgnored(n))return;let r=this.sourceFiles.sourceFileMatch(n);if(r)for(let o of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,n,o)}addPackageImportReferencesForDeclaration(e,t,n,r){let o=Se(this.workspacePackages,r.getModuleSpecifierValue());if(!o)return;let a=t.get(o);if(a)for(let s of K(r)){if(s.kind!=="named"||!s.identifier)continue;let c=a.get(s.importedName);if(!c||c.size===0)continue;let l=fe(s.identifier,n,this.db.config.projectRoot);l.length>0&&rt(e,c,l)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let t of this.workspacePackages){let n=new Map;for(let r of he(t))this.collectPackageExports(t,r,n,new Set);n.size>0&&e.set(t.name,n)}return this.packageExportIndex=e,e}collectPackageExports(e,t,n,r){if(r.has(t))return;r.add(t);let o=this.sourceFiles.sourceFile(t);if(o)for(let a of o.getExportDeclarations()){let s=a.getModuleSpecifierValue(),c=s?W(this.db,t,s):t;if(!c||!c.startsWith(`${e.relativeDir}/src/`))continue;let l=a.getNamedExports();if(l.length===0){if(a.isNamespaceExport())continue;this.collectPackageExports(e,c,n,r);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(e,t){return b(this.indexedDefinitionLeafCache,e,()=>me(this.db,e)).get(t)??null}nodeForDefinition(e){return b(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return b(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFiles.sourceFile(e);return t?pe(this.tsMorph,this.db,t,e):new Map})}definitionFromCompilerSymbol(e,t){let n=e.name,r=t?m.now():0,o=e.declarations??[];t&&(t.declarationsMs+=m.now()-r,t.declarationChecks+=o.length);for(let a of o){let s=t?m.now():0,c=a.getSourceFile(),l=P(this.db.config.projectRoot,c.fileName),d=c.getLineAndCharacterOfPosition(a.getStart(c)).line;if(t&&(t.declarationLocationMs+=m.now()-s),!l||this.db.isIgnored(l))continue;let p=t?m.now():0,f=ue(this.db,l,d,n);if(t&&(t.indexedLookupMs+=m.now()-p),f)return{symbolId:f.symbolId,symbol:f.symbol,file:f.relativePath,line:f.startLine}}return null}calleeMapForFile(e,t){let n=v(),r=0,o=0,a=0,s=0,c=0,l=0,d=0,p=0,f=n?nt():void 0;return S("typescript.callee-map.file",()=>{let u=n?m.now():0,g=this.sourceFiles.sourceFile(e);if(n&&(c=Math.round(m.now()-u)),!g)return new Map;let y=n?m.now():0,F=k(this.db,e).sort((M,x)=>M.startLine-x.startLine||x.endLine-M.endLine);if(n&&(l=Math.round(m.now()-y)),r=F.length,F.length===0)return new Map;let I=new Map,A=n?m.now():0,Le=this.compilerCheckerForSourceFile(g),Y=g.compilerNode;n&&(d=Math.round(m.now()-A));let Ee=new Map,X=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){n&&(o+=1);let x=this.semanticCalleeForCallNode(Le,Y,F,M,Ee,t,f);x&&(n&&(a+=1),Qe(I,x.callerId,x.target))}this.tsMorph.ts.forEachChild(M,X)},je=n?m.now():0;X(Y),n&&(p=Math.round(m.now()-je));for(let[M,x]of I)I.set(M,ot(x));return s=I.size,I},()=>({relativePath:e,definitions:r,callNodes:o,resolvedCallees:a,outputRows:s,requestedDefinitions:t?.size??r,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:d,traversalMs:p,...f?it(f):{}}))}semanticCalleeForCallNode(e,t,n,r,o,a,s){let c=s?m.now():0,l=et(n,ve(t,r));if(s&&(s.callerLookupMs+=m.now()-c),!l)return null;if(a&&!a.has(l.symbolId))return s&&(s.skippedUnrequestedCallers+=1),null;let d=r.expression,p=this.compilerSymbolForExpression(e,d,s),f=null;if(p)if(s&&(s.targetSymbolHits+=1),o.has(p))s&&(s.compilerSymbolCacheHits+=1),f=o.get(p)??null;else{s&&(s.compilerSymbolCacheMisses+=1);let u=s?m.now():0;f=this.definitionFromCompilerSymbol(p,s),s&&(s.targetLookupMs+=m.now()-u),o.set(p,f)}else s&&(s.targetMisses+=1);return f?{callerId:l.symbolId,target:{symbol:f.symbol,file:f.file,line:f.line}}:null}compilerSymbolForExpression(e,t,n){let r=n?m.now():0,o=e.getSymbolAtLocation(t);if(n&&(n.expressionSymbolMs+=m.now()-r),o)return o;n&&(n.typeFallbacks+=1);let a=n?m.now():0,s=e.getTypeAtLocation(t).getSymbol();return n&&(n.typeSymbolMs+=m.now()-a),s}compilerCheckerForSourceFile(e){let t=e.getProject(),n=this.compilerCheckerCache.get(t);return n||(n=t.getTypeChecker().compilerObject,this.compilerCheckerCache.set(t,n)),n}};function K(i){let e=[],t=i.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let n=i.getNamespaceImport();n&&e.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let r of i.getNamedImports()){let o=r.getNameNode(),s=r.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:s,importedName:o.getText(),localName:s?.getText()??o.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(i.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Je(i,e,t){return{importer:i,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Ye(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Xe(i){for(let e=i;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function Qe(i,e,t){let n=i.get(e);n||(n=[],i.set(e,n)),n.push(t)}function Ze(i){let e=new Set;for(let t of i.getImportDeclarations())for(let n of K(t))n.localName&&e.add(n.localName);return e}function et(i,e){let t=null;for(let n of i)e<n.startLine||e>n.endLine||(!t||n.startLine>=t.startLine)&&(t=n);return t}function ve(i,e){return i.getLineAndCharacterOfPosition(e.getStart(i)).line}function tt(i,e,t){return e===i.relativePath&&t>=i.startLine&&t<=i.endLine}function De(i){return i.symbol.includes("#")?se(i.symbol)==="type"&&i.relativePath.endsWith(".d.ts"):!1}function nt(){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 it(i){return{...i,callerLookupMs:Math.round(i.callerLookupMs),expressionSymbolMs:Math.round(i.expressionSymbolMs),typeSymbolMs:Math.round(i.typeSymbolMs),targetLookupMs:Math.round(i.targetLookupMs),declarationsMs:Math.round(i.declarationsMs),declarationLocationMs:Math.round(i.declarationLocationMs),indexedLookupMs:Math.round(i.indexedLookupMs)}}function Fe(){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 ke(i){return{...i,scanMs:Math.round(i.scanMs),packageRefsMs:Math.round(i.packageRefsMs),semanticRefsMs:Math.round(i.semanticRefsMs)}}function rt(i,e,t){for(let n of e){let r=i.get(n)??[];r.push(...t),i.set(n,r)}}function ot(i){let e=new Set,t=[];for(let n of i){let r=`${n.symbol}|${n.file}|${n.line}`;e.has(r)||(e.add(r),t.push(n))}return t}function Ce(i){return i.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var G=new WeakMap;Q({name:"semantic-provider",groups:["semantic-provider"],clearAll:i=>G.delete(i)});function J(i,e){let t=`${i.config.projectRoot}:typescript-workspace`,n=G.get(i);n||(n=new Map,G.set(i,n));let r=n.get(t);if(r)return r;let o=Re(i,e);return n.set(t,o),o}function E(i){return{capability:(e,t)=>we(i,e,t),importUsage:e=>st(i,e),references:e=>at(i,e),callerMap:e=>ct(i,e),calleeMap:e=>pt(i,e),signature:e=>dt(i,e)}}function fn(i,e){return E(i).importUsage(e)}function st(i,e){let t=j(i,e);return t?t.importUsage(e):[]}function pn(i,e){return E(i).references(e)}function at(i,e){let t=j(i,e.relativePath);return t?t.referencesFor(e):[]}function dn(i,e){return E(i).callerMap(e)}function ct(i,e){let t=v(),n=new Map,r=ee(i),o=[],a=[],s=[],c=0,l=0,d=0,p=0;if(S("semantic.references.cache-scan",()=>{for(let f of e){if(!r||!D(f.relativePath)){t&&!D(f.relativePath)&&(c+=1),s.push(f);continue}let u=te(i,f.relativePath,f.symbol,r);if(u!==null){let g=ft(u);if(g){t&&(l+=1),p+=Ne(i,n,f,g);continue}t&&(d+=1)}a.push(f)}},()=>({definitions:e.length,skippedNonTs:c,cacheHits:l,parseFailures:d,misses:a.length,unkeyed:s.length,resultRows:n.size,callerFiles:p})),a.length>0||s.length>0){let f=[...s,...a],u=0,g=S("semantic.references.compute-misses",()=>{let y=lt(i,f);return u=y.size,y},()=>({definitions:f.length,misses:a.length,unkeyed:s.length,rows:u}));for(let y of f)p+=Ne(i,n,y,g.get(y.symbolId)??[]);if(r)for(let y of a)o.push({relativePath:y.relativePath,symbol:y.symbol,projectFingerprint:r,payload:JSON.stringify(g.get(y.symbolId)??[])})}return o.length>0&&(we(i,"semantic-references").available?S("semantic.references.cache-write",()=>ne(i,o),()=>({entries:o.length})):S("semantic.references.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",entries:o.length}))),n}function lt(i,e){let t=v(),n=new Map,r=0,o=0,a=0,s=0;return S("semantic.references.provider-loop",()=>{let c=new Map,l=[];for(let d of e){let p=j(i,d.relativePath);if(!p){t&&(o+=1);continue}if(t&&(r+=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)??[];Pe(n,u.symbolId,g,t,y=>{a+=1,s+=y})}}for(let{provider:d,definition:p}of l){let f=d.referencesFor(p);Pe(n,p.symbolId,f,t,u=>{a+=1,s+=u})}return n},()=>({definitions:e.length,providerHits:r,providerMisses:o,definitionsWithReferences:a,referenceCount:s,rows:n.size}))}function Pe(i,e,t,n,r){i.set(e,t),n&&t.length>0&&r(t.length)}function Ne(i,e,t,n){let r=0;for(let o of n){if(o.file===t.relativePath||i.isIgnored(o.file))continue;let a=e.get(t.symbolId);a||(a=new Set,e.set(t.symbolId,a));let s=a.size;a.add(o.file),a.size!==s&&(r+=1)}return r}function ft(i){try{return JSON.parse(i)}catch{return null}}function un(i,e){return E(i).calleeMap(e)}function pt(i,e){let t=v(),n=new Map,r=0,o=0,a=0,s=0;return S("semantic.callees.provider-loop",()=>{let c=new Map,l=[];for(let d of e){let p=j(i,d.relativePath);if(!p){t&&(o+=1);continue}t&&(r+=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)??[];Te(n,u.symbolId,g,t,y=>{a+=1,s+=y})}}for(let{provider:d,definition:p}of l){let f=d.calleesFor(p);Te(n,p.symbolId,f,t,u=>{a+=1,s+=u})}return n},()=>({definitions:e.length,providerHits:r,providerMisses:o,definitionsWithCallees:a,calleeCount:s,rows:n.size}))}function Te(i,e,t,n,r){t.length>0&&(i.set(e,t),n&&r(t.length))}function mn(i,e){return E(i).signature(e)}function dt(i,e){let t=j(i,e.relativePath);return t?t.signatureFor(e):null}function we(i,e,t){if(t!==void 0&&!D(t))return{slot:e,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript files"};try{return{slot:e,language:"typescript",...J(i,t).availability()}}catch(n){return{slot:e,language:"typescript",available:!1,reason:n instanceof Error?n.message:String(n)}}}function j(i,e){if(!D(e))return null;let t=J(i,e);return t.availability().available?t:null}export{D as a,E as b,fn as c,pn as d,dn as e,un as f,mn as g};
3
+ //# sourceMappingURL=chunk-YDDGCJJG.js.map
@@ -1,2 +1,2 @@
1
- import{a as D}from"./chunk-7IWIMNHI.js";import{a as F}from"./chunk-JNMLBL36.js";import{a as f}from"./chunk-YFQIKYOP.js";import{a as g}from"./chunk-E3ADDB43.js";import{c as y}from"./chunk-Z2LDWIJV.js";import{a as h}from"./chunk-HRDSU5FN.js";import{d as p}from"./chunk-AREANYIA.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).fileAddRecords();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=P(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:K(...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 P(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function K(...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-2UVCH7CQ.js.map
1
+ import{a as F}from"./chunk-TG7QSYCJ.js";import{a as D}from"./chunk-URSSPS5H.js";import{a as f}from"./chunk-5AAAEZ2Z.js";import{a as g}from"./chunk-J5WVNZ6O.js";import{a as h}from"./chunk-FXG3PHVW.js";import{e as y}from"./chunk-BCNT6ODA.js";import{h as p}from"./chunk-GNG622H3.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).fileAddRecords();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=P(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:K(...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 P(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function K(...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-YPKBZ77R.js.map