@getcoherent/core 0.1.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 (3) hide show
  1. package/dist/index.d.ts +4297 -0
  2. package/dist/index.js +8638 -0
  3. package/package.json +52 -0
@@ -0,0 +1,4297 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Design System Configuration Types
5
+ *
6
+ * This is the core type system for the entire Coherent project.
7
+ * The DesignSystemConfig is the single source of truth for all UI generation.
8
+ *
9
+ * Philosophy:
10
+ * - Config is machine-readable (not human prose like PRD)
11
+ * - Changes to config cascade automatically through all components/pages
12
+ * - Validation happens at config level via Zod schemas
13
+ * - Config is versionable and git-friendly
14
+ */
15
+
16
+ /**
17
+ * Color palette with semantic naming
18
+ * Supports light/dark modes
19
+ */
20
+ declare const ColorTokenSchema: z.ZodObject<{
21
+ primary: z.ZodString;
22
+ secondary: z.ZodString;
23
+ accent: z.ZodOptional<z.ZodString>;
24
+ success: z.ZodString;
25
+ warning: z.ZodString;
26
+ error: z.ZodString;
27
+ info: z.ZodString;
28
+ background: z.ZodString;
29
+ foreground: z.ZodString;
30
+ muted: z.ZodString;
31
+ border: z.ZodString;
32
+ }, "strip", z.ZodTypeAny, {
33
+ primary: string;
34
+ secondary: string;
35
+ success: string;
36
+ warning: string;
37
+ error: string;
38
+ info: string;
39
+ background: string;
40
+ foreground: string;
41
+ muted: string;
42
+ border: string;
43
+ accent?: string | undefined;
44
+ }, {
45
+ primary: string;
46
+ secondary: string;
47
+ success: string;
48
+ warning: string;
49
+ error: string;
50
+ info: string;
51
+ background: string;
52
+ foreground: string;
53
+ muted: string;
54
+ border: string;
55
+ accent?: string | undefined;
56
+ }>;
57
+ type ColorToken = z.infer<typeof ColorTokenSchema>;
58
+ /**
59
+ * Spacing scale (8pt grid system)
60
+ */
61
+ declare const SpacingTokenSchema: z.ZodObject<{
62
+ xs: z.ZodDefault<z.ZodString>;
63
+ sm: z.ZodDefault<z.ZodString>;
64
+ md: z.ZodDefault<z.ZodString>;
65
+ lg: z.ZodDefault<z.ZodString>;
66
+ xl: z.ZodDefault<z.ZodString>;
67
+ '2xl': z.ZodDefault<z.ZodString>;
68
+ '3xl': z.ZodDefault<z.ZodString>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ xs: string;
71
+ sm: string;
72
+ md: string;
73
+ lg: string;
74
+ xl: string;
75
+ '2xl': string;
76
+ '3xl': string;
77
+ }, {
78
+ xs?: string | undefined;
79
+ sm?: string | undefined;
80
+ md?: string | undefined;
81
+ lg?: string | undefined;
82
+ xl?: string | undefined;
83
+ '2xl'?: string | undefined;
84
+ '3xl'?: string | undefined;
85
+ }>;
86
+ type SpacingToken = z.infer<typeof SpacingTokenSchema>;
87
+ /**
88
+ * Typography scale
89
+ */
90
+ declare const TypographyTokenSchema: z.ZodObject<{
91
+ fontFamily: z.ZodObject<{
92
+ sans: z.ZodDefault<z.ZodString>;
93
+ mono: z.ZodDefault<z.ZodString>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ sans: string;
96
+ mono: string;
97
+ }, {
98
+ sans?: string | undefined;
99
+ mono?: string | undefined;
100
+ }>;
101
+ fontSize: z.ZodObject<{
102
+ xs: z.ZodDefault<z.ZodString>;
103
+ sm: z.ZodDefault<z.ZodString>;
104
+ base: z.ZodDefault<z.ZodString>;
105
+ lg: z.ZodDefault<z.ZodString>;
106
+ xl: z.ZodDefault<z.ZodString>;
107
+ '2xl': z.ZodDefault<z.ZodString>;
108
+ '3xl': z.ZodDefault<z.ZodString>;
109
+ '4xl': z.ZodDefault<z.ZodString>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ xs: string;
112
+ sm: string;
113
+ lg: string;
114
+ xl: string;
115
+ '2xl': string;
116
+ '3xl': string;
117
+ base: string;
118
+ '4xl': string;
119
+ }, {
120
+ xs?: string | undefined;
121
+ sm?: string | undefined;
122
+ lg?: string | undefined;
123
+ xl?: string | undefined;
124
+ '2xl'?: string | undefined;
125
+ '3xl'?: string | undefined;
126
+ base?: string | undefined;
127
+ '4xl'?: string | undefined;
128
+ }>;
129
+ fontWeight: z.ZodObject<{
130
+ normal: z.ZodDefault<z.ZodNumber>;
131
+ medium: z.ZodDefault<z.ZodNumber>;
132
+ semibold: z.ZodDefault<z.ZodNumber>;
133
+ bold: z.ZodDefault<z.ZodNumber>;
134
+ }, "strip", z.ZodTypeAny, {
135
+ normal: number;
136
+ medium: number;
137
+ semibold: number;
138
+ bold: number;
139
+ }, {
140
+ normal?: number | undefined;
141
+ medium?: number | undefined;
142
+ semibold?: number | undefined;
143
+ bold?: number | undefined;
144
+ }>;
145
+ lineHeight: z.ZodObject<{
146
+ tight: z.ZodDefault<z.ZodNumber>;
147
+ normal: z.ZodDefault<z.ZodNumber>;
148
+ relaxed: z.ZodDefault<z.ZodNumber>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ normal: number;
151
+ tight: number;
152
+ relaxed: number;
153
+ }, {
154
+ normal?: number | undefined;
155
+ tight?: number | undefined;
156
+ relaxed?: number | undefined;
157
+ }>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ fontFamily: {
160
+ sans: string;
161
+ mono: string;
162
+ };
163
+ fontSize: {
164
+ xs: string;
165
+ sm: string;
166
+ lg: string;
167
+ xl: string;
168
+ '2xl': string;
169
+ '3xl': string;
170
+ base: string;
171
+ '4xl': string;
172
+ };
173
+ fontWeight: {
174
+ normal: number;
175
+ medium: number;
176
+ semibold: number;
177
+ bold: number;
178
+ };
179
+ lineHeight: {
180
+ normal: number;
181
+ tight: number;
182
+ relaxed: number;
183
+ };
184
+ }, {
185
+ fontFamily: {
186
+ sans?: string | undefined;
187
+ mono?: string | undefined;
188
+ };
189
+ fontSize: {
190
+ xs?: string | undefined;
191
+ sm?: string | undefined;
192
+ lg?: string | undefined;
193
+ xl?: string | undefined;
194
+ '2xl'?: string | undefined;
195
+ '3xl'?: string | undefined;
196
+ base?: string | undefined;
197
+ '4xl'?: string | undefined;
198
+ };
199
+ fontWeight: {
200
+ normal?: number | undefined;
201
+ medium?: number | undefined;
202
+ semibold?: number | undefined;
203
+ bold?: number | undefined;
204
+ };
205
+ lineHeight: {
206
+ normal?: number | undefined;
207
+ tight?: number | undefined;
208
+ relaxed?: number | undefined;
209
+ };
210
+ }>;
211
+ type TypographyToken = z.infer<typeof TypographyTokenSchema>;
212
+ /**
213
+ * Border radius tokens
214
+ */
215
+ declare const RadiusTokenSchema: z.ZodObject<{
216
+ none: z.ZodDefault<z.ZodString>;
217
+ sm: z.ZodDefault<z.ZodString>;
218
+ md: z.ZodDefault<z.ZodString>;
219
+ lg: z.ZodDefault<z.ZodString>;
220
+ xl: z.ZodDefault<z.ZodString>;
221
+ full: z.ZodDefault<z.ZodString>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ sm: string;
224
+ md: string;
225
+ lg: string;
226
+ xl: string;
227
+ none: string;
228
+ full: string;
229
+ }, {
230
+ sm?: string | undefined;
231
+ md?: string | undefined;
232
+ lg?: string | undefined;
233
+ xl?: string | undefined;
234
+ none?: string | undefined;
235
+ full?: string | undefined;
236
+ }>;
237
+ type RadiusToken = z.infer<typeof RadiusTokenSchema>;
238
+ /**
239
+ * All design tokens grouped
240
+ */
241
+ declare const DesignTokensSchema: z.ZodObject<{
242
+ colors: z.ZodObject<{
243
+ light: z.ZodObject<{
244
+ primary: z.ZodString;
245
+ secondary: z.ZodString;
246
+ accent: z.ZodOptional<z.ZodString>;
247
+ success: z.ZodString;
248
+ warning: z.ZodString;
249
+ error: z.ZodString;
250
+ info: z.ZodString;
251
+ background: z.ZodString;
252
+ foreground: z.ZodString;
253
+ muted: z.ZodString;
254
+ border: z.ZodString;
255
+ }, "strip", z.ZodTypeAny, {
256
+ primary: string;
257
+ secondary: string;
258
+ success: string;
259
+ warning: string;
260
+ error: string;
261
+ info: string;
262
+ background: string;
263
+ foreground: string;
264
+ muted: string;
265
+ border: string;
266
+ accent?: string | undefined;
267
+ }, {
268
+ primary: string;
269
+ secondary: string;
270
+ success: string;
271
+ warning: string;
272
+ error: string;
273
+ info: string;
274
+ background: string;
275
+ foreground: string;
276
+ muted: string;
277
+ border: string;
278
+ accent?: string | undefined;
279
+ }>;
280
+ dark: z.ZodObject<{
281
+ primary: z.ZodString;
282
+ secondary: z.ZodString;
283
+ accent: z.ZodOptional<z.ZodString>;
284
+ success: z.ZodString;
285
+ warning: z.ZodString;
286
+ error: z.ZodString;
287
+ info: z.ZodString;
288
+ background: z.ZodString;
289
+ foreground: z.ZodString;
290
+ muted: z.ZodString;
291
+ border: z.ZodString;
292
+ }, "strip", z.ZodTypeAny, {
293
+ primary: string;
294
+ secondary: string;
295
+ success: string;
296
+ warning: string;
297
+ error: string;
298
+ info: string;
299
+ background: string;
300
+ foreground: string;
301
+ muted: string;
302
+ border: string;
303
+ accent?: string | undefined;
304
+ }, {
305
+ primary: string;
306
+ secondary: string;
307
+ success: string;
308
+ warning: string;
309
+ error: string;
310
+ info: string;
311
+ background: string;
312
+ foreground: string;
313
+ muted: string;
314
+ border: string;
315
+ accent?: string | undefined;
316
+ }>;
317
+ }, "strip", z.ZodTypeAny, {
318
+ light: {
319
+ primary: string;
320
+ secondary: string;
321
+ success: string;
322
+ warning: string;
323
+ error: string;
324
+ info: string;
325
+ background: string;
326
+ foreground: string;
327
+ muted: string;
328
+ border: string;
329
+ accent?: string | undefined;
330
+ };
331
+ dark: {
332
+ primary: string;
333
+ secondary: string;
334
+ success: string;
335
+ warning: string;
336
+ error: string;
337
+ info: string;
338
+ background: string;
339
+ foreground: string;
340
+ muted: string;
341
+ border: string;
342
+ accent?: string | undefined;
343
+ };
344
+ }, {
345
+ light: {
346
+ primary: string;
347
+ secondary: string;
348
+ success: string;
349
+ warning: string;
350
+ error: string;
351
+ info: string;
352
+ background: string;
353
+ foreground: string;
354
+ muted: string;
355
+ border: string;
356
+ accent?: string | undefined;
357
+ };
358
+ dark: {
359
+ primary: string;
360
+ secondary: string;
361
+ success: string;
362
+ warning: string;
363
+ error: string;
364
+ info: string;
365
+ background: string;
366
+ foreground: string;
367
+ muted: string;
368
+ border: string;
369
+ accent?: string | undefined;
370
+ };
371
+ }>;
372
+ spacing: z.ZodObject<{
373
+ xs: z.ZodDefault<z.ZodString>;
374
+ sm: z.ZodDefault<z.ZodString>;
375
+ md: z.ZodDefault<z.ZodString>;
376
+ lg: z.ZodDefault<z.ZodString>;
377
+ xl: z.ZodDefault<z.ZodString>;
378
+ '2xl': z.ZodDefault<z.ZodString>;
379
+ '3xl': z.ZodDefault<z.ZodString>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ xs: string;
382
+ sm: string;
383
+ md: string;
384
+ lg: string;
385
+ xl: string;
386
+ '2xl': string;
387
+ '3xl': string;
388
+ }, {
389
+ xs?: string | undefined;
390
+ sm?: string | undefined;
391
+ md?: string | undefined;
392
+ lg?: string | undefined;
393
+ xl?: string | undefined;
394
+ '2xl'?: string | undefined;
395
+ '3xl'?: string | undefined;
396
+ }>;
397
+ typography: z.ZodObject<{
398
+ fontFamily: z.ZodObject<{
399
+ sans: z.ZodDefault<z.ZodString>;
400
+ mono: z.ZodDefault<z.ZodString>;
401
+ }, "strip", z.ZodTypeAny, {
402
+ sans: string;
403
+ mono: string;
404
+ }, {
405
+ sans?: string | undefined;
406
+ mono?: string | undefined;
407
+ }>;
408
+ fontSize: z.ZodObject<{
409
+ xs: z.ZodDefault<z.ZodString>;
410
+ sm: z.ZodDefault<z.ZodString>;
411
+ base: z.ZodDefault<z.ZodString>;
412
+ lg: z.ZodDefault<z.ZodString>;
413
+ xl: z.ZodDefault<z.ZodString>;
414
+ '2xl': z.ZodDefault<z.ZodString>;
415
+ '3xl': z.ZodDefault<z.ZodString>;
416
+ '4xl': z.ZodDefault<z.ZodString>;
417
+ }, "strip", z.ZodTypeAny, {
418
+ xs: string;
419
+ sm: string;
420
+ lg: string;
421
+ xl: string;
422
+ '2xl': string;
423
+ '3xl': string;
424
+ base: string;
425
+ '4xl': string;
426
+ }, {
427
+ xs?: string | undefined;
428
+ sm?: string | undefined;
429
+ lg?: string | undefined;
430
+ xl?: string | undefined;
431
+ '2xl'?: string | undefined;
432
+ '3xl'?: string | undefined;
433
+ base?: string | undefined;
434
+ '4xl'?: string | undefined;
435
+ }>;
436
+ fontWeight: z.ZodObject<{
437
+ normal: z.ZodDefault<z.ZodNumber>;
438
+ medium: z.ZodDefault<z.ZodNumber>;
439
+ semibold: z.ZodDefault<z.ZodNumber>;
440
+ bold: z.ZodDefault<z.ZodNumber>;
441
+ }, "strip", z.ZodTypeAny, {
442
+ normal: number;
443
+ medium: number;
444
+ semibold: number;
445
+ bold: number;
446
+ }, {
447
+ normal?: number | undefined;
448
+ medium?: number | undefined;
449
+ semibold?: number | undefined;
450
+ bold?: number | undefined;
451
+ }>;
452
+ lineHeight: z.ZodObject<{
453
+ tight: z.ZodDefault<z.ZodNumber>;
454
+ normal: z.ZodDefault<z.ZodNumber>;
455
+ relaxed: z.ZodDefault<z.ZodNumber>;
456
+ }, "strip", z.ZodTypeAny, {
457
+ normal: number;
458
+ tight: number;
459
+ relaxed: number;
460
+ }, {
461
+ normal?: number | undefined;
462
+ tight?: number | undefined;
463
+ relaxed?: number | undefined;
464
+ }>;
465
+ }, "strip", z.ZodTypeAny, {
466
+ fontFamily: {
467
+ sans: string;
468
+ mono: string;
469
+ };
470
+ fontSize: {
471
+ xs: string;
472
+ sm: string;
473
+ lg: string;
474
+ xl: string;
475
+ '2xl': string;
476
+ '3xl': string;
477
+ base: string;
478
+ '4xl': string;
479
+ };
480
+ fontWeight: {
481
+ normal: number;
482
+ medium: number;
483
+ semibold: number;
484
+ bold: number;
485
+ };
486
+ lineHeight: {
487
+ normal: number;
488
+ tight: number;
489
+ relaxed: number;
490
+ };
491
+ }, {
492
+ fontFamily: {
493
+ sans?: string | undefined;
494
+ mono?: string | undefined;
495
+ };
496
+ fontSize: {
497
+ xs?: string | undefined;
498
+ sm?: string | undefined;
499
+ lg?: string | undefined;
500
+ xl?: string | undefined;
501
+ '2xl'?: string | undefined;
502
+ '3xl'?: string | undefined;
503
+ base?: string | undefined;
504
+ '4xl'?: string | undefined;
505
+ };
506
+ fontWeight: {
507
+ normal?: number | undefined;
508
+ medium?: number | undefined;
509
+ semibold?: number | undefined;
510
+ bold?: number | undefined;
511
+ };
512
+ lineHeight: {
513
+ normal?: number | undefined;
514
+ tight?: number | undefined;
515
+ relaxed?: number | undefined;
516
+ };
517
+ }>;
518
+ radius: z.ZodObject<{
519
+ none: z.ZodDefault<z.ZodString>;
520
+ sm: z.ZodDefault<z.ZodString>;
521
+ md: z.ZodDefault<z.ZodString>;
522
+ lg: z.ZodDefault<z.ZodString>;
523
+ xl: z.ZodDefault<z.ZodString>;
524
+ full: z.ZodDefault<z.ZodString>;
525
+ }, "strip", z.ZodTypeAny, {
526
+ sm: string;
527
+ md: string;
528
+ lg: string;
529
+ xl: string;
530
+ none: string;
531
+ full: string;
532
+ }, {
533
+ sm?: string | undefined;
534
+ md?: string | undefined;
535
+ lg?: string | undefined;
536
+ xl?: string | undefined;
537
+ none?: string | undefined;
538
+ full?: string | undefined;
539
+ }>;
540
+ }, "strip", z.ZodTypeAny, {
541
+ colors: {
542
+ light: {
543
+ primary: string;
544
+ secondary: string;
545
+ success: string;
546
+ warning: string;
547
+ error: string;
548
+ info: string;
549
+ background: string;
550
+ foreground: string;
551
+ muted: string;
552
+ border: string;
553
+ accent?: string | undefined;
554
+ };
555
+ dark: {
556
+ primary: string;
557
+ secondary: string;
558
+ success: string;
559
+ warning: string;
560
+ error: string;
561
+ info: string;
562
+ background: string;
563
+ foreground: string;
564
+ muted: string;
565
+ border: string;
566
+ accent?: string | undefined;
567
+ };
568
+ };
569
+ spacing: {
570
+ xs: string;
571
+ sm: string;
572
+ md: string;
573
+ lg: string;
574
+ xl: string;
575
+ '2xl': string;
576
+ '3xl': string;
577
+ };
578
+ typography: {
579
+ fontFamily: {
580
+ sans: string;
581
+ mono: string;
582
+ };
583
+ fontSize: {
584
+ xs: string;
585
+ sm: string;
586
+ lg: string;
587
+ xl: string;
588
+ '2xl': string;
589
+ '3xl': string;
590
+ base: string;
591
+ '4xl': string;
592
+ };
593
+ fontWeight: {
594
+ normal: number;
595
+ medium: number;
596
+ semibold: number;
597
+ bold: number;
598
+ };
599
+ lineHeight: {
600
+ normal: number;
601
+ tight: number;
602
+ relaxed: number;
603
+ };
604
+ };
605
+ radius: {
606
+ sm: string;
607
+ md: string;
608
+ lg: string;
609
+ xl: string;
610
+ none: string;
611
+ full: string;
612
+ };
613
+ }, {
614
+ colors: {
615
+ light: {
616
+ primary: string;
617
+ secondary: string;
618
+ success: string;
619
+ warning: string;
620
+ error: string;
621
+ info: string;
622
+ background: string;
623
+ foreground: string;
624
+ muted: string;
625
+ border: string;
626
+ accent?: string | undefined;
627
+ };
628
+ dark: {
629
+ primary: string;
630
+ secondary: string;
631
+ success: string;
632
+ warning: string;
633
+ error: string;
634
+ info: string;
635
+ background: string;
636
+ foreground: string;
637
+ muted: string;
638
+ border: string;
639
+ accent?: string | undefined;
640
+ };
641
+ };
642
+ spacing: {
643
+ xs?: string | undefined;
644
+ sm?: string | undefined;
645
+ md?: string | undefined;
646
+ lg?: string | undefined;
647
+ xl?: string | undefined;
648
+ '2xl'?: string | undefined;
649
+ '3xl'?: string | undefined;
650
+ };
651
+ typography: {
652
+ fontFamily: {
653
+ sans?: string | undefined;
654
+ mono?: string | undefined;
655
+ };
656
+ fontSize: {
657
+ xs?: string | undefined;
658
+ sm?: string | undefined;
659
+ lg?: string | undefined;
660
+ xl?: string | undefined;
661
+ '2xl'?: string | undefined;
662
+ '3xl'?: string | undefined;
663
+ base?: string | undefined;
664
+ '4xl'?: string | undefined;
665
+ };
666
+ fontWeight: {
667
+ normal?: number | undefined;
668
+ medium?: number | undefined;
669
+ semibold?: number | undefined;
670
+ bold?: number | undefined;
671
+ };
672
+ lineHeight: {
673
+ normal?: number | undefined;
674
+ tight?: number | undefined;
675
+ relaxed?: number | undefined;
676
+ };
677
+ };
678
+ radius: {
679
+ sm?: string | undefined;
680
+ md?: string | undefined;
681
+ lg?: string | undefined;
682
+ xl?: string | undefined;
683
+ none?: string | undefined;
684
+ full?: string | undefined;
685
+ };
686
+ }>;
687
+ type DesignTokens = z.infer<typeof DesignTokensSchema>;
688
+ /**
689
+ * Component variant definition
690
+ * Each variant has a name and Tailwind classes
691
+ */
692
+ declare const ComponentVariantSchema: z.ZodObject<{
693
+ name: z.ZodString;
694
+ className: z.ZodDefault<z.ZodString>;
695
+ description: z.ZodOptional<z.ZodString>;
696
+ }, "strip", z.ZodTypeAny, {
697
+ name: string;
698
+ className: string;
699
+ description?: string | undefined;
700
+ }, {
701
+ name: string;
702
+ className?: string | undefined;
703
+ description?: string | undefined;
704
+ }>;
705
+ type ComponentVariant = z.infer<typeof ComponentVariantSchema>;
706
+ /**
707
+ * Component size definition
708
+ */
709
+ declare const ComponentSizeSchema: z.ZodObject<{
710
+ name: z.ZodEnum<["xs", "sm", "md", "lg", "xl"]>;
711
+ className: z.ZodDefault<z.ZodString>;
712
+ }, "strip", z.ZodTypeAny, {
713
+ name: "xs" | "sm" | "md" | "lg" | "xl";
714
+ className: string;
715
+ }, {
716
+ name: "xs" | "sm" | "md" | "lg" | "xl";
717
+ className?: string | undefined;
718
+ }>;
719
+ type ComponentSize = z.infer<typeof ComponentSizeSchema>;
720
+ /**
721
+ * Component definition
722
+ * Maps to a React component
723
+ */
724
+ declare const ComponentDefinitionSchema: z.ZodObject<{
725
+ id: z.ZodString;
726
+ name: z.ZodString;
727
+ category: z.ZodEnum<["form", "layout", "navigation", "feedback", "data-display", "overlay", "typography"]>;
728
+ source: z.ZodEnum<["shadcn", "custom"]>;
729
+ shadcnComponent: z.ZodOptional<z.ZodString>;
730
+ baseClassName: z.ZodString;
731
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
732
+ name: z.ZodString;
733
+ className: z.ZodDefault<z.ZodString>;
734
+ description: z.ZodOptional<z.ZodString>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ name: string;
737
+ className: string;
738
+ description?: string | undefined;
739
+ }, {
740
+ name: string;
741
+ className?: string | undefined;
742
+ description?: string | undefined;
743
+ }>, "many">>;
744
+ sizes: z.ZodDefault<z.ZodArray<z.ZodObject<{
745
+ name: z.ZodEnum<["xs", "sm", "md", "lg", "xl"]>;
746
+ className: z.ZodDefault<z.ZodString>;
747
+ }, "strip", z.ZodTypeAny, {
748
+ name: "xs" | "sm" | "md" | "lg" | "xl";
749
+ className: string;
750
+ }, {
751
+ name: "xs" | "sm" | "md" | "lg" | "xl";
752
+ className?: string | undefined;
753
+ }>, "many">>;
754
+ defaultProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
755
+ ariaLabel: z.ZodOptional<z.ZodString>;
756
+ ariaDescribedBy: z.ZodOptional<z.ZodString>;
757
+ usedInPages: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
758
+ description: z.ZodOptional<z.ZodString>;
759
+ createdAt: z.ZodString;
760
+ updatedAt: z.ZodString;
761
+ }, "strip", z.ZodTypeAny, {
762
+ name: string;
763
+ id: string;
764
+ category: "typography" | "form" | "layout" | "navigation" | "feedback" | "data-display" | "overlay";
765
+ source: "custom" | "shadcn";
766
+ baseClassName: string;
767
+ variants: {
768
+ name: string;
769
+ className: string;
770
+ description?: string | undefined;
771
+ }[];
772
+ sizes: {
773
+ name: "xs" | "sm" | "md" | "lg" | "xl";
774
+ className: string;
775
+ }[];
776
+ usedInPages: string[];
777
+ createdAt: string;
778
+ updatedAt: string;
779
+ description?: string | undefined;
780
+ shadcnComponent?: string | undefined;
781
+ defaultProps?: Record<string, any> | undefined;
782
+ ariaLabel?: string | undefined;
783
+ ariaDescribedBy?: string | undefined;
784
+ }, {
785
+ name: string;
786
+ id: string;
787
+ category: "typography" | "form" | "layout" | "navigation" | "feedback" | "data-display" | "overlay";
788
+ source: "custom" | "shadcn";
789
+ baseClassName: string;
790
+ createdAt: string;
791
+ updatedAt: string;
792
+ description?: string | undefined;
793
+ shadcnComponent?: string | undefined;
794
+ variants?: {
795
+ name: string;
796
+ className?: string | undefined;
797
+ description?: string | undefined;
798
+ }[] | undefined;
799
+ sizes?: {
800
+ name: "xs" | "sm" | "md" | "lg" | "xl";
801
+ className?: string | undefined;
802
+ }[] | undefined;
803
+ defaultProps?: Record<string, any> | undefined;
804
+ ariaLabel?: string | undefined;
805
+ ariaDescribedBy?: string | undefined;
806
+ usedInPages?: string[] | undefined;
807
+ }>;
808
+ type ComponentDefinition = z.infer<typeof ComponentDefinitionSchema>;
809
+ /**
810
+ * Page section (e.g., Hero, Features, Pricing)
811
+ */
812
+ declare const PageSectionSchema: z.ZodObject<{
813
+ id: z.ZodString;
814
+ name: z.ZodString;
815
+ componentId: z.ZodString;
816
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
817
+ order: z.ZodNumber;
818
+ }, "strip", z.ZodTypeAny, {
819
+ name: string;
820
+ id: string;
821
+ componentId: string;
822
+ order: number;
823
+ props?: Record<string, any> | undefined;
824
+ }, {
825
+ name: string;
826
+ id: string;
827
+ componentId: string;
828
+ order: number;
829
+ props?: Record<string, any> | undefined;
830
+ }>;
831
+ type PageSection = z.infer<typeof PageSectionSchema>;
832
+ /**
833
+ * Layout block — reusable chunk (header, footer, banner) shared across multiple pages.
834
+ * When the block is updated (e.g. "add button to lb-header-main"), all pages that
835
+ * reference it show the change.
836
+ */
837
+ declare const LayoutBlockDefinitionSchema: z.ZodObject<{
838
+ /** Unique id: kebab-case or generated (e.g. "lb-header-main", "lb-876") */
839
+ id: z.ZodString;
840
+ /** Optional short numeric id for user-facing refs (e.g. "add button to id876" → numericId 876) */
841
+ numericId: z.ZodOptional<z.ZodNumber>;
842
+ /** Human-readable name (e.g. "Main Header", "Site Footer") */
843
+ name: z.ZodString;
844
+ /** Role for semantics and default placement */
845
+ role: z.ZodDefault<z.ZodEnum<["header", "footer", "banner", "sidebar", "custom"]>>;
846
+ /** Order when multiple blocks of same role exist (lower = earlier) */
847
+ order: z.ZodDefault<z.ZodNumber>;
848
+ /** Structured content: sections (each can use a UI component + props) or raw markup hint for generator */
849
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
850
+ id: z.ZodString;
851
+ name: z.ZodString;
852
+ componentId: z.ZodString;
853
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
854
+ order: z.ZodNumber;
855
+ }, "strip", z.ZodTypeAny, {
856
+ name: string;
857
+ id: string;
858
+ componentId: string;
859
+ order: number;
860
+ props?: Record<string, any> | undefined;
861
+ }, {
862
+ name: string;
863
+ id: string;
864
+ componentId: string;
865
+ order: number;
866
+ props?: Record<string, any> | undefined;
867
+ }>, "many">>;
868
+ /** Optional: custom JSX snippet (when generatedWithCode is true, generator may store last output) */
869
+ generatedCode: z.ZodOptional<z.ZodString>;
870
+ createdAt: z.ZodOptional<z.ZodString>;
871
+ updatedAt: z.ZodOptional<z.ZodString>;
872
+ }, "strip", z.ZodTypeAny, {
873
+ name: string;
874
+ id: string;
875
+ order: number;
876
+ role: "custom" | "header" | "footer" | "banner" | "sidebar";
877
+ sections: {
878
+ name: string;
879
+ id: string;
880
+ componentId: string;
881
+ order: number;
882
+ props?: Record<string, any> | undefined;
883
+ }[];
884
+ createdAt?: string | undefined;
885
+ updatedAt?: string | undefined;
886
+ numericId?: number | undefined;
887
+ generatedCode?: string | undefined;
888
+ }, {
889
+ name: string;
890
+ id: string;
891
+ createdAt?: string | undefined;
892
+ updatedAt?: string | undefined;
893
+ order?: number | undefined;
894
+ numericId?: number | undefined;
895
+ role?: "custom" | "header" | "footer" | "banner" | "sidebar" | undefined;
896
+ sections?: {
897
+ name: string;
898
+ id: string;
899
+ componentId: string;
900
+ order: number;
901
+ props?: Record<string, any> | undefined;
902
+ }[] | undefined;
903
+ generatedCode?: string | undefined;
904
+ }>;
905
+ type LayoutBlockDefinition = z.infer<typeof LayoutBlockDefinitionSchema>;
906
+ /**
907
+ * Page layout type
908
+ */
909
+ declare const PageLayoutSchema: z.ZodEnum<["centered", "sidebar-left", "sidebar-right", "full-width", "grid"]>;
910
+ type PageLayout = z.infer<typeof PageLayoutSchema>;
911
+ /**
912
+ * Page definition
913
+ */
914
+ /**
915
+ * Structured analysis of a generated page's code (extracted post-generation, no AI call).
916
+ */
917
+ declare const PageAnalysisSchema: z.ZodOptional<z.ZodObject<{
918
+ sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
919
+ name: z.ZodString;
920
+ order: z.ZodNumber;
921
+ }, "strip", z.ZodTypeAny, {
922
+ name: string;
923
+ order: number;
924
+ }, {
925
+ name: string;
926
+ order: number;
927
+ }>, "many">>;
928
+ componentUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
929
+ iconCount: z.ZodOptional<z.ZodNumber>;
930
+ layoutPattern: z.ZodOptional<z.ZodString>;
931
+ hasForm: z.ZodOptional<z.ZodBoolean>;
932
+ analyzedAt: z.ZodOptional<z.ZodString>;
933
+ }, "strip", z.ZodTypeAny, {
934
+ sections?: {
935
+ name: string;
936
+ order: number;
937
+ }[] | undefined;
938
+ componentUsage?: Record<string, number> | undefined;
939
+ iconCount?: number | undefined;
940
+ layoutPattern?: string | undefined;
941
+ hasForm?: boolean | undefined;
942
+ analyzedAt?: string | undefined;
943
+ }, {
944
+ sections?: {
945
+ name: string;
946
+ order: number;
947
+ }[] | undefined;
948
+ componentUsage?: Record<string, number> | undefined;
949
+ iconCount?: number | undefined;
950
+ layoutPattern?: string | undefined;
951
+ hasForm?: boolean | undefined;
952
+ analyzedAt?: string | undefined;
953
+ }>>;
954
+ type PageAnalysis = z.infer<typeof PageAnalysisSchema>;
955
+ declare const PageDefinitionSchema: z.ZodObject<{
956
+ id: z.ZodString;
957
+ name: z.ZodString;
958
+ route: z.ZodString;
959
+ layout: z.ZodEnum<["centered", "sidebar-left", "sidebar-right", "full-width", "grid"]>;
960
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
961
+ id: z.ZodString;
962
+ name: z.ZodString;
963
+ componentId: z.ZodString;
964
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
965
+ order: z.ZodNumber;
966
+ }, "strip", z.ZodTypeAny, {
967
+ name: string;
968
+ id: string;
969
+ componentId: string;
970
+ order: number;
971
+ props?: Record<string, any> | undefined;
972
+ }, {
973
+ name: string;
974
+ id: string;
975
+ componentId: string;
976
+ order: number;
977
+ props?: Record<string, any> | undefined;
978
+ }>, "many">>;
979
+ /** Optional: IDs of layout blocks to render around this page (e.g. ["lb-header-main", "lb-footer-main"]). Order = render order. */
980
+ layoutBlockIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
981
+ generatedWithPageCode: z.ZodOptional<z.ZodBoolean>;
982
+ /** Post-generation code analysis: sections, component usage, layout pattern. */
983
+ pageAnalysis: z.ZodOptional<z.ZodObject<{
984
+ sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
985
+ name: z.ZodString;
986
+ order: z.ZodNumber;
987
+ }, "strip", z.ZodTypeAny, {
988
+ name: string;
989
+ order: number;
990
+ }, {
991
+ name: string;
992
+ order: number;
993
+ }>, "many">>;
994
+ componentUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
995
+ iconCount: z.ZodOptional<z.ZodNumber>;
996
+ layoutPattern: z.ZodOptional<z.ZodString>;
997
+ hasForm: z.ZodOptional<z.ZodBoolean>;
998
+ analyzedAt: z.ZodOptional<z.ZodString>;
999
+ }, "strip", z.ZodTypeAny, {
1000
+ sections?: {
1001
+ name: string;
1002
+ order: number;
1003
+ }[] | undefined;
1004
+ componentUsage?: Record<string, number> | undefined;
1005
+ iconCount?: number | undefined;
1006
+ layoutPattern?: string | undefined;
1007
+ hasForm?: boolean | undefined;
1008
+ analyzedAt?: string | undefined;
1009
+ }, {
1010
+ sections?: {
1011
+ name: string;
1012
+ order: number;
1013
+ }[] | undefined;
1014
+ componentUsage?: Record<string, number> | undefined;
1015
+ iconCount?: number | undefined;
1016
+ layoutPattern?: string | undefined;
1017
+ hasForm?: boolean | undefined;
1018
+ analyzedAt?: string | undefined;
1019
+ }>>;
1020
+ title: z.ZodString;
1021
+ description: z.ZodString;
1022
+ requiresAuth: z.ZodDefault<z.ZodBoolean>;
1023
+ allowedRoles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1024
+ ogImage: z.ZodOptional<z.ZodString>;
1025
+ noIndex: z.ZodDefault<z.ZodBoolean>;
1026
+ createdAt: z.ZodString;
1027
+ updatedAt: z.ZodString;
1028
+ }, "strip", z.ZodTypeAny, {
1029
+ name: string;
1030
+ description: string;
1031
+ id: string;
1032
+ layout: "centered" | "sidebar-left" | "sidebar-right" | "full-width" | "grid";
1033
+ createdAt: string;
1034
+ updatedAt: string;
1035
+ sections: {
1036
+ name: string;
1037
+ id: string;
1038
+ componentId: string;
1039
+ order: number;
1040
+ props?: Record<string, any> | undefined;
1041
+ }[];
1042
+ route: string;
1043
+ title: string;
1044
+ requiresAuth: boolean;
1045
+ noIndex: boolean;
1046
+ layoutBlockIds?: string[] | undefined;
1047
+ generatedWithPageCode?: boolean | undefined;
1048
+ pageAnalysis?: {
1049
+ sections?: {
1050
+ name: string;
1051
+ order: number;
1052
+ }[] | undefined;
1053
+ componentUsage?: Record<string, number> | undefined;
1054
+ iconCount?: number | undefined;
1055
+ layoutPattern?: string | undefined;
1056
+ hasForm?: boolean | undefined;
1057
+ analyzedAt?: string | undefined;
1058
+ } | undefined;
1059
+ allowedRoles?: string[] | undefined;
1060
+ ogImage?: string | undefined;
1061
+ }, {
1062
+ name: string;
1063
+ description: string;
1064
+ id: string;
1065
+ layout: "centered" | "sidebar-left" | "sidebar-right" | "full-width" | "grid";
1066
+ createdAt: string;
1067
+ updatedAt: string;
1068
+ route: string;
1069
+ title: string;
1070
+ sections?: {
1071
+ name: string;
1072
+ id: string;
1073
+ componentId: string;
1074
+ order: number;
1075
+ props?: Record<string, any> | undefined;
1076
+ }[] | undefined;
1077
+ layoutBlockIds?: string[] | undefined;
1078
+ generatedWithPageCode?: boolean | undefined;
1079
+ pageAnalysis?: {
1080
+ sections?: {
1081
+ name: string;
1082
+ order: number;
1083
+ }[] | undefined;
1084
+ componentUsage?: Record<string, number> | undefined;
1085
+ iconCount?: number | undefined;
1086
+ layoutPattern?: string | undefined;
1087
+ hasForm?: boolean | undefined;
1088
+ analyzedAt?: string | undefined;
1089
+ } | undefined;
1090
+ requiresAuth?: boolean | undefined;
1091
+ allowedRoles?: string[] | undefined;
1092
+ ogImage?: string | undefined;
1093
+ noIndex?: boolean | undefined;
1094
+ }>;
1095
+ type PageDefinition = z.infer<typeof PageDefinitionSchema>;
1096
+ /**
1097
+ * Navigation item
1098
+ */
1099
+ declare const NavigationItemSchema: z.ZodObject<{
1100
+ label: z.ZodString;
1101
+ route: z.ZodString;
1102
+ icon: z.ZodOptional<z.ZodString>;
1103
+ requiresAuth: z.ZodDefault<z.ZodBoolean>;
1104
+ order: z.ZodNumber;
1105
+ }, "strip", z.ZodTypeAny, {
1106
+ order: number;
1107
+ route: string;
1108
+ requiresAuth: boolean;
1109
+ label: string;
1110
+ icon?: string | undefined;
1111
+ }, {
1112
+ order: number;
1113
+ route: string;
1114
+ label: string;
1115
+ requiresAuth?: boolean | undefined;
1116
+ icon?: string | undefined;
1117
+ }>;
1118
+ type NavigationItem = z.infer<typeof NavigationItemSchema>;
1119
+ /**
1120
+ * Navigation configuration
1121
+ */
1122
+ declare const NavigationSchema: z.ZodObject<{
1123
+ enabled: z.ZodDefault<z.ZodBoolean>;
1124
+ type: z.ZodDefault<z.ZodEnum<["header", "sidebar", "both"]>>;
1125
+ items: z.ZodArray<z.ZodObject<{
1126
+ label: z.ZodString;
1127
+ route: z.ZodString;
1128
+ icon: z.ZodOptional<z.ZodString>;
1129
+ requiresAuth: z.ZodDefault<z.ZodBoolean>;
1130
+ order: z.ZodNumber;
1131
+ }, "strip", z.ZodTypeAny, {
1132
+ order: number;
1133
+ route: string;
1134
+ requiresAuth: boolean;
1135
+ label: string;
1136
+ icon?: string | undefined;
1137
+ }, {
1138
+ order: number;
1139
+ route: string;
1140
+ label: string;
1141
+ requiresAuth?: boolean | undefined;
1142
+ icon?: string | undefined;
1143
+ }>, "many">;
1144
+ logo: z.ZodOptional<z.ZodObject<{
1145
+ text: z.ZodOptional<z.ZodString>;
1146
+ image: z.ZodOptional<z.ZodString>;
1147
+ }, "strip", z.ZodTypeAny, {
1148
+ text?: string | undefined;
1149
+ image?: string | undefined;
1150
+ }, {
1151
+ text?: string | undefined;
1152
+ image?: string | undefined;
1153
+ }>>;
1154
+ }, "strip", z.ZodTypeAny, {
1155
+ type: "header" | "sidebar" | "both";
1156
+ enabled: boolean;
1157
+ items: {
1158
+ order: number;
1159
+ route: string;
1160
+ requiresAuth: boolean;
1161
+ label: string;
1162
+ icon?: string | undefined;
1163
+ }[];
1164
+ logo?: {
1165
+ text?: string | undefined;
1166
+ image?: string | undefined;
1167
+ } | undefined;
1168
+ }, {
1169
+ items: {
1170
+ order: number;
1171
+ route: string;
1172
+ label: string;
1173
+ requiresAuth?: boolean | undefined;
1174
+ icon?: string | undefined;
1175
+ }[];
1176
+ type?: "header" | "sidebar" | "both" | undefined;
1177
+ enabled?: boolean | undefined;
1178
+ logo?: {
1179
+ text?: string | undefined;
1180
+ image?: string | undefined;
1181
+ } | undefined;
1182
+ }>;
1183
+ type Navigation = z.infer<typeof NavigationSchema>;
1184
+ /**
1185
+ * Application features (authentication, payments, etc.)
1186
+ */
1187
+ declare const FeaturesSchema: z.ZodObject<{
1188
+ authentication: z.ZodObject<{
1189
+ enabled: z.ZodDefault<z.ZodBoolean>;
1190
+ provider: z.ZodOptional<z.ZodEnum<["next-auth", "clerk", "supabase", "custom"]>>;
1191
+ strategies: z.ZodDefault<z.ZodArray<z.ZodEnum<["email", "google", "github", "magic-link"]>, "many">>;
1192
+ }, "strip", z.ZodTypeAny, {
1193
+ enabled: boolean;
1194
+ strategies: ("email" | "google" | "github" | "magic-link")[];
1195
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
1196
+ }, {
1197
+ enabled?: boolean | undefined;
1198
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
1199
+ strategies?: ("email" | "google" | "github" | "magic-link")[] | undefined;
1200
+ }>;
1201
+ payments: z.ZodObject<{
1202
+ enabled: z.ZodDefault<z.ZodBoolean>;
1203
+ provider: z.ZodOptional<z.ZodEnum<["stripe", "paddle", "lemonsqueezy"]>>;
1204
+ }, "strip", z.ZodTypeAny, {
1205
+ enabled: boolean;
1206
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
1207
+ }, {
1208
+ enabled?: boolean | undefined;
1209
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
1210
+ }>;
1211
+ analytics: z.ZodObject<{
1212
+ enabled: z.ZodDefault<z.ZodBoolean>;
1213
+ provider: z.ZodOptional<z.ZodEnum<["google-analytics", "plausible", "posthog"]>>;
1214
+ }, "strip", z.ZodTypeAny, {
1215
+ enabled: boolean;
1216
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
1217
+ }, {
1218
+ enabled?: boolean | undefined;
1219
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
1220
+ }>;
1221
+ database: z.ZodObject<{
1222
+ enabled: z.ZodDefault<z.ZodBoolean>;
1223
+ provider: z.ZodOptional<z.ZodEnum<["prisma", "drizzle", "supabase"]>>;
1224
+ }, "strip", z.ZodTypeAny, {
1225
+ enabled: boolean;
1226
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
1227
+ }, {
1228
+ enabled?: boolean | undefined;
1229
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
1230
+ }>;
1231
+ stateManagement: z.ZodObject<{
1232
+ enabled: z.ZodDefault<z.ZodBoolean>;
1233
+ provider: z.ZodDefault<z.ZodEnum<["zustand", "redux", "jotai"]>>;
1234
+ }, "strip", z.ZodTypeAny, {
1235
+ enabled: boolean;
1236
+ provider: "zustand" | "redux" | "jotai";
1237
+ }, {
1238
+ enabled?: boolean | undefined;
1239
+ provider?: "zustand" | "redux" | "jotai" | undefined;
1240
+ }>;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ authentication: {
1243
+ enabled: boolean;
1244
+ strategies: ("email" | "google" | "github" | "magic-link")[];
1245
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
1246
+ };
1247
+ payments: {
1248
+ enabled: boolean;
1249
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
1250
+ };
1251
+ analytics: {
1252
+ enabled: boolean;
1253
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
1254
+ };
1255
+ database: {
1256
+ enabled: boolean;
1257
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
1258
+ };
1259
+ stateManagement: {
1260
+ enabled: boolean;
1261
+ provider: "zustand" | "redux" | "jotai";
1262
+ };
1263
+ }, {
1264
+ authentication: {
1265
+ enabled?: boolean | undefined;
1266
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
1267
+ strategies?: ("email" | "google" | "github" | "magic-link")[] | undefined;
1268
+ };
1269
+ payments: {
1270
+ enabled?: boolean | undefined;
1271
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
1272
+ };
1273
+ analytics: {
1274
+ enabled?: boolean | undefined;
1275
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
1276
+ };
1277
+ database: {
1278
+ enabled?: boolean | undefined;
1279
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
1280
+ };
1281
+ stateManagement: {
1282
+ enabled?: boolean | undefined;
1283
+ provider?: "zustand" | "redux" | "jotai" | undefined;
1284
+ };
1285
+ }>;
1286
+ type Features = z.infer<typeof FeaturesSchema>;
1287
+ /**
1288
+ * Complete design system configuration
1289
+ * This is the single source of truth
1290
+ */
1291
+ declare const DesignSystemConfigSchema: z.ZodObject<{
1292
+ version: z.ZodDefault<z.ZodString>;
1293
+ coherentVersion: z.ZodOptional<z.ZodString>;
1294
+ frameworkVersions: z.ZodOptional<z.ZodObject<{
1295
+ next: z.ZodString;
1296
+ react: z.ZodString;
1297
+ tailwind: z.ZodString;
1298
+ }, "strip", z.ZodTypeAny, {
1299
+ next: string;
1300
+ react: string;
1301
+ tailwind: string;
1302
+ }, {
1303
+ next: string;
1304
+ react: string;
1305
+ tailwind: string;
1306
+ }>>;
1307
+ name: z.ZodString;
1308
+ description: z.ZodString;
1309
+ tokens: z.ZodObject<{
1310
+ colors: z.ZodObject<{
1311
+ light: z.ZodObject<{
1312
+ primary: z.ZodString;
1313
+ secondary: z.ZodString;
1314
+ accent: z.ZodOptional<z.ZodString>;
1315
+ success: z.ZodString;
1316
+ warning: z.ZodString;
1317
+ error: z.ZodString;
1318
+ info: z.ZodString;
1319
+ background: z.ZodString;
1320
+ foreground: z.ZodString;
1321
+ muted: z.ZodString;
1322
+ border: z.ZodString;
1323
+ }, "strip", z.ZodTypeAny, {
1324
+ primary: string;
1325
+ secondary: string;
1326
+ success: string;
1327
+ warning: string;
1328
+ error: string;
1329
+ info: string;
1330
+ background: string;
1331
+ foreground: string;
1332
+ muted: string;
1333
+ border: string;
1334
+ accent?: string | undefined;
1335
+ }, {
1336
+ primary: string;
1337
+ secondary: string;
1338
+ success: string;
1339
+ warning: string;
1340
+ error: string;
1341
+ info: string;
1342
+ background: string;
1343
+ foreground: string;
1344
+ muted: string;
1345
+ border: string;
1346
+ accent?: string | undefined;
1347
+ }>;
1348
+ dark: z.ZodObject<{
1349
+ primary: z.ZodString;
1350
+ secondary: z.ZodString;
1351
+ accent: z.ZodOptional<z.ZodString>;
1352
+ success: z.ZodString;
1353
+ warning: z.ZodString;
1354
+ error: z.ZodString;
1355
+ info: z.ZodString;
1356
+ background: z.ZodString;
1357
+ foreground: z.ZodString;
1358
+ muted: z.ZodString;
1359
+ border: z.ZodString;
1360
+ }, "strip", z.ZodTypeAny, {
1361
+ primary: string;
1362
+ secondary: string;
1363
+ success: string;
1364
+ warning: string;
1365
+ error: string;
1366
+ info: string;
1367
+ background: string;
1368
+ foreground: string;
1369
+ muted: string;
1370
+ border: string;
1371
+ accent?: string | undefined;
1372
+ }, {
1373
+ primary: string;
1374
+ secondary: string;
1375
+ success: string;
1376
+ warning: string;
1377
+ error: string;
1378
+ info: string;
1379
+ background: string;
1380
+ foreground: string;
1381
+ muted: string;
1382
+ border: string;
1383
+ accent?: string | undefined;
1384
+ }>;
1385
+ }, "strip", z.ZodTypeAny, {
1386
+ light: {
1387
+ primary: string;
1388
+ secondary: string;
1389
+ success: string;
1390
+ warning: string;
1391
+ error: string;
1392
+ info: string;
1393
+ background: string;
1394
+ foreground: string;
1395
+ muted: string;
1396
+ border: string;
1397
+ accent?: string | undefined;
1398
+ };
1399
+ dark: {
1400
+ primary: string;
1401
+ secondary: string;
1402
+ success: string;
1403
+ warning: string;
1404
+ error: string;
1405
+ info: string;
1406
+ background: string;
1407
+ foreground: string;
1408
+ muted: string;
1409
+ border: string;
1410
+ accent?: string | undefined;
1411
+ };
1412
+ }, {
1413
+ light: {
1414
+ primary: string;
1415
+ secondary: string;
1416
+ success: string;
1417
+ warning: string;
1418
+ error: string;
1419
+ info: string;
1420
+ background: string;
1421
+ foreground: string;
1422
+ muted: string;
1423
+ border: string;
1424
+ accent?: string | undefined;
1425
+ };
1426
+ dark: {
1427
+ primary: string;
1428
+ secondary: string;
1429
+ success: string;
1430
+ warning: string;
1431
+ error: string;
1432
+ info: string;
1433
+ background: string;
1434
+ foreground: string;
1435
+ muted: string;
1436
+ border: string;
1437
+ accent?: string | undefined;
1438
+ };
1439
+ }>;
1440
+ spacing: z.ZodObject<{
1441
+ xs: z.ZodDefault<z.ZodString>;
1442
+ sm: z.ZodDefault<z.ZodString>;
1443
+ md: z.ZodDefault<z.ZodString>;
1444
+ lg: z.ZodDefault<z.ZodString>;
1445
+ xl: z.ZodDefault<z.ZodString>;
1446
+ '2xl': z.ZodDefault<z.ZodString>;
1447
+ '3xl': z.ZodDefault<z.ZodString>;
1448
+ }, "strip", z.ZodTypeAny, {
1449
+ xs: string;
1450
+ sm: string;
1451
+ md: string;
1452
+ lg: string;
1453
+ xl: string;
1454
+ '2xl': string;
1455
+ '3xl': string;
1456
+ }, {
1457
+ xs?: string | undefined;
1458
+ sm?: string | undefined;
1459
+ md?: string | undefined;
1460
+ lg?: string | undefined;
1461
+ xl?: string | undefined;
1462
+ '2xl'?: string | undefined;
1463
+ '3xl'?: string | undefined;
1464
+ }>;
1465
+ typography: z.ZodObject<{
1466
+ fontFamily: z.ZodObject<{
1467
+ sans: z.ZodDefault<z.ZodString>;
1468
+ mono: z.ZodDefault<z.ZodString>;
1469
+ }, "strip", z.ZodTypeAny, {
1470
+ sans: string;
1471
+ mono: string;
1472
+ }, {
1473
+ sans?: string | undefined;
1474
+ mono?: string | undefined;
1475
+ }>;
1476
+ fontSize: z.ZodObject<{
1477
+ xs: z.ZodDefault<z.ZodString>;
1478
+ sm: z.ZodDefault<z.ZodString>;
1479
+ base: z.ZodDefault<z.ZodString>;
1480
+ lg: z.ZodDefault<z.ZodString>;
1481
+ xl: z.ZodDefault<z.ZodString>;
1482
+ '2xl': z.ZodDefault<z.ZodString>;
1483
+ '3xl': z.ZodDefault<z.ZodString>;
1484
+ '4xl': z.ZodDefault<z.ZodString>;
1485
+ }, "strip", z.ZodTypeAny, {
1486
+ xs: string;
1487
+ sm: string;
1488
+ lg: string;
1489
+ xl: string;
1490
+ '2xl': string;
1491
+ '3xl': string;
1492
+ base: string;
1493
+ '4xl': string;
1494
+ }, {
1495
+ xs?: string | undefined;
1496
+ sm?: string | undefined;
1497
+ lg?: string | undefined;
1498
+ xl?: string | undefined;
1499
+ '2xl'?: string | undefined;
1500
+ '3xl'?: string | undefined;
1501
+ base?: string | undefined;
1502
+ '4xl'?: string | undefined;
1503
+ }>;
1504
+ fontWeight: z.ZodObject<{
1505
+ normal: z.ZodDefault<z.ZodNumber>;
1506
+ medium: z.ZodDefault<z.ZodNumber>;
1507
+ semibold: z.ZodDefault<z.ZodNumber>;
1508
+ bold: z.ZodDefault<z.ZodNumber>;
1509
+ }, "strip", z.ZodTypeAny, {
1510
+ normal: number;
1511
+ medium: number;
1512
+ semibold: number;
1513
+ bold: number;
1514
+ }, {
1515
+ normal?: number | undefined;
1516
+ medium?: number | undefined;
1517
+ semibold?: number | undefined;
1518
+ bold?: number | undefined;
1519
+ }>;
1520
+ lineHeight: z.ZodObject<{
1521
+ tight: z.ZodDefault<z.ZodNumber>;
1522
+ normal: z.ZodDefault<z.ZodNumber>;
1523
+ relaxed: z.ZodDefault<z.ZodNumber>;
1524
+ }, "strip", z.ZodTypeAny, {
1525
+ normal: number;
1526
+ tight: number;
1527
+ relaxed: number;
1528
+ }, {
1529
+ normal?: number | undefined;
1530
+ tight?: number | undefined;
1531
+ relaxed?: number | undefined;
1532
+ }>;
1533
+ }, "strip", z.ZodTypeAny, {
1534
+ fontFamily: {
1535
+ sans: string;
1536
+ mono: string;
1537
+ };
1538
+ fontSize: {
1539
+ xs: string;
1540
+ sm: string;
1541
+ lg: string;
1542
+ xl: string;
1543
+ '2xl': string;
1544
+ '3xl': string;
1545
+ base: string;
1546
+ '4xl': string;
1547
+ };
1548
+ fontWeight: {
1549
+ normal: number;
1550
+ medium: number;
1551
+ semibold: number;
1552
+ bold: number;
1553
+ };
1554
+ lineHeight: {
1555
+ normal: number;
1556
+ tight: number;
1557
+ relaxed: number;
1558
+ };
1559
+ }, {
1560
+ fontFamily: {
1561
+ sans?: string | undefined;
1562
+ mono?: string | undefined;
1563
+ };
1564
+ fontSize: {
1565
+ xs?: string | undefined;
1566
+ sm?: string | undefined;
1567
+ lg?: string | undefined;
1568
+ xl?: string | undefined;
1569
+ '2xl'?: string | undefined;
1570
+ '3xl'?: string | undefined;
1571
+ base?: string | undefined;
1572
+ '4xl'?: string | undefined;
1573
+ };
1574
+ fontWeight: {
1575
+ normal?: number | undefined;
1576
+ medium?: number | undefined;
1577
+ semibold?: number | undefined;
1578
+ bold?: number | undefined;
1579
+ };
1580
+ lineHeight: {
1581
+ normal?: number | undefined;
1582
+ tight?: number | undefined;
1583
+ relaxed?: number | undefined;
1584
+ };
1585
+ }>;
1586
+ radius: z.ZodObject<{
1587
+ none: z.ZodDefault<z.ZodString>;
1588
+ sm: z.ZodDefault<z.ZodString>;
1589
+ md: z.ZodDefault<z.ZodString>;
1590
+ lg: z.ZodDefault<z.ZodString>;
1591
+ xl: z.ZodDefault<z.ZodString>;
1592
+ full: z.ZodDefault<z.ZodString>;
1593
+ }, "strip", z.ZodTypeAny, {
1594
+ sm: string;
1595
+ md: string;
1596
+ lg: string;
1597
+ xl: string;
1598
+ none: string;
1599
+ full: string;
1600
+ }, {
1601
+ sm?: string | undefined;
1602
+ md?: string | undefined;
1603
+ lg?: string | undefined;
1604
+ xl?: string | undefined;
1605
+ none?: string | undefined;
1606
+ full?: string | undefined;
1607
+ }>;
1608
+ }, "strip", z.ZodTypeAny, {
1609
+ colors: {
1610
+ light: {
1611
+ primary: string;
1612
+ secondary: string;
1613
+ success: string;
1614
+ warning: string;
1615
+ error: string;
1616
+ info: string;
1617
+ background: string;
1618
+ foreground: string;
1619
+ muted: string;
1620
+ border: string;
1621
+ accent?: string | undefined;
1622
+ };
1623
+ dark: {
1624
+ primary: string;
1625
+ secondary: string;
1626
+ success: string;
1627
+ warning: string;
1628
+ error: string;
1629
+ info: string;
1630
+ background: string;
1631
+ foreground: string;
1632
+ muted: string;
1633
+ border: string;
1634
+ accent?: string | undefined;
1635
+ };
1636
+ };
1637
+ spacing: {
1638
+ xs: string;
1639
+ sm: string;
1640
+ md: string;
1641
+ lg: string;
1642
+ xl: string;
1643
+ '2xl': string;
1644
+ '3xl': string;
1645
+ };
1646
+ typography: {
1647
+ fontFamily: {
1648
+ sans: string;
1649
+ mono: string;
1650
+ };
1651
+ fontSize: {
1652
+ xs: string;
1653
+ sm: string;
1654
+ lg: string;
1655
+ xl: string;
1656
+ '2xl': string;
1657
+ '3xl': string;
1658
+ base: string;
1659
+ '4xl': string;
1660
+ };
1661
+ fontWeight: {
1662
+ normal: number;
1663
+ medium: number;
1664
+ semibold: number;
1665
+ bold: number;
1666
+ };
1667
+ lineHeight: {
1668
+ normal: number;
1669
+ tight: number;
1670
+ relaxed: number;
1671
+ };
1672
+ };
1673
+ radius: {
1674
+ sm: string;
1675
+ md: string;
1676
+ lg: string;
1677
+ xl: string;
1678
+ none: string;
1679
+ full: string;
1680
+ };
1681
+ }, {
1682
+ colors: {
1683
+ light: {
1684
+ primary: string;
1685
+ secondary: string;
1686
+ success: string;
1687
+ warning: string;
1688
+ error: string;
1689
+ info: string;
1690
+ background: string;
1691
+ foreground: string;
1692
+ muted: string;
1693
+ border: string;
1694
+ accent?: string | undefined;
1695
+ };
1696
+ dark: {
1697
+ primary: string;
1698
+ secondary: string;
1699
+ success: string;
1700
+ warning: string;
1701
+ error: string;
1702
+ info: string;
1703
+ background: string;
1704
+ foreground: string;
1705
+ muted: string;
1706
+ border: string;
1707
+ accent?: string | undefined;
1708
+ };
1709
+ };
1710
+ spacing: {
1711
+ xs?: string | undefined;
1712
+ sm?: string | undefined;
1713
+ md?: string | undefined;
1714
+ lg?: string | undefined;
1715
+ xl?: string | undefined;
1716
+ '2xl'?: string | undefined;
1717
+ '3xl'?: string | undefined;
1718
+ };
1719
+ typography: {
1720
+ fontFamily: {
1721
+ sans?: string | undefined;
1722
+ mono?: string | undefined;
1723
+ };
1724
+ fontSize: {
1725
+ xs?: string | undefined;
1726
+ sm?: string | undefined;
1727
+ lg?: string | undefined;
1728
+ xl?: string | undefined;
1729
+ '2xl'?: string | undefined;
1730
+ '3xl'?: string | undefined;
1731
+ base?: string | undefined;
1732
+ '4xl'?: string | undefined;
1733
+ };
1734
+ fontWeight: {
1735
+ normal?: number | undefined;
1736
+ medium?: number | undefined;
1737
+ semibold?: number | undefined;
1738
+ bold?: number | undefined;
1739
+ };
1740
+ lineHeight: {
1741
+ normal?: number | undefined;
1742
+ tight?: number | undefined;
1743
+ relaxed?: number | undefined;
1744
+ };
1745
+ };
1746
+ radius: {
1747
+ sm?: string | undefined;
1748
+ md?: string | undefined;
1749
+ lg?: string | undefined;
1750
+ xl?: string | undefined;
1751
+ none?: string | undefined;
1752
+ full?: string | undefined;
1753
+ };
1754
+ }>;
1755
+ theme: z.ZodObject<{
1756
+ defaultMode: z.ZodDefault<z.ZodEnum<["light", "dark", "system"]>>;
1757
+ allowModeToggle: z.ZodDefault<z.ZodBoolean>;
1758
+ }, "strip", z.ZodTypeAny, {
1759
+ defaultMode: "light" | "dark" | "system";
1760
+ allowModeToggle: boolean;
1761
+ }, {
1762
+ defaultMode?: "light" | "dark" | "system" | undefined;
1763
+ allowModeToggle?: boolean | undefined;
1764
+ }>;
1765
+ components: z.ZodArray<z.ZodObject<{
1766
+ id: z.ZodString;
1767
+ name: z.ZodString;
1768
+ category: z.ZodEnum<["form", "layout", "navigation", "feedback", "data-display", "overlay", "typography"]>;
1769
+ source: z.ZodEnum<["shadcn", "custom"]>;
1770
+ shadcnComponent: z.ZodOptional<z.ZodString>;
1771
+ baseClassName: z.ZodString;
1772
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1773
+ name: z.ZodString;
1774
+ className: z.ZodDefault<z.ZodString>;
1775
+ description: z.ZodOptional<z.ZodString>;
1776
+ }, "strip", z.ZodTypeAny, {
1777
+ name: string;
1778
+ className: string;
1779
+ description?: string | undefined;
1780
+ }, {
1781
+ name: string;
1782
+ className?: string | undefined;
1783
+ description?: string | undefined;
1784
+ }>, "many">>;
1785
+ sizes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1786
+ name: z.ZodEnum<["xs", "sm", "md", "lg", "xl"]>;
1787
+ className: z.ZodDefault<z.ZodString>;
1788
+ }, "strip", z.ZodTypeAny, {
1789
+ name: "xs" | "sm" | "md" | "lg" | "xl";
1790
+ className: string;
1791
+ }, {
1792
+ name: "xs" | "sm" | "md" | "lg" | "xl";
1793
+ className?: string | undefined;
1794
+ }>, "many">>;
1795
+ defaultProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1796
+ ariaLabel: z.ZodOptional<z.ZodString>;
1797
+ ariaDescribedBy: z.ZodOptional<z.ZodString>;
1798
+ usedInPages: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1799
+ description: z.ZodOptional<z.ZodString>;
1800
+ createdAt: z.ZodString;
1801
+ updatedAt: z.ZodString;
1802
+ }, "strip", z.ZodTypeAny, {
1803
+ name: string;
1804
+ id: string;
1805
+ category: "typography" | "form" | "layout" | "navigation" | "feedback" | "data-display" | "overlay";
1806
+ source: "custom" | "shadcn";
1807
+ baseClassName: string;
1808
+ variants: {
1809
+ name: string;
1810
+ className: string;
1811
+ description?: string | undefined;
1812
+ }[];
1813
+ sizes: {
1814
+ name: "xs" | "sm" | "md" | "lg" | "xl";
1815
+ className: string;
1816
+ }[];
1817
+ usedInPages: string[];
1818
+ createdAt: string;
1819
+ updatedAt: string;
1820
+ description?: string | undefined;
1821
+ shadcnComponent?: string | undefined;
1822
+ defaultProps?: Record<string, any> | undefined;
1823
+ ariaLabel?: string | undefined;
1824
+ ariaDescribedBy?: string | undefined;
1825
+ }, {
1826
+ name: string;
1827
+ id: string;
1828
+ category: "typography" | "form" | "layout" | "navigation" | "feedback" | "data-display" | "overlay";
1829
+ source: "custom" | "shadcn";
1830
+ baseClassName: string;
1831
+ createdAt: string;
1832
+ updatedAt: string;
1833
+ description?: string | undefined;
1834
+ shadcnComponent?: string | undefined;
1835
+ variants?: {
1836
+ name: string;
1837
+ className?: string | undefined;
1838
+ description?: string | undefined;
1839
+ }[] | undefined;
1840
+ sizes?: {
1841
+ name: "xs" | "sm" | "md" | "lg" | "xl";
1842
+ className?: string | undefined;
1843
+ }[] | undefined;
1844
+ defaultProps?: Record<string, any> | undefined;
1845
+ ariaLabel?: string | undefined;
1846
+ ariaDescribedBy?: string | undefined;
1847
+ usedInPages?: string[] | undefined;
1848
+ }>, "many">;
1849
+ /** Reusable layout blocks (header, footer, etc.) shared across pages. Referenced by id in page.layoutBlockIds. */
1850
+ layoutBlocks: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
1851
+ /** Unique id: kebab-case or generated (e.g. "lb-header-main", "lb-876") */
1852
+ id: z.ZodString;
1853
+ /** Optional short numeric id for user-facing refs (e.g. "add button to id876" → numericId 876) */
1854
+ numericId: z.ZodOptional<z.ZodNumber>;
1855
+ /** Human-readable name (e.g. "Main Header", "Site Footer") */
1856
+ name: z.ZodString;
1857
+ /** Role for semantics and default placement */
1858
+ role: z.ZodDefault<z.ZodEnum<["header", "footer", "banner", "sidebar", "custom"]>>;
1859
+ /** Order when multiple blocks of same role exist (lower = earlier) */
1860
+ order: z.ZodDefault<z.ZodNumber>;
1861
+ /** Structured content: sections (each can use a UI component + props) or raw markup hint for generator */
1862
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
1863
+ id: z.ZodString;
1864
+ name: z.ZodString;
1865
+ componentId: z.ZodString;
1866
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1867
+ order: z.ZodNumber;
1868
+ }, "strip", z.ZodTypeAny, {
1869
+ name: string;
1870
+ id: string;
1871
+ componentId: string;
1872
+ order: number;
1873
+ props?: Record<string, any> | undefined;
1874
+ }, {
1875
+ name: string;
1876
+ id: string;
1877
+ componentId: string;
1878
+ order: number;
1879
+ props?: Record<string, any> | undefined;
1880
+ }>, "many">>;
1881
+ /** Optional: custom JSX snippet (when generatedWithCode is true, generator may store last output) */
1882
+ generatedCode: z.ZodOptional<z.ZodString>;
1883
+ createdAt: z.ZodOptional<z.ZodString>;
1884
+ updatedAt: z.ZodOptional<z.ZodString>;
1885
+ }, "strip", z.ZodTypeAny, {
1886
+ name: string;
1887
+ id: string;
1888
+ order: number;
1889
+ role: "custom" | "header" | "footer" | "banner" | "sidebar";
1890
+ sections: {
1891
+ name: string;
1892
+ id: string;
1893
+ componentId: string;
1894
+ order: number;
1895
+ props?: Record<string, any> | undefined;
1896
+ }[];
1897
+ createdAt?: string | undefined;
1898
+ updatedAt?: string | undefined;
1899
+ numericId?: number | undefined;
1900
+ generatedCode?: string | undefined;
1901
+ }, {
1902
+ name: string;
1903
+ id: string;
1904
+ createdAt?: string | undefined;
1905
+ updatedAt?: string | undefined;
1906
+ order?: number | undefined;
1907
+ numericId?: number | undefined;
1908
+ role?: "custom" | "header" | "footer" | "banner" | "sidebar" | undefined;
1909
+ sections?: {
1910
+ name: string;
1911
+ id: string;
1912
+ componentId: string;
1913
+ order: number;
1914
+ props?: Record<string, any> | undefined;
1915
+ }[] | undefined;
1916
+ generatedCode?: string | undefined;
1917
+ }>, "many">>>;
1918
+ pages: z.ZodArray<z.ZodObject<{
1919
+ id: z.ZodString;
1920
+ name: z.ZodString;
1921
+ route: z.ZodString;
1922
+ layout: z.ZodEnum<["centered", "sidebar-left", "sidebar-right", "full-width", "grid"]>;
1923
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
1924
+ id: z.ZodString;
1925
+ name: z.ZodString;
1926
+ componentId: z.ZodString;
1927
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1928
+ order: z.ZodNumber;
1929
+ }, "strip", z.ZodTypeAny, {
1930
+ name: string;
1931
+ id: string;
1932
+ componentId: string;
1933
+ order: number;
1934
+ props?: Record<string, any> | undefined;
1935
+ }, {
1936
+ name: string;
1937
+ id: string;
1938
+ componentId: string;
1939
+ order: number;
1940
+ props?: Record<string, any> | undefined;
1941
+ }>, "many">>;
1942
+ /** Optional: IDs of layout blocks to render around this page (e.g. ["lb-header-main", "lb-footer-main"]). Order = render order. */
1943
+ layoutBlockIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1944
+ generatedWithPageCode: z.ZodOptional<z.ZodBoolean>;
1945
+ /** Post-generation code analysis: sections, component usage, layout pattern. */
1946
+ pageAnalysis: z.ZodOptional<z.ZodObject<{
1947
+ sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
1948
+ name: z.ZodString;
1949
+ order: z.ZodNumber;
1950
+ }, "strip", z.ZodTypeAny, {
1951
+ name: string;
1952
+ order: number;
1953
+ }, {
1954
+ name: string;
1955
+ order: number;
1956
+ }>, "many">>;
1957
+ componentUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1958
+ iconCount: z.ZodOptional<z.ZodNumber>;
1959
+ layoutPattern: z.ZodOptional<z.ZodString>;
1960
+ hasForm: z.ZodOptional<z.ZodBoolean>;
1961
+ analyzedAt: z.ZodOptional<z.ZodString>;
1962
+ }, "strip", z.ZodTypeAny, {
1963
+ sections?: {
1964
+ name: string;
1965
+ order: number;
1966
+ }[] | undefined;
1967
+ componentUsage?: Record<string, number> | undefined;
1968
+ iconCount?: number | undefined;
1969
+ layoutPattern?: string | undefined;
1970
+ hasForm?: boolean | undefined;
1971
+ analyzedAt?: string | undefined;
1972
+ }, {
1973
+ sections?: {
1974
+ name: string;
1975
+ order: number;
1976
+ }[] | undefined;
1977
+ componentUsage?: Record<string, number> | undefined;
1978
+ iconCount?: number | undefined;
1979
+ layoutPattern?: string | undefined;
1980
+ hasForm?: boolean | undefined;
1981
+ analyzedAt?: string | undefined;
1982
+ }>>;
1983
+ title: z.ZodString;
1984
+ description: z.ZodString;
1985
+ requiresAuth: z.ZodDefault<z.ZodBoolean>;
1986
+ allowedRoles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1987
+ ogImage: z.ZodOptional<z.ZodString>;
1988
+ noIndex: z.ZodDefault<z.ZodBoolean>;
1989
+ createdAt: z.ZodString;
1990
+ updatedAt: z.ZodString;
1991
+ }, "strip", z.ZodTypeAny, {
1992
+ name: string;
1993
+ description: string;
1994
+ id: string;
1995
+ layout: "centered" | "sidebar-left" | "sidebar-right" | "full-width" | "grid";
1996
+ createdAt: string;
1997
+ updatedAt: string;
1998
+ sections: {
1999
+ name: string;
2000
+ id: string;
2001
+ componentId: string;
2002
+ order: number;
2003
+ props?: Record<string, any> | undefined;
2004
+ }[];
2005
+ route: string;
2006
+ title: string;
2007
+ requiresAuth: boolean;
2008
+ noIndex: boolean;
2009
+ layoutBlockIds?: string[] | undefined;
2010
+ generatedWithPageCode?: boolean | undefined;
2011
+ pageAnalysis?: {
2012
+ sections?: {
2013
+ name: string;
2014
+ order: number;
2015
+ }[] | undefined;
2016
+ componentUsage?: Record<string, number> | undefined;
2017
+ iconCount?: number | undefined;
2018
+ layoutPattern?: string | undefined;
2019
+ hasForm?: boolean | undefined;
2020
+ analyzedAt?: string | undefined;
2021
+ } | undefined;
2022
+ allowedRoles?: string[] | undefined;
2023
+ ogImage?: string | undefined;
2024
+ }, {
2025
+ name: string;
2026
+ description: string;
2027
+ id: string;
2028
+ layout: "centered" | "sidebar-left" | "sidebar-right" | "full-width" | "grid";
2029
+ createdAt: string;
2030
+ updatedAt: string;
2031
+ route: string;
2032
+ title: string;
2033
+ sections?: {
2034
+ name: string;
2035
+ id: string;
2036
+ componentId: string;
2037
+ order: number;
2038
+ props?: Record<string, any> | undefined;
2039
+ }[] | undefined;
2040
+ layoutBlockIds?: string[] | undefined;
2041
+ generatedWithPageCode?: boolean | undefined;
2042
+ pageAnalysis?: {
2043
+ sections?: {
2044
+ name: string;
2045
+ order: number;
2046
+ }[] | undefined;
2047
+ componentUsage?: Record<string, number> | undefined;
2048
+ iconCount?: number | undefined;
2049
+ layoutPattern?: string | undefined;
2050
+ hasForm?: boolean | undefined;
2051
+ analyzedAt?: string | undefined;
2052
+ } | undefined;
2053
+ requiresAuth?: boolean | undefined;
2054
+ allowedRoles?: string[] | undefined;
2055
+ ogImage?: string | undefined;
2056
+ noIndex?: boolean | undefined;
2057
+ }>, "many">;
2058
+ navigation: z.ZodOptional<z.ZodObject<{
2059
+ enabled: z.ZodDefault<z.ZodBoolean>;
2060
+ type: z.ZodDefault<z.ZodEnum<["header", "sidebar", "both"]>>;
2061
+ items: z.ZodArray<z.ZodObject<{
2062
+ label: z.ZodString;
2063
+ route: z.ZodString;
2064
+ icon: z.ZodOptional<z.ZodString>;
2065
+ requiresAuth: z.ZodDefault<z.ZodBoolean>;
2066
+ order: z.ZodNumber;
2067
+ }, "strip", z.ZodTypeAny, {
2068
+ order: number;
2069
+ route: string;
2070
+ requiresAuth: boolean;
2071
+ label: string;
2072
+ icon?: string | undefined;
2073
+ }, {
2074
+ order: number;
2075
+ route: string;
2076
+ label: string;
2077
+ requiresAuth?: boolean | undefined;
2078
+ icon?: string | undefined;
2079
+ }>, "many">;
2080
+ logo: z.ZodOptional<z.ZodObject<{
2081
+ text: z.ZodOptional<z.ZodString>;
2082
+ image: z.ZodOptional<z.ZodString>;
2083
+ }, "strip", z.ZodTypeAny, {
2084
+ text?: string | undefined;
2085
+ image?: string | undefined;
2086
+ }, {
2087
+ text?: string | undefined;
2088
+ image?: string | undefined;
2089
+ }>>;
2090
+ }, "strip", z.ZodTypeAny, {
2091
+ type: "header" | "sidebar" | "both";
2092
+ enabled: boolean;
2093
+ items: {
2094
+ order: number;
2095
+ route: string;
2096
+ requiresAuth: boolean;
2097
+ label: string;
2098
+ icon?: string | undefined;
2099
+ }[];
2100
+ logo?: {
2101
+ text?: string | undefined;
2102
+ image?: string | undefined;
2103
+ } | undefined;
2104
+ }, {
2105
+ items: {
2106
+ order: number;
2107
+ route: string;
2108
+ label: string;
2109
+ requiresAuth?: boolean | undefined;
2110
+ icon?: string | undefined;
2111
+ }[];
2112
+ type?: "header" | "sidebar" | "both" | undefined;
2113
+ enabled?: boolean | undefined;
2114
+ logo?: {
2115
+ text?: string | undefined;
2116
+ image?: string | undefined;
2117
+ } | undefined;
2118
+ }>>;
2119
+ features: z.ZodObject<{
2120
+ authentication: z.ZodObject<{
2121
+ enabled: z.ZodDefault<z.ZodBoolean>;
2122
+ provider: z.ZodOptional<z.ZodEnum<["next-auth", "clerk", "supabase", "custom"]>>;
2123
+ strategies: z.ZodDefault<z.ZodArray<z.ZodEnum<["email", "google", "github", "magic-link"]>, "many">>;
2124
+ }, "strip", z.ZodTypeAny, {
2125
+ enabled: boolean;
2126
+ strategies: ("email" | "google" | "github" | "magic-link")[];
2127
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
2128
+ }, {
2129
+ enabled?: boolean | undefined;
2130
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
2131
+ strategies?: ("email" | "google" | "github" | "magic-link")[] | undefined;
2132
+ }>;
2133
+ payments: z.ZodObject<{
2134
+ enabled: z.ZodDefault<z.ZodBoolean>;
2135
+ provider: z.ZodOptional<z.ZodEnum<["stripe", "paddle", "lemonsqueezy"]>>;
2136
+ }, "strip", z.ZodTypeAny, {
2137
+ enabled: boolean;
2138
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
2139
+ }, {
2140
+ enabled?: boolean | undefined;
2141
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
2142
+ }>;
2143
+ analytics: z.ZodObject<{
2144
+ enabled: z.ZodDefault<z.ZodBoolean>;
2145
+ provider: z.ZodOptional<z.ZodEnum<["google-analytics", "plausible", "posthog"]>>;
2146
+ }, "strip", z.ZodTypeAny, {
2147
+ enabled: boolean;
2148
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
2149
+ }, {
2150
+ enabled?: boolean | undefined;
2151
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
2152
+ }>;
2153
+ database: z.ZodObject<{
2154
+ enabled: z.ZodDefault<z.ZodBoolean>;
2155
+ provider: z.ZodOptional<z.ZodEnum<["prisma", "drizzle", "supabase"]>>;
2156
+ }, "strip", z.ZodTypeAny, {
2157
+ enabled: boolean;
2158
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
2159
+ }, {
2160
+ enabled?: boolean | undefined;
2161
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
2162
+ }>;
2163
+ stateManagement: z.ZodObject<{
2164
+ enabled: z.ZodDefault<z.ZodBoolean>;
2165
+ provider: z.ZodDefault<z.ZodEnum<["zustand", "redux", "jotai"]>>;
2166
+ }, "strip", z.ZodTypeAny, {
2167
+ enabled: boolean;
2168
+ provider: "zustand" | "redux" | "jotai";
2169
+ }, {
2170
+ enabled?: boolean | undefined;
2171
+ provider?: "zustand" | "redux" | "jotai" | undefined;
2172
+ }>;
2173
+ }, "strip", z.ZodTypeAny, {
2174
+ authentication: {
2175
+ enabled: boolean;
2176
+ strategies: ("email" | "google" | "github" | "magic-link")[];
2177
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
2178
+ };
2179
+ payments: {
2180
+ enabled: boolean;
2181
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
2182
+ };
2183
+ analytics: {
2184
+ enabled: boolean;
2185
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
2186
+ };
2187
+ database: {
2188
+ enabled: boolean;
2189
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
2190
+ };
2191
+ stateManagement: {
2192
+ enabled: boolean;
2193
+ provider: "zustand" | "redux" | "jotai";
2194
+ };
2195
+ }, {
2196
+ authentication: {
2197
+ enabled?: boolean | undefined;
2198
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
2199
+ strategies?: ("email" | "google" | "github" | "magic-link")[] | undefined;
2200
+ };
2201
+ payments: {
2202
+ enabled?: boolean | undefined;
2203
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
2204
+ };
2205
+ analytics: {
2206
+ enabled?: boolean | undefined;
2207
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
2208
+ };
2209
+ database: {
2210
+ enabled?: boolean | undefined;
2211
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
2212
+ };
2213
+ stateManagement: {
2214
+ enabled?: boolean | undefined;
2215
+ provider?: "zustand" | "redux" | "jotai" | undefined;
2216
+ };
2217
+ }>;
2218
+ settings: z.ZodObject<{
2219
+ appType: z.ZodDefault<z.ZodEnum<["multi-page", "spa"]>>;
2220
+ framework: z.ZodDefault<z.ZodEnum<["next", "react-spa"]>>;
2221
+ router: z.ZodOptional<z.ZodEnum<["react-router", "tanstack-router"]>>;
2222
+ typescript: z.ZodDefault<z.ZodBoolean>;
2223
+ cssFramework: z.ZodDefault<z.ZodEnum<["tailwind", "css-modules"]>>;
2224
+ deployTarget: z.ZodOptional<z.ZodEnum<["vercel", "netlify", "cloudflare", "self-hosted"]>>;
2225
+ autoScaffold: z.ZodDefault<z.ZodBoolean>;
2226
+ }, "strip", z.ZodTypeAny, {
2227
+ appType: "multi-page" | "spa";
2228
+ framework: "next" | "react-spa";
2229
+ typescript: boolean;
2230
+ cssFramework: "tailwind" | "css-modules";
2231
+ autoScaffold: boolean;
2232
+ router?: "react-router" | "tanstack-router" | undefined;
2233
+ deployTarget?: "vercel" | "netlify" | "cloudflare" | "self-hosted" | undefined;
2234
+ }, {
2235
+ appType?: "multi-page" | "spa" | undefined;
2236
+ framework?: "next" | "react-spa" | undefined;
2237
+ router?: "react-router" | "tanstack-router" | undefined;
2238
+ typescript?: boolean | undefined;
2239
+ cssFramework?: "tailwind" | "css-modules" | undefined;
2240
+ deployTarget?: "vercel" | "netlify" | "cloudflare" | "self-hosted" | undefined;
2241
+ autoScaffold?: boolean | undefined;
2242
+ }>;
2243
+ createdAt: z.ZodString;
2244
+ updatedAt: z.ZodString;
2245
+ }, "strip", z.ZodTypeAny, {
2246
+ name: string;
2247
+ description: string;
2248
+ createdAt: string;
2249
+ updatedAt: string;
2250
+ version: string;
2251
+ tokens: {
2252
+ colors: {
2253
+ light: {
2254
+ primary: string;
2255
+ secondary: string;
2256
+ success: string;
2257
+ warning: string;
2258
+ error: string;
2259
+ info: string;
2260
+ background: string;
2261
+ foreground: string;
2262
+ muted: string;
2263
+ border: string;
2264
+ accent?: string | undefined;
2265
+ };
2266
+ dark: {
2267
+ primary: string;
2268
+ secondary: string;
2269
+ success: string;
2270
+ warning: string;
2271
+ error: string;
2272
+ info: string;
2273
+ background: string;
2274
+ foreground: string;
2275
+ muted: string;
2276
+ border: string;
2277
+ accent?: string | undefined;
2278
+ };
2279
+ };
2280
+ spacing: {
2281
+ xs: string;
2282
+ sm: string;
2283
+ md: string;
2284
+ lg: string;
2285
+ xl: string;
2286
+ '2xl': string;
2287
+ '3xl': string;
2288
+ };
2289
+ typography: {
2290
+ fontFamily: {
2291
+ sans: string;
2292
+ mono: string;
2293
+ };
2294
+ fontSize: {
2295
+ xs: string;
2296
+ sm: string;
2297
+ lg: string;
2298
+ xl: string;
2299
+ '2xl': string;
2300
+ '3xl': string;
2301
+ base: string;
2302
+ '4xl': string;
2303
+ };
2304
+ fontWeight: {
2305
+ normal: number;
2306
+ medium: number;
2307
+ semibold: number;
2308
+ bold: number;
2309
+ };
2310
+ lineHeight: {
2311
+ normal: number;
2312
+ tight: number;
2313
+ relaxed: number;
2314
+ };
2315
+ };
2316
+ radius: {
2317
+ sm: string;
2318
+ md: string;
2319
+ lg: string;
2320
+ xl: string;
2321
+ none: string;
2322
+ full: string;
2323
+ };
2324
+ };
2325
+ theme: {
2326
+ defaultMode: "light" | "dark" | "system";
2327
+ allowModeToggle: boolean;
2328
+ };
2329
+ components: {
2330
+ name: string;
2331
+ id: string;
2332
+ category: "typography" | "form" | "layout" | "navigation" | "feedback" | "data-display" | "overlay";
2333
+ source: "custom" | "shadcn";
2334
+ baseClassName: string;
2335
+ variants: {
2336
+ name: string;
2337
+ className: string;
2338
+ description?: string | undefined;
2339
+ }[];
2340
+ sizes: {
2341
+ name: "xs" | "sm" | "md" | "lg" | "xl";
2342
+ className: string;
2343
+ }[];
2344
+ usedInPages: string[];
2345
+ createdAt: string;
2346
+ updatedAt: string;
2347
+ description?: string | undefined;
2348
+ shadcnComponent?: string | undefined;
2349
+ defaultProps?: Record<string, any> | undefined;
2350
+ ariaLabel?: string | undefined;
2351
+ ariaDescribedBy?: string | undefined;
2352
+ }[];
2353
+ layoutBlocks: {
2354
+ name: string;
2355
+ id: string;
2356
+ order: number;
2357
+ role: "custom" | "header" | "footer" | "banner" | "sidebar";
2358
+ sections: {
2359
+ name: string;
2360
+ id: string;
2361
+ componentId: string;
2362
+ order: number;
2363
+ props?: Record<string, any> | undefined;
2364
+ }[];
2365
+ createdAt?: string | undefined;
2366
+ updatedAt?: string | undefined;
2367
+ numericId?: number | undefined;
2368
+ generatedCode?: string | undefined;
2369
+ }[];
2370
+ pages: {
2371
+ name: string;
2372
+ description: string;
2373
+ id: string;
2374
+ layout: "centered" | "sidebar-left" | "sidebar-right" | "full-width" | "grid";
2375
+ createdAt: string;
2376
+ updatedAt: string;
2377
+ sections: {
2378
+ name: string;
2379
+ id: string;
2380
+ componentId: string;
2381
+ order: number;
2382
+ props?: Record<string, any> | undefined;
2383
+ }[];
2384
+ route: string;
2385
+ title: string;
2386
+ requiresAuth: boolean;
2387
+ noIndex: boolean;
2388
+ layoutBlockIds?: string[] | undefined;
2389
+ generatedWithPageCode?: boolean | undefined;
2390
+ pageAnalysis?: {
2391
+ sections?: {
2392
+ name: string;
2393
+ order: number;
2394
+ }[] | undefined;
2395
+ componentUsage?: Record<string, number> | undefined;
2396
+ iconCount?: number | undefined;
2397
+ layoutPattern?: string | undefined;
2398
+ hasForm?: boolean | undefined;
2399
+ analyzedAt?: string | undefined;
2400
+ } | undefined;
2401
+ allowedRoles?: string[] | undefined;
2402
+ ogImage?: string | undefined;
2403
+ }[];
2404
+ features: {
2405
+ authentication: {
2406
+ enabled: boolean;
2407
+ strategies: ("email" | "google" | "github" | "magic-link")[];
2408
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
2409
+ };
2410
+ payments: {
2411
+ enabled: boolean;
2412
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
2413
+ };
2414
+ analytics: {
2415
+ enabled: boolean;
2416
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
2417
+ };
2418
+ database: {
2419
+ enabled: boolean;
2420
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
2421
+ };
2422
+ stateManagement: {
2423
+ enabled: boolean;
2424
+ provider: "zustand" | "redux" | "jotai";
2425
+ };
2426
+ };
2427
+ settings: {
2428
+ appType: "multi-page" | "spa";
2429
+ framework: "next" | "react-spa";
2430
+ typescript: boolean;
2431
+ cssFramework: "tailwind" | "css-modules";
2432
+ autoScaffold: boolean;
2433
+ router?: "react-router" | "tanstack-router" | undefined;
2434
+ deployTarget?: "vercel" | "netlify" | "cloudflare" | "self-hosted" | undefined;
2435
+ };
2436
+ navigation?: {
2437
+ type: "header" | "sidebar" | "both";
2438
+ enabled: boolean;
2439
+ items: {
2440
+ order: number;
2441
+ route: string;
2442
+ requiresAuth: boolean;
2443
+ label: string;
2444
+ icon?: string | undefined;
2445
+ }[];
2446
+ logo?: {
2447
+ text?: string | undefined;
2448
+ image?: string | undefined;
2449
+ } | undefined;
2450
+ } | undefined;
2451
+ coherentVersion?: string | undefined;
2452
+ frameworkVersions?: {
2453
+ next: string;
2454
+ react: string;
2455
+ tailwind: string;
2456
+ } | undefined;
2457
+ }, {
2458
+ name: string;
2459
+ description: string;
2460
+ createdAt: string;
2461
+ updatedAt: string;
2462
+ tokens: {
2463
+ colors: {
2464
+ light: {
2465
+ primary: string;
2466
+ secondary: string;
2467
+ success: string;
2468
+ warning: string;
2469
+ error: string;
2470
+ info: string;
2471
+ background: string;
2472
+ foreground: string;
2473
+ muted: string;
2474
+ border: string;
2475
+ accent?: string | undefined;
2476
+ };
2477
+ dark: {
2478
+ primary: string;
2479
+ secondary: string;
2480
+ success: string;
2481
+ warning: string;
2482
+ error: string;
2483
+ info: string;
2484
+ background: string;
2485
+ foreground: string;
2486
+ muted: string;
2487
+ border: string;
2488
+ accent?: string | undefined;
2489
+ };
2490
+ };
2491
+ spacing: {
2492
+ xs?: string | undefined;
2493
+ sm?: string | undefined;
2494
+ md?: string | undefined;
2495
+ lg?: string | undefined;
2496
+ xl?: string | undefined;
2497
+ '2xl'?: string | undefined;
2498
+ '3xl'?: string | undefined;
2499
+ };
2500
+ typography: {
2501
+ fontFamily: {
2502
+ sans?: string | undefined;
2503
+ mono?: string | undefined;
2504
+ };
2505
+ fontSize: {
2506
+ xs?: string | undefined;
2507
+ sm?: string | undefined;
2508
+ lg?: string | undefined;
2509
+ xl?: string | undefined;
2510
+ '2xl'?: string | undefined;
2511
+ '3xl'?: string | undefined;
2512
+ base?: string | undefined;
2513
+ '4xl'?: string | undefined;
2514
+ };
2515
+ fontWeight: {
2516
+ normal?: number | undefined;
2517
+ medium?: number | undefined;
2518
+ semibold?: number | undefined;
2519
+ bold?: number | undefined;
2520
+ };
2521
+ lineHeight: {
2522
+ normal?: number | undefined;
2523
+ tight?: number | undefined;
2524
+ relaxed?: number | undefined;
2525
+ };
2526
+ };
2527
+ radius: {
2528
+ sm?: string | undefined;
2529
+ md?: string | undefined;
2530
+ lg?: string | undefined;
2531
+ xl?: string | undefined;
2532
+ none?: string | undefined;
2533
+ full?: string | undefined;
2534
+ };
2535
+ };
2536
+ theme: {
2537
+ defaultMode?: "light" | "dark" | "system" | undefined;
2538
+ allowModeToggle?: boolean | undefined;
2539
+ };
2540
+ components: {
2541
+ name: string;
2542
+ id: string;
2543
+ category: "typography" | "form" | "layout" | "navigation" | "feedback" | "data-display" | "overlay";
2544
+ source: "custom" | "shadcn";
2545
+ baseClassName: string;
2546
+ createdAt: string;
2547
+ updatedAt: string;
2548
+ description?: string | undefined;
2549
+ shadcnComponent?: string | undefined;
2550
+ variants?: {
2551
+ name: string;
2552
+ className?: string | undefined;
2553
+ description?: string | undefined;
2554
+ }[] | undefined;
2555
+ sizes?: {
2556
+ name: "xs" | "sm" | "md" | "lg" | "xl";
2557
+ className?: string | undefined;
2558
+ }[] | undefined;
2559
+ defaultProps?: Record<string, any> | undefined;
2560
+ ariaLabel?: string | undefined;
2561
+ ariaDescribedBy?: string | undefined;
2562
+ usedInPages?: string[] | undefined;
2563
+ }[];
2564
+ pages: {
2565
+ name: string;
2566
+ description: string;
2567
+ id: string;
2568
+ layout: "centered" | "sidebar-left" | "sidebar-right" | "full-width" | "grid";
2569
+ createdAt: string;
2570
+ updatedAt: string;
2571
+ route: string;
2572
+ title: string;
2573
+ sections?: {
2574
+ name: string;
2575
+ id: string;
2576
+ componentId: string;
2577
+ order: number;
2578
+ props?: Record<string, any> | undefined;
2579
+ }[] | undefined;
2580
+ layoutBlockIds?: string[] | undefined;
2581
+ generatedWithPageCode?: boolean | undefined;
2582
+ pageAnalysis?: {
2583
+ sections?: {
2584
+ name: string;
2585
+ order: number;
2586
+ }[] | undefined;
2587
+ componentUsage?: Record<string, number> | undefined;
2588
+ iconCount?: number | undefined;
2589
+ layoutPattern?: string | undefined;
2590
+ hasForm?: boolean | undefined;
2591
+ analyzedAt?: string | undefined;
2592
+ } | undefined;
2593
+ requiresAuth?: boolean | undefined;
2594
+ allowedRoles?: string[] | undefined;
2595
+ ogImage?: string | undefined;
2596
+ noIndex?: boolean | undefined;
2597
+ }[];
2598
+ features: {
2599
+ authentication: {
2600
+ enabled?: boolean | undefined;
2601
+ provider?: "custom" | "next-auth" | "clerk" | "supabase" | undefined;
2602
+ strategies?: ("email" | "google" | "github" | "magic-link")[] | undefined;
2603
+ };
2604
+ payments: {
2605
+ enabled?: boolean | undefined;
2606
+ provider?: "stripe" | "paddle" | "lemonsqueezy" | undefined;
2607
+ };
2608
+ analytics: {
2609
+ enabled?: boolean | undefined;
2610
+ provider?: "google-analytics" | "plausible" | "posthog" | undefined;
2611
+ };
2612
+ database: {
2613
+ enabled?: boolean | undefined;
2614
+ provider?: "supabase" | "prisma" | "drizzle" | undefined;
2615
+ };
2616
+ stateManagement: {
2617
+ enabled?: boolean | undefined;
2618
+ provider?: "zustand" | "redux" | "jotai" | undefined;
2619
+ };
2620
+ };
2621
+ settings: {
2622
+ appType?: "multi-page" | "spa" | undefined;
2623
+ framework?: "next" | "react-spa" | undefined;
2624
+ router?: "react-router" | "tanstack-router" | undefined;
2625
+ typescript?: boolean | undefined;
2626
+ cssFramework?: "tailwind" | "css-modules" | undefined;
2627
+ deployTarget?: "vercel" | "netlify" | "cloudflare" | "self-hosted" | undefined;
2628
+ autoScaffold?: boolean | undefined;
2629
+ };
2630
+ navigation?: {
2631
+ items: {
2632
+ order: number;
2633
+ route: string;
2634
+ label: string;
2635
+ requiresAuth?: boolean | undefined;
2636
+ icon?: string | undefined;
2637
+ }[];
2638
+ type?: "header" | "sidebar" | "both" | undefined;
2639
+ enabled?: boolean | undefined;
2640
+ logo?: {
2641
+ text?: string | undefined;
2642
+ image?: string | undefined;
2643
+ } | undefined;
2644
+ } | undefined;
2645
+ version?: string | undefined;
2646
+ coherentVersion?: string | undefined;
2647
+ frameworkVersions?: {
2648
+ next: string;
2649
+ react: string;
2650
+ tailwind: string;
2651
+ } | undefined;
2652
+ layoutBlocks?: {
2653
+ name: string;
2654
+ id: string;
2655
+ createdAt?: string | undefined;
2656
+ updatedAt?: string | undefined;
2657
+ order?: number | undefined;
2658
+ numericId?: number | undefined;
2659
+ role?: "custom" | "header" | "footer" | "banner" | "sidebar" | undefined;
2660
+ sections?: {
2661
+ name: string;
2662
+ id: string;
2663
+ componentId: string;
2664
+ order: number;
2665
+ props?: Record<string, any> | undefined;
2666
+ }[] | undefined;
2667
+ generatedCode?: string | undefined;
2668
+ }[] | undefined;
2669
+ }>;
2670
+ type DesignSystemConfig = z.infer<typeof DesignSystemConfigSchema>;
2671
+ /**
2672
+ * Modification request (from chat command)
2673
+ */
2674
+ interface ModificationRequest {
2675
+ type: 'update-token' | 'add-component' | 'modify-component' | 'add-layout-block' | 'modify-layout-block' | 'add-page' | 'update-page' | 'update-navigation' | 'link-shared' | 'promote-and-link';
2676
+ target: string;
2677
+ changes: Record<string, any>;
2678
+ reason?: string;
2679
+ }
2680
+ /**
2681
+ * Modification result
2682
+ */
2683
+ interface ModificationResult {
2684
+ success: boolean;
2685
+ modified: string[];
2686
+ config: DesignSystemConfig;
2687
+ message: string;
2688
+ warnings?: string[];
2689
+ }
2690
+ /**
2691
+ * Component dependency graph node
2692
+ */
2693
+ interface ComponentDependency {
2694
+ componentId: string;
2695
+ dependsOn: string[];
2696
+ usedBy: string[];
2697
+ }
2698
+ /**
2699
+ * Criteria for searching components
2700
+ */
2701
+ interface ComponentCriteria {
2702
+ id?: string;
2703
+ name?: string;
2704
+ category?: ComponentDefinition['category'];
2705
+ source?: ComponentDefinition['source'];
2706
+ shadcnComponent?: string;
2707
+ usedInPage?: string;
2708
+ hasVariant?: string;
2709
+ hasSize?: string;
2710
+ }
2711
+ /**
2712
+ * Component specification for reuse checking
2713
+ */
2714
+ interface ComponentSpec {
2715
+ name?: string;
2716
+ category?: ComponentDefinition['category'];
2717
+ source?: ComponentDefinition['source'];
2718
+ shadcnComponent?: string;
2719
+ baseClassName?: string;
2720
+ requiredVariants?: string[];
2721
+ requiredSizes?: string[];
2722
+ }
2723
+ /**
2724
+ * Discovery result (from init command)
2725
+ */
2726
+ interface DiscoveryResult {
2727
+ projectType: 'saas' | 'landing' | 'dashboard' | 'api-portal' | 'other';
2728
+ appType: 'multi-page' | 'spa';
2729
+ audience: string;
2730
+ features: {
2731
+ authentication: boolean;
2732
+ payments: boolean;
2733
+ analytics: boolean;
2734
+ database: boolean;
2735
+ stateManagement: boolean;
2736
+ };
2737
+ visualStyle: 'minimal' | 'corporate' | 'playful' | 'custom';
2738
+ primaryColor: string;
2739
+ darkMode: boolean;
2740
+ additionalRequirements?: string;
2741
+ }
2742
+ /**
2743
+ * Validate entire config
2744
+ */
2745
+ declare function validateConfig(config: unknown): DesignSystemConfig;
2746
+ /**
2747
+ * Validate partial config (for updates)
2748
+ */
2749
+ declare function validatePartialConfig(config: unknown): Partial<DesignSystemConfig>;
2750
+ /**
2751
+ * Check if a component ID exists in config
2752
+ */
2753
+ declare function componentExists(config: DesignSystemConfig, componentId: string): boolean;
2754
+ /**
2755
+ * Check if a page route exists
2756
+ */
2757
+ declare function pageRouteExists(config: DesignSystemConfig, route: string): boolean;
2758
+ /**
2759
+ * Get component by ID
2760
+ */
2761
+ declare function getComponent(config: DesignSystemConfig, componentId: string): ComponentDefinition | undefined;
2762
+ /**
2763
+ * Get page by route
2764
+ */
2765
+ declare function getPage(config: DesignSystemConfig, route: string): PageDefinition | undefined;
2766
+ /**
2767
+ * Example: Minimal valid config for Multi-page app
2768
+ */
2769
+ declare const EXAMPLE_MULTIPAGE_CONFIG: DesignSystemConfig;
2770
+ /**
2771
+ * Example: SPA config
2772
+ */
2773
+ declare const EXAMPLE_SPA_CONFIG: DesignSystemConfig;
2774
+
2775
+ /**
2776
+ * Types for Epic 2: Shared Components manifest (coherent.components.json).
2777
+ * See docs/epic-2-shared-components.md.
2778
+ */
2779
+
2780
+ /** Shared component type: layout (layout.tsx), section (reusable block), widget (small element) */
2781
+ declare const SharedComponentTypeSchema: z.ZodEnum<["layout", "section", "widget"]>;
2782
+ type SharedComponentType = z.infer<typeof SharedComponentTypeSchema>;
2783
+ /** Single entry in the shared components registry */
2784
+ declare const SharedComponentEntrySchema: z.ZodObject<{
2785
+ /** Unique ID: CID-001, CID-002, ... */
2786
+ id: z.ZodString;
2787
+ /** Display name (e.g. "Header", "PricingCard") */
2788
+ name: z.ZodString;
2789
+ /** layout | section | widget */
2790
+ type: z.ZodEnum<["layout", "section", "widget"]>;
2791
+ /** Path to component file relative to project root */
2792
+ file: z.ZodString;
2793
+ /** List of file paths that import this component (e.g. ["app/layout.tsx", "app/dashboard/page.tsx"]) */
2794
+ usedIn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2795
+ createdAt: z.ZodOptional<z.ZodString>;
2796
+ /** Human-readable description */
2797
+ description: z.ZodOptional<z.ZodString>;
2798
+ }, "strip", z.ZodTypeAny, {
2799
+ type: "layout" | "section" | "widget";
2800
+ name: string;
2801
+ id: string;
2802
+ file: string;
2803
+ usedIn: string[];
2804
+ description?: string | undefined;
2805
+ createdAt?: string | undefined;
2806
+ }, {
2807
+ type: "layout" | "section" | "widget";
2808
+ name: string;
2809
+ id: string;
2810
+ file: string;
2811
+ description?: string | undefined;
2812
+ createdAt?: string | undefined;
2813
+ usedIn?: string[] | undefined;
2814
+ }>;
2815
+ type SharedComponentEntry = z.infer<typeof SharedComponentEntrySchema>;
2816
+ /** Root schema for coherent.components.json */
2817
+ declare const SharedComponentsManifestSchema: z.ZodObject<{
2818
+ shared: z.ZodDefault<z.ZodArray<z.ZodObject<{
2819
+ /** Unique ID: CID-001, CID-002, ... */
2820
+ id: z.ZodString;
2821
+ /** Display name (e.g. "Header", "PricingCard") */
2822
+ name: z.ZodString;
2823
+ /** layout | section | widget */
2824
+ type: z.ZodEnum<["layout", "section", "widget"]>;
2825
+ /** Path to component file relative to project root */
2826
+ file: z.ZodString;
2827
+ /** List of file paths that import this component (e.g. ["app/layout.tsx", "app/dashboard/page.tsx"]) */
2828
+ usedIn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2829
+ createdAt: z.ZodOptional<z.ZodString>;
2830
+ /** Human-readable description */
2831
+ description: z.ZodOptional<z.ZodString>;
2832
+ }, "strip", z.ZodTypeAny, {
2833
+ type: "layout" | "section" | "widget";
2834
+ name: string;
2835
+ id: string;
2836
+ file: string;
2837
+ usedIn: string[];
2838
+ description?: string | undefined;
2839
+ createdAt?: string | undefined;
2840
+ }, {
2841
+ type: "layout" | "section" | "widget";
2842
+ name: string;
2843
+ id: string;
2844
+ file: string;
2845
+ description?: string | undefined;
2846
+ createdAt?: string | undefined;
2847
+ usedIn?: string[] | undefined;
2848
+ }>, "many">>;
2849
+ /** Next numeric id for new entries (CID-XXX → nextId = 4 for CID-004) */
2850
+ nextId: z.ZodDefault<z.ZodNumber>;
2851
+ }, "strip", z.ZodTypeAny, {
2852
+ shared: {
2853
+ type: "layout" | "section" | "widget";
2854
+ name: string;
2855
+ id: string;
2856
+ file: string;
2857
+ usedIn: string[];
2858
+ description?: string | undefined;
2859
+ createdAt?: string | undefined;
2860
+ }[];
2861
+ nextId: number;
2862
+ }, {
2863
+ shared?: {
2864
+ type: "layout" | "section" | "widget";
2865
+ name: string;
2866
+ id: string;
2867
+ file: string;
2868
+ description?: string | undefined;
2869
+ createdAt?: string | undefined;
2870
+ usedIn?: string[] | undefined;
2871
+ }[] | undefined;
2872
+ nextId?: number | undefined;
2873
+ }>;
2874
+ type SharedComponentsManifest = z.infer<typeof SharedComponentsManifestSchema>;
2875
+ /** Generate next CID string from nextId (e.g. 4 → "CID-004") */
2876
+ declare function formatCid(nextId: number): string;
2877
+ /** Parse numeric part from CID (e.g. "CID-001" → 1) */
2878
+ declare function parseCid(id: string): number | null;
2879
+
2880
+ /**
2881
+ * Design System Manager
2882
+ *
2883
+ * Main orchestrator for design system operations.
2884
+ * All modifications flow through this class.
2885
+ */
2886
+
2887
+ declare class DesignSystemManager {
2888
+ private config;
2889
+ private configPath;
2890
+ private componentRegistry;
2891
+ constructor(configPath: string);
2892
+ /**
2893
+ * Load config from file and validate
2894
+ */
2895
+ load(): Promise<void>;
2896
+ /**
2897
+ * Save config to file
2898
+ */
2899
+ save(): Promise<void>;
2900
+ /**
2901
+ * Get current config
2902
+ */
2903
+ getConfig(): DesignSystemConfig;
2904
+ /**
2905
+ * Replace in-memory config (e.g. after ComponentManager or PageManager mutation)
2906
+ */
2907
+ updateConfig(newConfig: DesignSystemConfig): void;
2908
+ /**
2909
+ * Update design token and cascade to affected components
2910
+ */
2911
+ updateToken(path: string, value: unknown): Promise<ModificationResult>;
2912
+ /**
2913
+ * Add component to registry
2914
+ */
2915
+ addComponent(def: ComponentDefinition): Promise<ModificationResult>;
2916
+ /**
2917
+ * Add page to config
2918
+ */
2919
+ addPage(def: PageDefinition): Promise<ModificationResult>;
2920
+ /**
2921
+ * Find component by ID
2922
+ */
2923
+ findComponent(id: string): ComponentDefinition | null;
2924
+ /**
2925
+ * Get component dependencies
2926
+ */
2927
+ getComponentDependencies(componentId: string): ComponentDependency;
2928
+ /**
2929
+ * Get pages affected by component
2930
+ */
2931
+ getAffectedPages(componentId: string): string[];
2932
+ /**
2933
+ * Load component registry from config
2934
+ */
2935
+ private loadComponentRegistry;
2936
+ /**
2937
+ * Reload config from file
2938
+ */
2939
+ reload(): Promise<void>;
2940
+ }
2941
+
2942
+ /**
2943
+ * Component Manager
2944
+ *
2945
+ * Handles component CRUD operations, registry, and reuse logic.
2946
+ * Prevents duplicate components and tracks usage.
2947
+ */
2948
+
2949
+ declare class ComponentManager {
2950
+ private config;
2951
+ private componentRegistry;
2952
+ private DEBUG;
2953
+ constructor(config: DesignSystemConfig);
2954
+ /**
2955
+ * Load component registry from config
2956
+ */
2957
+ private loadRegistry;
2958
+ /**
2959
+ * Register a new component (with duplicate prevention)
2960
+ */
2961
+ register(def: ComponentDefinition): Promise<ModificationResult>;
2962
+ /**
2963
+ * Create a new component (alias for register)
2964
+ */
2965
+ create(def: ComponentDefinition): Promise<ModificationResult>;
2966
+ /**
2967
+ * Read component by ID
2968
+ */
2969
+ read(id: string): ComponentDefinition | undefined;
2970
+ /**
2971
+ * Update existing component
2972
+ */
2973
+ update(id: string, changes: Partial<ComponentDefinition>): Promise<ModificationResult>;
2974
+ /**
2975
+ * Delete component (with usage check)
2976
+ */
2977
+ delete(id: string): Promise<ModificationResult>;
2978
+ /**
2979
+ * Find components by criteria
2980
+ */
2981
+ find(criteria: ComponentCriteria): ComponentDefinition[];
2982
+ /**
2983
+ * Find single component by criteria (returns first match)
2984
+ */
2985
+ findOne(criteria: ComponentCriteria): ComponentDefinition | null;
2986
+ /**
2987
+ * Get all components
2988
+ */
2989
+ getAllComponents(): ComponentDefinition[];
2990
+ /**
2991
+ * Get components by category
2992
+ */
2993
+ getByCategory(category: ComponentDefinition['category']): ComponentDefinition[];
2994
+ /**
2995
+ * Track component usage in a page
2996
+ */
2997
+ trackUsage(componentId: string, pageRoute: string): void;
2998
+ /**
2999
+ * Remove component usage tracking
3000
+ */
3001
+ untrackUsage(componentId: string, pageRoute: string): void;
3002
+ /**
3003
+ * Get component dependencies
3004
+ */
3005
+ getDependencies(componentId: string): ComponentDependency;
3006
+ /**
3007
+ * Find similar components (for duplicate prevention)
3008
+ */
3009
+ private findSimilar;
3010
+ /**
3011
+ * Check if two class names are similar (simple heuristic)
3012
+ */
3013
+ private isSimilarClassName;
3014
+ /**
3015
+ * Check if component should be reused instead of creating new
3016
+ */
3017
+ shouldReuseComponent(requested: ComponentSpec, existing: ComponentDefinition): boolean;
3018
+ /**
3019
+ * Find best matching component for reuse
3020
+ */
3021
+ findBestMatch(requested: ComponentSpec): ComponentDefinition | null;
3022
+ /**
3023
+ * Update config reference (when config changes externally)
3024
+ */
3025
+ updateConfig(newConfig: DesignSystemConfig): void;
3026
+ /**
3027
+ * Get current config
3028
+ */
3029
+ getConfig(): DesignSystemConfig;
3030
+ }
3031
+
3032
+ /**
3033
+ * Page Manager
3034
+ *
3035
+ * Handles page composition, section management, navigation sync, and code generation.
3036
+ */
3037
+
3038
+ declare class PageManager {
3039
+ private config;
3040
+ private componentManager;
3041
+ constructor(config: DesignSystemConfig, componentManager?: ComponentManager);
3042
+ /**
3043
+ * Create a new page
3044
+ */
3045
+ create(def: PageDefinition): Promise<ModificationResult>;
3046
+ /**
3047
+ * Read page by ID or route
3048
+ */
3049
+ read(idOrRoute: string): PageDefinition | undefined;
3050
+ /**
3051
+ * Update existing page
3052
+ */
3053
+ update(id: string, changes: Partial<PageDefinition>): Promise<ModificationResult>;
3054
+ /**
3055
+ * Delete page
3056
+ */
3057
+ delete(id: string): Promise<ModificationResult>;
3058
+ /**
3059
+ * Add section to page
3060
+ */
3061
+ addSection(pageId: string, section: PageSection, position?: number): Promise<ModificationResult>;
3062
+ /**
3063
+ * Remove section from page
3064
+ */
3065
+ removeSection(pageId: string, sectionIndex: number): Promise<ModificationResult>;
3066
+ /**
3067
+ * Reorder sections in page
3068
+ */
3069
+ reorderSections(pageId: string, order: number[]): Promise<ModificationResult>;
3070
+ /**
3071
+ * Sync pages with navigation
3072
+ */
3073
+ syncWithNavigation(pages: PageDefinition[]): Promise<Navigation | null>;
3074
+ /**
3075
+ * Generate page code (Next.js App Router or React SPA)
3076
+ */
3077
+ generatePage(def: PageDefinition, appType?: 'multi-page' | 'spa'): Promise<string>;
3078
+ /**
3079
+ * Generate Next.js App Router page
3080
+ */
3081
+ private generateNextJsPage;
3082
+ /**
3083
+ * Generate React SPA page (React Router)
3084
+ */
3085
+ private generateSPAPage;
3086
+ /**
3087
+ * Generate layout code
3088
+ */
3089
+ generateLayout(layout: PageLayout, appType?: 'multi-page' | 'spa'): Promise<string>;
3090
+ /**
3091
+ * Generate Next.js App Router layout
3092
+ */
3093
+ private generateNextJsLayout;
3094
+ /**
3095
+ * Generate React SPA layout
3096
+ */
3097
+ private generateSPALayout;
3098
+ /**
3099
+ * Generate imports for page components
3100
+ */
3101
+ private generateImports;
3102
+ /**
3103
+ * Generate metadata object
3104
+ */
3105
+ private generateMetadata;
3106
+ /**
3107
+ * Generate sections JSX
3108
+ */
3109
+ private generateSections;
3110
+ /**
3111
+ * Generate navigation component
3112
+ */
3113
+ private generateNavigation;
3114
+ /**
3115
+ * Get container class based on layout type
3116
+ */
3117
+ private getContainerClass;
3118
+ /**
3119
+ * Get body class based on layout type
3120
+ */
3121
+ private getBodyClass;
3122
+ /**
3123
+ * Convert kebab-case to PascalCase
3124
+ */
3125
+ private toPascalCase;
3126
+ /**
3127
+ * Get all pages
3128
+ */
3129
+ getAllPages(): PageDefinition[];
3130
+ /**
3131
+ * Get pages by route pattern
3132
+ */
3133
+ getPagesByRoute(pattern: string): PageDefinition[];
3134
+ /**
3135
+ * Update config reference
3136
+ */
3137
+ updateConfig(newConfig: DesignSystemConfig): void;
3138
+ /**
3139
+ * Get current config
3140
+ */
3141
+ getConfig(): DesignSystemConfig;
3142
+ }
3143
+
3144
+ /**
3145
+ * Shared Components Registry (Epic 2).
3146
+ * CRUD for coherent.components.json manifest.
3147
+ * See docs/epic-2-shared-components.md.
3148
+ */
3149
+
3150
+ declare const MANIFEST_FILENAME = "coherent.components.json";
3151
+ /**
3152
+ * Get manifest file path for a project root.
3153
+ */
3154
+ declare function getManifestPath(projectRoot: string): string;
3155
+ /**
3156
+ * Load manifest from project root. Creates default manifest if file does not exist.
3157
+ */
3158
+ declare function loadManifest(projectRoot: string): Promise<SharedComponentsManifest>;
3159
+ /**
3160
+ * Save manifest to project root.
3161
+ */
3162
+ declare function saveManifest(projectRoot: string, manifest: SharedComponentsManifest): Promise<void>;
3163
+ /**
3164
+ * Find shared component by ID (e.g. CID-001) or by name (case-insensitive).
3165
+ */
3166
+ declare function findSharedComponent(manifest: SharedComponentsManifest, idOrName: string): SharedComponentEntry | undefined;
3167
+ /**
3168
+ * Allocate next CID and increment nextId. Caller must save manifest after adding the entry.
3169
+ */
3170
+ declare function allocateNextCid(manifest: SharedComponentsManifest): string;
3171
+ interface CreateSharedComponentInput {
3172
+ name: string;
3173
+ type: SharedComponentType;
3174
+ file: string;
3175
+ usedIn?: string[];
3176
+ description?: string;
3177
+ }
3178
+ /**
3179
+ * Add a new shared component: allocate CID, set createdAt, append to shared, increment nextId.
3180
+ * Name deduplication should be done by the caller (e.g. SharedComponentGenerator) via resolveUniqueName()
3181
+ * BEFORE building the file path, so name and file stay consistent.
3182
+ * Returns the created entry. Caller is responsible for saving the manifest and writing the file.
3183
+ */
3184
+ declare function createEntry(manifest: SharedComponentsManifest, input: CreateSharedComponentInput): {
3185
+ entry: SharedComponentEntry;
3186
+ nextManifest: SharedComponentsManifest;
3187
+ };
3188
+ /**
3189
+ * Update usedIn for an entry (e.g. add or remove a file path).
3190
+ */
3191
+ declare function updateUsedIn(manifest: SharedComponentsManifest, id: string, usedIn: string[]): SharedComponentsManifest;
3192
+ /**
3193
+ * Update an entry by ID. Partial update; only provided fields are changed.
3194
+ */
3195
+ declare function updateEntry(manifest: SharedComponentsManifest, id: string, partial: Partial<Omit<SharedComponentEntry, 'id'>>): SharedComponentsManifest;
3196
+ /**
3197
+ * Remove an entry by ID. Returns updated manifest.
3198
+ */
3199
+ declare function removeEntry(manifest: SharedComponentsManifest, id: string): SharedComponentsManifest;
3200
+
3201
+ /**
3202
+ * Component Generator
3203
+ *
3204
+ * Generates React/TypeScript component code from component definitions.
3205
+ * Follows shadcn/ui patterns with variants, sizes, and design tokens.
3206
+ */
3207
+
3208
+ declare class ComponentGenerator {
3209
+ private config;
3210
+ constructor(config: DesignSystemConfig);
3211
+ /**
3212
+ * Generate React component code from definition
3213
+ */
3214
+ generate(def: ComponentDefinition): Promise<string>;
3215
+ /**
3216
+ * Dedicated generators for known component types.
3217
+ * These produce correct, self-contained code regardless of config variant classNames.
3218
+ */
3219
+ private getDedicatedGenerator;
3220
+ /**
3221
+ * Generate full shadcn Card compound component (Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter).
3222
+ * Single-card components only export Card; this gives the model all subcomponents for richer UI.
3223
+ */
3224
+ private generateFullCard;
3225
+ /**
3226
+ * Generate full Table compound component (Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, TableFooter).
3227
+ */
3228
+ private generateFullTable;
3229
+ /**
3230
+ * Generate full Tabs compound component (Tabs, TabsList, TabsTrigger, TabsContent).
3231
+ */
3232
+ private generateFullTabs;
3233
+ /**
3234
+ * Generate Separator component.
3235
+ */
3236
+ private generateSeparator;
3237
+ /**
3238
+ * Generate full Avatar compound component (Avatar, AvatarImage, AvatarFallback).
3239
+ */
3240
+ private generateFullAvatar;
3241
+ /**
3242
+ * Generate full Dialog compound component.
3243
+ */
3244
+ private generateFullDialog;
3245
+ /**
3246
+ * Generate full AlertDialog compound component.
3247
+ */
3248
+ private generateFullAlertDialog;
3249
+ /**
3250
+ * Generate full DropdownMenu compound component.
3251
+ */
3252
+ private generateFullDropdownMenu;
3253
+ /**
3254
+ * Generate full Accordion compound component (Accordion, AccordionItem, AccordionTrigger, AccordionContent).
3255
+ */
3256
+ private generateFullAccordion;
3257
+ /**
3258
+ * Generate Switch (toggle) component — accessible, with hover/focus states.
3259
+ */
3260
+ private generateSwitch;
3261
+ private generateButton;
3262
+ private generateInput;
3263
+ private generateTextarea;
3264
+ private generateLabel;
3265
+ private generateBadge;
3266
+ private generateCheckbox;
3267
+ private generateSelect;
3268
+ /**
3269
+ * Fallback base styles for components that lack explicit className in config.
3270
+ * Ensures generated components always look styled even when AI omits className.
3271
+ */
3272
+ private getFallbackBaseClassName;
3273
+ /**
3274
+ * Fallback variant styles for components whose variants have empty classNames.
3275
+ */
3276
+ private getFallbackVariantClassName;
3277
+ /**
3278
+ * Fallback size styles for components whose sizes have empty classNames.
3279
+ */
3280
+ private getFallbackSizeClassName;
3281
+ /**
3282
+ * Generate shadcn/ui-style component
3283
+ */
3284
+ private generateShadcnComponent;
3285
+ /**
3286
+ * Return a copy of the definition with fallback styles injected where classNames are empty.
3287
+ */
3288
+ private enrichDefinitionWithFallbacks;
3289
+ /**
3290
+ * Generate custom component (simpler, without cva).
3291
+ * Applies fallback baseClassName if the definition has none.
3292
+ */
3293
+ private generateCustomComponent;
3294
+ /**
3295
+ * Generate imports for shadcn-style component
3296
+ */
3297
+ private generateImports;
3298
+ /**
3299
+ * Generate basic imports (without cva)
3300
+ */
3301
+ private generateBasicImports;
3302
+ /**
3303
+ * Generate variants using cva
3304
+ */
3305
+ private generateVariants;
3306
+ /**
3307
+ * Generate props interface
3308
+ */
3309
+ private generatePropsInterface;
3310
+ /**
3311
+ * Generate basic props interface (without VariantProps)
3312
+ */
3313
+ private generateBasicPropsInterface;
3314
+ /**
3315
+ * Generate component code
3316
+ */
3317
+ private generateComponentCode;
3318
+ /**
3319
+ * Generate basic component (without variants)
3320
+ */
3321
+ private generateBasicComponent;
3322
+ /**
3323
+ * Apply design tokens to className string
3324
+ */
3325
+ private applyTokens;
3326
+ /**
3327
+ * Determine HTML element type from component definition
3328
+ */
3329
+ private getHTMLElement;
3330
+ /**
3331
+ * Get TypeScript type for HTML element
3332
+ */
3333
+ private getHTMLElementType;
3334
+ /**
3335
+ * Check if component is a form element (needs forwardRef)
3336
+ */
3337
+ private isFormElement;
3338
+ /**
3339
+ * Convert PascalCase to camelCase
3340
+ */
3341
+ private toCamelCase;
3342
+ /**
3343
+ * Update config reference
3344
+ */
3345
+ updateConfig(newConfig: DesignSystemConfig): void;
3346
+ }
3347
+
3348
+ /**
3349
+ * Design System Generator
3350
+ *
3351
+ * Generates design system pages: layout, home, component showcases, tokens.
3352
+ */
3353
+
3354
+ declare class DesignSystemGenerator {
3355
+ private config;
3356
+ constructor(config: DesignSystemConfig);
3357
+ /**
3358
+ * Generate design system pages structure (dynamic: reads config at runtime)
3359
+ */
3360
+ generateStructure(): Map<string, string>;
3361
+ /**
3362
+ * Generate design system home page (fetches config from API at runtime)
3363
+ */
3364
+ private generateDynamicHome;
3365
+ /**
3366
+ * Generate design system components index page (separate section, not anchor)
3367
+ */
3368
+ private generateComponentsIndexPage;
3369
+ private generateComponentPage;
3370
+ private getComponentDescription;
3371
+ private getUsageCode;
3372
+ private generatePropsTable;
3373
+ private generateTokensHome;
3374
+ private generateColorsPage;
3375
+ private generateTypographyPage;
3376
+ private generateSpacingPage;
3377
+ private generateSitemapPage;
3378
+ }
3379
+
3380
+ /**
3381
+ * Page Generator
3382
+ *
3383
+ * Generates Next.js App Router and React SPA pages with proper component imports.
3384
+ */
3385
+
3386
+ declare class PageGenerator {
3387
+ private config;
3388
+ constructor(config: DesignSystemConfig);
3389
+ /**
3390
+ * Generate page code (Next.js App Router or React SPA).
3391
+ *
3392
+ * DESIGN PRINCIPLES:
3393
+ * - Include meaningful content, not just placeholders
3394
+ * - Use semantic HTML (header, main, section, article)
3395
+ * - Make responsive with Tailwind (md:, lg: breakpoints)
3396
+ * - Add proper spacing and typography
3397
+ * - Include accessibility attributes (aria-labels)
3398
+ */
3399
+ generate(def: PageDefinition, appType?: 'multi-page' | 'spa'): Promise<string>;
3400
+ /**
3401
+ * Generate Next.js App Router page.
3402
+ * CRITICAL: "use client" and export const metadata must never be in the same file (Next.js fails to compile).
3403
+ * - Client (hasForm / hooks): emit "use client", do NOT emit metadata.
3404
+ * - Server (static): emit metadata, do NOT emit "use client".
3405
+ */
3406
+ private generateNextJSPage;
3407
+ /**
3408
+ * Generate React SPA page (React Router)
3409
+ */
3410
+ private generateReactSPAPage;
3411
+ /**
3412
+ * Generate imports for page components
3413
+ */
3414
+ private generateImports;
3415
+ /**
3416
+ * Check if page has form fields
3417
+ */
3418
+ private hasFormFields;
3419
+ /**
3420
+ * Derive a single form state key from placeholder (e.g. "Your Name" -> "name")
3421
+ */
3422
+ private placeholderToStateKey;
3423
+ /**
3424
+ * Collect form state keys from page form fields (for useState initial state)
3425
+ */
3426
+ private getFormStateKeys;
3427
+ /**
3428
+ * Generate form state management (useState + handleSubmit + handleChange)
3429
+ */
3430
+ private generateFormState;
3431
+ /**
3432
+ * Generate metadata object for Next.js
3433
+ */
3434
+ private generateMetadata;
3435
+ /**
3436
+ * Generate sections JSX
3437
+ */
3438
+ private generateSections;
3439
+ /**
3440
+ * Generate section content with smart component rendering.
3441
+ * Button: children for text. Input/Textarea: correct props. Card: children.
3442
+ */
3443
+ private generateSection;
3444
+ /**
3445
+ * Derive form state key for a field (for name/value/onChange)
3446
+ */
3447
+ private getFieldStateKey;
3448
+ /**
3449
+ * Render a single field in a form (input, textarea, button) with state bindings
3450
+ */
3451
+ private renderFieldComponent;
3452
+ /**
3453
+ * Render section with one primary component (smart Button/Input/Textarea/Card)
3454
+ */
3455
+ private renderSectionComponent;
3456
+ /**
3457
+ * Generate props string for component
3458
+ */
3459
+ private generatePropsString;
3460
+ /**
3461
+ * Get container class based on layout type
3462
+ */
3463
+ private getContainerClass;
3464
+ /**
3465
+ * Generate layout code (for root layout)
3466
+ */
3467
+ generateLayout(layout: PageLayout, appType?: 'multi-page' | 'spa'): Promise<string>;
3468
+ /**
3469
+ * Generate Next.js App Router root layout
3470
+ */
3471
+ private generateNextJSLayout;
3472
+ /**
3473
+ * Generate AppNav client component (hides on Design System and Documentation routes)
3474
+ * Documentation is part of Design System; also hide on legacy /docs for consistency.
3475
+ */
3476
+ generateAppNav(): string;
3477
+ /**
3478
+ * Generate React SPA root layout
3479
+ */
3480
+ private generateReactSPALayout;
3481
+ /**
3482
+ * Generate navigation component
3483
+ */
3484
+ private generateNavigation;
3485
+ /**
3486
+ * Convert kebab-case to PascalCase
3487
+ */
3488
+ private toPascalCase;
3489
+ /**
3490
+ * Convert PascalCase to kebab-case
3491
+ */
3492
+ private toKebabCase;
3493
+ /**
3494
+ * Escape string for use in template literals
3495
+ */
3496
+ private escapeString;
3497
+ /**
3498
+ * Update config reference
3499
+ */
3500
+ updateConfig(newConfig: DesignSystemConfig): void;
3501
+ }
3502
+
3503
+ /**
3504
+ * Tailwind Config Generator
3505
+ *
3506
+ * Generates Tailwind CSS configuration from design tokens.
3507
+ */
3508
+
3509
+ declare class TailwindConfigGenerator {
3510
+ private config;
3511
+ constructor(config: DesignSystemConfig);
3512
+ /**
3513
+ * Generate Tailwind config file (TypeScript)
3514
+ */
3515
+ generate(): Promise<string>;
3516
+ /**
3517
+ * Generate Tailwind config as CommonJS (tailwind.config.cjs).
3518
+ * Simplified colors (no dark: {} block) to avoid PostCSS parsing errors.
3519
+ * Dark mode is handled via CSS variables in globals.css.
3520
+ */
3521
+ generateCjs(): Promise<string>;
3522
+ /**
3523
+ * Extract all Tailwind class names from component configs and generate safelist.
3524
+ * This ensures Tailwind generates CSS for classes used dynamically at runtime.
3525
+ */
3526
+ private generateSafelist;
3527
+ /**
3528
+ * Generate color tokens
3529
+ */
3530
+ private generateColors;
3531
+ /**
3532
+ * Generate spacing tokens (quote keys starting with digit, e.g. '2xl')
3533
+ */
3534
+ private generateSpacing;
3535
+ /**
3536
+ * Generate typography tokens
3537
+ */
3538
+ private generateTypography;
3539
+ /**
3540
+ * Generate border radius tokens (quote keys starting with digit)
3541
+ */
3542
+ private generateBorderRadius;
3543
+ /**
3544
+ * Update config reference
3545
+ */
3546
+ updateConfig(newConfig: DesignSystemConfig): void;
3547
+ }
3548
+
3549
+ /**
3550
+ * Shared Component Generator (Epic 2, Story 2.2).
3551
+ * Creates a component file in components/shared/ and registers it in coherent.components.json.
3552
+ */
3553
+
3554
+ /** Convert component name to file name (kebab-case). "Main Header" -> "main-header", "PricingCard" -> "pricing-card" */
3555
+ declare function toSharedFileName(name: string): string;
3556
+ /** Resolve unique display name: if "Header" exists, return "Header2" (or "Header3" etc). */
3557
+ declare function resolveUniqueName(manifest: SharedComponentsManifest, name: string): string;
3558
+ interface GenerateSharedComponentInput {
3559
+ name: string;
3560
+ type: SharedComponentType;
3561
+ /** Optional: full TSX code. If not provided, a placeholder template is used. */
3562
+ code?: string;
3563
+ description?: string;
3564
+ /** Files that will use this component (e.g. ["app/layout.tsx"]). */
3565
+ usedIn?: string[];
3566
+ }
3567
+ interface GenerateSharedComponentResult {
3568
+ id: string;
3569
+ name: string;
3570
+ file: string;
3571
+ }
3572
+ /**
3573
+ * Create a shared component: write file to components/shared/[name].tsx and register in manifest.
3574
+ * Returns the created entry id, name, and file path.
3575
+ */
3576
+ declare function generateSharedComponent(projectRoot: string, input: GenerateSharedComponentInput): Promise<GenerateSharedComponentResult>;
3577
+ /**
3578
+ * Find shared component by ID or name (for modifier/chat).
3579
+ */
3580
+ declare function findSharedComponentByIdOrName(projectRoot: string, idOrName: string): Promise<{
3581
+ id: string;
3582
+ name: string;
3583
+ file: string;
3584
+ } | null>;
3585
+
3586
+ /**
3587
+ * Shared Layout Integration (Epic 2, Story 2.3).
3588
+ * Updates app/layout.tsx to import and render layout-type shared components.
3589
+ */
3590
+ /**
3591
+ * Ensure app/layout.tsx imports and renders layout-type shared components.
3592
+ * - Layout components whose name contains "footer" are rendered after the content wrapper.
3593
+ * - Others are rendered before (right after body open, before AppNav).
3594
+ *
3595
+ * NOTE: Call ensureAuthRouteGroup() after this to wrap Header/Footer
3596
+ * in ShowWhenNotAuthRoute (hides on /design-system/* and auth routes).
3597
+ */
3598
+ declare function integrateSharedLayoutIntoRootLayout(projectRoot: string): Promise<boolean>;
3599
+
3600
+ /**
3601
+ * Project Scaffolder
3602
+ *
3603
+ * Creates complete Next.js 15 project structure with components, pages, and configuration.
3604
+ */
3605
+
3606
+ declare class ProjectScaffolder {
3607
+ private config;
3608
+ private componentGenerator;
3609
+ private pageGenerator;
3610
+ private tailwindGenerator;
3611
+ private projectRoot;
3612
+ constructor(config: DesignSystemConfig, projectRoot?: string);
3613
+ /** Options for scaffold (e.g. custom home page content from WELCOME.md) */
3614
+ private scaffoldOptions?;
3615
+ /**
3616
+ * Scaffold complete Next.js project
3617
+ */
3618
+ scaffold(options?: {
3619
+ homePageContent?: string;
3620
+ }): Promise<void>;
3621
+ /**
3622
+ * Scaffold Next.js 15 project
3623
+ */
3624
+ private scaffoldNextJsProject;
3625
+ /**
3626
+ * Create directory structure
3627
+ */
3628
+ private createDirectories;
3629
+ /**
3630
+ * Generate package.json
3631
+ */
3632
+ private generatePackageJson;
3633
+ /**
3634
+ * Generate next.config.js
3635
+ */
3636
+ private generateNextConfig;
3637
+ /**
3638
+ * Generate tsconfig.json
3639
+ */
3640
+ private generateTsConfig;
3641
+ /**
3642
+ * Generate Tailwind config as .cjs so require() works; avoids jiti/sucrase (SyntaxError 51:12).
3643
+ */
3644
+ generateTailwindConfig(): Promise<void>;
3645
+ /**
3646
+ * Generate tailwind.config.ts (TypeScript ESM format).
3647
+ * Used when overwriting create-next-app's default tailwind.config.ts.
3648
+ */
3649
+ generateTailwindConfigTs(): Promise<void>;
3650
+ /**
3651
+ * Generate postcss.config.mjs (ESM for Next.js).
3652
+ * No explicit Tailwind config path — Tailwind auto-discovers tailwind.config.*.
3653
+ */
3654
+ private generatePostCssConfig;
3655
+ /**
3656
+ * Generate globals.css with Tailwind directives and CSS variables from design tokens.
3657
+ */
3658
+ generateGlobalsCss(): Promise<void>;
3659
+ /**
3660
+ * Blend two hex colors. ratio=0 returns color1, ratio=1 returns color2.
3661
+ * Used to derive muted-foreground (a mid-gray between foreground and background).
3662
+ */
3663
+ private static blendColors;
3664
+ private static contrastingForeground;
3665
+ /**
3666
+ * Generate lib/utils.ts (cn utility)
3667
+ */
3668
+ private generateUtils;
3669
+ /**
3670
+ * Generate all components
3671
+ */
3672
+ private generateComponents;
3673
+ /**
3674
+ * Generate all pages. Root route (/) uses homePageContent if provided (welcome page from WELCOME.md).
3675
+ */
3676
+ private generatePages;
3677
+ /**
3678
+ * Generate root layout (and AppNav when navigation enabled).
3679
+ * Public so init can call it after create-next-app to add Design System button and Coherent layout.
3680
+ */
3681
+ generateRootLayout(): Promise<void>;
3682
+ private generateDefaultPages;
3683
+ private generateFavicon;
3684
+ /**
3685
+ * Generate .gitignore
3686
+ */
3687
+ private generateGitignore;
3688
+ /**
3689
+ * Generate README.md
3690
+ */
3691
+ private generateReadme;
3692
+ /**
3693
+ * Get page path from route
3694
+ */
3695
+ private getPagePath;
3696
+ /**
3697
+ * Convert PascalCase to kebab-case
3698
+ */
3699
+ private toKebabCase;
3700
+ /**
3701
+ * Generate VS Code settings for Tailwind CSS support
3702
+ */
3703
+ private generateVSCodeSettings;
3704
+ /**
3705
+ * Generate design system pages (layout, home, component showcases, tokens)
3706
+ */
3707
+ generateDesignSystemPages(): Promise<void>;
3708
+ /**
3709
+ * Generate docs pages under Design System (layout, index, components, tokens, for-designers, recommendations) and recommendations.md
3710
+ */
3711
+ generateDocsPages(): Promise<void>;
3712
+ private getDocsLayoutContent;
3713
+ /**
3714
+ * Single Documentation page: one scrollable page with all sections (no cards/sub-pages).
3715
+ * Use browser Print / Save as PDF to download.
3716
+ */
3717
+ private getDocsSinglePageContent;
3718
+ private getDocsRecommendationsPageContent;
3719
+ private getRecommendationsMdPlaceholder;
3720
+ /**
3721
+ * Write file to project root
3722
+ */
3723
+ private writeFile;
3724
+ /**
3725
+ * Update config reference
3726
+ */
3727
+ updateConfig(newConfig: DesignSystemConfig): void;
3728
+ }
3729
+
3730
+ interface BasePageContent {
3731
+ title: string;
3732
+ description: string;
3733
+ }
3734
+ interface DashboardContent extends BasePageContent {
3735
+ stats: Array<{
3736
+ label: string;
3737
+ value: string;
3738
+ change?: string;
3739
+ icon?: string;
3740
+ }>;
3741
+ recentActivity?: Array<{
3742
+ title: string;
3743
+ description: string;
3744
+ time: string;
3745
+ }>;
3746
+ }
3747
+ interface PricingContent extends BasePageContent {
3748
+ tiers: Array<{
3749
+ name: string;
3750
+ price: string;
3751
+ period?: string;
3752
+ description: string;
3753
+ features: string[];
3754
+ cta: string;
3755
+ highlighted?: boolean;
3756
+ }>;
3757
+ faq?: Array<{
3758
+ question: string;
3759
+ answer: string;
3760
+ }>;
3761
+ }
3762
+ interface ListingContent extends BasePageContent {
3763
+ items: Array<{
3764
+ title: string;
3765
+ description: string;
3766
+ badge?: string;
3767
+ icon?: string;
3768
+ link?: string;
3769
+ }>;
3770
+ filters?: string[];
3771
+ columns?: 2 | 3 | 4;
3772
+ }
3773
+ interface ContactContent extends BasePageContent {
3774
+ fields: Array<{
3775
+ name: string;
3776
+ label: string;
3777
+ type: 'text' | 'email' | 'tel' | 'textarea';
3778
+ placeholder: string;
3779
+ required?: boolean;
3780
+ }>;
3781
+ submitLabel: string;
3782
+ contactInfo?: Array<{
3783
+ label: string;
3784
+ value: string;
3785
+ icon?: string;
3786
+ }>;
3787
+ }
3788
+ interface SettingsContent extends BasePageContent {
3789
+ sections: Array<{
3790
+ title: string;
3791
+ description: string;
3792
+ fields: Array<{
3793
+ name: string;
3794
+ label: string;
3795
+ type: 'text' | 'email' | 'toggle' | 'select' | 'password';
3796
+ value?: string;
3797
+ options?: string[];
3798
+ }>;
3799
+ }>;
3800
+ }
3801
+ interface LandingContent extends BasePageContent {
3802
+ hero: {
3803
+ headline: string;
3804
+ subheadline: string;
3805
+ primaryCta: string;
3806
+ secondaryCta?: string;
3807
+ };
3808
+ features: Array<{
3809
+ title: string;
3810
+ description: string;
3811
+ icon?: string;
3812
+ }>;
3813
+ finalCta?: {
3814
+ headline: string;
3815
+ description: string;
3816
+ buttonText: string;
3817
+ };
3818
+ }
3819
+ interface BlogContent extends BasePageContent {
3820
+ posts: Array<{
3821
+ title: string;
3822
+ excerpt: string;
3823
+ date: string;
3824
+ author: string;
3825
+ slug?: string;
3826
+ }>;
3827
+ }
3828
+ interface ProfileContent extends BasePageContent {
3829
+ avatar?: string;
3830
+ name: string;
3831
+ email: string;
3832
+ fields: Array<{
3833
+ label: string;
3834
+ value: string;
3835
+ }>;
3836
+ connectedAccounts?: Array<{
3837
+ name: string;
3838
+ connected: boolean;
3839
+ }>;
3840
+ activity?: Array<{
3841
+ title: string;
3842
+ time: string;
3843
+ }>;
3844
+ }
3845
+ interface OnboardingContent extends BasePageContent {
3846
+ steps: Array<{
3847
+ title: string;
3848
+ description: string;
3849
+ fields?: Array<{
3850
+ name: string;
3851
+ label: string;
3852
+ type: string;
3853
+ }>;
3854
+ }>;
3855
+ totalSteps: number;
3856
+ }
3857
+ interface GalleryContent extends BasePageContent {
3858
+ images: Array<{
3859
+ src: string;
3860
+ alt: string;
3861
+ title?: string;
3862
+ }>;
3863
+ categories?: string[];
3864
+ }
3865
+ interface FaqContent extends BasePageContent {
3866
+ categories?: string[];
3867
+ items: Array<{
3868
+ question: string;
3869
+ answer: string;
3870
+ category?: string;
3871
+ }>;
3872
+ }
3873
+ interface ChangelogContent extends BasePageContent {
3874
+ versions: Array<{
3875
+ version: string;
3876
+ date: string;
3877
+ badge?: string;
3878
+ entries: Array<{
3879
+ type: string;
3880
+ text: string;
3881
+ }>;
3882
+ }>;
3883
+ }
3884
+ interface TemplateOptions {
3885
+ route: string;
3886
+ pageName: string;
3887
+ }
3888
+ type PageContent = {
3889
+ pageType: 'dashboard';
3890
+ content: DashboardContent;
3891
+ } | {
3892
+ pageType: 'pricing';
3893
+ content: PricingContent;
3894
+ } | {
3895
+ pageType: 'listing';
3896
+ content: ListingContent;
3897
+ } | {
3898
+ pageType: 'contact';
3899
+ content: ContactContent;
3900
+ } | {
3901
+ pageType: 'settings';
3902
+ content: SettingsContent;
3903
+ } | {
3904
+ pageType: 'landing';
3905
+ content: LandingContent;
3906
+ } | {
3907
+ pageType: 'blog';
3908
+ content: BlogContent;
3909
+ } | {
3910
+ pageType: 'profile';
3911
+ content: ProfileContent;
3912
+ } | {
3913
+ pageType: 'onboarding';
3914
+ content: OnboardingContent;
3915
+ } | {
3916
+ pageType: 'gallery';
3917
+ content: GalleryContent;
3918
+ } | {
3919
+ pageType: 'faq';
3920
+ content: FaqContent;
3921
+ } | {
3922
+ pageType: 'changelog';
3923
+ content: ChangelogContent;
3924
+ };
3925
+
3926
+ type TemplateFn = (content: any, options: TemplateOptions) => string;
3927
+ declare function getTemplateForPageType(pageType: string): TemplateFn | null;
3928
+ declare function getSupportedPageTypes(): string[];
3929
+
3930
+ /**
3931
+ * Figma import types (Story 3.8–3.12).
3932
+ * Intermediate representation between raw Figma API response and Coherent app.
3933
+ */
3934
+ /** Raw Figma API file response (minimal shape we consume). */
3935
+ interface FigmaFileResponse {
3936
+ name: string;
3937
+ lastModified?: string;
3938
+ version?: string;
3939
+ document: FigmaDocumentNode;
3940
+ components?: Record<string, FigmaComponentMeta>;
3941
+ componentSets?: Record<string, unknown>;
3942
+ styles?: Record<string, FigmaStyleMeta>;
3943
+ schemaVersion?: number;
3944
+ }
3945
+ interface FigmaDocumentNode {
3946
+ id: string;
3947
+ name: string;
3948
+ type: 'DOCUMENT';
3949
+ children?: FigmaNode[];
3950
+ }
3951
+ /** Generic node in Figma tree (frame, component instance, text, etc.). */
3952
+ interface FigmaNode {
3953
+ id: string;
3954
+ name: string;
3955
+ type: string;
3956
+ visible?: boolean;
3957
+ children?: FigmaNode[];
3958
+ layoutMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL';
3959
+ itemSpacing?: number;
3960
+ paddingLeft?: number;
3961
+ paddingRight?: number;
3962
+ paddingTop?: number;
3963
+ paddingBottom?: number;
3964
+ primaryAxisSizingMode?: string;
3965
+ counterAxisSizingMode?: string;
3966
+ fills?: Array<{
3967
+ type: string;
3968
+ color?: FigmaRgba;
3969
+ }>;
3970
+ strokes?: unknown[];
3971
+ effects?: unknown[];
3972
+ style?: {
3973
+ fontFamily?: string;
3974
+ fontSize?: number;
3975
+ fontWeight?: number;
3976
+ };
3977
+ characters?: string;
3978
+ componentId?: string;
3979
+ componentProperties?: Record<string, unknown>;
3980
+ }
3981
+ interface FigmaRgba {
3982
+ r: number;
3983
+ g: number;
3984
+ b: number;
3985
+ a: number;
3986
+ }
3987
+ interface FigmaComponentMeta {
3988
+ key: string;
3989
+ name: string;
3990
+ description?: string;
3991
+ }
3992
+ interface FigmaStyleMeta {
3993
+ name: string;
3994
+ styleType: 'FILL' | 'TEXT' | 'EFFECT';
3995
+ description?: string;
3996
+ }
3997
+ /** Our intermediate data (output of FigmaParser, input to token/component/page extractors). */
3998
+ interface FigmaIntermediateData {
3999
+ fileName: string;
4000
+ fileKey: string;
4001
+ pages: FigmaPageData[];
4002
+ components: FigmaComponentData[];
4003
+ colorStyles: FigmaColorStyle[];
4004
+ textStyles: FigmaTextStyle[];
4005
+ effectStyles: FigmaEffectStyle[];
4006
+ }
4007
+ interface FigmaPageData {
4008
+ id: string;
4009
+ name: string;
4010
+ /** Route segment (e.g. "dashboard", "pricing"). "Home" → "" for root. */
4011
+ route: string;
4012
+ children: FigmaNode[];
4013
+ layout?: FigmaLayout;
4014
+ }
4015
+ interface FigmaLayout {
4016
+ layoutMode: 'NONE' | 'HORIZONTAL' | 'VERTICAL';
4017
+ itemSpacing: number;
4018
+ paddingLeft: number;
4019
+ paddingRight: number;
4020
+ paddingTop: number;
4021
+ paddingBottom: number;
4022
+ }
4023
+ interface FigmaComponentData {
4024
+ id: string;
4025
+ key: string;
4026
+ name: string;
4027
+ description?: string;
4028
+ /** Resolved node tree for this component (from file.document). */
4029
+ node?: FigmaNode;
4030
+ variants?: FigmaVariant[];
4031
+ properties?: FigmaProperty[];
4032
+ layout?: FigmaLayout;
4033
+ }
4034
+ interface FigmaVariant {
4035
+ name: string;
4036
+ value: string;
4037
+ }
4038
+ interface FigmaProperty {
4039
+ name: string;
4040
+ type: string;
4041
+ value: string | number | boolean;
4042
+ }
4043
+ interface FigmaColorStyle {
4044
+ id: string;
4045
+ name: string;
4046
+ color: FigmaRgba;
4047
+ }
4048
+ interface FigmaTextStyle {
4049
+ id: string;
4050
+ name: string;
4051
+ fontFamily?: string;
4052
+ fontSize?: number;
4053
+ fontWeight?: number;
4054
+ lineHeight?: number;
4055
+ }
4056
+ interface FigmaEffectStyle {
4057
+ id: string;
4058
+ name: string;
4059
+ type: 'DROP_SHADOW' | 'INNER_SHADOW';
4060
+ radius?: number;
4061
+ offset?: {
4062
+ x: number;
4063
+ y: number;
4064
+ };
4065
+ color?: FigmaRgba;
4066
+ }
4067
+
4068
+ /**
4069
+ * Figma REST API client (Story 3.8).
4070
+ * Fetches file and optional image exports.
4071
+ */
4072
+ interface FigmaClientOptions {
4073
+ /** Callback for progress (e.g. "Fetching...", "Parsing..."). */
4074
+ onProgress?: (message: string) => void;
4075
+ }
4076
+ declare class FigmaClient {
4077
+ private token;
4078
+ private options;
4079
+ constructor(token: string, options?: FigmaClientOptions);
4080
+ private progress;
4081
+ /**
4082
+ * Extract file key from Figma URL or return as-is if already a key.
4083
+ * e.g. https://www.figma.com/file/ABC123/Title → ABC123
4084
+ */
4085
+ static extractFileKey(urlOrKey: string): string | null;
4086
+ /**
4087
+ * Fetch file structure from Figma API.
4088
+ * GET https://api.figma.com/v1/files/:key
4089
+ */
4090
+ private fetchWithRetry;
4091
+ private safeJson;
4092
+ fetchFile(fileKey: string): Promise<unknown>;
4093
+ /**
4094
+ * Fetch image URLs for given node IDs (for raster or vector export).
4095
+ * GET https://api.figma.com/v1/images/:key?ids=id1,id2&format=svg
4096
+ */
4097
+ fetchImages(fileKey: string, nodeIds: string[], options?: {
4098
+ format?: 'svg' | 'png';
4099
+ scale?: number;
4100
+ }): Promise<Record<string, string>>;
4101
+ }
4102
+
4103
+ /**
4104
+ * Parse raw Figma API response into FigmaIntermediateData (Story 3.8).
4105
+ */
4106
+
4107
+ /**
4108
+ * Parse raw file response into our intermediate format.
4109
+ */
4110
+ declare function parseFigmaFileResponse(raw: unknown, fileKey: string): FigmaIntermediateData;
4111
+ /** Convert Figma RGBA (0–1) to hex. */
4112
+ declare function figmaRgbaToHex(rgba: FigmaRgba): string;
4113
+
4114
+ /**
4115
+ * Extract Coherent design tokens from Figma intermediate data (Story 3.9).
4116
+ * Maps Figma color/text/effect styles to ColorToken, typography, and radius.
4117
+ */
4118
+
4119
+ /** Result of token extraction: partial tokens to merge with existing config. */
4120
+ interface FigmaTokenExtractionResult {
4121
+ /** Partial color tokens (light/dark). Merge with defaults for full ColorToken. */
4122
+ colors: {
4123
+ light: Partial<ColorToken>;
4124
+ dark: Partial<ColorToken>;
4125
+ };
4126
+ /** Optional typography overrides (e.g. fontSize from text styles). */
4127
+ typography?: Partial<DesignTokens['typography']>;
4128
+ /** Optional radius (e.g. from effect styles or first radius-like style). */
4129
+ radius?: Partial<DesignTokens['radius']>;
4130
+ }
4131
+ /**
4132
+ * Extract design tokens from Figma intermediate data.
4133
+ * Uses style names to map to Coherent semantic tokens; fills missing from defaults.
4134
+ */
4135
+ declare function extractTokensFromFigma(data: FigmaIntermediateData): FigmaTokenExtractionResult;
4136
+ /**
4137
+ * Merge extracted tokens with default tokens to produce full DesignTokens.colors.
4138
+ * Used so buildCssVariables receives a full config.
4139
+ */
4140
+ declare function mergeExtractedColorsWithDefaults(extracted: FigmaTokenExtractionResult): {
4141
+ light: ColorToken;
4142
+ dark: ColorToken;
4143
+ };
4144
+
4145
+ /**
4146
+ * Normalize Figma components to Coherent base (Button, Card, Input) or new shared (CID-XXX).
4147
+ * Story 3.10: name-based mapping, valid TSX with Tailwind for shared.
4148
+ */
4149
+
4150
+ /** Known base component ids in @/components/ui (shadcn-style). */
4151
+ declare const FIGMA_BASE_IDS: readonly ["button", "card", "input", "textarea", "badge", "label"];
4152
+ type FigmaBaseId = (typeof FIGMA_BASE_IDS)[number];
4153
+ /** Result for one Figma component: mapped to base or to new shared. */
4154
+ type FigmaNormalizedEntry = {
4155
+ figmaId: string;
4156
+ figmaKey: string;
4157
+ figmaName: string;
4158
+ kind: 'base';
4159
+ baseId: FigmaBaseId;
4160
+ } | {
4161
+ figmaId: string;
4162
+ figmaKey: string;
4163
+ figmaName: string;
4164
+ kind: 'shared';
4165
+ suggestedName: string;
4166
+ suggestedTsx: string;
4167
+ };
4168
+ /** Full result: entries + mapping figmaId → baseId or shared (cid filled by CLI after manifest write). */
4169
+ interface FigmaNormalizationResult {
4170
+ entries: FigmaNormalizedEntry[];
4171
+ /** figmaId → baseId for base; figmaId → cid for shared (set after creating shared component). */
4172
+ figmaToCoherent: Map<string, {
4173
+ kind: 'base';
4174
+ baseId: FigmaBaseId;
4175
+ } | {
4176
+ kind: 'shared';
4177
+ cid: string;
4178
+ name: string;
4179
+ file: string;
4180
+ }>;
4181
+ }
4182
+ /**
4183
+ * Map Figma component name to Coherent base component id, or null if unknown.
4184
+ * Normalize to Coherent patterns: Button/btn → button, Card → card, Input/TextField → input.
4185
+ */
4186
+ declare function figmaComponentNameToBaseId(name: string): FigmaBaseId | null;
4187
+ /**
4188
+ * Generate valid TSX for a shared component from Figma.
4189
+ * Uses Tailwind; layout from FigmaLayout or default flex. Normalizes to Coherent patterns (no pixel-perfect).
4190
+ */
4191
+ declare function generateSharedComponentTsx(displayName: string, layout?: FigmaLayout | null): string;
4192
+ /**
4193
+ * Normalize all Figma components: map to base or shared with suggested TSX.
4194
+ */
4195
+ declare function normalizeFigmaComponents(data: FigmaIntermediateData): FigmaNormalizationResult;
4196
+ /** After creating a shared component in manifest, update the map with real cid and file. */
4197
+ declare function setSharedMapping(result: FigmaNormalizationResult, figmaId: string, cid: string, name: string, file: string): void;
4198
+
4199
+ /**
4200
+ * Generate Next.js App Router pages from Figma frames (Story 3.11).
4201
+ * Frame → route → app/{route}/page.tsx; layout from auto-layout; component instances from map.
4202
+ */
4203
+
4204
+ /** Component map: figma component definition id → base or shared (from coherent.figma-component-map.json). */
4205
+ type FigmaComponentMap = Record<string, {
4206
+ kind: 'base';
4207
+ baseId: string;
4208
+ } | {
4209
+ kind: 'shared';
4210
+ cid: string;
4211
+ name: string;
4212
+ file: string;
4213
+ }>;
4214
+ /** One generated page: file path and full TSX content. */
4215
+ interface GeneratedPage {
4216
+ route: string;
4217
+ filePath: string;
4218
+ content: string;
4219
+ }
4220
+ /**
4221
+ * Get Next.js app page file path for a route.
4222
+ * "" → app/page.tsx; "dashboard" → app/dashboard/page.tsx.
4223
+ */
4224
+ declare function getPageFilePath(route: string): string;
4225
+ /**
4226
+ * Generate full page.tsx content for one Figma frame.
4227
+ */
4228
+ declare function generatePageFromFrame(page: FigmaPageData, componentMap: FigmaComponentMap, options?: {
4229
+ pageTitle?: string;
4230
+ }): string;
4231
+ /**
4232
+ * Generate all pages from Figma intermediate data and component map.
4233
+ */
4234
+ declare function generatePagesFromFigma(pages: FigmaPageData[], componentMap: FigmaComponentMap, options?: {
4235
+ pageTitle?: (page: FigmaPageData) => string;
4236
+ }): GeneratedPage[];
4237
+
4238
+ /**
4239
+ * Framework Versions
4240
+ *
4241
+ * Centralized version management for all dependencies.
4242
+ * Ensures consistent versions across generated projects.
4243
+ */
4244
+ declare const FRAMEWORK_VERSIONS: {
4245
+ readonly next: "15.2.4";
4246
+ readonly react: "18.3.1";
4247
+ readonly 'react-dom': "18.3.1";
4248
+ readonly tailwindcss: "3.4.17";
4249
+ readonly postcss: "8.4.49";
4250
+ readonly autoprefixer: "10.4.20";
4251
+ readonly typescript: "5.7.2";
4252
+ readonly '@types/node': "22.10.5";
4253
+ readonly '@types/react': "18.3.12";
4254
+ readonly '@types/react-dom': "18.3.1";
4255
+ readonly eslint: "9.17.0";
4256
+ readonly 'eslint-config-next': "15.2.4";
4257
+ };
4258
+ declare const CLI_VERSION = "0.1.0";
4259
+
4260
+ /**
4261
+ * Build CSS variables string for :root and .dark (design tokens).
4262
+ * Used in layout inline style to avoid Next.js build CSS pipeline bug (SyntaxError 51:12).
4263
+ */
4264
+
4265
+ declare function buildCssVariables(config: DesignSystemConfig): string;
4266
+
4267
+ /**
4268
+ * Story 2.11 Part C: Consistency audit for shared components.
4269
+ * - Verify usedIn vs actual imports
4270
+ * - Find inline code similar to existing shared (signature match)
4271
+ * - Find unused shared components
4272
+ */
4273
+ interface AuditEntryResult {
4274
+ id: string;
4275
+ name: string;
4276
+ type: string;
4277
+ status: 'ok' | 'unused' | 'used_but_mismatch' | 'has_inline_duplicates';
4278
+ usedIn: string[];
4279
+ message: string;
4280
+ suggestions?: string[];
4281
+ }
4282
+ interface AuditResult {
4283
+ shared: AuditEntryResult[];
4284
+ summary: {
4285
+ total: number;
4286
+ consistent: number;
4287
+ withInlineDuplicates: number;
4288
+ unused: number;
4289
+ usedButMismatch: number;
4290
+ };
4291
+ }
4292
+ /**
4293
+ * Run full consistency audit.
4294
+ */
4295
+ declare function runAudit(projectRoot: string): Promise<AuditResult>;
4296
+
4297
+ export { type AuditEntryResult, type AuditResult, type BlogContent, CLI_VERSION, type ChangelogContent, type ColorToken, ColorTokenSchema, type ComponentCriteria, type ComponentDefinition, ComponentDefinitionSchema, type ComponentDependency, ComponentGenerator, ComponentManager, type ComponentSize, ComponentSizeSchema, type ComponentSpec, type ComponentVariant, ComponentVariantSchema, type ContactContent, type CreateSharedComponentInput, type DashboardContent, type DesignSystemConfig, DesignSystemConfigSchema, DesignSystemGenerator, DesignSystemManager, type DesignTokens, DesignTokensSchema, type DiscoveryResult, EXAMPLE_MULTIPAGE_CONFIG, EXAMPLE_SPA_CONFIG, FIGMA_BASE_IDS, FRAMEWORK_VERSIONS, type FaqContent, type Features, FeaturesSchema, type FigmaBaseId, FigmaClient, type FigmaClientOptions, type FigmaColorStyle, type FigmaComponentData, type FigmaComponentMap, type FigmaComponentMeta, type FigmaDocumentNode, type FigmaEffectStyle, type FigmaFileResponse, type FigmaIntermediateData, type FigmaLayout, type FigmaNode, type FigmaNormalizationResult, type FigmaNormalizedEntry, type FigmaPageData, type FigmaProperty, type FigmaRgba, type FigmaStyleMeta, type FigmaTextStyle, type FigmaTokenExtractionResult, type FigmaVariant, type GalleryContent, type GenerateSharedComponentInput, type GenerateSharedComponentResult, type GeneratedPage, type LandingContent, type LayoutBlockDefinition, LayoutBlockDefinitionSchema, type ListingContent, MANIFEST_FILENAME, type ModificationRequest, type ModificationResult, type Navigation, type NavigationItem, NavigationItemSchema, NavigationSchema, type OnboardingContent, type PageAnalysis, PageAnalysisSchema, type PageContent, type PageDefinition, PageDefinitionSchema, PageGenerator, type PageLayout, PageLayoutSchema, PageManager, type PageSection, PageSectionSchema, type PricingContent, type ProfileContent, ProjectScaffolder, type RadiusToken, RadiusTokenSchema, type SettingsContent, type SharedComponentEntry, SharedComponentEntrySchema, type SharedComponentType, SharedComponentTypeSchema, type SharedComponentsManifest, SharedComponentsManifestSchema, type SpacingToken, SpacingTokenSchema, TailwindConfigGenerator, type TemplateOptions, type TypographyToken, TypographyTokenSchema, allocateNextCid, buildCssVariables, componentExists, createEntry, extractTokensFromFigma, figmaComponentNameToBaseId, figmaRgbaToHex, findSharedComponent, findSharedComponentByIdOrName, formatCid, generatePageFromFrame, generatePagesFromFigma, generateSharedComponent, generateSharedComponentTsx, getComponent, getManifestPath, getPage, getPageFilePath, getSupportedPageTypes, getTemplateForPageType, integrateSharedLayoutIntoRootLayout, loadManifest, mergeExtractedColorsWithDefaults, normalizeFigmaComponents, pageRouteExists, parseCid, parseFigmaFileResponse, removeEntry, resolveUniqueName, runAudit, saveManifest, setSharedMapping, toSharedFileName, updateEntry, updateUsedIn, validateConfig, validatePartialConfig };