scip-query 0.10.0 → 0.10.1

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 (263) hide show
  1. package/README.md +115 -58
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-23FVN4Y5.js +2 -0
  4. package/dist/chunk-24PFLKFK.js +2 -0
  5. package/dist/{chunk-A2VTV2QB.js → chunk-27KPKLRJ.js} +2 -2
  6. package/dist/chunk-2NLK4INB.js +2 -0
  7. package/dist/{chunk-6K2JQ2VI.js → chunk-2XKAMW6B.js} +2 -2
  8. package/dist/{chunk-4DAPXOWD.js → chunk-332L7SRO.js} +2 -2
  9. package/dist/chunk-44JOJLMO.js +38 -0
  10. package/dist/{chunk-MCW36F2D.js → chunk-4EAANIWC.js} +2 -2
  11. package/dist/{chunk-FVIKFWUL.js → chunk-4N7LFYSD.js} +2 -2
  12. package/dist/{chunk-4MHT7LKP.js → chunk-5ALI77D7.js} +2 -2
  13. package/dist/{chunk-V76FCF5F.js → chunk-5BZOSICN.js} +2 -2
  14. package/dist/{chunk-IVAIPXNO.js → chunk-5D3BT4B4.js} +2 -2
  15. package/dist/{chunk-ADRYSISR.js → chunk-5HDYAOSF.js} +2 -2
  16. package/dist/{chunk-IC3RC3KJ.js → chunk-5IDEQEM4.js} +2 -2
  17. package/dist/{chunk-NC4IUW25.js → chunk-5VB3WU7K.js} +2 -2
  18. package/dist/chunk-623UQCVG.js +2 -0
  19. package/dist/chunk-62NMBOA5.js +2 -0
  20. package/dist/chunk-64LH2QUP.js +62 -0
  21. package/dist/{chunk-PG3ZI5IH.js → chunk-65UWNXEH.js} +1 -1
  22. package/dist/{chunk-OLCKSG3Y.js → chunk-6TWFT4Y5.js} +2 -2
  23. package/dist/chunk-6U4EODW3.js +2 -0
  24. package/dist/{chunk-MN75T4UB.js → chunk-6YKJSETN.js} +2 -2
  25. package/dist/chunk-A2GVUCZR.js +8 -0
  26. package/dist/{chunk-WEJYUS5O.js → chunk-ADKQX2OY.js} +2 -2
  27. package/dist/{chunk-YWZBKYLS.js → chunk-ADTG377O.js} +2 -2
  28. package/dist/chunk-ATGRITZP.js +20 -0
  29. package/dist/chunk-B3HMRQDA.js +2 -0
  30. package/dist/chunk-B75HZHUP.js +2 -0
  31. package/dist/chunk-BGBBVSH4.js +2 -0
  32. package/dist/chunk-BJ7OHKB5.js +2 -0
  33. package/dist/{chunk-VZRILF2Z.js → chunk-CCB45WDY.js} +2 -2
  34. package/dist/chunk-CFLYMEUS.js +2 -0
  35. package/dist/{chunk-ISCKLDSS.js → chunk-CMGOXDVP.js} +3 -3
  36. package/dist/chunk-DBIG4QAJ.js +2 -0
  37. package/dist/{chunk-4JQFTUKD.js → chunk-DMLPJ75B.js} +2 -2
  38. package/dist/chunk-DRU74YUM.js +71 -0
  39. package/dist/chunk-DTERBKUE.js +7 -0
  40. package/dist/{chunk-4HTJZC6G.js → chunk-E55WCTLH.js} +2 -2
  41. package/dist/{chunk-CMXFASVD.js → chunk-F4PKYBQB.js} +2 -2
  42. package/dist/{chunk-L2KFPRMA.js → chunk-FVX4GEAC.js} +2 -2
  43. package/dist/{chunk-AP5GTKSG.js → chunk-GTNPPGZJ.js} +2 -2
  44. package/dist/{chunk-ZZ2W5P3D.js → chunk-GZXXBDJA.js} +2 -2
  45. package/dist/chunk-HCQ7J2N5.js +3 -0
  46. package/dist/chunk-HQHFMPLJ.js +2 -0
  47. package/dist/{chunk-SCEMECW7.js → chunk-I6PTB2CM.js} +2 -2
  48. package/dist/{chunk-772YYL6I.js → chunk-IJYWCB57.js} +2 -2
  49. package/dist/chunk-JTRY2YRJ.js +2 -0
  50. package/dist/chunk-L77GXANO.js +6 -0
  51. package/dist/{chunk-R6XDPWJA.js → chunk-LT6GJ27X.js} +2 -2
  52. package/dist/chunk-LUBKUISI.js +2 -0
  53. package/dist/{chunk-ZGIK464P.js → chunk-LVYXX7ZW.js} +2 -2
  54. package/dist/{chunk-2WEH5QHC.js → chunk-LWPEZ4FP.js} +2 -2
  55. package/dist/chunk-LWWZBABT.js +2 -0
  56. package/dist/chunk-LXM7AHQG.js +4 -0
  57. package/dist/chunk-LY6NRJPJ.js +2 -0
  58. package/dist/chunk-LYS4SMAQ.js +2 -0
  59. package/dist/{chunk-BNW3Q24R.js → chunk-MESUJJVQ.js} +2 -2
  60. package/dist/{chunk-Y5H7TBVE.js → chunk-MHAQXOZY.js} +2 -2
  61. package/dist/chunk-N2T2GPYQ.js +2 -0
  62. package/dist/chunk-OB6PEVI3.js +2 -0
  63. package/dist/chunk-PNN3D4BE.js +2 -0
  64. package/dist/{chunk-QJWN6LA5.js → chunk-PV4CEDIL.js} +2 -2
  65. package/dist/chunk-QH5GTVVB.js +3 -0
  66. package/dist/{chunk-ZOT3WUZW.js → chunk-QOFKVNFE.js} +2 -2
  67. package/dist/chunk-QUKZ77A6.js +4 -0
  68. package/dist/chunk-R42LZMLX.js +2 -0
  69. package/dist/{chunk-2BMFRBV6.js → chunk-R7S3UCDR.js} +2 -2
  70. package/dist/chunk-RGDUIMNE.js +3 -0
  71. package/dist/{chunk-BGRPMGTD.js → chunk-RNLUCQJB.js} +2 -2
  72. package/dist/chunk-RYBMW2EN.js +2 -0
  73. package/dist/{chunk-VGBSY6N7.js → chunk-SA6B3EGD.js} +2 -2
  74. package/dist/chunk-T67R7V5I.js +2 -0
  75. package/dist/chunk-TMS4JPWY.js +3 -0
  76. package/dist/chunk-TTGWDUJ4.js +5 -0
  77. package/dist/chunk-TUAPDKBI.js +2 -0
  78. package/dist/chunk-UVK3SL4Z.js +2 -0
  79. package/dist/chunk-W3PQRAI4.js +2 -0
  80. package/dist/{chunk-PRVDXGSK.js → chunk-WWFBDM5Y.js} +2 -2
  81. package/dist/{chunk-AQYBOORI.js → chunk-WZVTADY7.js} +1 -1
  82. package/dist/chunk-XGGTESMN.js +2 -0
  83. package/dist/{chunk-NGI4V4AB.js → chunk-Y33GRQK6.js} +2 -2
  84. package/dist/{chunk-QKO474FG.js → chunk-YIE5FZAF.js} +2 -2
  85. package/dist/chunk-YISMWW66.js +7 -0
  86. package/dist/chunk-YVQUQIBM.js +5 -0
  87. package/dist/{chunk-6DEX3XP6.js → chunk-YYCQQBMG.js} +2 -2
  88. package/dist/cli.js +221 -233
  89. package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bok4jrO3.d.ts} +29 -1
  90. package/dist/{db-DdTPetj5.d.ts → db-BkFlkzI3.d.ts} +1 -1
  91. package/dist/{health-C6r2VgpA.d.ts → health-CbGMdRPg.d.ts} +42 -3
  92. package/dist/index.d.ts +7 -6
  93. package/dist/index.js +1 -1
  94. package/dist/postinstall.js +2 -2
  95. package/dist/queries/affected.d.ts +2 -2
  96. package/dist/queries/affected.js +1 -1
  97. package/dist/queries/bottlenecks.d.ts +2 -2
  98. package/dist/queries/bottlenecks.js +1 -1
  99. package/dist/queries/by-kind.d.ts +2 -2
  100. package/dist/queries/by-kind.js +1 -1
  101. package/dist/queries/call-graph.d.ts +2 -2
  102. package/dist/queries/call-graph.js +1 -1
  103. package/dist/queries/change-surface.d.ts +2 -2
  104. package/dist/queries/change-surface.js +1 -1
  105. package/dist/queries/cleanup-plan.d.ts +2 -2
  106. package/dist/queries/cleanup-plan.js +1 -1
  107. package/dist/queries/co-change.d.ts +5 -4
  108. package/dist/queries/co-change.js +1 -1
  109. package/dist/queries/code.d.ts +2 -2
  110. package/dist/queries/code.js +1 -1
  111. package/dist/queries/complexity-hotspots.d.ts +2 -2
  112. package/dist/queries/complexity-hotspots.js +1 -1
  113. package/dist/queries/complexity.d.ts +2 -2
  114. package/dist/queries/complexity.js +1 -1
  115. package/dist/queries/convergence.d.ts +2 -2
  116. package/dist/queries/convergence.js +1 -1
  117. package/dist/queries/coupling.d.ts +2 -2
  118. package/dist/queries/coupling.js +1 -1
  119. package/dist/queries/cycles.d.ts +2 -2
  120. package/dist/queries/cycles.js +1 -1
  121. package/dist/queries/dataflow.d.ts +2 -2
  122. package/dist/queries/dataflow.js +1 -1
  123. package/dist/queries/dead.d.ts +2 -2
  124. package/dist/queries/dead.js +1 -1
  125. package/dist/queries/deep-chains.d.ts +2 -2
  126. package/dist/queries/deep-chains.js +1 -1
  127. package/dist/queries/deps.d.ts +2 -2
  128. package/dist/queries/deps.js +1 -1
  129. package/dist/queries/diff-gate.d.ts +21 -3
  130. package/dist/queries/diff-gate.js +1 -1
  131. package/dist/queries/diff-impact.d.ts +20 -4
  132. package/dist/queries/diff-impact.js +1 -1
  133. package/dist/queries/doc-drift.d.ts +2 -2
  134. package/dist/queries/doc-drift.js +1 -1
  135. package/dist/queries/drift.d.ts +2 -2
  136. package/dist/queries/drift.js +1 -1
  137. package/dist/queries/extract-candidates.d.ts +2 -2
  138. package/dist/queries/extract-candidates.js +1 -1
  139. package/dist/queries/fan.d.ts +2 -2
  140. package/dist/queries/fan.js +1 -1
  141. package/dist/queries/files.d.ts +2 -2
  142. package/dist/queries/files.js +1 -1
  143. package/dist/queries/health.d.ts +3 -3
  144. package/dist/queries/health.js +1 -1
  145. package/dist/queries/hierarchy.d.ts +2 -2
  146. package/dist/queries/hierarchy.js +1 -1
  147. package/dist/queries/hotspots.d.ts +2 -2
  148. package/dist/queries/hotspots.js +1 -1
  149. package/dist/queries/imports.d.ts +2 -2
  150. package/dist/queries/imports.js +1 -1
  151. package/dist/queries/incomplete-migration.d.ts +4 -2
  152. package/dist/queries/incomplete-migration.js +1 -1
  153. package/dist/queries/index.d.ts +10 -4
  154. package/dist/queries/index.js +1 -1
  155. package/dist/queries/isolated.d.ts +2 -2
  156. package/dist/queries/isolated.js +1 -1
  157. package/dist/queries/members.d.ts +2 -2
  158. package/dist/queries/members.js +1 -1
  159. package/dist/queries/methods.d.ts +2 -2
  160. package/dist/queries/methods.js +1 -1
  161. package/dist/queries/outline.d.ts +2 -2
  162. package/dist/queries/outline.js +1 -1
  163. package/dist/queries/passthrough-candidates.d.ts +2 -2
  164. package/dist/queries/passthrough-candidates.js +1 -1
  165. package/dist/queries/plan-context.d.ts +2 -2
  166. package/dist/queries/plan-context.js +1 -1
  167. package/dist/queries/react-component-duplicates.d.ts +31 -0
  168. package/dist/queries/react-component-duplicates.js +2 -0
  169. package/dist/queries/react-hook-candidates.d.ts +34 -0
  170. package/dist/queries/react-hook-candidates.js +2 -0
  171. package/dist/queries/react-large-component-pressure.d.ts +28 -0
  172. package/dist/queries/react-large-component-pressure.js +2 -0
  173. package/dist/queries/recent-duplicates.d.ts +10 -3
  174. package/dist/queries/recent-duplicates.js +1 -1
  175. package/dist/queries/redundant-reexports.d.ts +2 -2
  176. package/dist/queries/redundant-reexports.js +1 -1
  177. package/dist/queries/refs.d.ts +2 -2
  178. package/dist/queries/refs.js +1 -1
  179. package/dist/queries/self-audit.d.ts +2 -2
  180. package/dist/queries/self-audit.js +1 -1
  181. package/dist/queries/similar-chains.d.ts +2 -2
  182. package/dist/queries/similar-chains.js +1 -1
  183. package/dist/queries/similar-files.d.ts +2 -2
  184. package/dist/queries/similar-files.js +1 -1
  185. package/dist/queries/similar-signatures.d.ts +2 -2
  186. package/dist/queries/similar-signatures.js +1 -1
  187. package/dist/queries/similar.d.ts +8 -3
  188. package/dist/queries/similar.js +1 -1
  189. package/dist/queries/slice.d.ts +2 -2
  190. package/dist/queries/slice.js +1 -1
  191. package/dist/queries/stale-abstractions.d.ts +2 -2
  192. package/dist/queries/stale-abstractions.js +1 -1
  193. package/dist/queries/stats.d.ts +2 -2
  194. package/dist/queries/stats.js +1 -1
  195. package/dist/queries/surface.d.ts +2 -2
  196. package/dist/queries/surface.js +1 -1
  197. package/dist/queries/symbols.d.ts +2 -2
  198. package/dist/queries/symbols.js +1 -1
  199. package/dist/queries/system.d.ts +2 -2
  200. package/dist/queries/system.js +1 -1
  201. package/dist/queries/trace.d.ts +2 -2
  202. package/dist/queries/trace.js +1 -1
  203. package/dist/queries/unused-params.d.ts +2 -2
  204. package/dist/queries/unused-params.js +1 -1
  205. package/dist/queries/vue-component-duplicates.d.ts +35 -0
  206. package/dist/queries/vue-component-duplicates.js +2 -0
  207. package/dist/queries/vue-composable-candidates.d.ts +34 -0
  208. package/dist/queries/vue-composable-candidates.js +2 -0
  209. package/dist/queries/vue-large-view-pressure.d.ts +31 -0
  210. package/dist/queries/vue-large-view-pressure.js +2 -0
  211. package/dist/queries/wrapper-candidates.d.ts +2 -2
  212. package/dist/queries/wrapper-candidates.js +1 -1
  213. package/dist/reindex-worker.js +10 -10
  214. package/dist/reindex.d.ts +1 -1
  215. package/dist/reindex.js +22 -22
  216. package/dist/runtime.d.ts +1 -1
  217. package/dist/runtime.js +2 -2
  218. package/docs/AGENT_GUIDE.md +353 -0
  219. package/docs/AI_FAILURE_MODES.md +278 -0
  220. package/docs/API.md +40 -0
  221. package/docs/COMMAND_REFERENCE.md +130 -0
  222. package/docs/DETECTOR_GUIDE.md +119 -0
  223. package/docs/accuracy-hardening-goal.md +54 -0
  224. package/docs/assets/scip-query-logo-dark.svg +21 -0
  225. package/docs/assets/scip-query-logo.svg +24 -0
  226. package/package.json +31 -3
  227. package/skills/scip-maintainability/SKILL.md +24 -3
  228. package/skills/scip-query/SKILL.md +2 -1
  229. package/skills/scip-react-maintainability/SKILL.md +114 -0
  230. package/skills/scip-vue-maintainability/SKILL.md +130 -0
  231. package/dist/chunk-5OHZEO3U.js +0 -3
  232. package/dist/chunk-5QJIEYFB.js +0 -34
  233. package/dist/chunk-6IGXZZQ4.js +0 -4
  234. package/dist/chunk-6QVCPUK6.js +0 -2
  235. package/dist/chunk-6VL4AIEO.js +0 -8
  236. package/dist/chunk-AI2ECT7L.js +0 -2
  237. package/dist/chunk-BUAC4Q4G.js +0 -2
  238. package/dist/chunk-BZ6LCGE6.js +0 -2
  239. package/dist/chunk-CO3AL7NZ.js +0 -2
  240. package/dist/chunk-FVVT7GV6.js +0 -4
  241. package/dist/chunk-HXXRN77A.js +0 -2
  242. package/dist/chunk-ITHQJZTG.js +0 -2
  243. package/dist/chunk-IW7ASGVF.js +0 -2
  244. package/dist/chunk-JODYQDE4.js +0 -2
  245. package/dist/chunk-MX6F756F.js +0 -2
  246. package/dist/chunk-O6KCZPJQ.js +0 -62
  247. package/dist/chunk-OAI5GEIN.js +0 -6
  248. package/dist/chunk-OH5HIAID.js +0 -4
  249. package/dist/chunk-OXKEUWMJ.js +0 -2
  250. package/dist/chunk-PBGTMPJ7.js +0 -2
  251. package/dist/chunk-QYKKTYBN.js +0 -6
  252. package/dist/chunk-R3G6ERW7.js +0 -7
  253. package/dist/chunk-SJR4SB7B.js +0 -2
  254. package/dist/chunk-SYKCO25G.js +0 -16
  255. package/dist/chunk-T22X7WT6.js +0 -2
  256. package/dist/chunk-TH4JVC34.js +0 -71
  257. package/dist/chunk-VDY4HYNK.js +0 -2
  258. package/dist/chunk-VDZIEDJB.js +0 -2
  259. package/dist/chunk-VDZL45XI.js +0 -2
  260. package/dist/chunk-WJIS6BNI.js +0 -3
  261. package/dist/chunk-WN5Z3UVT.js +0 -7
  262. package/dist/chunk-XCW7DYHM.js +0 -2
  263. package/dist/chunk-ZF6P2NAT.js +0 -63
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: scip-vue-maintainability
3
+ description: Vue frontend maintainability review using scip-query's Vue SFC, template-duplicate, composable-candidate, large-view, and health commands. Use when reviewing Vue or Nuxt codebases, investigating duplicated components or composables, checking frontend health score pressure, or asking whether agents are reusing Vue code correctly.
4
+ allowed-tools: [Bash, Read, Grep, Glob]
5
+ ---
6
+
7
+ # SCIP Vue Maintainability Review
8
+
9
+ This skill reviews Vue frontends by treating `.vue` single-file components as first-class code units. It uses `scip-query` evidence to decide where templates, scripts, styles, external scripts, components, and composables are carrying duplicated concepts or too many reasons to change.
10
+
11
+ A Vue component duplicate candidate is a pair or group of rendered interface structures that repeat the same user-facing arrangement, controls, states, or data-presentation shape enough that a shared component may reduce future divergence.
12
+
13
+ A Vue composable candidate is a pair or group of script behaviors that repeat the same state lifecycle, effects, requests, validation, persistence, or derived-data policy enough that a shared composable may make the behavior easier to preserve.
14
+
15
+ Large view pressure is a maintainability signal that one SFC or linked view file contains several kinds of knowledge that change for different reasons, such as layout structure, state management, data loading, styling, and feature policy.
16
+
17
+ Vue health is a repo-grounded frontend pressure map. It is useful for ranking review attention, but it is not proof that code is bad and not the goal of a refactor.
18
+
19
+ ## Quick Start
20
+
21
+ Refresh the code intelligence before trusting graph facts:
22
+
23
+ ```bash
24
+ scip-query status
25
+ scip-query reindex
26
+ ```
27
+
28
+ If Vue files need rich internals, find the relevant TypeScript project and augment the index:
29
+
30
+ ```bash
31
+ find . -name 'tsconfig*.json' -not -path '*/node_modules/*'
32
+ scip-query augment-vue --project <path-to-tsconfig>
33
+ ```
34
+
35
+ Run the Vue review commands uncapped when doing a serious frontend pass. Do not combine `--full` with `--limit`.
36
+
37
+ ```bash
38
+ scip-query vue-component-duplicates --scope <vue-source-scope> --full --json
39
+ scip-query vue-composable-candidates --scope <vue-source-scope> --full --json
40
+ scip-query vue-large-view-pressure --scope <vue-source-scope> --full --json
41
+ scip-query health --full --json
42
+ ```
43
+
44
+ ## Workflow
45
+
46
+ 1. Bound the review to a Vue source root, feature area, or changed files. Prefer the narrowest scope that still includes likely reuse partners.
47
+ 2. Run `augment-vue` when component references, imported composables, script blocks, or linked external scripts matter to the question.
48
+ 3. Run the three Vue commands: component duplicates, composable candidates, and large view pressure.
49
+ 4. Cross-check the result sets before recommending an extraction:
50
+ - Component duplicate only: inspect for a shared presentational component or an existing component that callers should reuse.
51
+ - Composable candidate only: inspect for a shared behavior, lifecycle, request pattern, validation rule, persistence rule, or derived-state policy.
52
+ - Both component and composable candidate: inspect for a feature-level concept that may need both a component boundary and a composable boundary.
53
+ - Large view only: split by reason to change, not by line count alone.
54
+ 5. Open the source files for the top candidates. Similarity is evidence to inspect, not a verdict.
55
+ 6. Check existing exports, imports, and call sites before proposing anything new:
56
+
57
+ ```bash
58
+ scip-query outline <file>
59
+ scip-query deps <file>
60
+ scip-query rdeps <file>
61
+ scip-query similar-files --scope <vue-source-scope>
62
+ scip-query recent-duplicates --scope <vue-source-scope> --full --json
63
+ ```
64
+
65
+ ## Acting on Findings
66
+
67
+ Prefer reuse before extraction. If an existing component or composable already names the concept, migrate callers to it instead of creating another one.
68
+
69
+ When extracting:
70
+
71
+ - Extract a component when the repeated knowledge is rendered template structure, props, slots, empty/loading/error states, or design-system composition.
72
+ - Extract a composable when the repeated knowledge is state, lifecycle, requests, validation, persistence, derived data, or shared event policy.
73
+ - Split a large view by reason to change: data loading, permission/policy, layout shell, table/list rendering, form state, and action handling are different reasons.
74
+ - Keep domain-specific variation at the call site when the variation is essential. Do not hide different product rules behind broad option objects.
75
+
76
+ ## Post-Change Verification
77
+
78
+ After implementing a component reuse, composable extraction, or large-view split, prove both sides of the work: the new abstraction exists and the old inline copies were migrated.
79
+
80
+ Run the checks that match what changed:
81
+
82
+ ```bash
83
+ scip-query diff-impact
84
+ scip-query vue-component-duplicates --scope <vue-source-scope> --full --json
85
+ scip-query vue-composable-candidates --scope <vue-source-scope> --full --json
86
+ scip-query vue-large-view-pressure --scope <vue-source-scope> --full --json
87
+ scip-query recent-duplicates --scope <vue-source-scope> --full --json
88
+ scip-query incomplete-migration
89
+ scip-query unused-params
90
+ scip-query wrapper-candidates --scope <vue-source-scope> --full --json
91
+ scip-query passthrough-candidates --scope <vue-source-scope> --full --json
92
+ scip-query stale-abstractions --scope <vue-source-scope> --include-low-confidence --full --json
93
+ scip-query reindex && scip-query diff-gate
94
+ ```
95
+
96
+ Use the results this way:
97
+
98
+ - `incomplete-migration`: if a new composable/helper was created and wired somewhere, migrate every unchanged site that still contains the same logic or document why it is not the same behavior.
99
+ - `recent-duplicates`: if the new component/composable is still an echo of established code, delete the echo or reuse the established concept.
100
+ - Vue duplicate commands: the specific candidate pair you acted on should disappear, weaken materially, or be explicitly accepted as essential variation.
101
+ - `unused-params`: remove speculative props/options introduced "for later."
102
+ - wrapper/pass-through/stale checks: remove local wrapper components, composable aliases, or type abstractions that do not enforce a real policy.
103
+ - `diff-gate`: treat every finding as unfinished work unless there is a written reason to accept it.
104
+
105
+ ## False Positive Checks
106
+
107
+ - Shared design-system primitives, CSS utility classes, icons, labels, or test IDs are not enough to justify an extraction.
108
+ - Similar templates with different domain lifecycles may justify a presentational component but not a composable.
109
+ - Shared composable usage may mean the right concept is already extracted; look for drift around the shared call, not just another extraction.
110
+ - A large style block creates review pressure, but it is not proof that behavior is duplicated.
111
+ - A local wrapper is justified only when it names a real product concept, enforces a policy, or prevents drift across callers.
112
+
113
+ ## Reporting Shape
114
+
115
+ Report findings as a frontend maintainability register:
116
+
117
+ - Executive read: whether the Vue code is consolidating or drifting.
118
+ - Command evidence: exact commands, scope, counts, and whether results were uncapped.
119
+ - Candidate groups: files, repeated UI structure, repeated behavior, and large-view pressure.
120
+ - Recommended extractions: component, composable, view split, reuse existing API, or no action.
121
+ - Post-change proof: commands rerun, candidate pairs resolved or accepted, migration completeness checked, and `diff-gate` result.
122
+
123
+ ## Stable Management Calibration
124
+
125
+ When validating against Stable Management, use these known shapes as calibration examples, not hard-coded rules:
126
+
127
+ - `IncidentCategoriesPanel.vue` and `RecordLabelsPanel.vue` should read as both component and behavior pressure.
128
+ - `CardActionMenu.vue` and `CardStatusMenu.vue` should read as behavior/composable pressure.
129
+ - `HorseProfileFarrierVisitsSection.vue` and `HorseProfileVetRecordsSection.vue` should read as component pressure without forcing a composable.
130
+ - `InventoryView.vue` and `FacilityBookingView.vue` should count linked external script pressure when measuring large views.
@@ -1,3 +0,0 @@
1
- import{a as L}from"./chunk-SJR4SB7B.js";import{a as d}from"./chunk-B32FX5KB.js";import{a as B}from"./chunk-6IGXZZQ4.js";import{a as G}from"./chunk-AQYBOORI.js";import{a as I}from"./chunk-WN5Z3UVT.js";import{a as F}from"./chunk-BUAC4Q4G.js";import{a as v}from"./chunk-VDY4HYNK.js";import{a as E}from"./chunk-MCW36F2D.js";import{a as _}from"./chunk-6VL4AIEO.js";import{a as A,b as x}from"./chunk-OAI5GEIN.js";import{b as R}from"./chunk-SYKCO25G.js";import{c as N}from"./chunk-HXXRN77A.js";import{a as w}from"./chunk-NGI4V4AB.js";import{b as $}from"./chunk-6QVCPUK6.js";import{a as S}from"./chunk-JODYQDE4.js";import{f as D}from"./chunk-R3G6ERW7.js";import{a as C}from"./chunk-4HTJZC6G.js";import{a as k}from"./chunk-IW7ASGVF.js";import{e as g,f as y}from"./chunk-QYKKTYBN.js";import{existsSync as H}from"fs";import{existsSync as M,readFileSync as O,writeFileSync as U}from"fs";import{isAbsolute as q,join as K}from"path";var Y=75e3,z=5e3,J=2500;function V(e){let i=G(e);return i.symbols>=Y||i.documents>=z?J:void 0}var W=".scipquery-baseline.json";function b(e,i){return i&&q(i)?i:K(e.config.projectRoot,i??W)}function P(e,i={}){let{scope:t}=i,o=V(e),s=[],a=$(e,{scope:t,...d.dead,scanLimit:o});for(let n of a.symbols)g(e,n.relativePath)||y(e,n.symbol,n.relativePath)||n.kind==="dead-code"&&s.push(`dead:${n.relativePath}:${n.shortName}`);for(let n of F(e,{scope:t,...d.isolated,scanLimit:o}))g(e,n.relativePath)||y(e,n.symbol,n.relativePath)||s.push(`isolated:${n.relativePath}:${n.shortName}`);for(let n of C(e,{scope:t}))n.kind==="real"&&s.push(`cycle:${Q(n.path)}`);for(let n of x(e,{scope:t,...d.similar,scanLimit:o}))s.push(`similar:${[n.symbolA,n.symbolB].sort().join("|")}`);for(let n of E(e,{scope:t,...d.extract,scanLimit:o}))s.push(`extract:${n.relativePath}:${n.shortName}`);for(let n of I(e,{scope:t,...d.wrappers,scanLimit:o}))s.push(`wrapper:${n.file}:${n.shortName}`);for(let n of v(e,{scope:t,...d.passthroughs,scanLimit:o}))s.push(`passthrough:${n.file}:${n.shortName}`);for(let n of B(e,{scope:t,...d.stale,scanLimit:o}))s.push(`stale:${n.file}:${n.shortName}`);for(let n of w(e,{scope:t,...d.drift}).results)n.kind!=="pattern-deviation"&&s.push(`drift:${n.kind}:${n.file}:${n.dep}`);return[...new Set(s)].sort()}function Q(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 Se(e,i={}){let t=P(e,{scope:i.scope}),o=b(e,i.path);return U(o,JSON.stringify({version:1,findings:t},null,2)+`
2
- `),{path:o,findingCount:t.length}}function T(e,i={}){let t=b(e,i.path);if(!M(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let o=JSON.parse(O(t,"utf-8")),s=new Set(o.findings??[]),a=P(e,{scope:i.scope}),n=new Set(a);return{baselinePath:t,baselineCount:s.size,current:a,newFindings:a.filter(r=>!s.has(r)),fixedFindings:[...s].filter(r=>!n.has(r))}}var Be=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function Ge(e,i={}){let t=i.base??"HEAD",{minTogether:o=6,minConfidence:s=.6,maxEchoChecks:a=Number.POSITIVE_INFINITY,maxHelpers:n=Number.POSITIVE_INFINITY,minSimilarity:r=.8}=i,c=new Set(i.skip??[]),h=R(e,{base:t}),l=h.changedFiles,p=new Set(l),f={base:t,changedFiles:l,changedSymbols:h.changedSymbols.length,checksRun:[],skipped:[],findings:[],note:h.summary.note};if(l.length===0)return f;let m=(u,j)=>{if(c.has(u)){f.skipped.push({check:u,reason:"skipped via --skip"});return}j()};return m("echo",()=>X(e,h.changedSymbols,p,a,r,f)),m("incomplete-migration",()=>Z(e,t,n,f)),m("co-change-partner",()=>ee(e,p,o,s,f)),m("doc-reference",()=>ne(e,p,f)),m("unused-params",()=>ie(e,l,f)),m("new-dead",()=>te(e,h.changedSymbols,f)),m("baseline",()=>oe(e,f)),f}function X(e,i,t,o,s,a){a.checksRun.push("echo");for(let n of i.slice(0,o)){let r=A(e,n.symbol,{minSimilarity:s,limit:3});for(let c of r){let h=c.fileA===n.file?c.fileB:c.fileA,l=c.fileA===n.file?c.shortNameB:c.shortNameA;t.has(h)||a.findings.push({check:"echo",message:`${n.shortName} (${n.file}) is ${Math.round(c.similarity*100)}% similar to established ${l} (${h})`,remediation:`Extend or reuse ${l} instead of keeping the re-implementation.`})}}i.length>o&&a.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function Z(e,i,t,o){let s=_(e,{base:i,maxHelpers:t});if(!s.available){o.skipped.push({check:"incomplete-migration",reason:"no git history"});return}o.checksRun.push("incomplete-migration"),s.note&&o.skipped.push({check:"incomplete-migration",reason:s.note});for(let a of s.findings){let n=a.leftovers.map(r=>`${r.shortName} (${r.file}, ${Math.round(r.containment*100)}%)`).join(", ");o.findings.push({check:"incomplete-migration",message:`new helper ${a.helperShortName} (${a.helperFile}) is wired into ${a.migratedFiles.length} file(s), but ${a.leftovers.length} similar un-migrated site(s) remain: ${n}`,remediation:`Migrate the remaining sites to ${a.helperShortName}, or confirm they are intentionally different.`})}}function ee(e,i,t,o,s){let a=D(e,{minTogether:t,minConfidence:0});if(!a){s.skipped.push({check:"co-change-partner",reason:"no git history"});return}s.checksRun.push("co-change-partner");let n=new Set;for(let r of a){let c=i.has(r.fileA),h=i.has(r.fileB);if(c===h)continue;let l=c?r.fileA:r.fileB,p=c?r.fileB:r.fileA,f=c?r.changesA:r.changesB,m=f>0?r.together/f:0;if(m<o||S(p)||S(l)||!H(`${e.config.projectRoot}/${p}`))continue;let u=`${l}|${p}`;n.has(u)||(n.add(u),s.findings.push({check:"co-change-partner",message:`${l} changed, but ${p} did not \u2014 they change together ${r.together}x (${Math.round(m*100)}% of the time)`,remediation:`Update ${p} alongside this change, or confirm the coupling no longer holds.`}))}}function ne(e,i,t){t.checksRun.push("doc-reference");for(let o of N(e,i))i.has(o.doc)||t.findings.push({check:"doc-reference",message:`${o.doc} cites ${o.cited.join(", ")} \u2014 changed in this diff, doc untouched`,remediation:`Re-read ${o.doc} and update its claims, or update its citations.`})}function ie(e,i,t){t.checksRun.push("unused-params");for(let o of L(e,{files:i,limit:50}))t.findings.push({check:"unused-params",message:`${o.shortName} (${o.file}) has trailing unused parameter(s): ${o.unusedTrailing.join(", ")}`,remediation:"Drop the unused trailing parameters and their call-site arguments."})}function te(e,i,t){t.checksRun.push("new-dead");let o=new k(e);for(let s of i)s.fanIn>0||o.fileKind(s.file)!=="test"&&(g(e,s.file)||y(e,s.symbol,s.file)||t.findings.push({check:"new-dead",message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,remediation:"Wire it up, or remove it before it becomes permanent dead code."}))}function oe(e,i){if(!H(b(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=T(e);for(let o of t.newFindings)i.findings.push({check:"baseline",message:`new finding vs committed baseline: ${o}`,remediation:"Fix the finding, or knowingly accept it via health --write-baseline."})}export{P as a,Se as b,T as c,Be as d,Ge as e};
3
- //# sourceMappingURL=chunk-5OHZEO3U.js.map
@@ -1,34 +0,0 @@
1
- import{b as P,g as F,h as H,i as G,n as W}from"./chunk-VGBSY6N7.js";import{a as $,b as J,d as j,f as B}from"./chunk-ZF6P2NAT.js";import{a as v}from"./chunk-IVAIPXNO.js";import{d as k,f as O,r as N,s as T,v as x}from"./chunk-O6KCZPJQ.js";import{a as C,c as I,i as M}from"./chunk-OH5HIAID.js";import{a as L,b as _,e as A,f as D}from"./chunk-ISCKLDSS.js";import{c as E,d as w}from"./chunk-VDZL45XI.js";function Me(e,n,o={}){let i=U(e,[n],{additive:o.additive,semantic:o.semantic}),s=o.callableOnly?(i.get(n.symbolId)??[]).filter(r=>O(r.symbol)):i.get(n.symbolId)??[];return typeof o.limit=="number"?s.slice(0,o.limit):s}function Re(e,n,o={}){let i=q(e)?Q(e,n,{semantic:o.semantic!==!1}):z(e).get(n.symbolId)??[];return typeof o.limit=="number"?i.slice(0,o.limit):i}var V=w("caller-rows",{clearGroups:["whole-project"]}),Y=2e4;function q(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Y}function z(e){return V.get(e,()=>{let n=T(e),o=U(e,n),i=new Map;for(let l of n)i.set(l.symbol,l.symbolId);let s=new Map,r=new Map;for(let l of n){let a=o.get(l.symbolId);if(!(!a||a.length===0))for(let m of a){let t=i.get(m.symbol);if(t===void 0||t===l.symbolId)continue;let c=s.get(t);c||(c=[],s.set(t,c),r.set(t,new Set));let u=`${l.symbol}|${l.relativePath}`;r.get(t).has(u)||(r.get(t).add(u),c.push({symbol:l.symbol,file:l.relativePath,source:"caller-map-inversion"}))}}return s})}function Q(e,n,o){let i=[],s=new Set,r=a=>{if(a.symbol===n.symbol)return;let m=`${a.symbol}|${a.file}`;s.has(m)||(s.add(m),i.push(a))};for(let a of W(e,n))a.file!==n.relativePath&&r({symbol:a.enclosingSymbol??a.file,file:a.file,source:"resolved-reference"});let l=o.semantic?X(e,n):null;if(l)for(let a of j(e,l)){if(a.file===n.relativePath||e.isIgnored(a.file))continue;let m=x(N(e,a.file),a.line);r({symbol:m?.symbol??a.file,file:a.file,source:"semantic-reference"})}return i}function X(e,n){return e.get(`SELECT
2
- d.id AS documentId,
3
- gs.id AS symbolId,
4
- gs.symbol,
5
- d.relative_path AS relativePath,
6
- COALESCE(der.start_line, c.start_line) AS startLine,
7
- COALESCE(der.end_line, c.end_line) AS endLine,
8
- COALESCE(gs.display_name, '') AS leaf,
9
- NULL AS parentTypeName,
10
- CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
11
- CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
12
- gs.kind AS kind,
13
- gs.documentation AS documentation,
14
- gs.enclosing_symbol AS enclosingSymbol
15
- FROM global_symbols gs
16
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
17
- LEFT JOIN chunks c ON c.document_id = der.document_id
18
- JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
19
- WHERE gs.id = ?
20
- LIMIT 1`,n.symbolId)??null}function U(e,n,o={}){if(n.length===0)return new Map;let i=o.additive??!1,s=[],r=[];for(let c of n)I(c.relativePath)&&M(e,c.relativePath)!==null?s.push(c):r.push(c);let l=new Map,a=new Map,m=c=>{for(let[u,g]of c){let b=l.get(u);b||(b=[],l.set(u,b));let y=a.get(u);y||(y=new Set,a.set(u,y));for(let d of g){let f=`${d.symbol}|${d.chunkId}`;y.has(f)||(y.add(f),b.push(d))}}};s.length>0&&m(oe(e,s)),o.semantic!==!1&&m(re(Z(e,n)));let t=i?n:r;return t.length>0&&m(ae(e,t)),l}function Z(e,n){let o=new Map,i=[],s=[];for(let l of n){if(!$(l.relativePath))continue;let a=C(e,l.relativePath);if(!a){s.push(l);continue}let m=_(e,l.relativePath,a),t=te(e,l.relativePath),c=A(e,l.relativePath,l.symbol,m,t);if(c!==null){let u=ee(c);if(u){u.length>0&&o.set(l.symbolId,u);continue}}i.push({def:l,contentHash:m,depsDigest:t})}if(i.length===0&&s.length===0)return o;let r=B(e,[...s,...i.map(l=>l.def)]);for(let[l,a]of r)o.set(l,a);return J(e).availability().available&&D(e,i.map(l=>({relativePath:l.def.relativePath,symbol:l.def.symbol,contentHash:l.contentHash,depsDigest:l.depsDigest,payload:JSON.stringify(r.get(l.def.symbolId)??[])}))),o}function ee(e){try{return JSON.parse(e)}catch{return null}}var ne=E("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function te(e,n){return ne.get(e,n,()=>{let i=[...v(e).get(n)??[]].sort().map(s=>`${s}:${_(e,s,C(e,s))}`);return L(i.join("|"))})}function oe(e,n){let o=new Map,i=le(n,o),s=G(e);for(let[r,l]of i){let a=M(e,r);if(a)for(let m of a){let t=ie(l,m.line);if(!t)continue;let c=se(e,r,s,m.calleeLeaf,m.memberAccess);c&&c.symbol!==t.symbol&&o.get(t.symbolId).push({symbol:c.symbol,file:c.file,chunkId:m.line,source:"ast-callsite"})}}return o}function le(e,n){let o=new Map;for(let i of e){let s=o.get(i.relativePath);s?s.push(i):o.set(i.relativePath,[i]),n.set(i.symbolId,[])}for(let i of o.values())i.sort((s,r)=>s.endLine-s.startLine-(r.endLine-r.startLine));return o}function ie(e,n){return e.find(o=>n>=o.startLine&&n<=o.endLine)??null}function se(e,n,o,i,s){let r=F(n,o.get(i)??[]);return r.length===0?null:H(e,n,r,s)}function ae(e,n){if(n.length===0)return new Map;let o=e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
21
- FROM mentions m
22
- JOIN chunks c ON m.chunk_id = c.id
23
- WHERE m.role != 1`),i=new Map;for(let t of o)i.has(t.document_id)||i.set(t.document_id,[]),i.get(t.document_id).push(t);let s=new Map(e.all("SELECT id, relative_path FROM documents").map(t=>[t.id,t.relative_path])),r=new Map,l=e.all(`SELECT gs.id AS symbol_id, gs.symbol,
24
- COALESCE(der.document_id, def_chunk.document_id) AS document_id
25
- FROM global_symbols gs
26
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
27
- LEFT JOIN (
28
- SELECT m.symbol_id, MIN(c.document_id) AS document_id
29
- FROM mentions m
30
- JOIN chunks c ON m.chunk_id = c.id
31
- WHERE m.role = 1
32
- GROUP BY m.symbol_id
33
- ) def_chunk ON def_chunk.symbol_id = gs.id`);for(let t of l)r.has(t.symbol_id)||r.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?s.get(t.document_id)??"":""});let a=new Map,m=s;for(let t of n){let c=i.get(t.documentId)??[],u=new Set,g=[],b=null,y=()=>{if(b)return b;let d=m.get(t.documentId)??"",f=new Set;if(d){let S=P(e,d),h=Math.max(0,t.startLine),R=Math.min(S.length-1,t.endLine);for(let p=h;p<=R;p+=1)for(let K of S[p])f.add(K)}return b=f,f};for(let d of c){if(d.symbol_id===t.symbolId)continue;let f=r.get(d.symbol_id);if(!f)continue;if(!(d.start_line>=t.startLine&&d.end_line<=t.endLine)){if(!(d.start_line<=t.endLine&&d.end_line>=t.startLine))continue;let p=k(f.symbol);if(!p||!y().has(p))continue}let h=`${f.symbol}|${d.chunk_id}`;u.has(h)||(u.add(h),g.push({...f,chunkId:d.chunk_id,source:"scip-chunk"}))}a.set(t.symbolId,g)}return a}function re(e){let n=new Map;for(let[o,i]of e){let s=[];for(let r of i)s.push({symbol:r.symbol,file:r.file,chunkId:-1,source:"semantic-callee"});n.set(o,s)}return n}export{Me as a,Re as b,U as c};
34
- //# sourceMappingURL=chunk-5QJIEYFB.js.map
@@ -1,4 +0,0 @@
1
- import{a as h,b as F,c as w}from"./chunk-WJIS6BNI.js";import{a as M}from"./chunk-V76FCF5F.js";import{a as b}from"./chunk-MX6F756F.js";import{a as P}from"./chunk-IW7ASGVF.js";import{a as S,f as D}from"./chunk-QYKKTYBN.js";import{a as L,c as v,d as p}from"./chunk-O6KCZPJQ.js";import{a as y,j as I}from"./chunk-OH5HIAID.js";function ie(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:a}=e??{},f=e?.semantic!==!1,o=new P(t),d=o.scopedDefinitions(n),g=V(o,n),x={high:0,medium:1,low:2};return M({candidates:()=>$(t,o,d,{minLoc:i,maxLoc:s}),orderCandidates:(c,u)=>b(u)-b(c)||c.relativePath.localeCompare(u.relativePath),scanLimit:a,prepare:c=>({consumerFileMap:A(o,c,{semantic:f}),singletonBackedClassIds:O(t,o,d,c,{semantic:f}),candidateIndex:B(c)}),evaluate:(c,u)=>{if(u.singletonBackedClassIds.has(c.symbolId))return null;let m=N(t,c,u.consumerFileMap,u.candidateIndex);if(m.transitivelyReachable||m.realConsumers.length>1||m.realConsumers.length===0&&m.barrelConsumers>0||!Z(m.definition,m.realConsumers.length,g))return null;let C=j(t,m);return!l&&C.confidence==="low"?null:C},orderResults:(c,u)=>x[c.confidence]-x[u.confidence]||u.loc-c.loc||c.file.localeCompare(u.file)||c.startLine-u.startLine,limit:r})}function $(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=>S(s.relativePath)!=="test").filter(s=>!D(t,s.symbol,s.relativePath)).filter(s=>!H(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function A(t,e,n){return h(t,e,{semantic:n.semantic})}function B(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 N(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(d=>d!==e.relativePath&&!t.isIgnored(d)),{realConsumers:l,barrelConsumers:a,importOnlyConsumers:f}=F(t,e,r),o=_(t,e,n,i);return{definition:e,realConsumers:l,barrelConsumers:a+f,transitivelyReachable:o}}function j(t,e){let n=k(t,e.definition.relativePath,e.definition.startLine),i=T(e.definition.relativePath)?!0:q(t,e.definition),{confidence:s,reason:r}=G(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:v(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}}function O(t,e,n,i,s){let r=W(t,U(n),i),l=r.map(o=>o.singleton);if(r.length===0)return new Set;let a=h(e,l,{semantic:s.semantic}),f=new Set;for(let{singleton:o,classId:d}of r)E(t,o,a)&&f.add(d);return f}function U(t){let e=new Map;for(let n of t){let i=p(n.symbol);i&&e.set(R(n.relativePath,i),n)}return e}function W(t,e,n){let i=[];for(let s of n){let r=z(t,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function z(t,e,n){if(k(t,n.relativePath,n.startLine)!=="class")return null;let i=p(n.symbol);if(!i)return null;let s=K(t,n.relativePath,i);return s?e.get(R(n.relativePath,s))??null:null}function E(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)&&!w(t,r,i))}function R(t,e){return`${t}\0${e}`}function K(t,e,n){let i=y(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 V(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function H(t){let e=L(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 T(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 Z(t,e,n){return!(T(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function _(t,e,n,i){let s=I(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let l=s.get(r);if(!l||l.size===0)return!1;let a=i.get(e.relativePath);if(!a)return!1;for(let f of l){let o=a.get(f);if(!o)continue;let d=n.get(o.symbolId);if(d){for(let g of d)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function k(t,e,n){let i=y(t,e);if(!i)return"other";let s=i.split(`
2
- `),r=Math.max(0,n-2),l=Math.min(s.length-1,n+2);for(let a=r;a<=l;a++){let o=(s[a]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(o))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(o))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(o))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(o))return"enum"}return"other"}function q(t,e){let n=y(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`),l=n.split(`
3
- `);for(let a=0;a<l.length;a++)if(!(a>=e.startLine&&a<=e.endLine)&&r.test(l[a]??""))return!0;return!1}function G(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{ie as a};
4
- //# sourceMappingURL=chunk-6IGXZZQ4.js.map
@@ -1,2 +0,0 @@
1
- import{c as G}from"./chunk-MX6F756F.js";import{a as E}from"./chunk-IW7ASGVF.js";import{a as F,d as N,e as k,f as T}from"./chunk-QYKKTYBN.js";import{a as z}from"./chunk-VDZIEDJB.js";import{c as H,d as U,f as v,j as q}from"./chunk-VGBSY6N7.js";import{b as I}from"./chunk-FVVT7GV6.js";import{c as M,f as A,g as j,h as O,i as B,j as W,r as V,x}from"./chunk-O6KCZPJQ.js";import{c as P,e as _}from"./chunk-OH5HIAID.js";import{a as h}from"./chunk-NN3O7TPH.js";import{b as S}from"./chunk-VDZL45XI.js";var g=new WeakMap;function J(e,n){let t=P(n);return t==="rust"?pe(e,n):t==="typescript"||t==="tsx"||t==="javascript"?de(e,n):[]}var ue=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function de(e,n){let t=_(e,n);if(!t)return[];let i=g.get(t);if(i)return i;let r=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(n)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(n),o=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(n),s=!1,c=t.rootNode;for(let u of c.namedChildren){if(u.type!=="expression_statement")continue;let a=u.namedChild(0);if(!a||a.type!=="call_expression")continue;let d=a.namedChild(0);if(!d)continue;let f=d.type==="member_expression"?d.namedChild(d.namedChildCount-1)?.text:d.text;if(f&&ue.has(f)){s=!0;break}}let l=[];s&&l.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(r||o)&&l.push({startLine:0,endLine:c.endPosition.row,reason:r?"Next.js / Remix route file":"Vite/Vue route component"});for(let u of c.namedChildren){let a=null,d=null;if(u.type==="function_declaration")a=u.namedChild(0)?.text??null,d=u;else if(u.type==="export_statement"){let f=u.namedChild(0);f?.type==="function_declaration"&&(a=f.namedChild(0)?.text??null,d=f)}else if(u.type==="lexical_declaration"){let f=u.namedChild(0);if(f?.type==="variable_declarator"){let b=f.namedChild(0)?.text,y=f.namedChild(1);b&&(y?.type==="arrow_function"||y?.type==="function_expression")&&(a=b,d=f)}}a&&/^use[A-Z]/.test(a)&&d&&l.push({startLine:d.startPosition.row,endLine:d.endPosition.row,reason:"React custom hook (use*)"})}return l.push(...K(t,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),g.set(t,l),l}var fe=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function me(e){return fe.test(e)}function K(e,n,t){let i=[],r=o=>{if(n.has(o.type)&&o.parent){let c=o.parent.children,l=-1;for(let u=0;u<c.length;u+=1)if(c[u].startIndex===o.startIndex&&c[u].type===o.type){l=u;break}if(l>0)for(let u=l-1;u>=0;u-=1){let a=c[u];if(t.has(a.type)){if(me(a.text)){i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(a.type==="attribute_item"||a.type==="inner_attribute_item"))break}}for(let s of o.namedChildren)r(s)};return r(e.rootNode),i}function pe(e,n){let t=_(e,n);if(!t)return[];let i=g.get(t);if(i)return i;let r=[],o=be(t);return o?(g.set(t,o),o):(X(t.rootNode,r,!1,!1),r.push(...K(t,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...ve(t.rootNode)),g.set(t,r),r)}function be(e){return Ee(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function X(e,n,t,i){let r=t,o=i;e.type==="trait_item"&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?ye(e,n,t,i):i&&_e(e)?n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?ge(e,n,t):e.type==="mod_item"&&C(e).some(s=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(s))&&(r=!0);for(let s of e.namedChildren)X(s,n,r,o)}function ye(e,n,t,i){let r=C(e),o=null;i?o="trait impl method (dynamic dispatch)":t&&(o="inside #[cfg(test)] mod");for(let s of r){let c=xe(s);if(c){o=c;break}if(Z(s)){o="#[allow(dead_code)]";break}}o&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o})}function ge(e,n,t){let i=C(e),r=e.namedChildren.find(o=>o.type==="type_identifier")?.text;i.some(Se)&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(Z)&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),t&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function C(e){let n=e.parent;if(!n)return[];let t=n.children,i=-1;for(let o=0;o<t.length;o+=1)if(t[o].startIndex===e.startIndex&&t[o].type===e.type){i=o;break}if(i<=0)return[];let r=[];for(let o=i-1;o>=0;o-=1){let s=t[o];if(s.type==="attribute_item"||s.type==="inner_attribute_item")r.push(s.text);else{if(s.type==="line_comment"||s.type==="block_comment")continue;break}}return r}var he=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function xe(e){return he.find(({re:n})=>n.test(e))?.reason??null}var Re=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function Se(e){return/#\[\s*derive\s*\(/.test(e)?Re.some(n=>n.test(e)):!1}function Z(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function _e(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function ve(e){let n=De(e);if(n.size===0)return[];let t=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&n.has(r)&&t.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return t}function Ee(e){for(let n=0;n<Math.min(e.namedChildCount,12);n+=1){let t=e.namedChild(n);if(!t||t.type!=="line_comment"&&t.type!=="block_comment")break;if(/@generated\b/.test(t.text)||/This file is .*generated\b/i.test(t.text)||/Code generated by/i.test(t.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(t.text)||/openapi-generator/i.test(t.text)&&/Generated by/i.test(t.text))return!0}return!1}var Ce=/^#!?\[\s*serde\s*\(/,$=/\bwith\s*=\s*"([^"]+)"/g;function De(e){let n=new Set;for(let t of e.descendantsOfType("attribute_item")){if(!Ce.test(t.text))continue;$.lastIndex=0;let i;for(;(i=$.exec(t.text))!==null;){let r=i[1],o=r.split("::").pop()??r;o&&n.add(o)}}return n}function Q(e){let n=new Map,t=i=>{let r=n.get(i);if(r)return r;let o=J(e,i);return r={ranges:o.map(s=>({startLine:s.startLine,endLine:s.endLine})),containers:new Set(o.map(s=>s.containerName).filter(s=>!!s))},n.set(i,r),r};return(i,r,o,s)=>{let c=t(i);for(let l of c.ranges)if(r>=l.startLine&&r<=l.endLine)return!0;if(s&&c.containers.has(s))return!0;for(let l of x(o))if(c.containers.has(l))return!0;return!1}}function ze(e,n={}){S(e,{groups:n.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function D(e,n,t={}){S(e,{groups:t.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:n.replace(/\\/g,"/")})}function ee(e,n){return n.isIgnoredPath(e.relativePath)?m("ignored-file"):O(e.symbol)?m("module-like-symbol"):Y(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&Y(e.enclosingSymbol)?m("nested-non-callable-value"):!n.includeTests&&!w(e.relativePath)?m("test-file"):!n.includeTests&&n.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?m("excluded-file-region"):B(e.symbol)?m("rust-trait-impl-member"):W(e.symbol)?m("rust-test-module"):!n.includeMembers&&!we(e)?m("member"):e.endLine-e.startLine+1<n.minLoc?m("below-min-loc"):{accepted:!0}:m("non-value-symbol")}function w(e){return F(e)!=="test"}function m(e){return{accepted:!1,rejectionReason:e}}function Y(e){return j(e)||e.endsWith("().")||e.endsWith(".")}function we(e){return A(e.symbol)||x(e.symbol).length===0}function te(){return new Map}function ne(e,n,t){let i=new Map;for(let r of H(e,t))e.isIgnored(r.relative_path)||n.has(r.relative_path)||R(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function re(e,n,t){let i=new Set;for(let r of U(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||i.add(r.symbol_id);return i}function L(e,n){let t=e.get(n);if(!t)return!1;for(let i of t.values())if(i.occurrences>0)return!0;return!1}function ie(e){return e?.occurrences??0}function R(e,n,t,i,r="source-fallback"){if(i<=0)return;let o=se(e,n,t);o.occurrences+=i,o.sources.add(r)}function oe(e,n,t,i,r){if(i<=0)return;let o=se(e,n,t);o.occurrences=Math.max(i,o.occurrences),o.sources.add(r)}function se(e,n,t){let i=e.get(n);i||(i=new Map,e.set(n,i));let r=i.get(t);return r||(r={occurrences:0,sources:new Set},i.set(t,r)),r}function mt(e,n={}){let{scope:t,minLoc:i=1,includeTests:r=!1,skipBarrels:o=!1,includeMembers:s=!1,deadCodeOnly:c=!1,scanLimit:l,semantic:u=!0}=n,a=G(Le(e,{scope:t,minLoc:i,includeTests:r,includeMembers:s}),l),d=o?new Set(N(e)):new Set,f=c?te():ne(e,d,a.map(p=>p.symbolId)),b=c?re(e,a.map(p=>p.symbolId),d):new Set,y=c?a.filter(p=>!b.has(p.symbolId)):a;c?ke(e,y,f,d):Ne(e,y,f,d);let ce=c?y.filter(p=>!L(f,p.symbolId)):a;Oe(e,ce,f,{includeTests:r,inactiveBarrelPaths:d,includeSemantic:!c&&u});let le=c?y.filter(p=>!L(f,p.symbolId)):a;return Fe(e,Pe(le,f))}function Le(e,n){let t=Q(e),i=[];for(let r of h(e,{scope:n.scope}))try{for(let o of V(e,r))ee(o,{minLoc:n.minLoc,includeTests:n.includeTests,includeMembers:n.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:t}).accepted&&i.push(o)}finally{D(e,r,{definitions:!0})}return i}function Pe(e,n){return e.map(t=>Ie(t,n)).filter(t=>t.cross_file_refs===0).sort((t,i)=>i.loc-t.loc||t.relative_path.localeCompare(i.relative_path)||t.start_line-i.start_line)}function Ie(e,n){let t=n.get(e.symbolId)??new Map,i=ie(t.get(e.relativePath)),r=0;for(let[o,s]of t)o!==e.relativePath&&(r+=s.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:i,cross_file_refs:r}}function Fe(e,n){let t=[],i=0,r=0,o=0;for(let s of n){if(e.isIgnored(s.relative_path)||k(e,s.relative_path)||T(e,s.symbol,s.relative_path))continue;let c=s.same_file_refs===0?"dead-code":"file-internal";c==="dead-code"?i++:r++,o+=s.loc,t.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:M(s.symbol),sameFileRefs:s.same_file_refs,kind:c})}return{symbols:t,totalCount:t.length,deadCodeCount:i,fileInternalCount:r,totalLoc:o}}function Ne(e,n,t,i){if(n.length===0)return;let r=new E(e),o=new Set(n.map(l=>l.symbolId)),s=new Set(n.map(l=>l.leaf).filter(Boolean)),c=new Set(r.sourceFiles());for(let l of h(e))c.add(l);r.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:s,skipPath:l=>i.has(l)},l=>{o.has(l.target.symbolId)&&(Ae(e,l)||R(t,l.target.symbolId,l.sourceFile,je(l),"source-fallback"))})}function ke(e,n,t,i){if(n.length===0)return;let r=new E(e),o=Te(n),s=new Set(r.sourceFiles());for(let a of h(e))s.add(a);let c=new Set(o.keys()),l=new Map,u=a=>{let d=l.get(a);return d||(d=q(e,a),l.set(a,d)),d};r.scanSourceReferences({paths:s,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:a=>i.has(a),resolveTargets:({sourceFile:a,name:d,kind:f})=>{let b=o.get(d);return b?Me(a,d,b,u(a),{permissive:f!=="cross-language-dispatch"}):[]},afterPath:a=>{l.delete(a),D(e,a)}},a=>{let d=a.kind==="identifier"&&a.sourceFile===a.target.relativePath?Math.max(0,a.occurrences-1):a.occurrences;a.kind==="identifier"&&ae(e,{sourceFile:a.sourceFile,name:a.name,target:a.target,occurrences:d})||R(t,a.target.symbolId,a.sourceFile,d,"source-fallback")})}function Te(e){let n=new Map;for(let t of e){if(!t.leaf)continue;let i=n.get(t.leaf)??[];i.push(t),n.set(t.leaf,i)}return n}function Me(e,n,t,i,r){let o=t.filter(l=>l.relativePath===e);if(o.length>0)return o;if(!r.permissive&&t.length===1)return[...t];let s=i.get(n);if(s)for(let l of s){let u=t.filter(a=>v(l,a.relativePath));if(u.length>0)return u}let c=new Set;for(let l of i.values())for(let u of l)c.add(u);for(let l of c){let u=t.filter(a=>v(l,a.relativePath));if(u.length>0&&u.length===t.length)return u}return r.permissive?[...t]:[]}function Ae(e,n){return n.kind==="cross-language-dispatch"&&n.target.relativePath===n.sourceFile?!0:n.kind==="identifier"&&ae(e,n)}function je(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function ae(e,n){return n.occurrences>1?!1:I(e,n.sourceFile).some(t=>t.used||t.sourcePath!==n.target.relativePath?!1:t.importedName===n.name||t.localName===n.name)}function Oe(e,n,t,i){for(let r of n){let o=z(e,r,{semantic:i.includeSemantic!==!1});if(o.length!==0)for(let s of o){let c=s.file;c===r.relativePath||e.isIgnored(c)||i.inactiveBarrelPaths.has(c)||!i.includeTests&&!w(c)||oe(t,r.symbolId,c,1,"caller-map")}}}export{ze as a,mt as b};
2
- //# sourceMappingURL=chunk-6QVCPUK6.js.map
@@ -1,8 +0,0 @@
1
- import{c as k,d as P}from"./chunk-OAI5GEIN.js";import{d as E}from"./chunk-UIWAZ2NT.js";import{a as w,c as x}from"./chunk-SYKCO25G.js";import{a as _}from"./chunk-IW7ASGVF.js";import{c as u}from"./chunk-O6KCZPJQ.js";import{execFileSync as T}from"child_process";var $=5;function U(n,l={}){let{base:s="HEAD",minContainment:m=.7,minCallees:c=3,maxHelpers:o=Number.POSITIVE_INFINITY,limit:a=20}=l,y=l.semantic!==!1,g=x(n,{base:s}),t={available:g.note!==w,base:s,changedFiles:g.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!t.available||g.changedFiles.length===0)return t;let v=new _(n),S=new Set(g.changedFiles),h=A(n,v,S,s);if(h.length===0)return t;let C=h.slice(0,o);h.length>o&&(t.note=`helper scoring capped at ${o} of ${h.length} new symbols`);let d=k(n,{minCallees:Math.min(3,c),semantic:y}),R=v.calleeMap(C,{semantic:y}),D=C.map(e=>({def:e,callees:P((R.get(e.symbolId)??[]).map(i=>i.symbol))})),b=new Map;for(let e of d)for(let i of e.callees)b.set(i,(b.get(i)??0)+1);let L=Math.max(8,Math.ceil(Math.sqrt(d.length)));for(let{def:e,callees:i}of D){let F=u(e.symbol);if(i.size<c){t.skipped.push({helperShortName:F,helperFile:e.relativePath,reason:`fewer than ${c} meaningful callees \u2014 too small to score`});continue}let M=H(n,e.symbolId);if(M.length===0){t.skipped.push({helperShortName:F,helperFile:e.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}t.helpersChecked+=1;let f=[];for(let r of d){if(r.symbol===e.symbol||S.has(r.file)||r.callees.has(e.symbol))continue;let p=E(i,r.callees);if(p<m)continue;let N=[...i].filter(I=>r.callees.has(I));N.some(I=>(b.get(I)??0)<=L)&&f.push({symbol:r.symbol,shortName:u(r.symbol),file:r.file,containment:p,sharedCallees:N.map(u).sort()})}f.length!==0&&(f.sort((r,p)=>p.containment-r.containment||r.file.localeCompare(p.file)),t.findings.push({helperSymbol:e.symbol,helperShortName:F,helperFile:e.relativePath,migratedFiles:M.sort(),leftovers:f.slice(0,$)}))}return t.findings.sort((e,i)=>(i.leftovers[0]?.containment??0)-(e.leftovers[0]?.containment??0)||e.helperFile.localeCompare(i.helperFile)),t.findings=t.findings.slice(0,a),t}function A(n,l,s,m){let c=new Map;return l.productionCallableDefinitions({requireFunctionLikeSymbol:!0}).filter(o=>{if(!s.has(o.relativePath))return!1;let a=c.get(o.relativePath);return a===void 0&&(a=O(n.config.projectRoot,m,o.relativePath),c.set(o.relativePath,a)),a===null||!new RegExp(`\\b${j(o.leaf)}\\b`).test(a)})}function O(n,l,s){try{return T("git",["show",`${l}:./${s}`],{encoding:"utf-8",cwd:n,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function H(n,l){return n.all(`SELECT DISTINCT ref_d.relative_path
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents ref_d ON c.document_id = ref_d.id
5
- WHERE m.symbol_id = ?
6
- AND m.role != 1
7
- ${n.pathExclusionsFor("ref_d")}`,l).map(m=>m.relative_path)}function j(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{U as a};
8
- //# sourceMappingURL=chunk-6VL4AIEO.js.map
@@ -1,2 +0,0 @@
1
- import{a as I}from"./chunk-OXKEUWMJ.js";import{a as u}from"./chunk-B32FX5KB.js";import{a as F}from"./chunk-6IGXZZQ4.js";import{a as k}from"./chunk-AQYBOORI.js";import{a as z}from"./chunk-WN5Z3UVT.js";import{a as _}from"./chunk-BUAC4Q4G.js";import{a as M}from"./chunk-VDY4HYNK.js";import{a as B}from"./chunk-MCW36F2D.js";import{b as $}from"./chunk-OAI5GEIN.js";import{a as T}from"./chunk-NGI4V4AB.js";import{a as x,b as R}from"./chunk-6QVCPUK6.js";import{b as A}from"./chunk-JODYQDE4.js";import{b as E,c as P}from"./chunk-R3G6ERW7.js";import{a as L}from"./chunk-772YYL6I.js";import{a as D}from"./chunk-4HTJZC6G.js";import{e as C,f as H}from"./chunk-QYKKTYBN.js";function y(e){let i=K(e),{breakdown:t}=Z(e),r=O(t,"risk"),n=O(t,"hygiene");return{score:Math.min(r,n),riskScore:r,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null},axes:Q(e),validation:X(e),suppressions:e.suppressions,actions:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Q(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:Y(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function Y(e){let i=e.gitEvidence?.fileStats;return i?e.complexity.top.map(t=>{let r=t.file?i[t.file]?.changes??0:0;return{...t,changes:r,weighted:p(t.score*Math.log2(1+r))}}).sort((t,r)=>r.weighted-t.weighted):null}function X(e){let i=e.gitEvidence?.fileStats;if(!i)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[]},r=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[f,d]of Object.entries(i))r.has(f)?n+=d.fixChanges:(o+=d.fixChanges,a+=1);let m=r.size>0?p(n/r.size):0,l=a>0?p(o/a):0,g={};for(let[f,d]of Object.entries(t)){let h=new Set(d);if(h.size===0)continue;let b=0;for(let q of h)b+=i[q]?.fixChanges??0;let w=p(b/h.size);g[f]={flaggedFiles:h.size,fixDensity:w,lift:l>0?p(w/l):null}}return{flaggedFiles:r.size,flaggedFixDensity:m,baselineFixDensity:l,ratio:r.size>0&&l>0?p(m/l):null,byCategory:g}}function p(e){return Math.round(e*100)/100}function K(e){let i=[];if(e.dead.count>0&&i.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&i.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&i.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&i.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.extractCount>0&&i.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&i.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&i.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),i.push({category:"Stale abstractions",evidence:"heuristic",description:`${n.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&n.push(`${e.drift.layerViolations} layer violations`),i.push({category:"Structural drift",evidence:"heuristic",description:n.join(", "),effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];i.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a dependency edge`+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},r={low:3,medium:2,high:1};return i.sort((n,o)=>{let a=t[n.impact]*r[n.effort];return t[o.impact]*r[o.effort]-a}),i}var J={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk",similar:"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene"};function O(e,i){let t=e.filter(r=>r.kind===i).reduce((r,n)=>r+n.points,0);return Math.max(0,Math.min(100,100-t))}function Z(e){let i=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),r=[],n=(d,h,b)=>{h>0&&r.push({axis:d,points:h,detail:b,kind:J[d]??"hygiene"})},o=e.dead.count/t;n("dead-code",Math.min(20,Math.round(o*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let a=e.isolated.count/t;n("isolated",Math.min(10,Math.round(a*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let m=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(m)),`${e.similarCount} similar function pair(s)`);let l=e.extractCount/t*1e3;n("extract",Math.min(5,Math.round(l/2)),`${e.extractCount} extraction candidate(s)`),n("wrappers",Math.min(3,e.wrappers.count),`${e.wrappers.count} wrapper candidate(s)`),n("passthroughs",Math.min(3,e.passthroughs.count),`${e.passthroughs.count} passthrough candidate(s)`);let g=e.stale.count/Math.max(t*.1,1);n("stale-abstractions",Math.min(8,Math.round(g*10)),`${e.stale.count} stale abstraction(s)`);let f=e.drift.count/i;return n("drift",Math.min(5,Math.round(f*50)),`${e.drift.count} drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence&&n("hidden-coupling",Math.min(5,e.gitEvidence.hiddenCoupling.pairCount),`${e.gitEvidence.hiddenCoupling.pairCount} co-changing pair(s) without a dependency edge`),{breakdown:r}}import{getHeapStatistics as ee}from"v8";var te=64*1024*1024;function S(){let e=globalThis.gc;if(!e)return;let i=ee();i.heap_size_limit-i.used_heap_size<te||e()}var ie=50,re=75e3,ne=5e3,V=2500,oe=["overview","dead","isolated","cycles","similar","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],N={overview:(e,i,t,r)=>({phase:"overview",statsResult:r,warnings:t.warnings}),dead:(e,i,t)=>({phase:"dead",dead:se(e,i,t)}),isolated:(e,i,t)=>({phase:"isolated",isolated:ce(e,i,t)}),cycles:(e,i,t)=>({phase:"cycles",realCycleCount:ue(e,i,t)}),similar:(e,i,t)=>({phase:"similar",similarCount:le(e,i,t)}),"extract-candidates":(e,i,t)=>({phase:"extract-candidates",extractCount:de(e,i,t)}),"wrapper-candidates":(e,i,t)=>({phase:"wrapper-candidates",wrappers:he(e,i,t)}),"passthrough-candidates":(e,i,t)=>({phase:"passthrough-candidates",passthroughs:pe(e,i,t)}),"stale-abstractions":(e,i,t)=>({phase:"stale-abstractions",stale:me(e,i,t)}),drift:(e,i,t)=>({phase:"drift",drift:be(e,i,t)}),"complexity-hotspots":(e,i,t)=>({phase:"complexity-hotspots",complexity:Ce(e,i,t)}),"git-evidence":(e,i,t)=>({phase:"git-evidence",gitEvidence:fe(e,t)}),suppressions:(e,i,t)=>({phase:"suppressions",suppressions:ge(e,t)})};function Ue(e,i={}){return G(e,i.full===!0,(t,r)=>{let n=ae(e,i.scope,t,r);return y(n)})}function qe(e,i,t={}){return G(e,t.full===!0,(r,n)=>N[i](e,t.scope,n,r))}function G(e,i,t){let r=k(e),n=He(r,i);try{return t(r,n)}finally{x(e,{semanticProvider:!0}),S()}}function Qe(e){return y(W(e))}function W(e){let i=s(e,"overview");return{statsResult:i.statsResult,warnings:i.warnings,dead:s(e,"dead").dead,isolated:s(e,"isolated").isolated,realCycleCount:s(e,"cycles").realCycleCount,similarCount:s(e,"similar").similarCount,extractCount:s(e,"extract-candidates").extractCount,wrappers:s(e,"wrapper-candidates").wrappers,passthroughs:s(e,"passthrough-candidates").passthroughs,stale:s(e,"stale-abstractions").stale,drift:s(e,"drift").drift,complexity:s(e,"complexity-hotspots").complexity,gitEvidence:j(e,"git-evidence")?.gitEvidence??null,suppressions:j(e,"suppressions")?.suppressions??null}}function j(e,i){return e.find(t=>t.phase===i)}function s(e,i){let t=e.find(r=>r.phase===i);if(!t)throw new Error(`Missing health phase result: ${i}`);return t}function ae(e,i,t,r){return W(oe.map(n=>N[n](e,i,r,t)))}function se(e,i,t){return c(e,t,"dead",()=>{let r=R(e,{scope:i,...u.dead,scanLimit:t.candidateScanLimit});return v(Se(e,r.symbols))})}function ce(e,i,t){return c(e,t,"isolated",()=>{let r=_(e,{scope:i,...u.isolated,scanLimit:t.candidateScanLimit});return v(ve(e,r))})}function ue(e,i,t){return c(e,t,"cycles",()=>D(e,{scope:i}).filter(n=>n.kind==="real").length)}function le(e,i,t){return c(e,t,"similar",()=>$(e,{scope:i,...u.similar,scanLimit:t.candidateScanLimit}).length)}function de(e,i,t){return c(e,t,"extract-candidates",()=>B(e,{scope:i,...u.extract,scanLimit:t.candidateScanLimit}).length)}function he(e,i,t){return U(e,t,"wrapper-candidates",()=>z(e,{scope:i,...u.wrappers,scanLimit:t.candidateScanLimit}))}function pe(e,i,t){return U(e,t,"passthrough-candidates",()=>M(e,{scope:i,...u.passthroughs,scanLimit:t.candidateScanLimit}))}function me(e,i,t){return c(e,t,"stale-abstractions",()=>{let r=F(e,{scope:i,...u.stale,scanLimit:t.candidateScanLimit}),n=r.filter(o=>o.consumers===0).length;return{count:r.length,loc:r.reduce((o,a)=>o+a.loc,0),files:[...new Set(r.map(o=>o.file))],unused:n,singleUse:r.length-n}})}function fe(e,i){return c(e,i,"git-evidence",()=>{let t=E(e);if(!t)return null;let r=A(e,void 0,{limit:50}),n={};for(let[o,a]of t)n[o]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:P(e),hiddenCoupling:{pairCount:r.findings.length,top:r.findings.slice(0,5).map(o=>({fileA:o.fileA,fileB:o.fileB,together:o.together,confidence:o.confidence}))},fileStats:n}})}function ge(e,i){return c(e,i,"suppressions",()=>{let t=I(e);return{total:t.total,byCategory:{...t.byCategory}}})}function be(e,i,t){return c(e,t,"drift",()=>{let r=T(e,{scope:i,...u.drift});return{count:r.unusedImports+r.layerViolations,unusedImports:r.unusedImports,layerViolations:r.layerViolations}})}function Ce(e,i,t){return c(e,t,"complexity-hotspots",()=>{let r=L(e,{scope:i,minLoc:10,limit:10,scanLimit:t.candidateScanLimit,semantic:!1});return{top:r.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:r.filter(n=>n.score>ie).length}})}function He(e,i){return e.symbols>=re||e.documents>=ne?i?{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:["Large index detected; running unbounded health analyses because --full was supplied."]}:{candidateScanLimit:V,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${V} symbols. Run "scip-query health --full" for unbounded candidate counts.`]}:{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:[]}}function xe(e,i){i.releaseCachesBetweenPhases&&(x(e),S())}function c(e,i,t,r){ye(t);try{return r()}finally{xe(e,i)}}function U(e,i,t,r){return c(e,i,t,()=>v(r()))}function ye(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Se(e,i){return i.filter(t=>!C(e,t.relativePath)&&!H(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function ve(e,i){return i.filter(t=>!C(e,t.relativePath)&&!H(e,t.symbol,t.relativePath))}function v(e){let i=new Set;for(let t of e){let r=t.relativePath??t.file;r&&i.add(r)}return{count:e.length,loc:e.reduce((t,r)=>t+r.loc,0),files:[...i]}}export{oe as a,Ue as b,qe as c,Qe as d};
2
- //# sourceMappingURL=chunk-AI2ECT7L.js.map
@@ -1,2 +0,0 @@
1
- import{a as o,c as p}from"./chunk-MX6F756F.js";import{a as y}from"./chunk-IW7ASGVF.js";import{c as b}from"./chunk-O6KCZPJQ.js";function P(u,c={}){let{scope:f,minLoc:L=3,scanLimit:l}=c,s=new y(u),r=c.semantic!==!1,t=p(s.productionCallableDefinitions({scope:f,minLoc:L,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof l=="number"&&l>0}),l),h=s.crossFileCallerMap(t,{semantic:r}),a=new Set(h.keys());for(let e of s.frameworkReferencedSymbolIds(t))a.add(e);let n=s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:r}),m=t.filter(e=>!a.has(e.symbolId)).filter(e=>!n.has(e.symbolId)),I=s.sourceFallbackCallerFiles(m);for(let e of I.keys())a.add(e);let d=m.filter(e=>!a.has(e.symbolId)),C=s.symbolsWithNonSelfCallees(d,{additive:!0,semantic:r});for(let e of C)n.add(e);return d.filter(e=>!n.has(e.symbolId)).sort((e,i)=>o(i)-o(e)||e.relativePath.localeCompare(i.relativePath)||e.startLine-i.startLine).map(e=>({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o(e)}))}export{P as a};
2
- //# sourceMappingURL=chunk-BUAC4Q4G.js.map
@@ -1,2 +0,0 @@
1
- import{b}from"./chunk-OAI5GEIN.js";import{e as d}from"./chunk-R3G6ERW7.js";function C(m,r={}){let{windowCommits:a=100,minSimilarity:u=.7,limit:c=30,scope:g,scanLimit:f}=r,o=d(m);if(!o)return{available:!1,windowCommits:a,findings:[]};let A=b(m,{scope:g,minSimilarity:u,limit:c*5,crossFileOnly:!0,scanLimit:f,semantic:r.semantic}),n=[];for(let e of A){let i=o.get(e.fileA)?.commitsAgo??null,t=o.get(e.fileB)?.commitsAgo??null,s=i!==null&&i<=a,h=t!==null&&t<=a;if(!(!s&&!h)){if(s&&h){let l=(i??0)<=(t??0);n.push({kind:"twin",echoSymbol:l?e.shortNameA:e.shortNameB,echoFile:l?e.fileA:e.fileB,echoAgeCommits:(l?i:t)??0,establishedSymbol:l?e.shortNameB:e.shortNameA,establishedFile:l?e.fileB:e.fileA,establishedAgeCommits:l?t:i,similarity:e.similarity,sharedCallees:e.sharedCallees})}else n.push({kind:"echo",echoSymbol:s?e.shortNameA:e.shortNameB,echoFile:s?e.fileA:e.fileB,echoAgeCommits:(s?i:t)??0,establishedSymbol:s?e.shortNameB:e.shortNameA,establishedFile:s?e.fileB:e.fileA,establishedAgeCommits:s?t:i,similarity:e.similarity,sharedCallees:e.sharedCallees});if(n.length>=c)break}}return n.sort((e,i)=>(e.kind===i.kind?0:e.kind==="echo"?-1:1)||i.similarity-e.similarity),{available:!0,windowCommits:a,findings:n}}export{C as a};
2
- //# sourceMappingURL=chunk-BZ6LCGE6.js.map
@@ -1,2 +0,0 @@
1
- import{c as b}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-IW7ASGVF.js";import{a as f}from"./chunk-VDZIEDJB.js";import{a as c}from"./chunk-5QJIEYFB.js";import{c as l}from"./chunk-O6KCZPJQ.js";function R(o,e={}){let{limit:r=20,scope:s,minFanIn:i=2,minFanOut:n=2,scanLimit:m}=e,p=new u(o);return b(p.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof m=="number"&&m>0}),m).map(t=>y(o,t,e.semantic!==!1)).filter(t=>t.fanIn>=i&&t.fanOut>=n).sort((t,a)=>a.score-t.score||a.fanIn-t.fanIn).slice(0,r)}function y(o,e,r){let s=new Set(f(o,e,{limit:500,semantic:r}).map(n=>n.file)).size,i=new Set(c(o,e,{limit:500,semantic:r}).filter(n=>n.file!==e.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:e.symbol,shortName:l(e.symbol),fanIn:s,fanOut:i,score:s*i,definedIn:e.relativePath}}export{R as a};
2
- //# sourceMappingURL=chunk-CO3AL7NZ.js.map
@@ -1,4 +0,0 @@
1
- import{a as te,b as re,c as b,d as se,e as ne,f as oe,g as j,h as ie,i as U,j as ae,k as pe,l as E,m as W,n as T,o as V,p as z,q as S,r as Q,s as J,u as R,v as h,w as M,x as G}from"./chunk-WEJYUS5O.js";import{a as v,c as ce,d as me,e as C}from"./chunk-OH5HIAID.js";import{c as L}from"./chunk-VDZL45XI.js";import{basename as le}from"path";var Oe=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function y(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&Oe.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function P(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,pe(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function D(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function O(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=R(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=C(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=C(t,r),o=ce(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function ue(t,r,e){return I(t,r,s=>Ae(t,r,s),()=>ke(t,r,e))}function ke(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=le(o).replace(/\.[^.]+$/,"");return[$(o,i,z(t,r,o),h(n,i))]})}function Ae(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(c=>c.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=le(i).replace(/\.[^.]+$/,"");n.push(f(i,a,z(t,r,i),s))}return n}function de(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=R(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:Q(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function fe(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:Q(t,r,o)})}return s}function ge(t,r,e){return X(t,r,{csharp:s=>Le(t,r,s),vb:s=>we(t,r,s)},()=>{let s=ae(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),m=!!p,c=(m?p:a)?.trim()??i,l=c.split(".").pop()??c,u=m?a?.trim()??l:l;return[P(t,r,o,c,l,u,S(t,c,j))]})})}function we(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,m=a.text,c=m.split(".").pop()??m,l=p?.text??c;n.push(f(c,l,S(t,m,j),s,p?"namespace":"named"))}return n}function Le(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let m=p.text,c=m.split(".").pop()??m,l=a?.text??c;n.push(f(c,l,S(t,m,j),s,a?"namespace":"named"))}return n}var je=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Se(t,r){return je.get(t,r,()=>{let e=new Set,s=v(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function Y(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return ze(e).flatMap(s=>Qe(t,r,s.clause,s.specifier,s.start,s.end,e))}function Me(t,r,e){let s=$e(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...qe(t,r,e,o,s));return n}function $e(t,r,e){let s=g(e,new Set(["import_statement"]));if(me(r))for(let n of Se(t,r))s.add(n);return s}function qe(t,r,e,s,n){let o=Xe(s);if(!o)return[];let i=E(t,r,o),a=y(s,"import_clause");return a?Ue(e,a,i,n,Be(s.text)):[D("*",i)]}function Ue(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(We(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Fe(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Je(i,e,s,n));return o}function We(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Fe(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Ve(t,i);return O("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Je(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,m=a?.text??p;n.push(f(p,m,r,e,"named",{isTypeOnly:s||He(o.text)}))}return n}function Xe(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Be(t){return/^\s*import\s+type\b/.test(t)}function He(t){return/^\s*type\b/.test(t.trim())}function Ve(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function ze(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function Qe(t,r,e,s,n,o,i){let a=E(t,r,s),p=R(i,n,o);return e?Ge(e).map(c=>({...c,sourcePath:a})).map(c=>{if(c.kind==="namespace"){let l=M(p,c.localName);return O(c.importedName,c.sourcePath,{localName:c.localName,usedMembers:l,used:l.length>0||h(p,c.localName),isTypeOnly:c.isTypeOnly})}return c.kind==="side-effect"?D(c.importedName,c.sourcePath):$(c.importedName,c.localName??"",c.sourcePath,c.localName?h(p,c.localName):!1,c.kind,[],{isTypeOnly:c.isTypeOnly})}):[D("*",a)]}function Ge(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=Ye(s),i=[];return n&&i.push(...he(n,e)),o&&i.push(...he(o,e)),i}function he(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?x(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,m]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(m??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function Ye(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function K(t,r,e){let s=C(t,r);return s?st(t,r,s):Ke(t,r,e)}function Ke(t,r,e){return[...Ze(t,r,e),...et(t,r,e),...tt(t,r,e)]}function Ze(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=x(i).map(l=>rt(l.trim())).filter(l=>!!l),m=q(e,o.index),c=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:E(t,r,a),names:p,startLine:m,endLine:c})}return s}function et(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function tt(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function rt(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function st(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=nt(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=ot(n,o,i,a);s.push(p)}return s}function nt(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return E(t,r,n.text)}function ot(t,r,e,s){let n=y(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),m=a.namedChild(1);p&&i.push((m??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return y(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function xe(t,r,e){return X(t,r,{java:s=>it(t,r,s),kotlin:s=>at(t,r,s),scala:s=>pt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ct(t,r,o,n):[]}))}function it(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let m=p.text;if(i){n.push(O("*",S(t,m,b)));continue}let c=m.split(".").pop()??m;n.push(f(c,c,S(t,m,b),s))}return n}function at(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(O("*",S(t,i.text,b)));continue}let m=i.text,c=m.split(".").pop()??m,u=p?.namedChild(0)?.text??c;n.push(f(c,u,S(t,m,b),s))}return n}function pt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(O("*",S(t,p,b)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let _=u.text,A=d?.text??_;if(_==="_")continue;n.push(f(_,A,S(t,`${p}.${_}`,b),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,b),s))}continue}let m=a[a.length-1]?.text??p,c=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(m,m,S(t,c&&a.length>1?`${c}.${m}`:p,b),s))}return n}function ct(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),c=p?.trim();if(!c||c==="_")return[];let l=(m??c.split(".").pop()??c).trim(),u=c==="_"?n:`${n}.${c}`.replace(/\.\./g,".");return[P(t,r,s,u,c,l)]})}return[P(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function Ne(t,r,e){return I(t,r,s=>mt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.split(/\s+as\s+/i),c=p?.trim()??a,l=c.split("\\").pop()??c,u=(m??l).trim();return[P(t,r,n,c,l,u,S(t,c.replace(/\\/g,"."),U))]}):[]}))}function mt(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),U),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(m=>m.type==="namespace_name")?.text??"";for(let m of a.namedChildren){if(m.type!=="namespace_use_clause")continue;let{importedName:c,localName:l,qualified:u}=ye(m,p);c&&o(u,c,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:m,localName:c,qualified:l}=ye(p,"");m&&o(l,m,c)}}return n}function ye(t,r){let e=t.namedChildren.find(m=>m.type==="qualified_name"),s=t.namedChildren.filter(m=>m.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function be(t,r,e){return I(t,r,s=>lt(t,r,s),()=>dt(e).flatMap(s=>gt(t,r,s,e)))}function lt(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Ie(i);if(!a)continue;let p=W(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ut(i);if(a===null)continue;let p=W(t,r,a);for(let m=1;m<o.namedChildCount;m+=1){let c=o.namedChild(m);if(c.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Ie(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Ie(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ut(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=y(t,"import_prefix")?.text??"",e=y(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function dt(t){let r=t.split(`
2
- `),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,m=a+o.length,c=G(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
3
- ${u}`,m+=1+u.length,c+=G(u),s+=u.length+1}let l=ft(p);l&&e.push({...l,start:a,end:m})}return e}function ft(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function gt(t,r,e,s){let n=R(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return x(o).flatMap(p=>{let m=p.trim().replace(/,$/,"");if(!m)return[];let[c,l]=m.split(/\s+as\s+/),u=c.trim(),d=(l??u.split(".")[0]??u).trim(),_=W(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:_,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?W(t,r,e.module):null,a=[];for(let p of x(o)){let m=p.trim().replace(/,$/,"");if(!m)continue;if(m==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[c,l]=m.split(/\s+as\s+/),u=(l??c).trim();a.push({importedName:c.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as St}from"path";function Pe(t,r,e){return I(t,r,s=>xt(t,r,s),()=>ht(t,r,e))}function ht(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?V(t,r,i):null;if(a){let p=_e(i);return[$(p,p,a,h(n,p))]}return[D(i,a)]})}function xt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let m=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!m||m.type!=="string")continue;let l=m.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?V(t,r,l):null;if(u){let d=_e(l);n.push(f(d,d,u,s))}else n.push(D(l,u))}return n}function _e(t){return St(t).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function Ee(t,r,e){return I(t,r,s=>yt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?Nt(t,r,o,n):[]}))}function yt(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of F(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function F(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:B(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:B(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=B(r,e.text),o=[];for(let i of s.namedChildren)o.push(...F(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...F(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=F(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:B(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function B(t,r){return t?r?`${t}::${r}`:t:r}function Nt(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let c=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[_,A]=d.split(/\s+as\s+/),w=_?.trim();if(!w)return[];let Ce=(A??w.split("::").pop()??w).trim(),De=`${c}::${w}`.replace(/::::/g,"::");return[P(t,r,s,De,w.split("::").pop()??w,Ce,T(t,r,c))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),m=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[P(t,r,s,a,a.split("::").pop()??a,p,m)]}function Te(t,r,e){let s=C(t,r);if(s)return It(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Pt(t,r,i))}return n}function It(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!bt(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of F(o,""))i.importedName&&s.push(Z(t,r,i.qualifiedName))}return s}function bt(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Pt(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),m=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[Z(t,r,m)]})}return[Z(t,r,s)]}function Z(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function Re(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var _t={language:"javascript",extensions:te,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Y,parseReExports:K},Et=k({language:"python",extensions:re,imports:"ast-with-regex-fallback",parseImports:be}),Tt=k({language:"jvm",extensions:b,imports:"ast-dispatch-with-regex-fallback",parseImports:xe}),Rt={language:"rust",extensions:se,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ee,parseExports:Te},Ct=k({language:"ruby",extensions:ne,imports:"ast-with-regex-fallback",parseImports:Pe}),Dt=k({language:"c/cpp",extensions:oe,imports:"ast-with-regex-fallback",parseImports:ue}),Ot=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:ge}),kt={language:"dart",extensions:ie,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:de,parseExports:fe},At=k({language:"php",extensions:U,imports:"ast-with-regex-fallback",parseImports:Ne}),wt=[_t,Et,Tt,Rt,Ct,Dt,Ot,kt,At];function H(t){return Re(wt,t)}var ee={clearGroups:["whole-project","source-file"]},Lt=L("source-imports",ee),jt=L("source-exports",ee),vt=L("source-reexports",ee);function Yr(t,r){let e=J(r);return vt.get(t,e,()=>{let s=H(e);if(!s?.parseReExports)return[];let n=v(t,e);return n?s.parseReExports(t,e,n):[]})}function Kr(t,r){let e=J(r);return Lt.get(t,e,()=>{let s=H(e);if(!s)return[];let n=v(t,e);return n?s.parseImports(t,e,n):[]})}function Zr(t,r){let e=J(r);return jt.get(t,e,()=>{let s=H(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{Yr as a,Kr as b,Zr as c};
4
- //# sourceMappingURL=chunk-FVVT7GV6.js.map
@@ -1,2 +0,0 @@
1
- import{a as j,d as v}from"./chunk-R3G6ERW7.js";import{b as k,c as A,d as w}from"./chunk-ISCKLDSS.js";import{existsSync as F,readFileSync as U}from"fs";import{join as C}from"path";var S=/\.(?:md|mdx|rst|txt)$/i;function _(e){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(e)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(e)}var H=3,L=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function B(e,t={}){let{doc:s,limit:f=20,minCoupling:a=H}=t,n=j(e);if(!n)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=v(e)??new Set,d=new Map,g=new Map,p=new Set;for(let o of n.commits){let h=[...new Set(o.files)],m=h.filter(r=>S.test(r)),y=h.filter(r=>!S.test(r));for(let r of h){p.add(r);let l=d.get(r)??[];l.push(o.timestamp),d.set(r,l)}for(let r of m){let l=g.get(r);l||(l=new Map,g.set(r,l));for(let i of y)l.set(i,(l.get(i)??0)+1)}}let R=[...c].filter(o=>S.test(o)),z=M(c),D=[];for(let o of R){if(s!==void 0&&!o.includes(s)||s===void 0&&!E(e,o)||s!==void 0&&!F(C(e.config.projectRoot,o)))continue;let h=Math.max(0,...d.get(o)??[]),m=new Map,{resolved:y,broken:r}=N(e,o,c,z,p);for(let i of y){if(i===o||S.test(i))continue;let u=(d.get(i)??[]).filter(b=>b>h).length;u!==0&&m.set(i,{file:i,evidence:"reference",coChanges:0,changesSinceDocUpdate:u})}for(let[i,u]of g.get(o)??[]){if(u<a||!c.has(i))continue;let b=(d.get(i)??[]).filter(T=>T>h).length;if(b===0)continue;let x=m.get(i);x?(x.evidence="both",x.coChanges=u):m.set(i,{file:i,evidence:"co-change",coChanges:u,changesSinceDocUpdate:b})}if(m.size===0&&r.length===0)continue;let l=[...m.values()].sort((i,u)=>u.changesSinceDocUpdate-i.changesSinceDocUpdate);D.push({doc:o,docLastChangedAt:h,staleness:l.reduce((i,u)=>i+u.changesSinceDocUpdate,0)+r.length*10,subjects:l.slice(0,8),brokenReferences:r})}return D.sort((o,h)=>h.staleness-o.staleness),{available:!0,commitsAnalyzed:n.commits.length,docsScanned:R.length,findings:D.slice(0,f)}}function J(e,t){let s=v(e)??new Set,f=M(s),a=[];for(let n of s){if(!E(e,n))continue;let{resolved:c}=N(e,n,s,f,new Set),d=[...c].filter(g=>t.has(g));d.length>0&&a.push({doc:n,cited:d.sort()})}return a}function E(e,t){return S.test(t)&&!_(t)&&F(C(e.config.projectRoot,t))}function M(e){let t=new Map;for(let s of e){let f=s.split("/");for(let a of[2,3]){if(f.length<a)continue;let n=f.slice(-a).join("/"),c=t.get(n)??[];c.push(s),t.set(n,c)}}return t}function N(e,t,s,f,a){let n=new Set,c=new Set,d=I(e,t);if(!d)return{resolved:n,broken:[]};for(let g of d){if(s.has(g)){n.add(g);continue}let p=f.get(g);if(p&&p.length===1){n.add(p[0]);continue}p&&p.length>1||a.has(g)&&c.add(g)}return{resolved:n,broken:[...c]}}function I(e,t){let s;try{s=U(C(e.config.projectRoot,t),"utf-8")}catch{return null}let f=k(e,t,s),a=A(e,"doc-path-tokens",t,f);if(a!==null)try{return JSON.parse(a)}catch{}let n=[...new Set([...s.matchAll(L)].map(c=>c[0].replace(/^\.?\//,"")))];return w(e,"doc-path-tokens",t,f,JSON.stringify(n)),n}export{_ as a,B as b,J as c};
2
- //# sourceMappingURL=chunk-HXXRN77A.js.map
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-ZOT3WUZW.js";import{u as e}from"./chunk-O6KCZPJQ.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-ITHQJZTG.js.map
@@ -1,2 +0,0 @@
1
- import{a as R,e as T,f as k}from"./chunk-QYKKTYBN.js";import{b as V,c as j,d as G}from"./chunk-VDZIEDJB.js";import{c as B}from"./chunk-5QJIEYFB.js";import{a as K,k as I,l as O}from"./chunk-VGBSY6N7.js";import{a as C}from"./chunk-IVAIPXNO.js";import{c as M}from"./chunk-PBGTMPJ7.js";import{f as P,g as N,i as A,j as w,r as E,t as q}from"./chunk-O6KCZPJQ.js";import{b as h,c as m,d as v,f as x,k as b}from"./chunk-OH5HIAID.js";import{a as L}from"./chunk-NN3O7TPH.js";function H(i,e,t){let a=e.identifierResolution==="strict"?I:O;for(let n of e.paths)if(!(!m(n)&&!(e.includeVueSfc&&v(n)))&&!i.isIgnored(n)&&!e.skipPath?.(n))try{let l=(r,c,p,d)=>{if(e.candidateNames&&!e.candidateNames.has(r))return;let y=e.resolveTargets?e.resolveTargets({sourceFile:n,name:r,kind:c,defaultTargets:d}):d();for(let S of y)t({sourceFile:n,name:r,target:S,occurrences:p,kind:c})},f=K(i,n);for(let[r,c]of f)l(r,"identifier",c.length,()=>a(i,n,r));for(let r of b(i,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=r.kind==="cross-language-dispatch"?()=>I(i,n,r.name):()=>a(i,n,r.name);l(r.name,r.kind,r.occurrences,c)}}finally{e.afterPath?.(n)}}var W=class{constructor(e){this.db=e}db;scopedDefinitions(e){return q(this.db,e)}definitionsForFile(e){return E(this.db,e)}productionCallableDefinitions(e={}){let{scope:t,minLoc:a=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:l=!1,excludeTypesFiles:f=!1,excludeRootedSymbols:r=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:p=!1,excludeRustTraitImplMembers:d=!1,includeSuppressed:y=!1,sortByLocDesc:S=!1}=e,g=[];for(let s of this.scopedDefinitions(t)){let u=s.relativePath;if(this.db.isIgnored(u)||l&&T(this.db,u)||!Y(s,{requireFunctionLikeSymbol:c,requireCallableSymbol:p})||o!==void 0&&s.symbol===o)continue;let F=D(s);F<a||F>n||f&&_(u)||r&&k(this.db,s.symbol,u)||d&&A(s.symbol)||R(u)!=="test"&&(w(s.symbol)||!y&&h(this.db,u,s.startLine)||g.push(s))}return S?g.sort((s,u)=>D(u)-D(s)):g}calleeMap(e,t={}){return B(this.db,e,t)}crossFileCallerMap(e,t={}){return V(this.db,e,t)}sourceFallbackCallerFiles(e){return j(this.db,e)}callerFileMap(e,t={}){return G(this.db,e,t)}frameworkReferencedSymbolIds(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let o=t.get(n.leaf)??[];o.push(n.symbolId),t.set(n.leaf,o)}let a=new Set;for(let n of L(this.db,{includeIgnored:!1}))if(m(n)==="rust")for(let{name:o}of b(this.db,n,{includeRustAttributeNames:!0}))for(let l of t.get(o)??[])a.add(l);return a}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let a=new Map(e.map(o=>[o.symbolId,o.symbol])),n=this.calleeMap(e,t);return new Set([...n.entries()].filter(([o,l])=>{let f=a.get(o);return l.some(r=>r.symbol!==f)}).map(([o])=>o))}fileDependencyGraph(e){return C(this.db,e)}fileKind(e){return R(e)}hasSuppressionComment(e){return h(this.db,e.relativePath,e.startLine)}sourceFiles(){return M(this.db)}scanSourceReferences(e,t){H(this.db,e,t)}callableSignature(e){let t=x(this.db,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};function Y(i,e){return e.requireCallableSymbol?P(i.symbol):e.requireFunctionLikeSymbol?N(i.symbol):i.isFunctionLike}function D(i){return i.endLine-i.startLine+1}function _(i){return(i.split("/").pop()??"").includes("types")}export{W as a};
2
- //# sourceMappingURL=chunk-IW7ASGVF.js.map
@@ -1,2 +0,0 @@
1
- import{a as p,f as h}from"./chunk-R3G6ERW7.js";import{a as c}from"./chunk-QYKKTYBN.js";import{a as d}from"./chunk-IVAIPXNO.js";import{existsSync as A}from"fs";import{join as S}from"path";function T(e){return m.test(e)}var m=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules)\//i;function j(e,i,t={}){let{minTogether:o=4,minConfidence:r=.6,limit:a=30}=t,u=p(e),s=i!==void 0,f=h(e,{minTogether:s?Math.min(o,2):o,minConfidence:s?0:r});if(!u||!f)return{available:!1,commitsAnalyzed:0,findings:[]};let C=d(e),y=t.includeLinked===!0||s,l=[];for(let n of f){if(m.test(n.fileA)||m.test(n.fileB)||!b(e,n.fileA)||!b(e,n.fileB)||s&&!n.fileA.includes(i)&&!n.fileB.includes(i)||!s&&(c(n.fileA)==="test"||c(n.fileB)==="test"||k(n.fileA,n.fileB)))continue;let g=x(C,n.fileA,n.fileB);if(!(!y&&g)&&(l.push({...n,structurallyLinked:g}),l.length>=a))break}return{available:!0,commitsAnalyzed:u.commits.length,findings:l}}function b(e,i){return A(S(e.config.projectRoot,i))}function k(e,i){let t=e.lastIndexOf("/"),o=i.lastIndexOf("/");if(e.slice(0,t)!==i.slice(0,o))return!1;let r=e.slice(t+1).split(".")[0],a=i.slice(o+1).split(".")[0];return r!==""&&r===a}function x(e,i,t){return e.get(i)?.has(t)===!0||e.get(t)?.has(i)===!0}export{T as a,j as b};
2
- //# sourceMappingURL=chunk-JODYQDE4.js.map
@@ -1,2 +0,0 @@
1
- function r(e){return e.endLine-e.startLine+1}function u(e,n){return r(e)-r(n)||e.relativePath.localeCompare(n.relativePath)}function d(e,n){return typeof n!="number"||n<=0||e.length<=n?e:e.slice(0,n)}function f(e){let n=new Set,o=[];for(let t of e){let i=`${t.symbol}|${t.file}`;n.has(i)||(n.add(i),o.push(t))}return o}export{r as a,u as b,d as c,f as d};
2
- //# sourceMappingURL=chunk-MX6F756F.js.map
@@ -1,62 +0,0 @@
1
- import{a as h,h as S}from"./chunk-OH5HIAID.js";import{a as x}from"./chunk-NN3O7TPH.js";import{c as y}from"./chunk-VDZL45XI.js";var v={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function d(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let n=t[0],i=t[1],r=e.slice(n.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=F(r);return{scheme:n,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let t=d(e);if("kind"in t)return null;for(let n=t.descriptors.length-2;n>=0;n--){let i=t.descriptors[n];if(i?.suffix==="type")return i.name}return null}function F(e){let t=[],n=0;for(;n<e.length;){if(e[n]==="["){let s=e.indexOf("]",n+1);if(s===-1){t.push({name:e.slice(n+1),suffix:"type-param"});break}t.push({name:e.slice(n+1,s),suffix:"type-param"}),n=s+1;continue}if(e[n]==="("&&(t.length===0||n===0||D(e[n-1]))){let s=e.indexOf(")",n+1);if(s!==-1&&e[s+1]!=="."){t.push({name:e.slice(n+1,s),suffix:"parameter"}),n=s+1;continue}}let i;if(e[n]==="`"){let s=e.indexOf("`",n+1);if(s===-1){i=e.slice(n+1),t.push({name:i,suffix:"term"});break}i=e.slice(n+1,s),n=s+1}else{let s=n;for(;n<e.length&&!D(e[n]);)n++;i=e.slice(s,n)}if(n>=e.length){i&&t.push({name:i,suffix:"term"});break}let r=e[n];if(r==="("){let s=e.indexOf(")",n+1);s!==-1&&e[s+1]==="."?(t.push({name:i,suffix:"method"}),n=s+2):s!==-1?(t.push({name:i,suffix:"method"}),n=s+1):(t.push({name:i,suffix:"term"}),n++)}else{let s=v[r];s&&t.push({name:i,suffix:s}),n+=1}}return t}function D(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function _(e){let t=d(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let n=t;if(n.descriptors.length===0)return n.raw;let i=[];for(let r of n.descriptors){let s=w(r);s&&i.push(s)}return i.join(":")}function w(e){let t=e.suffix==="namespace"?C(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function C(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function L(e){let t=d(e);if("kind"in t&&t.kind==="local")return t.id;let n=t;return n.descriptors.length===0?"":n.descriptors[n.descriptors.length-1].name}function f(e){let t=d(e);if("kind"in t&&t.kind==="local")return null;let n=t;return n.descriptors[n.descriptors.length-1]?.suffix??null}function te(e){return e.endsWith("().")||f(e)==="method"}function I(e){let t=f(e);return t==="method"||t==="term"}function re(e){return f(e)==="namespace"}var A=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function ie(e){return A.test(e)}var T=new Set(["test","tests","_tests"]);function se(e){let t=d(e);if("kind"in t)return!1;for(let n=0;n<t.descriptors.length-1;n+=1){let i=t.descriptors[n];if(i?.suffix==="namespace"&&i.name&&T.has(i.name))return!0}return!1}function oe(e,t){let n=d(e),i=d(t);if("kind"in n||"kind"in i)return!1;let r=n.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ae(e,t){let n=d(e),i=d(t);if("kind"in n||"kind"in i)return!1;let r=n.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ce(e,t){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
2
- FROM global_symbols gs
3
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
- JOIN documents d ON der.document_id = d.id
5
- WHERE ${t.where}
6
- ${e.pathExclusionsFor("d")}
7
- ${M(t.orderBy)}
8
- ${k(t.limit)}`,...t.params??[])}function ue(e,t){return e.all(`SELECT
9
- gs.id,
10
- gs.symbol,
11
- c.document_id,
12
- MIN(c.start_line) AS start_line,
13
- MAX(c.end_line) AS end_line,
14
- d.relative_path,
15
- gs.display_name,
16
- gs.documentation
17
- FROM global_symbols gs
18
- JOIN mentions m ON m.symbol_id = gs.id
19
- JOIN chunks c ON m.chunk_id = c.id
20
- JOIN documents d ON c.document_id = d.id
21
- WHERE m.role = 1
22
- AND ${t.where}
23
- ${e.pathExclusionsFor("d")}
24
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
25
- ${M(t.orderBy)}
26
- ${k(t.limit)}`,...t.params??[])}function M(e){return e?`ORDER BY ${e}`:""}function k(e){return typeof e=="number"?`LIMIT ${e}`:""}function N(e){return!e||!e.trim()?null:e.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()||null}function O(e){if(!e)return null;let t=R(e);if(t)return t.replace(/\n/g," ");let n=e.indexOf("|");if(n===-1)return e.replace(/\n/g," ");let i=e.slice(n+1);return(R(i)??i).replace(/\n/g," ")}function R(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function Q(e){if(m(e.symbol)!==null)return!1;let n=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(n)}function $(e,t,n={}){let i=new Map;for(let s of t)e.length>0&&!Q(s)||i.set(s.id,s);for(let s of e)i.set(s.id,s);let r=[...i.values()];return n.sort?r.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):r}var P=y("file-definitions",{clearGroups:["definition-catalog"]});function g(e,t){return P.get(e,t,()=>{let n=$(B(e,t),j(e,t),{sort:!0});return H(e,t,n.map(J))})}function B(e,t){return e.all(`SELECT
27
- gs.id,
28
- gs.symbol,
29
- der.document_id,
30
- der.start_line,
31
- der.end_line,
32
- d.relative_path,
33
- gs.display_name,
34
- gs.kind,
35
- gs.documentation,
36
- gs.enclosing_symbol
37
- FROM global_symbols gs
38
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
39
- JOIN documents d ON der.document_id = d.id
40
- WHERE d.relative_path = ?
41
- ${e.symbolNoiseFor("gs")}
42
- ORDER BY der.start_line, der.end_line`,t)}function j(e,t){return e.all(`SELECT
43
- gs.id,
44
- gs.symbol,
45
- c.document_id,
46
- MIN(c.start_line) AS start_line,
47
- MAX(c.end_line) AS end_line,
48
- d.relative_path,
49
- gs.display_name,
50
- gs.kind,
51
- gs.documentation,
52
- gs.enclosing_symbol
53
- FROM global_symbols gs
54
- JOIN mentions m ON m.symbol_id = gs.id
55
- JOIN chunks c ON m.chunk_id = c.id
56
- JOIN documents d ON c.document_id = d.id
57
- WHERE d.relative_path = ?
58
- AND m.role = 1
59
- ${e.symbolNoiseFor("gs")}
60
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
61
- ORDER BY start_line, end_line`,t)}function J(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,endLine:e.end_line,relativePath:e.relative_path,leaf:L(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:I(e.symbol),isTypeLike:f(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function De(e,t={}){return W(e,t.scope)}function W(e,t){return x(e,{scope:t,includeIgnored:!1}).flatMap(n=>g(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function _e(e,t,n={}){if(t.length===0)return[];let i=t.flatMap(r=>g(e,r)).filter(r=>!e.isIgnored(r.relativePath));return n.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),n.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:_(r.symbol),signature:N(O(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Le(e,t){let n=null;for(let i of e)i.startLine>t||i.endLine<t||(!n||i.endLine-i.startLine<n.endLine-n.startLine)&&(n=i);return n}function Ie(e,t){let n=g(e,t.relative_path).find(i=>i.symbolId===t.id);return n?{symbolId:n.symbolId,symbol:n.symbol,documentId:n.documentId,startLine:n.startLine,endLine:n.endLine,relativePath:n.relativePath}:{symbolId:t.id,symbol:t.symbol,documentId:t.document_id,startLine:t.start_line,endLine:t.end_line,relativePath:t.relative_path}}function H(e,t,n){let i=h(e,t),r=S(e,t);return r?X(n,r,i):i?z(n,i):n}function z(e,t){let n=t.split(/\r?\n/),i=U(e,n),r=Y(e,i),s=Z(r,n);return G(e,s)}function U(e,t){let n=e.some(r=>b(r.symbol))?q(t):null,i=new Map;for(let r of e)i.set(r.symbolId,V(t,n,r));return i}function Y(e,t){return e.filter(n=>b(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,i)=>n.startLine-i.startLine||n.definition.startLine-i.definition.startLine||n.definition.symbol.localeCompare(i.definition.symbol))}function Z(e,t){let n=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):t.length-1;n.set(r.definition.symbolId,{startLine:r.startLine,endLine:ee(t,r.definition,r.startLine,o)})}return n}function G(e,t){return e.map(n=>{let i=t.get(n.symbolId);return i?{...n,startLine:i.startLine,endLine:i.endLine}:n})}function X(e,t,n=null){let i=new Map;for(let r of t){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!K(r)||!r.leaf)return E(r,n);let s=i.get(r.leaf);if(!s||s.length===0)return E(r,n);let o=s[0],a=Math.abs(o.startLine-r.startLine);for(let c=1;c<s.length;c+=1){let l=s[c],u=Math.abs(l.startLine-r.startLine);u<a&&(o=l,a=u)}return{...r,startLine:o.startLine,endLine:o.endLine}})}function K(e){return b(e.symbol)?!0:f(e.symbol)==="term"&&m(e.symbol)===null}function E(e,t){if(!t||!e.leaf||f(e.symbol)!=="term"||m(e.symbol)!==null)return e;let n=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),s=t.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function V(e,t,n){if(!b(n.symbol))return n.startLine;let i=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return i;let r=t.get(n.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-n.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function q(e){let t=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,n=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let u of c.matchAll(t))u[1]&&o(u[1],a);for(let u of c.matchAll(n))u[1]&&o(u[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let u of c.matchAll(r))u[1]&&o(u[1],a)}return s}function ee(e,t,n,i){let r=Math.max(n,Math.min(e.length-1,i)),s=Math.max(n,Math.min(r,t.endLine)),o=0,a=0,c=!1;for(let l=n;l<=r;l+=1){let u=ne(e[l]??"");for(let p of u)p==="{"?(o+=1,c=!0):p==="}"?o=Math.max(0,o-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function ne(e){let t="",n=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!n&&s==="/"&&o==="/"){t+=" ".repeat(e.length-r);break}if(n){if(i){i=!1,t+=" ";continue}if(s==="\\"){i=!0,t+=" ";continue}s===n&&(n=null),t+=" ";continue}if(s==='"'||s==="'"||s==="`"){n=s,t+=" ";continue}t+=s}return t}function b(e){return e.includes("().")}function Re(e){let t=d(e);if("kind"in t)return[];let n=[];for(let i=t.descriptors.length-2;i>=0;i-=1){let r=t.descriptors[i];r?.suffix==="type"&&r.name&&n.push(r.name)}return n}export{d as a,m as b,_ as c,L as d,f as e,te as f,I as g,re as h,ie as i,se as j,oe as k,ae as l,ce as m,ue as n,N as o,O as p,$ as q,g as r,De as s,W as t,_e as u,Le as v,Ie as w,Re as x};
62
- //# sourceMappingURL=chunk-O6KCZPJQ.js.map
@@ -1,6 +0,0 @@
1
- import{a as k,b as y,e as L,f as E}from"./chunk-UIWAZ2NT.js";import{c as q}from"./chunk-MX6F756F.js";import{a as F}from"./chunk-IW7ASGVF.js";import{a as N}from"./chunk-5QJIEYFB.js";import{a as A}from"./chunk-4MHT7LKP.js";import{c as p,d as M,g as R}from"./chunk-O6KCZPJQ.js";import{a as z}from"./chunk-OH5HIAID.js";import{d as w}from"./chunk-VDZL45XI.js";function ue(e,n,i={}){let{minSimilarity:r=.4,limit:s=20}=i,l=V(e,n,{semantic:i.semantic!==!1});if(!l)return[];if(!R(l.symbol))return[];let t=U(e,l,r,{scanLimit:i.scanLimit,semantic:i.semantic!==!1});return t.length>0?t.slice(0,s):H(e,n,{minSimilarity:r,limit:s})}function U(e,n,i,r){let s=I(e,{minCallees:3,excludeSymbol:n.symbol,scanLimit:r.scanLimit,semantic:r.semantic}),l=L([n,...s].map(o=>o.callees)),t=[];for(let o of s){if(o.callees.size<3)continue;let a=$(n,o,l,{minSimilarity:i,requireSignificantShared:1,requireSharedCount:0});a&&t.push(a)}return t.sort((o,a)=>a.similarity-o.similarity),t}function $(e,n,i,r){let{similarity:s,significantShared:l}=E(e.callees,n.callees,i);if(s<r.minSimilarity)return null;let t=k(e.callees,n.callees).size;if(l.length<r.requireSignificantShared&&t<r.requireSharedCount)return null;let o=l.length>0?l:[...k(e.callees,n.callees)];return{symbolA:e.symbol,shortNameA:p(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:p(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:o.map(p),uniqueToA:[...y(e.callees,n.callees)].map(p),uniqueToB:[...y(n.callees,e.callees)].map(p)}}function be(e,n={}){let{minSimilarity:i=.5,limit:r=20,scope:s,minCallees:l=4,crossFileOnly:t=!1,scanLimit:o}=n,a=I(e,{minCallees:l,scope:s,scanLimit:o,semantic:n.semantic!==!1}),c=L(a.map(u=>u.callees)),m=new Map;for(let u of a)for(let b of u.callees)m.set(b,(m.get(b)??0)+1);let h=Math.max(8,Math.ceil(Math.sqrt(a.length))),x=new Map;for(let u=0;u<a.length;u+=1)for(let b of a[u].callees){if((m.get(b)??0)>h)continue;let g=x.get(b);g||(g=[],x.set(b,g)),g.push(u)}let C=[],P=new Set;e:for(let u=0;u<a.length;u+=1){let b=a[u],g=new Set;for(let D of b.callees){let S=x.get(D);if(S)for(let f of S)f>u&&g.add(f)}for(let D of g){let S=`${u}|${D}`;if(P.has(S))continue;P.add(S);let f=a[D];if(t&&b.file===f.file)continue;if(b.paramCount>=0&&f.paramCount>=0){let _=Math.abs(b.paramCount-f.paramCount),O=Math.max(2,Math.ceil(Math.max(b.paramCount,f.paramCount)*.5));if(_>O)continue}let B=$(b,f,c,{minSimilarity:i,requireSignificantShared:2,requireSharedCount:4});if(B&&(C.push(B),C.length>r*5))break e}}return C.sort((u,b)=>b.similarity-u.similarity),C.slice(0,r)}var G=["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 V(e,n,i){let r=A(e,n),s=new F(e);if(!r)return null;let l=N(e,r,{semantic:i.semantic});return{symbol:r.symbol,file:r.relativePath,callees:T(l.map(t=>t.symbol)),paramCount:s.callableSignature(r)?.paramCount??-1}}var Z=w("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]});function I(e,n){let{minCallees:i,scope:r,excludeSymbol:s,scanLimit:l}=n,t=n.semantic!==!1,o=Z.get(e,()=>new Map),a=`${i}|${r??""}|${l??""}|${t}`,c=o.get(a);return c||(c=W(e,{minCallees:i,scope:r,scanLimit:l,semantic:t}),o.set(a,c)),s===void 0?c:c.filter(m=>m.symbol!==s)}function W(e,n){let{minCallees:i,scope:r,scanLimit:s,semantic:l}=n,t=new F(e),o=q(t.productionCallableDefinitions({scope:r,minLoc:5,sortByLocDesc:typeof s=="number"&&s>0}),s),a=t.calleeMap(o,{semantic:l});return o.map(c=>({symbol:c.symbol,file:c.relativePath,callees:T((a.get(c.symbolId)??[]).map(m=>m.symbol)),paramCount:t.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=i)}function T(e){return new Set([...e].filter(n=>!K(n)))}function K(e){return G.some(n=>e.includes(n))}function H(e,n,i){let r=J(e,n);if(!r||r.tokens.size<3)return[];let s=i.minSimilarity>=.5?i.minSimilarity:.3,l=[];for(let t of Y(e)){if(t.symbol===r.symbol||t.tokens.size<3)continue;let o=k(r.tokens,t.tokens);if(o.size<2)continue;let a=new Set([...r.tokens,...t.tokens]),c=a.size>0?o.size/a.size:0;c<s||l.push({symbolA:r.symbol,shortNameA:p(r.symbol),fileA:r.file,symbolB:t.symbol,shortNameB:p(t.symbol),fileB:t.file,similarity:c,similarityBasis:"source-tokens",sharedCallees:[...o].sort(),uniqueToA:[...y(r.tokens,t.tokens)].sort(),uniqueToB:[...y(t.tokens,r.tokens)].sort()})}return l.sort((t,o)=>o.similarity-t.similarity||t.shortNameB.localeCompare(o.shortNameB)),l.slice(0,i.limit)}function J(e,n){let i=A(e,n);if(!i||!R(i.symbol))return null;let r=Q(e,i);return r?{symbol:i.symbol,file:i.relativePath,tokens:r}:null}function Q(e,n){let i=M(n.symbol),r=v(e,n.relativePath,n.startLine,n.endLine,i),s=j(r,i);return s.size>0?s:null}var X=w("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]});function Y(e){return X.get(e,()=>ee(e))}function ee(e){return new F(e).productionCallableDefinitions().map(i=>({symbol:i.symbol,file:i.relativePath,tokens:j(v(e,i.relativePath,i.startLine,i.endLine,i.leaf),i.leaf)})).filter(i=>i.tokens.size>0)}function v(e,n,i,r,s){let l=z(e,n);if(!l)return"";let t=l.split(`
2
- `);if(r>=i&&r-i<=12)return t.slice(i,r+1).join(`
3
- `);let o=[new RegExp(`\\bdef\\s+${d(s)}\\b`),new RegExp(`\\bfun\\s+${d(s)}\\b`),new RegExp(`\\bfn\\s+${d(s)}\\b`),new RegExp(`\\bfunction\\s+${d(s)}\\b`),new RegExp(`\\b${d(s)}\\s*\\(`)],a=t.findIndex(c=>o.some(m=>m.test(c)));if(a>=0){let c=a;for(let m=a+1;m<t.length&&m<=a+8;m++){let h=t[m]??"";if(m>a&&te(h)||(c=m,h.trim()===""&&m>a+1))break}return t.slice(a,c+1).join(`
4
- `)}return t.slice(i,Math.min(t.length,i+8)).join(`
5
- `)}function j(e,n){if(!e)return new Set;let i=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"]),r=ie(n),l=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(t=>t.trim()).filter(t=>t.length>1).filter(t=>!i.has(t)).filter(t=>!r.has(t));return new Set(l)}function ie(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 te(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{ue as a,be as b,I as c,T as d};
6
- //# sourceMappingURL=chunk-OAI5GEIN.js.map
@@ -1,4 +0,0 @@
1
- import{b as F,c as k,d as R}from"./chunk-ISCKLDSS.js";import{c as w,e as b}from"./chunk-VDZL45XI.js";import{existsSync as X,readFileSync as $}from"fs";import{join as Z}from"path";var ee=w("source-text",{clearGroups:["whole-project","source-file"]});function g(e,t){let r=t.replace(/\\/g,"/");return ee.get(e,r,()=>{let n=Z(e.config.projectRoot,r);return X(n)?$(n,"utf-8"):""})}var te=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift|extract)?/i;function Qe(e,t,r){if(r<=0)return!1;let n=g(e,t);if(!n)return!1;let s=n.split(`
2
- `);for(let a=r-1;a>=0&&a>=r-5;a-=1){let i=(s[a]??"").trim();if(i!==""){if(te.test(i))return!0;if(!i.startsWith("//")&&!i.startsWith("*")&&!i.startsWith("/*")&&!i.startsWith("@")&&!i.startsWith("#"))return!1}}return!1}import{extname as T}from"path";var re={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function h(e){return re[T(e).toLowerCase()]??null}function C(e){return T(e).toLowerCase()===".vue"}import{createRequire as ne}from"module";var f=ne(import.meta.url),x=null,j=!1;function se(){if(j)return null;if(x)return x;try{return x=f("tree-sitter"),x}catch{return j=!0,null}}var E=new Map,N=new Set;function ae(e){if(N.has(e))return null;let t=E.get(e);if(t)return t;let r;try{switch(e){case"rust":r=f("tree-sitter-rust");break;case"typescript":r=f("tree-sitter-typescript").typescript;break;case"tsx":r=f("tree-sitter-typescript").tsx;break;case"javascript":r=f("tree-sitter-javascript");break;case"python":r=f("tree-sitter-python");break;case"java":r=f("tree-sitter-java");break;case"kotlin":r=f("tree-sitter-kotlin");break;case"scala":r=f("tree-sitter-scala");break;case"ruby":r=f("tree-sitter-ruby");break;case"c":r=f("tree-sitter-c");break;case"cpp":r=f("tree-sitter-cpp");break;case"csharp":r=f("tree-sitter-c-sharp");break;case"php":r=f("tree-sitter-php").php;break;case"vb":{let n=f("tree-sitter-vb-dotnet");r=n.language??n;break}}}catch{return N.add(e),null}return E.set(e,r),r}var D=new Map;function ie(e){let t=D.get(e);if(t)return t;let r=ae(e);if(!r)return null;let n=se();if(!n)return null;let s=new n;try{s.setLanguage(r)}catch{return N.add(e),null}return D.set(e,s),s}function oe(e,t){return e.parse(n=>n>=t.length?null:t.slice(n,Math.min(t.length,n+16384)))}function L(e,t){let r=ie(e);if(!r)return null;try{return oe(r,t)}catch{return null}}function I(e){let t=[],r=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let o of e.matchAll(r))typeof o.index=="number"&&t.push({tagOpen:o[1]??"",body:o[2]??"",openIdx:o.index+(o[0].length-(o[2]?.length??0)-9)});if(t.length===0)return null;let n=t.find(o=>/\bsetup\b/.test(o.tagOpen))??t[0],a=n.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),i=a==="ts"||a==="typescript"?"typescript":a==="tsx"?"tsx":"javascript";return{body:n.body,startLine:ce(e,n.openIdx),language:i}}function ce(e,t){let r=0;for(let n=0;n<t&&n<e.length;n++)e.charCodeAt(n)===10&&r++;return r}var M=b("ast-trees",{clearGroups:["whole-project","source-file"]});function _(e,t){if(C(t))return ue(e,t);let r=h(t);if(!r)return null;let n=g(e,t);return n?M.get(e,t,n,()=>L(r,n)):null}function ue(e,t){let r=g(e,t);return r?M.get(e,t,r,()=>{let n=I(r);if(!n)return null;let s=`
3
- `.repeat(n.startLine)+n.body;return L(n.language,s)}):null}function S(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var le=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function H(e,t){let r=fe(e,t);if(r)return{name:r.name,startLine:r.definitionNode.startPosition.row,endLine:r.definitionNode.endPosition.row,paramCount:O(r.functionNode),params:v(r.functionNode),paramsEndLine:P(r.functionNode),isLiteralPassthrough:B(r.functionNode,t)};if(!pe(e.type,t))return null;let n=e.childForFieldName("name")??e.namedChildren.find(s=>s.type==="identifier"||s.type==="property_identifier");return n?{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:O(e),params:v(e),paramsEndLine:P(e),isLiteralPassthrough:B(e,t)}:null}function Q(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function v(e){let t=Q(e);if(!t)return[];let r=[];for(let n of t.namedChildren){if(S(n))continue;if(n.type==="identifier"){r.push({name:n.text,simple:!0});continue}let s=n.namedChildren.some(o=>o.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(n.text),a=n.childForFieldName("pattern");if(!s&&a&&a.type==="identifier"){r.push({name:a.text,simple:!0});continue}let i=n.namedChildren.find(o=>o.type==="identifier");r.push({name:a?.type==="identifier"?a.text:i?.text??"",simple:!1})}return r}function P(e){let t=Q(e);return t?t.endPosition.row:e.startPosition.row}function pe(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?le.has(e):!1}function fe(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}if(e.type==="public_field_definition"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}return null}function O(e){let t=e.namedChildren.find(n=>n.type==="parameters"||n.type==="formal_parameters");if(!t)return 0;let r=0;for(let n of t.namedChildren)S(n)||(r+=1);return r}function B(e,t){let r=e.namedChildren.find(l=>l.type==="block"||l.type==="statement_block");if(!r)return!1;let n=r.namedChildren.filter(l=>!S(l));if(n.length!==1)return!1;let s=n[0],a=null;if(s.type==="return_statement"||s.type==="expression_statement"?a=s.namedChild(0)??null:t==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(a=s),!a)return!1;let i=t==="python"?"call":"call_expression";if(a.type!==i)return!1;let o=a.namedChildren.find(l=>l.type==="arguments"||l.type==="argument_list");if(!o)return!1;let u=o.namedChildren.filter(l=>!S(l)),c=e.namedChildren.find(l=>l.type==="parameters"||l.type==="formal_parameters");if(!c)return!1;let p=[];for(let l of c.namedChildren){if(l.type==="identifier"){p.push(l.text);continue}let d=l.namedChildren.find(J=>J.type==="identifier");d&&p.push(d.text)}if(u.length!==p.length)return!1;for(let l=0;l<p.length;l+=1){let d=u[l];if(d.type!=="identifier"||d.text!==p[l])return!1}return!0}function z(e,t){let r=me(e,t);if(!r)return null;let n=y(r);return n?{calleeLeaf:n,memberAccess:de(r),line:e.startPosition.row}:null}function me(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 de(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function y(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?y(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?y(t):null}case"super":case"self":case"this":return null;default:return null}}var ge=new Set(["identifier","type_identifier","field_identifier"]),ye=new Set(["identifier"]),he=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Se=new Set(["rust","python"]),be=/\{([^{}]*)\}/g,xe=/\b([A-Za-z_][\w]*)\b/g;function V(e,t){return Ce(t).has(e.type)}function G(e,t){return Se.has(t)&&e.type==="string_content"}function A(e){let t=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>t&&(t=s)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,s]of e)for(let a of s)r[a].add(n);return r}function Ce(e){return e==="rust"?ge:e==="python"?ye:he}function U(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(be)){let s=n[1]??"";for(let a of s.matchAll(xe))a[1]&&t(a[1],r)}}var Ne=[/\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],Le=/^#!?\[\s*serde\s*\(/,_e=/^#!?\[\s*schemars\s*\(/,Ae=/^#!?\[\s*validate\s*\(/,we=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function W(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 s=y(n);if(!s||!we.has(s))return;let a=e.namedChildren.find(u=>u.type==="arguments");if(!a)return;let i=a.namedChild(0);if(!i||i.type!=="string")return;let o=i.namedChildren.find(u=>u.type==="string_fragment");o&&r.add(o.text)}function Y(e,t){let r=Le.test(e),n=_e.test(e),s=Ae.test(e);if(!(!r&&!n&&!s))for(let a of Ne){a.lastIndex=0;let i;for(;(i=a.exec(e))!==null;){let o=i[1],u=o.split("::").pop()??o;u==="is_none"&&/\bOption\b/.test(o)||u==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||u&&t.add(u)}}}function K(e,t){let r=new Map,n=(i,o)=>{if(i===o)return;let u=r.get(i);u||(u=new Set,r.set(i,u)),u.add(o)},s=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),a=(i,o)=>{let u=c=>{s.has(c.type)&&c.text!==o&&n(c.text,o);for(let p of c.children)u(p)};for(let c of i.children)u(c)};if(t==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=i.namedChildren.find(c=>c.type==="type_identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="field_declaration_list"||c.type==="enum_variant_list"||c.type==="ordered_field_declaration_list");u&&a(u,o),i.type==="type_item"&&a(i,o)}else if(t==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let o=i.namedChildren.find(c=>c.type==="identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="block");if(u)for(let c of u.descendantsOfType("type"))for(let p of c.descendantsOfType("identifier"))p.text!==o&&n(p.text,o)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=i.namedChildren.find(u=>u.type==="type_identifier")?.text;o&&a(i,o)}return r}var Fe=b("source-facts",{clearGroups:["whole-project","source-file"]});function m(e,t){let r=h(t);if(!r)return null;let n=g(e,t);return n?Fe.get(e,t,n,()=>ke(e,t,r,n)):null}function ke(e,t,r,n){let s=F(e,t,n),a=k(e,"source-facts",t,s);if(a){let u=Te(a);if(u&&u.language===r)return u}let i=_(e,t);if(!i)return null;let o=De(i,r);return R(e,"source-facts",t,s,Re(o)),o}function Re(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 Te(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,s])=>[n,new Set(s)])),identifierLineMap:r,identifiersByLine:A(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function je(e,t,r,n){let s=m(e,t);return s?Ee(s,r,n)?.isLiteralPassthrough??!0:!0}function Ee(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function De(e,t){let r=[],n=[],s=new Set,a=new Set,i=new Map,o=(c,p)=>{let l=i.get(c);if(!l){i.set(c,[p]);return}l[l.length-1]!==p&&l.push(p)},u=c=>{let p=H(c,t);p&&r.push(p);let l=z(c,t);l&&n.push(l),W(c,t,a),t==="rust"&&(c.type==="attribute_item"||c.type==="inner_attribute_item")&&Y(c.text,s),V(c,t)&&o(c.text,c.startPosition.row),G(c,t)&&U(c,o);for(let d of c.children)u(d)};return u(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:K(e,t),identifierLineMap:i,identifiersByLine:A(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:a}}var q=new Set(["rust","typescript","tsx","javascript","python"]);function Ie(e,t){let r=m(e,t);return!r||!q.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function Me(e,t){let r=m(e,t);return!r||!q.has(r.language)?null:r.callSites}function ve(e,t){return m(e,t)?.typeContainerMap??new Map}function Pe(e,t,r={}){let n=m(e,t);if(!n)return[];let s=[];if(r.includeCrossLanguageDispatchNames)for(let a of n.crossLanguageDispatchNames)s.push({name:a,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let a of n.rustAttrReferencedNames)s.push({name:a,kind:"rust-attribute",occurrences:1});return s}export{g as a,Qe as b,h as c,C as d,_ as e,m as f,je as g,Ie as h,Me as i,ve as j,Pe as k};
4
- //# sourceMappingURL=chunk-OH5HIAID.js.map
@@ -1,2 +0,0 @@
1
- import{c as p}from"./chunk-PBGTMPJ7.js";import{a as i}from"./chunk-OH5HIAID.js";import{d as a}from"./chunk-VDZL45XI.js";var g=/scip-query[\s:-]*ignore[\s:-]*(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar)?/gi,y=a("suppression-inventory",{clearGroups:["whole-project"]});function b(e){return y.get(e,()=>d(e))}function d(e){let r={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,uncategorized:0},t=new Map,n=0;for(let o of p(e)){let s=i(e,o);if(!(!s||!s.includes("scip-query")))for(let c of s.matchAll(g)){n+=1,t.set(o,(t.get(o)??0)+1);let u=l(c[1]);r[u]+=1}}return{total:n,byCategory:r,byFile:t}}function l(e){if(!e)return"uncategorized";let r=e.toLowerCase();return r==="dead-code"?"dead":r}export{b as a};
2
- //# sourceMappingURL=chunk-OXKEUWMJ.js.map