scip-query 0.10.11 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
  3. package/README.md +168 -55
  4. package/dist/augment-vue-worker.js +1 -1
  5. package/dist/chunk-2VSDXOG5.js +2 -0
  6. package/dist/chunk-343O6EVV.js +2 -0
  7. package/dist/chunk-3KDUITBE.js +7 -0
  8. package/dist/chunk-3T2FNHIU.js +2 -0
  9. package/dist/chunk-3V6JQQM5.js +2 -0
  10. package/dist/chunk-5AAAEZ2Z.js +2 -0
  11. package/dist/chunk-6Q6OFLFQ.js +8 -0
  12. package/dist/chunk-6XA4LDHY.js +2 -0
  13. package/dist/chunk-75X52JTA.js +2 -0
  14. package/dist/{chunk-54KGX7EX.js → chunk-7HB3CZFD.js} +2 -2
  15. package/dist/chunk-7JZRFDCU.js +2 -0
  16. package/dist/chunk-7XL7J7PT.js +3 -0
  17. package/dist/chunk-ALHNAPS2.js +2 -0
  18. package/dist/{chunk-JATUZIEH.js → chunk-BDRBPG7Y.js} +2 -2
  19. package/dist/chunk-BN5SXXQS.js +40 -0
  20. package/dist/chunk-C4ICAIJ4.js +3 -0
  21. package/dist/{chunk-LSET2TXH.js → chunk-CMHYBXJB.js} +2 -2
  22. package/dist/{chunk-YWYFU2V3.js → chunk-DRPAQAFM.js} +6 -6
  23. package/dist/chunk-FERAXG6Y.js +72 -0
  24. package/dist/chunk-FLJJLSGB.js +2 -0
  25. package/dist/chunk-FXG3PHVW.js +9 -0
  26. package/dist/chunk-GCN2P4EJ.js +2 -0
  27. package/dist/chunk-GHXRVCIY.js +21 -0
  28. package/dist/chunk-GNG622H3.js +3 -0
  29. package/dist/chunk-H4LUPLEJ.js +2 -0
  30. package/dist/{chunk-BASVXNY3.js → chunk-H56MGERE.js} +4 -4
  31. package/dist/chunk-H7NSJ7L2.js +5 -0
  32. package/dist/chunk-HINMXZ6J.js +2 -0
  33. package/dist/chunk-HXXMPYEF.js +2 -0
  34. package/dist/{chunk-Z3YYR4OS.js → chunk-HZKMEXA3.js} +2 -2
  35. package/dist/chunk-IFSX6YVU.js +4 -0
  36. package/dist/chunk-ISLWJ4PY.js +10 -0
  37. package/dist/chunk-J5WVNZ6O.js +2 -0
  38. package/dist/chunk-K2HYR5A7.js +3 -0
  39. package/dist/chunk-K6UI6EBZ.js +2 -0
  40. package/dist/chunk-KJCDEDQW.js +2 -0
  41. package/dist/{chunk-Z4HICZGY.js → chunk-KKMOB3OJ.js} +2 -2
  42. package/dist/{chunk-YWOOQ4FF.js → chunk-KMVGRIO2.js} +2 -2
  43. package/dist/chunk-LWOOTRHC.js +2 -0
  44. package/dist/{chunk-EY43NV4M.js → chunk-LZNLRE4X.js} +17 -8
  45. package/dist/chunk-M2YXL62V.js +23 -0
  46. package/dist/chunk-MNEJYEHW.js +3 -0
  47. package/dist/chunk-MTDBHTSF.js +2 -0
  48. package/dist/{chunk-ZQDIXAF5.js → chunk-N2Z3CU7X.js} +2 -2
  49. package/dist/chunk-N7PNFLGY.js +2 -0
  50. package/dist/chunk-NAH5EAZS.js +6 -0
  51. package/dist/chunk-NBXK32I6.js +2 -0
  52. package/dist/chunk-NJJ7AS4F.js +2 -0
  53. package/dist/{chunk-FDEQIPPK.js → chunk-NLMRJ7SI.js} +2 -2
  54. package/dist/chunk-ODVITBYU.js +26 -0
  55. package/dist/chunk-ORBRX2QJ.js +2 -0
  56. package/dist/chunk-P36UR5II.js +2 -0
  57. package/dist/chunk-PYZZBIEU.js +3 -0
  58. package/dist/chunk-PZS6J5YG.js +16 -0
  59. package/dist/{chunk-LM5SHAN4.js → chunk-QARYU7R3.js} +2 -2
  60. package/dist/chunk-QJ3FK4TB.js +38 -0
  61. package/dist/chunk-QXGTGE2C.js +35 -0
  62. package/dist/chunk-QZ4JVECJ.js +2 -0
  63. package/dist/chunk-R3JY4EZ4.js +102 -0
  64. package/dist/{chunk-VOYOYC5T.js → chunk-R5336VHZ.js} +2 -2
  65. package/dist/chunk-RJMXSHKM.js +2 -0
  66. package/dist/chunk-STBXCPKY.js +5 -0
  67. package/dist/chunk-T2FQ4GHD.js +9 -0
  68. package/dist/chunk-TFWDJDGO.js +2 -0
  69. package/dist/chunk-TG7QSYCJ.js +2 -0
  70. package/dist/{chunk-FKCGBZAC.js → chunk-TTS75UF2.js} +5 -5
  71. package/dist/{chunk-BVRS7RKQ.js → chunk-U7I373V4.js} +2 -2
  72. package/dist/chunk-UIKLA3F5.js +2 -0
  73. package/dist/{chunk-P753MDDE.js → chunk-UMPNL7T6.js} +2 -2
  74. package/dist/chunk-URSSPS5H.js +2 -0
  75. package/dist/chunk-VGMUFW3J.js +2 -0
  76. package/dist/chunk-VXTNADIW.js +18 -0
  77. package/dist/chunk-VYF5HA76.js +2 -0
  78. package/dist/chunk-WFGOH2UI.js +43 -0
  79. package/dist/chunk-WGA5BBTA.js +4 -0
  80. package/dist/chunk-WIBFXSYB.js +6 -0
  81. package/dist/chunk-WPSS37EW.js +2 -0
  82. package/dist/chunk-WQHWIVA7.js +3 -0
  83. package/dist/chunk-WS3Z6W3M.js +65 -0
  84. package/dist/chunk-WXVGNFAO.js +2 -0
  85. package/dist/{chunk-6LJHXREW.js → chunk-WZLPXFZU.js} +2 -2
  86. package/dist/chunk-X4O6K47U.js +2 -0
  87. package/dist/chunk-X6OGDTQH.js +2 -0
  88. package/dist/chunk-XEMQUN3Z.js +20 -0
  89. package/dist/{chunk-7B6LP46R.js → chunk-XHWLNQVZ.js} +2 -2
  90. package/dist/chunk-XMR747CP.js +2 -0
  91. package/dist/chunk-Y6L4LXPG.js +2 -0
  92. package/dist/chunk-YCPASUCX.js +2 -0
  93. package/dist/chunk-YZXV3CU3.js +60 -0
  94. package/dist/chunk-ZEKBR4OK.js +10 -0
  95. package/dist/chunk-ZMGBWSFZ.js +2 -0
  96. package/dist/cli.js +462 -274
  97. package/dist/{config-types-BDIWAYzr.d.ts → config-types-BrHl3Bge.d.ts} +61 -1
  98. package/dist/{db-Djj3Nqrb.d.ts → db-_Bdx0E1W.d.ts} +1 -1
  99. package/dist/diff-gate-types-CG2YQ_ei.d.ts +4 -0
  100. package/dist/{frontend-behavior-evidence-BxKpKWUu.d.ts → frontend-behavior-evidence-EfM4_9bc.d.ts} +1 -1
  101. package/dist/{health-D5J42g4D.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
  102. package/dist/index.d.ts +10 -70
  103. package/dist/index.js +2 -2
  104. package/dist/postinstall.js +1 -4
  105. package/dist/queries/affected.d.ts +2 -2
  106. package/dist/queries/affected.js +1 -1
  107. package/dist/queries/bottlenecks.d.ts +2 -2
  108. package/dist/queries/bottlenecks.js +1 -1
  109. package/dist/queries/by-kind.d.ts +2 -2
  110. package/dist/queries/by-kind.js +1 -1
  111. package/dist/queries/call-graph.d.ts +2 -2
  112. package/dist/queries/call-graph.js +1 -1
  113. package/dist/queries/change-surface.d.ts +2 -2
  114. package/dist/queries/change-surface.js +1 -1
  115. package/dist/queries/cleanup-plan.d.ts +2 -2
  116. package/dist/queries/cleanup-plan.js +1 -1
  117. package/dist/queries/co-change.d.ts +12 -2
  118. package/dist/queries/co-change.js +1 -1
  119. package/dist/queries/code.d.ts +2 -2
  120. package/dist/queries/code.js +1 -1
  121. package/dist/queries/complexity-hotspots.d.ts +7 -3
  122. package/dist/queries/complexity-hotspots.js +1 -1
  123. package/dist/queries/complexity.d.ts +42 -4
  124. package/dist/queries/complexity.js +1 -1
  125. package/dist/queries/convergence.d.ts +2 -2
  126. package/dist/queries/convergence.js +1 -1
  127. package/dist/queries/coupling.d.ts +2 -2
  128. package/dist/queries/coupling.js +1 -1
  129. package/dist/queries/cycles.d.ts +12 -3
  130. package/dist/queries/cycles.js +1 -1
  131. package/dist/queries/dataflow.d.ts +2 -2
  132. package/dist/queries/dataflow.js +1 -1
  133. package/dist/queries/dead.d.ts +3 -3
  134. package/dist/queries/dead.js +1 -1
  135. package/dist/queries/deep-chains.d.ts +2 -2
  136. package/dist/queries/deep-chains.js +1 -1
  137. package/dist/queries/deps.d.ts +2 -2
  138. package/dist/queries/deps.js +1 -1
  139. package/dist/queries/diff-gate.d.ts +65 -8
  140. package/dist/queries/diff-gate.js +1 -1
  141. package/dist/queries/diff-impact.d.ts +21 -3
  142. package/dist/queries/diff-impact.js +1 -1
  143. package/dist/queries/doc-drift.d.ts +29 -2
  144. package/dist/queries/doc-drift.js +1 -1
  145. package/dist/queries/drift.d.ts +15 -3
  146. package/dist/queries/drift.js +1 -1
  147. package/dist/queries/duplicate-bodies.d.ts +55 -0
  148. package/dist/queries/duplicate-bodies.js +2 -0
  149. package/dist/queries/extract-candidates.d.ts +2 -2
  150. package/dist/queries/extract-candidates.js +1 -1
  151. package/dist/queries/fan.d.ts +2 -2
  152. package/dist/queries/fan.js +1 -1
  153. package/dist/queries/files.d.ts +4 -3
  154. package/dist/queries/files.js +1 -1
  155. package/dist/queries/health.d.ts +3 -3
  156. package/dist/queries/health.js +1 -1
  157. package/dist/queries/hierarchy.d.ts +2 -2
  158. package/dist/queries/hierarchy.js +1 -1
  159. package/dist/queries/hotspots.d.ts +2 -2
  160. package/dist/queries/hotspots.js +1 -1
  161. package/dist/queries/imports.d.ts +2 -2
  162. package/dist/queries/imports.js +1 -1
  163. package/dist/queries/incomplete-migration.d.ts +3 -2
  164. package/dist/queries/incomplete-migration.js +1 -1
  165. package/dist/queries/index.d.ts +12 -7
  166. package/dist/queries/index.js +1 -1
  167. package/dist/queries/isolated.d.ts +2 -2
  168. package/dist/queries/isolated.js +1 -1
  169. package/dist/queries/locality-candidates.d.ts +2 -2
  170. package/dist/queries/locality-candidates.js +1 -1
  171. package/dist/queries/members.d.ts +2 -2
  172. package/dist/queries/members.js +1 -1
  173. package/dist/queries/methods.d.ts +2 -2
  174. package/dist/queries/methods.js +1 -1
  175. package/dist/queries/outline.d.ts +2 -2
  176. package/dist/queries/outline.js +1 -1
  177. package/dist/queries/passthrough-candidates.d.ts +11 -3
  178. package/dist/queries/passthrough-candidates.js +1 -1
  179. package/dist/queries/plan-context.d.ts +3 -2
  180. package/dist/queries/plan-context.js +1 -1
  181. package/dist/queries/react-component-duplicates.d.ts +7 -2
  182. package/dist/queries/react-component-duplicates.js +1 -1
  183. package/dist/queries/react-hook-candidates.d.ts +3 -3
  184. package/dist/queries/react-hook-candidates.js +1 -1
  185. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  186. package/dist/queries/react-large-component-pressure.js +1 -1
  187. package/dist/queries/recent-duplicates.d.ts +2 -2
  188. package/dist/queries/recent-duplicates.js +1 -1
  189. package/dist/queries/redundant-reexports.d.ts +2 -2
  190. package/dist/queries/redundant-reexports.js +1 -1
  191. package/dist/queries/refs.d.ts +2 -2
  192. package/dist/queries/refs.js +1 -1
  193. package/dist/queries/self-audit.d.ts +9 -4
  194. package/dist/queries/self-audit.js +1 -1
  195. package/dist/queries/similar-chains.d.ts +2 -2
  196. package/dist/queries/similar-chains.js +1 -1
  197. package/dist/queries/similar-files.d.ts +2 -2
  198. package/dist/queries/similar-files.js +1 -1
  199. package/dist/queries/similar-signatures.d.ts +17 -10
  200. package/dist/queries/similar-signatures.js +1 -1
  201. package/dist/queries/similar.d.ts +85 -17
  202. package/dist/queries/similar.js +1 -1
  203. package/dist/queries/slice.d.ts +2 -2
  204. package/dist/queries/slice.js +1 -1
  205. package/dist/queries/stale-abstractions.d.ts +2 -2
  206. package/dist/queries/stale-abstractions.js +1 -1
  207. package/dist/queries/stats.d.ts +2 -2
  208. package/dist/queries/surface.d.ts +2 -2
  209. package/dist/queries/surface.js +1 -1
  210. package/dist/queries/symbols.d.ts +2 -2
  211. package/dist/queries/symbols.js +1 -1
  212. package/dist/queries/system.d.ts +2 -2
  213. package/dist/queries/system.js +1 -1
  214. package/dist/queries/trace.d.ts +2 -2
  215. package/dist/queries/trace.js +1 -1
  216. package/dist/queries/twin-ab.d.ts +55 -0
  217. package/dist/queries/twin-ab.js +2 -0
  218. package/dist/queries/twin-drift.d.ts +97 -0
  219. package/dist/queries/twin-drift.js +2 -0
  220. package/dist/queries/unused-imports.d.ts +2 -2
  221. package/dist/queries/unused-imports.js +1 -1
  222. package/dist/queries/unused-params.d.ts +2 -2
  223. package/dist/queries/unused-params.js +1 -1
  224. package/dist/queries/vue-component-duplicates.d.ts +7 -2
  225. package/dist/queries/vue-component-duplicates.js +1 -1
  226. package/dist/queries/vue-composable-candidates.d.ts +3 -3
  227. package/dist/queries/vue-composable-candidates.js +1 -1
  228. package/dist/queries/vue-large-view-pressure.d.ts +6 -2
  229. package/dist/queries/vue-large-view-pressure.js +1 -1
  230. package/dist/queries/wrapper-candidates.d.ts +2 -2
  231. package/dist/queries/wrapper-candidates.js +1 -1
  232. package/dist/reindex-worker.js +9 -9
  233. package/dist/reindex.d.ts +30 -4
  234. package/dist/reindex.js +19 -19
  235. package/dist/runtime.d.ts +12 -6
  236. package/dist/runtime.js +2 -2
  237. package/dist/{scip-cli-CnK9Va4O.d.ts → scip-cli-C7cg4ZHR.d.ts} +1 -1
  238. package/dist/symbol-types-DaoeXKUt.d.ts +66 -0
  239. package/docs/AGENT_GUIDE.md +20 -18
  240. package/docs/AI_FAILURE_MODES.md +36 -13
  241. package/docs/API.md +1 -1
  242. package/docs/COMMAND_REFERENCE.md +57 -14
  243. package/docs/DETECTOR_GUIDE.md +20 -3
  244. package/docs/REGEX_POLICY.md +34 -0
  245. package/docs/analyzer-inventory.md +48 -3
  246. package/docs/analyzer-validation-ledger.md +41 -6
  247. package/package.json +23 -7
  248. package/scripts/build-scip-windows.mjs +10 -7
  249. package/scripts/evidence-product-contract.mjs +197 -0
  250. package/skills/_shared/SKILL.md +243 -0
  251. package/skills/_shared/agents/openai.yaml +4 -0
  252. package/skills/scip-api-impact/SKILL.md +55 -71
  253. package/skills/scip-claim-audit/SKILL.md +105 -0
  254. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  255. package/skills/scip-cleanup-audit/SKILL.md +122 -0
  256. package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
  257. package/skills/scip-cleanup-improve/SKILL.md +84 -0
  258. package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
  259. package/skills/scip-concrete-plan/SKILL.md +181 -0
  260. package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
  261. package/skills/scip-conductor/SKILL.md +133 -0
  262. package/skills/scip-conductor/agents/openai.yaml +4 -0
  263. package/skills/scip-debug/SKILL.md +60 -58
  264. package/skills/scip-diagram/SKILL.md +64 -94
  265. package/skills/scip-directory-architecture/SKILL.md +65 -107
  266. package/skills/scip-doc-reconcile/SKILL.md +56 -67
  267. package/skills/scip-explore/SKILL.md +78 -210
  268. package/skills/scip-hyper-optimization/SKILL.md +124 -198
  269. package/skills/scip-integrity-audit/SKILL.md +103 -0
  270. package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
  271. package/skills/scip-language-playbook/SKILL.md +56 -326
  272. package/skills/scip-maintainability/SKILL.md +80 -219
  273. package/skills/scip-probe-reachability/SKILL.md +92 -0
  274. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  275. package/skills/scip-query/SKILL.md +108 -124
  276. package/skills/scip-react-maintainability/SKILL.md +64 -82
  277. package/skills/scip-setup/SKILL.md +121 -0
  278. package/skills/scip-setup/agents/openai.yaml +4 -0
  279. package/skills/scip-tla-model-system/SKILL.md +138 -0
  280. package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
  281. package/skills/scip-triage-issue/SKILL.md +53 -41
  282. package/skills/scip-twin-drift/SKILL.md +107 -0
  283. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  284. package/skills/scip-verify/SKILL.md +70 -88
  285. package/skills/scip-vue-maintainability/SKILL.md +67 -94
  286. package/dist/chunk-2KHTSEIL.js +0 -102
  287. package/dist/chunk-3VD3JMK2.js +0 -2
  288. package/dist/chunk-4UZO3XCV.js +0 -35
  289. package/dist/chunk-5GOLFJEO.js +0 -8
  290. package/dist/chunk-5OST6GYB.js +0 -2
  291. package/dist/chunk-65AU3HFZ.js +0 -2
  292. package/dist/chunk-6GN7FXCH.js +0 -2
  293. package/dist/chunk-6IR2AOBM.js +0 -7
  294. package/dist/chunk-6JRV4MY2.js +0 -23
  295. package/dist/chunk-6QSOCTZT.js +0 -18
  296. package/dist/chunk-72KY2ZFO.js +0 -2
  297. package/dist/chunk-7GO4EQF5.js +0 -2
  298. package/dist/chunk-7IVSJJZU.js +0 -7
  299. package/dist/chunk-7TWLSZK5.js +0 -2
  300. package/dist/chunk-A536TEU4.js +0 -3
  301. package/dist/chunk-AVWPHM2Q.js +0 -4
  302. package/dist/chunk-B32FX5KB.js +0 -2
  303. package/dist/chunk-B6MJ5VQV.js +0 -2
  304. package/dist/chunk-BFXPG2VN.js +0 -2
  305. package/dist/chunk-BSN22NRK.js +0 -9
  306. package/dist/chunk-BZ53S4ZN.js +0 -2
  307. package/dist/chunk-C5CTSJ6X.js +0 -6
  308. package/dist/chunk-CO5GJRP7.js +0 -2
  309. package/dist/chunk-CW5YFOCP.js +0 -5
  310. package/dist/chunk-DS6QEB3G.js +0 -5
  311. package/dist/chunk-E35O7UCB.js +0 -2
  312. package/dist/chunk-EXDQ35NN.js +0 -2
  313. package/dist/chunk-FAYI6KZ5.js +0 -2
  314. package/dist/chunk-FFVIFETB.js +0 -2
  315. package/dist/chunk-FG4NT6VY.js +0 -2
  316. package/dist/chunk-FXNWFMKW.js +0 -25
  317. package/dist/chunk-G5UPYQGL.js +0 -4
  318. package/dist/chunk-GQBMH2TQ.js +0 -2
  319. package/dist/chunk-GRJY65YT.js +0 -2
  320. package/dist/chunk-HF25DFSC.js +0 -3
  321. package/dist/chunk-HHN2B5KA.js +0 -2
  322. package/dist/chunk-IHUETYFW.js +0 -2
  323. package/dist/chunk-JCLDUKT6.js +0 -38
  324. package/dist/chunk-JGN2ZFJR.js +0 -2
  325. package/dist/chunk-JM72FNGA.js +0 -2
  326. package/dist/chunk-JME7OWD3.js +0 -2
  327. package/dist/chunk-KDFONWTW.js +0 -40
  328. package/dist/chunk-LPL4MA6R.js +0 -2
  329. package/dist/chunk-LZHUWKGD.js +0 -2
  330. package/dist/chunk-M4COR2H6.js +0 -2
  331. package/dist/chunk-NOJAM5ZV.js +0 -21
  332. package/dist/chunk-O6ZH6C6Y.js +0 -2
  333. package/dist/chunk-OBGRLXWF.js +0 -3
  334. package/dist/chunk-OLTESY4K.js +0 -3
  335. package/dist/chunk-ONPCQ2PM.js +0 -6
  336. package/dist/chunk-P4KYUPBD.js +0 -4
  337. package/dist/chunk-P5RYBRIO.js +0 -4
  338. package/dist/chunk-P7AL7Y37.js +0 -2
  339. package/dist/chunk-PFOCOG57.js +0 -2
  340. package/dist/chunk-QLAUCRDJ.js +0 -2
  341. package/dist/chunk-QPU7EXAW.js +0 -2
  342. package/dist/chunk-QYB5P7GL.js +0 -2
  343. package/dist/chunk-RNM6LMCF.js +0 -2
  344. package/dist/chunk-RVWSAMTT.js +0 -2
  345. package/dist/chunk-TK7O5ER5.js +0 -3
  346. package/dist/chunk-TQ5W2H3S.js +0 -4
  347. package/dist/chunk-USPV3T5K.js +0 -2
  348. package/dist/chunk-UUBMFL3F.js +0 -59
  349. package/dist/chunk-VCQYSG2M.js +0 -10
  350. package/dist/chunk-VUKC6F77.js +0 -20
  351. package/dist/chunk-W2CBNBEL.js +0 -71
  352. package/dist/chunk-W6BVEKYC.js +0 -3
  353. package/dist/chunk-WUCEKFQC.js +0 -3
  354. package/dist/chunk-XUGQU7PM.js +0 -41
  355. package/dist/chunk-Y5NBHMQX.js +0 -2
  356. package/dist/chunk-YCOFCT4B.js +0 -2
  357. package/dist/chunk-YZA6PPZL.js +0 -3
  358. package/skills/concrete-plan/SKILL.md +0 -372
  359. package/skills/concrete-plan/agents/openai.yaml +0 -4
  360. package/skills/scip-adoption/SKILL.md +0 -122
  361. package/skills/scip-adoption/agents/openai.yaml +0 -4
  362. package/skills/scip-ai-cleanup/SKILL.md +0 -153
  363. package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
  364. package/skills/scip-debloat/SKILL.md +0 -439
  365. package/skills/scip-debloat/agents/openai.yaml +0 -4
  366. package/skills/scip-health-audit/SKILL.md +0 -162
  367. package/skills/scip-health-audit/agents/openai.yaml +0 -4
  368. package/skills/scip-health-improve/SKILL.md +0 -155
  369. package/skills/scip-health-improve/agents/openai.yaml +0 -4
  370. package/skills/scip-query-setup/SKILL.md +0 -170
  371. package/skills/scip-query-setup/agents/openai.yaml +0 -3
  372. package/vendor/scip/README.md +0 -6
  373. package/vendor/scip/win32-arm64/scip.exe +0 -0
  374. package/vendor/scip/win32-x64/scip.exe +0 -0
@@ -1,2 +0,0 @@
1
- import{b as R,f as B,g as j}from"./chunk-C5CTSJ6X.js";import{a as F}from"./chunk-BGBBVSH4.js";import{b as J,c as Q,d as U}from"./chunk-RNM6LMCF.js";import{c as z}from"./chunk-JCLDUKT6.js";import{a as H,j as W,k as Y,m as M,n as _}from"./chunk-KDFONWTW.js";import{a as A}from"./chunk-VUKC6F77.js";import{f as h,h as V,i as G,j as O}from"./chunk-2KHTSEIL.js";import{f as C,g as q,i as E,j as K}from"./chunk-JM72FNGA.js";import{a as P,f as g}from"./chunk-72KY2ZFO.js";import{a as S,b as N}from"./chunk-HF25DFSC.js";import{a as k,d as y}from"./chunk-DS6QEB3G.js";import{c as w}from"./chunk-A536TEU4.js";import{a as T}from"./chunk-64MNV6AB.js";function X(t,e,i){let o=e.identifierResolution==="strict"?M:_,s=e.candidateNames?W(e.candidateNames):null;for(let n of e.paths)if(!(!S(n)&&!(e.includeVueSfc&&N(n)))&&!t.isIgnored(n)&&!e.skipPath?.(n))try{if(s&&!Y(k(t,n),s))continue;let d=(a,c,p,b)=>{if(e.candidateNames&&!e.candidateNames.has(a))return;let D=e.resolveTargets?e.resolveTargets({sourceFile:n,name:a,kind:c,defaultTargets:b}):b();for(let I of D)i({sourceFile:n,name:a,target:I,occurrences:p,kind:c})},m=H(t,n);for(let[a,c]of m)d(a,"identifier",c.length,()=>o(t,n,a));for(let a of g(t,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=a.kind==="cross-language-dispatch"?()=>M(t,n,a.name):()=>o(t,n,a.name);d(a.name,a.kind,a.occurrences,c)}}finally{e.afterPath?.(n)}}function Z(t,e={}){let{scope:i,files:o,minLoc:s=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:f,excludeEntrySurfaces:d=!1,excludeTypesFiles:m=!1,excludeRootedSymbols:a=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:p=!1,excludeRustTraitImplMembers:b=!1,includeSuppressed:D=!1,sortByLocDesc:I=!1}=e,x=[],ee=ie(t,{scope:i,files:o,requireCallableSymbol:p}),L=new Map,v=new Map,ne=r=>{let l=L.get(r);if(l!==void 0)return l;let u=B(t,r);return L.set(r,u),u},te=r=>{let l=v.get(r);if(l!==void 0)return l;let u=R(r);return v.set(r,u),u};for(let r of ee){let l=r.relativePath;if(t.isIgnored(l)||d&&ne(l)||!re(r,{requireFunctionLikeSymbol:c,requireCallableSymbol:p})||f!==void 0&&r.symbol===f)continue;let u=F(r);u<s||u>n||m&&oe(l)||a&&j(t,r.symbol,l)||b&&E(r.symbol)||te(l)!=="test"&&(K(r.symbol)||!D&&y(t,l,r.startLine)||x.push(r))}return I?x.sort((r,l)=>F(l)-F(r)):x}function ie(t,e){return e.files!==void 0?[...new Set(e.files.map(o=>o.replace(/\\/g,"/")))].sort().filter(o=>!e.scope||o.includes(e.scope)).flatMap(o=>h(t,o)):e.requireCallableSymbol?O(t,{scope:e.scope,symbolMatches:C,sqlPrefilter:"callable"}):G(t,e.scope)}function re(t,e){return e.requireCallableSymbol?C(t.symbol):e.requireFunctionLikeSymbol?q(t.symbol):t.isFunctionLike}function oe(t){return(t.split("/").pop()??"").includes("types")}var $=class{constructor(e){this.db=e}db;scopedDefinitions(e){return V(this.db,e)}definitionsForFile(e){return h(this.db,e)}productionCallableDefinitions(e={}){return Z(this.db,e)}calleeMap(e,i={}){return z(this.db,e,i)}crossFileCallerMap(e,i={}){return J(this.db,e,i)}sourceFallbackCallerFiles(e){return Q(this.db,e)}callerFileMap(e,i={}){return U(this.db,e,i)}frameworkReferencedSymbolIds(e){let i=new Map;for(let s of e){if(!s.leaf)continue;let n=i.get(s.leaf)??[];n.push(s.symbolId),i.set(s.leaf,n)}let o=new Set;for(let s of T(this.db,{includeIgnored:!1}))if(S(s)==="rust")for(let{name:n}of g(this.db,s,{includeRustAttributeNames:!0}))for(let f of i.get(n)??[])o.add(f);return o}symbolsWithNonSelfCallees(e,i={}){if(e.length===0)return new Set;let o=new Map(e.map(n=>[n.symbolId,n.symbol])),s=this.calleeMap(e,i);return new Set([...s.entries()].filter(([n,f])=>{let d=o.get(n);return f.some(m=>m.symbol!==d)}).map(([n])=>n))}fileDependencyGraph(e){return A(this.db,e)}fileKind(e){return R(e)}hasSuppressionComment(e){return y(this.db,e.relativePath,e.startLine)}sourceFiles(){return w(this.db)}scanSourceReferences(e,i){X(this.db,e,i)}callableSignature(e){let i=P(this.db,e.relativePath)?.callables.find(o=>o.startLine===e.startLine&&o.endLine===e.endLine);return i?{paramCount:i.paramCount}:null}};export{$ as a};
2
- //# sourceMappingURL=chunk-5OST6GYB.js.map
@@ -1,2 +0,0 @@
1
- import{a as b,f as S}from"./chunk-BSN22NRK.js";import{b as d}from"./chunk-C5CTSJ6X.js";import{a as h}from"./chunk-VUKC6F77.js";import{existsSync as R}from"fs";import{join as $}from"path";function U(e){return C.test(e)}var C=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function X(e,t,n={}){let{minTogether:s=4,minConfidence:o=.6,limit:a=30,maxFilesPerCommit:c=20}=n,l=b(e),r=t!==void 0,g=S(e,{minTogether:r?Math.min(s,2):s,minConfidence:r?0:o,maxFilesPerCommit:c});if(!l||!g)return{available:!1,commitsAnalyzed:0,findings:[]};let A=h(e),E=x(e),k=L(e,A,E),w=n.includeLinked===!0||r,u=[];for(let i of g){if(C.test(i.fileA)||C.test(i.fileB)||!y(e,i.fileA)||!y(e,i.fileB)||r&&!i.fileA.includes(t)&&!i.fileB.includes(t)||!r&&(d(i.fileA)==="test"||d(i.fileB)==="test"||j(i.fileA,i.fileB)))continue;let m=k(i.fileA,i.fileB);if(!w&&m)continue;let f=v(i.fileA,i.fileB),p=F(i,f,m);if(u.push({...i,structurallyLinked:m,partnerClass:f.partnerClass,partnerClassReasons:f.reasons,...p?{declaredCouplingSuggestion:p}:{}}),u.length>=a)break}return{available:!0,commitsAnalyzed:l.commits.length,findings:u}}function y(e,t){return R($(e.config.projectRoot,t))}function v(e,t){let n=P(e),s=P(t),o=[],a=r=>{o.includes(r)||o.push(r)},c=(r,g)=>n.tags.has(r)&&s.tags.has(g)||n.tags.has(g)&&s.tags.has(r);if(c("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:o};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:o};if(c("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:o};if(c("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:o};if(c("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:o};let l=q(n.tokens,s.tokens).filter(r=>!G.has(r));return T(e,t)||l.length>=2?(a(T(e,t)?"both files live in the same directory":`files share feature tokens: ${l.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:o}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:o})}function F(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!M.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${Z(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function L(e,t=h(e),n=x(e)){return(s,o)=>_(t,n,s,o)}function j(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let o=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return o!==""&&o===a}function x(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function _(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(o=>o.has(n)&&o.has(s))}var I=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,N=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,D=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,O=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,B=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,z=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,M=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),G=new Set(["src","lib","app","test","tests","spec","index","main","utils","util","types","type","config","docs","doc"]);function P(e){let t=e.replace(/\\/g,"/"),n=new Set;return I.test(t)&&n.add("doc"),N.test(t)&&n.add("config"),D.test(t)&&n.add("schema"),O.test(t)&&n.add("script"),B.test(t)&&n.add("model"),z.test(t)&&n.add("view"),d(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:H(t)}}function T(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),o=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return o!==""&&o===a}function H(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function q(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function Z(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{U as a,X as b,v as c,F as d,L as e};
2
- //# sourceMappingURL=chunk-65AU3HFZ.js.map
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-5OST6GYB.js";import{a as i}from"./chunk-TK7O5ER5.js";import{c as s,e as o,k as m}from"./chunk-JM72FNGA.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
2
- //# sourceMappingURL=chunk-6GN7FXCH.js.map
@@ -1,7 +0,0 @@
1
- import{a as u}from"./chunk-5OST6GYB.js";import{a as b}from"./chunk-TK7O5ER5.js";import{u as l}from"./chunk-OBGRLXWF.js";import{c as m}from"./chunk-JM72FNGA.js";import{readFileSync as p}from"fs";import{join as h}from"path";function O(e,n,r={}){let t=b(e,n);if(!t)return null;let c=new u(e),o=P(d(e,t.relativePath,t.startLine,t.endLine),y(e,t.relativePath)),s=t.endLine-t.startLine+1,a=c.calleeMap([t],{additive:!0,semantic:r.semantic}).get(t.symbolId)??[],f=new Set(a.map(g=>g.symbol));return{symbol:t.symbol,shortName:m(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s,branches:o,cyclomaticEstimate:o+1,calleeCount:f.size,fanIn:S(e,t.symbolId),fanOut:L(a,t.relativePath)}}function y(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function d(e,n,r,t){try{return p(h(e.config.projectRoot,n),"utf-8").split(`
2
- `).slice(r,t+1).join(`
3
- `)}catch{return""}}function S(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
- FROM mentions m
5
- JOIN chunks c ON m.chunk_id = c.id
6
- WHERE m.symbol_id = ? AND m.role != 1`,n)?.c??0}function L(e,n){return new Set(e.filter(r=>r.file!==n).map(r=>r.symbol)).size}function P(e,n){let r=l(e),t=0,c=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of c){let s=r.match(o);s&&(t+=s.length)}if(n==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}return t}export{O as a};
7
- //# sourceMappingURL=chunk-6IR2AOBM.js.map
@@ -1,23 +0,0 @@
1
- import{g as p}from"./chunk-2KHTSEIL.js";import{a as f,c as g,e as l}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-64MNV6AB.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},d=new Map;for(let[e,r]of Object.entries(m))d.set(r.toLowerCase(),Number(e));var b=500;function _(e){let r=parseInt(e,10);if(!isNaN(r))return r;let t=e.toLowerCase(),n=d.get(t);if(n!==void 0)return n;for(let[i,o]of d)if(i.includes(t))return o;return null}function O(e,r,t={}){let{scope:n,limit:i=100}=t,o=_(r);return o===null?[]:h(e,n).map(s=>({row:s,resolvedKind:N(s)})).filter(s=>s.resolvedKind===o).slice(0,i).map(({row:s,resolvedKind:u})=>({symbol:s.symbol,shortName:g(s.symbol),kind:u,kindName:m[u]??"Unknown",relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line}))}function P(e,r={}){let t=k(e,r.scope);for(let n of S(e,r.scope)){let i=N(n);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((n,i)=>i[1]-n[1]||n[0]-i[0]).map(([n,i])=>({kind:n,kindName:m[n]??"Unknown",count:i}))}function h(e,r){return p(e,{scope:r}).map(K)}function k(e,r){let t=new Map;for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", "),o=e.all(`SELECT gs.kind AS kind, COUNT(*) AS count
2
- FROM defn_enclosing_ranges der
3
- JOIN global_symbols gs ON der.symbol_id = gs.id
4
- JOIN documents d ON der.document_id = d.id
5
- WHERE gs.kind IS NOT NULL
6
- AND gs.kind != 0
7
- AND gs.symbol NOT LIKE '%#'
8
- AND d.relative_path IN (${i})
9
- GROUP BY gs.kind`,...n);for(let a of o)t.set(a.kind,(t.get(a.kind)??0)+a.count)}return t}function S(e,r){let t=[];for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", ");t.push(...e.all(`SELECT gs.symbol,
10
- gs.kind,
11
- gs.documentation,
12
- gs.enclosing_symbol,
13
- d.relative_path,
14
- der.start_line,
15
- der.end_line
16
- FROM defn_enclosing_ranges der
17
- JOIN global_symbols gs ON der.symbol_id = gs.id
18
- JOIN documents d ON der.document_id = d.id
19
- WHERE (gs.kind IS NULL OR gs.kind = 0 OR gs.symbol LIKE '%#')
20
- ${e.symbolNoiseFor("gs")}
21
- AND d.relative_path IN (${i})
22
- ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...n))}return t}function y(e){let r=[];for(let t=0;t<e.length;t+=b)r.push(e.slice(t,t+b));return r}function K(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function N(e){return e.kind!==null&&e.kind!==0?M(e.kind,e.symbol,e.documentation):R(e.symbol,e.documentation,e.enclosing_symbol)}function M(e,r,t){let n=(t??"").toLowerCase();if(l(r)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function R(e,r,t){let n=f(e);if("kind"in n)return null;let i=n.descriptors,o=i[i.length-2]??null,a=l(e),s=(r??"").toLowerCase();return a==="type"?s.includes("type ")?76:s.includes("interface ")?27:s.includes("struct ")?68:s.includes("trait ")?73:(s.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:s.includes("async def ")||s.includes("def ")?23:(t?l(t):o?.suffix??null)==="type"?21:83}export{O as a,P as b};
23
- //# sourceMappingURL=chunk-6JRV4MY2.js.map
@@ -1,18 +0,0 @@
1
- import{a as y}from"./chunk-5OST6GYB.js";import{b}from"./chunk-C5CTSJ6X.js";import{c as D}from"./chunk-OLTESY4K.js";import{b as p}from"./chunk-P5RYBRIO.js";import{a as h}from"./chunk-64MNV6AB.js";import g from"path";function d(e){let n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n.length<=1?"(root)":n.length>=3&&["src","lib","app","server","client"].includes(n[0])?`${n[0]}/${n[1]}`:n[0]}function S(e,t){if(e===t)return"ok";let n=m(e),i=m(t);return n&&i?k(n,i)?"ok":"violation":x(e,t)}function v(e,t){let n=m(d(e)),i=m(d(t));return!!n&&!!i}function m(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function k(e,t){return t==="domain"?!0:e==="domain"?!1:{analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),"language-parsers":new Set(["domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["domain","queries","reindex","resolution","semantic","source","storage","symbols"]),semantic:new Set(["domain","resolution","storage","symbols"]),source:new Set(["domain","storage"]),storage:new Set(["domain","source"]),symbols:new Set(["analysis","domain","language-parsers","resolution","semantic","source","storage"])}[e]?.has(t)??!1}function x(e,t){if(t==="shared")return"ok";let n={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return n[e]?n[e].has(t)?"ok":"violation":null}function Z(e,t){let{scope:n,minDeviation:i=5}=t??{},r=t?.semantic!==!1,s=t?.includePatternDeviations!==!1,o=new y(e).fileDependencyGraph(n);return M([...$(e,o,{scope:n,semantic:r}),...P(o),...s?_(o,i):[]])}function $(e,t,n){let i=N(e,n.scope),r=[],s=new Set;for(let[o,a]of t){if(l(o))continue;let u=i.get(o)??new Set;for(let f of a)l(f)||u.has(f)||I(e,o,f,n)||(r.push({file:o,dep:f}),s.add(o))}s.size>0&&A(e,i,{paths:[...s]});let c=[];for(let{file:o,dep:a}of r)(i.get(o)??new Set).has(a)||c.push({file:o,kind:"unused-import",description:`Depends on ${a} but references none of its symbols`,dep:a,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${o} to ${a}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return c}function I(e,t,n,i){return V(e,t,n)||q(e,t,n)||j(n)||U(e,t,n)||J(n)?!0:i.semantic&&B(e,t,n)}function P(e){let t=[],n=L(e);for(let[i,r]of e){if(l(i))continue;let s=d(i);for(let c of r){if(l(c))continue;let o=d(c);if(s===o)continue;let a=S(s,o),u=a?"explicit":"inferred";if((a??n.get(`${s}->${o}`))==="violation"){let R=u==="explicit"?"direct":"signal";t.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${s}/ should not depend on ${o}/`,actionTier:R,policyBasis:u,evidenceReasons:[`dependency edge exists from ${i} to ${c}`,u==="explicit"?`explicit layer policy rejects ${s}/ -> ${o}/`:`rare cross-layer edge ${s}/ -> ${o}/ is inferred as a violation`],recommendation:u==="explicit"?"Move the dependency behind an allowed layer boundary or document a policy change.":"Review whether this is a real boundary break or an intentional exception before moving code."})}}}return t}function _(e,t){let n=[];for(let[i,r]of O(e)){let s=r.filter(o=>!l(o));if(s.length<t)continue;let c=E(e,s);for(let o of s)for(let a of e.get(o)??[])l(a)||(c.get(a)??0)===1&&g.dirname(a)!==i&&g.dirname(a)!==g.dirname(i)&&(v(o,a)||n.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${a}`,dep:a,actionTier:"signal",evidenceReasons:[`${s.length} sibling file(s) in ${i}/ were compared`,`${o} is the only non-skipped sibling depending on ${a}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."}))}return n}function M(e){return{results:e,unusedImports:e.filter(t=>t.kind==="unused-import").length,layerViolations:e.filter(t=>t.kind==="layer-violation").length,patternDeviations:e.filter(t=>t.kind==="pattern-deviation").length}}function O(e){let t=new Map;for(let n of e.keys()){let i=g.dirname(n),r=t.get(i);r||(r=[],t.set(i,r)),r.push(n)}return t}function E(e,t){let n=new Map;for(let i of t)for(let r of e.get(i)??[])l(r)||n.set(r,(n.get(r)??0)+1);return n}function N(e,t){let n=new Map;return F(e,n,t),n}function F(e,t,n){for(let i of T(e,n))w(e,t,i.from_file,i.to_file)}function T(e,t){let n=t?`AND d1.relative_path LIKE '%${t}%'`:"";return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d1 ON c.document_id = d1.id
5
- JOIN global_symbols gs ON m.symbol_id = gs.id
6
- JOIN (
7
- SELECT m2.symbol_id, c2.document_id
8
- FROM mentions m2
9
- JOIN chunks c2 ON m2.chunk_id = c2.id
10
- WHERE m2.role = 1
11
- GROUP BY m2.symbol_id
12
- ) sym_def ON sym_def.symbol_id = gs.id
13
- JOIN documents d2 ON sym_def.document_id = d2.id
14
- WHERE d1.id != d2.id
15
- AND m.role != 1
16
- ${e.pathExclusionsFor("d1","d2")}
17
- ${n}`)}function A(e,t,n={}){new y(e).scanSourceReferences({paths:n.paths??h(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},r=>{r.target.relativePath!==r.sourceFile&&(e.isIgnored(r.target.relativePath)||w(e,t,r.sourceFile,r.target.relativePath))})}function w(e,t,n,i){if(e.isIgnored(n)||e.isIgnored(i))return;let r=t.get(n);r||(r=new Set,t.set(n,r)),r.add(i)}function L(e){let t=new Map;for(let[i,r]of e){if(l(i))continue;let s=d(i);for(let c of r){if(l(c))continue;let o=d(c);if(s===o||S(s,o))continue;let a=`${s}->${o}`;t.set(a,(t.get(a)??0)+1)}}let n=new Map;for(let[i,r]of t)n.set(i,r<=2?"violation":"ok");return n}function j(e){return e.includes("types")||e.endsWith(".d.ts")}function B(e,t,n){let i=D(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.isUsed)}function V(e,t,n){let i=p(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.used)}function q(e,t,n){let i=p(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function J(e){return e.endsWith(".vue")}function U(e,t,n){let i=p(e,t).filter(r=>r.sourcePath===n);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function l(e){let t=b(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||z(g.basename(e)))}function z(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{Z as a};
18
- //# sourceMappingURL=chunk-6QSOCTZT.js.map
@@ -1,2 +0,0 @@
1
- import{a as C}from"./chunk-YZA6PPZL.js";import{a as m,b as d,c as _,d as g}from"./chunk-HF25DFSC.js";import{a as x,i as N,j as S}from"./chunk-DS6QEB3G.js";import{b as h,d as L,e as A}from"./chunk-XUGQU7PM.js";import{f as b}from"./chunk-7S5E7KWT.js";var k=new Set(["identifier","type_identifier","field_identifier"]),v=new Set(["identifier"]),B=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),V=new Set(["rust","python"]),j=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return V.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?v:B}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(j)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\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],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(i=>i.type==="arguments");if(!u)return;let a=u.namedChild(0);if(!a||a.type!=="string")return;let o=a.namedChildren.find(i=>i.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let a;for(;(a=u.exec(e))!==null;){let o=a[1],i=o.split("::").pop()??o;i==="is_none"&&/\bOption\b/.test(o)||i==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||i&&t.add(i)}}}function E(e,t){let r=new Map,n=(a,o)=>{if(a===o)return;let i=r.get(a);i||(i=new Set,r.set(a,i)),i.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(a,o)=>{let i=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)i(l)};for(let s of a.children)i(s)};if(t==="rust")for(let a of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=a.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");i&&u(i,o),a.type==="type_item"&&u(a,o)}else if(t==="python")for(let a of e.rootNode.descendantsOfType("class_definition")){let o=a.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="block");if(i)for(let s of i.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let a of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=a.namedChildren.find(i=>i.type==="type_identifier")?.text;o&&u(a,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=x(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?_(t)?.language??null:m(e)}function Q(e,t,r,n){let c=h(e,t,n),u=L(e,"source-facts",t,c);if(u){let i=q(u);if(i&&i.language===r)return i}let a=g(e,t);if(!a)return null;let o=$(a,r);return A(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,a=new Map,o=(s,l)=>{let p=a.get(s);if(!p){a.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},i=s=>{let l=C(s,t);l&&r.push(l);let p=N(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)i(M)};return i(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:a,identifiersByLine:y(a),fileIdentifiers:new Set(a.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
2
- //# sourceMappingURL=chunk-72KY2ZFO.js.map
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-7B6LP46R.js";import{k as e}from"./chunk-2KHTSEIL.js";function l(t,s){let o=r(t,s);return e(t,o).map(({relativePath:n,...a})=>a)}export{l as a};
2
- //# sourceMappingURL=chunk-7GO4EQF5.js.map
@@ -1,7 +0,0 @@
1
- import{a as C,b as E}from"./chunk-GRJY65YT.js";import{a as _}from"./chunk-LM5SHAN4.js";import{a as P}from"./chunk-PFOCOG57.js";import{a as w}from"./chunk-B75HZHUP.js";import{a as k}from"./chunk-5OST6GYB.js";import{a as v}from"./chunk-BGBBVSH4.js";import{e as I}from"./chunk-RNM6LMCF.js";import{a as y}from"./chunk-KDFONWTW.js";import{b as L}from"./chunk-TQ5W2H3S.js";import{m as x}from"./chunk-2KHTSEIL.js";import{c as d,d as D,j as S}from"./chunk-JM72FNGA.js";import{basename as f,extname as g}from"path";function ne(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new k(t),l=B(r.fileDependencyGraph(e));return P({candidates:()=>T(r,e,i),orderCandidates:w,scanLimit:o,prepare:s=>({callerFileMap:W(t,r,s,{semantic:n?.semantic!==!1}),reverseFanIn:l}),evaluate:(s,c)=>R(t,r,s,c),orderResults:(s,c)=>c.callerFanIn-s.callerFanIn||c.loc-s.loc,limit:a})}function W(t,n,e,i){let a=C(n,e,{semantic:!1,sourceFallback:!1}),o=[];i.semantic&&L("wrapper.semantic-candidates",()=>{o=e.filter(u=>F(t,n,u,a).length<=1)},()=>({symbols:e.length,semanticCandidates:o.length}));let r=o.length===0?new Map:C(n,o,{semantic:!0,sourceFallback:!1}),l=r.size===0?a:I(a,r),s=new Map(e.map(u=>[u.symbolId,u])),c=new Map;for(let u of e){let b=F(t,n,u,l);if(b.length>1||(c.set(u.symbolId,u),b.length!==1))continue;let h=b[0],M=N(t,u.symbolId,h);if(!M)continue;let p=j(n,t,h,u.symbol,M);p?.isFunctionLike&&s.has(p.symbolId)&&c.set(p.symbolId,s.get(p.symbolId))}let m=[...c.values()];return m.length===0?l:I(l,n.sourceFallbackCallerFiles(m))}function R(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=N(t,e.symbolId,o);if(!r)return null;let l=j(n,t,o,e.symbol,r);if(l&&S(l.symbol))return null;let{fanIn:s,source:c}=A(i.callerFileMap,i.reverseFanIn,o,l);if(c==="function"?s<=3:s<=5)return null;let m=q(t,e,o,l);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:v(e),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?d(l.symbol):f(o),callerFanIn:s,actionTier:m.length>0?"signal":"direct",boundaryEvidence:m}}function T(t,n,e){return t.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function F(t,n,e,i){let a=f(e.relativePath,g(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>f(r,g(r))!==a).filter(r=>{let l=n.fileKind(r);return l!=="barrel"&&l!=="entry"&&l!=="test"});return E(t,e,o).realConsumers}function N(t,n,e){return t.get(`SELECT c.start_line, c.end_line
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d ON c.document_id = d.id
5
- WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
- LIMIT 1`,n,e)}function j(t,n,e,i,a){let o=t.definitionsForFile(e),r=O(n,e,i,a.start_line,a.end_line);return x(o,r)}function A(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:J(n,e),source:"file"}}function O(t,n,e,i,a){let o=D(e);if(!o)return i;let r=y(t,n).get(o);if(!r||r.length===0)return i;for(let l of r)if(l>=i&&l<=a)return l;return i}function B(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function J(t,n){let e=t.get(n)??0;if(e>0)return e;let i=f(n,g(n)),a=0;for(let[o,r]of t)o!==n&&f(o,g(o))===i&&r>a&&(a=r);return a}function q(t,n,e,i){return _(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):f(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ne as a};
7
- //# sourceMappingURL=chunk-7IVSJJZU.js.map
@@ -1,2 +0,0 @@
1
- import{c as i}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-RNM6LMCF.js";import{a}from"./chunk-JCLDUKT6.js";import{a as r}from"./chunk-TK7O5ER5.js";import{c as o}from"./chunk-JM72FNGA.js";function S(s,n,c={}){let e=r(s,n);if(!e)return null;let t=c.semantic!==!1,y=m(s,e,{limit:50,semantic:t}),b=i(a(s,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:o(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file}))}}export{S as a};
2
- //# sourceMappingURL=chunk-7TWLSZK5.js.map
@@ -1,3 +0,0 @@
1
- import{a as d}from"./chunk-64MNV6AB.js";import{c as S}from"./chunk-7S5E7KWT.js";import{readdirSync as p}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],F=[".vue"],f=[".tsx",".jsx"],g=[".vue"],_=[...f,...g],h=new Set(f),C=new Set(g),E=new Set(m.map(e=>e.toLowerCase())),O=[...E].sort().join(","),I=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function R(e,n={}){let o=n.includeIndexed??!0,s=n.includeAuxiliary??!0,t=n.extensions?.map(c=>c.toLowerCase()),i=t?new Set(t):E,u=t?[...i].sort().join(","):O,r=`${o?"1":"0"}|${s?"1":"0"}|${u}`;return N.get(e,r,()=>{let c=new Set;if(o)for(let a of d(e,{includeIgnored:!1}))i.has(l(a).toLowerCase())&&c.add(a);if(s)for(let a of w(e.config.projectRoot,i))e.isIgnored(a)||o&&c.has(a)||c.add(a);return[...c].sort()})}function X(e,n={}){let o=!1,s=!1;for(let t of R(e,{extensions:_})){if(n.scope&&!t.includes(n.scope))continue;let i=l(t).toLowerCase();if(o||=h.has(i),s||=C.has(i),o&&s)break}return{react:o,vue:s}}var N=S("source-files",{clearGroups:[]});function w(e,n){return T(e,n)??v(e,n)}function T(e,n){try{let o=x("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),s=new Set;for(let t of o.split(`
2
- `)){let i=t.trim();i&&n.has(l(i).toLowerCase())&&s.add(i)}return s}catch{return null}}function v(e,n){let o=new Set,s=t=>{let i=t?y(e,t):e,u;try{u=p(i,{withFileTypes:!0})}catch{return}for(let r of u)if(!I.has(r.name)){if(r.isDirectory()){s(t?`${t}/${r.name}`:r.name);continue}n.has(l(r.name).toLowerCase())&&o.add(t?`${t}/${r.name}`:r.name)}};return s(""),o}export{F as a,I as b,R as c,X as d};
3
- //# sourceMappingURL=chunk-A536TEU4.js.map
@@ -1,4 +0,0 @@
1
- import{a as I,b as K,c as $}from"./chunk-GRJY65YT.js";import{a as A}from"./chunk-PFOCOG57.js";import{a as R}from"./chunk-5OST6GYB.js";import{b as M,g as k}from"./chunk-C5CTSJ6X.js";import{a as b}from"./chunk-BGBBVSH4.js";import{e as S}from"./chunk-RNM6LMCF.js";import{e as F}from"./chunk-OLTESY4K.js";import{a as P,c as w,d as p}from"./chunk-JM72FNGA.js";import{e as T}from"./chunk-72KY2ZFO.js";import{a as h}from"./chunk-DS6QEB3G.js";function de(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:o=!1,scanLimit:l}=e??{},d=e?.semantic!==!1,a=new R(t),m=a.scopedDefinitions(n),g=Q(a,n),v={high:0,medium:1,low:2};return A({candidates:()=>O(t,a,m,{minLoc:i,maxLoc:s}),orderCandidates:(u,c)=>b(c)-b(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:l,prepare:u=>{let c=z(u),f=W(t,a,u,c,{semantic:d}),y=u.filter(L=>{let x=C(t,L,f,c);return x.realConsumers.length<=1&&!x.transitivelyReachable&&B(L,x.realConsumers.length,g)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,y,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=C(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!B(f.definition,f.realConsumers.length,g))return null;let y=E(t,f);return!o&&y.confidence==="low"?null:y},orderResults:(u,c)=>v[u.confidence]-v[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,i){return n.filter(s=>s.isTypeLike&&b(s)>=i.minLoc).filter(s=>b(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>M(s.relativePath)!=="test").filter(s=>!k(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function U(t,e,n){return I(t,e,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function W(t,e,n,i,s){let r=U(e,n,{semantic:!1,sourceFallback:!1}),o=n.filter(a=>{let m=C(t,a,r,i);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&D(a.relativePath))}),l=s.semantic&&o.length>0?S(r,F(t,o)):r,d=o.filter(a=>C(t,a,l,i).realConsumers.length<=1);return S(l,e.sourceFallbackCallerFiles(d))}function z(t){let e=new Map;for(let n of t){let i=e.get(n.relativePath);i||(i=new Map,e.set(n.relativePath,i));let s=p(n.symbol);s&&i.set(s,n)}return e}function C(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:o,barrelConsumers:l,importOnlyConsumers:d}=K(t,e,r),a=Y(t,e,n,i);return{definition:e,realConsumers:o,barrelConsumers:l+d,transitivelyReachable:a}}function E(t,e){let n=N(t,e.definition.relativePath,e.definition.startLine),i=D(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:r}=ne(e.realConsumers.length,n,i),o=V(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:w(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r,actionTier:o.actionTier,stalenessKind:o.stalenessKind,recommendation:o.recommendation}}function V(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,i,s){let r=_(t,Z(n),i),o=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=I(e,o,{semantic:s.semantic}),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,l)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let i=p(n.symbol);i&&e.set(j(n.relativePath,i),n)}return e}function _(t,e,n){let i=[];for(let s of n){let r=q(t,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function q(t,e,n){if(N(t,n.relativePath,n.startLine)!=="class")return null;let i=p(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(j(n.relativePath,s))??null:null}function G(t,e,n){let i=p(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!$(t,r,i))}function j(t,e){return`${t}\0${e}`}function J(t,e,n){let i=h(t,e);if(!i)return null;let s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=P(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let i=n[n.length-1],s=n[n.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function D(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function B(t,e,n){return!(D(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=T(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let o=s.get(r);if(!o||o.size===0)return!1;let l=i.get(e.relativePath);if(!l)return!1;for(let d of o){let a=l.get(d);if(!a)continue;let m=n.get(a.symbolId);if(m){for(let g of m)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function N(t,e,n){let i=h(t,e);if(!i)return"other";let s=i.split(`
2
- `),r=Math.max(0,n-2),o=Math.min(s.length-1,n+2);for(let l=r;l<=o;l++){let a=(s[l]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=h(t,e.relativePath);if(!n)return!1;let i=p(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),o=n.split(`
3
- `);for(let l=0;l<o.length;l++)if(!(l>=e.startLine&&l<=e.endLine)&&r.test(o[l]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{de as a};
4
- //# sourceMappingURL=chunk-AVWPHM2Q.js.map
@@ -1,2 +0,0 @@
1
- var i={dead:{minLoc:3,skipBarrels:!0,deadCodeOnly:!0,semantic:!1},isolated:{minLoc:3,semantic:!1},similar:{minSimilarity:.6,limit:50,minCallees:4,semantic:!1},extract:{minLoc:15,minCallees:5,limit:50,semantic:!1},wrappers:{maxLoc:15,limit:50,semantic:!1},passthroughs:{maxLoc:15,limit:50,semantic:!1},stale:{minLoc:3,limit:50,semantic:!1},drift:{semantic:!1}};export{i as a};
2
- //# sourceMappingURL=chunk-B32FX5KB.js.map
@@ -1,2 +0,0 @@
1
- import{a as r}from"./chunk-64MNV6AB.js";function a(e){return/[*?]/.test(e)?e.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_"):`%${e}%`}function o(e,t){let i=a(t);return r(e,{like:i,includeIgnored:!1}).map(s=>({relativePath:s}))}export{o as a};
2
- //# sourceMappingURL=chunk-B6MJ5VQV.js.map
@@ -1,2 +0,0 @@
1
- import{c as m}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-RNM6LMCF.js";import{a as g}from"./chunk-JCLDUKT6.js";import{q as y}from"./chunk-KDFONWTW.js";import{a as c}from"./chunk-TK7O5ER5.js";import{c as r}from"./chunk-JM72FNGA.js";function v(l,t,n={}){let o=c(l,t);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],s=y(l,o,{semantic:n.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:i}=S(l,o,s,{semantic:n.semantic!==!1});return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:i.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function S(l,t,n,o){let a=m(g(l,t,{limit:30,semantic:o.semantic}).map(i=>({symbol:i.symbol,file:i.file}))),s=m(b(l,t,{limit:30,semantic:o.semantic})),f=s.length>0?s:m(n.map(i=>({symbol:i.enclosingSymbol==="(top-level)"?i.file:i.enclosingSymbol,file:i.file})));return{producers:a,consumers:f}}export{v as a};
2
- //# sourceMappingURL=chunk-BFXPG2VN.js.map
@@ -1,9 +0,0 @@
1
- import{d as _,e as E}from"./chunk-XUGQU7PM.js";import{d as H}from"./chunk-7S5E7KWT.js";import{execFileSync as O}from"child_process";var y=2e3,S=50,L=64,N=8,j=3,B=2160*60*60,I=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,v=3,G=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,U=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function T(e){let t=H(e,{clearGroups:["whole-project"]});return(n,r)=>{let i=D(n.config.projectRoot);if(!i)return null;let o=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return o&&o.head===i?o.value:(t.invalidate(n),t.get(n,()=>({head:i,value:r(n.config.projectRoot,i)})).value)}}var J=T("git-commit-history");function x(e){return J(e,K)}function D(e){try{return p(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function p(e,t){return O("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function K(e,t){let n;try{n=p(e,["log","--no-merges","--name-only","-n",String(y),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:t,...R(n,S)}}function V(e){return I.test(e.subject)}function de(e){let t=x(e);if(!t)return null;let n=new Map;for(let r of t.commits){let i=V(r);for(let o of r.files){let c=n.get(o)??{changes:0,fixChanges:0,lastChangedAt:0};c.changes+=1,i&&(c.fixChanges+=1),r.timestamp>c.lastChangedAt&&(c.lastChangedAt=r.timestamp),n.set(o,c)}}return n}function ge(e){let t=x(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(r=>r.files.length).filter(r=>r>0).sort((r,i)=>r-i);return n.length===0?null:{medianFilesPerCommit:P(n,.5),p90FilesPerCommit:P(n,.9),commitsAnalyzed:n.length}}function P(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var W=T("git-tracked-files");function fe(e){return W(e,t=>{try{let n=p(t,["ls-files"]);return new Set(n.split(`
2
- `).map(r=>r.trim()).filter(r=>r!==""))}catch{return null}})}var X=T("git-file-adds"),k="__git__/file-adds";function he(e){return X(e,(t,n)=>Y(e,t,n))}function Y(e,t,n){let r=$(_(e,"git-file-adds",k,n));if(r)return r;let i=q(t);return i&&E(e,"git-file-adds",k,n,Z(i)),i}function Z(e){return JSON.stringify([...e.entries()])}function $(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=new Map;for(let r of t){if(!Array.isArray(r)||r.length!==2||typeof r[0]!="string")return null;let i=r[1];if(!i||typeof i.commitsAgo!="number"||!Number.isFinite(i.commitsAgo)||typeof i.addedAt!="number"||!Number.isFinite(i.addedAt))return null;n.set(r[0],{commitsAgo:i.commitsAgo,addedAt:i.addedAt})}return n}catch{return null}}function q(e){let t;try{t=p(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(y),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,r=-1;for(let i of t.split("")){if(i.trim()==="")continue;r+=1;let o=i.indexOf(`
3
- `),c=o>=0?i.slice(0,o):i,[,m]=c.split("\0"),l=Number(m)||0;if(!(o<0))for(let g of i.slice(o+1).split(`
4
- `)){let h=g.trim();h!==""&&n.set(h,{commitsAgo:r,addedAt:l})}}return n}function pe(e,t={}){let n=x(e);return n?F(n,t):null}function Q(e,t,n={}){let r=x(e);return r?t.size===0?[]:F(r,n,t):null}function Ce(e,t,n={}){if(t.size===0)return[];let r=D(e.config.projectRoot);if(!r)return null;let i=n.maxFilesPerCommit??S;if(t.size>L)return Q(e,t,n);let o=ee(e.config.projectRoot,r,t,i);return o?F(o,n,t):null}function F(e,t,n){let{minTogether:r=4,minConfidence:i=.6,maxFilesPerCommit:o=S}=t,c=new Map,m=new Map,l=e.newestAnalyzedAt??0;for(let s of e.commits){let a=[...new Set(s.files)].sort();if(a.length>o)continue;e.newestAnalyzedAt===void 0&&s.timestamp>l&&(l=s.timestamp);let f=re(a),A=n===void 0||a.some(u=>n.has(u));for(let u of a)c.set(u,(c.get(u)??0)+1);if(A)for(let u=0;u<a.length;u++)for(let C=u+1;C<a.length;C++){if(n&&!n.has(a[u])&&!n.has(a[C]))continue;let b=`${a[u]}\0${a[C]}`,d=m.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};d.together+=1,f?d.broadTogether+=1:d.focusedTogether+=1,s.timestamp>d.lastTogetherAt&&(d.lastTogetherAt=s.timestamp),d.timestamps.push(s.timestamp),d.subjects.push(s.subject),m.set(b,d)}}let g=[],h=l-B;for(let[s,a]of m){let f=a.together;if(f<r)continue;let[A,u]=s.split("\0"),C=c.get(A)??f,b=c.get(u)??f,d=Math.max(f/C,f/b);if(d<i)continue;let M=a.broadTogether/f,w=a.timestamps.filter(z=>z>=h).length;g.push({fileA:A,fileB:u,together:f,confidence:d,changesA:C,changesB:b,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:M,lastTogetherAt:a.lastTogetherAt,recentTogether:w,commitScope:oe(a.broadTogether,f),recency:w>0?"recent":"stale",subjectContext:se(a.subjects)})}return g.sort((s,a)=>a.together-s.together||a.confidence-s.confidence||s.fileA.localeCompare(a.fileA)),g}function ee(e,t,n,r){let i;try{i=te(e)}catch{return null}if(i.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let o;try{o=p(e,["log","--no-merges","--format=%H","-n",String(y),"--",...[...n].sort()])}catch{return null}let c=new Set(i.map(s=>s.hash)),m=o.split(`
5
- `).map(s=>s.trim()).filter(s=>s!==""&&c.has(s)),l=ne(e,i,r);if(m.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:l};let g;try{g=p(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...m])}catch{return null}let h=R(g,r);return{head:t,...h,newestAnalyzedAt:l}}function te(e){return p(e,["log","--no-merges","--format=%H%x00%ct","-n",String(y)]).split(`
6
- `).map(n=>n.trim()).filter(n=>n!=="").map(n=>{let[r,i]=n.split("\0");return{hash:r??"",timestamp:Number(i)||0}}).filter(n=>n.hash!=="")}function ne(e,t,n){for(let i=0;i<t.length;i+=20){let o=t.slice(i,i+20),c;try{c=p(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...o.map(l=>l.hash)])}catch{return t[0]?.timestamp??0}let m=R(c,n);if(m.commits.length>0)return m.commits[0].timestamp}return 0}function R(e,t){let n=[],r=0;for(let i of e.split("")){if(i.trim()==="")continue;let o=i.indexOf(`
7
- `),c=o>=0?i.slice(0,o):i,[m,l,g]=c.split("\0");if(!m||!l)continue;let h=o>=0?i.slice(o+1).split(`
8
- `).map(s=>s.trim()).filter(s=>s!==""):[];if(h.length>t){r+=1;continue}n.push({hash:m,timestamp:Number(l)||0,subject:g??"",files:h})}return{commits:n,skippedBulkCommits:r}}function re(e){return e.length>=N?!0:ie(e).size>=j}function ie(e){let t=new Set;for(let n of e){let r=n.indexOf("/");t.add(r>=0?n.slice(0,r):".")}return t}function oe(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function se(e){let t=new Set,n=[],r=[];for(let i of e){!r.includes(i)&&r.length<v&&r.push(i);for(let o of ae(i))t.add(o);for(let o of i.match(G)??[])n.includes(o)||n.push(o)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:r,externalIssueLabelStatus:"unavailable"}}function ae(e){let t=new Set,n=U.exec(e)?.[1]?.toLowerCase();return n&&t.add(ce(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function ce(e){return e==="feat"?"feature":e}export{x as a,de as b,ge as c,fe as d,he as e,pe as f,Ce as g};
9
- //# sourceMappingURL=chunk-BSN22NRK.js.map
@@ -1,2 +0,0 @@
1
- import{a as l,c as g}from"./chunk-YWOOQ4FF.js";function v(e){let n=[],r=[],i=[];for(let o of e.primitiveGroups)o.values.length!==0&&h(o.bucket,r,i).push(`${o.reasonPrefix}: ${o.values.join(", ")}`);for(let o of e.nameGroups)u(o.names,o.label,e.genericWords,e.stripPrefixes??[],n,h(o.fallbackBucket,r,i));let c=n.length>0,d=r.length>0,s=i.length>0,t=c?d||s?"mixed":"domain-behavior":s?"shared-abstraction":"generic-workflow-scaffolding";return{actionTier:t==="domain-behavior"||t==="mixed"?"signal":"support",evidenceClass:t,reasons:[...n,...i,...r].slice(0,6),recommendation:e.recommendation(t)}}function x(e,n){if(e.size===0||n.size===0)return 0;let i=l(e,n).size/Math.min(e.size,n.size);return Math.max(g(e,n),i)}function y(e,n){return[...e].filter(r=>r.startsWith(n)).map(r=>r.slice(n.length)).sort()}function b(e){return[...e].sort()}function u(e,n,r,i,c,d){let s=[],t=[];for(let a of e)m(a,i).filter(f=>!r.has(f)).length>0?s.push(a):t.push(a);s.length&&c.push(`${n} has domain term(s): ${s.slice(0,6).join(", ")}`),t.length&&d.push(`${n} is generic workflow: ${t.slice(0,6).join(", ")}`)}function m(e,n){let r=e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2");for(let i of n)r=r.replace(i,"");return r.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function h(e,n,r){return e==="generic"?n:r}export{v as a,x as b,y as c,b as d};
2
- //# sourceMappingURL=chunk-BZ53S4ZN.js.map
@@ -1,6 +0,0 @@
1
- import{a as E}from"./chunk-VUKC6F77.js";import{d as _}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-72KY2ZFO.js";import{c as P}from"./chunk-A536TEU4.js";import{d as p}from"./chunk-7S5E7KWT.js";import{existsSync as d,readFileSync as D,readdirSync as y}from"fs";import{join as l}from"path";var R={files:new Set,pathPrefixes:[]},x=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,F=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,j=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],C=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),I=4,M=p("package-surface",{clearGroups:["whole-project"]});function X(t){return M.get(t,()=>W(t.config.projectRoot))}function T(t,e){let r=X(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function W(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of U(t))for(let n of B(s))G(t,i,n,e,r);return e.size===0&&r.length===0?R:{files:e,pathPrefixes:r}}function U(t){let e=[],r=k(t,"");return r&&e.push({manifest:r,packageRoot:""}),w(t,"",e,0),e}function w(t,e,r,s){if(s>=I)return;let i=l(t,e);if(d(i))for(let n of y(i,{withFileTypes:!0})){if(!n.isDirectory()||C.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=k(t,a);o&&r.push({manifest:o,packageRoot:a}),w(t,a,r,s+1)}}function k(t,e){try{let r=D(l(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function B(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return $(t.exports,e),e}function $(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))$(r,e)}function G(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of m(c))u!==""&&i.push(f(e,u));return}let o=n.replace(F,"");for(let c of m(o)){c===o&&c===n&&s.add(f(e,n));for(let u of j)L(t,s,e,c+u)}s.add(f(e,n))}function m(t){let e=[t];return x.test(t)&&(e.push(t.replace(x,"src/")),e.push(t.replace(x,""))),e}function L(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(l(t,i)))return;let n=j.find(h=>s.endsWith(h));if(!n)return;let a=s.slice(0,-n.length);V(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let h of v(t,r,c,`${u}${n}`))e.add(h)}function V(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(l(t,n))&&e.add(n)}function v(t,e,r,s){let i=l(t,e,r);if(!d(i))return[];let n=[];for(let a of y(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...v(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}function S(t){let e=g(t);return ct(e)?"test":ut(e)?"worker":ft(e)?"entry":gt(e)?"barrel":"source"}function H(t){return S(t)==="barrel"}function N(t){return K.get(t,()=>{let e=E(t),r=P(t).filter(n=>{let a=S(n);return a==="entry"||a==="worker"}),s=new Set,i=new Set;for(;r.length>0;){let n=r.shift();if(!s.has(n)){s.add(n),S(n)==="barrel"&&i.add(n);for(let a of e.get(n)??[])s.has(a)||r.push(a)}}return i})}var K=p("live-barrels",{clearGroups:["whole-project"]});function J(t,e){return N(t).has(g(e))}function yt(t){let e=N(t);return P(t).filter(r=>H(r)&&!e.has(r)&&!Q(t,r))}function Q(t,e){let r=g(e),s=b(t,r)?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
2
- FROM defn_enclosing_ranges der
3
- JOIN documents d ON d.id = der.document_id
4
- WHERE d.relative_path = ?
5
- AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function jt(t,e){let r=S(e);return r==="entry"||r==="worker"||J(t,e)}function Tt(t,e,r){let s=g(r);if(T(t,s)||et(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>g(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(g(n)))||i.qualifiedVars?.some(n=>lt(e,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(e)}catch{return!1}})):!1}var A=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Y=new Set(["default","generateMetadata","generateStaticParams"]),Z=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),q=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),z=new Set(["load","actions","entries",...A]),tt=new Set(["default"]);function et(t,e){let r=_(t);return r===""?!1:rt(e)?A.has(r):st(e)?Y.has(r):nt(e)?Z.has(r):it(e)?q.has(r):at(e)?z.has(r):ot(e)?tt.has(r):!1}function rt(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function nt(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function it(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function at(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ot(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function ct(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function ut(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function ft(t){let e=t.split("/"),r=e[e.length-1]??t;return r==="cli.ts"||r==="cli.js"||r==="postinstall.ts"||r==="postinstall.js"||r==="main.ts"||r==="main.js"||r==="main.rs"||r==="main.go"||r==="main.py"||r==="build.rs"||r==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:r==="index.ts"||r==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:e.length<=2:!1}function gt(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function g(t){return t.replace(/\\/g,"/")}function lt(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let s=e.slice(0,r),i=e.slice(r+1);return t.includes(O(s)+"/")&&t.includes(O(i)+".")}function O(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{T as a,S as b,H as c,J as d,yt as e,jt as f,Tt as g};
6
- //# sourceMappingURL=chunk-C5CTSJ6X.js.map
@@ -1,2 +0,0 @@
1
- import{a as A}from"./chunk-GRJY65YT.js";import{a as C}from"./chunk-5OST6GYB.js";import{a as k}from"./chunk-TK7O5ER5.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as f}from"path";var j=20,z=1,_=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"]]),G=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),O=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 De(e,n={}){let t=L(n.limit,j),i=L(n.minConsumers,z),o=new C(e),s=o.fileDependencyGraph(n.scope),r=de(p(e,{includeIgnored:!1})),c=fe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?q(e,o,n.target):Y(e,n.scope,n.scanLimit)).map(a=>K(o,s,a,n,r,c)).filter(a=>a.consumerFiles.length>=i||n.target).sort(ue).slice(0,t)}function q(e,n,t){let i=V(e,t);if(i)return[N(i)];let o=k(e,t);if(!o)return[];let s=n.definitionsForFile(o.relativePath).find(r=>r.symbolId===o.symbolId);return s?[X(s)]:[{unit:{kind:"symbol",file:o.relativePath,shortName:b(o.symbol),symbol:o.symbol,startLine:o.startLine,endLine:o.endLine}}]}function Y(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),o=L(t,i.length);return i.slice(0,o).map(s=>N(s))}function K(e,n,t,i,o,s){let r=t.definition?J(e,t.definition,i.semantic):Q(n,t.unit.file),c=t.definition?r.length>0?"exact":"none":r.length>0?"file-level":"none",m=t.unit.file,l=u(f.dirname(m)),a=ee(r),h=Z(l),B=w([...F(l),...a?F(a):[]]),y=ne(t.unit,l,a,r),g=te(y,t.unit,l,a,r,o,s),E=ae(t.unit,c,a,r,l,g.whyNoSuggestedHome),W=ce(t.unit,l,a,r,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:t.unit,candidatePath:m,currentDirectory:l,directoryAncestry:h,consumerFiles:r,consumerCoverage:c,nearestCommonOwner:a,boundaryMarkers:B,recommendedTier:y,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:E,reasons:W,recommendation:le(y,g.suggestedHome,c)}}function J(e,n,t){let i=A(e,[n],{semantic:t!==!1,sourceFallback:!0});return H(i.get(n.symbolId)??[])}function Q(e,n){let t=[];for(let[i,o]of e.entries())i!==n&&o.has(n)&&t.push(i);return H(t)}function V(e,n){let t=D(n),i=p(e,{includeIgnored:!1}),o=i.find(r=>r===t);if(o)return o;let s=i.find(r=>r.endsWith(`/${t}`));return s||(i.find(r=>r.includes(t))??null)}function X(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:b(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function N(e){return{unit:{kind:"file",file:e,shortName:f.basename(e)}}}function Z(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 o=t.slice(0,i+1).join("/");n.push({path:o,depth:i,markers:v(o)})}return n}function F(e){return e==="."?[]:I(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function v(e){return w(I(e).map(({marker:n})=>n))}function I(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let o=_.get(n[i]);o&&t.push({marker:o,prefix:n.slice(0,i+1).join("/")})}return t}function ee(e){if(e.length===0)return null;let n=e.map(i=>u(f.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let o=i.split("/").filter(Boolean),s=[],r=Math.min(t.length,o.length);for(let c=0;c<r&&t[c]===o[c];c+=1)s.push(t[c]);t=s}return t.length===0?".":t.join("/")}function ne(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":R(t,"package")?"package-level-shared":R(t,"app")?"app-level-shared":U(t,["feature","domain","module"])||U(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function te(e,n,t,i,o,s,r){let c=ie(e,i);if(c)return d(c);let m=me(n.file),l=re(e,t,m,o,r);if(l)return l;let a=i;if(u(t)===u(a))return d(`${t} is already the nearest common owner for its consumers.`);let h=oe(a,t,m,r);return h||se(a,t,m,s,r)}function ie(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 re(e,n,t,i,o){if(e==="same-file"){let s=i[0]??null;return s?S(s):d("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=u(f.dirname(i[0])),r=M(n,t,s,o);return r?d(r):S(s)}return null}function oe(e,n,t,i){return pe(e)?$(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function se(e,n,t,i,o){if(e===".")return d("The nearest common owner is the repository root.");let s=`${e}/shared`,r=$(s,n,t,o,`Proposed home ${s} is outside source root ${t}.`);return r.confidence==="withheld"||i.has(s)?r:d(`${s} does not exist in the indexed project.`)}function $(e,n,t,i,o){if(!P(e,t))return d(o);let s=M(n,t,e,i);return s?d(s):S(e)}function S(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function d(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ae(e,n,t,i,o,s){let r=["Report-only signal; review ownership before moving files."];return n==="none"&&r.push("No consumers were found in the current index."),n==="file-level"&&r.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&r.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&r.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&r.push("File targets describe module locality, not symbol-level usage."),t&&o.startsWith(`${t}/`)&&r.push("Candidate already lives under the nearest common owner."),s&&r.push(`No exact suggested home: ${s}`),r}function ce(e,n,t,i,o,s){let r=[];return r.push(`${e.shortName} currently lives in ${n}.`),t?r.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):r.push("No consumer owner could be inferred from the current index."),o?r.push(`Suggested home is ${o}.`):s&&r.push(`No exact suggested home: ${s}`),r}function le(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 ue(e,n){return T(n)-T(e)||e.candidatePath.localeCompare(n.candidatePath)}function T(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n-=8),e.recommendedTier==="no-exact-consumers"&&(n-=12),n}function de(e){let n=new Set(["."]);for(let t of e){let i=u(f.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=u(f.dirname(i))}return n}function me(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function P(e,n){let t=u(e),i=u(n);return i==="."||t===i||t.startsWith(`${i}/`)}function ge(e,n,t){let i=x(e),o=x(n);return(P(e,n)?i.slice(o.length):i).some(r=>t.has(r.toLowerCase()))}function M(e,n,t,i){return u(e)===u(t)||!ge(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function fe(...e){let n=new Set(O);for(let t of e)for(let i of t??[]){let o=he(i);o&&n.add(o)}return n}function he(e){let n=e.trim().toLowerCase();return n===""?null:n}function R(e,n){return v(e).includes(n)}function U(e,n){let t=v(e);return n.some(i=>t.includes(i))}function pe(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?G.has(t):!1}function D(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function u(e){let n=D(e);return n===""?".":n}function x(e){let n=D(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 H(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{De as a};
2
- //# sourceMappingURL=chunk-CO5GJRP7.js.map
@@ -1,5 +0,0 @@
1
- import{a as ne,b as A,e as H,f as $,g as z,h as ie,i as te}from"./chunk-YWOOQ4FF.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as T}from"./chunk-5OST6GYB.js";import{a as ee}from"./chunk-JCLDUKT6.js";import{a as D,b as S}from"./chunk-TQ5W2H3S.js";import{a as U}from"./chunk-TK7O5ER5.js";import{c as L,d as G,g as P}from"./chunk-JM72FNGA.js";import{a as _,b as j}from"./chunk-DS6QEB3G.js";import{b as X,d as J,e as Q}from"./chunk-XUGQU7PM.js";import{a as Y}from"./chunk-64MNV6AB.js";import{d as E}from"./chunk-7S5E7KWT.js";function fn(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,s=Me(e,n,{semantic:t.semantic!==!1});if(!s)return[];if(!P(s.symbol))return[];if(s.callees.size===0)return re(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"});let a=ye(e,s,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return a.length>0?a.slice(0,r):re(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"})}function ye(e,n,t,i){let r=W(e,{minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),s=De(n,r),a=he(n,r),l=$(a),c=z(n.callees,a),m=[];for(let f of s){if(f.callees.size<3)continue;let d=z(f.callees,a),o=oe(n,f,a,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:l,magnitudeA:c,magnitudeB:d});o&&m.push(o)}return m.sort((f,d)=>d.similarity-f.similarity),m}function he(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return H(t,n.corpus.length+1)}function oe(e,n,t,i){let r=Ce(e,n,t,i);if(!ke(r,i))return null;let{similarity:s,significantShared:a,trivialShared:l}=r,c=a.length>0?a:l,m=ue(c,"callees");return{symbolA:e.symbol,shortNameA:L(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:L(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:c.map(L),uniqueToA:[...A(e.callees,n.callees)].map(L),uniqueToB:[...A(n.callees,e.callees)].map(L),...m}}function Fe(e,n,t,i){let r=i.magnitudeA??z(e.callees,t),s=i.magnitudeB??z(n.callees,t),a=0,l=0,c=0,m=i.medianIdf??$(t);for(let o of e.callees){if(!n.callees.has(o))continue;let g=t.get(o)??0;a+=g*g,c+=1,g>=m&&(l+=1)}if(c===0)return!1;let f=r*s;return(f>0?a/f:0)<i.minSimilarity?!1:l>=i.requireSignificantShared||c>=i.requireSharedCount}function Ce(e,n,t,i){return i.magnitudeA===void 0||i.magnitudeB===void 0?ie(e.callees,n.callees,t,{medianIdf:i.medianIdf}):te(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB})}function ke(e,n){if(e.similarity<n.minSimilarity)return!1;let t=e.significantShared.length+e.trivialShared.length;return e.significantShared.length>=n.requireSignificantShared||t>=n.requireSharedCount}function gn(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:s=4,crossFileOnly:a=!1,scanLimit:l}=n,c=n.semantic!==!1,m=D(),f=0,d=0,o=0,g=0,u=0,p=0,b=0;return S("similar.all",()=>{let y=W(e,{minCallees:s,scope:r,scanLimit:l,semantic:c}),C=y.corpus;f=C.length;let x=n.focusFiles,k=[],B=0;return S("similar.all.pair-scan",()=>{for(let F=0;F<C.length;F+=1){let h=C[F],I=x?.has(h.file)??!1,w=y.weightedMagnitudes[F],M=new Set;for(let N of h.callees){let R=y.candidateIndexesByCallee.get(N);if(R)for(let v of R)v<=F||x&&!I&&!x.has(C[v].file)||M.add(v)}m&&(o+=M.size,M.size>0&&(d+=1));for(let N of M){let R=C[N];if(a&&h.file===R.file){m&&(u+=1);continue}if(le(h,R)){m&&(p+=1);continue}m&&(g+=1);let v=oe(h,R,y.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:y.medianIdf,magnitudeA:w,magnitudeB:y.weightedMagnitudes[N]});v&&(xe(k,v,i,B),m&&(b+=1),B+=1)}}},()=>({corpusSize:f,candidateSets:d,candidatePairs:o,comparedPairs:g,crossFileSkips:u,signatureSkips:p,insertedResults:b,topResults:k.length})),S("similar.all.sort-project",()=>(k.sort((F,h)=>h.result.similarity-F.result.similarity||F.order-h.order),k.map(F=>F.result)),()=>({topResults:k.length}))},()=>({minSimilarity:t,limit:i,scope:r,minCallees:s,crossFileOnly:a,scanLimit:l,semantic:c,corpusSize:f,candidateSets:d,candidatePairs:o,comparedPairs:g,crossFileSkips:u,signatureSkips:p,insertedResults:b}))}function pn(e,n={}){let{minSimilarity:t=.5,scope:i,minCallees:r=4,crossFileOnly:s=!1,scanLimit:a}=n,l=n.semantic!==!1,c=D(),m=0,f=0,d=0,o=0,g=0,u=0,p=0;return S("similar.all-count",()=>{let b=W(e,{minCallees:r,scope:i,scanLimit:a,semantic:l}),y=b.corpus;m=y.length;let C=n.focusFiles;return S("similar.all-count.pair-scan",()=>{for(let x=0;x<y.length;x+=1){let k=y[x],B=C?.has(k.file)??!1,F=b.weightedMagnitudes[x],h=new Set;for(let I of k.callees){let w=b.candidateIndexesByCallee.get(I);if(w)for(let M of w)M<=x||C&&!B&&!C.has(y[M].file)||h.add(M)}c&&(d+=h.size,h.size>0&&(f+=1));for(let I of h){let w=y[I];if(s&&k.file===w.file){c&&(g+=1);continue}if(le(k,w)){c&&(u+=1);continue}c&&(o+=1),Fe(k,w,b.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:b.medianIdf,magnitudeA:F,magnitudeB:b.weightedMagnitudes[I]})&&(p+=1)}}},()=>({corpusSize:m,candidateSets:f,candidatePairs:d,comparedPairs:o,crossFileSkips:g,signatureSkips:u,insertedResults:p})),p},()=>({minSimilarity:t,scope:i,minCallees:r,crossFileOnly:s,scanLimit:a,semantic:l,corpusSize:m,candidateSets:f,candidatePairs:d,comparedPairs:o,crossFileSkips:g,signatureSkips:u,insertedResults:p}))}function le(e,n){if(e.paramCount<0||n.paramCount<0)return!1;let t=Math.abs(e.paramCount-n.paramCount),i=Math.max(2,Math.ceil(Math.max(e.paramCount,n.paramCount)*.5));return t>i}function xe(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let a=1;a<e.length;a+=1){let l=e[a],c=e[r];(l.result.similarity<c.result.similarity||l.result.similarity===c.result.similarity&&l.order>c.order)&&(r=a)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:i})}var we=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function Me(e,n,t){let i=U(e,n);if(!i||!P(i.symbol))return null;let r=new T(e),s=ee(e,i,{semantic:t.semantic});return{symbol:i.symbol,file:i.relativePath,callees:ce(s.map(a=>a.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var Le=E("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Ie=E("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function Re(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:s}=n,a=n.semantic!==!1,l=Le.get(e,()=>new Map),c=`${t}|${i??""}|${s??""}|${a}`,m=!0,f=0,d=0;return S("similar.callee-fingerprints.resolve",()=>{let o=l.get(c);if(m=o!==void 0,o||(o=ze(e,{minCallees:t,scope:i,scanLimit:s,semantic:a}),l.set(c,o)),f=o.length,r===void 0)return o;let g=o.filter(u=>u.symbol!==r);return d=o.length-g.length,g},()=>({minCallees:t,scope:i,scanLimit:s,semantic:a,cacheHit:m,corpusSize:f,excludeSymbol:r!==void 0,excludedSymbols:d}))}function W(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,s=n.semantic!==!1,a=Ie.get(e,()=>new Map),l=`${t}|${i??""}|${r??""}|${s}`,c=!0,m=0,f=0,d=0;return S("similar.callee-index.resolve",()=>{let o=a.get(l);return c=o!==void 0,o||(o=ve(Re(e,{minCallees:t,scope:i,scanLimit:r,semantic:s})),a.set(l,o)),m=o.corpus.length,f=o.docFreq.size,d=o.candidateIndexesByCallee.size,o},()=>({minCallees:t,scope:i,scanLimit:r,semantic:s,cacheHit:c,corpusSize:m,indexedCallees:f,candidateBuckets:d}))}function ve(e){let n=D(),t=0,i=S("similar.callee-index.doc-frequency",()=>{let o=new Map;for(let g of e)for(let u of g.callees)o.set(u,(o.get(u)??0)+1);return t=o.size,o},()=>({corpusSize:e.length,uniqueCallees:t})),r=Math.max(8,Math.ceil(Math.sqrt(e.length))),s=S("similar.callee-index.idf-weights",()=>H(i,e.length),()=>({corpusSize:e.length,uniqueCallees:i.size})),a=S("similar.callee-index.weighted-magnitudes",()=>e.map(o=>z(o.callees,s)),()=>({corpusSize:e.length})),l=0,c=0,m=0,f=S("similar.callee-index.candidate-buckets",()=>{let o=new Map;for(let g=0;g<e.length;g+=1){let u=e[g];for(let p of u.callees){if((i.get(p)??0)>r){n&&(c+=1);continue}let b=o.get(p);b||(b=[],o.set(p,b)),b.push(g),n&&(l+=1)}}return n&&(m=o.size),o},()=>({corpusSize:e.length,buckets:m,candidateRefs:l,ubiquitousSkips:c,ubiquityThreshold:r})),d=S("similar.callee-index.median-idf",()=>$(s),()=>({uniqueCallees:s.size}));return{corpus:e,candidateIndexesByCallee:f,docFreq:i,idfWeights:s,weightedMagnitudes:a,medianIdf:d,ubiquityThreshold:r}}function De(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let s=n.corpus[r];s.symbol!==e.symbol&&t.set(s.symbol,s)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function ze(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:s}=n,a=D(),l=new T(e),c=0,m=S("similar.callee-fingerprints.candidates",()=>{let u=O(l.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r);return c=u.length,u},()=>({scope:i,scanLimit:r,candidateCount:c})),f=0,d=S("similar.callee-fingerprints.callee-map",()=>{let u=l.calleeMap(m,{semantic:s});if(a)for(let p of u.values())f+=p.length;return u},()=>({candidateCount:c,semantic:s,calleeEdges:f})),o=0,g=0;return S("similar.callee-fingerprints.shape",()=>{let u=m.map(p=>({symbol:p.symbol,file:p.relativePath,callees:ce((d.get(p.symbolId)??[]).map(b=>b.symbol)),paramCount:l.callableSignature(p)?.paramCount??-1})).filter(p=>p.callees.size>=t);return o=u.length,a&&(g=u.reduce((p,b)=>p+b.callees.size,0)),u},()=>({candidateCount:c,fingerprintCount:o,retainedCalleeCount:g,minCallees:t}))}function ce(e){return new Set([...e].filter(n=>!Ee(n)))}function Ee(e){return we.some(n=>e.includes(n))}function re(e,n,t){let i=Be(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,s=[],a=t.candidateMode??"full",l=0,c=0,m=0,f=0;return S("similar.source-shape",()=>{let d=a==="target-pruned"?Ue(e,i,{minSimilarity:r,scanLimit:t.scanLimit}):Ge(i,_e(e,{scanLimit:t.scanLimit}));l=d.length;for(let o of d){if(o.symbol===i.symbol||o.tokens.size<3)continue;c+=1;let g=ne(i.tokens,o.tokens);if(g.size<2){m+=1;continue}let u=new Set([...i.tokens,...o.tokens]),p=u.size>0?g.size/u.size:0;if(p<r){f+=1;continue}s.push({symbolA:i.symbol,shortNameA:L(i.symbol),fileA:i.file,symbolB:o.symbol,shortNameB:L(o.symbol),fileB:o.file,similarity:p,similarityBasis:"source-tokens",sharedCallees:[...g].sort(),uniqueToA:[...A(i.tokens,o.tokens)].sort(),uniqueToB:[...A(o.tokens,i.tokens)].sort(),...ue([...g],"source-tokens")})}return s.sort((o,g)=>g.similarity-o.similarity||o.shortNameB.localeCompare(g.shortNameB)),s.slice(0,t.limit)},()=>({symbol:i.symbol,file:i.file,targetTokens:i.tokens.size,candidateMode:a,candidates:l,comparedPairs:c,sharedSkips:m,similaritySkips:f,results:s.length}))}function ue(e,n){let t=e.flatMap(V),i=e.flatMap(b=>se(b,n)),r=K(t,me),s=K(t,de),a=K(i,Z),l=[...new Set(i.filter(ae))],c=e.filter(b=>{let y=se(b,n);return y.some(C=>Z.has(C))&&y.some(ae)}).length,m=[];r.length>0&&m.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&m.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),a.length>0&&m.push(`domain behavior verbs: ${a.slice(0,5).join(", ")}`),a.length>0&&l.length>0&&m.push(`domain-specific terms: ${l.slice(0,5).join(", ")}`);let f=n==="source-tokens"&&t.length>0&&t.every(b=>fe.has(b));f&&m.push("shared source tokens are generic scaffolding");let d=a.length>0&&l.length>0,o=r.length+s.length>0,g=n==="callees"&&d&&e.length>=4&&l.length>=4&&c>=2,u=g?"domain-behavior":d?o?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||f?"framework-scaffolding":"structural-overlap";u==="structural-overlap"&&e.length>0&&m.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let p=u==="domain-behavior"&&(e.length>=3||g)?"direct":"signal";return{evidenceClass:u,actionTier:p,evidenceClassReasons:m,recommendation:Te(u,p)}}function Te(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function K(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function se(e,n){if(n==="source-tokens")return V(e);let t=G(e);return V(t.length>0?t:Ae(e))}function Ae(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(i=>i.trim()).filter(i=>/[A-Za-z]/.test(i)).at(-1)?.replace(/\.$/,"")??e}function ae(e){return e.length>3&&!Z.has(e)&&!me.has(e)&&!de.has(e)&&!fe.has(e)&&!qe.has(e)}var Z=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),me=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),de=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),fe=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),qe=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function Be(e,n){let t=U(e,n);if(!t||!P(t.symbol))return null;let i=Ne(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function Ne(e,n){let t=G(n.symbol),i=We(e,n.relativePath,n.startLine,n.endLine,t),r=Se(i,t);return r.size>0?r:null}var Pe=E("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Oe=E("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ge(e){return`${e.scanLimit??""}`}function $e(e,n={}){let t=Pe.get(e,()=>new Map),i=ge(n),r=t.get(i);return r||(r=Ze(e,n),t.set(i,r)),r}function _e(e,n={}){let t=Oe.get(e,()=>new Map),i=ge(n),r=t.get(i);return r||(r=je($e(e,n)),t.set(i,r)),r}function je(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>t)continue;let a=i.get(s);a||(a=[],i.set(s,a)),a.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function Ge(e,n){let t=new Map;for(let i of e.tokens)for(let r of n.candidateByToken.get(i)??[])r.symbol!==e.symbol&&t.set(r.symbol,r);return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Ue(e,n,t){let i=D(),r=new T(e),s=He(n.tokens.size,t.minSimilarity),a=0,l=0,c=0,m=S("similar.source-shape.target-files",()=>{let u=[...n.tokens],p=[];for(let b of Y(e,{includeIgnored:!1})){a+=1;let y=_(e,b);y&&(l+=1,Ke(y,u,s)&&p.push(b))}return c=p.length,p},()=>({symbol:n.symbol,targetTokens:n.tokens.size,requiredSharedTokens:s,scannedFiles:a,readableFiles:l,candidateFiles:c})),f=0,d=S("similar.source-shape.target-definitions",()=>{let u=O(r.productionCallableDefinitions({files:m,sortByLocDesc:typeof t.scanLimit=="number"&&t.scanLimit>0}),t.scanLimit);return f=u.length,u},()=>({symbol:n.symbol,candidateFiles:c,scanLimit:t.scanLimit,definitionCount:f})),o=0;return S("similar.source-shape.target-fingerprints",()=>{let u=pe(e,d);return i&&(o=u.length),u},()=>({symbol:n.symbol,definitionCount:f,fingerprintCount:o})).filter(u=>u.symbol!==n.symbol)}function He(e,n){return Math.max(2,Math.ceil(e*n))}function Ke(e,n,t){if(n.length<t)return!1;let i=e.toLowerCase(),r=0;for(let s of n)if(Ve(i,s)&&(r+=1,r>=t))return!0;return!1}function Ve(e,n){return n==="num"?/\b\d+\b/.test(e):e.includes(n)}function Ze(e,n={}){let t=new T(e),{scanLimit:i}=n,r=O(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return pe(e,r)}function pe(e,n){let t=new Map;for(let r of n){let s=t.get(r.relativePath)??[];s.push(r),t.set(r.relativePath,s)}let i=new Map;for(let[r,s]of t){let a=_(e,r);if(!a)continue;let l=X(e,r,a),c=Je(e,r,l),m=!1,f=null;for(let d of s){let o=Xe(d),g=c.get(o),u=g?new Set(g.tokens):null;u||(f??=j(e,r),u=Se(be(f,d.startLine,d.endLine,d.leaf),d.leaf),c.set(o,{key:o,symbol:d.symbol,startLine:d.startLine,endLine:d.endLine,leaf:d.leaf,tokens:[...u].sort()}),m=!0),u.size>0&&i.set(d.symbol,{symbol:d.symbol,file:d.relativePath,tokens:u})}m&&Qe(e,r,l,c)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function We(e,n,t,i,r){let s=j(e,n);return s.length===0?"":be(s,t,i,r)}function be(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
2
- `);let r=[new RegExp(`\\bdef\\s+${q(i)}\\b`),new RegExp(`\\bfun\\s+${q(i)}\\b`),new RegExp(`\\bfn\\s+${q(i)}\\b`),new RegExp(`\\bfunction\\s+${q(i)}\\b`),new RegExp(`\\b${q(i)}\\s*\\(`)],s=e.findIndex(a=>r.some(l=>l.test(a)));if(s>=0){let a=s;for(let l=s+1;l<e.length&&l<=s+8;l++){let c=e[l]??"";if(l>s&&en(c)||(a=l,c.trim()===""&&l>s+1))break}return e.slice(s,a+1).join(`
3
- `)}return e.slice(n,Math.min(e.length,n+8)).join(`
4
- `)}function Xe(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function Je(e,n,t){let i=J(e,"source-fingerprints",n,t);if(!i)return new Map;try{let r=JSON.parse(i);if(!Array.isArray(r.entries))return new Map;let s=new Map;for(let a of r.entries){if(!a||typeof a.key!="string"||typeof a.symbol!="string"||typeof a.startLine!="number"||typeof a.endLine!="number"||typeof a.leaf!="string"||!Array.isArray(a.tokens)||!a.tokens.every(l=>typeof l=="string"))return new Map;s.set(a.key,a)}return s}catch{return new Map}}function Qe(e,n,t,i){let r={entries:[...i.values()].sort((s,a)=>s.key.localeCompare(a.key))};Q(e,"source-fingerprints",n,t,JSON.stringify(r))}function Se(e,n){if(!e)return new Set;let t=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),i=Ye(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(a=>a.trim()).filter(a=>a.length>1).filter(a=>!t.has(a)).filter(a=>!i.has(a));return new Set(s)}function Ye(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function en(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{fn as a,he as b,gn as c,pn as d,xe as e,Re as f,W as g,ve as h,De as i,ce as j,ue as k};
5
- //# sourceMappingURL=chunk-CW5YFOCP.js.map
@@ -1,5 +0,0 @@
1
- import{c as g,e as h}from"./chunk-7S5E7KWT.js";import{readFileSync as w}from"fs";import{join as V}from"path";var j=g("source-text",{clearGroups:["whole-project","source-file"]}),v=g("source-lines",{clearGroups:["whole-project","source-file"]});function l(e,t){let r=t.replace(/\\/g,"/");return j.get(e,r,()=>{let n=V(e.config.projectRoot,r);try{return w(n,"utf-8")}catch(s){if(_(s))return"";throw s}})}function _(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function A(e,t){let r=t.replace(/\\/g,"/");return v.get(e,r,()=>{let n=l(e,r);return n?n.split(`
2
- `):[]})}var N=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar))?\b/i;function R(e){let t=N.exec(e);return t?t[1]??"":null}function X(e,t,r){if(r<=0)return!1;let n=A(e,t);if(n.length===0)return!1;for(let s=r-1;s>=0&&s>=r-5;s-=1){let a=(n[s]??"").trim();if(a!==""){if(R(a)!==null)return!0;if(!a.startsWith("//")&&!a.startsWith("*")&&!a.startsWith("/*")&&!a.startsWith("@")&&!a.startsWith("#"))return!1}}return!1}import{createRequire as P}from"module";var c=P(import.meta.url),p=null,k=!1;function T(){if(k)return null;if(p)return p;try{return p=c("tree-sitter"),p}catch{return k=!0,null}}var C=new Map,m=new Set;function E(e){if(m.has(e))return null;let t=C.get(e);if(t)return t;let r;try{switch(e){case"rust":r=c("tree-sitter-rust");break;case"typescript":r=c("tree-sitter-typescript").typescript;break;case"tsx":r=c("tree-sitter-typescript").tsx;break;case"javascript":r=c("tree-sitter-javascript");break;case"python":r=c("tree-sitter-python");break;case"java":r=c("tree-sitter-java");break;case"kotlin":r=c("tree-sitter-kotlin");break;case"scala":r=c("tree-sitter-scala");break;case"ruby":r=c("tree-sitter-ruby");break;case"c":r=c("tree-sitter-c");break;case"cpp":r=c("tree-sitter-cpp");break;case"csharp":r=c("tree-sitter-c-sharp");break;case"php":r=c("tree-sitter-php").php;break;case"vb":{let n=c("tree-sitter-vb-dotnet");r=n.language??n;break}}}catch{return m.add(e),null}return C.set(e,r),r}var x=new Map;function M(e){let t=x.get(e);if(t)return t;let r=E(e);if(!r)return null;let n=T();if(!n)return null;let s=new n;try{s.setLanguage(r)}catch{return m.add(e),null}return x.set(e,s),s}function Q(e,t){return e.parse(n=>n>=t.length?null:t.slice(n,Math.min(t.length,n+16384)))}function Z(e,t){let r=M(e);if(!r)return null;try{return Q(r,t)}catch{return null}}import{posix as y}from"path";import{parse as U}from"@vue/compiler-sfc";var I=h("vue-sfc-units");function ae(e,t){let r=B(t),n=l(e,r);return I.get(e,r,n,()=>z(e,r,n))}function B(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function D(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function ce(e){return!e||e.body.length===0?0:e.body.split(`
3
- `).length}function z(e,t,r){let n={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!r)return n;let s;try{s=U(r,{filename:t})}catch(i){return n.errors.push(L(i)),n}n.errors.push(...s.errors.map(L));let{descriptor:a}=s;return a.template&&(n.template=f(e,t,"template",a.template)),a.script&&n.scripts.push(b(e,t,a.script,!1)),a.scriptSetup&&n.scripts.push(b(e,t,a.scriptSetup,!0)),n.styles=a.styles.map(i=>f(e,t,"style",i)),n.customBlocks=a.customBlocks.map(i=>f(e,t,"custom",i)),n.errors.push(...[n.template,...n.scripts,...n.styles,...n.customBlocks].flatMap(i=>i?.errors??[])),n}function b(e,t,r,n){let s=f(e,t,"script",r);return{...s,kind:"script",setup:n,astLanguage:D(s.lang)}}function f(e,t,r,n){let s=$(n.attrs),a=typeof s.lang=="string"?s.lang:null,i=typeof s.src=="string"?s.src:typeof n.src=="string"?n.src:void 0;if(i){let o=W(t,i);if(!o)return{kind:r,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:s,lang:a,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${r} block source: ${i}`]};let u=l(e,o),F=u?Math.max(0,u.split(`
4
- `).length-1):0;return{kind:r,ownerPath:t,sourcePath:o,external:!0,src:i,attrs:s,lang:a,body:u,startLine:0,endLine:F,errors:u?[]:[`Vue ${r} block source not found: ${o}`]}}let S=Math.max(0,n.loc.start.line-1);return{kind:r,ownerPath:t,sourcePath:t,external:!1,attrs:s,lang:a,body:n.content,startLine:S,endLine:Math.max(S,n.loc.end.line-1),errors:[]}}function W(e,t){let r=t.split(/[?#]/,1)[0];if(!r||r.startsWith("/")||r.includes("://"))return null;let n=B(y.normalize(y.join(y.dirname(e),r)));return n===".."||n.startsWith("../")?null:n}function $(e){return{...e}}function L(e){return e instanceof Error?e.message:String(e)}function oe(e,t){let r=O(e,t);if(!r)return null;let n=d(r);return n?{calleeLeaf:n,memberAccess:q(r),line:e.startPosition.row}:null}function O(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function q(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function d(e){switch(e.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?d(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?d(t):null}case"super":case"self":case"this":return null;default:return null}}export{l as a,A as b,R as c,X as d,Z as e,ae as f,D as g,ce as h,oe as i,d as j};
5
- //# sourceMappingURL=chunk-DS6QEB3G.js.map
@@ -1,2 +0,0 @@
1
- import{a as g}from"./chunk-PFOCOG57.js";import{a as d}from"./chunk-5OST6GYB.js";import{a as c}from"./chunk-KDFONWTW.js";import{c as p}from"./chunk-JM72FNGA.js";import{a as u}from"./chunk-72KY2ZFO.js";import{a as o}from"./chunk-HF25DFSC.js";function F(r,t={}){let{scope:l,limit:s=30,scanLimit:b}=t,f=new d(r);return g({candidates:()=>f.productionCallableDefinitions({scope:l,files:t.files,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>y(e.relativePath)),scanLimit:b,evaluate:e=>{let n=u(r,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let L=c(r,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||h(L.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function y(r){let t=o(r);return t==="typescript"||t==="tsx"||t==="javascript"}function h(r,t,l){return r?r.some(s=>s>t&&s<=l):!1}export{F as a};
2
- //# sourceMappingURL=chunk-E35O7UCB.js.map
@@ -1,2 +0,0 @@
1
- import{a as g}from"./chunk-JCLDUKT6.js";import{a as u}from"./chunk-TK7O5ER5.js";import{c as i}from"./chunk-JM72FNGA.js";function w(r,b,y,f={}){let s=u(r,b),n=u(r,y);if(!s||!n)return null;let c=new Set(g(r,s,{semantic:f.semantic}).map(e=>e.symbol)),m=new Set(g(r,n,{semantic:f.semantic}).map(e=>e.symbol)),l=[];for(let e of c)m.has(e)&&l.push(e);let o=[];for(let e of c)m.has(e)||o.push(e);let a=[];for(let e of m)c.has(e)||a.push(e);let h=new Set([...c,...m]),d=h.size>0?l.length/h.size:0,t;h.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&a.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":a.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&a.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${o.length+a.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${a.length} in B).`;let p=s.endLine-s.startLine+1,A=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:i(s.symbol),file:s.relativePath,loc:p},symbolB:{symbol:n.symbol,shortName:i(n.symbol),file:n.relativePath,loc:A},similarity:d,sharedCallees:l.map(i),uniqueToA:o.map(i),uniqueToB:a.map(i),consolidationStrategy:t}}export{w as a};
2
- //# sourceMappingURL=chunk-EXDQ35NN.js.map
@@ -1,2 +0,0 @@
1
- import{c as s,d as l}from"./chunk-BZ53S4ZN.js";import{a as u}from"./chunk-3VD3JMK2.js";import{a as p,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{e as c}from"./chunk-HF25DFSC.js";function y(i,t={}){let{minSimilarity:r=.62,minTokens:e=8,limit:a=20,scope:d,scanLimit:g,filePattern:h,focusFiles:k}=t,P=c(i,{scope:d,minJsxTokens:e,scanLimit:g}).filter(n=>n.kind==="component").map(n=>({file:n.file,component:n.name,tokens:n.jsxTokens,profile:n}));return u({profiles:P,limit:a,filePattern:h,focusFiles:k,compare:(n,o)=>B(n,o,r),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.componentA.localeCompare(o.componentA)||n.fileB.localeCompare(o.fileB)||n.componentB.localeCompare(o.componentB)})}function B(i,t,r){let e=p(i.tokens,t.tokens);if(e.size<6||!C(e))return null;let a=f(i.tokens,t.tokens);return a<r?null:{fileA:i.file,componentA:i.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:l(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:l(m(i.tokens,t.tokens)).slice(0,25),uniqueToB:l(m(t.tokens,i.tokens)).slice(0,25),locA:i.profile.loc,locB:t.profile.loc}}function C(i){let t=0,r=0;for(let e of i)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(r+=1);return t>=1||r>=4}export{y as a};
2
- //# sourceMappingURL=chunk-FAYI6KZ5.js.map
@@ -1,2 +0,0 @@
1
- import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-OLTESY4K.js";import{y as d}from"./chunk-OBGRLXWF.js";import{c as h,d as S,g as x}from"./chunk-2KHTSEIL.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as g}from"./chunk-DS6QEB3G.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
2
- //# sourceMappingURL=chunk-FFVIFETB.js.map
@@ -1,2 +0,0 @@
1
- import{c as l}from"./chunk-YZA6PPZL.js";function v(e,t={}){let{minTotalLines:n=800,minTemplateLines:i=300,minScriptLines:a=300,minStyleLines:r=500,limit:o=20,scope:m,scanLimit:p,filePattern:u}=t;return l(e,{scope:m,scanLimit:p}).filter(s=>!u||s.file.includes(u)).map(s=>L(s,{minTotalLines:n,minTemplateLines:i,minScriptLines:a,minStyleLines:r})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(e,t){let n=[];if(e.totalLines>=t.minTotalLines&&n.push(`${e.totalLines} total component line(s)`),e.templateLines>=t.minTemplateLines&&n.push(`${e.templateLines} template line(s)`),e.scriptLines>=t.minScriptLines&&n.push(`${e.scriptLines} script line(s)`),e.styleLines>=t.minStyleLines&&n.push(`${e.styleLines} style line(s)`),n.length===0)return null;let i=b(e),a=g(e,t,i),r=x(e.file),o=V(i,r);return{file:e.file,totalLines:e.totalLines,sfcLines:e.sfcLines,templateLines:e.templateLines,scriptLines:e.scriptLines,styleLines:e.styleLines,externalScriptLines:e.externalScriptLines,externalScriptPaths:e.externalScriptPaths,customBlockLines:e.customBlockLines,dominantPressure:i,pressureKinds:a,contextKind:r,recommendationKind:o,recommendation:d(o,r),reasons:n,loc:e.totalLines}}function b(e){let t=[{axis:"template",lines:e.templateLines},{axis:"script",lines:e.scriptLines-e.externalScriptLines},{axis:"style",lines:e.styleLines},{axis:"external-script",lines:e.externalScriptLines},{axis:"custom-block",lines:e.customBlockLines}];return t.sort((n,i)=>i.lines-n.lines),t[0]?.lines?t[0].axis:"total"}function g(e,t,n){let i=[];return e.totalLines>=t.minTotalLines&&(i.push("total"),n!=="total"&&i.push(n)),e.templateLines>=t.minTemplateLines&&i.push("template"),e.scriptLines>=t.minScriptLines&&i.push("script"),e.styleLines>=t.minStyleLines&&i.push("style"),(e.externalScriptLines>=t.minScriptLines||n==="external-script")&&i.push("external-script"),e.customBlockLines>0&&n==="custom-block"&&i.push("custom-block"),[...new Set(i.length>0?i:[n])]}function x(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(i=>w.has(i))||/(?:view|page|route)\.vue$/i.test(e)||/(?:^|\/)(views|pages|routes)\//i.test(e)?"route-page":"component"}function V(e,t){return e==="style"?"style-decomposition":e==="template"?"template-decomposition":e==="external-script"?"external-script-boundary":e==="custom-block"?"custom-block-review":t==="route-page"?"route-page-decomposition":e==="script"?"script-behavior-extraction":"total-size-review"}function d(e,t){switch(e){case"template-decomposition":return t==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{v as a};
2
- //# sourceMappingURL=chunk-FG4NT6VY.js.map
@@ -1,25 +0,0 @@
1
- import{a as d}from"./chunk-RNM6LMCF.js";import{g as l}from"./chunk-2KHTSEIL.js";import{c as r}from"./chunk-JM72FNGA.js";function b(o,t={}){let{limit:n=30,scope:e}=t,i=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
2
- gs.symbol,
3
- COUNT(*) AS ref_count,
4
- COUNT(DISTINCT ref_d.id) AS file_count,
5
- def_d.relative_path AS defined_in
6
- FROM mentions m
7
- JOIN chunks c ON m.chunk_id = c.id
8
- JOIN documents ref_d ON c.document_id = ref_d.id
9
- JOIN global_symbols gs ON m.symbol_id = gs.id
10
- JOIN (
11
- SELECT m2.symbol_id, c2.document_id
12
- FROM mentions m2
13
- JOIN chunks c2 ON m2.chunk_id = c2.id
14
- WHERE m2.role = 1
15
- GROUP BY m2.symbol_id
16
- ) sym_def ON sym_def.symbol_id = gs.id
17
- JOIN documents def_d ON sym_def.document_id = def_d.id
18
- WHERE m.role != 1
19
- ${o.pathExclusionsFor("def_d")}
20
- ${o.symbolNoiseFor("gs")}
21
- ${i}
22
- GROUP BY gs.id
23
- ORDER BY ref_count DESC
24
- LIMIT ?`,n).filter(s=>!o.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in}));return m.length>0?m:f(o,e,n)}function f(o,t,n){return l(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>u(o,e)).filter(e=>e.refCount>0).sort((e,i)=>i.refCount-e.refCount||i.fileCount-e.fileCount).slice(0,n)}function u(o,t){let n=d(o,t,{limit:500});return{symbol:t.symbol,shortName:r(t.symbol),refCount:n.length,fileCount:new Set(n.map(e=>e.file)).size,definedIn:t.relativePath}}export{b as a};
25
- //# sourceMappingURL=chunk-FXNWFMKW.js.map
@@ -1,4 +0,0 @@
1
- import{a as ce}from"./chunk-E35O7UCB.js";import{a as ae}from"./chunk-5GOLFJEO.js";import{a as S}from"./chunk-B32FX5KB.js";import{a as se}from"./chunk-7IVSJJZU.js";import{a as oe}from"./chunk-AVWPHM2Q.js";import{a as re}from"./chunk-C2QSK7E7.js";import{a as ie,c as ne}from"./chunk-CW5YFOCP.js";import{a as ee}from"./chunk-O6ZH6C6Y.js";import{a as te}from"./chunk-WUCEKFQC.js";import{a as X}from"./chunk-M4COR2H6.js";import{a as U,c as V,d as q,h as L,i as K}from"./chunk-NOJAM5ZV.js";import{a as W,b as A,e as Y}from"./chunk-P4KYUPBD.js";import{a as Q}from"./chunk-6QSOCTZT.js";import{b as Z}from"./chunk-USPV3T5K.js";import{a as E,c as _,d as z,e as O}from"./chunk-65AU3HFZ.js";import{g as H}from"./chunk-BSN22NRK.js";import{a as J}from"./chunk-QYB5P7GL.js";import{a as I}from"./chunk-5OST6GYB.js";import{f as F,g as v}from"./chunk-C5CTSJ6X.js";import{b as P}from"./chunk-TQ5W2H3S.js";import{d as T,e as N,f as M}from"./chunk-JM72FNGA.js";import{createHash as Oe}from"crypto";import{existsSync as me}from"fs";function le(e){let[i,t]=G(e,":"),n=i||"unknown",o=(s={})=>{let r=s.actionTier??Se(n);return{sourceAnalyzer:n,actionTier:r,rootCauseKey:s.rootCauseKey??(t||e),label:s.label??`${n} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??$e(r,n),file:s.file}};if(!t)return o({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(n)){let[s,r]=G(t,":");return o({file:s,relatedFiles:s?[s]:[],rootCauseKey:r?`${s}:${r}`:t,label:`${n} finding`,why:r?[`Baseline subject: ${r}.`]:[]})}if(n==="cycle"){let s=t.split(">").filter(Boolean);return o({relatedFiles:s,rootCauseKey:t,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(n==="similar"){let s=t.split("|").filter(Boolean);return o({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(n==="drift"){let[s,r]=G(t,":"),[l,a]=G(r,":");return o({actionTier:s==="unused-import"?"direct":"signal",file:l,relatedFiles:[...new Set([l,a].filter(Boolean))],rootCauseKey:t,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...a?[`Related dependency: ${a}.`]:[]]})}return o({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function Se(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function $e(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function G(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}import{existsSync as De,readFileSync as fe}from"fs";var w={classifyCitation:we,citationContexts:ke,citationKindLabel:Te,citationRemediation:Fe,referenceTargets:ve};function we(e){let i=e.join(`
2
- `).toLowerCase(),t=[],n=A(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(n.length>0)return t.push(`configuration/example terms near citation: ${n.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:t};let o=A(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return t.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:t};let s=A(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(t.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:t}):(t.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:t})}function ke(e,i,t){let n;try{n=fe(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=t.flatMap(Re),s=[];for(let r=0;r<n.length;r+=1){let l=n[r]??"";o.some(a=>l.includes(a))&&s.push(W(n,r))}return s}function Re(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((t,n,o)=>t.length>0&&o.indexOf(t)===n)}function Te(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function Fe(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function ve(e,i,t){let n=U(t),o=new Set;for(let s of i)xe(e,s,n.get(s)??[])&&o.add(s);return o}function xe(e,i,t){if(t.length===0)return!1;if(!Ae.test(i))return!0;let n=`${e.config.projectRoot}/${i}`;if(!De(n))return!0;let o=fe(n,"utf-8").split(/\r?\n/),s=Ge(o);for(let r of t)for(let l=r.startLine;l<=r.endLine;l+=1)if((o[l]??"").trim()!==""&&!s.has(l))return!0;return!1}var Ae=/\.(?:[cm]?[jt]sx?)$/i;function Ge(e){let i=new Set,t=!1;for(let n=0;n<e.length;n+=1){let o=e[n].trim();!t&&je(o)&&(t=!0),t&&(i.add(n),o.endsWith(";")&&(t=!1))}return i}function je(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}import{existsSync as Be,readFileSync as Ee,writeFileSync as Le}from"fs";import{isAbsolute as Ke,join as Ne}from"path";var Me=75e3,Pe=5e3,Ie=2500;function He(e){let i=re(e);return i.symbols>=Me||i.documents>=Pe?Ie:void 0}var _e=".scipquery-baseline.json";function j(e,i){return i&&Ke(i)?i:Ne(e.config.projectRoot,i??_e)}function de(e,i={}){let{scope:t}=i,n=He(e),o=[],s=Z(e,{scope:t,...S.dead,scanLimit:n});for(let r of s.symbols)F(e,r.relativePath)||v(e,r.symbol,r.relativePath)||r.kind==="dead-code"&&o.push(`dead:${r.relativePath}:${r.shortName}`);for(let r of ee(e,{scope:t,...S.isolated,scanLimit:n}))F(e,r.relativePath)||v(e,r.symbol,r.relativePath)||o.push(`isolated:${r.relativePath}:${r.shortName}`);for(let r of J(e,{scope:t}))r.kind==="real"&&o.push(`cycle:${ze(r.path)}`);for(let r of ne(e,{scope:t,...S.similar,scanLimit:n}))o.push(`similar:${[r.symbolA,r.symbolB].sort().join("|")}`);for(let r of X(e,{scope:t,...S.extract,scanLimit:n}))o.push(`extract:${r.relativePath}:${r.shortName}`);for(let r of se(e,{scope:t,...S.wrappers,scanLimit:n}))o.push(`wrapper:${r.file}:${r.shortName}`);for(let r of te(e,{scope:t,...S.passthroughs,scanLimit:n}))o.push(`passthrough:${r.file}:${r.shortName}`);for(let r of oe(e,{scope:t,...S.stale,scanLimit:n}))o.push(`stale:${r.file}:${r.shortName}`);for(let r of Q(e,{scope:t,...S.drift,includePatternDeviations:!1}).results)o.push(`drift:${r.kind}:${r.file}:${r.dep}`);return[...new Set(o)].sort()}function ze(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function Pt(e,i={}){let t=de(e,{scope:i.scope}),n=j(e,i.path);return Le(n,JSON.stringify({version:1,findings:t},null,2)+`
3
- `),{path:n,findingCount:t.length}}function ue(e,i={}){let t=j(e,i.path);if(!Be(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let n=JSON.parse(Ee(t,"utf-8")),o=new Set(n.findings??[]),s=de(e,{scope:i.scope}),r=new Set(s);return{baselinePath:t,baselineCount:o.size,current:s,newFindings:s.filter(l=>!o.has(l)),fixedFindings:[...o].filter(l=>!r.has(l))}}var ni=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function oi(e,i={}){let t=i.base??"HEAD",{minTogether:n=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:r=Number.POSITIVE_INFINITY,minSimilarity:l=.8,includeBaseline:a=!1,scanLimit:c}=i,y=i.semantic!==!1,h=new Set(i.skip??[]),f=q(e,{base:t}),p=V(e,{base:t,plan:f}),m=p.changedFiles,d=new Set(m),u=new Set(f.changedFileLines),b=new Set([...d,...u]),C=L(e.config.projectRoot,t,K(f,m)),R=mt(e.config.projectRoot,t,f,C),g={base:t,changedFiles:m,changedSymbols:p.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:p.summary.note};if(m.length===0)return g;let $=(x,pe)=>{if(h.has(x)){g.skipped.push({check:x,reason:"skipped via --skip"});return}let ye=g.findings.length,be=g.skipped.length,Ce=g.checksRun.length;P(`diff-gate.check.${x}`,pe,()=>({check:x,changedFiles:m.length,changedSymbols:p.changedSymbols.length,findingsAdded:g.findings.length-ye,skippedAdded:g.skipped.length-be,checksRunAdded:g.checksRun.length-Ce}))};return $("echo",()=>Je(e,p.changedSymbols,d,R,s,l,c,y,g)),$("incomplete-migration",()=>rt(e,t,f,r,c,y,C,g)),$("co-change-partner",()=>st(e,b,n,o,g)),$("doc-reference",()=>dt(e,d,u,f.changedRanges,g)),$("unused-params",()=>ut(e,m,g)),$("new-dead",()=>ht(e,p.changedSymbols,R,g)),a&&$("baseline",()=>bt(e,g)),We(g,e.config.suppressions??[]),g.rootCauseGroups=Ue(g.findings),g}function Ue(e){let i=new Map;for(let t of e){let n=t.groupKey??`${t.check}:${t.id}`,o=i.get(n);o||(o={groupKey:n,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(n,o)),o.count+=1,o.findingIds.push(t.id),o.severity=Ve(o.severity,t.severity),o.actionTier=qe(o.actionTier,t.actionTier),t.file&&o.files.add(t.file);for(let s of t.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,n)=>n.count-t.count||B(n.severity)-B(t.severity)||t.groupKey.localeCompare(n.groupKey))}function Ve(e,i){return B(i)>B(e)?i:e}function B(e){return e==="error"?2:e==="warning"?1:0}function qe(e,i){return e?i&&he(i)>he(e)?i:e:i}function he(e){return e==="direct"?2:e==="signal"?1:0}function We(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let n of e.findings){let o=i.find(s=>Ye(s,n));o?e.suppressed.push({finding:n,suppression:o}):t.push(n)}e.findings=t}function Ye(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function k(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function Je(e,i,t,n,o,s,r,l,a){a.checksRun.push("echo");for(let c of i.slice(0,o)){if(!M(c.symbol)||n(c))continue;let y=ie(e,c.symbol,{minSimilarity:s,limit:5,scanLimit:r,semantic:l,sourceCandidateMode:"target-pruned"}),h=[];for(let d of y){let u=d.fileA===c.file?d.fileB:d.fileA,b=d.fileA===c.file?d.shortNameB:d.shortNameA,C=d.fileA===c.file?d.symbolB:d.symbolA;t.has(u)||h.push({otherFile:u,otherShort:b,otherSymbol:C,similarity:d.similarity,similarityBasis:d.similarityBasis??"callees",sharedEvidence:d.sharedCallees})}if(h.length===0)continue;let f=h[0],p=D("echo",c.symbol,c.file,...h.map(d=>`${d.otherSymbol}|${d.otherFile}`).sort()),m=Ze(c,h);k(a,{id:p,groupKey:p,actionTier:m,check:"echo",severity:"warning",evidence:"heuristic",confidence:f.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(h.map(d=>d.otherFile))].sort(),message:it(c,h),why:nt(c,h),remediation:ot(m,c.shortName,f.otherShort)})}i.length>o&&a.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function Ze(e,i){return i.some(n=>Qe(e.symbol,n))?"direct":"signal"}function Qe(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=T(e),n=T(i.otherSymbol);return!t||!n?!1:t===n?!0:tt(i.sharedEvidence)?!1:Xe(t,n)}function Xe(e,i){let t=ge(e),n=ge(i);if(t.length===0||n.length===0)return!1;let o=new Set(n),s=t.filter(r=>o.has(r)).length;return s>=2&&s/Math.min(t.length,n.length)>=.5}function ge(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var et=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function tt(e){return e.length>=3&&e.every(i=>et.has(i.toLowerCase()))}function it(e,i){let t=i[0],n=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${n}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${n}% similar to ${t.otherShort} (${t.otherFile})`}function nt(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let n of i.slice(0,3))t.push(`${n.otherShort} is outside this diff and scored ${Math.round(n.similarity*100)}% similar by ${n.similarityBasis} evidence.`),t.push(`Shared evidence: ${n.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function ot(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function rt(e,i,t,n,o,s,r,l){let a=ae(e,{base:i,maxHelpers:n,diffPlan:t,scanLimit:o,semantic:s,baseContentAt:r});if(!a.available){l.skipped.push({check:"incomplete-migration",reason:"no git history"});return}l.checksRun.push("incomplete-migration"),a.note&&l.skipped.push({check:"incomplete-migration",reason:a.note});for(let c of a.findings){let y=c.leftovers.map(u=>`${u.shortName} (${u.file}, ${Math.round(u.containment*100)}% helper / ${Math.round(u.siteCoverage*100)}% site, ${u.migrationScope})`).join(", "),h=c.leftovers.map(u=>`${u.shortName}: ${u.migrationScope} (${u.migrationScopeReasons[0]})`).join("; "),f=[...c.migratedFiles,...c.leftovers.map(u=>u.file)],p=c.leftovers.length===0?void 0:Math.max(...c.leftovers.map(u=>Math.min(u.containment,u.siteCoverage))),m=c.leftovers.some(u=>u.migrationScope==="possible-subtype"),d=D("incomplete-migration",c.helperSymbol,c.helperFile,f.join("|"));k(l,{id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:p,file:c.helperFile,symbol:c.helperSymbol,relatedFiles:f,message:`new helper ${c.helperShortName} (${c.helperFile}) is wired into ${c.migratedFiles.length} file(s), but ${c.leftovers.length} similar un-migrated site(s) remain: ${y}`,why:[`${c.helperShortName} is new in this diff and already referenced by ${c.migratedFiles.join(", ")}.`,`Helper shape: ${c.helperShape}; ${c.specificHelperCalleeCount}/${c.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${y}.`,`Migration scope hints: ${h}.`],remediation:m?`Migrate same-scope sites to ${c.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${c.helperShortName}, or confirm they are intentionally different.`})}}function st(e,i,t,n,o){let s=H(e,i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let r=new Set,l;for(let a of s){let c=i.has(a.fileA),y=i.has(a.fileB);if(c===y)continue;let h=c?a.fileA:a.fileB,f=c?a.fileB:a.fileA,p=c?a.changesA:a.changesB,m=p>0?a.together/p:0;if(m<n||E(f)||E(h)||!me(`${e.config.projectRoot}/${f}`))continue;let d=`${h}|${f}`;if(r.has(d))continue;r.add(d);let u=D("co-change-partner",h,f,String(a.together)),b=_(h,f),C=z({fileA:h,fileB:f,together:a.together,confidence:m,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,(l??=O(e))(h,f)),R=[h,f].sort().join("|");o.findings.push({id:u,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${R}`,confidence:m,file:h,relatedFiles:[f],sourceAnalyzer:"co-change",rootCauseKey:R,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${h} changed, but ${f} did not \u2014 they change together ${a.together}x (${Math.round(m*100)}% of the time)`,why:[`${h} is in this diff and ${f} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(m*100)}% of changes to the edited side.`,`History context: ${at(a)}.`,`Subject context: ${ct(a.subjectContext)}.`,...lt(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:C?`Update ${f} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${f} alongside this change, or confirm the coupling no longer holds.`})}}function at(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${ft(e.lastTogetherAt)}`}function ct(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",n=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${n}; external issue/PR labels ${e.externalIssueLabelStatus}`}function lt(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function ft(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function dt(e,i,t,n,o){o.checksRun.push("doc-reference");let s=w.referenceTargets(e,i,n);if(s.size!==0)for(let r of Y(e,s)){if(t.has(r.doc))continue;let l=r.citedClaims.length>0?r.citedClaims:w.citationContexts(e,r.doc,r.cited),a=w.classifyCitation(l),c=D("doc-reference",r.doc,r.cited.join("|"));k(o,{id:c,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:r.doc,relatedFiles:r.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:l,message:`${r.doc} cites ${r.cited.join(", ")} as ${w.citationKindLabel(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${r.cited.join(", ")} changed in this diff.`,`${r.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(y=>`Citation kind evidence: ${y}`)],remediation:w.citationRemediation(a.citationKind,r.doc)})}}function ut(e,i,t){t.checksRun.push("unused-params");for(let n of ce(e,{files:i,limit:50})){let o=D("unused-params",n.symbol,n.file,n.unusedTrailing.join("|"));k(t,{id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:n.file,startLine:n.startLine,endLine:n.endLine,symbol:n.symbol,message:`${n.shortName} (${n.file}) has trailing unused parameter(s): ${n.unusedTrailing.join(", ")}`,why:[`${n.shortName} is in a changed file.`,`The trailing parameter(s) ${n.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function ht(e,i,t,n){n.checksRun.push("new-dead");let o=new I(e);for(let s of i){if(t(s)||s.fanIn>0||o.fileKind(s.file)==="test"||F(e,s.file)||v(e,s.symbol,s.file)||gt(s.symbol))continue;let r=D("new-dead",s.symbol,s.file);k(n,{id:r,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code."})}}function gt(e){if(N(e)!=="type")return!1;let i=T(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function mt(e,i,t,n){let o=new Map(t.renamedFiles.map(r=>[r.to,r.from])),s=n??L(e,i,K(t));return r=>{let l=o.get(r.file)??r.file,a=T(r.symbol);if(!a)return!1;let c=s(l);return c!==null&&pt(c,a)}}function pt(e,i){return new RegExp(`\\b${yt(i)}\\b`).test(e)}function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bt(e,i){if(!me(j(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=ue(e);for(let n of t.newFindings){let o=le(n),s=D("baseline",n);k(i,{id:s,groupKey:`baseline:${o.sourceAnalyzer}:${o.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:o.actionTier,confidence:1,file:o.file,relatedFiles:o.relatedFiles.length>0?o.relatedFiles:void 0,sourceAnalyzer:o.sourceAnalyzer,rootCauseKey:o.rootCauseKey,message:`new ${o.label} vs committed baseline: ${n}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${o.sourceAnalyzer}.`,`Inherited action tier: ${o.actionTier}.`,`Root cause key: ${o.rootCauseKey}.`,...o.why],remediation:o.remediation})}}function D(e,...i){return`SQ${Oe("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{de as a,Pt as b,ue as c,ni as d,oi as e,mt as f};
4
- //# sourceMappingURL=chunk-G5UPYQGL.js.map
@@ -1,2 +0,0 @@
1
- import{a as b}from"./chunk-PFOCOG57.js";import{a as u}from"./chunk-5OST6GYB.js";import{c as p}from"./chunk-JM72FNGA.js";function C(e,r){let{scope:c,minLoc:l=10,limit:s=30,scanLimit:a}=r??{},o=new u(e);return b({candidates:()=>o.productionCallableDefinitions({scope:c,minLoc:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,prepare:t=>({callerMap:o.crossFileCallerMap(t,{semantic:r?.semantic!==!1}),calleeMap:o.calleeMap(t,{semantic:r?.semantic!==!1})}),evaluate:(t,n)=>d(t,n,l),orderResults:(t,n)=>n.score-t.score||n.loc-t.loc,limit:s})}function d(e,r,c){let l=e.endLine-e.startLine+1;if(l<c)return null;let s=r.callerMap.get(e.symbolId)?.size??0,a=r.calleeMap.get(e.symbolId)??[],o=new Set,t=new Set;for(let m of a){let i=`${m.symbol}|${m.file}`;o.add(i),m.file!==e.relativePath&&t.add(i)}let n=t.size,y=o.size;return{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:l,fanIn:s,fanOut:n,calleeCount:y,score:Math.round(l/50*(s/5)*Math.max(n/5,1)*100)/100}}export{C as a};
2
- //# sourceMappingURL=chunk-GQBMH2TQ.js.map
@@ -1,2 +0,0 @@
1
- import{a as F}from"./chunk-P5RYBRIO.js";import{d as x}from"./chunk-JM72FNGA.js";import{a as v,d as S}from"./chunk-HF25DFSC.js";import{a as L,b as y}from"./chunk-DS6QEB3G.js";import{b as m,d as g,e as d}from"./chunk-XUGQU7PM.js";import{c as p}from"./chunk-7S5E7KWT.js";var C=p("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function k(t,e,r){return t.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function z(t,e,r){let n=[],i=0,s=0,c=x(e.symbol);for(let a of r)_(t,a,e.relativePath,c)?i++:h(t,a,c)?s++:n.push(a);return{realConsumers:n,barrelConsumers:i,importOnlyConsumers:s}}function h(t,e,r){if(!r)return!1;let n=v(e);if(!n)return!1;let i=C.get(t,e,()=>b(t,e,n));return i.importedLeaves.has(r)&&!i.usedLeaves.has(r)}function b(t,e,r){let n=L(t,e);if(!n)return U();let i=m(t,e,n),s=g(t,"consumer-file-usage",e,i);if(s){let a=E(s);if(a)return a}let c=w(t,e,r);return d(t,"consumer-file-usage",e,i,D(c)),c}function w(t,e,r){let n=new Set,i=new Set,s=S(t,e);if(!s)return{importedLeaves:n,usedLeaves:i};let c=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let u=f||c.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(u?n.add(o.text):i.add(o.text));for(let l of o.children)a(l,u)};return a(s.rootNode,!1),{importedLeaves:n,usedLeaves:i}}function U(){return{importedLeaves:new Set,usedLeaves:new Set}}function D(t){return JSON.stringify({importedLeaves:[...t.importedLeaves],usedLeaves:[...t.usedLeaves]})}function E(t){try{let e=JSON.parse(t);return!Array.isArray(e.importedLeaves)||!Array.isArray(e.usedLeaves)?null:{importedLeaves:new Set(e.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(e.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function _(t,e,r,n){if(!n)return!1;let i=y(t,e);if(i.length===0)return!1;let s=F(t,e);if(s.length===0)return!1;let c=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${c}\\b`),o=0;for(let f=0;f<i.length;f++){if(!a.test(i[f]??""))continue;if(o++,!s.find(l=>l.startLine<=f&&f<=l.endLine))return!1}return o>0}export{k as a,z as b,h as c};
2
- //# sourceMappingURL=chunk-GRJY65YT.js.map