@aibloom/schemas 0.2.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 (54) hide show
  1. package/README.md +20 -0
  2. package/dist/config.d.ts +124 -0
  3. package/dist/config.d.ts.map +1 -0
  4. package/dist/config.js +27 -0
  5. package/dist/config.js.map +1 -0
  6. package/dist/design-reference.d.ts +860 -0
  7. package/dist/design-reference.d.ts.map +1 -0
  8. package/dist/design-reference.js +147 -0
  9. package/dist/design-reference.js.map +1 -0
  10. package/dist/design-system.d.ts +191 -0
  11. package/dist/design-system.d.ts.map +1 -0
  12. package/dist/design-system.js +47 -0
  13. package/dist/design-system.js.map +1 -0
  14. package/dist/design-tokens.d.ts +318 -0
  15. package/dist/design-tokens.d.ts.map +1 -0
  16. package/dist/design-tokens.js +78 -0
  17. package/dist/design-tokens.js.map +1 -0
  18. package/dist/framework.d.ts +90 -0
  19. package/dist/framework.d.ts.map +1 -0
  20. package/dist/framework.js +34 -0
  21. package/dist/framework.js.map +1 -0
  22. package/dist/host-task.d.ts +197 -0
  23. package/dist/host-task.d.ts.map +1 -0
  24. package/dist/host-task.js +38 -0
  25. package/dist/host-task.js.map +1 -0
  26. package/dist/implementation-plan.d.ts +69 -0
  27. package/dist/implementation-plan.d.ts.map +1 -0
  28. package/dist/implementation-plan.js +21 -0
  29. package/dist/implementation-plan.js.map +1 -0
  30. package/dist/index.d.ts +13 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +13 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/page-shape.d.ts +334 -0
  35. package/dist/page-shape.d.ts.map +1 -0
  36. package/dist/page-shape.js +62 -0
  37. package/dist/page-shape.js.map +1 -0
  38. package/dist/product.d.ts +153 -0
  39. package/dist/product.d.ts.map +1 -0
  40. package/dist/product.js +32 -0
  41. package/dist/product.js.map +1 -0
  42. package/dist/state.d.ts +505 -0
  43. package/dist/state.d.ts.map +1 -0
  44. package/dist/state.js +115 -0
  45. package/dist/state.js.map +1 -0
  46. package/dist/verification.d.ts +197 -0
  47. package/dist/verification.d.ts.map +1 -0
  48. package/dist/verification.js +50 -0
  49. package/dist/verification.js.map +1 -0
  50. package/dist/visual-input.d.ts +130 -0
  51. package/dist/visual-input.d.ts.map +1 -0
  52. package/dist/visual-input.js +34 -0
  53. package/dist/visual-input.js.map +1 -0
  54. package/package.json +23 -0
@@ -0,0 +1,505 @@
1
+ import { z } from "zod";
2
+ export declare const SCHEMA_VERSION = 2;
3
+ export declare const ProjectStageSchema: z.ZodEnum<["uninitialized", "initialized", "design_references_imported", "design_references_analyzed", "fusion_decision_required", "design_system_synthesized"]>;
4
+ export declare const PageStageSchema: z.ZodEnum<["planned", "implementation_pending", "implemented", "verification_failed", "repair_pending", "completed", "blocked"]>;
5
+ export declare const FrameworkIdSchema: z.ZodEnum<["next", "vite-react"]>;
6
+ export declare const DesignReferenceIndexEntrySchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ sourceType: z.ZodEnum<["refero", "figma-export", "manual", "unknown"]>;
10
+ role: z.ZodEnum<["primary", "secondary", "inspiration", "negative", "candidate"]>;
11
+ status: z.ZodEnum<["imported", "parsed", "analyzed", "error"]>;
12
+ importedAt: z.ZodString;
13
+ fingerprintPath: z.ZodOptional<z.ZodString>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ id: string;
16
+ name: string;
17
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
18
+ status: "imported" | "parsed" | "analyzed" | "error";
19
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
20
+ importedAt: string;
21
+ fingerprintPath?: string | undefined;
22
+ }, {
23
+ id: string;
24
+ name: string;
25
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
26
+ status: "imported" | "parsed" | "analyzed" | "error";
27
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
28
+ importedAt: string;
29
+ fingerprintPath?: string | undefined;
30
+ }>;
31
+ export declare const PageStateSchema: z.ZodObject<{
32
+ id: z.ZodString;
33
+ name: z.ZodString;
34
+ slug: z.ZodString;
35
+ route: z.ZodString;
36
+ framework: z.ZodEnum<["next", "vite-react"]>;
37
+ stage: z.ZodEnum<["planned", "implementation_pending", "implemented", "verification_failed", "repair_pending", "completed", "blocked"]>;
38
+ prompt: z.ZodString;
39
+ artifactDir: z.ZodString;
40
+ shapePath: z.ZodString;
41
+ implementationPlanPath: z.ZodString;
42
+ implementationPromptPath: z.ZodString;
43
+ activeTaskId: z.ZodNullable<z.ZodString>;
44
+ repairAttempts: z.ZodNumber;
45
+ lastVerificationReport: z.ZodNullable<z.ZodString>;
46
+ createdAt: z.ZodString;
47
+ updatedAt: z.ZodString;
48
+ }, "strip", z.ZodTypeAny, {
49
+ id: string;
50
+ name: string;
51
+ slug: string;
52
+ route: string;
53
+ framework: "next" | "vite-react";
54
+ stage: "planned" | "implementation_pending" | "implemented" | "verification_failed" | "repair_pending" | "completed" | "blocked";
55
+ prompt: string;
56
+ artifactDir: string;
57
+ shapePath: string;
58
+ implementationPlanPath: string;
59
+ implementationPromptPath: string;
60
+ activeTaskId: string | null;
61
+ repairAttempts: number;
62
+ lastVerificationReport: string | null;
63
+ createdAt: string;
64
+ updatedAt: string;
65
+ }, {
66
+ id: string;
67
+ name: string;
68
+ slug: string;
69
+ route: string;
70
+ framework: "next" | "vite-react";
71
+ stage: "planned" | "implementation_pending" | "implemented" | "verification_failed" | "repair_pending" | "completed" | "blocked";
72
+ prompt: string;
73
+ artifactDir: string;
74
+ shapePath: string;
75
+ implementationPlanPath: string;
76
+ implementationPromptPath: string;
77
+ activeTaskId: string | null;
78
+ repairAttempts: number;
79
+ lastVerificationReport: string | null;
80
+ createdAt: string;
81
+ updatedAt: string;
82
+ }>;
83
+ export declare const ProjectStateSchema: z.ZodObject<{
84
+ schemaVersion: z.ZodLiteral<2>;
85
+ version: z.ZodString;
86
+ projectStage: z.ZodEnum<["uninitialized", "initialized", "design_references_imported", "design_references_analyzed", "fusion_decision_required", "design_system_synthesized"]>;
87
+ projectName: z.ZodNullable<z.ZodString>;
88
+ framework: z.ZodNullable<z.ZodEnum<["next", "vite-react"]>>;
89
+ designReferences: z.ZodArray<z.ZodObject<{
90
+ id: z.ZodString;
91
+ name: z.ZodString;
92
+ sourceType: z.ZodEnum<["refero", "figma-export", "manual", "unknown"]>;
93
+ role: z.ZodEnum<["primary", "secondary", "inspiration", "negative", "candidate"]>;
94
+ status: z.ZodEnum<["imported", "parsed", "analyzed", "error"]>;
95
+ importedAt: z.ZodString;
96
+ fingerprintPath: z.ZodOptional<z.ZodString>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ id: string;
99
+ name: string;
100
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
101
+ status: "imported" | "parsed" | "analyzed" | "error";
102
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
103
+ importedAt: string;
104
+ fingerprintPath?: string | undefined;
105
+ }, {
106
+ id: string;
107
+ name: string;
108
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
109
+ status: "imported" | "parsed" | "analyzed" | "error";
110
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
111
+ importedAt: string;
112
+ fingerprintPath?: string | undefined;
113
+ }>, "many">;
114
+ activeDesignSystem: z.ZodNullable<z.ZodString>;
115
+ fusionDecision: z.ZodNullable<z.ZodObject<{
116
+ strategy: z.ZodString;
117
+ selectedOptionId: z.ZodString;
118
+ recordedAt: z.ZodString;
119
+ }, "strip", z.ZodTypeAny, {
120
+ strategy: string;
121
+ selectedOptionId: string;
122
+ recordedAt: string;
123
+ }, {
124
+ strategy: string;
125
+ selectedOptionId: string;
126
+ recordedAt: string;
127
+ }>>;
128
+ pages: z.ZodArray<z.ZodObject<{
129
+ id: z.ZodString;
130
+ name: z.ZodString;
131
+ slug: z.ZodString;
132
+ route: z.ZodString;
133
+ framework: z.ZodEnum<["next", "vite-react"]>;
134
+ stage: z.ZodEnum<["planned", "implementation_pending", "implemented", "verification_failed", "repair_pending", "completed", "blocked"]>;
135
+ prompt: z.ZodString;
136
+ artifactDir: z.ZodString;
137
+ shapePath: z.ZodString;
138
+ implementationPlanPath: z.ZodString;
139
+ implementationPromptPath: z.ZodString;
140
+ activeTaskId: z.ZodNullable<z.ZodString>;
141
+ repairAttempts: z.ZodNumber;
142
+ lastVerificationReport: z.ZodNullable<z.ZodString>;
143
+ createdAt: z.ZodString;
144
+ updatedAt: z.ZodString;
145
+ }, "strip", z.ZodTypeAny, {
146
+ id: string;
147
+ name: string;
148
+ slug: string;
149
+ route: string;
150
+ framework: "next" | "vite-react";
151
+ stage: "planned" | "implementation_pending" | "implemented" | "verification_failed" | "repair_pending" | "completed" | "blocked";
152
+ prompt: string;
153
+ artifactDir: string;
154
+ shapePath: string;
155
+ implementationPlanPath: string;
156
+ implementationPromptPath: string;
157
+ activeTaskId: string | null;
158
+ repairAttempts: number;
159
+ lastVerificationReport: string | null;
160
+ createdAt: string;
161
+ updatedAt: string;
162
+ }, {
163
+ id: string;
164
+ name: string;
165
+ slug: string;
166
+ route: string;
167
+ framework: "next" | "vite-react";
168
+ stage: "planned" | "implementation_pending" | "implemented" | "verification_failed" | "repair_pending" | "completed" | "blocked";
169
+ prompt: string;
170
+ artifactDir: string;
171
+ shapePath: string;
172
+ implementationPlanPath: string;
173
+ implementationPromptPath: string;
174
+ activeTaskId: string | null;
175
+ repairAttempts: number;
176
+ lastVerificationReport: string | null;
177
+ createdAt: string;
178
+ updatedAt: string;
179
+ }>, "many">;
180
+ runs: z.ZodArray<z.ZodString, "many">;
181
+ createdAt: z.ZodString;
182
+ updatedAt: z.ZodString;
183
+ }, "strip", z.ZodTypeAny, {
184
+ framework: "next" | "vite-react" | null;
185
+ createdAt: string;
186
+ updatedAt: string;
187
+ schemaVersion: 2;
188
+ version: string;
189
+ projectStage: "uninitialized" | "initialized" | "design_references_imported" | "design_references_analyzed" | "fusion_decision_required" | "design_system_synthesized";
190
+ projectName: string | null;
191
+ designReferences: {
192
+ id: string;
193
+ name: string;
194
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
195
+ status: "imported" | "parsed" | "analyzed" | "error";
196
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
197
+ importedAt: string;
198
+ fingerprintPath?: string | undefined;
199
+ }[];
200
+ activeDesignSystem: string | null;
201
+ fusionDecision: {
202
+ strategy: string;
203
+ selectedOptionId: string;
204
+ recordedAt: string;
205
+ } | null;
206
+ pages: {
207
+ id: string;
208
+ name: string;
209
+ slug: string;
210
+ route: string;
211
+ framework: "next" | "vite-react";
212
+ stage: "planned" | "implementation_pending" | "implemented" | "verification_failed" | "repair_pending" | "completed" | "blocked";
213
+ prompt: string;
214
+ artifactDir: string;
215
+ shapePath: string;
216
+ implementationPlanPath: string;
217
+ implementationPromptPath: string;
218
+ activeTaskId: string | null;
219
+ repairAttempts: number;
220
+ lastVerificationReport: string | null;
221
+ createdAt: string;
222
+ updatedAt: string;
223
+ }[];
224
+ runs: string[];
225
+ }, {
226
+ framework: "next" | "vite-react" | null;
227
+ createdAt: string;
228
+ updatedAt: string;
229
+ schemaVersion: 2;
230
+ version: string;
231
+ projectStage: "uninitialized" | "initialized" | "design_references_imported" | "design_references_analyzed" | "fusion_decision_required" | "design_system_synthesized";
232
+ projectName: string | null;
233
+ designReferences: {
234
+ id: string;
235
+ name: string;
236
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
237
+ status: "imported" | "parsed" | "analyzed" | "error";
238
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
239
+ importedAt: string;
240
+ fingerprintPath?: string | undefined;
241
+ }[];
242
+ activeDesignSystem: string | null;
243
+ fusionDecision: {
244
+ strategy: string;
245
+ selectedOptionId: string;
246
+ recordedAt: string;
247
+ } | null;
248
+ pages: {
249
+ id: string;
250
+ name: string;
251
+ slug: string;
252
+ route: string;
253
+ framework: "next" | "vite-react";
254
+ stage: "planned" | "implementation_pending" | "implemented" | "verification_failed" | "repair_pending" | "completed" | "blocked";
255
+ prompt: string;
256
+ artifactDir: string;
257
+ shapePath: string;
258
+ implementationPlanPath: string;
259
+ implementationPromptPath: string;
260
+ activeTaskId: string | null;
261
+ repairAttempts: number;
262
+ lastVerificationReport: string | null;
263
+ createdAt: string;
264
+ updatedAt: string;
265
+ }[];
266
+ runs: string[];
267
+ }>;
268
+ export declare const LegacyProjectStateSchema: z.ZodObject<{
269
+ version: z.ZodString;
270
+ stage: z.ZodString;
271
+ projectName: z.ZodNullable<z.ZodString>;
272
+ designReferences: z.ZodArray<z.ZodObject<{
273
+ id: z.ZodString;
274
+ name: z.ZodString;
275
+ sourceType: z.ZodEnum<["refero", "figma-export", "manual", "unknown"]>;
276
+ role: z.ZodEnum<["primary", "secondary", "inspiration", "negative", "candidate"]>;
277
+ status: z.ZodEnum<["imported", "parsed", "analyzed", "error"]>;
278
+ importedAt: z.ZodString;
279
+ fingerprintPath: z.ZodOptional<z.ZodString>;
280
+ }, "strip", z.ZodTypeAny, {
281
+ id: string;
282
+ name: string;
283
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
284
+ status: "imported" | "parsed" | "analyzed" | "error";
285
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
286
+ importedAt: string;
287
+ fingerprintPath?: string | undefined;
288
+ }, {
289
+ id: string;
290
+ name: string;
291
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
292
+ status: "imported" | "parsed" | "analyzed" | "error";
293
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
294
+ importedAt: string;
295
+ fingerprintPath?: string | undefined;
296
+ }>, "many">;
297
+ activeDesignSystem: z.ZodNullable<z.ZodString>;
298
+ fusionDecision: z.ZodNullable<z.ZodObject<{
299
+ strategy: z.ZodString;
300
+ selectedOptionId: z.ZodString;
301
+ recordedAt: z.ZodString;
302
+ }, "strip", z.ZodTypeAny, {
303
+ strategy: string;
304
+ selectedOptionId: string;
305
+ recordedAt: string;
306
+ }, {
307
+ strategy: string;
308
+ selectedOptionId: string;
309
+ recordedAt: string;
310
+ }>>;
311
+ pages: z.ZodArray<z.ZodObject<{
312
+ name: z.ZodString;
313
+ route: z.ZodString;
314
+ shapePath: z.ZodOptional<z.ZodString>;
315
+ implementationPromptPath: z.ZodOptional<z.ZodString>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ name: string;
318
+ route: string;
319
+ shapePath?: string | undefined;
320
+ implementationPromptPath?: string | undefined;
321
+ }, {
322
+ name: string;
323
+ route: string;
324
+ shapePath?: string | undefined;
325
+ implementationPromptPath?: string | undefined;
326
+ }>, "many">;
327
+ runs: z.ZodArray<z.ZodString, "many">;
328
+ createdAt: z.ZodString;
329
+ updatedAt: z.ZodString;
330
+ }, "strip", z.ZodTypeAny, {
331
+ stage: string;
332
+ createdAt: string;
333
+ updatedAt: string;
334
+ version: string;
335
+ projectName: string | null;
336
+ designReferences: {
337
+ id: string;
338
+ name: string;
339
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
340
+ status: "imported" | "parsed" | "analyzed" | "error";
341
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
342
+ importedAt: string;
343
+ fingerprintPath?: string | undefined;
344
+ }[];
345
+ activeDesignSystem: string | null;
346
+ fusionDecision: {
347
+ strategy: string;
348
+ selectedOptionId: string;
349
+ recordedAt: string;
350
+ } | null;
351
+ pages: {
352
+ name: string;
353
+ route: string;
354
+ shapePath?: string | undefined;
355
+ implementationPromptPath?: string | undefined;
356
+ }[];
357
+ runs: string[];
358
+ }, {
359
+ stage: string;
360
+ createdAt: string;
361
+ updatedAt: string;
362
+ version: string;
363
+ projectName: string | null;
364
+ designReferences: {
365
+ id: string;
366
+ name: string;
367
+ sourceType: "unknown" | "refero" | "figma-export" | "manual";
368
+ status: "imported" | "parsed" | "analyzed" | "error";
369
+ role: "primary" | "secondary" | "inspiration" | "negative" | "candidate";
370
+ importedAt: string;
371
+ fingerprintPath?: string | undefined;
372
+ }[];
373
+ activeDesignSystem: string | null;
374
+ fusionDecision: {
375
+ strategy: string;
376
+ selectedOptionId: string;
377
+ recordedAt: string;
378
+ } | null;
379
+ pages: {
380
+ name: string;
381
+ route: string;
382
+ shapePath?: string | undefined;
383
+ implementationPromptPath?: string | undefined;
384
+ }[];
385
+ runs: string[];
386
+ }>;
387
+ export declare const RunRecordSchema: z.ZodObject<{
388
+ schemaVersion: z.ZodLiteral<2>;
389
+ id: z.ZodString;
390
+ command: z.ZodString;
391
+ projectStage: z.ZodEnum<["uninitialized", "initialized", "design_references_imported", "design_references_analyzed", "fusion_decision_required", "design_system_synthesized"]>;
392
+ pageId: z.ZodOptional<z.ZodString>;
393
+ status: z.ZodEnum<["running", "completed", "failed"]>;
394
+ startedAt: z.ZodString;
395
+ completedAt: z.ZodOptional<z.ZodString>;
396
+ artifacts: z.ZodArray<z.ZodString, "many">;
397
+ errors: z.ZodArray<z.ZodString, "many">;
398
+ notes: z.ZodOptional<z.ZodString>;
399
+ }, "strip", z.ZodTypeAny, {
400
+ id: string;
401
+ status: "completed" | "running" | "failed";
402
+ schemaVersion: 2;
403
+ projectStage: "uninitialized" | "initialized" | "design_references_imported" | "design_references_analyzed" | "fusion_decision_required" | "design_system_synthesized";
404
+ command: string;
405
+ startedAt: string;
406
+ artifacts: string[];
407
+ errors: string[];
408
+ pageId?: string | undefined;
409
+ completedAt?: string | undefined;
410
+ notes?: string | undefined;
411
+ }, {
412
+ id: string;
413
+ status: "completed" | "running" | "failed";
414
+ schemaVersion: 2;
415
+ projectStage: "uninitialized" | "initialized" | "design_references_imported" | "design_references_analyzed" | "fusion_decision_required" | "design_system_synthesized";
416
+ command: string;
417
+ startedAt: string;
418
+ artifacts: string[];
419
+ errors: string[];
420
+ pageId?: string | undefined;
421
+ completedAt?: string | undefined;
422
+ notes?: string | undefined;
423
+ }>;
424
+ export declare const FileChangeSchema: z.ZodObject<{
425
+ action: z.ZodEnum<["create", "modify", "delete"]>;
426
+ path: z.ZodString;
427
+ description: z.ZodString;
428
+ content: z.ZodOptional<z.ZodString>;
429
+ backupPath: z.ZodOptional<z.ZodString>;
430
+ }, "strip", z.ZodTypeAny, {
431
+ path: string;
432
+ action: "create" | "modify" | "delete";
433
+ description: string;
434
+ content?: string | undefined;
435
+ backupPath?: string | undefined;
436
+ }, {
437
+ path: string;
438
+ action: "create" | "modify" | "delete";
439
+ description: string;
440
+ content?: string | undefined;
441
+ backupPath?: string | undefined;
442
+ }>;
443
+ export declare const FileChangePlanSchema: z.ZodObject<{
444
+ schemaVersion: z.ZodLiteral<2>;
445
+ planId: z.ZodString;
446
+ taskId: z.ZodString;
447
+ changes: z.ZodArray<z.ZodObject<{
448
+ action: z.ZodEnum<["create", "modify", "delete"]>;
449
+ path: z.ZodString;
450
+ description: z.ZodString;
451
+ content: z.ZodOptional<z.ZodString>;
452
+ backupPath: z.ZodOptional<z.ZodString>;
453
+ }, "strip", z.ZodTypeAny, {
454
+ path: string;
455
+ action: "create" | "modify" | "delete";
456
+ description: string;
457
+ content?: string | undefined;
458
+ backupPath?: string | undefined;
459
+ }, {
460
+ path: string;
461
+ action: "create" | "modify" | "delete";
462
+ description: string;
463
+ content?: string | undefined;
464
+ backupPath?: string | undefined;
465
+ }>, "many">;
466
+ status: z.ZodEnum<["planned", "applied", "rolled-back", "failed"]>;
467
+ createdAt: z.ZodString;
468
+ }, "strip", z.ZodTypeAny, {
469
+ status: "planned" | "failed" | "applied" | "rolled-back";
470
+ createdAt: string;
471
+ schemaVersion: 2;
472
+ planId: string;
473
+ taskId: string;
474
+ changes: {
475
+ path: string;
476
+ action: "create" | "modify" | "delete";
477
+ description: string;
478
+ content?: string | undefined;
479
+ backupPath?: string | undefined;
480
+ }[];
481
+ }, {
482
+ status: "planned" | "failed" | "applied" | "rolled-back";
483
+ createdAt: string;
484
+ schemaVersion: 2;
485
+ planId: string;
486
+ taskId: string;
487
+ changes: {
488
+ path: string;
489
+ action: "create" | "modify" | "delete";
490
+ description: string;
491
+ content?: string | undefined;
492
+ backupPath?: string | undefined;
493
+ }[];
494
+ }>;
495
+ export type ProjectStage = z.infer<typeof ProjectStageSchema>;
496
+ export type PageStage = z.infer<typeof PageStageSchema>;
497
+ export type FrameworkId = z.infer<typeof FrameworkIdSchema>;
498
+ export type DesignReferenceIndexEntry = z.infer<typeof DesignReferenceIndexEntrySchema>;
499
+ export type PageState = z.infer<typeof PageStateSchema>;
500
+ export type ProjectState = z.infer<typeof ProjectStateSchema>;
501
+ export type LegacyProjectState = z.infer<typeof LegacyProjectStateSchema>;
502
+ export type RunRecord = z.infer<typeof RunRecordSchema>;
503
+ export type FileChange = z.infer<typeof FileChangeSchema>;
504
+ export type FileChangePlan = z.infer<typeof FileChangePlanSchema>;
505
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,eAAO,MAAM,kBAAkB,kKAO7B,CAAC;AAEH,eAAO,MAAM,eAAe,kIAQ1B,CAAC;AAEH,eAAO,MAAM,iBAAiB,mCAAiC,CAAC;AAEhE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;EAQ1C,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB1B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB7B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ProjectStageSchema = z.enum([
4
+ "uninitialized",
5
+ "initialized",
6
+ "design_references_imported",
7
+ "design_references_analyzed",
8
+ "fusion_decision_required",
9
+ "design_system_synthesized",
10
+ ]);
11
+ export const PageStageSchema = z.enum([
12
+ "planned",
13
+ "implementation_pending",
14
+ "implemented",
15
+ "verification_failed",
16
+ "repair_pending",
17
+ "completed",
18
+ "blocked",
19
+ ]);
20
+ export const FrameworkIdSchema = z.enum(["next", "vite-react"]);
21
+ export const DesignReferenceIndexEntrySchema = z.object({
22
+ id: z.string(),
23
+ name: z.string(),
24
+ sourceType: z.enum(["refero", "figma-export", "manual", "unknown"]),
25
+ role: z.enum(["primary", "secondary", "inspiration", "negative", "candidate"]),
26
+ status: z.enum(["imported", "parsed", "analyzed", "error"]),
27
+ importedAt: z.string(),
28
+ fingerprintPath: z.string().optional(),
29
+ });
30
+ export const PageStateSchema = z.object({
31
+ id: z.string(),
32
+ name: z.string(),
33
+ slug: z.string(),
34
+ route: z.string(),
35
+ framework: FrameworkIdSchema,
36
+ stage: PageStageSchema,
37
+ prompt: z.string(),
38
+ artifactDir: z.string(),
39
+ shapePath: z.string(),
40
+ implementationPlanPath: z.string(),
41
+ implementationPromptPath: z.string(),
42
+ activeTaskId: z.string().nullable(),
43
+ repairAttempts: z.number().int().min(0).max(3),
44
+ lastVerificationReport: z.string().nullable(),
45
+ createdAt: z.string(),
46
+ updatedAt: z.string(),
47
+ });
48
+ export const ProjectStateSchema = z.object({
49
+ schemaVersion: z.literal(SCHEMA_VERSION),
50
+ version: z.string(),
51
+ projectStage: ProjectStageSchema,
52
+ projectName: z.string().nullable(),
53
+ framework: FrameworkIdSchema.nullable(),
54
+ designReferences: z.array(DesignReferenceIndexEntrySchema),
55
+ activeDesignSystem: z.string().nullable(),
56
+ fusionDecision: z.object({
57
+ strategy: z.string(),
58
+ selectedOptionId: z.string(),
59
+ recordedAt: z.string(),
60
+ }).nullable(),
61
+ pages: z.array(PageStateSchema),
62
+ runs: z.array(z.string()),
63
+ createdAt: z.string(),
64
+ updatedAt: z.string(),
65
+ });
66
+ export const LegacyProjectStateSchema = z.object({
67
+ version: z.string(),
68
+ stage: z.string(),
69
+ projectName: z.string().nullable(),
70
+ designReferences: z.array(DesignReferenceIndexEntrySchema),
71
+ activeDesignSystem: z.string().nullable(),
72
+ fusionDecision: z.object({
73
+ strategy: z.string(),
74
+ selectedOptionId: z.string(),
75
+ recordedAt: z.string(),
76
+ }).nullable(),
77
+ pages: z.array(z.object({
78
+ name: z.string(),
79
+ route: z.string(),
80
+ shapePath: z.string().optional(),
81
+ implementationPromptPath: z.string().optional(),
82
+ })),
83
+ runs: z.array(z.string()),
84
+ createdAt: z.string(),
85
+ updatedAt: z.string(),
86
+ });
87
+ export const RunRecordSchema = z.object({
88
+ schemaVersion: z.literal(SCHEMA_VERSION),
89
+ id: z.string(),
90
+ command: z.string(),
91
+ projectStage: ProjectStageSchema,
92
+ pageId: z.string().optional(),
93
+ status: z.enum(["running", "completed", "failed"]),
94
+ startedAt: z.string(),
95
+ completedAt: z.string().optional(),
96
+ artifacts: z.array(z.string()),
97
+ errors: z.array(z.string()),
98
+ notes: z.string().optional(),
99
+ });
100
+ export const FileChangeSchema = z.object({
101
+ action: z.enum(["create", "modify", "delete"]),
102
+ path: z.string(),
103
+ description: z.string(),
104
+ content: z.string().optional(),
105
+ backupPath: z.string().optional(),
106
+ });
107
+ export const FileChangePlanSchema = z.object({
108
+ schemaVersion: z.literal(SCHEMA_VERSION),
109
+ planId: z.string(),
110
+ taskId: z.string(),
111
+ changes: z.array(FileChangeSchema),
112
+ status: z.enum(["planned", "applied", "rolled-back", "failed"]),
113
+ createdAt: z.string(),
114
+ });
115
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,C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