@usefragments/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunk-243QYRUF.js +2145 -0
  3. package/dist/chunk-243QYRUF.js.map +1 -0
  4. package/dist/chunk-3LLRNCPX.js +111 -0
  5. package/dist/chunk-3LLRNCPX.js.map +1 -0
  6. package/dist/chunk-EIYNNS77.js +48 -0
  7. package/dist/chunk-EIYNNS77.js.map +1 -0
  8. package/dist/chunk-JNBFJ34I.js +326 -0
  9. package/dist/chunk-JNBFJ34I.js.map +1 -0
  10. package/dist/chunk-R3X7UBHU.js +228 -0
  11. package/dist/chunk-R3X7UBHU.js.map +1 -0
  12. package/dist/chunk-SH4KPIYH.js +393 -0
  13. package/dist/chunk-SH4KPIYH.js.map +1 -0
  14. package/dist/chunk-V4VQB57N.js +56 -0
  15. package/dist/chunk-V4VQB57N.js.map +1 -0
  16. package/dist/chunk-X34IA4LR.js +319 -0
  17. package/dist/chunk-X34IA4LR.js.map +1 -0
  18. package/dist/chunk-YF65VYRY.js +493 -0
  19. package/dist/chunk-YF65VYRY.js.map +1 -0
  20. package/dist/codes/index.d.ts +40 -0
  21. package/dist/codes/index.js +23 -0
  22. package/dist/codes/index.js.map +1 -0
  23. package/dist/compiled-types/index.d.ts +5 -0
  24. package/dist/compiled-types/index.js +1 -0
  25. package/dist/compiled-types/index.js.map +1 -0
  26. package/dist/generate/index.d.ts +47 -0
  27. package/dist/generate/index.js +11 -0
  28. package/dist/generate/index.js.map +1 -0
  29. package/dist/governance-BOa3KyiJ.d.ts +3279 -0
  30. package/dist/graph/index.d.ts +66 -0
  31. package/dist/graph/index.js +17 -0
  32. package/dist/graph/index.js.map +1 -0
  33. package/dist/index.d.ts +11388 -0
  34. package/dist/index.js +8711 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/package-identity.d.ts +42 -0
  37. package/dist/package-identity.js +23 -0
  38. package/dist/package-identity.js.map +1 -0
  39. package/dist/preview/index.d.ts +484 -0
  40. package/dist/preview/index.js +1129 -0
  41. package/dist/preview/index.js.map +1 -0
  42. package/dist/react-types.d.ts +22 -0
  43. package/dist/react-types.js +1 -0
  44. package/dist/react-types.js.map +1 -0
  45. package/dist/registry.d.ts +2367 -0
  46. package/dist/registry.js +62 -0
  47. package/dist/registry.js.map +1 -0
  48. package/dist/schemas/index.d.ts +2584 -0
  49. package/dist/schemas/index.js +55 -0
  50. package/dist/schemas/index.js.map +1 -0
  51. package/dist/severity.d.ts +18 -0
  52. package/dist/severity.js +27 -0
  53. package/dist/severity.js.map +1 -0
  54. package/dist/test-utils.d.ts +14 -0
  55. package/dist/test-utils.js +63 -0
  56. package/dist/test-utils.js.map +1 -0
  57. package/dist/topology/index.d.ts +48 -0
  58. package/dist/topology/index.js +7 -0
  59. package/dist/topology/index.js.map +1 -0
  60. package/dist/types-xJ2xyp_G.d.ts +119 -0
  61. package/package.json +120 -0
  62. package/src/__tests__/contract-parser.test.ts +614 -0
  63. package/src/__tests__/dtcg-generators.test.ts +439 -0
  64. package/src/__tests__/dtcg-parser.test.ts +884 -0
  65. package/src/__tests__/preview-runtime.test.tsx +111 -0
  66. package/src/__tests__/schema.test.ts +31 -0
  67. package/src/__tests__/severity.test.ts +34 -0
  68. package/src/__tests__/style-comparison.test.ts +662 -0
  69. package/src/__tests__/tokens-compat.test.ts +51 -0
  70. package/src/agent-format.test.ts +105 -0
  71. package/src/agent-format.ts +141 -0
  72. package/src/bundle.ts +149 -0
  73. package/src/codes/__tests__/codes.test.ts +73 -0
  74. package/src/codes/codes.ts +463 -0
  75. package/src/codes/index.ts +7 -0
  76. package/src/codes/source-finding-bridge.ts +113 -0
  77. package/src/compiled-types/index.ts +293 -0
  78. package/src/component-contract.ts +231 -0
  79. package/src/component-discovery.ts +80 -0
  80. package/src/composition.test.ts +262 -0
  81. package/src/composition.ts +318 -0
  82. package/src/config-paths.test.ts +78 -0
  83. package/src/config-paths.ts +47 -0
  84. package/src/config.ts +18 -0
  85. package/src/conform-prove.test.ts +274 -0
  86. package/src/conform-prove.ts +326 -0
  87. package/src/conform.ts +160 -0
  88. package/src/constants.ts +114 -0
  89. package/src/context.ts +2 -0
  90. package/src/contract/fixture.ts +110 -0
  91. package/src/contract/hash.test.ts +86 -0
  92. package/src/contract/hash.ts +195 -0
  93. package/src/contract/index.ts +43 -0
  94. package/src/contract/preimage.test.ts +254 -0
  95. package/src/contract/preimage.ts +365 -0
  96. package/src/contract/stamp.test.ts +100 -0
  97. package/src/contract/stamp.ts +105 -0
  98. package/src/contract-parser.ts +141 -0
  99. package/src/defineFragment.test.ts +257 -0
  100. package/src/defineFragment.ts +293 -0
  101. package/src/dtcg-generators.ts +324 -0
  102. package/src/dtcg-parser.ts +1 -0
  103. package/src/dtcg.ts +237 -0
  104. package/src/facts/__snapshots__/facts.test.ts.snap +124 -0
  105. package/src/facts/builders.ts +835 -0
  106. package/src/facts/compile.ts +422 -0
  107. package/src/facts/fact-index.ts +394 -0
  108. package/src/facts/facts.test.ts +494 -0
  109. package/src/facts/ids.ts +125 -0
  110. package/src/facts/index.ts +119 -0
  111. package/src/facts/types.ts +614 -0
  112. package/src/figma.ts +263 -0
  113. package/src/fragment-types.ts +214 -0
  114. package/src/generate/generate.test.ts +594 -0
  115. package/src/generate/index.ts +438 -0
  116. package/src/governance-integrity.test.ts +186 -0
  117. package/src/governance-integrity.ts +282 -0
  118. package/src/governance.test.ts +300 -0
  119. package/src/governance.ts +605 -0
  120. package/src/governance.type-test.ts +75 -0
  121. package/src/graph/engine.ts +446 -0
  122. package/src/graph/graph.test.ts +746 -0
  123. package/src/graph/index.ts +32 -0
  124. package/src/graph/serialization.ts +55 -0
  125. package/src/graph/types.ts +178 -0
  126. package/src/index.ts +891 -0
  127. package/src/local-canonical.ts +102 -0
  128. package/src/mcp-snapshot.ts +222 -0
  129. package/src/package-identity-match.ts +33 -0
  130. package/src/package-identity.generated.ts +233 -0
  131. package/src/package-identity.test.ts +99 -0
  132. package/src/package-identity.ts +157 -0
  133. package/src/performance-presets.ts +142 -0
  134. package/src/preview/comparison-artifact.test.ts +228 -0
  135. package/src/preview/comparison-artifact.ts +181 -0
  136. package/src/preview/comparison-context.ts +93 -0
  137. package/src/preview/comparison-evidence.ts +112 -0
  138. package/src/preview/comparison-format.ts +21 -0
  139. package/src/preview/comparison-presentation.ts +187 -0
  140. package/src/preview/comparison-references.test.ts +430 -0
  141. package/src/preview/comparison-references.ts +72 -0
  142. package/src/preview/comparison-score.ts +59 -0
  143. package/src/preview/comparison-styles.ts +197 -0
  144. package/src/preview/comparison.test.ts +559 -0
  145. package/src/preview/comparison.ts +488 -0
  146. package/src/preview/index.ts +10 -0
  147. package/src/preview/types.ts +309 -0
  148. package/src/preview/validation.test.ts +290 -0
  149. package/src/preview/validation.ts +356 -0
  150. package/src/preview-runtime.tsx +144 -0
  151. package/src/raw-html-canonical.test.ts +41 -0
  152. package/src/raw-html-canonical.ts +179 -0
  153. package/src/react-types.ts +21 -0
  154. package/src/registry-install-plan.ts +344 -0
  155. package/src/registry.test.ts +245 -0
  156. package/src/registry.ts +369 -0
  157. package/src/rules/a11y-required-accessible-name.ts +93 -0
  158. package/src/rules/color-math.test.ts +72 -0
  159. package/src/rules/color-math.ts +192 -0
  160. package/src/rules/components-forbidden-prop-value.ts +108 -0
  161. package/src/rules/components-prefer-library.ts +943 -0
  162. package/src/rules/components-unknown-prop.ts +94 -0
  163. package/src/rules/composition-pattern-schema.ts +125 -0
  164. package/src/rules/composition-pattern.test.ts +320 -0
  165. package/src/rules/composition-pattern.ts +271 -0
  166. package/src/rules/emit-gate.test.ts +42 -0
  167. package/src/rules/emit-gate.ts +60 -0
  168. package/src/rules/finding.ts +54 -0
  169. package/src/rules/index.ts +235 -0
  170. package/src/rules/jsx-preferred-component.ts +68 -0
  171. package/src/rules/jsx-preferred-import-path.ts +67 -0
  172. package/src/rules/presets.ts +57 -0
  173. package/src/rules/props-invalid-value.ts +115 -0
  174. package/src/rules/rules.test.ts +3636 -0
  175. package/src/rules/spacing-resolution.ts +184 -0
  176. package/src/rules/styles-no-raw-color.ts +329 -0
  177. package/src/rules/styles-no-raw-dimensions.ts +357 -0
  178. package/src/rules/styles-no-raw-spacing.ts +236 -0
  179. package/src/rules/styles-no-raw-typography.ts +237 -0
  180. package/src/rules/tailwind-arbitrary-color.test.ts +128 -0
  181. package/src/rules/tailwind-arbitrary-color.ts +93 -0
  182. package/src/rules/tailwind-arbitrary-spacing.test.ts +157 -0
  183. package/src/rules/tailwind-arbitrary-spacing.ts +120 -0
  184. package/src/rules/tailwind-forbidden-palette.test.ts +116 -0
  185. package/src/rules/tailwind-forbidden-palette.ts +107 -0
  186. package/src/rules/tailwind-off-scale-spacing-token.test.ts +100 -0
  187. package/src/rules/tailwind-off-scale-spacing-token.ts +108 -0
  188. package/src/rules/tailwind-raw-color-via-token.test.ts +108 -0
  189. package/src/rules/tailwind-raw-color-via-token.ts +82 -0
  190. package/src/rules/tailwind-rule-utils.ts +106 -0
  191. package/src/rules/tailwind-unknown-class.test.ts +157 -0
  192. package/src/rules/tailwind-unknown-class.ts +121 -0
  193. package/src/rules/taxonomy.test.ts +238 -0
  194. package/src/rules/theme-no-theme-coupled-literal.ts +132 -0
  195. package/src/rules/tiers.ts +111 -0
  196. package/src/rules/tokens-css-vars-must-be-defined.test.ts +244 -0
  197. package/src/rules/tokens-css-vars-must-be-defined.ts +156 -0
  198. package/src/rules/tokens-require-dual-fallback.ts +78 -0
  199. package/src/rules/types.ts +27 -0
  200. package/src/rules/utils.test.ts +110 -0
  201. package/src/rules/utils.ts +599 -0
  202. package/src/schema.ts +427 -0
  203. package/src/schemas/index.ts +275 -0
  204. package/src/schemas/schemas.test.ts +124 -0
  205. package/src/severity.ts +54 -0
  206. package/src/storyAdapter.test.ts +571 -0
  207. package/src/storyAdapter.ts +761 -0
  208. package/src/storyFilters.test.ts +350 -0
  209. package/src/storyFilters.ts +253 -0
  210. package/src/storybook-csf.ts +11 -0
  211. package/src/style-comparison.ts +423 -0
  212. package/src/test-utils.ts +68 -0
  213. package/src/token-parser.ts +2 -0
  214. package/src/token-types.ts +287 -0
  215. package/src/tokens/categories.ts +131 -0
  216. package/src/tokens/color.ts +193 -0
  217. package/src/tokens/design-token-parser.test.ts +159 -0
  218. package/src/tokens/design-token-parser.ts +402 -0
  219. package/src/tokens/dtcg.ts +428 -0
  220. package/src/tokens/index.ts +130 -0
  221. package/src/tokens/lookup.ts +19 -0
  222. package/src/tokens/scss.ts +171 -0
  223. package/src/tokens/tailwind-v4.ts +187 -0
  224. package/src/tokens/types.ts +43 -0
  225. package/src/topology/index.ts +9 -0
  226. package/src/topology/resolve-area.test.ts +174 -0
  227. package/src/topology/resolve-area.ts +215 -0
  228. package/src/types.ts +1057 -0
@@ -0,0 +1,3279 @@
1
+ import { z } from 'zod';
2
+ import { ComponentType, ReactNode, JSX } from 'react';
3
+ import { Topology } from './topology/index.js';
4
+ import { S as SerializedComponentGraph } from './types-xJ2xyp_G.js';
5
+
6
+ /**
7
+ * Frontend Contract preimage — the projection that defines what the contract IS.
8
+ *
9
+ * The FCID used to be a hash of the raw `code-contracts` artifact payload. That
10
+ * conflated identity with display: a copy-edit to a component description moved
11
+ * the hash, and tokens / canonical mappings / policy — the things gates actually
12
+ * enforce — were not part of identity at all. This module widens the preimage to
13
+ * the full enforcement surface as ONE shared projection, imported by both Cloud
14
+ * (mint) and the CLI (reportedHash). Neither side may reimplement it: parity is
15
+ * a property of the shared import, not a test you can fail.
16
+ *
17
+ * Enforced-only is implemented structurally: {@link projectContractPreimage}
18
+ * copies an explicit pick-list of fields per domain. Anything an adapter passes
19
+ * beyond that list (descriptions, docs URLs, timestamps, heuristic signals)
20
+ * never reaches the hash. Proposed canonical mappings are excluded for the same
21
+ * reason — they cannot block, so they are not identity; confirmation is the
22
+ * moment a mapping enters the contract.
23
+ *
24
+ * The preimage itself is the record of four domain sub-hashes, so
25
+ * `contractHash(preimage)` is the fcid and a domain diff is a four-string
26
+ * compare — no deep structural diffing. Determinism (key sorting, undefined
27
+ * dropping, number normalization) is inherited from `canonicalPreimage`; this
28
+ * module adds element-level sorting for the arrays it owns and nothing else.
29
+ *
30
+ * Runtime-portable by construction: no Node APIs, no Convex imports, no React.
31
+ */
32
+
33
+ /**
34
+ * The fixed domain enum. Adding a domain is a spine change (update
35
+ * `01-architecture.md` first); never rename — deprecate and alias.
36
+ */
37
+ declare const CONTRACT_DOMAINS: readonly ["components", "tokens", "canonicalMap", "policy"];
38
+ type ContractDomain = (typeof CONTRACT_DOMAINS)[number];
39
+ /**
40
+ * One component's enforcement identity. Props are the *name* membership surface
41
+ * (what unknown-prop checks today); prop types/defaults are not enforced by the
42
+ * rules engine, so they are not identity — enforced-only cuts both ways.
43
+ */
44
+ interface ContractComponentInput {
45
+ name: string;
46
+ /** Parent component name when this is a subcomponent (compound identity). */
47
+ parentName?: string;
48
+ /** Prop names the component accepts. */
49
+ props?: readonly string[];
50
+ /**
51
+ * The per-component enforcement contract as authored (bans, a11y rules,
52
+ * required compound children). Passed through whole — it is enforcement data
53
+ * by definition.
54
+ */
55
+ contract?: unknown;
56
+ /** Required compound-children names, when the structure is declared. */
57
+ compoundChildren?: readonly string[];
58
+ }
59
+ interface ContractTokenInput {
60
+ name: string;
61
+ value: string | number;
62
+ type?: string;
63
+ }
64
+ type CanonicalMappingStatus = "confirmed" | "proposed" | "unknown";
65
+ interface ContractPropMappingInput {
66
+ rawProp: string;
67
+ canonicalProp: string;
68
+ valueMap?: Readonly<Record<string, string>>;
69
+ }
70
+ interface ContractCanonicalMappingInput {
71
+ /** The raw/source component the mapping covers. */
72
+ component: string;
73
+ /** The canonical component it maps to. */
74
+ canonical: string;
75
+ status: CanonicalMappingStatus;
76
+ /** Local/offline canonical import target, when the mapping is config-authored. */
77
+ importPath?: string;
78
+ /** Explicit raw element or semantic resolutions covered by a local declaration. */
79
+ resolves?: readonly {
80
+ tag: string;
81
+ role?: string;
82
+ inputType?: string;
83
+ }[];
84
+ propMapping?: readonly ContractPropMappingInput[];
85
+ }
86
+ /**
87
+ * An authored waiver record. Hashed as data — including `expiresOn` as a plain
88
+ * date string. Expiry *evaluation* happens at enforcement time and must never
89
+ * change the fcid (no time-dependent hashing).
90
+ */
91
+ interface ContractWaiverInput {
92
+ id: string;
93
+ /** The diagnostic code or rule the waiver suppresses. */
94
+ target: string;
95
+ reason: string;
96
+ /** YYYY-MM-DD, treated as opaque data. */
97
+ expiresOn?: string;
98
+ }
99
+ /**
100
+ * Active policy: everything that changes what a gate would allow or deny.
101
+ * Waivers live here (spine open question 1, resolved): a waiver changes what
102
+ * blocks, so it is enforcement-relevant.
103
+ */
104
+ interface ContractPolicyInput {
105
+ rules?: Readonly<Record<string, unknown>>;
106
+ codes?: Readonly<Record<string, unknown>>;
107
+ compositionPatterns?: readonly unknown[];
108
+ waivers?: readonly ContractWaiverInput[];
109
+ }
110
+ /**
111
+ * The neutral catalog shape both adapters (Cloud mint, CLI scan) assemble.
112
+ * Adapters gather data; the projection owns all normalization — element order,
113
+ * optional fields, and display-data stripping never reach the hash.
114
+ */
115
+ interface ContractCatalogInput {
116
+ components?: readonly ContractComponentInput[];
117
+ tokens?: readonly ContractTokenInput[];
118
+ canonicalMappings?: readonly ContractCanonicalMappingInput[];
119
+ policy?: ContractPolicyInput | null;
120
+ }
121
+ declare const CONTRACT_PREIMAGE_SCHEMA: "fcid-preimage:v1";
122
+ /**
123
+ * The hashed identity record: four domain sub-hashes plus the projection schema
124
+ * version (so an intentional projection change mints a new fcid). The fcid is
125
+ * `contractHash(preimage)` — hash of the domain hashes, per the spine pipeline.
126
+ */
127
+ interface ContractPreimage {
128
+ schema: typeof CONTRACT_PREIMAGE_SCHEMA;
129
+ domains: Record<ContractDomain, string>;
130
+ }
131
+ /**
132
+ * Project a catalog onto the contract preimage: four enforced-only domain
133
+ * bodies, each hashed independently. `contractHash(projectContractPreimage(x))`
134
+ * is the fcid.
135
+ */
136
+ declare function projectContractPreimage(catalog: ContractCatalogInput): ContractPreimage;
137
+ /**
138
+ * Name the domains whose identity differs between two preimages — a four-string
139
+ * compare, no structural diffing. Returned in fixed {@link CONTRACT_DOMAINS}
140
+ * order. Staleness checks compare these, never whole fcids.
141
+ */
142
+ declare function diffContractDomains(a: ContractPreimage, b: ContractPreimage): ContractDomain[];
143
+ /**
144
+ * Map defineFragment-shaped records — the `code-contracts` payload's
145
+ * `fragments` array (Cloud mint) or the CLI's loaded fragment definitions —
146
+ * onto their enforcement identity. The one shared mapping is what keeps the
147
+ * two adapters from drifting into a second "catalog → preimage"
148
+ * implementation: both sides gather fragments however they like, then this
149
+ * picks the identity fields. Records without a string `meta.name` are skipped
150
+ * (no identity to hash).
151
+ */
152
+ /**
153
+ * The enforced-only slice of a resolved CLI governance config — the fields
154
+ * that change what a scan allows or denies. CI gate options, agent repair
155
+ * order, and runner config change how/when gates run, not what they enforce,
156
+ * so they are not identity. This pick-list lives here, beside the projection,
157
+ * so adapters cannot drift into private enforced-only boundaries: a new
158
+ * enforcement field on {@link GovernanceConfig} is added to the contract in
159
+ * exactly one place.
160
+ */
161
+ declare function contractPolicyFromGovernanceConfig(config: GovernanceConfig | null | undefined): ContractPolicyInput | null;
162
+ declare function contractComponentsFromFragments(fragments: readonly unknown[]): ContractComponentInput[];
163
+
164
+ interface LocalCanonicalResolveRule {
165
+ tag: string;
166
+ role?: string;
167
+ inputType?: string;
168
+ }
169
+ interface LocalCanonicalDeclaration {
170
+ importPath: string;
171
+ resolves: readonly LocalCanonicalResolveRule[];
172
+ }
173
+ interface InspectConfig {
174
+ localCanonical?: Readonly<Record<string, LocalCanonicalDeclaration>>;
175
+ }
176
+ declare function localCanonicalContractMappings(inspect: InspectConfig | null | undefined): ContractCanonicalMappingInput[];
177
+ declare function governanceConfigWithLocalCanonical(config: GovernanceConfig | undefined, inspect: InspectConfig | null | undefined): GovernanceConfig | undefined;
178
+
179
+ /**
180
+ * Component metadata
181
+ */
182
+ interface FragmentMeta$1 {
183
+ name: string;
184
+ description: string;
185
+ category: string;
186
+ tags?: string[];
187
+ status?: "stable" | "beta" | "deprecated" | "experimental";
188
+ since?: string;
189
+ dependencies?: Array<{
190
+ name: string;
191
+ version: string;
192
+ reason?: string;
193
+ }>;
194
+ figma?: string;
195
+ figmaProps?: Record<string, unknown>;
196
+ }
197
+ /**
198
+ * Usage guidelines for AI agents and developers
199
+ */
200
+ interface FragmentUsage$1 {
201
+ when: string[];
202
+ whenNot: string[];
203
+ guidelines?: string[];
204
+ accessibility?: string[];
205
+ }
206
+ /**
207
+ * Definition for a single prop
208
+ */
209
+ interface PropDefinition$1 {
210
+ type: string;
211
+ values?: readonly string[];
212
+ default?: unknown;
213
+ description: string;
214
+ required?: boolean;
215
+ constraints?: string[];
216
+ typeDetails?: Record<string, unknown>;
217
+ controlType?: string;
218
+ controlOptions?: {
219
+ min?: number;
220
+ max?: number;
221
+ step?: number;
222
+ presetColors?: string[];
223
+ };
224
+ }
225
+ /**
226
+ * Relationship to another component
227
+ */
228
+ interface ComponentRelation$1 {
229
+ component: string;
230
+ relationship: string;
231
+ note: string;
232
+ }
233
+ /**
234
+ * Agent-optimized contract metadata
235
+ */
236
+ interface FragmentContract$1 {
237
+ propsSummary?: string[];
238
+ a11yRules?: string[];
239
+ bans?: Array<{
240
+ pattern: string;
241
+ message: string;
242
+ }>;
243
+ scenarioTags?: string[];
244
+ /** Per-component performance budget override in bytes (gzipped) */
245
+ performanceBudget?: number;
246
+ /** Sub-component slot metadata for compound components */
247
+ compoundChildren?: Record<string, {
248
+ required?: boolean;
249
+ accepts?: string[];
250
+ description?: string;
251
+ }>;
252
+ /** Canonical JSX usage examples showing how to assemble the component */
253
+ canonicalUsage?: string[];
254
+ }
255
+ /**
256
+ * Provenance tracking for generated fragments
257
+ */
258
+ interface FragmentGenerated$1 {
259
+ source: "storybook" | "manual" | "ai" | "extracted" | "merged" | "migrated";
260
+ sourceFile?: string;
261
+ /** @deprecated Use provenance.verified instead */
262
+ confidence?: number;
263
+ verified?: boolean;
264
+ timestamp?: string;
265
+ }
266
+ /**
267
+ * AI-specific metadata
268
+ */
269
+ interface AIMetadata$1 {
270
+ compositionPattern?: "compound" | "simple" | "controlled" | "wrapper";
271
+ subComponents?: string[];
272
+ requiredChildren?: string[];
273
+ commonPatterns?: string[];
274
+ }
275
+ /**
276
+ * Performance data for a component (from bundle size measurement)
277
+ */
278
+ /**
279
+ * A single import contributing to bundle size
280
+ */
281
+ interface ImportEntry {
282
+ /** Resolved file path (relative to project root) */
283
+ path: string;
284
+ /** Bytes contributed to the bundle */
285
+ bytes: number;
286
+ /** Percentage of total bundle size */
287
+ percent: number;
288
+ }
289
+ interface PerformanceData {
290
+ /** Gzipped bundle size in bytes */
291
+ bundleSize: number;
292
+ /** Raw (minified, not gzipped) bundle size in bytes */
293
+ rawSize: number;
294
+ /** Complexity classification */
295
+ complexity: 'lightweight' | 'moderate' | 'heavy';
296
+ /** Percentage of budget used (0-100+) */
297
+ budgetPercent: number;
298
+ /** Whether the component exceeds its budget */
299
+ overBudget: boolean;
300
+ /** ISO timestamp when measured */
301
+ measuredAt: string;
302
+ /** Top imports by size (largest first) */
303
+ imports?: ImportEntry[];
304
+ }
305
+ interface ObservedUsageProp {
306
+ name: string;
307
+ kind: 'static' | 'dynamic' | 'spread' | 'jsx' | 'boolean' | 'null';
308
+ value?: string | number | boolean | null;
309
+ }
310
+ interface ObservedComponentUsage {
311
+ /** Source file path relative to the fragments config root */
312
+ file: string;
313
+ /** 1-indexed source line */
314
+ line: number;
315
+ /** 0-indexed source column */
316
+ column: number;
317
+ props: ObservedUsageProp[];
318
+ parentElement?: string;
319
+ conditional?: boolean;
320
+ }
321
+ /**
322
+ * Compiled fragment data (JSON-serializable for AI consumption)
323
+ */
324
+ interface CompiledFragment {
325
+ filePath: string;
326
+ meta: FragmentMeta$1;
327
+ /** Canonical v2 guidance. `usage` is retained for compatibility. */
328
+ guidance?: FragmentUsage$1;
329
+ usage: FragmentUsage$1;
330
+ props: Record<string, PropDefinition$1>;
331
+ /** Normalized component governance records emitted from *.fragment.ts. */
332
+ governance?: ComponentGovernanceRecord[];
333
+ relations?: ComponentRelation$1[];
334
+ variants: Array<{
335
+ name: string;
336
+ description: string;
337
+ code?: string;
338
+ figma?: string;
339
+ args?: Record<string, unknown>;
340
+ }>;
341
+ contract?: FragmentContract$1;
342
+ ai?: AIMetadata$1;
343
+ /** Framework hint from contract, used by preview adapters and Cloud */
344
+ framework?: string;
345
+ /** Top-level compact prop summaries for agent first-pass */
346
+ propsSummary?: string[];
347
+ /** Source file path relative to config root (for contract-sourced fragments) */
348
+ sourcePath?: string;
349
+ /** Named export for preview adapter resolution */
350
+ exportName?: string;
351
+ /** Clean provenance tracking (V2) */
352
+ provenance?: {
353
+ source: string;
354
+ verified: boolean;
355
+ frameworkSupport?: string;
356
+ sourceHash?: string;
357
+ extractedAt?: string;
358
+ };
359
+ /** Component performance data from bundle size measurement */
360
+ performance?: PerformanceData;
361
+ /** Observed JSX call sites captured during `fragments scan` */
362
+ usages?: ObservedComponentUsage[];
363
+ _generated?: FragmentGenerated$1;
364
+ }
365
+ /**
366
+ * Compiled block data (JSON-serializable for AI consumption)
367
+ */
368
+ interface CompiledBlock {
369
+ filePath: string;
370
+ name: string;
371
+ description: string;
372
+ category: string;
373
+ components: string[];
374
+ code: string;
375
+ tags?: string[];
376
+ }
377
+ /**
378
+ * A single token entry in the compiled output
379
+ */
380
+ interface CompiledTokenEntry {
381
+ name: string;
382
+ value?: string;
383
+ description?: string;
384
+ }
385
+ /**
386
+ * Compiled token data stored in fragments.json
387
+ */
388
+ interface CompiledTokenData {
389
+ prefix: string;
390
+ total: number;
391
+ categories: Record<string, CompiledTokenEntry[]>;
392
+ }
393
+ /**
394
+ * Performance summary across all components
395
+ */
396
+ interface PerformanceSummary {
397
+ /** Preset name used */
398
+ preset: string;
399
+ /** Budget applied in bytes */
400
+ budget: number;
401
+ /** Total components measured */
402
+ total: number;
403
+ /** Number of components over budget */
404
+ overBudget: number;
405
+ /** Distribution by tier */
406
+ tiers: Record<string, number>;
407
+ }
408
+ /**
409
+ * The compiled fragments.json structure
410
+ */
411
+ interface CompiledFragmentsFile {
412
+ version: string;
413
+ generatedAt: string;
414
+ /** CLI version that produced this file, used for freshness checks */
415
+ generatorVersion?: string;
416
+ /** Relative source/config inputs used to build this file, used for freshness checks */
417
+ buildInputs?: string[];
418
+ packageName?: string;
419
+ fragments: Record<string, CompiledFragment>;
420
+ blocks?: Record<string, CompiledBlock>;
421
+ tokens?: CompiledTokenData;
422
+ /** Component relationship graph for AI structural queries */
423
+ graph?: SerializedComponentGraph;
424
+ /** Performance measurement summary */
425
+ performanceSummary?: PerformanceSummary;
426
+ /** @deprecated Use blocks instead */
427
+ recipes?: Record<string, CompiledBlock>;
428
+ }
429
+ /**
430
+ * Theme identifier
431
+ */
432
+ type Theme$1 = "light" | "dark";
433
+ /**
434
+ * Verification result
435
+ */
436
+ interface VerifyResult$1 {
437
+ verdict: "pass" | "fail" | "error";
438
+ matches: boolean;
439
+ diffPercentage: number;
440
+ screenshot: string;
441
+ baseline: string;
442
+ diffImage?: string;
443
+ notes: string[];
444
+ error?: string;
445
+ timing: {
446
+ renderMs: number;
447
+ captureMs: number;
448
+ diffMs: number;
449
+ totalMs: number;
450
+ };
451
+ }
452
+
453
+ /**
454
+ * A React component that can be used in a fragment definition.
455
+ * This type is intentionally broad to support various React component patterns
456
+ * including FC, forwardRef, memo, and class components across different React versions.
457
+ */
458
+ type FragmentComponent<TProps = any> = ComponentType<TProps> | ((props: TProps) => ReactNode | JSX.Element | null);
459
+ /**
460
+ * Framework-agnostic component reference.
461
+ * Used in contexts where React is not required (e.g., JSON component contracts).
462
+ * Accepts a string identifier, a generic function, or a record of metadata.
463
+ */
464
+ type ComponentRef = string | ((...args: unknown[]) => unknown) | Record<string, unknown>;
465
+ /**
466
+ * Metadata about the component
467
+ */
468
+ interface FragmentMeta {
469
+ /** Component display name */
470
+ name: string;
471
+ /** Brief description of the component's purpose */
472
+ description: string;
473
+ /** Category for organizing components (e.g., "actions", "forms", "layout") */
474
+ category: string;
475
+ /** Optional tags for additional categorization */
476
+ tags?: string[];
477
+ /** Component status */
478
+ status?: "stable" | "beta" | "deprecated" | "experimental";
479
+ /** Version when component was introduced */
480
+ since?: string;
481
+ /** External npm packages required by this component (displayed in docs Setup section) */
482
+ dependencies?: Array<{
483
+ name: string;
484
+ version: string;
485
+ reason?: string;
486
+ }>;
487
+ /** Figma frame URL for design verification */
488
+ figma?: string;
489
+ /** Figma property mappings (how Figma props map to code props) */
490
+ figmaProps?: Record<string, FigmaPropMapping>;
491
+ }
492
+ /**
493
+ * Figma property mapping types - describes how a Figma property maps to code
494
+ */
495
+ type FigmaPropMapping = FigmaStringMapping | FigmaBooleanMapping | FigmaEnumMapping | FigmaInstanceMapping | FigmaChildrenMapping | FigmaTextContentMapping;
496
+ /** Maps a Figma text property to a string prop */
497
+ interface FigmaStringMapping {
498
+ __type: "figma-string";
499
+ figmaProperty: string;
500
+ }
501
+ /** Maps a Figma boolean property to a boolean prop (with optional value mapping) */
502
+ interface FigmaBooleanMapping {
503
+ __type: "figma-boolean";
504
+ figmaProperty: string;
505
+ valueMapping?: {
506
+ true: unknown;
507
+ false: unknown;
508
+ };
509
+ }
510
+ /** Maps a Figma variant property to an enum prop */
511
+ interface FigmaEnumMapping {
512
+ __type: "figma-enum";
513
+ figmaProperty: string;
514
+ valueMapping: Record<string, unknown>;
515
+ }
516
+ /** References a nested Figma component instance */
517
+ interface FigmaInstanceMapping {
518
+ __type: "figma-instance";
519
+ figmaProperty: string;
520
+ }
521
+ /** Renders children from Figma layer names */
522
+ interface FigmaChildrenMapping {
523
+ __type: "figma-children";
524
+ layers: string[];
525
+ }
526
+ /** Extracts text content from a Figma text layer */
527
+ interface FigmaTextContentMapping {
528
+ __type: "figma-text-content";
529
+ layer: string;
530
+ }
531
+ /**
532
+ * Usage guidelines for AI agents and developers
533
+ */
534
+ interface FragmentUsage {
535
+ /** When to use this component */
536
+ when: string[];
537
+ /** When NOT to use this component (with alternatives) */
538
+ whenNot: string[];
539
+ /** Additional usage guidelines and best practices */
540
+ guidelines?: string[];
541
+ /** Accessibility considerations */
542
+ accessibility?: string[];
543
+ }
544
+ /**
545
+ * Prop type definitions
546
+ */
547
+ type PropType = {
548
+ type: "string";
549
+ pattern?: string;
550
+ } | {
551
+ type: "number";
552
+ min?: number;
553
+ max?: number;
554
+ } | {
555
+ type: "boolean";
556
+ } | {
557
+ type: "enum";
558
+ values: readonly string[];
559
+ } | {
560
+ type: "function";
561
+ signature?: string;
562
+ } | {
563
+ type: "node";
564
+ } | {
565
+ type: "element";
566
+ } | {
567
+ type: "object";
568
+ shape?: Record<string, PropDefinition>;
569
+ } | {
570
+ type: "array";
571
+ items?: PropType;
572
+ } | {
573
+ type: "union";
574
+ types: PropType[];
575
+ } | {
576
+ type: "custom";
577
+ typescript: string;
578
+ };
579
+ /**
580
+ * Storybook control types for UI rendering
581
+ */
582
+ type ControlType = "text" | "number" | "range" | "boolean" | "select" | "multi-select" | "radio" | "inline-radio" | "check" | "inline-check" | "object" | "file" | "color" | "date";
583
+ /**
584
+ * Definition for a single prop
585
+ */
586
+ interface PropDefinition {
587
+ /** The prop type */
588
+ type: PropType["type"];
589
+ /** For enum types, the allowed values */
590
+ values?: readonly string[];
591
+ /** Default value if not provided */
592
+ default?: unknown;
593
+ /** Description of what this prop does */
594
+ description: string;
595
+ /** Whether this prop is required */
596
+ required?: boolean;
597
+ /** Usage constraints for AI agents */
598
+ constraints?: string[];
599
+ /** Additional type details for complex types */
600
+ typeDetails?: Omit<PropType, "type">;
601
+ /** Original Storybook control type for UI rendering (e.g., "color", "date", "range") */
602
+ controlType?: ControlType;
603
+ /** Control options (e.g., min/max for range, presetColors for color) */
604
+ controlOptions?: {
605
+ min?: number;
606
+ max?: number;
607
+ step?: number;
608
+ presetColors?: string[];
609
+ };
610
+ }
611
+ /**
612
+ * Relationship types between components
613
+ */
614
+ type RelationshipType = "alternative" | "sibling" | "parent" | "child" | "composition" | "complementary" | "used-by";
615
+ /**
616
+ * Relationship to another component
617
+ */
618
+ interface ComponentRelation {
619
+ /** Name of the related component */
620
+ component: string;
621
+ /** Type of relationship */
622
+ relationship: RelationshipType;
623
+ /** Explanation of the relationship */
624
+ note: string;
625
+ }
626
+ /**
627
+ * Loader function type for async data loading before render
628
+ */
629
+ type VariantLoader = () => Promise<Record<string, unknown>>;
630
+ /**
631
+ * Play function context passed during interaction testing
632
+ */
633
+ interface PlayFunctionContext {
634
+ /** The rendered canvas element containing the story */
635
+ canvasElement: HTMLElement;
636
+ /** Args passed to the story */
637
+ args: Record<string, unknown>;
638
+ /** Step function for organizing interactions */
639
+ step: (name: string, fn: () => Promise<void>) => Promise<void>;
640
+ }
641
+ /**
642
+ * Play function type for interaction testing
643
+ */
644
+ type PlayFunction = (context: PlayFunctionContext) => Promise<void>;
645
+ /**
646
+ * Options passed to variant render function
647
+ */
648
+ interface VariantRenderOptions {
649
+ /** Props/args to override the variant defaults */
650
+ args?: Record<string, unknown>;
651
+ /** Data loaded from async loaders */
652
+ loadedData?: Record<string, unknown>;
653
+ }
654
+ /**
655
+ * A single variant/example of the component
656
+ */
657
+ interface FragmentVariant {
658
+ /** Variant name */
659
+ name: string;
660
+ /** Description of when to use this variant */
661
+ description: string;
662
+ /** Render function that returns the component example
663
+ * @param options - Optional args overrides and loaded data
664
+ */
665
+ render: (options?: VariantRenderOptions) => ReactNode;
666
+ /** Optional code string for display (auto-generated if not provided) */
667
+ code?: string;
668
+ /** Figma frame URL for this specific variant (overrides meta.figma) */
669
+ figma?: string;
670
+ /** Whether this variant has a Storybook play function (for display purposes) */
671
+ hasPlayFunction?: boolean;
672
+ /** The actual play function for interaction testing */
673
+ play?: PlayFunction;
674
+ /** Storybook story ID for this variant (generated by @storybook/csf toId) */
675
+ storyId?: string;
676
+ /** Optional tags for this variant (inherited from story tags) */
677
+ tags?: string[];
678
+ /** Async loaders to execute before rendering (from Storybook loaders) */
679
+ loaders?: VariantLoader[];
680
+ /** The args/props used to render this variant (for code generation) */
681
+ args?: Record<string, unknown>;
682
+ }
683
+ /**
684
+ * Agent-optimized contract metadata
685
+ * Provides compact, structured data for AI code generation
686
+ */
687
+ interface FragmentContract {
688
+ /** Short prop descriptions for agents (e.g., "variant: primary|secondary (required)") */
689
+ propsSummary?: string[];
690
+ /** Accessibility rule IDs for lookup in glossary (e.g., "A11Y_BTN_LABEL") */
691
+ a11yRules?: string[];
692
+ /** Banned patterns in codebase - triggers warnings during code review */
693
+ bans?: Array<{
694
+ /** Pattern to match (regex string or literal) */
695
+ pattern: string;
696
+ /** Message explaining why this pattern is banned and what to use instead */
697
+ message: string;
698
+ }>;
699
+ /** Scenario tags for use-case matching (e.g., "form.submit", "navigation.primary") */
700
+ scenarioTags?: string[];
701
+ /** Per-component performance budget override in bytes (gzipped). Overrides global budget. */
702
+ performanceBudget?: number;
703
+ /** Sub-component slot metadata for compound components (e.g., Card.Header, Dialog.Body) */
704
+ compoundChildren?: Record<string, {
705
+ required?: boolean;
706
+ accepts?: string[];
707
+ description?: string;
708
+ }>;
709
+ /** Canonical JSX usage examples showing how to assemble the component */
710
+ canonicalUsage?: string[];
711
+ }
712
+ /**
713
+ * Provenance tracking for generated fragments
714
+ * Helps distinguish human-authored from machine-generated content
715
+ */
716
+ interface FragmentGenerated {
717
+ /** Source of this fragment definition */
718
+ source: "storybook" | "manual" | "ai" | "extracted" | "merged" | "migrated";
719
+ /** Original source file (e.g., "Button.stories.tsx") */
720
+ sourceFile?: string;
721
+ /** @deprecated Use provenance.verified instead — kept for backwards compatibility */
722
+ confidence?: number;
723
+ /** Whether the fragment has been verified against source */
724
+ verified?: boolean;
725
+ /** ISO timestamp when this was generated */
726
+ timestamp?: string;
727
+ }
728
+ /**
729
+ * AI-specific metadata for playground context generation
730
+ * Provides hints for AI code generation about component composition
731
+ */
732
+ interface AIMetadata {
733
+ /** How this component is composed with others */
734
+ compositionPattern?: "compound" | "simple" | "controlled" | "wrapper";
735
+ /** Sub-component names (without parent prefix, e.g., "Header" not "Card.Header") */
736
+ subComponents?: string[];
737
+ /** Sub-components that must be present for valid composition */
738
+ requiredChildren?: string[];
739
+ /** Common usage patterns as JSX strings for AI reference */
740
+ commonPatterns?: string[];
741
+ }
742
+ /**
743
+ * Complete fragment definition
744
+ */
745
+ interface FragmentDefinition<TProps = unknown> {
746
+ /** The component being documented */
747
+ component: FragmentComponent<TProps>;
748
+ /** Component metadata */
749
+ meta: FragmentMeta;
750
+ /** Usage guidelines */
751
+ usage: FragmentUsage;
752
+ /** Props documentation */
753
+ props: Record<string, PropDefinition>;
754
+ /** Relationships to other components */
755
+ relations?: ComponentRelation[];
756
+ /** Component variants/examples */
757
+ variants: FragmentVariant[];
758
+ /** Agent-optimized contract metadata */
759
+ contract?: FragmentContract;
760
+ /** AI-specific metadata for playground context generation */
761
+ ai?: AIMetadata;
762
+ /** Provenance tracking (for generated fragments) */
763
+ _generated?: FragmentGenerated;
764
+ }
765
+ /**
766
+ * Usage guidelines for AI agents and developers.
767
+ * v2 alias for FragmentUsage — clearer naming.
768
+ * @since 2.0
769
+ */
770
+ type FragmentGuidance = FragmentUsage;
771
+ /**
772
+ * A single example of the component.
773
+ * v2 alias for FragmentVariant — research shows "examples" is clearer for AI consumption.
774
+ * @since 2.0
775
+ */
776
+ type FragmentExample = FragmentVariant;
777
+ /**
778
+ * Composition metadata — promoted from ai.compositionPattern to first-class field.
779
+ * Uses shorter field names since the parent field is already `composition`.
780
+ * @since 2.0
781
+ */
782
+ interface CompositionMetadata {
783
+ /** How this component is composed with others */
784
+ pattern?: "compound" | "simple" | "controlled" | "wrapper";
785
+ /** Sub-component names (without parent prefix, e.g., "Header" not "Card.Header") */
786
+ subComponents?: string[];
787
+ /** Sub-components that must be present for valid composition */
788
+ requiredChildren?: string[];
789
+ /** Common usage patterns as JSX strings for AI reference */
790
+ commonPatterns?: string[];
791
+ }
792
+ /**
793
+ * Extended provenance tracking for generated fragments.
794
+ * Superset of FragmentGenerated with field-level attribution.
795
+ * @since 2.0
796
+ */
797
+ interface FragmentProvenance {
798
+ /** Source of this fragment definition */
799
+ source: "storybook" | "manual" | "ai" | "scan" | "extracted" | "merged" | "migrated";
800
+ /** Original source file (e.g., "Button.stories.tsx") */
801
+ sourceFile?: string;
802
+ /** @deprecated Use verified instead */
803
+ confidence?: number;
804
+ /** Whether the fragment has been verified against source */
805
+ verified: boolean;
806
+ /** Framework support level */
807
+ frameworkSupport?: "native" | "manual-only";
808
+ /** SHA hash of the source file at extraction time */
809
+ sourceHash?: string;
810
+ /** ISO timestamp when this was generated */
811
+ timestamp?: string;
812
+ /** Fields that were auto-extracted (e.g., ['props', 'composition']) */
813
+ autoFields?: string[];
814
+ /** Fields that were human-authored (e.g., ['guidance', 'examples']) */
815
+ humanFields?: string[];
816
+ }
817
+ /**
818
+ * v2 fragment definition with clearer field names.
819
+ *
820
+ * Changes from v1 FragmentDefinition:
821
+ * - `usage` → `guidance` (clearer intent)
822
+ * - `variants` → `examples` (research-backed: examples > parameter lists)
823
+ * - `ai` → `composition` (promoted to first-class, shorter field names)
824
+ * - `_generated` → `_provenance` (extended with autoFields/humanFields)
825
+ * - `contract` remains but is auto-compiled at build time
826
+ *
827
+ * @since 2.0
828
+ */
829
+ interface FragmentDefinitionV2<TProps = unknown> {
830
+ /** The component being documented */
831
+ component: FragmentComponent<TProps>;
832
+ /** Component metadata */
833
+ meta: FragmentMeta;
834
+ /** Usage guidelines (v2 name for 'usage') */
835
+ guidance: FragmentGuidance;
836
+ /** Props documentation */
837
+ props: Record<string, PropDefinition>;
838
+ /** Relationships to other components */
839
+ relations?: ComponentRelation[];
840
+ /** Component examples (v2 name for 'variants') */
841
+ examples: FragmentExample[];
842
+ /** Composition metadata (v2 name for 'ai', promoted to first-class) */
843
+ composition?: CompositionMetadata;
844
+ /** Agent-optimized contract — auto-compiled at build time */
845
+ contract?: FragmentContract;
846
+ /** Provenance tracking (v2 name for '_generated', extended) */
847
+ _provenance?: FragmentProvenance;
848
+ }
849
+ /**
850
+ * Registry generation options
851
+ */
852
+ interface RegistryOptions {
853
+ /** Only include components that have a corresponding .stories.tsx file */
854
+ requireStory?: boolean;
855
+ /** Only include components that are exported (public API) */
856
+ publicOnly?: boolean;
857
+ /** Maximum depth for category inference from directory structure (default: 1) */
858
+ categoryDepth?: number;
859
+ /** Include props in registry (default: false - AI can read TypeScript directly) */
860
+ includeProps?: boolean;
861
+ /** Include full fragment data in registry (default: false - reference fragmentPath instead) */
862
+ embedFragments?: boolean;
863
+ }
864
+ /**
865
+ * Design token configuration
866
+ */
867
+ type RepoRelativePath = string;
868
+ interface AppConfig {
869
+ /** Repo-root-relative app/source directory to scan. Defaults to ".". */
870
+ path?: RepoRelativePath;
871
+ /** Optional source globs relative to app.path. */
872
+ include?: string[];
873
+ /** Optional source exclusions relative to app.path. */
874
+ exclude?: string[];
875
+ }
876
+ interface DesignSystemConfig {
877
+ /** Repo-root-relative directory that owns the canonical primitives. */
878
+ path?: RepoRelativePath;
879
+ /** Package name for primitive imports. Inferred from path/package.json when omitted. */
880
+ packageName?: string;
881
+ /** Component source globs relative to designSystem.path. */
882
+ components?: string[];
883
+ }
884
+ type TokenSourceFormat = "auto" | "css" | "scss" | "dtcg" | "tailwind";
885
+ interface TokenSourceConfig {
886
+ /** Repo-root-relative token file or glob. */
887
+ path: RepoRelativePath;
888
+ /** Explicit token format, or "auto" to infer from extension/content. */
889
+ format?: TokenSourceFormat;
890
+ }
891
+ interface TokenConfig {
892
+ /**
893
+ * Glob patterns for files to scan for tokens
894
+ * e.g., ["src/styles/theme.scss", "src/styles/variables.css"]
895
+ */
896
+ include?: string[];
897
+ /** Repo-root-relative token source files/globs for monorepos and Cloud setup. */
898
+ sources?: TokenSourceConfig[];
899
+ /**
900
+ * Glob patterns to exclude
901
+ * @example ["node_modules"]
902
+ */
903
+ exclude?: string[];
904
+ /**
905
+ * Map CSS selectors to theme names
906
+ * @example { ":root": "default", "[data-theme='dark']": "dark" }
907
+ */
908
+ themeSelectors?: Record<string, string>;
909
+ /** Enable token comparison in style diffs (default: true) */
910
+ enabled?: boolean;
911
+ /** Token source format detection ('auto' detects from file extension) */
912
+ format?: TokenSourceFormat;
913
+ /** Vendor namespace for Fragments extensions in DTCG files (default: 'com.usefragments') */
914
+ namespace?: string;
915
+ }
916
+ /**
917
+ * CI configuration for automated compliance checks
918
+ */
919
+ interface CIConfig {
920
+ /** Minimum compliance percentage to pass (default: 80) */
921
+ minCompliance?: number;
922
+ /** Whether to fail on any visual regression */
923
+ failOnDiff?: boolean;
924
+ /** Whether to output JSON format */
925
+ jsonOutput?: boolean;
926
+ }
927
+ /**
928
+ * Snippet policy configuration.
929
+ * Controls snippet/render quality enforcement in `fragments validate`.
930
+ */
931
+ interface SnippetPolicyConfig {
932
+ /** Validation mode: warn (non-blocking) or error (blocking). Default: warn */
933
+ mode?: "warn" | "error";
934
+ /** Validate snippet strings only, or snippet strings + render functions. Default: snippet+render */
935
+ scope?: "snippet" | "snippet+render";
936
+ /** Require authored snippets to be full, copy-pasteable examples with imports. Default: true */
937
+ requireFullSnippet?: boolean;
938
+ /** Allow these external modules for JSX components in snippets/renders. */
939
+ allowedExternalModules?: string[];
940
+ }
941
+ /**
942
+ * Storybook adapter filtering configuration.
943
+ * Controls which Storybook stories are included when generating fragments.
944
+ */
945
+ interface StorybookFilterConfig {
946
+ /** Glob-style patterns for component names to explicitly exclude */
947
+ exclude?: string[];
948
+ /** Glob-style patterns for component names to force-include (bypasses all heuristic filters) */
949
+ include?: string[];
950
+ /** Exclude stories with "Deprecated" in the title (default: true) */
951
+ excludeDeprecated?: boolean;
952
+ /** Exclude test stories (title ending /test(s) or *.test.stories.* files) (default: true) */
953
+ excludeTests?: boolean;
954
+ /** Exclude SVG icon components (names matching Svg[A-Z]*) (default: true) */
955
+ excludeSvgIcons?: boolean;
956
+ /** Exclude sub-components detected by directory structure (default: true) */
957
+ excludeSubComponents?: boolean;
958
+ }
959
+ /**
960
+ * Theme seed configuration.
961
+ * The 5 root values that derive 120+ CSS custom properties.
962
+ */
963
+ interface ThemeSeeds {
964
+ /** Primary brand color as hex (e.g., "#6366f1") */
965
+ brand?: string;
966
+ /** Neutral palette name */
967
+ neutral?: "stone" | "ice" | "earth" | "sand" | "fire" | "fragments";
968
+ /** Spacing density scale */
969
+ density?: "compact" | "default" | "relaxed";
970
+ /** Border radius style */
971
+ radiusStyle?: "sharp" | "subtle" | "default" | "rounded" | "pill";
972
+ /** Danger/error color as hex (e.g., "#ef4444") */
973
+ danger?: string;
974
+ }
975
+ /**
976
+ * Visual snapshot testing configuration.
977
+ */
978
+ interface SnapshotConfig {
979
+ /** Enable visual snapshot tests (default: false) */
980
+ enabled: boolean;
981
+ /** Output directory for snapshot baselines (relative to project root) */
982
+ outputDir?: string;
983
+ /** Viewport width for snapshots (default: 1440) */
984
+ viewportWidth?: number;
985
+ /** Viewport height for snapshots (default: 1100) */
986
+ viewportHeight?: number;
987
+ /** Diff threshold percentage before a snapshot fails (default: 0.1) */
988
+ threshold?: number;
989
+ /** Disable CSS animations during capture (default: true) */
990
+ disableAnimations?: boolean;
991
+ }
992
+ /**
993
+ * Config file structure
994
+ */
995
+ interface FragmentsConfig {
996
+ /** App/source scan scope. Paths are repo-root-relative. */
997
+ app?: AppConfig;
998
+ /** Canonical primitive component source. Paths are repo-root-relative. */
999
+ designSystem?: DesignSystemConfig;
1000
+ /** Glob patterns for finding fragment/fragment files */
1001
+ include?: string[];
1002
+ /** Glob patterns to exclude */
1003
+ exclude?: string[];
1004
+ /** Glob patterns for finding component files (for coverage validation) */
1005
+ components?: string[];
1006
+ /** Output path for compiled output */
1007
+ outFile?: string;
1008
+ /** Framework adapter to use */
1009
+ framework?: "react" | "vue" | "svelte";
1010
+ /** Figma file URL for the design system (used by `fragments link`) */
1011
+ figmaFile?: string;
1012
+ /** Figma access token (alternative to FIGMA_ACCESS_TOKEN env var) */
1013
+ figmaToken?: string;
1014
+ /** Screenshot configuration */
1015
+ screenshots?: ScreenshotConfig;
1016
+ /** Service configuration */
1017
+ service?: ServiceConfig;
1018
+ /** Registry generation options */
1019
+ registry?: RegistryOptions;
1020
+ /** Design token discovery and mapping configuration */
1021
+ tokens?: TokenConfig;
1022
+ /** CI pipeline configuration */
1023
+ ci?: CIConfig;
1024
+ /** Snippet/render policy validation */
1025
+ snippets?: SnippetPolicyConfig;
1026
+ /** Performance budgets: preset name or custom config */
1027
+ performance?: string | {
1028
+ preset?: string;
1029
+ budgets?: {
1030
+ bundleSize?: number;
1031
+ };
1032
+ };
1033
+ /** Storybook adapter filtering configuration */
1034
+ storybook?: StorybookFilterConfig;
1035
+ /** Theme seed values for the 5-seed theming system */
1036
+ theme?: ThemeSeeds;
1037
+ /**
1038
+ * Product-area topology — maps file paths to areas (checkout, dashboard, …)
1039
+ * for area-scoped governance. Resolved at scan time; areas are tagged onto
1040
+ * findings and coverage. See `apps/cloud/docs/topology/`.
1041
+ */
1042
+ topology?: Topology;
1043
+ /** Visual snapshot testing configuration */
1044
+ snapshots?: SnapshotConfig;
1045
+ /** Preview configuration for component rendering */
1046
+ preview?: {
1047
+ /** Module that runs before any render (global CSS, MSW, mocks) */
1048
+ setupModule?: string;
1049
+ /** Module path for the render wrapper component (ThemeProvider, etc.) */
1050
+ wrapperModule?: string;
1051
+ /** Named export from wrapperModule (e.g., 'ThemeProvider') */
1052
+ wrapperExport?: string;
1053
+ /** Additional CSS files to inject */
1054
+ css?: string[];
1055
+ /** Default theme for previews */
1056
+ theme?: "light" | "dark";
1057
+ };
1058
+ /** Governance policy configuration (replaces standalone govern.config.ts) */
1059
+ govern?: GovernanceConfig;
1060
+ /** Local Inspect-only configuration. */
1061
+ inspect?: InspectConfig;
1062
+ /**
1063
+ * Identifier names recognized as className-helper callees during Tailwind
1064
+ * extraction (e.g. `clsx`, `cn`). Supplying this list **replaces** the
1065
+ * default `['clsx', 'cn', 'classnames', 'twMerge', 'tw', 'cva']` — it does
1066
+ * not merge.
1067
+ */
1068
+ recognizedClassHelpers?: string[];
1069
+ }
1070
+ /**
1071
+ * Screenshot capture configuration
1072
+ */
1073
+ interface ScreenshotConfig {
1074
+ /** Default viewport for captures */
1075
+ viewport?: Viewport;
1076
+ /** Diff threshold percentage (0-100) */
1077
+ threshold?: number;
1078
+ /** Additional delay after render before capture (ms) */
1079
+ delay?: number;
1080
+ /** Output directory for baselines (relative to project root) */
1081
+ outputDir?: string;
1082
+ /** Themes to capture */
1083
+ themes?: Theme[];
1084
+ }
1085
+ /**
1086
+ * Service configuration
1087
+ */
1088
+ interface ServiceConfig {
1089
+ /** Browser pool size */
1090
+ poolSize?: number;
1091
+ /** Idle timeout before shutdown (ms) */
1092
+ idleTimeout?: number;
1093
+ }
1094
+ /**
1095
+ * Viewport dimensions
1096
+ */
1097
+ interface Viewport {
1098
+ width: number;
1099
+ height: number;
1100
+ deviceScaleFactor?: number;
1101
+ }
1102
+ /**
1103
+ * Theme identifier
1104
+ */
1105
+ type Theme = "light" | "dark";
1106
+ /**
1107
+ * Screenshot metadata
1108
+ */
1109
+ interface Screenshot {
1110
+ /** PNG image data */
1111
+ data: Buffer;
1112
+ /** SHA-256 hash of image data (for change detection) */
1113
+ hash: string;
1114
+ /** Viewport used for capture */
1115
+ viewport: Viewport;
1116
+ /** When this screenshot was taken */
1117
+ capturedAt: Date;
1118
+ /** Capture metadata */
1119
+ metadata: ScreenshotMetadata;
1120
+ }
1121
+ /**
1122
+ * Screenshot metadata
1123
+ */
1124
+ interface ScreenshotMetadata {
1125
+ /** Component name */
1126
+ component: string;
1127
+ /** Variant name */
1128
+ variant: string;
1129
+ /** Theme used */
1130
+ theme: Theme;
1131
+ /** Time to render the component (ms) */
1132
+ renderTimeMs: number;
1133
+ /** Time to capture the screenshot (ms) */
1134
+ captureTimeMs: number;
1135
+ }
1136
+ /**
1137
+ * Result of comparing two screenshots
1138
+ */
1139
+ interface DiffResult {
1140
+ /** Whether images are considered matching (below threshold) */
1141
+ matches: boolean;
1142
+ /** Percentage of pixels that differ (0-100) */
1143
+ diffPercentage: number;
1144
+ /** Number of differing pixels */
1145
+ diffPixelCount: number;
1146
+ /** Total pixels compared */
1147
+ totalPixels: number;
1148
+ /** PNG image highlighting differences */
1149
+ diffImage?: Buffer;
1150
+ /** Bounding boxes of changed regions */
1151
+ changedRegions: BoundingBox[];
1152
+ /** Time taken to compute diff (ms) */
1153
+ diffTimeMs: number;
1154
+ }
1155
+ /**
1156
+ * Bounding box for changed region
1157
+ */
1158
+ interface BoundingBox {
1159
+ x: number;
1160
+ y: number;
1161
+ width: number;
1162
+ height: number;
1163
+ }
1164
+ /**
1165
+ * Baseline information stored in manifest
1166
+ */
1167
+ interface BaselineInfo {
1168
+ /** Component name */
1169
+ component: string;
1170
+ /** Variant name */
1171
+ variant: string;
1172
+ /** Theme */
1173
+ theme: Theme;
1174
+ /** Relative path to image file */
1175
+ path: string;
1176
+ /** SHA-256 hash */
1177
+ hash: string;
1178
+ /** Viewport used */
1179
+ viewport: Viewport;
1180
+ /** When captured */
1181
+ capturedAt: string;
1182
+ /** File size in bytes */
1183
+ fileSize: number;
1184
+ }
1185
+ /**
1186
+ * Manifest file structure
1187
+ */
1188
+ interface Manifest {
1189
+ /** Schema version */
1190
+ version: "1.0.0";
1191
+ /** When manifest was generated */
1192
+ generatedAt: string;
1193
+ /** Configuration used for capture */
1194
+ config: {
1195
+ defaultViewport: Viewport;
1196
+ defaultThreshold: number;
1197
+ captureDelay: number;
1198
+ };
1199
+ /** All baselines indexed by component/variant */
1200
+ baselines: Record<string, Record<string, BaselineInfo>>;
1201
+ }
1202
+ /**
1203
+ * Verification request from AI agents
1204
+ */
1205
+ interface VerifyRequest {
1206
+ /** Component name */
1207
+ component: string;
1208
+ /** Variant name */
1209
+ variant: string;
1210
+ /** Theme to verify against */
1211
+ theme?: Theme;
1212
+ /** Override diff threshold */
1213
+ threshold?: number;
1214
+ }
1215
+ /**
1216
+ * Verification result
1217
+ */
1218
+ interface VerifyResult {
1219
+ /** Overall verdict */
1220
+ verdict: "pass" | "fail" | "error";
1221
+ /** Whether diff is below threshold */
1222
+ matches: boolean;
1223
+ /** Percentage of pixels that differ */
1224
+ diffPercentage: number;
1225
+ /** Current screenshot (base64 PNG) */
1226
+ screenshot: string;
1227
+ /** Baseline screenshot (base64 PNG) */
1228
+ baseline: string;
1229
+ /** Diff image if different (base64 PNG) */
1230
+ diffImage?: string;
1231
+ /** Human-readable notes */
1232
+ notes: string[];
1233
+ /** Error message if verdict is "error" */
1234
+ error?: string;
1235
+ /** Performance metrics */
1236
+ timing: {
1237
+ renderMs: number;
1238
+ captureMs: number;
1239
+ diffMs: number;
1240
+ totalMs: number;
1241
+ };
1242
+ }
1243
+
1244
+ /**
1245
+ * Block definition — a named composition pattern showing how
1246
+ * design system components wire together for a common use case.
1247
+ */
1248
+ interface BlockDefinition {
1249
+ name: string;
1250
+ description: string;
1251
+ category: string;
1252
+ components: string[];
1253
+ code: string;
1254
+ tags?: string[];
1255
+ }
1256
+ /**
1257
+ * @deprecated Use BlockDefinition instead
1258
+ */
1259
+ type RecipeDefinition = BlockDefinition;
1260
+ /**
1261
+ * @deprecated Use CompiledBlock instead
1262
+ */
1263
+ type CompiledRecipe = CompiledBlock;
1264
+
1265
+ declare const governanceSeveritySchema: z.ZodEnum<["error", "warn", "info"]>;
1266
+ type GovernanceSeverity = z.infer<typeof governanceSeveritySchema>;
1267
+ declare const scaleGovernanceRecordSchema: z.ZodObject<{
1268
+ kind: z.ZodDefault<z.ZodLiteral<"scale">>;
1269
+ name: z.ZodOptional<z.ZodString>;
1270
+ unit: z.ZodEnum<["px", "rem"]>;
1271
+ values: z.ZodArray<z.ZodNumber, "many">;
1272
+ rootFontSizePx: z.ZodOptional<z.ZodNumber>;
1273
+ emBasePx: z.ZodOptional<z.ZodNumber>;
1274
+ }, "strip", z.ZodTypeAny, {
1275
+ values: number[];
1276
+ kind: "scale";
1277
+ unit: "px" | "rem";
1278
+ name?: string | undefined;
1279
+ rootFontSizePx?: number | undefined;
1280
+ emBasePx?: number | undefined;
1281
+ }, {
1282
+ values: number[];
1283
+ unit: "px" | "rem";
1284
+ kind?: "scale" | undefined;
1285
+ name?: string | undefined;
1286
+ rootFontSizePx?: number | undefined;
1287
+ emBasePx?: number | undefined;
1288
+ }>;
1289
+ declare const globalStyleGovernanceRecordSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1290
+ kind: z.ZodLiteral<"style.rawColors.forbid">;
1291
+ except: z.ZodArray<z.ZodString, "many">;
1292
+ prefer: z.ZodEnum<["token", "css-variable"]>;
1293
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1294
+ }, "strip", z.ZodTypeAny, {
1295
+ kind: "style.rawColors.forbid";
1296
+ severity: "error" | "info" | "warn";
1297
+ except: string[];
1298
+ prefer: "token" | "css-variable";
1299
+ }, {
1300
+ kind: "style.rawColors.forbid";
1301
+ severity: "error" | "info" | "warn";
1302
+ except: string[];
1303
+ prefer: "token" | "css-variable";
1304
+ }>, z.ZodObject<{
1305
+ kind: z.ZodLiteral<"style.rawDimensions.forbid">;
1306
+ appliesTo: z.ZodArray<z.ZodString, "many">;
1307
+ prefer: z.ZodEnum<["token", "css-variable"]>;
1308
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1309
+ }, "strip", z.ZodTypeAny, {
1310
+ kind: "style.rawDimensions.forbid";
1311
+ severity: "error" | "info" | "warn";
1312
+ prefer: "token" | "css-variable";
1313
+ appliesTo: string[];
1314
+ }, {
1315
+ kind: "style.rawDimensions.forbid";
1316
+ severity: "error" | "info" | "warn";
1317
+ prefer: "token" | "css-variable";
1318
+ appliesTo: string[];
1319
+ }>, z.ZodObject<{
1320
+ kind: z.ZodLiteral<"style.rawSpacing.mustMatchScale">;
1321
+ scale: z.ZodString;
1322
+ appliesTo: z.ZodArray<z.ZodString, "many">;
1323
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1324
+ }, "strip", z.ZodTypeAny, {
1325
+ kind: "style.rawSpacing.mustMatchScale";
1326
+ severity: "error" | "info" | "warn";
1327
+ scale: string;
1328
+ appliesTo: string[];
1329
+ }, {
1330
+ kind: "style.rawSpacing.mustMatchScale";
1331
+ severity: "error" | "info" | "warn";
1332
+ scale: string;
1333
+ appliesTo: string[];
1334
+ }>, z.ZodObject<{
1335
+ kind: z.ZodLiteral<"style.fontSize.mustMatchScale">;
1336
+ scale: z.ZodString;
1337
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1338
+ }, "strip", z.ZodTypeAny, {
1339
+ kind: "style.fontSize.mustMatchScale";
1340
+ severity: "error" | "info" | "warn";
1341
+ scale: string;
1342
+ }, {
1343
+ kind: "style.fontSize.mustMatchScale";
1344
+ severity: "error" | "info" | "warn";
1345
+ scale: string;
1346
+ }>, z.ZodObject<{
1347
+ kind: z.ZodLiteral<"style.cssVars.mustBeDefined">;
1348
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1349
+ }, "strip", z.ZodTypeAny, {
1350
+ kind: "style.cssVars.mustBeDefined";
1351
+ severity: "error" | "info" | "warn";
1352
+ }, {
1353
+ kind: "style.cssVars.mustBeDefined";
1354
+ severity: "error" | "info" | "warn";
1355
+ }>]>;
1356
+ declare const globalJsxGovernanceRecordSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1357
+ kind: z.ZodLiteral<"jsx.unknownProps.forbid">;
1358
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1359
+ }, "strip", z.ZodTypeAny, {
1360
+ kind: "jsx.unknownProps.forbid";
1361
+ severity: "error" | "info" | "warn";
1362
+ }, {
1363
+ kind: "jsx.unknownProps.forbid";
1364
+ severity: "error" | "info" | "warn";
1365
+ }>, z.ZodObject<{
1366
+ kind: z.ZodLiteral<"jsx.inlineStyle.forbidRaw">;
1367
+ properties: z.ZodArray<z.ZodString, "many">;
1368
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1369
+ }, "strip", z.ZodTypeAny, {
1370
+ kind: "jsx.inlineStyle.forbidRaw";
1371
+ severity: "error" | "info" | "warn";
1372
+ properties: string[];
1373
+ }, {
1374
+ kind: "jsx.inlineStyle.forbidRaw";
1375
+ severity: "error" | "info" | "warn";
1376
+ properties: string[];
1377
+ }>, z.ZodObject<{
1378
+ kind: z.ZodLiteral<"jsx.importPath.prefer">;
1379
+ from: z.ZodString;
1380
+ to: z.ZodString;
1381
+ imported: z.ZodOptional<z.ZodString>;
1382
+ because: z.ZodOptional<z.ZodString>;
1383
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1384
+ }, "strip", z.ZodTypeAny, {
1385
+ kind: "jsx.importPath.prefer";
1386
+ from: string;
1387
+ to: string;
1388
+ severity: "error" | "info" | "warn";
1389
+ imported?: string | undefined;
1390
+ because?: string | undefined;
1391
+ }, {
1392
+ kind: "jsx.importPath.prefer";
1393
+ from: string;
1394
+ to: string;
1395
+ severity: "error" | "info" | "warn";
1396
+ imported?: string | undefined;
1397
+ because?: string | undefined;
1398
+ }>, z.ZodObject<{
1399
+ kind: z.ZodLiteral<"jsx.component.prefer">;
1400
+ from: z.ZodString;
1401
+ to: z.ZodString;
1402
+ because: z.ZodOptional<z.ZodString>;
1403
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1404
+ }, "strip", z.ZodTypeAny, {
1405
+ kind: "jsx.component.prefer";
1406
+ from: string;
1407
+ to: string;
1408
+ severity: "error" | "info" | "warn";
1409
+ because?: string | undefined;
1410
+ }, {
1411
+ kind: "jsx.component.prefer";
1412
+ from: string;
1413
+ to: string;
1414
+ severity: "error" | "info" | "warn";
1415
+ because?: string | undefined;
1416
+ }>]>;
1417
+ declare const globalGovernanceRecordSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1418
+ kind: z.ZodDefault<z.ZodLiteral<"scale">>;
1419
+ name: z.ZodOptional<z.ZodString>;
1420
+ unit: z.ZodEnum<["px", "rem"]>;
1421
+ values: z.ZodArray<z.ZodNumber, "many">;
1422
+ rootFontSizePx: z.ZodOptional<z.ZodNumber>;
1423
+ emBasePx: z.ZodOptional<z.ZodNumber>;
1424
+ }, "strip", z.ZodTypeAny, {
1425
+ values: number[];
1426
+ kind: "scale";
1427
+ unit: "px" | "rem";
1428
+ name?: string | undefined;
1429
+ rootFontSizePx?: number | undefined;
1430
+ emBasePx?: number | undefined;
1431
+ }, {
1432
+ values: number[];
1433
+ unit: "px" | "rem";
1434
+ kind?: "scale" | undefined;
1435
+ name?: string | undefined;
1436
+ rootFontSizePx?: number | undefined;
1437
+ emBasePx?: number | undefined;
1438
+ }>, z.ZodObject<{
1439
+ kind: z.ZodLiteral<"style.rawColors.forbid">;
1440
+ except: z.ZodArray<z.ZodString, "many">;
1441
+ prefer: z.ZodEnum<["token", "css-variable"]>;
1442
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1443
+ }, "strip", z.ZodTypeAny, {
1444
+ kind: "style.rawColors.forbid";
1445
+ severity: "error" | "info" | "warn";
1446
+ except: string[];
1447
+ prefer: "token" | "css-variable";
1448
+ }, {
1449
+ kind: "style.rawColors.forbid";
1450
+ severity: "error" | "info" | "warn";
1451
+ except: string[];
1452
+ prefer: "token" | "css-variable";
1453
+ }>, z.ZodObject<{
1454
+ kind: z.ZodLiteral<"style.rawDimensions.forbid">;
1455
+ appliesTo: z.ZodArray<z.ZodString, "many">;
1456
+ prefer: z.ZodEnum<["token", "css-variable"]>;
1457
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1458
+ }, "strip", z.ZodTypeAny, {
1459
+ kind: "style.rawDimensions.forbid";
1460
+ severity: "error" | "info" | "warn";
1461
+ prefer: "token" | "css-variable";
1462
+ appliesTo: string[];
1463
+ }, {
1464
+ kind: "style.rawDimensions.forbid";
1465
+ severity: "error" | "info" | "warn";
1466
+ prefer: "token" | "css-variable";
1467
+ appliesTo: string[];
1468
+ }>, z.ZodObject<{
1469
+ kind: z.ZodLiteral<"style.rawSpacing.mustMatchScale">;
1470
+ scale: z.ZodString;
1471
+ appliesTo: z.ZodArray<z.ZodString, "many">;
1472
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1473
+ }, "strip", z.ZodTypeAny, {
1474
+ kind: "style.rawSpacing.mustMatchScale";
1475
+ severity: "error" | "info" | "warn";
1476
+ scale: string;
1477
+ appliesTo: string[];
1478
+ }, {
1479
+ kind: "style.rawSpacing.mustMatchScale";
1480
+ severity: "error" | "info" | "warn";
1481
+ scale: string;
1482
+ appliesTo: string[];
1483
+ }>, z.ZodObject<{
1484
+ kind: z.ZodLiteral<"style.fontSize.mustMatchScale">;
1485
+ scale: z.ZodString;
1486
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1487
+ }, "strip", z.ZodTypeAny, {
1488
+ kind: "style.fontSize.mustMatchScale";
1489
+ severity: "error" | "info" | "warn";
1490
+ scale: string;
1491
+ }, {
1492
+ kind: "style.fontSize.mustMatchScale";
1493
+ severity: "error" | "info" | "warn";
1494
+ scale: string;
1495
+ }>, z.ZodObject<{
1496
+ kind: z.ZodLiteral<"style.cssVars.mustBeDefined">;
1497
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1498
+ }, "strip", z.ZodTypeAny, {
1499
+ kind: "style.cssVars.mustBeDefined";
1500
+ severity: "error" | "info" | "warn";
1501
+ }, {
1502
+ kind: "style.cssVars.mustBeDefined";
1503
+ severity: "error" | "info" | "warn";
1504
+ }>, z.ZodObject<{
1505
+ kind: z.ZodLiteral<"jsx.unknownProps.forbid">;
1506
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1507
+ }, "strip", z.ZodTypeAny, {
1508
+ kind: "jsx.unknownProps.forbid";
1509
+ severity: "error" | "info" | "warn";
1510
+ }, {
1511
+ kind: "jsx.unknownProps.forbid";
1512
+ severity: "error" | "info" | "warn";
1513
+ }>, z.ZodObject<{
1514
+ kind: z.ZodLiteral<"jsx.inlineStyle.forbidRaw">;
1515
+ properties: z.ZodArray<z.ZodString, "many">;
1516
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1517
+ }, "strip", z.ZodTypeAny, {
1518
+ kind: "jsx.inlineStyle.forbidRaw";
1519
+ severity: "error" | "info" | "warn";
1520
+ properties: string[];
1521
+ }, {
1522
+ kind: "jsx.inlineStyle.forbidRaw";
1523
+ severity: "error" | "info" | "warn";
1524
+ properties: string[];
1525
+ }>, z.ZodObject<{
1526
+ kind: z.ZodLiteral<"jsx.importPath.prefer">;
1527
+ from: z.ZodString;
1528
+ to: z.ZodString;
1529
+ imported: z.ZodOptional<z.ZodString>;
1530
+ because: z.ZodOptional<z.ZodString>;
1531
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1532
+ }, "strip", z.ZodTypeAny, {
1533
+ kind: "jsx.importPath.prefer";
1534
+ from: string;
1535
+ to: string;
1536
+ severity: "error" | "info" | "warn";
1537
+ imported?: string | undefined;
1538
+ because?: string | undefined;
1539
+ }, {
1540
+ kind: "jsx.importPath.prefer";
1541
+ from: string;
1542
+ to: string;
1543
+ severity: "error" | "info" | "warn";
1544
+ imported?: string | undefined;
1545
+ because?: string | undefined;
1546
+ }>, z.ZodObject<{
1547
+ kind: z.ZodLiteral<"jsx.component.prefer">;
1548
+ from: z.ZodString;
1549
+ to: z.ZodString;
1550
+ because: z.ZodOptional<z.ZodString>;
1551
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1552
+ }, "strip", z.ZodTypeAny, {
1553
+ kind: "jsx.component.prefer";
1554
+ from: string;
1555
+ to: string;
1556
+ severity: "error" | "info" | "warn";
1557
+ because?: string | undefined;
1558
+ }, {
1559
+ kind: "jsx.component.prefer";
1560
+ from: string;
1561
+ to: string;
1562
+ severity: "error" | "info" | "warn";
1563
+ because?: string | undefined;
1564
+ }>]>;
1565
+ declare const componentGovernanceRecordSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1566
+ kind: z.ZodLiteral<"capability">;
1567
+ capability: z.ZodString;
1568
+ }, "strip", z.ZodTypeAny, {
1569
+ kind: "capability";
1570
+ capability: string;
1571
+ }, {
1572
+ kind: "capability";
1573
+ capability: string;
1574
+ }>, z.ZodObject<{
1575
+ kind: z.ZodLiteral<"prop.value.avoid">;
1576
+ prop: z.ZodString;
1577
+ value: z.ZodUnknown;
1578
+ because: z.ZodString;
1579
+ suggest: z.ZodOptional<z.ZodString>;
1580
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1581
+ }, "strip", z.ZodTypeAny, {
1582
+ kind: "prop.value.avoid";
1583
+ prop: string;
1584
+ severity: "error" | "info" | "warn";
1585
+ because: string;
1586
+ value?: unknown;
1587
+ suggest?: string | undefined;
1588
+ }, {
1589
+ kind: "prop.value.avoid";
1590
+ prop: string;
1591
+ severity: "error" | "info" | "warn";
1592
+ because: string;
1593
+ value?: unknown;
1594
+ suggest?: string | undefined;
1595
+ }>, z.ZodObject<{
1596
+ kind: z.ZodLiteral<"prop.value.forbid">;
1597
+ prop: z.ZodString;
1598
+ value: z.ZodUnknown;
1599
+ when: z.ZodOptional<z.ZodObject<{
1600
+ path: z.ZodOptional<z.ZodString>;
1601
+ }, "strip", z.ZodTypeAny, {
1602
+ path?: string | undefined;
1603
+ }, {
1604
+ path?: string | undefined;
1605
+ }>>;
1606
+ because: z.ZodString;
1607
+ fix: z.ZodOptional<z.ZodObject<{
1608
+ replaceWith: z.ZodUnknown;
1609
+ }, "strip", z.ZodTypeAny, {
1610
+ replaceWith?: unknown;
1611
+ }, {
1612
+ replaceWith?: unknown;
1613
+ }>>;
1614
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1615
+ }, "strip", z.ZodTypeAny, {
1616
+ kind: "prop.value.forbid";
1617
+ prop: string;
1618
+ severity: "error" | "info" | "warn";
1619
+ because: string;
1620
+ value?: unknown;
1621
+ fix?: {
1622
+ replaceWith?: unknown;
1623
+ } | undefined;
1624
+ when?: {
1625
+ path?: string | undefined;
1626
+ } | undefined;
1627
+ }, {
1628
+ kind: "prop.value.forbid";
1629
+ prop: string;
1630
+ severity: "error" | "info" | "warn";
1631
+ because: string;
1632
+ value?: unknown;
1633
+ fix?: {
1634
+ replaceWith?: unknown;
1635
+ } | undefined;
1636
+ when?: {
1637
+ path?: string | undefined;
1638
+ } | undefined;
1639
+ }>, z.ZodObject<{
1640
+ kind: z.ZodLiteral<"a11y.requireName">;
1641
+ because: z.ZodString;
1642
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1643
+ }, "strip", z.ZodTypeAny, {
1644
+ kind: "a11y.requireName";
1645
+ severity: "error" | "info" | "warn";
1646
+ because: string;
1647
+ }, {
1648
+ kind: "a11y.requireName";
1649
+ severity: "error" | "info" | "warn";
1650
+ because: string;
1651
+ }>]>;
1652
+ declare const componentGovernanceRecordsSchema: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1653
+ kind: z.ZodLiteral<"capability">;
1654
+ capability: z.ZodString;
1655
+ }, "strip", z.ZodTypeAny, {
1656
+ kind: "capability";
1657
+ capability: string;
1658
+ }, {
1659
+ kind: "capability";
1660
+ capability: string;
1661
+ }>, z.ZodObject<{
1662
+ kind: z.ZodLiteral<"prop.value.avoid">;
1663
+ prop: z.ZodString;
1664
+ value: z.ZodUnknown;
1665
+ because: z.ZodString;
1666
+ suggest: z.ZodOptional<z.ZodString>;
1667
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1668
+ }, "strip", z.ZodTypeAny, {
1669
+ kind: "prop.value.avoid";
1670
+ prop: string;
1671
+ severity: "error" | "info" | "warn";
1672
+ because: string;
1673
+ value?: unknown;
1674
+ suggest?: string | undefined;
1675
+ }, {
1676
+ kind: "prop.value.avoid";
1677
+ prop: string;
1678
+ severity: "error" | "info" | "warn";
1679
+ because: string;
1680
+ value?: unknown;
1681
+ suggest?: string | undefined;
1682
+ }>, z.ZodObject<{
1683
+ kind: z.ZodLiteral<"prop.value.forbid">;
1684
+ prop: z.ZodString;
1685
+ value: z.ZodUnknown;
1686
+ when: z.ZodOptional<z.ZodObject<{
1687
+ path: z.ZodOptional<z.ZodString>;
1688
+ }, "strip", z.ZodTypeAny, {
1689
+ path?: string | undefined;
1690
+ }, {
1691
+ path?: string | undefined;
1692
+ }>>;
1693
+ because: z.ZodString;
1694
+ fix: z.ZodOptional<z.ZodObject<{
1695
+ replaceWith: z.ZodUnknown;
1696
+ }, "strip", z.ZodTypeAny, {
1697
+ replaceWith?: unknown;
1698
+ }, {
1699
+ replaceWith?: unknown;
1700
+ }>>;
1701
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1702
+ }, "strip", z.ZodTypeAny, {
1703
+ kind: "prop.value.forbid";
1704
+ prop: string;
1705
+ severity: "error" | "info" | "warn";
1706
+ because: string;
1707
+ value?: unknown;
1708
+ fix?: {
1709
+ replaceWith?: unknown;
1710
+ } | undefined;
1711
+ when?: {
1712
+ path?: string | undefined;
1713
+ } | undefined;
1714
+ }, {
1715
+ kind: "prop.value.forbid";
1716
+ prop: string;
1717
+ severity: "error" | "info" | "warn";
1718
+ because: string;
1719
+ value?: unknown;
1720
+ fix?: {
1721
+ replaceWith?: unknown;
1722
+ } | undefined;
1723
+ when?: {
1724
+ path?: string | undefined;
1725
+ } | undefined;
1726
+ }>, z.ZodObject<{
1727
+ kind: z.ZodLiteral<"a11y.requireName">;
1728
+ because: z.ZodString;
1729
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1730
+ }, "strip", z.ZodTypeAny, {
1731
+ kind: "a11y.requireName";
1732
+ severity: "error" | "info" | "warn";
1733
+ because: string;
1734
+ }, {
1735
+ kind: "a11y.requireName";
1736
+ severity: "error" | "info" | "warn";
1737
+ because: string;
1738
+ }>]>, "many">;
1739
+ declare const componentPolicyRecordSchema: z.ZodObject<{
1740
+ rules: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1741
+ kind: z.ZodLiteral<"capability">;
1742
+ capability: z.ZodString;
1743
+ }, "strip", z.ZodTypeAny, {
1744
+ kind: "capability";
1745
+ capability: string;
1746
+ }, {
1747
+ kind: "capability";
1748
+ capability: string;
1749
+ }>, z.ZodObject<{
1750
+ kind: z.ZodLiteral<"prop.value.avoid">;
1751
+ prop: z.ZodString;
1752
+ value: z.ZodUnknown;
1753
+ because: z.ZodString;
1754
+ suggest: z.ZodOptional<z.ZodString>;
1755
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1756
+ }, "strip", z.ZodTypeAny, {
1757
+ kind: "prop.value.avoid";
1758
+ prop: string;
1759
+ severity: "error" | "info" | "warn";
1760
+ because: string;
1761
+ value?: unknown;
1762
+ suggest?: string | undefined;
1763
+ }, {
1764
+ kind: "prop.value.avoid";
1765
+ prop: string;
1766
+ severity: "error" | "info" | "warn";
1767
+ because: string;
1768
+ value?: unknown;
1769
+ suggest?: string | undefined;
1770
+ }>, z.ZodObject<{
1771
+ kind: z.ZodLiteral<"prop.value.forbid">;
1772
+ prop: z.ZodString;
1773
+ value: z.ZodUnknown;
1774
+ when: z.ZodOptional<z.ZodObject<{
1775
+ path: z.ZodOptional<z.ZodString>;
1776
+ }, "strip", z.ZodTypeAny, {
1777
+ path?: string | undefined;
1778
+ }, {
1779
+ path?: string | undefined;
1780
+ }>>;
1781
+ because: z.ZodString;
1782
+ fix: z.ZodOptional<z.ZodObject<{
1783
+ replaceWith: z.ZodUnknown;
1784
+ }, "strip", z.ZodTypeAny, {
1785
+ replaceWith?: unknown;
1786
+ }, {
1787
+ replaceWith?: unknown;
1788
+ }>>;
1789
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1790
+ }, "strip", z.ZodTypeAny, {
1791
+ kind: "prop.value.forbid";
1792
+ prop: string;
1793
+ severity: "error" | "info" | "warn";
1794
+ because: string;
1795
+ value?: unknown;
1796
+ fix?: {
1797
+ replaceWith?: unknown;
1798
+ } | undefined;
1799
+ when?: {
1800
+ path?: string | undefined;
1801
+ } | undefined;
1802
+ }, {
1803
+ kind: "prop.value.forbid";
1804
+ prop: string;
1805
+ severity: "error" | "info" | "warn";
1806
+ because: string;
1807
+ value?: unknown;
1808
+ fix?: {
1809
+ replaceWith?: unknown;
1810
+ } | undefined;
1811
+ when?: {
1812
+ path?: string | undefined;
1813
+ } | undefined;
1814
+ }>, z.ZodObject<{
1815
+ kind: z.ZodLiteral<"a11y.requireName">;
1816
+ because: z.ZodString;
1817
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1818
+ }, "strip", z.ZodTypeAny, {
1819
+ kind: "a11y.requireName";
1820
+ severity: "error" | "info" | "warn";
1821
+ because: string;
1822
+ }, {
1823
+ kind: "a11y.requireName";
1824
+ severity: "error" | "info" | "warn";
1825
+ because: string;
1826
+ }>]>, "many">;
1827
+ status: z.ZodOptional<z.ZodEnum<["active", "draft", "disabled"]>>;
1828
+ }, "strict", z.ZodTypeAny, {
1829
+ rules: ({
1830
+ kind: "capability";
1831
+ capability: string;
1832
+ } | {
1833
+ kind: "prop.value.avoid";
1834
+ prop: string;
1835
+ severity: "error" | "info" | "warn";
1836
+ because: string;
1837
+ value?: unknown;
1838
+ suggest?: string | undefined;
1839
+ } | {
1840
+ kind: "prop.value.forbid";
1841
+ prop: string;
1842
+ severity: "error" | "info" | "warn";
1843
+ because: string;
1844
+ value?: unknown;
1845
+ fix?: {
1846
+ replaceWith?: unknown;
1847
+ } | undefined;
1848
+ when?: {
1849
+ path?: string | undefined;
1850
+ } | undefined;
1851
+ } | {
1852
+ kind: "a11y.requireName";
1853
+ severity: "error" | "info" | "warn";
1854
+ because: string;
1855
+ })[];
1856
+ status?: "active" | "draft" | "disabled" | undefined;
1857
+ }, {
1858
+ rules: ({
1859
+ kind: "capability";
1860
+ capability: string;
1861
+ } | {
1862
+ kind: "prop.value.avoid";
1863
+ prop: string;
1864
+ severity: "error" | "info" | "warn";
1865
+ because: string;
1866
+ value?: unknown;
1867
+ suggest?: string | undefined;
1868
+ } | {
1869
+ kind: "prop.value.forbid";
1870
+ prop: string;
1871
+ severity: "error" | "info" | "warn";
1872
+ because: string;
1873
+ value?: unknown;
1874
+ fix?: {
1875
+ replaceWith?: unknown;
1876
+ } | undefined;
1877
+ when?: {
1878
+ path?: string | undefined;
1879
+ } | undefined;
1880
+ } | {
1881
+ kind: "a11y.requireName";
1882
+ severity: "error" | "info" | "warn";
1883
+ because: string;
1884
+ })[];
1885
+ status?: "active" | "draft" | "disabled" | undefined;
1886
+ }>;
1887
+ declare const componentPolicyOverrideSchema: z.ZodObject<{
1888
+ match: z.ZodObject<{
1889
+ componentKey: z.ZodOptional<z.ZodString>;
1890
+ componentId: z.ZodOptional<z.ZodString>;
1891
+ publicRef: z.ZodOptional<z.ZodString>;
1892
+ importPath: z.ZodOptional<z.ZodString>;
1893
+ sourcePath: z.ZodOptional<z.ZodString>;
1894
+ path: z.ZodOptional<z.ZodString>;
1895
+ exportName: z.ZodOptional<z.ZodString>;
1896
+ export: z.ZodOptional<z.ZodString>;
1897
+ name: z.ZodOptional<z.ZodString>;
1898
+ scope: z.ZodOptional<z.ZodEnum<["one", "all"]>>;
1899
+ }, "strict", z.ZodTypeAny, {
1900
+ path?: string | undefined;
1901
+ scope?: "one" | "all" | undefined;
1902
+ importPath?: string | undefined;
1903
+ componentId?: string | undefined;
1904
+ name?: string | undefined;
1905
+ componentKey?: string | undefined;
1906
+ publicRef?: string | undefined;
1907
+ sourcePath?: string | undefined;
1908
+ exportName?: string | undefined;
1909
+ export?: string | undefined;
1910
+ }, {
1911
+ path?: string | undefined;
1912
+ scope?: "one" | "all" | undefined;
1913
+ importPath?: string | undefined;
1914
+ componentId?: string | undefined;
1915
+ name?: string | undefined;
1916
+ componentKey?: string | undefined;
1917
+ publicRef?: string | undefined;
1918
+ sourcePath?: string | undefined;
1919
+ exportName?: string | undefined;
1920
+ export?: string | undefined;
1921
+ }>;
1922
+ rules: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1923
+ kind: z.ZodLiteral<"capability">;
1924
+ capability: z.ZodString;
1925
+ }, "strip", z.ZodTypeAny, {
1926
+ kind: "capability";
1927
+ capability: string;
1928
+ }, {
1929
+ kind: "capability";
1930
+ capability: string;
1931
+ }>, z.ZodObject<{
1932
+ kind: z.ZodLiteral<"prop.value.avoid">;
1933
+ prop: z.ZodString;
1934
+ value: z.ZodUnknown;
1935
+ because: z.ZodString;
1936
+ suggest: z.ZodOptional<z.ZodString>;
1937
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1938
+ }, "strip", z.ZodTypeAny, {
1939
+ kind: "prop.value.avoid";
1940
+ prop: string;
1941
+ severity: "error" | "info" | "warn";
1942
+ because: string;
1943
+ value?: unknown;
1944
+ suggest?: string | undefined;
1945
+ }, {
1946
+ kind: "prop.value.avoid";
1947
+ prop: string;
1948
+ severity: "error" | "info" | "warn";
1949
+ because: string;
1950
+ value?: unknown;
1951
+ suggest?: string | undefined;
1952
+ }>, z.ZodObject<{
1953
+ kind: z.ZodLiteral<"prop.value.forbid">;
1954
+ prop: z.ZodString;
1955
+ value: z.ZodUnknown;
1956
+ when: z.ZodOptional<z.ZodObject<{
1957
+ path: z.ZodOptional<z.ZodString>;
1958
+ }, "strip", z.ZodTypeAny, {
1959
+ path?: string | undefined;
1960
+ }, {
1961
+ path?: string | undefined;
1962
+ }>>;
1963
+ because: z.ZodString;
1964
+ fix: z.ZodOptional<z.ZodObject<{
1965
+ replaceWith: z.ZodUnknown;
1966
+ }, "strip", z.ZodTypeAny, {
1967
+ replaceWith?: unknown;
1968
+ }, {
1969
+ replaceWith?: unknown;
1970
+ }>>;
1971
+ severity: z.ZodEnum<["error", "warn", "info"]>;
1972
+ }, "strip", z.ZodTypeAny, {
1973
+ kind: "prop.value.forbid";
1974
+ prop: string;
1975
+ severity: "error" | "info" | "warn";
1976
+ because: string;
1977
+ value?: unknown;
1978
+ fix?: {
1979
+ replaceWith?: unknown;
1980
+ } | undefined;
1981
+ when?: {
1982
+ path?: string | undefined;
1983
+ } | undefined;
1984
+ }, {
1985
+ kind: "prop.value.forbid";
1986
+ prop: string;
1987
+ severity: "error" | "info" | "warn";
1988
+ because: string;
1989
+ value?: unknown;
1990
+ fix?: {
1991
+ replaceWith?: unknown;
1992
+ } | undefined;
1993
+ when?: {
1994
+ path?: string | undefined;
1995
+ } | undefined;
1996
+ }>, z.ZodObject<{
1997
+ kind: z.ZodLiteral<"a11y.requireName">;
1998
+ because: z.ZodString;
1999
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2000
+ }, "strip", z.ZodTypeAny, {
2001
+ kind: "a11y.requireName";
2002
+ severity: "error" | "info" | "warn";
2003
+ because: string;
2004
+ }, {
2005
+ kind: "a11y.requireName";
2006
+ severity: "error" | "info" | "warn";
2007
+ because: string;
2008
+ }>]>, "many">;
2009
+ status: z.ZodOptional<z.ZodEnum<["active", "draft", "disabled"]>>;
2010
+ }, "strict", z.ZodTypeAny, {
2011
+ rules: ({
2012
+ kind: "capability";
2013
+ capability: string;
2014
+ } | {
2015
+ kind: "prop.value.avoid";
2016
+ prop: string;
2017
+ severity: "error" | "info" | "warn";
2018
+ because: string;
2019
+ value?: unknown;
2020
+ suggest?: string | undefined;
2021
+ } | {
2022
+ kind: "prop.value.forbid";
2023
+ prop: string;
2024
+ severity: "error" | "info" | "warn";
2025
+ because: string;
2026
+ value?: unknown;
2027
+ fix?: {
2028
+ replaceWith?: unknown;
2029
+ } | undefined;
2030
+ when?: {
2031
+ path?: string | undefined;
2032
+ } | undefined;
2033
+ } | {
2034
+ kind: "a11y.requireName";
2035
+ severity: "error" | "info" | "warn";
2036
+ because: string;
2037
+ })[];
2038
+ match: {
2039
+ path?: string | undefined;
2040
+ scope?: "one" | "all" | undefined;
2041
+ importPath?: string | undefined;
2042
+ componentId?: string | undefined;
2043
+ name?: string | undefined;
2044
+ componentKey?: string | undefined;
2045
+ publicRef?: string | undefined;
2046
+ sourcePath?: string | undefined;
2047
+ exportName?: string | undefined;
2048
+ export?: string | undefined;
2049
+ };
2050
+ status?: "active" | "draft" | "disabled" | undefined;
2051
+ }, {
2052
+ rules: ({
2053
+ kind: "capability";
2054
+ capability: string;
2055
+ } | {
2056
+ kind: "prop.value.avoid";
2057
+ prop: string;
2058
+ severity: "error" | "info" | "warn";
2059
+ because: string;
2060
+ value?: unknown;
2061
+ suggest?: string | undefined;
2062
+ } | {
2063
+ kind: "prop.value.forbid";
2064
+ prop: string;
2065
+ severity: "error" | "info" | "warn";
2066
+ because: string;
2067
+ value?: unknown;
2068
+ fix?: {
2069
+ replaceWith?: unknown;
2070
+ } | undefined;
2071
+ when?: {
2072
+ path?: string | undefined;
2073
+ } | undefined;
2074
+ } | {
2075
+ kind: "a11y.requireName";
2076
+ severity: "error" | "info" | "warn";
2077
+ because: string;
2078
+ })[];
2079
+ match: {
2080
+ path?: string | undefined;
2081
+ scope?: "one" | "all" | undefined;
2082
+ importPath?: string | undefined;
2083
+ componentId?: string | undefined;
2084
+ name?: string | undefined;
2085
+ componentKey?: string | undefined;
2086
+ publicRef?: string | undefined;
2087
+ sourcePath?: string | undefined;
2088
+ exportName?: string | undefined;
2089
+ export?: string | undefined;
2090
+ };
2091
+ status?: "active" | "draft" | "disabled" | undefined;
2092
+ }>;
2093
+ declare const canonicalSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2094
+ kind: z.ZodLiteral<"npm">;
2095
+ specifier: z.ZodString;
2096
+ implementationPath: z.ZodOptional<z.ZodString>;
2097
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2098
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2099
+ }, "strip", z.ZodTypeAny, {
2100
+ kind: "npm";
2101
+ specifier: string;
2102
+ implementationPath?: string | undefined;
2103
+ include?: string[] | undefined;
2104
+ exclude?: string[] | undefined;
2105
+ }, {
2106
+ kind: "npm";
2107
+ specifier: string;
2108
+ implementationPath?: string | undefined;
2109
+ include?: string[] | undefined;
2110
+ exclude?: string[] | undefined;
2111
+ }>, z.ZodObject<{
2112
+ kind: z.ZodLiteral<"directory">;
2113
+ path: z.ZodString;
2114
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2115
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2116
+ }, "strip", z.ZodTypeAny, {
2117
+ path: string;
2118
+ kind: "directory";
2119
+ include?: string[] | undefined;
2120
+ exclude?: string[] | undefined;
2121
+ }, {
2122
+ path: string;
2123
+ kind: "directory";
2124
+ include?: string[] | undefined;
2125
+ exclude?: string[] | undefined;
2126
+ }>, z.ZodObject<{
2127
+ kind: z.ZodLiteral<"registry">;
2128
+ registryId: z.ZodString;
2129
+ registryHash: z.ZodOptional<z.ZodString>;
2130
+ receiptPath: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
2131
+ installPath: z.ZodEffects<z.ZodString, string, string>;
2132
+ importPath: z.ZodOptional<z.ZodString>;
2133
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2134
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2135
+ severity: z.ZodOptional<z.ZodEnum<["error", "warn", "info"]>>;
2136
+ }, "strip", z.ZodTypeAny, {
2137
+ kind: "registry";
2138
+ registryId: string;
2139
+ receiptPath: string;
2140
+ installPath: string;
2141
+ severity?: "error" | "info" | "warn" | undefined;
2142
+ importPath?: string | undefined;
2143
+ include?: string[] | undefined;
2144
+ exclude?: string[] | undefined;
2145
+ registryHash?: string | undefined;
2146
+ }, {
2147
+ kind: "registry";
2148
+ registryId: string;
2149
+ installPath: string;
2150
+ severity?: "error" | "info" | "warn" | undefined;
2151
+ importPath?: string | undefined;
2152
+ include?: string[] | undefined;
2153
+ exclude?: string[] | undefined;
2154
+ registryHash?: string | undefined;
2155
+ receiptPath?: string | undefined;
2156
+ }>]>;
2157
+ declare const governanceConfigSchema: z.ZodObject<{
2158
+ extends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2159
+ severity: z.ZodOptional<z.ZodEnum<["error", "warn", "info"]>>;
2160
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2161
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2162
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2163
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2164
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2165
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2166
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2167
+ }, z.ZodTypeAny, "passthrough">>>>;
2168
+ audit: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2169
+ runners: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
2170
+ canonicalSources: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2171
+ kind: z.ZodLiteral<"npm">;
2172
+ specifier: z.ZodString;
2173
+ implementationPath: z.ZodOptional<z.ZodString>;
2174
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2175
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2176
+ }, "strip", z.ZodTypeAny, {
2177
+ kind: "npm";
2178
+ specifier: string;
2179
+ implementationPath?: string | undefined;
2180
+ include?: string[] | undefined;
2181
+ exclude?: string[] | undefined;
2182
+ }, {
2183
+ kind: "npm";
2184
+ specifier: string;
2185
+ implementationPath?: string | undefined;
2186
+ include?: string[] | undefined;
2187
+ exclude?: string[] | undefined;
2188
+ }>, z.ZodObject<{
2189
+ kind: z.ZodLiteral<"directory">;
2190
+ path: z.ZodString;
2191
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2192
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2193
+ }, "strip", z.ZodTypeAny, {
2194
+ path: string;
2195
+ kind: "directory";
2196
+ include?: string[] | undefined;
2197
+ exclude?: string[] | undefined;
2198
+ }, {
2199
+ path: string;
2200
+ kind: "directory";
2201
+ include?: string[] | undefined;
2202
+ exclude?: string[] | undefined;
2203
+ }>, z.ZodObject<{
2204
+ kind: z.ZodLiteral<"registry">;
2205
+ registryId: z.ZodString;
2206
+ registryHash: z.ZodOptional<z.ZodString>;
2207
+ receiptPath: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
2208
+ installPath: z.ZodEffects<z.ZodString, string, string>;
2209
+ importPath: z.ZodOptional<z.ZodString>;
2210
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2211
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2212
+ severity: z.ZodOptional<z.ZodEnum<["error", "warn", "info"]>>;
2213
+ }, "strip", z.ZodTypeAny, {
2214
+ kind: "registry";
2215
+ registryId: string;
2216
+ receiptPath: string;
2217
+ installPath: string;
2218
+ severity?: "error" | "info" | "warn" | undefined;
2219
+ importPath?: string | undefined;
2220
+ include?: string[] | undefined;
2221
+ exclude?: string[] | undefined;
2222
+ registryHash?: string | undefined;
2223
+ }, {
2224
+ kind: "registry";
2225
+ registryId: string;
2226
+ installPath: string;
2227
+ severity?: "error" | "info" | "warn" | undefined;
2228
+ importPath?: string | undefined;
2229
+ include?: string[] | undefined;
2230
+ exclude?: string[] | undefined;
2231
+ registryHash?: string | undefined;
2232
+ receiptPath?: string | undefined;
2233
+ }>]>, "many">>;
2234
+ presets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2235
+ scales: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2236
+ kind: z.ZodDefault<z.ZodLiteral<"scale">>;
2237
+ name: z.ZodOptional<z.ZodString>;
2238
+ unit: z.ZodEnum<["px", "rem"]>;
2239
+ values: z.ZodArray<z.ZodNumber, "many">;
2240
+ rootFontSizePx: z.ZodOptional<z.ZodNumber>;
2241
+ emBasePx: z.ZodOptional<z.ZodNumber>;
2242
+ }, "strip", z.ZodTypeAny, {
2243
+ values: number[];
2244
+ kind: "scale";
2245
+ unit: "px" | "rem";
2246
+ name?: string | undefined;
2247
+ rootFontSizePx?: number | undefined;
2248
+ emBasePx?: number | undefined;
2249
+ }, {
2250
+ values: number[];
2251
+ unit: "px" | "rem";
2252
+ kind?: "scale" | undefined;
2253
+ name?: string | undefined;
2254
+ rootFontSizePx?: number | undefined;
2255
+ emBasePx?: number | undefined;
2256
+ }>>>;
2257
+ styles: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2258
+ kind: z.ZodLiteral<"style.rawColors.forbid">;
2259
+ except: z.ZodArray<z.ZodString, "many">;
2260
+ prefer: z.ZodEnum<["token", "css-variable"]>;
2261
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2262
+ }, "strip", z.ZodTypeAny, {
2263
+ kind: "style.rawColors.forbid";
2264
+ severity: "error" | "info" | "warn";
2265
+ except: string[];
2266
+ prefer: "token" | "css-variable";
2267
+ }, {
2268
+ kind: "style.rawColors.forbid";
2269
+ severity: "error" | "info" | "warn";
2270
+ except: string[];
2271
+ prefer: "token" | "css-variable";
2272
+ }>, z.ZodObject<{
2273
+ kind: z.ZodLiteral<"style.rawDimensions.forbid">;
2274
+ appliesTo: z.ZodArray<z.ZodString, "many">;
2275
+ prefer: z.ZodEnum<["token", "css-variable"]>;
2276
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2277
+ }, "strip", z.ZodTypeAny, {
2278
+ kind: "style.rawDimensions.forbid";
2279
+ severity: "error" | "info" | "warn";
2280
+ prefer: "token" | "css-variable";
2281
+ appliesTo: string[];
2282
+ }, {
2283
+ kind: "style.rawDimensions.forbid";
2284
+ severity: "error" | "info" | "warn";
2285
+ prefer: "token" | "css-variable";
2286
+ appliesTo: string[];
2287
+ }>, z.ZodObject<{
2288
+ kind: z.ZodLiteral<"style.rawSpacing.mustMatchScale">;
2289
+ scale: z.ZodString;
2290
+ appliesTo: z.ZodArray<z.ZodString, "many">;
2291
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2292
+ }, "strip", z.ZodTypeAny, {
2293
+ kind: "style.rawSpacing.mustMatchScale";
2294
+ severity: "error" | "info" | "warn";
2295
+ scale: string;
2296
+ appliesTo: string[];
2297
+ }, {
2298
+ kind: "style.rawSpacing.mustMatchScale";
2299
+ severity: "error" | "info" | "warn";
2300
+ scale: string;
2301
+ appliesTo: string[];
2302
+ }>, z.ZodObject<{
2303
+ kind: z.ZodLiteral<"style.fontSize.mustMatchScale">;
2304
+ scale: z.ZodString;
2305
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2306
+ }, "strip", z.ZodTypeAny, {
2307
+ kind: "style.fontSize.mustMatchScale";
2308
+ severity: "error" | "info" | "warn";
2309
+ scale: string;
2310
+ }, {
2311
+ kind: "style.fontSize.mustMatchScale";
2312
+ severity: "error" | "info" | "warn";
2313
+ scale: string;
2314
+ }>, z.ZodObject<{
2315
+ kind: z.ZodLiteral<"style.cssVars.mustBeDefined">;
2316
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2317
+ }, "strip", z.ZodTypeAny, {
2318
+ kind: "style.cssVars.mustBeDefined";
2319
+ severity: "error" | "info" | "warn";
2320
+ }, {
2321
+ kind: "style.cssVars.mustBeDefined";
2322
+ severity: "error" | "info" | "warn";
2323
+ }>]>, "many">>;
2324
+ jsx: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2325
+ kind: z.ZodLiteral<"jsx.unknownProps.forbid">;
2326
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2327
+ }, "strip", z.ZodTypeAny, {
2328
+ kind: "jsx.unknownProps.forbid";
2329
+ severity: "error" | "info" | "warn";
2330
+ }, {
2331
+ kind: "jsx.unknownProps.forbid";
2332
+ severity: "error" | "info" | "warn";
2333
+ }>, z.ZodObject<{
2334
+ kind: z.ZodLiteral<"jsx.inlineStyle.forbidRaw">;
2335
+ properties: z.ZodArray<z.ZodString, "many">;
2336
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2337
+ }, "strip", z.ZodTypeAny, {
2338
+ kind: "jsx.inlineStyle.forbidRaw";
2339
+ severity: "error" | "info" | "warn";
2340
+ properties: string[];
2341
+ }, {
2342
+ kind: "jsx.inlineStyle.forbidRaw";
2343
+ severity: "error" | "info" | "warn";
2344
+ properties: string[];
2345
+ }>, z.ZodObject<{
2346
+ kind: z.ZodLiteral<"jsx.importPath.prefer">;
2347
+ from: z.ZodString;
2348
+ to: z.ZodString;
2349
+ imported: z.ZodOptional<z.ZodString>;
2350
+ because: z.ZodOptional<z.ZodString>;
2351
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2352
+ }, "strip", z.ZodTypeAny, {
2353
+ kind: "jsx.importPath.prefer";
2354
+ from: string;
2355
+ to: string;
2356
+ severity: "error" | "info" | "warn";
2357
+ imported?: string | undefined;
2358
+ because?: string | undefined;
2359
+ }, {
2360
+ kind: "jsx.importPath.prefer";
2361
+ from: string;
2362
+ to: string;
2363
+ severity: "error" | "info" | "warn";
2364
+ imported?: string | undefined;
2365
+ because?: string | undefined;
2366
+ }>, z.ZodObject<{
2367
+ kind: z.ZodLiteral<"jsx.component.prefer">;
2368
+ from: z.ZodString;
2369
+ to: z.ZodString;
2370
+ because: z.ZodOptional<z.ZodString>;
2371
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2372
+ }, "strip", z.ZodTypeAny, {
2373
+ kind: "jsx.component.prefer";
2374
+ from: string;
2375
+ to: string;
2376
+ severity: "error" | "info" | "warn";
2377
+ because?: string | undefined;
2378
+ }, {
2379
+ kind: "jsx.component.prefer";
2380
+ from: string;
2381
+ to: string;
2382
+ severity: "error" | "info" | "warn";
2383
+ because?: string | undefined;
2384
+ }>]>, "many">>;
2385
+ tailwind: z.ZodOptional<z.ZodObject<{
2386
+ palette: z.ZodOptional<z.ZodObject<{
2387
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2388
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2389
+ }, "strip", z.ZodTypeAny, {
2390
+ allow?: string[] | undefined;
2391
+ deny?: string[] | undefined;
2392
+ }, {
2393
+ allow?: string[] | undefined;
2394
+ deny?: string[] | undefined;
2395
+ }>>;
2396
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2397
+ palette: z.ZodOptional<z.ZodObject<{
2398
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2399
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2400
+ }, "strip", z.ZodTypeAny, {
2401
+ allow?: string[] | undefined;
2402
+ deny?: string[] | undefined;
2403
+ }, {
2404
+ allow?: string[] | undefined;
2405
+ deny?: string[] | undefined;
2406
+ }>>;
2407
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2408
+ palette: z.ZodOptional<z.ZodObject<{
2409
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2410
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2411
+ }, "strip", z.ZodTypeAny, {
2412
+ allow?: string[] | undefined;
2413
+ deny?: string[] | undefined;
2414
+ }, {
2415
+ allow?: string[] | undefined;
2416
+ deny?: string[] | undefined;
2417
+ }>>;
2418
+ }, z.ZodTypeAny, "passthrough">>>;
2419
+ agent: z.ZodOptional<z.ZodObject<{
2420
+ repairOrder: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2421
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2422
+ repairOrder: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2423
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2424
+ repairOrder: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2425
+ }, z.ZodTypeAny, "passthrough">>>;
2426
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2427
+ rules: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2428
+ kind: z.ZodLiteral<"capability">;
2429
+ capability: z.ZodString;
2430
+ }, "strip", z.ZodTypeAny, {
2431
+ kind: "capability";
2432
+ capability: string;
2433
+ }, {
2434
+ kind: "capability";
2435
+ capability: string;
2436
+ }>, z.ZodObject<{
2437
+ kind: z.ZodLiteral<"prop.value.avoid">;
2438
+ prop: z.ZodString;
2439
+ value: z.ZodUnknown;
2440
+ because: z.ZodString;
2441
+ suggest: z.ZodOptional<z.ZodString>;
2442
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2443
+ }, "strip", z.ZodTypeAny, {
2444
+ kind: "prop.value.avoid";
2445
+ prop: string;
2446
+ severity: "error" | "info" | "warn";
2447
+ because: string;
2448
+ value?: unknown;
2449
+ suggest?: string | undefined;
2450
+ }, {
2451
+ kind: "prop.value.avoid";
2452
+ prop: string;
2453
+ severity: "error" | "info" | "warn";
2454
+ because: string;
2455
+ value?: unknown;
2456
+ suggest?: string | undefined;
2457
+ }>, z.ZodObject<{
2458
+ kind: z.ZodLiteral<"prop.value.forbid">;
2459
+ prop: z.ZodString;
2460
+ value: z.ZodUnknown;
2461
+ when: z.ZodOptional<z.ZodObject<{
2462
+ path: z.ZodOptional<z.ZodString>;
2463
+ }, "strip", z.ZodTypeAny, {
2464
+ path?: string | undefined;
2465
+ }, {
2466
+ path?: string | undefined;
2467
+ }>>;
2468
+ because: z.ZodString;
2469
+ fix: z.ZodOptional<z.ZodObject<{
2470
+ replaceWith: z.ZodUnknown;
2471
+ }, "strip", z.ZodTypeAny, {
2472
+ replaceWith?: unknown;
2473
+ }, {
2474
+ replaceWith?: unknown;
2475
+ }>>;
2476
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2477
+ }, "strip", z.ZodTypeAny, {
2478
+ kind: "prop.value.forbid";
2479
+ prop: string;
2480
+ severity: "error" | "info" | "warn";
2481
+ because: string;
2482
+ value?: unknown;
2483
+ fix?: {
2484
+ replaceWith?: unknown;
2485
+ } | undefined;
2486
+ when?: {
2487
+ path?: string | undefined;
2488
+ } | undefined;
2489
+ }, {
2490
+ kind: "prop.value.forbid";
2491
+ prop: string;
2492
+ severity: "error" | "info" | "warn";
2493
+ because: string;
2494
+ value?: unknown;
2495
+ fix?: {
2496
+ replaceWith?: unknown;
2497
+ } | undefined;
2498
+ when?: {
2499
+ path?: string | undefined;
2500
+ } | undefined;
2501
+ }>, z.ZodObject<{
2502
+ kind: z.ZodLiteral<"a11y.requireName">;
2503
+ because: z.ZodString;
2504
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2505
+ }, "strip", z.ZodTypeAny, {
2506
+ kind: "a11y.requireName";
2507
+ severity: "error" | "info" | "warn";
2508
+ because: string;
2509
+ }, {
2510
+ kind: "a11y.requireName";
2511
+ severity: "error" | "info" | "warn";
2512
+ because: string;
2513
+ }>]>, "many">;
2514
+ status: z.ZodOptional<z.ZodEnum<["active", "draft", "disabled"]>>;
2515
+ }, "strict", z.ZodTypeAny, {
2516
+ rules: ({
2517
+ kind: "capability";
2518
+ capability: string;
2519
+ } | {
2520
+ kind: "prop.value.avoid";
2521
+ prop: string;
2522
+ severity: "error" | "info" | "warn";
2523
+ because: string;
2524
+ value?: unknown;
2525
+ suggest?: string | undefined;
2526
+ } | {
2527
+ kind: "prop.value.forbid";
2528
+ prop: string;
2529
+ severity: "error" | "info" | "warn";
2530
+ because: string;
2531
+ value?: unknown;
2532
+ fix?: {
2533
+ replaceWith?: unknown;
2534
+ } | undefined;
2535
+ when?: {
2536
+ path?: string | undefined;
2537
+ } | undefined;
2538
+ } | {
2539
+ kind: "a11y.requireName";
2540
+ severity: "error" | "info" | "warn";
2541
+ because: string;
2542
+ })[];
2543
+ status?: "active" | "draft" | "disabled" | undefined;
2544
+ }, {
2545
+ rules: ({
2546
+ kind: "capability";
2547
+ capability: string;
2548
+ } | {
2549
+ kind: "prop.value.avoid";
2550
+ prop: string;
2551
+ severity: "error" | "info" | "warn";
2552
+ because: string;
2553
+ value?: unknown;
2554
+ suggest?: string | undefined;
2555
+ } | {
2556
+ kind: "prop.value.forbid";
2557
+ prop: string;
2558
+ severity: "error" | "info" | "warn";
2559
+ because: string;
2560
+ value?: unknown;
2561
+ fix?: {
2562
+ replaceWith?: unknown;
2563
+ } | undefined;
2564
+ when?: {
2565
+ path?: string | undefined;
2566
+ } | undefined;
2567
+ } | {
2568
+ kind: "a11y.requireName";
2569
+ severity: "error" | "info" | "warn";
2570
+ because: string;
2571
+ })[];
2572
+ status?: "active" | "draft" | "disabled" | undefined;
2573
+ }>>>;
2574
+ overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
2575
+ match: z.ZodObject<{
2576
+ componentKey: z.ZodOptional<z.ZodString>;
2577
+ componentId: z.ZodOptional<z.ZodString>;
2578
+ publicRef: z.ZodOptional<z.ZodString>;
2579
+ importPath: z.ZodOptional<z.ZodString>;
2580
+ sourcePath: z.ZodOptional<z.ZodString>;
2581
+ path: z.ZodOptional<z.ZodString>;
2582
+ exportName: z.ZodOptional<z.ZodString>;
2583
+ export: z.ZodOptional<z.ZodString>;
2584
+ name: z.ZodOptional<z.ZodString>;
2585
+ scope: z.ZodOptional<z.ZodEnum<["one", "all"]>>;
2586
+ }, "strict", z.ZodTypeAny, {
2587
+ path?: string | undefined;
2588
+ scope?: "one" | "all" | undefined;
2589
+ importPath?: string | undefined;
2590
+ componentId?: string | undefined;
2591
+ name?: string | undefined;
2592
+ componentKey?: string | undefined;
2593
+ publicRef?: string | undefined;
2594
+ sourcePath?: string | undefined;
2595
+ exportName?: string | undefined;
2596
+ export?: string | undefined;
2597
+ }, {
2598
+ path?: string | undefined;
2599
+ scope?: "one" | "all" | undefined;
2600
+ importPath?: string | undefined;
2601
+ componentId?: string | undefined;
2602
+ name?: string | undefined;
2603
+ componentKey?: string | undefined;
2604
+ publicRef?: string | undefined;
2605
+ sourcePath?: string | undefined;
2606
+ exportName?: string | undefined;
2607
+ export?: string | undefined;
2608
+ }>;
2609
+ rules: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2610
+ kind: z.ZodLiteral<"capability">;
2611
+ capability: z.ZodString;
2612
+ }, "strip", z.ZodTypeAny, {
2613
+ kind: "capability";
2614
+ capability: string;
2615
+ }, {
2616
+ kind: "capability";
2617
+ capability: string;
2618
+ }>, z.ZodObject<{
2619
+ kind: z.ZodLiteral<"prop.value.avoid">;
2620
+ prop: z.ZodString;
2621
+ value: z.ZodUnknown;
2622
+ because: z.ZodString;
2623
+ suggest: z.ZodOptional<z.ZodString>;
2624
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2625
+ }, "strip", z.ZodTypeAny, {
2626
+ kind: "prop.value.avoid";
2627
+ prop: string;
2628
+ severity: "error" | "info" | "warn";
2629
+ because: string;
2630
+ value?: unknown;
2631
+ suggest?: string | undefined;
2632
+ }, {
2633
+ kind: "prop.value.avoid";
2634
+ prop: string;
2635
+ severity: "error" | "info" | "warn";
2636
+ because: string;
2637
+ value?: unknown;
2638
+ suggest?: string | undefined;
2639
+ }>, z.ZodObject<{
2640
+ kind: z.ZodLiteral<"prop.value.forbid">;
2641
+ prop: z.ZodString;
2642
+ value: z.ZodUnknown;
2643
+ when: z.ZodOptional<z.ZodObject<{
2644
+ path: z.ZodOptional<z.ZodString>;
2645
+ }, "strip", z.ZodTypeAny, {
2646
+ path?: string | undefined;
2647
+ }, {
2648
+ path?: string | undefined;
2649
+ }>>;
2650
+ because: z.ZodString;
2651
+ fix: z.ZodOptional<z.ZodObject<{
2652
+ replaceWith: z.ZodUnknown;
2653
+ }, "strip", z.ZodTypeAny, {
2654
+ replaceWith?: unknown;
2655
+ }, {
2656
+ replaceWith?: unknown;
2657
+ }>>;
2658
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2659
+ }, "strip", z.ZodTypeAny, {
2660
+ kind: "prop.value.forbid";
2661
+ prop: string;
2662
+ severity: "error" | "info" | "warn";
2663
+ because: string;
2664
+ value?: unknown;
2665
+ fix?: {
2666
+ replaceWith?: unknown;
2667
+ } | undefined;
2668
+ when?: {
2669
+ path?: string | undefined;
2670
+ } | undefined;
2671
+ }, {
2672
+ kind: "prop.value.forbid";
2673
+ prop: string;
2674
+ severity: "error" | "info" | "warn";
2675
+ because: string;
2676
+ value?: unknown;
2677
+ fix?: {
2678
+ replaceWith?: unknown;
2679
+ } | undefined;
2680
+ when?: {
2681
+ path?: string | undefined;
2682
+ } | undefined;
2683
+ }>, z.ZodObject<{
2684
+ kind: z.ZodLiteral<"a11y.requireName">;
2685
+ because: z.ZodString;
2686
+ severity: z.ZodEnum<["error", "warn", "info"]>;
2687
+ }, "strip", z.ZodTypeAny, {
2688
+ kind: "a11y.requireName";
2689
+ severity: "error" | "info" | "warn";
2690
+ because: string;
2691
+ }, {
2692
+ kind: "a11y.requireName";
2693
+ severity: "error" | "info" | "warn";
2694
+ because: string;
2695
+ }>]>, "many">;
2696
+ status: z.ZodOptional<z.ZodEnum<["active", "draft", "disabled"]>>;
2697
+ }, "strict", z.ZodTypeAny, {
2698
+ rules: ({
2699
+ kind: "capability";
2700
+ capability: string;
2701
+ } | {
2702
+ kind: "prop.value.avoid";
2703
+ prop: string;
2704
+ severity: "error" | "info" | "warn";
2705
+ because: string;
2706
+ value?: unknown;
2707
+ suggest?: string | undefined;
2708
+ } | {
2709
+ kind: "prop.value.forbid";
2710
+ prop: string;
2711
+ severity: "error" | "info" | "warn";
2712
+ because: string;
2713
+ value?: unknown;
2714
+ fix?: {
2715
+ replaceWith?: unknown;
2716
+ } | undefined;
2717
+ when?: {
2718
+ path?: string | undefined;
2719
+ } | undefined;
2720
+ } | {
2721
+ kind: "a11y.requireName";
2722
+ severity: "error" | "info" | "warn";
2723
+ because: string;
2724
+ })[];
2725
+ match: {
2726
+ path?: string | undefined;
2727
+ scope?: "one" | "all" | undefined;
2728
+ importPath?: string | undefined;
2729
+ componentId?: string | undefined;
2730
+ name?: string | undefined;
2731
+ componentKey?: string | undefined;
2732
+ publicRef?: string | undefined;
2733
+ sourcePath?: string | undefined;
2734
+ exportName?: string | undefined;
2735
+ export?: string | undefined;
2736
+ };
2737
+ status?: "active" | "draft" | "disabled" | undefined;
2738
+ }, {
2739
+ rules: ({
2740
+ kind: "capability";
2741
+ capability: string;
2742
+ } | {
2743
+ kind: "prop.value.avoid";
2744
+ prop: string;
2745
+ severity: "error" | "info" | "warn";
2746
+ because: string;
2747
+ value?: unknown;
2748
+ suggest?: string | undefined;
2749
+ } | {
2750
+ kind: "prop.value.forbid";
2751
+ prop: string;
2752
+ severity: "error" | "info" | "warn";
2753
+ because: string;
2754
+ value?: unknown;
2755
+ fix?: {
2756
+ replaceWith?: unknown;
2757
+ } | undefined;
2758
+ when?: {
2759
+ path?: string | undefined;
2760
+ } | undefined;
2761
+ } | {
2762
+ kind: "a11y.requireName";
2763
+ severity: "error" | "info" | "warn";
2764
+ because: string;
2765
+ })[];
2766
+ match: {
2767
+ path?: string | undefined;
2768
+ scope?: "one" | "all" | undefined;
2769
+ importPath?: string | undefined;
2770
+ componentId?: string | undefined;
2771
+ name?: string | undefined;
2772
+ componentKey?: string | undefined;
2773
+ publicRef?: string | undefined;
2774
+ sourcePath?: string | undefined;
2775
+ exportName?: string | undefined;
2776
+ export?: string | undefined;
2777
+ };
2778
+ status?: "active" | "draft" | "disabled" | undefined;
2779
+ }>, "many">>;
2780
+ ci: z.ZodOptional<z.ZodObject<{
2781
+ failOnWarnings: z.ZodOptional<z.ZodBoolean>;
2782
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2783
+ failOnWarnings: z.ZodOptional<z.ZodBoolean>;
2784
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2785
+ failOnWarnings: z.ZodOptional<z.ZodBoolean>;
2786
+ }, z.ZodTypeAny, "passthrough">>>;
2787
+ }, "strict", z.ZodTypeAny, {
2788
+ components?: Record<string, {
2789
+ rules: ({
2790
+ kind: "capability";
2791
+ capability: string;
2792
+ } | {
2793
+ kind: "prop.value.avoid";
2794
+ prop: string;
2795
+ severity: "error" | "info" | "warn";
2796
+ because: string;
2797
+ value?: unknown;
2798
+ suggest?: string | undefined;
2799
+ } | {
2800
+ kind: "prop.value.forbid";
2801
+ prop: string;
2802
+ severity: "error" | "info" | "warn";
2803
+ because: string;
2804
+ value?: unknown;
2805
+ fix?: {
2806
+ replaceWith?: unknown;
2807
+ } | undefined;
2808
+ when?: {
2809
+ path?: string | undefined;
2810
+ } | undefined;
2811
+ } | {
2812
+ kind: "a11y.requireName";
2813
+ severity: "error" | "info" | "warn";
2814
+ because: string;
2815
+ })[];
2816
+ status?: "active" | "draft" | "disabled" | undefined;
2817
+ }> | undefined;
2818
+ severity?: "error" | "info" | "warn" | undefined;
2819
+ rules?: Record<string, unknown> | undefined;
2820
+ scales?: Record<string, {
2821
+ values: number[];
2822
+ kind: "scale";
2823
+ unit: "px" | "rem";
2824
+ name?: string | undefined;
2825
+ rootFontSizePx?: number | undefined;
2826
+ emBasePx?: number | undefined;
2827
+ }> | undefined;
2828
+ styles?: ({
2829
+ kind: "style.rawColors.forbid";
2830
+ severity: "error" | "info" | "warn";
2831
+ except: string[];
2832
+ prefer: "token" | "css-variable";
2833
+ } | {
2834
+ kind: "style.rawDimensions.forbid";
2835
+ severity: "error" | "info" | "warn";
2836
+ prefer: "token" | "css-variable";
2837
+ appliesTo: string[];
2838
+ } | {
2839
+ kind: "style.rawSpacing.mustMatchScale";
2840
+ severity: "error" | "info" | "warn";
2841
+ scale: string;
2842
+ appliesTo: string[];
2843
+ } | {
2844
+ kind: "style.fontSize.mustMatchScale";
2845
+ severity: "error" | "info" | "warn";
2846
+ scale: string;
2847
+ } | {
2848
+ kind: "style.cssVars.mustBeDefined";
2849
+ severity: "error" | "info" | "warn";
2850
+ })[] | undefined;
2851
+ jsx?: ({
2852
+ kind: "jsx.unknownProps.forbid";
2853
+ severity: "error" | "info" | "warn";
2854
+ } | {
2855
+ kind: "jsx.inlineStyle.forbidRaw";
2856
+ severity: "error" | "info" | "warn";
2857
+ properties: string[];
2858
+ } | {
2859
+ kind: "jsx.importPath.prefer";
2860
+ from: string;
2861
+ to: string;
2862
+ severity: "error" | "info" | "warn";
2863
+ imported?: string | undefined;
2864
+ because?: string | undefined;
2865
+ } | {
2866
+ kind: "jsx.component.prefer";
2867
+ from: string;
2868
+ to: string;
2869
+ severity: "error" | "info" | "warn";
2870
+ because?: string | undefined;
2871
+ })[] | undefined;
2872
+ tailwind?: z.objectOutputType<{
2873
+ palette: z.ZodOptional<z.ZodObject<{
2874
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2875
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2876
+ }, "strip", z.ZodTypeAny, {
2877
+ allow?: string[] | undefined;
2878
+ deny?: string[] | undefined;
2879
+ }, {
2880
+ allow?: string[] | undefined;
2881
+ deny?: string[] | undefined;
2882
+ }>>;
2883
+ }, z.ZodTypeAny, "passthrough"> | undefined;
2884
+ overrides?: {
2885
+ rules: ({
2886
+ kind: "capability";
2887
+ capability: string;
2888
+ } | {
2889
+ kind: "prop.value.avoid";
2890
+ prop: string;
2891
+ severity: "error" | "info" | "warn";
2892
+ because: string;
2893
+ value?: unknown;
2894
+ suggest?: string | undefined;
2895
+ } | {
2896
+ kind: "prop.value.forbid";
2897
+ prop: string;
2898
+ severity: "error" | "info" | "warn";
2899
+ because: string;
2900
+ value?: unknown;
2901
+ fix?: {
2902
+ replaceWith?: unknown;
2903
+ } | undefined;
2904
+ when?: {
2905
+ path?: string | undefined;
2906
+ } | undefined;
2907
+ } | {
2908
+ kind: "a11y.requireName";
2909
+ severity: "error" | "info" | "warn";
2910
+ because: string;
2911
+ })[];
2912
+ match: {
2913
+ path?: string | undefined;
2914
+ scope?: "one" | "all" | undefined;
2915
+ importPath?: string | undefined;
2916
+ componentId?: string | undefined;
2917
+ name?: string | undefined;
2918
+ componentKey?: string | undefined;
2919
+ publicRef?: string | undefined;
2920
+ sourcePath?: string | undefined;
2921
+ exportName?: string | undefined;
2922
+ export?: string | undefined;
2923
+ };
2924
+ status?: "active" | "draft" | "disabled" | undefined;
2925
+ }[] | undefined;
2926
+ extends?: string[] | undefined;
2927
+ agents?: Record<string, z.objectOutputType<{
2928
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2929
+ }, z.ZodTypeAny, "passthrough">> | undefined;
2930
+ audit?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2931
+ runners?: Record<string, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">> | undefined;
2932
+ canonicalSources?: ({
2933
+ kind: "npm";
2934
+ specifier: string;
2935
+ implementationPath?: string | undefined;
2936
+ include?: string[] | undefined;
2937
+ exclude?: string[] | undefined;
2938
+ } | {
2939
+ path: string;
2940
+ kind: "directory";
2941
+ include?: string[] | undefined;
2942
+ exclude?: string[] | undefined;
2943
+ } | {
2944
+ kind: "registry";
2945
+ registryId: string;
2946
+ receiptPath: string;
2947
+ installPath: string;
2948
+ severity?: "error" | "info" | "warn" | undefined;
2949
+ importPath?: string | undefined;
2950
+ include?: string[] | undefined;
2951
+ exclude?: string[] | undefined;
2952
+ registryHash?: string | undefined;
2953
+ })[] | undefined;
2954
+ presets?: string[] | undefined;
2955
+ agent?: z.objectOutputType<{
2956
+ repairOrder: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2957
+ }, z.ZodTypeAny, "passthrough"> | undefined;
2958
+ ci?: z.objectOutputType<{
2959
+ failOnWarnings: z.ZodOptional<z.ZodBoolean>;
2960
+ }, z.ZodTypeAny, "passthrough"> | undefined;
2961
+ }, {
2962
+ components?: Record<string, {
2963
+ rules: ({
2964
+ kind: "capability";
2965
+ capability: string;
2966
+ } | {
2967
+ kind: "prop.value.avoid";
2968
+ prop: string;
2969
+ severity: "error" | "info" | "warn";
2970
+ because: string;
2971
+ value?: unknown;
2972
+ suggest?: string | undefined;
2973
+ } | {
2974
+ kind: "prop.value.forbid";
2975
+ prop: string;
2976
+ severity: "error" | "info" | "warn";
2977
+ because: string;
2978
+ value?: unknown;
2979
+ fix?: {
2980
+ replaceWith?: unknown;
2981
+ } | undefined;
2982
+ when?: {
2983
+ path?: string | undefined;
2984
+ } | undefined;
2985
+ } | {
2986
+ kind: "a11y.requireName";
2987
+ severity: "error" | "info" | "warn";
2988
+ because: string;
2989
+ })[];
2990
+ status?: "active" | "draft" | "disabled" | undefined;
2991
+ }> | undefined;
2992
+ severity?: "error" | "info" | "warn" | undefined;
2993
+ rules?: Record<string, unknown> | undefined;
2994
+ scales?: Record<string, {
2995
+ values: number[];
2996
+ unit: "px" | "rem";
2997
+ kind?: "scale" | undefined;
2998
+ name?: string | undefined;
2999
+ rootFontSizePx?: number | undefined;
3000
+ emBasePx?: number | undefined;
3001
+ }> | undefined;
3002
+ styles?: ({
3003
+ kind: "style.rawColors.forbid";
3004
+ severity: "error" | "info" | "warn";
3005
+ except: string[];
3006
+ prefer: "token" | "css-variable";
3007
+ } | {
3008
+ kind: "style.rawDimensions.forbid";
3009
+ severity: "error" | "info" | "warn";
3010
+ prefer: "token" | "css-variable";
3011
+ appliesTo: string[];
3012
+ } | {
3013
+ kind: "style.rawSpacing.mustMatchScale";
3014
+ severity: "error" | "info" | "warn";
3015
+ scale: string;
3016
+ appliesTo: string[];
3017
+ } | {
3018
+ kind: "style.fontSize.mustMatchScale";
3019
+ severity: "error" | "info" | "warn";
3020
+ scale: string;
3021
+ } | {
3022
+ kind: "style.cssVars.mustBeDefined";
3023
+ severity: "error" | "info" | "warn";
3024
+ })[] | undefined;
3025
+ jsx?: ({
3026
+ kind: "jsx.unknownProps.forbid";
3027
+ severity: "error" | "info" | "warn";
3028
+ } | {
3029
+ kind: "jsx.inlineStyle.forbidRaw";
3030
+ severity: "error" | "info" | "warn";
3031
+ properties: string[];
3032
+ } | {
3033
+ kind: "jsx.importPath.prefer";
3034
+ from: string;
3035
+ to: string;
3036
+ severity: "error" | "info" | "warn";
3037
+ imported?: string | undefined;
3038
+ because?: string | undefined;
3039
+ } | {
3040
+ kind: "jsx.component.prefer";
3041
+ from: string;
3042
+ to: string;
3043
+ severity: "error" | "info" | "warn";
3044
+ because?: string | undefined;
3045
+ })[] | undefined;
3046
+ tailwind?: z.objectInputType<{
3047
+ palette: z.ZodOptional<z.ZodObject<{
3048
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3049
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3050
+ }, "strip", z.ZodTypeAny, {
3051
+ allow?: string[] | undefined;
3052
+ deny?: string[] | undefined;
3053
+ }, {
3054
+ allow?: string[] | undefined;
3055
+ deny?: string[] | undefined;
3056
+ }>>;
3057
+ }, z.ZodTypeAny, "passthrough"> | undefined;
3058
+ overrides?: {
3059
+ rules: ({
3060
+ kind: "capability";
3061
+ capability: string;
3062
+ } | {
3063
+ kind: "prop.value.avoid";
3064
+ prop: string;
3065
+ severity: "error" | "info" | "warn";
3066
+ because: string;
3067
+ value?: unknown;
3068
+ suggest?: string | undefined;
3069
+ } | {
3070
+ kind: "prop.value.forbid";
3071
+ prop: string;
3072
+ severity: "error" | "info" | "warn";
3073
+ because: string;
3074
+ value?: unknown;
3075
+ fix?: {
3076
+ replaceWith?: unknown;
3077
+ } | undefined;
3078
+ when?: {
3079
+ path?: string | undefined;
3080
+ } | undefined;
3081
+ } | {
3082
+ kind: "a11y.requireName";
3083
+ severity: "error" | "info" | "warn";
3084
+ because: string;
3085
+ })[];
3086
+ match: {
3087
+ path?: string | undefined;
3088
+ scope?: "one" | "all" | undefined;
3089
+ importPath?: string | undefined;
3090
+ componentId?: string | undefined;
3091
+ name?: string | undefined;
3092
+ componentKey?: string | undefined;
3093
+ publicRef?: string | undefined;
3094
+ sourcePath?: string | undefined;
3095
+ exportName?: string | undefined;
3096
+ export?: string | undefined;
3097
+ };
3098
+ status?: "active" | "draft" | "disabled" | undefined;
3099
+ }[] | undefined;
3100
+ extends?: string[] | undefined;
3101
+ agents?: Record<string, z.objectInputType<{
3102
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3103
+ }, z.ZodTypeAny, "passthrough">> | undefined;
3104
+ audit?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
3105
+ runners?: Record<string, z.objectInputType<{}, z.ZodTypeAny, "passthrough">> | undefined;
3106
+ canonicalSources?: ({
3107
+ kind: "npm";
3108
+ specifier: string;
3109
+ implementationPath?: string | undefined;
3110
+ include?: string[] | undefined;
3111
+ exclude?: string[] | undefined;
3112
+ } | {
3113
+ path: string;
3114
+ kind: "directory";
3115
+ include?: string[] | undefined;
3116
+ exclude?: string[] | undefined;
3117
+ } | {
3118
+ kind: "registry";
3119
+ registryId: string;
3120
+ installPath: string;
3121
+ severity?: "error" | "info" | "warn" | undefined;
3122
+ importPath?: string | undefined;
3123
+ include?: string[] | undefined;
3124
+ exclude?: string[] | undefined;
3125
+ registryHash?: string | undefined;
3126
+ receiptPath?: string | undefined;
3127
+ })[] | undefined;
3128
+ presets?: string[] | undefined;
3129
+ agent?: z.objectInputType<{
3130
+ repairOrder: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3131
+ }, z.ZodTypeAny, "passthrough"> | undefined;
3132
+ ci?: z.objectInputType<{
3133
+ failOnWarnings: z.ZodOptional<z.ZodBoolean>;
3134
+ }, z.ZodTypeAny, "passthrough"> | undefined;
3135
+ }>;
3136
+ type ScaleGovernanceRecord = z.infer<typeof scaleGovernanceRecordSchema>;
3137
+ type GlobalStyleGovernanceRecord = z.infer<typeof globalStyleGovernanceRecordSchema>;
3138
+ type GlobalJsxGovernanceRecord = z.infer<typeof globalJsxGovernanceRecordSchema>;
3139
+ type GlobalGovernanceRecord = z.infer<typeof globalGovernanceRecordSchema>;
3140
+ type ComponentGovernanceRecord = z.infer<typeof componentGovernanceRecordSchema>;
3141
+ type ComponentPolicyRecord = z.infer<typeof componentPolicyRecordSchema>;
3142
+ type ComponentPolicyOverride = z.infer<typeof componentPolicyOverrideSchema>;
3143
+ type CanonicalSource = z.infer<typeof canonicalSourceSchema>;
3144
+ interface GovernanceConfig {
3145
+ extends?: string[];
3146
+ severity?: GovernanceSeverity;
3147
+ rules?: Record<string, unknown>;
3148
+ agents?: Record<string, {
3149
+ rules?: Record<string, unknown>;
3150
+ }>;
3151
+ audit?: Record<string, unknown>;
3152
+ runners?: Record<string, Record<string, unknown>>;
3153
+ canonicalSources?: CanonicalSource[];
3154
+ presets?: string[];
3155
+ scales?: Record<string, ScaleGovernanceRecord>;
3156
+ styles?: GlobalStyleGovernanceRecord[];
3157
+ jsx?: GlobalJsxGovernanceRecord[];
3158
+ tailwind?: {
3159
+ palette?: {
3160
+ allow?: string[];
3161
+ deny?: string[];
3162
+ };
3163
+ [key: string]: unknown;
3164
+ };
3165
+ agent?: {
3166
+ repairOrder?: string[];
3167
+ [key: string]: unknown;
3168
+ };
3169
+ components?: Record<string, ComponentPolicyRecord>;
3170
+ overrides?: ComponentPolicyOverride[];
3171
+ ci?: {
3172
+ failOnWarnings?: boolean;
3173
+ [key: string]: unknown;
3174
+ };
3175
+ [key: string]: unknown;
3176
+ }
3177
+ type SeverityOption = {
3178
+ severity?: GovernanceSeverity;
3179
+ };
3180
+ type PropContext = {
3181
+ path?: string;
3182
+ };
3183
+ type NonNullish<T> = T extends null | undefined ? never : T;
3184
+ type GovernancePropValue<T> = NonNullish<T> extends string ? string extends NonNullish<T> ? string : NonNullish<T> : NonNullish<T> extends number ? number extends NonNullish<T> ? number : NonNullish<T> : NonNullish<T> extends boolean ? boolean extends NonNullish<T> ? boolean : NonNullish<T> : NonNullish<T>;
3185
+ type PropKey<TProps> = Extract<keyof TProps, string>;
3186
+ interface PropGovernanceOptions<TValue> extends SeverityOption {
3187
+ because?: string;
3188
+ suggest?: string;
3189
+ when?: PropContext;
3190
+ fix?: {
3191
+ replaceWith: GovernancePropValue<TValue>;
3192
+ };
3193
+ }
3194
+ interface PropGovernanceBuilder<TValue> {
3195
+ avoid(value: GovernancePropValue<TValue>, options?: Omit<PropGovernanceOptions<TValue>, "fix" | "when">): ComponentGovernanceRecord;
3196
+ forbid(value: GovernancePropValue<TValue>, options?: PropGovernanceOptions<TValue>): ComponentGovernanceRecord;
3197
+ }
3198
+ interface AccessibilityGovernanceBuilder {
3199
+ requireName(options?: SeverityOption & {
3200
+ because?: string;
3201
+ }): ComponentGovernanceRecord;
3202
+ }
3203
+ interface ComponentGovernanceBuilder<TProps> {
3204
+ capability(capability: string): ComponentGovernanceRecord;
3205
+ prop<TKey extends PropKey<TProps>>(prop: TKey): PropGovernanceBuilder<TProps[TKey]>;
3206
+ accessibility(): AccessibilityGovernanceBuilder;
3207
+ }
3208
+ interface GovernedFragmentDefinition<TProps = unknown, TComponent extends FragmentComponent<TProps> = FragmentComponent<TProps>> {
3209
+ component: TComponent;
3210
+ meta: FragmentMeta;
3211
+ guidance: FragmentGuidance;
3212
+ props?: Record<string, PropDefinition>;
3213
+ relations?: ComponentRelation[];
3214
+ examples?: FragmentExample[];
3215
+ composition?: {
3216
+ pattern?: "compound" | "simple" | "controlled" | "wrapper";
3217
+ subComponents?: string[];
3218
+ requiredChildren?: string[];
3219
+ commonPatterns?: string[];
3220
+ };
3221
+ contract?: FragmentContract;
3222
+ _provenance?: FragmentProvenance;
3223
+ govern?: (g: ComponentGovernanceBuilder<TProps>) => ComponentGovernanceRecord[];
3224
+ governance?: ComponentGovernanceRecord[];
3225
+ }
3226
+ type ResolvedGovernedFragmentDefinition<TProps = unknown, TComponent extends FragmentComponent<TProps> = FragmentComponent<TProps>> = GovernedFragmentDefinition<TProps, TComponent> & {
3227
+ governance: ComponentGovernanceRecord[];
3228
+ };
3229
+ declare function normalizeGovernanceConfig<TConfig extends {
3230
+ govern?: GovernanceConfig;
3231
+ }>(config: TConfig): TConfig;
3232
+ declare const g: {
3233
+ scale: {
3234
+ px(values: readonly number[]): ScaleGovernanceRecord;
3235
+ rem(values: readonly number[]): ScaleGovernanceRecord;
3236
+ };
3237
+ styles: {
3238
+ rawColors(): {
3239
+ forbid(options?: {
3240
+ except?: string[];
3241
+ prefer?: "token" | "css-variable";
3242
+ severity?: GovernanceSeverity;
3243
+ }): GlobalStyleGovernanceRecord;
3244
+ };
3245
+ rawSpacing(): {
3246
+ mustMatchScale(scale: string, options?: SeverityOption & {
3247
+ appliesTo?: string[];
3248
+ }): GlobalStyleGovernanceRecord;
3249
+ };
3250
+ fontSize(): {
3251
+ mustMatchScale(scale: string, options?: SeverityOption): GlobalStyleGovernanceRecord;
3252
+ };
3253
+ cssVars(): {
3254
+ mustBeDefined(options?: SeverityOption): GlobalStyleGovernanceRecord;
3255
+ };
3256
+ };
3257
+ jsx: {
3258
+ unknownProps(): {
3259
+ forbid(options?: SeverityOption): GlobalJsxGovernanceRecord;
3260
+ };
3261
+ inlineStyle(): {
3262
+ forbidRaw(properties: readonly string[], options?: SeverityOption): GlobalJsxGovernanceRecord;
3263
+ };
3264
+ importPath(): {
3265
+ prefer(from: string, to: string, options?: SeverityOption & {
3266
+ imported?: string;
3267
+ because?: string;
3268
+ }): GlobalJsxGovernanceRecord;
3269
+ };
3270
+ component(): {
3271
+ prefer(from: string, to: string, options?: SeverityOption & {
3272
+ because?: string;
3273
+ }): GlobalJsxGovernanceRecord;
3274
+ };
3275
+ };
3276
+ component: ComponentGovernanceBuilder<Record<string, unknown>>;
3277
+ };
3278
+
3279
+ export { type FragmentContract as $, type AIMetadata as A, type BlockDefinition as B, type CompiledBlock as C, type CompiledTokenData as D, type CompiledTokenEntry as E, type FragmentDefinition as F, type GovernanceSeverity as G, type ComponentGovernanceBuilder as H, type ComponentGovernanceRecord as I, type ComponentRef as J, type ComponentRelation as K, type CompositionMetadata as L, type ContractCanonicalMappingInput as M, type ContractComponentInput as N, type ContractPolicyInput as O, type ContractPreimage as P, type ContractPropMappingInput as Q, type ResolvedGovernedFragmentDefinition as R, type StorybookFilterConfig as S, type TokenConfig as T, type ContractTokenInput as U, type VariantRenderOptions as V, type ContractWaiverInput as W, type ControlType as X, type DesignSystemConfig as Y, type DiffResult as Z, type FigmaPropMapping as _, type FragmentDefinitionV2 as a, type ImportEntry as a$, type FragmentExample as a0, type FragmentGenerated as a1, type FragmentGuidance as a2, type FragmentMeta as a3, type FragmentProvenance as a4, type FragmentUsage as a5, type FragmentVariant as a6, type GlobalGovernanceRecord as a7, type GlobalJsxGovernanceRecord as a8, type GlobalStyleGovernanceRecord as a9, type TokenSourceConfig as aA, type TokenSourceFormat as aB, type VerifyRequest as aC, type VerifyResult as aD, type Viewport as aE, componentGovernanceRecordSchema as aF, componentGovernanceRecordsSchema as aG, contractComponentsFromFragments as aH, contractPolicyFromGovernanceConfig as aI, diffContractDomains as aJ, g as aK, globalGovernanceRecordSchema as aL, globalJsxGovernanceRecordSchema as aM, globalStyleGovernanceRecordSchema as aN, governanceConfigSchema as aO, governanceConfigWithLocalCanonical as aP, governanceSeveritySchema as aQ, localCanonicalContractMappings as aR, normalizeGovernanceConfig as aS, projectContractPreimage as aT, scaleGovernanceRecordSchema as aU, type AIMetadata$1 as aV, type ComponentRelation$1 as aW, type FragmentContract$1 as aX, type FragmentGenerated$1 as aY, type FragmentMeta$1 as aZ, type FragmentUsage$1 as a_, type GovernancePropValue as aa, type InspectConfig as ab, type LocalCanonicalDeclaration as ac, type LocalCanonicalResolveRule as ad, type Manifest as ae, type ObservedComponentUsage as af, type ObservedUsageProp as ag, type PlayFunction as ah, type PlayFunctionContext as ai, type PropDefinition as aj, type PropGovernanceBuilder as ak, type PropGovernanceOptions as al, type PropKey as am, type PropType as an, type RecipeDefinition as ao, type RegistryOptions as ap, type RepoRelativePath as aq, type ScaleGovernanceRecord as ar, type Screenshot as as, type ScreenshotConfig as at, type ScreenshotMetadata as au, type ServiceConfig as av, type SnapshotConfig as aw, type SnippetPolicyConfig as ax, type Theme as ay, type ThemeSeeds as az, type CompiledFragment as b, type PerformanceData as b0, type PerformanceSummary as b1, type PropDefinition$1 as b2, type Theme$1 as b3, type VerifyResult$1 as b4, type ContractDomain as c, type ContractCatalogInput as d, type GovernedFragmentDefinition as e, type GovernanceConfig as f, type FragmentsConfig as g, type FragmentComponent as h, type FigmaStringMapping as i, type FigmaBooleanMapping as j, type FigmaEnumMapping as k, type FigmaInstanceMapping as l, type FigmaChildrenMapping as m, type FigmaTextContentMapping as n, type RelationshipType as o, type VariantLoader as p, type CanonicalSource as q, type AccessibilityGovernanceBuilder as r, type AppConfig as s, type BaselineInfo as t, type BoundingBox as u, CONTRACT_DOMAINS as v, CONTRACT_PREIMAGE_SCHEMA as w, type CanonicalMappingStatus as x, type CompiledFragmentsFile as y, type CompiledRecipe as z };