@fragments-sdk/cli 0.15.10 → 0.16.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.
- package/dist/bin.js +896 -787
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-6SQPP47U.js → chunk-77AAP6R6.js} +532 -31
- package/dist/chunk-77AAP6R6.js.map +1 -0
- package/dist/{chunk-5JF26E55.js → chunk-ACFVKMVZ.js} +11 -11
- package/dist/{chunk-BJE3425I.js → chunk-ACX7YWZW.js} +2 -2
- package/dist/{chunk-ONUP6Z4W.js → chunk-G6UVWMFU.js} +8 -8
- package/dist/{chunk-2WXKALIG.js → chunk-OZZ4SVZX.js} +2 -2
- package/dist/{chunk-32LIWN2P.js → chunk-SJFSG7QF.js} +582 -261
- package/dist/chunk-SJFSG7QF.js.map +1 -0
- package/dist/{chunk-HQ6A6DTV.js → chunk-XRADMHMV.js} +315 -1089
- package/dist/chunk-XRADMHMV.js.map +1 -0
- package/dist/core/index.js +53 -1
- package/dist/{create-EXURTBKK.js → create-3ZFYQB3T.js} +2 -2
- package/dist/{doctor-BDPMYYE6.js → doctor-4IDUM7HI.js} +2 -2
- package/dist/{generate-PVOLUAAC.js → generate-VNUUWVWQ.js} +4 -4
- package/dist/{govern-scan-DW4QUAYD.js → govern-scan-HTACKYPF.js} +158 -120
- package/dist/govern-scan-HTACKYPF.js.map +1 -0
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/{init-SSGUSP7Z.js → init-PXFRAQ64.js} +5 -5
- package/dist/mcp-bin.js +2 -2
- package/dist/{scan-PKSYSTRR.js → scan-L4GWGEZX.js} +5 -6
- package/dist/{scan-generate-VY27PIOX.js → scan-generate-74EYSAGH.js} +4 -4
- package/dist/{service-QJGWUIVL.js → service-VELQHEWV.js} +12 -14
- package/dist/{snapshot-WIJMEIFT.js → snapshot-DT4B6DPR.js} +2 -2
- package/dist/{static-viewer-7QIBQZRC.js → static-viewer-E4OJWFDJ.js} +3 -3
- package/dist/{test-64Z5BKBA.js → test-QJY2QO4X.js} +3 -3
- package/dist/{token-normalizer-TEPOVBPV.js → token-normalizer-56H4242J.js} +2 -2
- package/dist/{tokens-NZWFQIAB.js → tokens-K6URXFPK.js} +7 -8
- package/dist/{tokens-NZWFQIAB.js.map → tokens-K6URXFPK.js.map} +1 -1
- package/dist/{tokens-generate-5JQSJ27E.js → tokens-generate-EL6IN536.js} +2 -2
- package/package.json +7 -6
- package/src/bin.ts +49 -88
- package/src/commands/__fixtures__/shadcn-label-wrapper/src/components/ui/label.contract.json +1 -1
- package/src/commands/__fixtures__/shadcn-label-wrapper/src/components/ui/primitive.contract.json +1 -1
- package/src/commands/__tests__/context-cloud.test.ts +291 -0
- package/src/commands/__tests__/govern-scan.test.ts +185 -0
- package/src/commands/__tests__/govern.test.ts +1 -0
- package/src/commands/context-cloud.ts +355 -0
- package/src/commands/govern-scan-report.ts +170 -0
- package/src/commands/govern-scan.ts +42 -147
- package/src/commands/govern.ts +0 -157
- package/dist/chunk-32LIWN2P.js.map +0 -1
- package/dist/chunk-6SQPP47U.js.map +0 -1
- package/dist/chunk-HQ6A6DTV.js.map +0 -1
- package/dist/chunk-MHIBEEW4.js +0 -511
- package/dist/chunk-MHIBEEW4.js.map +0 -1
- package/dist/govern-scan-DW4QUAYD.js.map +0 -1
- package/dist/init-cloud-3DNKPWFB.js +0 -304
- package/dist/init-cloud-3DNKPWFB.js.map +0 -1
- package/dist/node-37AUE74M.js +0 -65
- package/dist/push-contracts-WY32TFP6.js +0 -84
- package/dist/push-contracts-WY32TFP6.js.map +0 -1
- package/dist/static-viewer-7QIBQZRC.js.map +0 -1
- package/dist/token-parser-32KOIOFN.js +0 -22
- package/dist/token-parser-32KOIOFN.js.map +0 -1
- package/dist/tokens-push-HY3KO36V.js +0 -148
- package/dist/tokens-push-HY3KO36V.js.map +0 -1
- package/src/commands/init-cloud.ts +0 -382
- package/src/commands/push-contracts.ts +0 -112
- package/src/commands/tokens-push.ts +0 -199
- /package/dist/{chunk-5JF26E55.js.map → chunk-ACFVKMVZ.js.map} +0 -0
- /package/dist/{chunk-BJE3425I.js.map → chunk-ACX7YWZW.js.map} +0 -0
- /package/dist/{chunk-ONUP6Z4W.js.map → chunk-G6UVWMFU.js.map} +0 -0
- /package/dist/{chunk-2WXKALIG.js.map → chunk-OZZ4SVZX.js.map} +0 -0
- /package/dist/{create-EXURTBKK.js.map → create-3ZFYQB3T.js.map} +0 -0
- /package/dist/{doctor-BDPMYYE6.js.map → doctor-4IDUM7HI.js.map} +0 -0
- /package/dist/{generate-PVOLUAAC.js.map → generate-VNUUWVWQ.js.map} +0 -0
- /package/dist/{init-SSGUSP7Z.js.map → init-PXFRAQ64.js.map} +0 -0
- /package/dist/{node-37AUE74M.js.map → scan-L4GWGEZX.js.map} +0 -0
- /package/dist/{scan-generate-VY27PIOX.js.map → scan-generate-74EYSAGH.js.map} +0 -0
- /package/dist/{scan-PKSYSTRR.js.map → service-VELQHEWV.js.map} +0 -0
- /package/dist/{snapshot-WIJMEIFT.js.map → snapshot-DT4B6DPR.js.map} +0 -0
- /package/dist/{service-QJGWUIVL.js.map → static-viewer-E4OJWFDJ.js.map} +0 -0
- /package/dist/{test-64Z5BKBA.js.map → test-QJY2QO4X.js.map} +0 -0
- /package/dist/{token-normalizer-TEPOVBPV.js.map → token-normalizer-56H4242J.js.map} +0 -0
- /package/dist/{tokens-generate-5JQSJ27E.js.map → tokens-generate-EL6IN536.js.map} +0 -0
|
@@ -2,6 +2,8 @@ import { createRequire as __banner_createRequire } from 'module'; const require
|
|
|
2
2
|
|
|
3
3
|
// ../core/dist/index.js
|
|
4
4
|
import { z } from "zod";
|
|
5
|
+
import { z as z2 } from "zod";
|
|
6
|
+
import { z as z3 } from "zod";
|
|
5
7
|
import { createElement } from "react";
|
|
6
8
|
import {
|
|
7
9
|
toId as storybookToId,
|
|
@@ -9,8 +11,8 @@ import {
|
|
|
9
11
|
isExportStory as storybookIsExportStory
|
|
10
12
|
} from "@storybook/csf";
|
|
11
13
|
import { generateContext, filterPlaceholders, PLACEHOLDER_PATTERNS } from "@fragments-sdk/context/generate";
|
|
12
|
-
import { z as
|
|
13
|
-
import { z as
|
|
14
|
+
import { z as z4 } from "zod";
|
|
15
|
+
import { z as z5 } from "zod";
|
|
14
16
|
import { ComponentGraphEngine } from "@fragments-sdk/context/graph";
|
|
15
17
|
import { useEffect, useState } from "react";
|
|
16
18
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
@@ -136,6 +138,299 @@ function budgetBar(percent, width = 20) {
|
|
|
136
138
|
const bar = "\u2588".repeat(filled) + "\u2591".repeat(width - filled);
|
|
137
139
|
return percent > 100 ? `\x1B[31m${bar}\x1B[0m` : `\x1B[32m${bar}\x1B[0m`;
|
|
138
140
|
}
|
|
141
|
+
var bundleSchemaVersionSchema = z.literal(1);
|
|
142
|
+
var bundleTargetSchema = z.enum([
|
|
143
|
+
"cursor",
|
|
144
|
+
"agents",
|
|
145
|
+
"claude",
|
|
146
|
+
"copilot"
|
|
147
|
+
]);
|
|
148
|
+
var bundleArtifactMetadataSchema = z.object({
|
|
149
|
+
kind: z.enum([
|
|
150
|
+
"manifest",
|
|
151
|
+
"tokens",
|
|
152
|
+
"design-system",
|
|
153
|
+
"readme",
|
|
154
|
+
"helper",
|
|
155
|
+
"component"
|
|
156
|
+
]),
|
|
157
|
+
key: z.string().min(1),
|
|
158
|
+
label: z.string().min(1),
|
|
159
|
+
path: z.string().min(1),
|
|
160
|
+
etag: z.string().min(1),
|
|
161
|
+
updatedAt: z.string().datetime(),
|
|
162
|
+
target: bundleTargetSchema.optional(),
|
|
163
|
+
componentId: z.string().optional(),
|
|
164
|
+
contentType: z.enum(["application/json", "text/markdown"])
|
|
165
|
+
});
|
|
166
|
+
var bundleManifestRelationSchema = z.object({
|
|
167
|
+
type: z.string().min(1),
|
|
168
|
+
componentId: z.string().min(1),
|
|
169
|
+
name: z.string().min(1)
|
|
170
|
+
});
|
|
171
|
+
var bundleManifestCompoundChildSchema = z.object({
|
|
172
|
+
componentId: z.string().min(1),
|
|
173
|
+
name: z.string().min(1)
|
|
174
|
+
});
|
|
175
|
+
var bundleManifestComponentEntrySchema = z.object({
|
|
176
|
+
componentId: z.string().min(1),
|
|
177
|
+
file: z.string().min(1),
|
|
178
|
+
name: z.string().min(1),
|
|
179
|
+
publicSlug: z.string().nullable(),
|
|
180
|
+
tier: z.enum(["core", "composition"]),
|
|
181
|
+
category: z.string().min(1),
|
|
182
|
+
status: z.string().min(1),
|
|
183
|
+
description: z.string(),
|
|
184
|
+
propCount: z.number().int().nonnegative(),
|
|
185
|
+
hasExamples: z.boolean(),
|
|
186
|
+
hasCompoundChildren: z.boolean(),
|
|
187
|
+
relations: z.array(bundleManifestRelationSchema),
|
|
188
|
+
compoundChildren: z.array(bundleManifestCompoundChildSchema)
|
|
189
|
+
});
|
|
190
|
+
var bundleManifestSchema = z.object({
|
|
191
|
+
schemaVersion: bundleSchemaVersionSchema,
|
|
192
|
+
catalogRevision: z.string().min(1),
|
|
193
|
+
catalogUpdatedAt: z.string().datetime(),
|
|
194
|
+
org: z.object({
|
|
195
|
+
id: z.string().min(1),
|
|
196
|
+
name: z.string().min(1),
|
|
197
|
+
slug: z.string().min(1)
|
|
198
|
+
}),
|
|
199
|
+
designSystem: z.object({
|
|
200
|
+
name: z.string().min(1),
|
|
201
|
+
packageName: z.string().nullable(),
|
|
202
|
+
importPath: z.string().nullable()
|
|
203
|
+
}),
|
|
204
|
+
sourceBinding: z.object({
|
|
205
|
+
bindingId: z.string().min(1),
|
|
206
|
+
projectId: z.string().min(1),
|
|
207
|
+
projectName: z.string().min(1),
|
|
208
|
+
repoFullName: z.string().min(1),
|
|
209
|
+
resolution: z.enum(["explicit", "auto"])
|
|
210
|
+
}),
|
|
211
|
+
totalComponents: z.number().int().nonnegative(),
|
|
212
|
+
totalTokens: z.number().int().nonnegative(),
|
|
213
|
+
tokenCategories: z.record(z.string(), z.number().int().nonnegative()),
|
|
214
|
+
components: z.record(z.string(), bundleManifestComponentEntrySchema)
|
|
215
|
+
});
|
|
216
|
+
var bundleTokenEntrySchema = z.object({
|
|
217
|
+
name: z.string().min(1),
|
|
218
|
+
path: z.array(z.string().min(1)),
|
|
219
|
+
category: z.string().min(1),
|
|
220
|
+
value: z.string(),
|
|
221
|
+
type: z.string().optional(),
|
|
222
|
+
description: z.string().optional()
|
|
223
|
+
});
|
|
224
|
+
var bundleTokenFileSchema = z.object({
|
|
225
|
+
schemaVersion: bundleSchemaVersionSchema,
|
|
226
|
+
catalogRevision: z.string().min(1),
|
|
227
|
+
catalogUpdatedAt: z.string().datetime(),
|
|
228
|
+
categories: z.record(
|
|
229
|
+
z.string(),
|
|
230
|
+
z.object({
|
|
231
|
+
count: z.number().int().nonnegative(),
|
|
232
|
+
tokens: z.array(bundleTokenEntrySchema)
|
|
233
|
+
})
|
|
234
|
+
),
|
|
235
|
+
flat: z.array(bundleTokenEntrySchema)
|
|
236
|
+
});
|
|
237
|
+
var bundleComponentShardSchema = z.object({
|
|
238
|
+
schemaVersion: bundleSchemaVersionSchema,
|
|
239
|
+
catalogRevision: z.string().min(1),
|
|
240
|
+
catalogUpdatedAt: z.string().datetime(),
|
|
241
|
+
componentId: z.string().min(1),
|
|
242
|
+
file: z.string().min(1),
|
|
243
|
+
component: z.object({
|
|
244
|
+
componentKey: z.string().min(1),
|
|
245
|
+
publicRef: z.string().min(1),
|
|
246
|
+
publicId: z.string().nullable(),
|
|
247
|
+
publicSlug: z.string().nullable(),
|
|
248
|
+
name: z.string().min(1),
|
|
249
|
+
tier: z.enum(["core", "composition"]),
|
|
250
|
+
category: z.string().min(1),
|
|
251
|
+
status: z.string().min(1),
|
|
252
|
+
description: z.string(),
|
|
253
|
+
usageGuidance: z.string(),
|
|
254
|
+
dos: z.array(z.string()),
|
|
255
|
+
donts: z.array(z.string()),
|
|
256
|
+
props: z.record(z.string(), z.unknown()),
|
|
257
|
+
relations: z.array(z.record(z.string(), z.unknown())),
|
|
258
|
+
compoundChildren: z.array(bundleManifestCompoundChildSchema),
|
|
259
|
+
examples: z.array(z.record(z.string(), z.unknown())),
|
|
260
|
+
source: z.literal("design-system"),
|
|
261
|
+
sourcePath: z.string().optional(),
|
|
262
|
+
sourceRepoFullName: z.string().optional(),
|
|
263
|
+
parentComponentName: z.string().optional(),
|
|
264
|
+
parentComponentKey: z.string().optional()
|
|
265
|
+
})
|
|
266
|
+
});
|
|
267
|
+
var mcpSnapshotSchemaVersionSchema = z2.literal(1);
|
|
268
|
+
var mcpSourceTypeSchema = z2.enum([
|
|
269
|
+
"fragments-json",
|
|
270
|
+
"cloud",
|
|
271
|
+
"auto-extract",
|
|
272
|
+
"custom-json",
|
|
273
|
+
"bundle"
|
|
274
|
+
]);
|
|
275
|
+
var mcpCapabilitySchema = z2.enum([
|
|
276
|
+
"components",
|
|
277
|
+
"tokens",
|
|
278
|
+
"blocks",
|
|
279
|
+
"graph",
|
|
280
|
+
"performance"
|
|
281
|
+
]);
|
|
282
|
+
var mcpPerformanceImportSchema = z2.object({
|
|
283
|
+
path: z2.string().min(1),
|
|
284
|
+
bytes: z2.number().nonnegative(),
|
|
285
|
+
percent: z2.number().nonnegative()
|
|
286
|
+
});
|
|
287
|
+
var mcpPerformanceDataSchema = z2.object({
|
|
288
|
+
bundleSize: z2.number().nonnegative(),
|
|
289
|
+
rawSize: z2.number().nonnegative(),
|
|
290
|
+
complexity: z2.enum(["lightweight", "moderate", "heavy"]),
|
|
291
|
+
budgetPercent: z2.number().nonnegative(),
|
|
292
|
+
overBudget: z2.boolean(),
|
|
293
|
+
measuredAt: z2.string().datetime(),
|
|
294
|
+
imports: z2.array(mcpPerformanceImportSchema).optional()
|
|
295
|
+
});
|
|
296
|
+
var mcpPerformanceSummarySchema = z2.object({
|
|
297
|
+
preset: z2.string().min(1),
|
|
298
|
+
budget: z2.number().nonnegative(),
|
|
299
|
+
total: z2.number().int().nonnegative(),
|
|
300
|
+
overBudget: z2.number().int().nonnegative(),
|
|
301
|
+
tiers: z2.record(
|
|
302
|
+
z2.enum(["lightweight", "moderate", "heavy"]),
|
|
303
|
+
z2.number().int().nonnegative()
|
|
304
|
+
)
|
|
305
|
+
});
|
|
306
|
+
var mcpComponentPropSchema = z2.object({
|
|
307
|
+
type: z2.string().min(1),
|
|
308
|
+
description: z2.string().default(""),
|
|
309
|
+
required: z2.boolean().default(false),
|
|
310
|
+
default: z2.unknown().optional(),
|
|
311
|
+
values: z2.array(z2.string()).optional(),
|
|
312
|
+
constraints: z2.array(z2.string()).optional()
|
|
313
|
+
});
|
|
314
|
+
var mcpComponentExampleSchema = z2.object({
|
|
315
|
+
name: z2.string().min(1),
|
|
316
|
+
description: z2.string().optional(),
|
|
317
|
+
code: z2.string().optional(),
|
|
318
|
+
kind: z2.string().optional()
|
|
319
|
+
});
|
|
320
|
+
var mcpComponentRelationSchema = z2.object({
|
|
321
|
+
componentName: z2.string().min(1),
|
|
322
|
+
componentId: z2.string().optional(),
|
|
323
|
+
relationship: z2.string().min(1),
|
|
324
|
+
note: z2.string().optional(),
|
|
325
|
+
description: z2.string().optional()
|
|
326
|
+
});
|
|
327
|
+
var mcpCompoundChildSchema = z2.object({
|
|
328
|
+
name: z2.string().min(1),
|
|
329
|
+
componentId: z2.string().optional(),
|
|
330
|
+
description: z2.string().optional(),
|
|
331
|
+
required: z2.boolean().optional(),
|
|
332
|
+
accepts: z2.array(z2.string()).optional(),
|
|
333
|
+
visibility: z2.enum(["public", "internal"]).optional()
|
|
334
|
+
});
|
|
335
|
+
var mcpGuidancePatternSchema = z2.object({
|
|
336
|
+
name: z2.string().min(1),
|
|
337
|
+
description: z2.string().optional()
|
|
338
|
+
});
|
|
339
|
+
var mcpComponentGuidanceSchema = z2.object({
|
|
340
|
+
when: z2.array(z2.string()).default([]),
|
|
341
|
+
whenNot: z2.array(z2.string()).default([]),
|
|
342
|
+
guidelines: z2.array(z2.string()).default([]),
|
|
343
|
+
accessibility: z2.array(z2.string()).default([]),
|
|
344
|
+
usageGuidance: z2.string().optional(),
|
|
345
|
+
dos: z2.array(z2.string()).default([]),
|
|
346
|
+
donts: z2.array(z2.string()).default([]),
|
|
347
|
+
patterns: z2.array(mcpGuidancePatternSchema).default([])
|
|
348
|
+
});
|
|
349
|
+
var mcpComponentMetadataSchema = z2.object({
|
|
350
|
+
a11yRules: z2.array(z2.string()).default([]),
|
|
351
|
+
scenarioTags: z2.array(z2.string()).default([])
|
|
352
|
+
});
|
|
353
|
+
var mcpComponentSchema = z2.object({
|
|
354
|
+
id: z2.string().min(1),
|
|
355
|
+
name: z2.string().min(1),
|
|
356
|
+
description: z2.string().default(""),
|
|
357
|
+
category: z2.string().default("uncategorized"),
|
|
358
|
+
status: z2.string().default("stable"),
|
|
359
|
+
tags: z2.array(z2.string()).default([]),
|
|
360
|
+
props: z2.record(z2.string(), mcpComponentPropSchema).default({}),
|
|
361
|
+
propsSummary: z2.array(z2.string()).default([]),
|
|
362
|
+
examples: z2.array(mcpComponentExampleSchema).default([]),
|
|
363
|
+
relations: z2.array(mcpComponentRelationSchema).default([]),
|
|
364
|
+
compoundChildren: z2.array(mcpCompoundChildSchema).default([]),
|
|
365
|
+
guidance: mcpComponentGuidanceSchema.default({
|
|
366
|
+
when: [],
|
|
367
|
+
whenNot: [],
|
|
368
|
+
guidelines: [],
|
|
369
|
+
accessibility: [],
|
|
370
|
+
dos: [],
|
|
371
|
+
donts: [],
|
|
372
|
+
patterns: []
|
|
373
|
+
}),
|
|
374
|
+
sourceType: mcpSourceTypeSchema,
|
|
375
|
+
sourcePath: z2.string().optional(),
|
|
376
|
+
sourceRepoFullName: z2.string().optional(),
|
|
377
|
+
packageName: z2.string().optional(),
|
|
378
|
+
importPath: z2.string().optional(),
|
|
379
|
+
publicRef: z2.string().optional(),
|
|
380
|
+
publicSlug: z2.string().nullable().optional(),
|
|
381
|
+
tier: z2.string().optional(),
|
|
382
|
+
parentComponentId: z2.string().optional(),
|
|
383
|
+
parentComponentName: z2.string().optional(),
|
|
384
|
+
performance: mcpPerformanceDataSchema.optional(),
|
|
385
|
+
metadata: mcpComponentMetadataSchema.default({
|
|
386
|
+
a11yRules: [],
|
|
387
|
+
scenarioTags: []
|
|
388
|
+
})
|
|
389
|
+
});
|
|
390
|
+
var mcpBlockSchema = z2.object({
|
|
391
|
+
id: z2.string().min(1),
|
|
392
|
+
name: z2.string().min(1),
|
|
393
|
+
description: z2.string().default(""),
|
|
394
|
+
category: z2.string().default("uncategorized"),
|
|
395
|
+
components: z2.array(z2.string()).default([]),
|
|
396
|
+
tags: z2.array(z2.string()).default([]),
|
|
397
|
+
code: z2.string().default("")
|
|
398
|
+
});
|
|
399
|
+
var mcpTokenSchema = z2.object({
|
|
400
|
+
name: z2.string().min(1),
|
|
401
|
+
category: z2.string().min(1),
|
|
402
|
+
value: z2.string().optional(),
|
|
403
|
+
description: z2.string().optional(),
|
|
404
|
+
path: z2.array(z2.string()).optional(),
|
|
405
|
+
type: z2.string().optional()
|
|
406
|
+
});
|
|
407
|
+
var mcpTokenDataSchema = z2.object({
|
|
408
|
+
prefix: z2.string(),
|
|
409
|
+
total: z2.number().int().nonnegative(),
|
|
410
|
+
categories: z2.record(z2.string(), z2.array(mcpTokenSchema)),
|
|
411
|
+
flat: z2.array(mcpTokenSchema).default([])
|
|
412
|
+
});
|
|
413
|
+
var mcpSnapshotMetadataSchema = z2.object({
|
|
414
|
+
designSystemName: z2.string().optional(),
|
|
415
|
+
packageName: z2.string().optional(),
|
|
416
|
+
importPath: z2.string().optional(),
|
|
417
|
+
revision: z2.string().optional(),
|
|
418
|
+
updatedAt: z2.string().optional()
|
|
419
|
+
});
|
|
420
|
+
var mcpSnapshotSchema = z2.object({
|
|
421
|
+
schemaVersion: mcpSnapshotSchemaVersionSchema,
|
|
422
|
+
sourceType: mcpSourceTypeSchema,
|
|
423
|
+
sourceLabel: z2.string().min(1),
|
|
424
|
+
capabilities: z2.array(mcpCapabilitySchema),
|
|
425
|
+
metadata: mcpSnapshotMetadataSchema.default({}),
|
|
426
|
+
components: z2.record(z2.string(), mcpComponentSchema),
|
|
427
|
+
blocks: z2.record(z2.string(), mcpBlockSchema).optional(),
|
|
428
|
+
tokens: mcpTokenDataSchema.optional(),
|
|
429
|
+
graph: z2.unknown().optional(),
|
|
430
|
+
performanceSummary: mcpPerformanceSummarySchema.optional(),
|
|
431
|
+
packageMap: z2.record(z2.string(), z2.string()).default({}),
|
|
432
|
+
defaultPackageName: z2.string().optional()
|
|
433
|
+
});
|
|
139
434
|
var COLOR_PROPERTIES = /* @__PURE__ */ new Set(["backgroundColor", "borderColor", "color"]);
|
|
140
435
|
var NUMERIC_PROPERTIES = /* @__PURE__ */ new Set([
|
|
141
436
|
"borderWidth",
|
|
@@ -345,33 +640,33 @@ function getComplianceBadge(compliancePercent) {
|
|
|
345
640
|
return { label: "Poor", color: "red" };
|
|
346
641
|
}
|
|
347
642
|
}
|
|
348
|
-
var figmaStringMappingSchema =
|
|
349
|
-
__type:
|
|
350
|
-
figmaProperty:
|
|
643
|
+
var figmaStringMappingSchema = z3.object({
|
|
644
|
+
__type: z3.literal("figma-string"),
|
|
645
|
+
figmaProperty: z3.string().min(1)
|
|
351
646
|
});
|
|
352
|
-
var figmaBooleanMappingSchema =
|
|
353
|
-
__type:
|
|
354
|
-
figmaProperty:
|
|
355
|
-
valueMapping:
|
|
647
|
+
var figmaBooleanMappingSchema = z3.object({
|
|
648
|
+
__type: z3.literal("figma-boolean"),
|
|
649
|
+
figmaProperty: z3.string().min(1),
|
|
650
|
+
valueMapping: z3.object({ true: z3.unknown(), false: z3.unknown() }).optional()
|
|
356
651
|
});
|
|
357
|
-
var figmaEnumMappingSchema =
|
|
358
|
-
__type:
|
|
359
|
-
figmaProperty:
|
|
360
|
-
valueMapping:
|
|
652
|
+
var figmaEnumMappingSchema = z3.object({
|
|
653
|
+
__type: z3.literal("figma-enum"),
|
|
654
|
+
figmaProperty: z3.string().min(1),
|
|
655
|
+
valueMapping: z3.record(z3.unknown())
|
|
361
656
|
});
|
|
362
|
-
var figmaInstanceMappingSchema =
|
|
363
|
-
__type:
|
|
364
|
-
figmaProperty:
|
|
657
|
+
var figmaInstanceMappingSchema = z3.object({
|
|
658
|
+
__type: z3.literal("figma-instance"),
|
|
659
|
+
figmaProperty: z3.string().min(1)
|
|
365
660
|
});
|
|
366
|
-
var figmaChildrenMappingSchema =
|
|
367
|
-
__type:
|
|
368
|
-
layers:
|
|
661
|
+
var figmaChildrenMappingSchema = z3.object({
|
|
662
|
+
__type: z3.literal("figma-children"),
|
|
663
|
+
layers: z3.array(z3.string().min(1))
|
|
369
664
|
});
|
|
370
|
-
var figmaTextContentMappingSchema =
|
|
371
|
-
__type:
|
|
372
|
-
layer:
|
|
665
|
+
var figmaTextContentMappingSchema = z3.object({
|
|
666
|
+
__type: z3.literal("figma-text-content"),
|
|
667
|
+
layer: z3.string().min(1)
|
|
373
668
|
});
|
|
374
|
-
var figmaPropMappingSchema =
|
|
669
|
+
var figmaPropMappingSchema = z3.discriminatedUnion("__type", [
|
|
375
670
|
figmaStringMappingSchema,
|
|
376
671
|
figmaBooleanMappingSchema,
|
|
377
672
|
figmaEnumMappingSchema,
|
|
@@ -379,28 +674,28 @@ var figmaPropMappingSchema = z.discriminatedUnion("__type", [
|
|
|
379
674
|
figmaChildrenMappingSchema,
|
|
380
675
|
figmaTextContentMappingSchema
|
|
381
676
|
]);
|
|
382
|
-
var fragmentMetaSchema =
|
|
383
|
-
name:
|
|
384
|
-
description:
|
|
385
|
-
category:
|
|
386
|
-
tags:
|
|
387
|
-
status:
|
|
388
|
-
since:
|
|
389
|
-
dependencies:
|
|
390
|
-
name:
|
|
391
|
-
version:
|
|
392
|
-
reason:
|
|
677
|
+
var fragmentMetaSchema = z3.object({
|
|
678
|
+
name: z3.string().min(1),
|
|
679
|
+
description: z3.string().min(1),
|
|
680
|
+
category: z3.string().min(1),
|
|
681
|
+
tags: z3.array(z3.string()).optional(),
|
|
682
|
+
status: z3.enum(["stable", "beta", "deprecated", "experimental"]).optional(),
|
|
683
|
+
since: z3.string().optional(),
|
|
684
|
+
dependencies: z3.array(z3.object({
|
|
685
|
+
name: z3.string().min(1),
|
|
686
|
+
version: z3.string().min(1),
|
|
687
|
+
reason: z3.string().optional()
|
|
393
688
|
})).optional(),
|
|
394
|
-
figma:
|
|
395
|
-
figmaProps:
|
|
689
|
+
figma: z3.string().url().optional(),
|
|
690
|
+
figmaProps: z3.record(figmaPropMappingSchema).optional()
|
|
396
691
|
});
|
|
397
|
-
var fragmentUsageSchema =
|
|
398
|
-
when:
|
|
399
|
-
whenNot:
|
|
400
|
-
guidelines:
|
|
401
|
-
accessibility:
|
|
692
|
+
var fragmentUsageSchema = z3.object({
|
|
693
|
+
when: z3.array(z3.string()),
|
|
694
|
+
whenNot: z3.array(z3.string()),
|
|
695
|
+
guidelines: z3.array(z3.string()).optional(),
|
|
696
|
+
accessibility: z3.array(z3.string()).optional()
|
|
402
697
|
});
|
|
403
|
-
var propTypeSchema =
|
|
698
|
+
var propTypeSchema = z3.enum([
|
|
404
699
|
"string",
|
|
405
700
|
"number",
|
|
406
701
|
"boolean",
|
|
@@ -413,16 +708,16 @@ var propTypeSchema = z.enum([
|
|
|
413
708
|
"union",
|
|
414
709
|
"custom"
|
|
415
710
|
]);
|
|
416
|
-
var propDefinitionSchema =
|
|
711
|
+
var propDefinitionSchema = z3.object({
|
|
417
712
|
type: propTypeSchema,
|
|
418
|
-
values:
|
|
419
|
-
default:
|
|
420
|
-
description:
|
|
421
|
-
required:
|
|
422
|
-
constraints:
|
|
423
|
-
typeDetails:
|
|
713
|
+
values: z3.array(z3.string()).readonly().optional(),
|
|
714
|
+
default: z3.unknown().optional(),
|
|
715
|
+
description: z3.string().optional(),
|
|
716
|
+
required: z3.boolean().optional(),
|
|
717
|
+
constraints: z3.array(z3.string()).optional(),
|
|
718
|
+
typeDetails: z3.record(z3.unknown()).optional()
|
|
424
719
|
});
|
|
425
|
-
var relationshipTypeSchema =
|
|
720
|
+
var relationshipTypeSchema = z3.enum([
|
|
426
721
|
"alternative",
|
|
427
722
|
"sibling",
|
|
428
723
|
"parent",
|
|
@@ -431,136 +726,136 @@ var relationshipTypeSchema = z.enum([
|
|
|
431
726
|
"complementary",
|
|
432
727
|
"used-by"
|
|
433
728
|
]);
|
|
434
|
-
var componentRelationSchema =
|
|
435
|
-
component:
|
|
729
|
+
var componentRelationSchema = z3.object({
|
|
730
|
+
component: z3.string().min(1),
|
|
436
731
|
relationship: relationshipTypeSchema,
|
|
437
|
-
note:
|
|
732
|
+
note: z3.string().min(1)
|
|
438
733
|
});
|
|
439
|
-
var fragmentVariantSchema =
|
|
440
|
-
name:
|
|
441
|
-
description:
|
|
442
|
-
render:
|
|
443
|
-
code:
|
|
444
|
-
figma:
|
|
734
|
+
var fragmentVariantSchema = z3.object({
|
|
735
|
+
name: z3.string().min(1),
|
|
736
|
+
description: z3.string().min(1),
|
|
737
|
+
render: z3.function().returns(z3.unknown()),
|
|
738
|
+
code: z3.string().optional(),
|
|
739
|
+
figma: z3.string().url().optional()
|
|
445
740
|
});
|
|
446
|
-
var fragmentBanSchema =
|
|
447
|
-
pattern:
|
|
448
|
-
message:
|
|
741
|
+
var fragmentBanSchema = z3.object({
|
|
742
|
+
pattern: z3.string().min(1),
|
|
743
|
+
message: z3.string().min(1)
|
|
449
744
|
});
|
|
450
|
-
var fragmentContractSchema =
|
|
451
|
-
propsSummary:
|
|
452
|
-
a11yRules:
|
|
453
|
-
bans:
|
|
454
|
-
scenarioTags:
|
|
455
|
-
performanceBudget:
|
|
456
|
-
compoundChildren:
|
|
457
|
-
required:
|
|
458
|
-
accepts:
|
|
459
|
-
description:
|
|
745
|
+
var fragmentContractSchema = z3.object({
|
|
746
|
+
propsSummary: z3.array(z3.string()).optional(),
|
|
747
|
+
a11yRules: z3.array(z3.string()).optional(),
|
|
748
|
+
bans: z3.array(fragmentBanSchema).optional(),
|
|
749
|
+
scenarioTags: z3.array(z3.string()).optional(),
|
|
750
|
+
performanceBudget: z3.number().positive().optional(),
|
|
751
|
+
compoundChildren: z3.record(z3.object({
|
|
752
|
+
required: z3.boolean().optional(),
|
|
753
|
+
accepts: z3.array(z3.string()).optional(),
|
|
754
|
+
description: z3.string().optional()
|
|
460
755
|
})).optional(),
|
|
461
|
-
canonicalUsage:
|
|
756
|
+
canonicalUsage: z3.array(z3.string()).optional()
|
|
462
757
|
});
|
|
463
|
-
var fragmentGeneratedSchema =
|
|
464
|
-
source:
|
|
465
|
-
sourceFile:
|
|
466
|
-
confidence:
|
|
467
|
-
timestamp:
|
|
758
|
+
var fragmentGeneratedSchema = z3.object({
|
|
759
|
+
source: z3.enum(["storybook", "manual", "ai"]),
|
|
760
|
+
sourceFile: z3.string().optional(),
|
|
761
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
762
|
+
timestamp: z3.string().datetime().optional()
|
|
468
763
|
});
|
|
469
|
-
var aiMetadataSchema =
|
|
470
|
-
compositionPattern:
|
|
471
|
-
subComponents:
|
|
472
|
-
requiredChildren:
|
|
473
|
-
commonPatterns:
|
|
764
|
+
var aiMetadataSchema = z3.object({
|
|
765
|
+
compositionPattern: z3.enum(["compound", "simple", "controlled", "wrapper"]).optional(),
|
|
766
|
+
subComponents: z3.array(z3.string()).optional(),
|
|
767
|
+
requiredChildren: z3.array(z3.string()).optional(),
|
|
768
|
+
commonPatterns: z3.array(z3.string()).optional()
|
|
474
769
|
});
|
|
475
|
-
var blockDefinitionSchema =
|
|
476
|
-
name:
|
|
477
|
-
description:
|
|
478
|
-
category:
|
|
479
|
-
components:
|
|
480
|
-
code:
|
|
481
|
-
tags:
|
|
770
|
+
var blockDefinitionSchema = z3.object({
|
|
771
|
+
name: z3.string().min(1),
|
|
772
|
+
description: z3.string().min(1),
|
|
773
|
+
category: z3.string().min(1),
|
|
774
|
+
components: z3.array(z3.string().min(1)).min(1),
|
|
775
|
+
code: z3.string().min(1),
|
|
776
|
+
tags: z3.array(z3.string()).optional()
|
|
482
777
|
});
|
|
483
|
-
var fragmentDefinitionSchema =
|
|
484
|
-
component:
|
|
778
|
+
var fragmentDefinitionSchema = z3.object({
|
|
779
|
+
component: z3.any(),
|
|
485
780
|
// Allow any component type (function, class, forwardRef, etc.)
|
|
486
781
|
meta: fragmentMetaSchema,
|
|
487
782
|
usage: fragmentUsageSchema,
|
|
488
|
-
props:
|
|
489
|
-
relations:
|
|
490
|
-
variants:
|
|
783
|
+
props: z3.record(propDefinitionSchema),
|
|
784
|
+
relations: z3.array(componentRelationSchema).optional(),
|
|
785
|
+
variants: z3.array(fragmentVariantSchema),
|
|
491
786
|
// Allow empty variants array
|
|
492
787
|
contract: fragmentContractSchema.optional(),
|
|
493
788
|
ai: aiMetadataSchema.optional(),
|
|
494
789
|
_generated: fragmentGeneratedSchema.optional()
|
|
495
790
|
});
|
|
496
|
-
var fragmentsConfigSchema =
|
|
497
|
-
include:
|
|
498
|
-
exclude:
|
|
499
|
-
components:
|
|
500
|
-
outFile:
|
|
501
|
-
framework:
|
|
502
|
-
figmaFile:
|
|
503
|
-
figmaToken:
|
|
504
|
-
screenshots:
|
|
505
|
-
service:
|
|
506
|
-
registry:
|
|
507
|
-
tokens:
|
|
508
|
-
include:
|
|
791
|
+
var fragmentsConfigSchema = z3.object({
|
|
792
|
+
include: z3.array(z3.string()).min(1),
|
|
793
|
+
exclude: z3.array(z3.string()).optional(),
|
|
794
|
+
components: z3.array(z3.string()).optional(),
|
|
795
|
+
outFile: z3.string().optional(),
|
|
796
|
+
framework: z3.enum(["react", "vue", "svelte"]).optional(),
|
|
797
|
+
figmaFile: z3.string().url().optional(),
|
|
798
|
+
figmaToken: z3.string().optional(),
|
|
799
|
+
screenshots: z3.object({}).passthrough().optional(),
|
|
800
|
+
service: z3.object({}).passthrough().optional(),
|
|
801
|
+
registry: z3.object({}).passthrough().optional(),
|
|
802
|
+
tokens: z3.object({
|
|
803
|
+
include: z3.array(z3.string()).min(1)
|
|
509
804
|
}).passthrough().optional(),
|
|
510
|
-
snippets:
|
|
511
|
-
mode:
|
|
512
|
-
scope:
|
|
513
|
-
requireFullSnippet:
|
|
514
|
-
allowedExternalModules:
|
|
805
|
+
snippets: z3.object({
|
|
806
|
+
mode: z3.enum(["warn", "error"]).optional(),
|
|
807
|
+
scope: z3.enum(["snippet", "snippet+render"]).optional(),
|
|
808
|
+
requireFullSnippet: z3.boolean().optional(),
|
|
809
|
+
allowedExternalModules: z3.array(z3.string().min(1)).optional()
|
|
515
810
|
}).optional(),
|
|
516
|
-
performance:
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
preset:
|
|
520
|
-
budgets:
|
|
521
|
-
bundleSize:
|
|
811
|
+
performance: z3.union([
|
|
812
|
+
z3.enum(["strict", "standard", "relaxed"]),
|
|
813
|
+
z3.object({
|
|
814
|
+
preset: z3.enum(["strict", "standard", "relaxed"]).optional(),
|
|
815
|
+
budgets: z3.object({
|
|
816
|
+
bundleSize: z3.number().positive().optional()
|
|
522
817
|
}).optional()
|
|
523
818
|
})
|
|
524
819
|
]).optional(),
|
|
525
|
-
storybook:
|
|
526
|
-
exclude:
|
|
527
|
-
include:
|
|
528
|
-
excludeDeprecated:
|
|
529
|
-
excludeTests:
|
|
530
|
-
excludeSvgIcons:
|
|
531
|
-
excludeSubComponents:
|
|
820
|
+
storybook: z3.object({
|
|
821
|
+
exclude: z3.array(z3.string()).optional(),
|
|
822
|
+
include: z3.array(z3.string()).optional(),
|
|
823
|
+
excludeDeprecated: z3.boolean().optional(),
|
|
824
|
+
excludeTests: z3.boolean().optional(),
|
|
825
|
+
excludeSvgIcons: z3.boolean().optional(),
|
|
826
|
+
excludeSubComponents: z3.boolean().optional()
|
|
532
827
|
}).optional(),
|
|
533
|
-
govern:
|
|
534
|
-
extends:
|
|
535
|
-
rules:
|
|
536
|
-
agents:
|
|
537
|
-
rules:
|
|
828
|
+
govern: z3.object({
|
|
829
|
+
extends: z3.array(z3.string()).optional(),
|
|
830
|
+
rules: z3.record(z3.string(), z3.unknown()).optional(),
|
|
831
|
+
agents: z3.record(z3.string(), z3.object({
|
|
832
|
+
rules: z3.record(z3.string(), z3.unknown()).optional()
|
|
538
833
|
})).optional(),
|
|
539
|
-
audit:
|
|
540
|
-
runners:
|
|
834
|
+
audit: z3.object({}).passthrough().optional(),
|
|
835
|
+
runners: z3.record(z3.string(), z3.object({}).passthrough()).optional()
|
|
541
836
|
}).optional()
|
|
542
837
|
});
|
|
543
|
-
var compositionMetadataSchema =
|
|
544
|
-
pattern:
|
|
545
|
-
subComponents:
|
|
546
|
-
requiredChildren:
|
|
547
|
-
commonPatterns:
|
|
838
|
+
var compositionMetadataSchema = z3.object({
|
|
839
|
+
pattern: z3.enum(["compound", "simple", "controlled", "wrapper"]).optional(),
|
|
840
|
+
subComponents: z3.array(z3.string()).optional(),
|
|
841
|
+
requiredChildren: z3.array(z3.string()).optional(),
|
|
842
|
+
commonPatterns: z3.array(z3.string()).optional()
|
|
548
843
|
});
|
|
549
|
-
var fragmentProvenanceSchema =
|
|
550
|
-
source:
|
|
551
|
-
sourceFile:
|
|
552
|
-
confidence:
|
|
553
|
-
timestamp:
|
|
554
|
-
autoFields:
|
|
555
|
-
humanFields:
|
|
844
|
+
var fragmentProvenanceSchema = z3.object({
|
|
845
|
+
source: z3.enum(["storybook", "manual", "ai", "scan"]),
|
|
846
|
+
sourceFile: z3.string().optional(),
|
|
847
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
848
|
+
timestamp: z3.string().datetime().optional(),
|
|
849
|
+
autoFields: z3.array(z3.string()).optional(),
|
|
850
|
+
humanFields: z3.array(z3.string()).optional()
|
|
556
851
|
});
|
|
557
|
-
var fragmentDefinitionV2Schema =
|
|
558
|
-
component:
|
|
852
|
+
var fragmentDefinitionV2Schema = z3.object({
|
|
853
|
+
component: z3.any(),
|
|
559
854
|
meta: fragmentMetaSchema,
|
|
560
855
|
guidance: fragmentUsageSchema,
|
|
561
|
-
props:
|
|
562
|
-
relations:
|
|
563
|
-
examples:
|
|
856
|
+
props: z3.record(propDefinitionSchema),
|
|
857
|
+
relations: z3.array(componentRelationSchema).optional(),
|
|
858
|
+
examples: z3.array(fragmentVariantSchema),
|
|
564
859
|
composition: compositionMetadataSchema.optional(),
|
|
565
860
|
contract: fragmentContractSchema.optional(),
|
|
566
861
|
_provenance: fragmentProvenanceSchema.optional()
|
|
@@ -1739,7 +2034,7 @@ function parseDTCGFile(content, filePath) {
|
|
|
1739
2034
|
total: resolvedTokens.length
|
|
1740
2035
|
};
|
|
1741
2036
|
}
|
|
1742
|
-
var dtcgTokenTypeSchema =
|
|
2037
|
+
var dtcgTokenTypeSchema = z4.enum([
|
|
1743
2038
|
"color",
|
|
1744
2039
|
"dimension",
|
|
1745
2040
|
"fontFamily",
|
|
@@ -1754,159 +2049,159 @@ var dtcgTokenTypeSchema = z2.enum([
|
|
|
1754
2049
|
"gradient",
|
|
1755
2050
|
"typography"
|
|
1756
2051
|
]);
|
|
1757
|
-
var dtcgColorValueSchema =
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
colorSpace:
|
|
1761
|
-
components:
|
|
1762
|
-
hex:
|
|
1763
|
-
alpha:
|
|
2052
|
+
var dtcgColorValueSchema = z4.union([
|
|
2053
|
+
z4.string(),
|
|
2054
|
+
z4.object({
|
|
2055
|
+
colorSpace: z4.string().default("srgb"),
|
|
2056
|
+
components: z4.array(z4.number()),
|
|
2057
|
+
hex: z4.string().optional(),
|
|
2058
|
+
alpha: z4.number().optional()
|
|
1764
2059
|
})
|
|
1765
2060
|
]);
|
|
1766
|
-
var dtcgDimensionValueSchema =
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
value:
|
|
1770
|
-
unit:
|
|
2061
|
+
var dtcgDimensionValueSchema = z4.union([
|
|
2062
|
+
z4.string(),
|
|
2063
|
+
z4.object({
|
|
2064
|
+
value: z4.number(),
|
|
2065
|
+
unit: z4.enum(["px", "rem"])
|
|
1771
2066
|
})
|
|
1772
2067
|
]);
|
|
1773
|
-
var dtcgShadowValueSchema =
|
|
2068
|
+
var dtcgShadowValueSchema = z4.object({
|
|
1774
2069
|
color: dtcgColorValueSchema,
|
|
1775
2070
|
offsetX: dtcgDimensionValueSchema,
|
|
1776
2071
|
offsetY: dtcgDimensionValueSchema,
|
|
1777
2072
|
blur: dtcgDimensionValueSchema,
|
|
1778
2073
|
spread: dtcgDimensionValueSchema.optional(),
|
|
1779
|
-
inset:
|
|
2074
|
+
inset: z4.boolean().optional()
|
|
1780
2075
|
});
|
|
1781
|
-
var dtcgBorderValueSchema =
|
|
2076
|
+
var dtcgBorderValueSchema = z4.object({
|
|
1782
2077
|
color: dtcgColorValueSchema,
|
|
1783
2078
|
width: dtcgDimensionValueSchema,
|
|
1784
|
-
style:
|
|
2079
|
+
style: z4.string()
|
|
1785
2080
|
});
|
|
1786
|
-
var dtcgTypographyValueSchema =
|
|
1787
|
-
fontFamily:
|
|
2081
|
+
var dtcgTypographyValueSchema = z4.object({
|
|
2082
|
+
fontFamily: z4.union([z4.string(), z4.array(z4.string())]),
|
|
1788
2083
|
fontSize: dtcgDimensionValueSchema,
|
|
1789
|
-
fontWeight:
|
|
2084
|
+
fontWeight: z4.union([z4.number(), z4.string()]),
|
|
1790
2085
|
letterSpacing: dtcgDimensionValueSchema.optional(),
|
|
1791
|
-
lineHeight:
|
|
2086
|
+
lineHeight: z4.union([z4.string(), z4.number()]).optional()
|
|
1792
2087
|
});
|
|
1793
|
-
var dtcgTransitionValueSchema =
|
|
1794
|
-
duration:
|
|
1795
|
-
delay:
|
|
1796
|
-
timingFunction:
|
|
2088
|
+
var dtcgTransitionValueSchema = z4.object({
|
|
2089
|
+
duration: z4.string(),
|
|
2090
|
+
delay: z4.string().optional(),
|
|
2091
|
+
timingFunction: z4.array(z4.number()).length(4)
|
|
1797
2092
|
});
|
|
1798
|
-
var dtcgGradientStopSchema =
|
|
2093
|
+
var dtcgGradientStopSchema = z4.object({
|
|
1799
2094
|
color: dtcgColorValueSchema,
|
|
1800
|
-
position:
|
|
2095
|
+
position: z4.number()
|
|
1801
2096
|
});
|
|
1802
|
-
var dtcgCubicBezierValueSchema =
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
2097
|
+
var dtcgCubicBezierValueSchema = z4.tuple([
|
|
2098
|
+
z4.number(),
|
|
2099
|
+
z4.number(),
|
|
2100
|
+
z4.number(),
|
|
2101
|
+
z4.number()
|
|
1807
2102
|
]);
|
|
1808
|
-
var dtcgTokenSchema =
|
|
1809
|
-
$value:
|
|
2103
|
+
var dtcgTokenSchema = z4.object({
|
|
2104
|
+
$value: z4.unknown(),
|
|
1810
2105
|
$type: dtcgTokenTypeSchema.optional(),
|
|
1811
|
-
$description:
|
|
1812
|
-
$deprecated:
|
|
1813
|
-
$extensions:
|
|
2106
|
+
$description: z4.string().optional(),
|
|
2107
|
+
$deprecated: z4.union([z4.boolean(), z4.string()]).optional(),
|
|
2108
|
+
$extensions: z4.record(z4.string(), z4.unknown()).optional()
|
|
1814
2109
|
}).passthrough();
|
|
1815
|
-
var dtcgTokenFileSchema =
|
|
2110
|
+
var dtcgTokenFileSchema = z4.record(z4.string(), z4.unknown()).refine(
|
|
1816
2111
|
(data) => {
|
|
1817
2112
|
return data !== null && typeof data === "object" && !Array.isArray(data);
|
|
1818
2113
|
},
|
|
1819
2114
|
{ message: "DTCG token file must be a JSON object" }
|
|
1820
2115
|
);
|
|
1821
|
-
var contractPropSchema =
|
|
1822
|
-
type:
|
|
1823
|
-
values:
|
|
1824
|
-
default:
|
|
1825
|
-
description:
|
|
1826
|
-
required:
|
|
1827
|
-
constraints:
|
|
2116
|
+
var contractPropSchema = z5.object({
|
|
2117
|
+
type: z5.string(),
|
|
2118
|
+
values: z5.array(z5.string()).optional(),
|
|
2119
|
+
default: z5.unknown().optional(),
|
|
2120
|
+
description: z5.string(),
|
|
2121
|
+
required: z5.boolean().optional(),
|
|
2122
|
+
constraints: z5.array(z5.string()).optional()
|
|
1828
2123
|
});
|
|
1829
|
-
var contractUsageSchema =
|
|
1830
|
-
when:
|
|
1831
|
-
whenNot:
|
|
1832
|
-
guidelines:
|
|
1833
|
-
accessibility:
|
|
2124
|
+
var contractUsageSchema = z5.object({
|
|
2125
|
+
when: z5.array(z5.string()),
|
|
2126
|
+
whenNot: z5.array(z5.string()),
|
|
2127
|
+
guidelines: z5.array(z5.string()).optional(),
|
|
2128
|
+
accessibility: z5.array(z5.string()).optional()
|
|
1834
2129
|
});
|
|
1835
|
-
var contractExampleSchema =
|
|
1836
|
-
name:
|
|
1837
|
-
description:
|
|
1838
|
-
code:
|
|
1839
|
-
args:
|
|
2130
|
+
var contractExampleSchema = z5.object({
|
|
2131
|
+
name: z5.string(),
|
|
2132
|
+
description: z5.string(),
|
|
2133
|
+
code: z5.string(),
|
|
2134
|
+
args: z5.record(z5.string(), z5.unknown()).optional()
|
|
1840
2135
|
});
|
|
1841
|
-
var contractRelationSchema =
|
|
1842
|
-
component:
|
|
1843
|
-
relationship:
|
|
1844
|
-
note:
|
|
2136
|
+
var contractRelationSchema = z5.object({
|
|
2137
|
+
component: z5.string(),
|
|
2138
|
+
relationship: z5.enum(["alternative", "parent", "child", "sibling", "composition", "complementary", "used-by"]),
|
|
2139
|
+
note: z5.string()
|
|
1845
2140
|
});
|
|
1846
|
-
var contractContractSchema =
|
|
1847
|
-
propsSummary:
|
|
1848
|
-
scenarioTags:
|
|
1849
|
-
a11yRules:
|
|
1850
|
-
bans:
|
|
1851
|
-
pattern:
|
|
1852
|
-
message:
|
|
2141
|
+
var contractContractSchema = z5.object({
|
|
2142
|
+
propsSummary: z5.array(z5.string()).optional(),
|
|
2143
|
+
scenarioTags: z5.array(z5.string()).optional(),
|
|
2144
|
+
a11yRules: z5.array(z5.string()).optional(),
|
|
2145
|
+
bans: z5.array(z5.object({
|
|
2146
|
+
pattern: z5.string(),
|
|
2147
|
+
message: z5.string()
|
|
1853
2148
|
})).optional(),
|
|
1854
|
-
compoundChildren:
|
|
1855
|
-
required:
|
|
1856
|
-
accepts:
|
|
1857
|
-
description:
|
|
2149
|
+
compoundChildren: z5.record(z5.string(), z5.object({
|
|
2150
|
+
required: z5.boolean().optional(),
|
|
2151
|
+
accepts: z5.array(z5.string()).optional(),
|
|
2152
|
+
description: z5.string().optional()
|
|
1858
2153
|
})).optional(),
|
|
1859
|
-
canonicalUsage:
|
|
1860
|
-
performanceBudget:
|
|
2154
|
+
canonicalUsage: z5.array(z5.string()).optional(),
|
|
2155
|
+
performanceBudget: z5.number().optional()
|
|
1861
2156
|
});
|
|
1862
|
-
var contractAiSchema =
|
|
1863
|
-
compositionPattern:
|
|
1864
|
-
subComponents:
|
|
1865
|
-
requiredChildren:
|
|
1866
|
-
commonPatterns:
|
|
2157
|
+
var contractAiSchema = z5.object({
|
|
2158
|
+
compositionPattern: z5.enum(["compound", "simple", "controlled", "wrapper"]).optional(),
|
|
2159
|
+
subComponents: z5.array(z5.string()).optional(),
|
|
2160
|
+
requiredChildren: z5.array(z5.string()).optional(),
|
|
2161
|
+
commonPatterns: z5.array(z5.string()).optional()
|
|
1867
2162
|
});
|
|
1868
|
-
var contractPreviewSchema =
|
|
1869
|
-
setupModule:
|
|
1870
|
-
wrapperModule:
|
|
1871
|
-
wrapperExport:
|
|
1872
|
-
css:
|
|
1873
|
-
theme:
|
|
2163
|
+
var contractPreviewSchema = z5.object({
|
|
2164
|
+
setupModule: z5.string().optional(),
|
|
2165
|
+
wrapperModule: z5.string().optional(),
|
|
2166
|
+
wrapperExport: z5.string().optional(),
|
|
2167
|
+
css: z5.array(z5.string()).optional(),
|
|
2168
|
+
theme: z5.enum(["light", "dark"]).optional()
|
|
1874
2169
|
});
|
|
1875
|
-
var contractProvenanceSchema =
|
|
1876
|
-
source:
|
|
1877
|
-
verified:
|
|
1878
|
-
frameworkSupport:
|
|
1879
|
-
sourceHash:
|
|
1880
|
-
extractedAt:
|
|
2170
|
+
var contractProvenanceSchema = z5.object({
|
|
2171
|
+
source: z5.enum(["manual", "extracted", "merged", "migrated"]),
|
|
2172
|
+
verified: z5.boolean(),
|
|
2173
|
+
frameworkSupport: z5.enum(["native", "manual-only"]).optional(),
|
|
2174
|
+
sourceHash: z5.string().optional(),
|
|
2175
|
+
extractedAt: z5.string().optional()
|
|
1881
2176
|
});
|
|
1882
|
-
var contractFigmaSchema =
|
|
1883
|
-
nodeUrl:
|
|
1884
|
-
propMappings:
|
|
1885
|
-
type:
|
|
1886
|
-
figmaProperty:
|
|
1887
|
-
values:
|
|
2177
|
+
var contractFigmaSchema = z5.object({
|
|
2178
|
+
nodeUrl: z5.string().optional(),
|
|
2179
|
+
propMappings: z5.record(z5.string(), z5.object({
|
|
2180
|
+
type: z5.enum(["string", "boolean", "enum", "instance", "children", "textContent"]),
|
|
2181
|
+
figmaProperty: z5.string(),
|
|
2182
|
+
values: z5.record(z5.string(), z5.string()).optional()
|
|
1888
2183
|
})).optional()
|
|
1889
2184
|
});
|
|
1890
|
-
var componentContractSchema =
|
|
1891
|
-
$schema:
|
|
1892
|
-
name:
|
|
1893
|
-
description:
|
|
1894
|
-
category:
|
|
1895
|
-
tags:
|
|
1896
|
-
status:
|
|
1897
|
-
framework:
|
|
1898
|
-
sourcePath:
|
|
1899
|
-
exportName:
|
|
1900
|
-
propsSummary:
|
|
1901
|
-
props:
|
|
2185
|
+
var componentContractSchema = z5.object({
|
|
2186
|
+
$schema: z5.string(),
|
|
2187
|
+
name: z5.string(),
|
|
2188
|
+
description: z5.string(),
|
|
2189
|
+
category: z5.string(),
|
|
2190
|
+
tags: z5.array(z5.string()).optional(),
|
|
2191
|
+
status: z5.enum(["stable", "beta", "deprecated", "experimental"]).optional(),
|
|
2192
|
+
framework: z5.enum(["react", "vue", "svelte", "web-components", "angular"]).optional(),
|
|
2193
|
+
sourcePath: z5.string(),
|
|
2194
|
+
exportName: z5.string(),
|
|
2195
|
+
propsSummary: z5.array(z5.string()),
|
|
2196
|
+
props: z5.record(z5.string(), contractPropSchema),
|
|
1902
2197
|
usage: contractUsageSchema,
|
|
1903
|
-
examples:
|
|
1904
|
-
relations:
|
|
2198
|
+
examples: z5.array(contractExampleSchema).optional(),
|
|
2199
|
+
relations: z5.array(contractRelationSchema).optional(),
|
|
1905
2200
|
contract: contractContractSchema.optional(),
|
|
1906
2201
|
ai: contractAiSchema.optional(),
|
|
1907
2202
|
preview: contractPreviewSchema.optional(),
|
|
1908
2203
|
provenance: contractProvenanceSchema,
|
|
1909
|
-
tokens:
|
|
2204
|
+
tokens: z5.array(z5.string()).optional(),
|
|
1910
2205
|
figma: contractFigmaSchema.optional()
|
|
1911
2206
|
});
|
|
1912
2207
|
function isContractFile(filePath) {
|
|
@@ -2459,6 +2754,32 @@ export {
|
|
|
2459
2754
|
classifyComplexity,
|
|
2460
2755
|
formatBytes,
|
|
2461
2756
|
budgetBar,
|
|
2757
|
+
bundleSchemaVersionSchema,
|
|
2758
|
+
bundleTargetSchema,
|
|
2759
|
+
bundleArtifactMetadataSchema,
|
|
2760
|
+
bundleManifestComponentEntrySchema,
|
|
2761
|
+
bundleManifestSchema,
|
|
2762
|
+
bundleTokenFileSchema,
|
|
2763
|
+
bundleComponentShardSchema,
|
|
2764
|
+
mcpSnapshotSchemaVersionSchema,
|
|
2765
|
+
mcpSourceTypeSchema,
|
|
2766
|
+
mcpCapabilitySchema,
|
|
2767
|
+
mcpPerformanceImportSchema,
|
|
2768
|
+
mcpPerformanceDataSchema,
|
|
2769
|
+
mcpPerformanceSummarySchema,
|
|
2770
|
+
mcpComponentPropSchema,
|
|
2771
|
+
mcpComponentExampleSchema,
|
|
2772
|
+
mcpComponentRelationSchema,
|
|
2773
|
+
mcpCompoundChildSchema,
|
|
2774
|
+
mcpGuidancePatternSchema,
|
|
2775
|
+
mcpComponentGuidanceSchema,
|
|
2776
|
+
mcpComponentMetadataSchema,
|
|
2777
|
+
mcpComponentSchema,
|
|
2778
|
+
mcpBlockSchema,
|
|
2779
|
+
mcpTokenSchema,
|
|
2780
|
+
mcpTokenDataSchema,
|
|
2781
|
+
mcpSnapshotMetadataSchema,
|
|
2782
|
+
mcpSnapshotSchema,
|
|
2462
2783
|
DEFAULT_STYLE_PROPERTIES,
|
|
2463
2784
|
DEFAULT_ENHANCED_STYLE_PROPERTIES,
|
|
2464
2785
|
normalizeStyleValue,
|
|
@@ -2527,4 +2848,4 @@ export {
|
|
|
2527
2848
|
isReactComponent,
|
|
2528
2849
|
discoverComponents
|
|
2529
2850
|
};
|
|
2530
|
-
//# sourceMappingURL=chunk-
|
|
2851
|
+
//# sourceMappingURL=chunk-SJFSG7QF.js.map
|