@getchomp/mcp 0.0.0-stage → 0.2.42

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 (56) hide show
  1. package/README.md +15 -2
  2. package/dist/conventionsReference.d.ts +84 -0
  3. package/dist/conventionsReference.js +313 -0
  4. package/dist/designSystem/astScanner.d.ts +153 -0
  5. package/dist/designSystem/astScanner.js +2014 -0
  6. package/dist/designSystem/baseline.d.ts +65 -0
  7. package/dist/designSystem/baseline.js +136 -0
  8. package/dist/designSystem/color.d.ts +35 -0
  9. package/dist/designSystem/color.js +265 -0
  10. package/dist/designSystem/config.d.ts +183 -0
  11. package/dist/designSystem/config.js +469 -0
  12. package/dist/designSystem/contrast.d.ts +55 -0
  13. package/dist/designSystem/contrast.js +377 -0
  14. package/dist/designSystem/cssParser.d.ts +63 -0
  15. package/dist/designSystem/cssParser.js +469 -0
  16. package/dist/designSystem/merges.d.ts +57 -0
  17. package/dist/designSystem/merges.js +94 -0
  18. package/dist/designSystem/preprocessors.d.ts +46 -0
  19. package/dist/designSystem/preprocessors.js +1108 -0
  20. package/dist/designSystem/presentation.d.ts +45 -0
  21. package/dist/designSystem/presentation.js +796 -0
  22. package/dist/designSystem/styleVectors.d.ts +27 -0
  23. package/dist/designSystem/styleVectors.js +484 -0
  24. package/dist/designSystem/tokens.d.ts +39 -0
  25. package/dist/designSystem/tokens.js +409 -0
  26. package/dist/designSystem/topology.d.ts +64 -0
  27. package/dist/designSystem/topology.js +254 -0
  28. package/dist/designSystem/types.d.ts +857 -0
  29. package/dist/designSystem/types.js +113 -0
  30. package/dist/designSystem/typography.d.ts +25 -0
  31. package/dist/designSystem/typography.js +244 -0
  32. package/dist/designSystem/uiShapes.d.ts +74 -0
  33. package/dist/designSystem/uiShapes.js +285 -0
  34. package/dist/designSystem/valueClusters.d.ts +76 -0
  35. package/dist/designSystem/valueClusters.js +281 -0
  36. package/dist/designSystemPlugin.d.ts +321 -0
  37. package/dist/designSystemPlugin.js +4730 -0
  38. package/dist/enrichNodesPlugin.d.ts +160 -0
  39. package/dist/enrichNodesPlugin.js +957 -0
  40. package/dist/index.d.ts +65 -0
  41. package/dist/index.js +1298 -0
  42. package/dist/intelligence.d.ts +502 -0
  43. package/dist/intelligence.js +3058 -0
  44. package/dist/pluginRunner.d.ts +364 -0
  45. package/dist/pluginRunner.js +1096 -0
  46. package/dist/plugins/design-system/index.d.ts +14 -0
  47. package/dist/plugins/design-system/index.js +241 -0
  48. package/dist/plugins/enrich-nodes/index.d.ts +388 -0
  49. package/dist/plugins/enrich-nodes/index.js +697 -0
  50. package/dist/plugins/index.d.ts +15 -0
  51. package/dist/plugins/index.js +20 -0
  52. package/dist/plugins/local-shims/index.d.ts +121 -0
  53. package/dist/plugins/local-shims/index.js +237 -0
  54. package/dist/shimsPlugin.d.ts +134 -0
  55. package/dist/shimsPlugin.js +1392 -0
  56. package/package.json +38 -3
@@ -0,0 +1,409 @@
1
+ /**
2
+ * packages/mcp/src/designSystem/tokens.ts
3
+ *
4
+ * Derives token tiers (primitive → semantic → component) from the *reference graph* of the
5
+ * repo's own CSS custom properties instead of from naming conventions:
6
+ *
7
+ * - a literal (non-aliased) token → primitive (or semantic when it is re-declared per theme)
8
+ * - an alias of primitives only → semantic
9
+ * - an alias involving a semantic/component token, or a token declared in a scoped
10
+ * selector (`.card { --card-bg }`) → component
11
+ *
12
+ * Explicit `designSystem.tokens.tiers` regexes always win. `@theme` bridge tokens stay
13
+ * "semantic" (they are the Tailwind v4 theme surface).
14
+ */
15
+ import { compileRegexes } from "./config.js";
16
+ const SCALE_NAME_RE = /^(?:--|\$|@)(?:[a-z][a-z0-9]*-)*[a-z][a-z0-9]*-\d{1,4}$/;
17
+ export function isScaleStepTokenName(name) {
18
+ return SCALE_NAME_RE.test(name.toLowerCase());
19
+ }
20
+ export function deriveTokenTiers(decls, tiers) {
21
+ const primRes = compileRegexes(tiers.primitive);
22
+ const semRes = compileRegexes(tiers.semantic);
23
+ const compRes = compileRegexes(tiers.component);
24
+ const byName = new Map();
25
+ for (const d of decls) {
26
+ let list = byName.get(d.name);
27
+ if (!list) {
28
+ list = [];
29
+ byName.set(d.name, list);
30
+ }
31
+ list.push(d);
32
+ }
33
+ const memo = new Map();
34
+ const visiting = new Set();
35
+ const resolve = (name) => {
36
+ const cached = memo.get(name);
37
+ if (cached)
38
+ return cached;
39
+ const list = byName.get(name) ?? [];
40
+ let out;
41
+ if (compRes.some((re) => re.test(name)))
42
+ out = { tier: "component", source: "config" };
43
+ else if (semRes.some((re) => re.test(name)))
44
+ out = { tier: "semantic", source: "config" };
45
+ else if (primRes.some((re) => re.test(name)))
46
+ out = { tier: "primitive", source: "config" };
47
+ else if (list.length > 0 &&
48
+ list.every((d) => d.themeContext === "theme-bridge") &&
49
+ (list.some((d) => d.referencedVars.length > 0) || !isScaleStepTokenName(name))) {
50
+ out = { tier: "semantic", source: "theme-bridge" };
51
+ }
52
+ else {
53
+ const globals = list.filter((d) => d.scope !== "scoped");
54
+ if (globals.length === 0) {
55
+ out = { tier: "component", source: "scoped" };
56
+ }
57
+ else if (visiting.has(name)) {
58
+ out = { tier: "semantic", source: "derived" };
59
+ }
60
+ else {
61
+ visiting.add(name);
62
+ const refs = new Set();
63
+ for (const d of globals)
64
+ for (const r of d.referencedVars)
65
+ refs.add(r);
66
+ refs.delete(name);
67
+ const definedRefs = [...refs].filter((r) => byName.has(r));
68
+ if (refs.size === 0) {
69
+ if (isScaleStepTokenName(name)) {
70
+ out = { tier: "primitive", source: "derived" };
71
+ }
72
+ else {
73
+ const themed = globals.some((d) => d.themeContext === "dark" || d.themeContext === "light");
74
+ out = { tier: themed ? "semantic" : "primitive", source: "derived" };
75
+ }
76
+ }
77
+ else {
78
+ const refTiers = definedRefs.map((r) => resolve(r).tier);
79
+ const involvesHigher = refTiers.some((t) => t === "semantic" || t === "component");
80
+ out = { tier: involvesHigher ? "component" : "semantic", source: "derived" };
81
+ }
82
+ visiting.delete(name);
83
+ }
84
+ }
85
+ memo.set(name, out);
86
+ return out;
87
+ };
88
+ const result = new Map();
89
+ for (const name of byName.keys())
90
+ result.set(name, resolve(name));
91
+ return result;
92
+ }
93
+ const TRIVIAL_CSS_KEYWORDS = new Set([
94
+ "none",
95
+ "auto",
96
+ "inherit",
97
+ "initial",
98
+ "unset",
99
+ "revert",
100
+ "revert-layer",
101
+ "currentcolor",
102
+ "transparent",
103
+ "normal",
104
+ "nowrap",
105
+ "0",
106
+ "0px",
107
+ ]);
108
+ function normalizeTokenValueForComparison(value) {
109
+ return value.trim().toLowerCase().replace(/\s+/g, " ");
110
+ }
111
+ export function analyzeTokenLineageAndSymmetry(decls, tiersByName) {
112
+ const byName = new Map();
113
+ for (const d of decls) {
114
+ let list = byName.get(d.name);
115
+ if (!list) {
116
+ list = [];
117
+ byName.set(d.name, list);
118
+ }
119
+ list.push(d);
120
+ }
121
+ const globalDecls = decls.filter((d) => d.scope !== "scoped" && d.themeContext !== "theme-bridge");
122
+ const hasDarkTheme = globalDecls.some((d) => d.themeContext === "dark");
123
+ const hasLightTheme = globalDecls.some((d) => d.themeContext === "light");
124
+ const lineageRoleByName = new Map();
125
+ const backingByName = new Map();
126
+ const unbackedSemanticTokens = [];
127
+ const themeSymmetryIssues = [];
128
+ for (const [name, list] of byName.entries()) {
129
+ const derived = tiersByName.get(name);
130
+ const tier = derived?.tier ?? list[0]?.tier ?? "semantic";
131
+ const source = derived?.source ?? "derived";
132
+ const scaleStep = isScaleStepTokenName(name);
133
+ const allRefs = new Set();
134
+ for (const d of list) {
135
+ for (const ref of d.referencedVars) {
136
+ if (ref !== name)
137
+ allRefs.add(ref);
138
+ }
139
+ }
140
+ if (source === "theme-bridge") {
141
+ lineageRoleByName.set(name, "framework-bridge");
142
+ }
143
+ else if (tier === "primitive" || scaleStep) {
144
+ lineageRoleByName.set(name, "scale-primitive");
145
+ }
146
+ else if (tier === "component") {
147
+ lineageRoleByName.set(name, "component-slot");
148
+ }
149
+ else {
150
+ lineageRoleByName.set(name, "semantic-role");
151
+ }
152
+ const nonBridgeList = list.filter((d) => d.themeContext !== "theme-bridge");
153
+ if (tier === "primitive" || scaleStep) {
154
+ backingByName.set(name, "primitive-scale");
155
+ }
156
+ else if (source === "theme-bridge") {
157
+ backingByName.set(name, allRefs.size > 0 ? "backed" : "unbacked-literal");
158
+ }
159
+ else {
160
+ const activeList = nonBridgeList.length > 0 ? nonBridgeList : list;
161
+ const meaningful = activeList.filter((d) => !TRIVIAL_CSS_KEYWORDS.has(normalizeTokenValueForComparison(d.value)));
162
+ const anyUnreferenced = meaningful.some((d) => d.referencedVars.length === 0);
163
+ const hasAnyRefs = allRefs.size > 0;
164
+ const isUnbacked = !hasAnyRefs || (anyUnreferenced && meaningful.some((d) => d.themeContext === "dark" || d.themeContext === "light"));
165
+ backingByName.set(name, isUnbacked && meaningful.length > 0 ? "unbacked-literal" : "backed");
166
+ if (tier === "semantic" && isUnbacked && meaningful.length > 0 && activeList.some((d) => d.scope !== "scoped")) {
167
+ const values = {};
168
+ for (const d of meaningful) {
169
+ if (d.referencedVars.length === 0) {
170
+ values[d.themeContext] = d.value.trim();
171
+ }
172
+ }
173
+ const first = meaningful.find((d) => d.referencedVars.length === 0) ?? meaningful[0];
174
+ if (Object.keys(values).length > 0) {
175
+ unbackedSemanticTokens.push({
176
+ name,
177
+ tier,
178
+ filePath: first.filePath,
179
+ lineNumber: first.lineNumber,
180
+ values,
181
+ });
182
+ }
183
+ }
184
+ }
185
+ // Theme symmetry checks (only when both dark & light themes exist globally)
186
+ if (hasDarkTheme && hasLightTheme) {
187
+ const darkDecls = nonBridgeList.filter((d) => d.scope !== "scoped" && d.themeContext === "dark");
188
+ const lightDecls = nonBridgeList.filter((d) => d.scope !== "scoped" && d.themeContext === "light");
189
+ if (darkDecls.length > 0 && lightDecls.length === 0) {
190
+ const d0 = darkDecls[0];
191
+ themeSymmetryIssues.push({
192
+ kind: "missing-in-theme",
193
+ tokenName: name,
194
+ details: `Token '${name}' is declared in dark theme without a corresponding light theme declaration.`,
195
+ filePath: d0.filePath,
196
+ lineNumber: d0.lineNumber,
197
+ themes: ["dark"],
198
+ });
199
+ }
200
+ else if (lightDecls.length > 0 && darkDecls.length === 0) {
201
+ const d0 = lightDecls[0];
202
+ themeSymmetryIssues.push({
203
+ kind: "missing-in-theme",
204
+ tokenName: name,
205
+ details: `Token '${name}' is declared in light theme without a corresponding dark theme declaration.`,
206
+ filePath: d0.filePath,
207
+ lineNumber: d0.lineNumber,
208
+ themes: ["light"],
209
+ });
210
+ }
211
+ else if (darkDecls.length > 0 && lightDecls.length > 0) {
212
+ const darkMeaningful = darkDecls.filter((d) => !TRIVIAL_CSS_KEYWORDS.has(normalizeTokenValueForComparison(d.value)));
213
+ const lightMeaningful = lightDecls.filter((d) => !TRIVIAL_CSS_KEYWORDS.has(normalizeTokenValueForComparison(d.value)));
214
+ if (darkMeaningful.length > 0 && lightMeaningful.length > 0) {
215
+ const darkHasRef = darkMeaningful.some((d) => d.referencedVars.length > 0);
216
+ const lightHasRef = lightMeaningful.some((d) => d.referencedVars.length > 0);
217
+ if (darkHasRef !== lightHasRef) {
218
+ const first = darkHasRef ? lightMeaningful[0] : darkMeaningful[0];
219
+ themeSymmetryIssues.push({
220
+ kind: "reference-vs-literal",
221
+ tokenName: name,
222
+ details: `Token '${name}' uses var() reference in ${darkHasRef ? "dark" : "light"} theme (${(darkHasRef ? darkMeaningful[0] : lightMeaningful[0]).value}) but a raw literal in ${darkHasRef ? "light" : "dark"} theme (${first.value}).`,
223
+ filePath: first.filePath,
224
+ lineNumber: first.lineNumber,
225
+ themes: ["dark", "light"],
226
+ });
227
+ }
228
+ }
229
+ }
230
+ }
231
+ }
232
+ // Parallel token detection across semantic tokens:
233
+ // (1) Exact identical normalized (dark, light) or root values across distinct non-bridge semantic tokens
234
+ const semanticValueKey = new Map();
235
+ for (const [name, list] of byName.entries()) {
236
+ const tier = tiersByName.get(name)?.tier;
237
+ const source = tiersByName.get(name)?.source;
238
+ if (tier !== "semantic" || source === "theme-bridge" || isScaleStepTokenName(name))
239
+ continue;
240
+ const globalList = list.filter((d) => d.scope !== "scoped" && d.themeContext !== "theme-bridge");
241
+ if (globalList.length === 0)
242
+ continue;
243
+ const darkVal = globalList.find((d) => d.themeContext === "dark")?.value;
244
+ const lightVal = globalList.find((d) => d.themeContext === "light")?.value;
245
+ const rootVal = globalList.find((d) => d.themeContext === "root")?.value;
246
+ const key = darkVal && lightVal
247
+ ? `dl:${normalizeTokenValueForComparison(darkVal)}||${normalizeTokenValueForComparison(lightVal)}`
248
+ : rootVal
249
+ ? `r:${normalizeTokenValueForComparison(rootVal)}`
250
+ : null;
251
+ if (!key)
252
+ continue;
253
+ if (TRIVIAL_CSS_KEYWORDS.has(key.slice(key.indexOf(":") + 1)))
254
+ continue;
255
+ let bucket = semanticValueKey.get(key);
256
+ if (!bucket) {
257
+ bucket = [];
258
+ semanticValueKey.set(key, bucket);
259
+ }
260
+ bucket.push({ name, decl: globalList[0] });
261
+ }
262
+ const reportedParallel = new Set();
263
+ for (const bucket of semanticValueKey.values()) {
264
+ if (bucket.length < 2)
265
+ continue;
266
+ // Only flag cross-file duplicates or distinct prefix families where at least one is not intentionally aliasing the other
267
+ const canonical = bucket[0];
268
+ for (let i = 1; i < bucket.length; i++) {
269
+ const candidate = bucket[i];
270
+ const canDecls = byName.get(candidate.name) ?? [];
271
+ const refCanonical = canDecls.some((d) => d.referencedVars.includes(canonical.name));
272
+ const refBack = (byName.get(canonical.name) ?? []).some((d) => d.referencedVars.includes(candidate.name));
273
+ if (refCanonical || refBack)
274
+ continue;
275
+ reportedParallel.add(candidate.name);
276
+ themeSymmetryIssues.push({
277
+ kind: "duplicate-parallel-token",
278
+ tokenName: candidate.name,
279
+ otherTokenName: canonical.name,
280
+ details: `Semantic token '${candidate.name}' duplicates the exact theme values of '${canonical.name}'.`,
281
+ filePath: candidate.decl.filePath,
282
+ lineNumber: candidate.decl.lineNumber,
283
+ });
284
+ }
285
+ }
286
+ // (2) Secondary parallel theme island: a secondary stylesheet declaring a prefixed dark/light semantic set
287
+ // whose suffixes mirror semantic tokens in the primary themed token stylesheet.
288
+ const themedFileCounts = new Map();
289
+ const themedDeclsByFile = new Map();
290
+ for (const d of globalDecls) {
291
+ if (d.themeContext !== "dark" && d.themeContext !== "light")
292
+ continue;
293
+ if (tiersByName.get(d.name)?.tier !== "semantic")
294
+ continue;
295
+ themedFileCounts.set(d.filePath, (themedFileCounts.get(d.filePath) ?? 0) + 1);
296
+ let arr = themedDeclsByFile.get(d.filePath);
297
+ if (!arr) {
298
+ arr = [];
299
+ themedDeclsByFile.set(d.filePath, arr);
300
+ }
301
+ arr.push(d);
302
+ }
303
+ if (themedFileCounts.size >= 2) {
304
+ const sortedFiles = [...themedFileCounts.entries()].sort((a, b) => b[1] - a[1]);
305
+ const primaryFile = sortedFiles[0][0];
306
+ const primaryTokenNames = new Set((themedDeclsByFile.get(primaryFile) ?? []).map((d) => d.name.slice(2)));
307
+ const matchesPrimarySuffix = (suffix) => {
308
+ if (primaryTokenNames.has(suffix))
309
+ return `--${suffix}`;
310
+ for (const pName of primaryTokenNames) {
311
+ if (pName.endsWith(`-${suffix}`) || pName.startsWith(`${suffix}-`)) {
312
+ return `--${pName}`;
313
+ }
314
+ }
315
+ return undefined;
316
+ };
317
+ for (let i = 1; i < sortedFiles.length; i++) {
318
+ const [file, _] = sortedFiles[i];
319
+ const fileDecls = themedDeclsByFile.get(file) ?? [];
320
+ const prefixGroups = new Map();
321
+ for (const d of fileDecls) {
322
+ if (reportedParallel.has(d.name))
323
+ continue;
324
+ if (d.referencedVars.length > 0)
325
+ continue;
326
+ const raw = d.name.startsWith("--") ? d.name.slice(2) : d.name;
327
+ const dash = raw.indexOf("-");
328
+ if (dash <= 0 || dash === raw.length - 1)
329
+ continue;
330
+ const prefix = raw.slice(0, dash);
331
+ const suffix = raw.slice(dash + 1);
332
+ const peer = matchesPrimarySuffix(suffix);
333
+ if (!peer)
334
+ continue;
335
+ let grp = prefixGroups.get(prefix);
336
+ if (!grp) {
337
+ grp = new Map();
338
+ prefixGroups.set(prefix, grp);
339
+ }
340
+ if (!grp.has(d.name))
341
+ grp.set(d.name, { decl: d, peer });
342
+ }
343
+ for (const [prefix, entries] of prefixGroups.entries()) {
344
+ if (entries.size < 3)
345
+ continue;
346
+ for (const [tokName, info] of entries.entries()) {
347
+ reportedParallel.add(tokName);
348
+ themeSymmetryIssues.push({
349
+ kind: "duplicate-parallel-token",
350
+ tokenName: tokName,
351
+ otherTokenName: info.peer,
352
+ details: `Parallel theme block '--${prefix}-*' declares unbacked token '${tokName}' mirroring primary theme token '${info.peer}'.`,
353
+ filePath: info.decl.filePath,
354
+ lineNumber: info.decl.lineNumber,
355
+ themes: ["dark", "light"],
356
+ });
357
+ }
358
+ }
359
+ }
360
+ }
361
+ return {
362
+ lineageRoleByName,
363
+ backingByName,
364
+ unbackedSemanticTokens,
365
+ themeSymmetryIssues,
366
+ };
367
+ }
368
+ /**
369
+ * Computes the transitive closure of tokens reachable from actual consumer roots
370
+ * (CSS style rules, active Tailwind utilities, TS/JSX/canvas references) without
371
+ * seeding from `:root` / `[data-theme]` / `@theme` token declarations themselves.
372
+ */
373
+ export function computeLiveReferencedTokens(consumerRootNames, allTokenDecls) {
374
+ const depsByName = new Map();
375
+ for (const decl of allTokenDecls) {
376
+ let set = depsByName.get(decl.name);
377
+ if (!set) {
378
+ set = new Set();
379
+ depsByName.set(decl.name, set);
380
+ }
381
+ for (const ref of decl.referencedVars) {
382
+ if (ref !== decl.name)
383
+ set.add(ref);
384
+ }
385
+ }
386
+ const directlyReferencedTokens = new Set(consumerRootNames);
387
+ const liveTokens = new Set();
388
+ const queue = [];
389
+ for (const root of directlyReferencedTokens) {
390
+ if (!liveTokens.has(root)) {
391
+ liveTokens.add(root);
392
+ queue.push(root);
393
+ }
394
+ }
395
+ let head = 0;
396
+ while (head < queue.length) {
397
+ const curr = queue[head++];
398
+ const deps = depsByName.get(curr);
399
+ if (!deps)
400
+ continue;
401
+ for (const dep of deps) {
402
+ if (!liveTokens.has(dep)) {
403
+ liveTokens.add(dep);
404
+ queue.push(dep);
405
+ }
406
+ }
407
+ }
408
+ return { liveTokens, directlyReferencedTokens };
409
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * packages/mcp/src/designSystem/topology.ts
3
+ *
4
+ * UI role classification, AST/render-topology Atomic Design tier assignment,
5
+ * dynamic class prefix matching, and cycle-safe weakest-link subtree health rollup.
6
+ */
7
+ import type { StructuralNode } from "@getchomp/core";
8
+ import { type AtomDefinition, type DesignSystemConfig, type ResolvedDesignSystemConfig } from "./config.js";
9
+ import { type AtomicClassificationSource, type AtomicTier, type SubtreeHealthSummary, type UiRoleConventionRow } from "./types.js";
10
+ export declare function getPrimaryNodeEvidence(node: StructuralNode): {
11
+ filePath?: string;
12
+ lineNumber?: number;
13
+ };
14
+ export declare function cleanNodeDisplayLabel(name: string): string;
15
+ export declare function matchUiRoleConvention(node: Pick<StructuralNode, "entityType"> & {
16
+ name?: string;
17
+ patternId?: string;
18
+ metadata?: Record<string, unknown>;
19
+ }, filePath: string, options?: {
20
+ allowPathMatchForStructuralRoles?: boolean;
21
+ }): UiRoleConventionRow | undefined;
22
+ export declare function classifyAtomicTier(params: {
23
+ node: StructuralNode;
24
+ filePath: string;
25
+ jsxDomElementCount: number;
26
+ jsxCustomComponentCount: number;
27
+ stateHookCount: number;
28
+ rendersInDegree: number;
29
+ rendersOutDegree: number;
30
+ domTags?: ReadonlySet<string>;
31
+ isPrimaryInFile?: boolean;
32
+ }): {
33
+ atomicTier: AtomicTier;
34
+ classificationSource: AtomicClassificationSource;
35
+ convention?: UiRoleConventionRow;
36
+ };
37
+ export declare function inferSuggestedComponentName(rootTag: string, canonicalSignature: string, elementCount: number): {
38
+ name: string;
39
+ tier: "ATOM" | "MOLECULE" | "ORGANISM";
40
+ confidence: "medium" | "low";
41
+ };
42
+ export declare function matchesDynamicPrefix(cls: string, dynamicPrefixes: Set<string>): boolean;
43
+ export interface AnalyzeDesignSystemOptions {
44
+ /** Pre-resolved config. Default: loaded from `<repoPath>/chomp.config.json` (`designSystem` key). */
45
+ resolvedConfig?: ResolvedDesignSystemConfig;
46
+ /** Partial overrides merged over the file config and defaults (tests, programmatic use). */
47
+ configOverrides?: Partial<DesignSystemConfig>;
48
+ }
49
+ /** Resolves the effective atom catalog from config (`defaults` + declared definitions, `extend`, or `replace`). */
50
+ export declare function resolveAtomCatalog(config: DesignSystemConfig): AtomDefinition[];
51
+ export declare const UNSUPPORTED_UI_EXTENSIONS: string[];
52
+ export interface DirectHealthNode {
53
+ entityId: string;
54
+ label: string;
55
+ filePath: string;
56
+ directScore: number;
57
+ directStatus: "healthy" | "warn" | "critical";
58
+ directIssueCount: number;
59
+ }
60
+ /**
61
+ * Cycle-safe weakest-link subtree health rollup over reachable `RENDERS` descendants.
62
+ * Does not double-count descendant issues into `directIssueCount` (used for package totals).
63
+ */
64
+ export declare function computeSubtreeHealth(nodes: ReadonlyMap<string, DirectHealthNode>, rendersOutById: ReadonlyMap<string, ReadonlySet<string>>): Map<string, SubtreeHealthSummary>;