@sketchscreens/core-schema 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.
@@ -0,0 +1,625 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The SketchScreens contract.
4
+ *
5
+ * One JSON shape, produced by the extractor and consumed by the renderer.
6
+ * It is deliberately stack-agnostic: a Next.js screen and a Flutter screen
7
+ * both reduce to the same `ScreenSpec`, so the renderer draws them identically.
8
+ *
9
+ * Design note: `ElementType` is a CLOSED enum on purpose. Each value maps 1:1
10
+ * onto a renderable hand-drawn primitive (mostly wired-elements). A closed set
11
+ * keeps every map renderable and stops the LLM extractor from inventing element
12
+ * types the renderer can't draw.
13
+ */
14
+ /** The closed set of wireframe primitives. Each maps to a renderable widget. */
15
+ export declare const ElementType: z.ZodEnum<["heading", "text", "input", "textarea", "button", "checkbox", "radio", "toggle", "select", "listbox", "card", "image", "list", "divider", "nav", "tabs"]>;
16
+ export type ElementType = z.infer<typeof ElementType>;
17
+ /** Optional visual role for buttons, so the renderer can vary emphasis. */
18
+ export declare const ElementVariant: z.ZodEnum<["primary", "secondary", "destructive", "ghost", "link"]>;
19
+ export type ElementVariant = z.infer<typeof ElementVariant>;
20
+ /**
21
+ * Which vertical band of the screen an element sits in. `top` = a header / nav
22
+ * bar pinned to the top; `bottom` = a footer / sticky action bar; `main` = the
23
+ * scrollable body (the default). Lets the sketch mirror the real screen's
24
+ * coarse layout without pixel positions.
25
+ */
26
+ export declare const ElementRegion: z.ZodEnum<["top", "main", "bottom"]>;
27
+ export type ElementRegion = z.infer<typeof ElementRegion>;
28
+ /**
29
+ * Horizontal placement of an element within its band. `full` stretches edge to
30
+ * edge (inputs, nav bars, lists); `center` is a centered block (a hero button,
31
+ * a centered card); `left`/`right` hug a side. Default is `full` for fields and
32
+ * `left` for text.
33
+ */
34
+ export declare const ElementAlign: z.ZodEnum<["left", "center", "right", "full"]>;
35
+ export type ElementAlign = z.infer<typeof ElementAlign>;
36
+ /**
37
+ * One UI element on a screen. `label` is the visible text (button caption,
38
+ * field label, heading text). Order in the `elements` array = top-to-bottom
39
+ * position in the sketch (structural fidelity, not pixel-exact).
40
+ */
41
+ export declare const ScreenElement: z.ZodObject<{
42
+ type: z.ZodEnum<["heading", "text", "input", "textarea", "button", "checkbox", "radio", "toggle", "select", "listbox", "card", "image", "list", "divider", "nav", "tabs"]>;
43
+ /** Visible text: caption, label, or heading. Optional for dividers/images. */
44
+ label: z.ZodOptional<z.ZodString>;
45
+ /** Placeholder / hint text for inputs. */
46
+ placeholder: z.ZodOptional<z.ZodString>;
47
+ /** Visual emphasis (mainly for buttons). */
48
+ variant: z.ZodOptional<z.ZodEnum<["primary", "secondary", "destructive", "ghost", "link"]>>;
49
+ /** True for password / masked inputs. */
50
+ secure: z.ZodOptional<z.ZodBoolean>;
51
+ /** True if the element is marked required in the source. */
52
+ required: z.ZodOptional<z.ZodBoolean>;
53
+ /**
54
+ * Optional grouping key. Elements sharing a group render inside one
55
+ * card/section, preserving the source's visual grouping.
56
+ */
57
+ group: z.ZodOptional<z.ZodString>;
58
+ /**
59
+ * Which band of the screen this element sits in (top nav / main / bottom
60
+ * bar). Defaults to "main". Lets the sketch mirror the real layout.
61
+ */
62
+ region: z.ZodOptional<z.ZodEnum<["top", "main", "bottom"]>>;
63
+ /**
64
+ * Horizontal placement within the band. Defaults sensibly by type (fields
65
+ * full-width, text left). Set "center" for a centered hero button/card.
66
+ */
67
+ align: z.ZodOptional<z.ZodEnum<["left", "center", "right", "full"]>>;
68
+ /**
69
+ * Whether `label` is the app's verbatim text or the extractor's SHAPE
70
+ * description of a dynamic region (a list/table it couldn't read literally).
71
+ * Defaults to "verbatim". The renderer styles "descriptive" labels distinctly
72
+ * so a reviewer sees "this is the tool's summary, not the app's words."
73
+ */
74
+ labelKind: z.ZodOptional<z.ZodEnum<["verbatim", "descriptive"]>>;
75
+ /** Free-form note the extractor wants to surface (e.g. "conditionally shown"). */
76
+ note: z.ZodOptional<z.ZodString>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
79
+ label?: string | undefined;
80
+ placeholder?: string | undefined;
81
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
82
+ secure?: boolean | undefined;
83
+ required?: boolean | undefined;
84
+ group?: string | undefined;
85
+ region?: "top" | "main" | "bottom" | undefined;
86
+ align?: "left" | "center" | "right" | "full" | undefined;
87
+ labelKind?: "verbatim" | "descriptive" | undefined;
88
+ note?: string | undefined;
89
+ }, {
90
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
91
+ label?: string | undefined;
92
+ placeholder?: string | undefined;
93
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
94
+ secure?: boolean | undefined;
95
+ required?: boolean | undefined;
96
+ group?: string | undefined;
97
+ region?: "top" | "main" | "bottom" | undefined;
98
+ align?: "left" | "center" | "right" | "full" | undefined;
99
+ labelKind?: "verbatim" | "descriptive" | undefined;
100
+ note?: string | undefined;
101
+ }>;
102
+ export type ScreenElement = z.infer<typeof ScreenElement>;
103
+ /** One screen = one node in the map. */
104
+ export declare const ScreenSpec: z.ZodObject<{
105
+ /** Stable id, unique within the map. Referenced by edges. */
106
+ id: z.ZodString;
107
+ /** Human-friendly screen name (e.g. "Login"). */
108
+ name: z.ZodString;
109
+ /**
110
+ * The route or address of this screen: a URL path (`/settings/profile`),
111
+ * a Flutter widget class (`SettingsScreen`), or an API path group. Optional
112
+ * because not every screen is addressable (e.g. a modal).
113
+ */
114
+ route: z.ZodOptional<z.ZodString>;
115
+ /** Repo-relative path of the file this screen was extracted from. */
116
+ sourceFile: z.ZodOptional<z.ZodString>;
117
+ /** The elements on this screen, in top-to-bottom order. */
118
+ elements: z.ZodDefault<z.ZodArray<z.ZodObject<{
119
+ type: z.ZodEnum<["heading", "text", "input", "textarea", "button", "checkbox", "radio", "toggle", "select", "listbox", "card", "image", "list", "divider", "nav", "tabs"]>;
120
+ /** Visible text: caption, label, or heading. Optional for dividers/images. */
121
+ label: z.ZodOptional<z.ZodString>;
122
+ /** Placeholder / hint text for inputs. */
123
+ placeholder: z.ZodOptional<z.ZodString>;
124
+ /** Visual emphasis (mainly for buttons). */
125
+ variant: z.ZodOptional<z.ZodEnum<["primary", "secondary", "destructive", "ghost", "link"]>>;
126
+ /** True for password / masked inputs. */
127
+ secure: z.ZodOptional<z.ZodBoolean>;
128
+ /** True if the element is marked required in the source. */
129
+ required: z.ZodOptional<z.ZodBoolean>;
130
+ /**
131
+ * Optional grouping key. Elements sharing a group render inside one
132
+ * card/section, preserving the source's visual grouping.
133
+ */
134
+ group: z.ZodOptional<z.ZodString>;
135
+ /**
136
+ * Which band of the screen this element sits in (top nav / main / bottom
137
+ * bar). Defaults to "main". Lets the sketch mirror the real layout.
138
+ */
139
+ region: z.ZodOptional<z.ZodEnum<["top", "main", "bottom"]>>;
140
+ /**
141
+ * Horizontal placement within the band. Defaults sensibly by type (fields
142
+ * full-width, text left). Set "center" for a centered hero button/card.
143
+ */
144
+ align: z.ZodOptional<z.ZodEnum<["left", "center", "right", "full"]>>;
145
+ /**
146
+ * Whether `label` is the app's verbatim text or the extractor's SHAPE
147
+ * description of a dynamic region (a list/table it couldn't read literally).
148
+ * Defaults to "verbatim". The renderer styles "descriptive" labels distinctly
149
+ * so a reviewer sees "this is the tool's summary, not the app's words."
150
+ */
151
+ labelKind: z.ZodOptional<z.ZodEnum<["verbatim", "descriptive"]>>;
152
+ /** Free-form note the extractor wants to surface (e.g. "conditionally shown"). */
153
+ note: z.ZodOptional<z.ZodString>;
154
+ }, "strip", z.ZodTypeAny, {
155
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
156
+ label?: string | undefined;
157
+ placeholder?: string | undefined;
158
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
159
+ secure?: boolean | undefined;
160
+ required?: boolean | undefined;
161
+ group?: string | undefined;
162
+ region?: "top" | "main" | "bottom" | undefined;
163
+ align?: "left" | "center" | "right" | "full" | undefined;
164
+ labelKind?: "verbatim" | "descriptive" | undefined;
165
+ note?: string | undefined;
166
+ }, {
167
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
168
+ label?: string | undefined;
169
+ placeholder?: string | undefined;
170
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
171
+ secure?: boolean | undefined;
172
+ required?: boolean | undefined;
173
+ group?: string | undefined;
174
+ region?: "top" | "main" | "bottom" | undefined;
175
+ align?: "left" | "center" | "right" | "full" | undefined;
176
+ labelKind?: "verbatim" | "descriptive" | undefined;
177
+ note?: string | undefined;
178
+ }>, "many">>;
179
+ /** Optional short description / purpose of the screen. */
180
+ description: z.ZodOptional<z.ZodString>;
181
+ /**
182
+ * Optional label-path for this screen's section, most-general first, using
183
+ * " › " as the separator — e.g. "Settings › AI Settings". Groups cluster and
184
+ * label screens; the renderer nests group labels. Deriveable from the route.
185
+ * (For the overall journey SHAPE, prefer `parent` below.)
186
+ */
187
+ group: z.ZodOptional<z.ZodString>;
188
+ /**
189
+ * Optional id of the screen this one hangs beneath in the JOURNEY tree — the
190
+ * screen a user reaches this one *from*. This is what roots the map as a real
191
+ * flow: an entry screen has no parent; the auth screen's parent is the entry;
192
+ * each feature-section hub's parent is the dashboard; etc. When set, it
193
+ * overrides route-derived nesting so the tree matches how users actually
194
+ * navigate. Must reference another screen's `id`.
195
+ */
196
+ parent: z.ZodOptional<z.ZodString>;
197
+ /**
198
+ * Optional hint that this screen is the app's entry point / root of the
199
+ * journey (what the user sees first). At most one screen should set this; the
200
+ * renderer roots the tree here. If none is set, the renderer infers a root.
201
+ */
202
+ isEntry: z.ZodOptional<z.ZodBoolean>;
203
+ /**
204
+ * How this screen is presented. "screen" (default) is a full page/route; the
205
+ * others are overlays. The renderer draws non-"screen" presentations with a
206
+ * distinct overlay frame and attaches them to their opener via an edge rather
207
+ * than the journey backbone.
208
+ */
209
+ presentation: z.ZodOptional<z.ZodEnum<["screen", "modal", "drawer", "sheet"]>>;
210
+ /**
211
+ * Optional state variant this screen represents (an empty/error/loading view
212
+ * of another screen). The renderer can cluster it beside its base screen.
213
+ */
214
+ state: z.ZodOptional<z.ZodEnum<["default", "empty", "error", "loading"]>>;
215
+ }, "strip", z.ZodTypeAny, {
216
+ id: string;
217
+ name: string;
218
+ elements: {
219
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
220
+ label?: string | undefined;
221
+ placeholder?: string | undefined;
222
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
223
+ secure?: boolean | undefined;
224
+ required?: boolean | undefined;
225
+ group?: string | undefined;
226
+ region?: "top" | "main" | "bottom" | undefined;
227
+ align?: "left" | "center" | "right" | "full" | undefined;
228
+ labelKind?: "verbatim" | "descriptive" | undefined;
229
+ note?: string | undefined;
230
+ }[];
231
+ group?: string | undefined;
232
+ route?: string | undefined;
233
+ sourceFile?: string | undefined;
234
+ description?: string | undefined;
235
+ parent?: string | undefined;
236
+ isEntry?: boolean | undefined;
237
+ presentation?: "screen" | "modal" | "drawer" | "sheet" | undefined;
238
+ state?: "default" | "empty" | "error" | "loading" | undefined;
239
+ }, {
240
+ id: string;
241
+ name: string;
242
+ group?: string | undefined;
243
+ route?: string | undefined;
244
+ sourceFile?: string | undefined;
245
+ elements?: {
246
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
247
+ label?: string | undefined;
248
+ placeholder?: string | undefined;
249
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
250
+ secure?: boolean | undefined;
251
+ required?: boolean | undefined;
252
+ group?: string | undefined;
253
+ region?: "top" | "main" | "bottom" | undefined;
254
+ align?: "left" | "center" | "right" | "full" | undefined;
255
+ labelKind?: "verbatim" | "descriptive" | undefined;
256
+ note?: string | undefined;
257
+ }[] | undefined;
258
+ description?: string | undefined;
259
+ parent?: string | undefined;
260
+ isEntry?: boolean | undefined;
261
+ presentation?: "screen" | "modal" | "drawer" | "sheet" | undefined;
262
+ state?: "default" | "empty" | "error" | "loading" | undefined;
263
+ }>;
264
+ export type ScreenSpec = z.infer<typeof ScreenSpec>;
265
+ /** Split a group path ("Settings › AI Settings") into its segments. */
266
+ export declare function groupSegments(group: string | undefined): string[];
267
+ /** A navigation transition from one screen to another. */
268
+ export declare const Edge: z.ZodObject<{
269
+ /** Source screen id. */
270
+ from: z.ZodString;
271
+ /** Destination screen id. */
272
+ to: z.ZodString;
273
+ /**
274
+ * What triggers the transition — usually a button/link label
275
+ * ("Continue", "Forgot?"). Rendered as the edge label.
276
+ */
277
+ trigger: z.ZodOptional<z.ZodString>;
278
+ /** How the transition is expressed, if useful (e.g. "redirect", "push", "link"). */
279
+ kind: z.ZodOptional<z.ZodString>;
280
+ }, "strip", z.ZodTypeAny, {
281
+ from: string;
282
+ to: string;
283
+ trigger?: string | undefined;
284
+ kind?: string | undefined;
285
+ }, {
286
+ from: string;
287
+ to: string;
288
+ trigger?: string | undefined;
289
+ kind?: string | undefined;
290
+ }>;
291
+ export type Edge = z.infer<typeof Edge>;
292
+ /**
293
+ * Which surface this map represents. Each surface is its own map — a web app,
294
+ * a mobile app, a CRM, and a backend are mapped separately, not tangled into one.
295
+ */
296
+ export declare const Surface: z.ZodEnum<["web", "mobile", "crm", "admin", "backend", "desktop", "other"]>;
297
+ export type Surface = z.infer<typeof Surface>;
298
+ /** Optional provenance / metadata about how this map was produced. */
299
+ export declare const ProjectMapMeta: z.ZodObject<{
300
+ /** The tool version that produced the map. */
301
+ generator: z.ZodOptional<z.ZodString>;
302
+ /** Repo-relative or absolute root the map was extracted from. */
303
+ repoRoot: z.ZodOptional<z.ZodString>;
304
+ /** ISO timestamp string (set by the producer; schema stays time-agnostic). */
305
+ generatedAt: z.ZodOptional<z.ZodString>;
306
+ /** How elements were derived: "agent", "static", or "hybrid". */
307
+ extraction: z.ZodOptional<z.ZodEnum<["agent", "static", "hybrid", "manual"]>>;
308
+ }, "strip", z.ZodTypeAny, {
309
+ generator?: string | undefined;
310
+ repoRoot?: string | undefined;
311
+ generatedAt?: string | undefined;
312
+ extraction?: "agent" | "static" | "hybrid" | "manual" | undefined;
313
+ }, {
314
+ generator?: string | undefined;
315
+ repoRoot?: string | undefined;
316
+ generatedAt?: string | undefined;
317
+ extraction?: "agent" | "static" | "hybrid" | "manual" | undefined;
318
+ }>;
319
+ export type ProjectMapMeta = z.infer<typeof ProjectMapMeta>;
320
+ /** The contract version this build of SketchScreens speaks. */
321
+ export declare const CONTRACT_VERSION = 1;
322
+ /** The whole thing: one surface's screens + the flow between them. */
323
+ export declare const ProjectMap: z.ZodObject<{
324
+ /**
325
+ * Contract version. Accepts any positive integer so an OLD renderer reading a
326
+ * NEWER map fails with a clear "upgrade" message (see validate.ts) rather than
327
+ * a generic zod "invalid literal". New fields are additive; bump only on a
328
+ * breaking change.
329
+ */
330
+ version: z.ZodDefault<z.ZodNumber>;
331
+ /** Display name for this map (e.g. "AiPhone 360 — Web App"). */
332
+ name: z.ZodString;
333
+ /** Which surface this represents. */
334
+ surface: z.ZodEnum<["web", "mobile", "crm", "admin", "backend", "desktop", "other"]>;
335
+ /** The screens (nodes). */
336
+ screens: z.ZodDefault<z.ZodArray<z.ZodObject<{
337
+ /** Stable id, unique within the map. Referenced by edges. */
338
+ id: z.ZodString;
339
+ /** Human-friendly screen name (e.g. "Login"). */
340
+ name: z.ZodString;
341
+ /**
342
+ * The route or address of this screen: a URL path (`/settings/profile`),
343
+ * a Flutter widget class (`SettingsScreen`), or an API path group. Optional
344
+ * because not every screen is addressable (e.g. a modal).
345
+ */
346
+ route: z.ZodOptional<z.ZodString>;
347
+ /** Repo-relative path of the file this screen was extracted from. */
348
+ sourceFile: z.ZodOptional<z.ZodString>;
349
+ /** The elements on this screen, in top-to-bottom order. */
350
+ elements: z.ZodDefault<z.ZodArray<z.ZodObject<{
351
+ type: z.ZodEnum<["heading", "text", "input", "textarea", "button", "checkbox", "radio", "toggle", "select", "listbox", "card", "image", "list", "divider", "nav", "tabs"]>;
352
+ /** Visible text: caption, label, or heading. Optional for dividers/images. */
353
+ label: z.ZodOptional<z.ZodString>;
354
+ /** Placeholder / hint text for inputs. */
355
+ placeholder: z.ZodOptional<z.ZodString>;
356
+ /** Visual emphasis (mainly for buttons). */
357
+ variant: z.ZodOptional<z.ZodEnum<["primary", "secondary", "destructive", "ghost", "link"]>>;
358
+ /** True for password / masked inputs. */
359
+ secure: z.ZodOptional<z.ZodBoolean>;
360
+ /** True if the element is marked required in the source. */
361
+ required: z.ZodOptional<z.ZodBoolean>;
362
+ /**
363
+ * Optional grouping key. Elements sharing a group render inside one
364
+ * card/section, preserving the source's visual grouping.
365
+ */
366
+ group: z.ZodOptional<z.ZodString>;
367
+ /**
368
+ * Which band of the screen this element sits in (top nav / main / bottom
369
+ * bar). Defaults to "main". Lets the sketch mirror the real layout.
370
+ */
371
+ region: z.ZodOptional<z.ZodEnum<["top", "main", "bottom"]>>;
372
+ /**
373
+ * Horizontal placement within the band. Defaults sensibly by type (fields
374
+ * full-width, text left). Set "center" for a centered hero button/card.
375
+ */
376
+ align: z.ZodOptional<z.ZodEnum<["left", "center", "right", "full"]>>;
377
+ /**
378
+ * Whether `label` is the app's verbatim text or the extractor's SHAPE
379
+ * description of a dynamic region (a list/table it couldn't read literally).
380
+ * Defaults to "verbatim". The renderer styles "descriptive" labels distinctly
381
+ * so a reviewer sees "this is the tool's summary, not the app's words."
382
+ */
383
+ labelKind: z.ZodOptional<z.ZodEnum<["verbatim", "descriptive"]>>;
384
+ /** Free-form note the extractor wants to surface (e.g. "conditionally shown"). */
385
+ note: z.ZodOptional<z.ZodString>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
388
+ label?: string | undefined;
389
+ placeholder?: string | undefined;
390
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
391
+ secure?: boolean | undefined;
392
+ required?: boolean | undefined;
393
+ group?: string | undefined;
394
+ region?: "top" | "main" | "bottom" | undefined;
395
+ align?: "left" | "center" | "right" | "full" | undefined;
396
+ labelKind?: "verbatim" | "descriptive" | undefined;
397
+ note?: string | undefined;
398
+ }, {
399
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
400
+ label?: string | undefined;
401
+ placeholder?: string | undefined;
402
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
403
+ secure?: boolean | undefined;
404
+ required?: boolean | undefined;
405
+ group?: string | undefined;
406
+ region?: "top" | "main" | "bottom" | undefined;
407
+ align?: "left" | "center" | "right" | "full" | undefined;
408
+ labelKind?: "verbatim" | "descriptive" | undefined;
409
+ note?: string | undefined;
410
+ }>, "many">>;
411
+ /** Optional short description / purpose of the screen. */
412
+ description: z.ZodOptional<z.ZodString>;
413
+ /**
414
+ * Optional label-path for this screen's section, most-general first, using
415
+ * " › " as the separator — e.g. "Settings › AI Settings". Groups cluster and
416
+ * label screens; the renderer nests group labels. Deriveable from the route.
417
+ * (For the overall journey SHAPE, prefer `parent` below.)
418
+ */
419
+ group: z.ZodOptional<z.ZodString>;
420
+ /**
421
+ * Optional id of the screen this one hangs beneath in the JOURNEY tree — the
422
+ * screen a user reaches this one *from*. This is what roots the map as a real
423
+ * flow: an entry screen has no parent; the auth screen's parent is the entry;
424
+ * each feature-section hub's parent is the dashboard; etc. When set, it
425
+ * overrides route-derived nesting so the tree matches how users actually
426
+ * navigate. Must reference another screen's `id`.
427
+ */
428
+ parent: z.ZodOptional<z.ZodString>;
429
+ /**
430
+ * Optional hint that this screen is the app's entry point / root of the
431
+ * journey (what the user sees first). At most one screen should set this; the
432
+ * renderer roots the tree here. If none is set, the renderer infers a root.
433
+ */
434
+ isEntry: z.ZodOptional<z.ZodBoolean>;
435
+ /**
436
+ * How this screen is presented. "screen" (default) is a full page/route; the
437
+ * others are overlays. The renderer draws non-"screen" presentations with a
438
+ * distinct overlay frame and attaches them to their opener via an edge rather
439
+ * than the journey backbone.
440
+ */
441
+ presentation: z.ZodOptional<z.ZodEnum<["screen", "modal", "drawer", "sheet"]>>;
442
+ /**
443
+ * Optional state variant this screen represents (an empty/error/loading view
444
+ * of another screen). The renderer can cluster it beside its base screen.
445
+ */
446
+ state: z.ZodOptional<z.ZodEnum<["default", "empty", "error", "loading"]>>;
447
+ }, "strip", z.ZodTypeAny, {
448
+ id: string;
449
+ name: string;
450
+ elements: {
451
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
452
+ label?: string | undefined;
453
+ placeholder?: string | undefined;
454
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
455
+ secure?: boolean | undefined;
456
+ required?: boolean | undefined;
457
+ group?: string | undefined;
458
+ region?: "top" | "main" | "bottom" | undefined;
459
+ align?: "left" | "center" | "right" | "full" | undefined;
460
+ labelKind?: "verbatim" | "descriptive" | undefined;
461
+ note?: string | undefined;
462
+ }[];
463
+ group?: string | undefined;
464
+ route?: string | undefined;
465
+ sourceFile?: string | undefined;
466
+ description?: string | undefined;
467
+ parent?: string | undefined;
468
+ isEntry?: boolean | undefined;
469
+ presentation?: "screen" | "modal" | "drawer" | "sheet" | undefined;
470
+ state?: "default" | "empty" | "error" | "loading" | undefined;
471
+ }, {
472
+ id: string;
473
+ name: string;
474
+ group?: string | undefined;
475
+ route?: string | undefined;
476
+ sourceFile?: string | undefined;
477
+ elements?: {
478
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
479
+ label?: string | undefined;
480
+ placeholder?: string | undefined;
481
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
482
+ secure?: boolean | undefined;
483
+ required?: boolean | undefined;
484
+ group?: string | undefined;
485
+ region?: "top" | "main" | "bottom" | undefined;
486
+ align?: "left" | "center" | "right" | "full" | undefined;
487
+ labelKind?: "verbatim" | "descriptive" | undefined;
488
+ note?: string | undefined;
489
+ }[] | undefined;
490
+ description?: string | undefined;
491
+ parent?: string | undefined;
492
+ isEntry?: boolean | undefined;
493
+ presentation?: "screen" | "modal" | "drawer" | "sheet" | undefined;
494
+ state?: "default" | "empty" | "error" | "loading" | undefined;
495
+ }>, "many">>;
496
+ /** The navigation transitions (edges). */
497
+ edges: z.ZodDefault<z.ZodArray<z.ZodObject<{
498
+ /** Source screen id. */
499
+ from: z.ZodString;
500
+ /** Destination screen id. */
501
+ to: z.ZodString;
502
+ /**
503
+ * What triggers the transition — usually a button/link label
504
+ * ("Continue", "Forgot?"). Rendered as the edge label.
505
+ */
506
+ trigger: z.ZodOptional<z.ZodString>;
507
+ /** How the transition is expressed, if useful (e.g. "redirect", "push", "link"). */
508
+ kind: z.ZodOptional<z.ZodString>;
509
+ }, "strip", z.ZodTypeAny, {
510
+ from: string;
511
+ to: string;
512
+ trigger?: string | undefined;
513
+ kind?: string | undefined;
514
+ }, {
515
+ from: string;
516
+ to: string;
517
+ trigger?: string | undefined;
518
+ kind?: string | undefined;
519
+ }>, "many">>;
520
+ /** Optional provenance. */
521
+ meta: z.ZodOptional<z.ZodObject<{
522
+ /** The tool version that produced the map. */
523
+ generator: z.ZodOptional<z.ZodString>;
524
+ /** Repo-relative or absolute root the map was extracted from. */
525
+ repoRoot: z.ZodOptional<z.ZodString>;
526
+ /** ISO timestamp string (set by the producer; schema stays time-agnostic). */
527
+ generatedAt: z.ZodOptional<z.ZodString>;
528
+ /** How elements were derived: "agent", "static", or "hybrid". */
529
+ extraction: z.ZodOptional<z.ZodEnum<["agent", "static", "hybrid", "manual"]>>;
530
+ }, "strip", z.ZodTypeAny, {
531
+ generator?: string | undefined;
532
+ repoRoot?: string | undefined;
533
+ generatedAt?: string | undefined;
534
+ extraction?: "agent" | "static" | "hybrid" | "manual" | undefined;
535
+ }, {
536
+ generator?: string | undefined;
537
+ repoRoot?: string | undefined;
538
+ generatedAt?: string | undefined;
539
+ extraction?: "agent" | "static" | "hybrid" | "manual" | undefined;
540
+ }>>;
541
+ }, "strip", z.ZodTypeAny, {
542
+ name: string;
543
+ version: number;
544
+ surface: "web" | "mobile" | "crm" | "admin" | "backend" | "desktop" | "other";
545
+ screens: {
546
+ id: string;
547
+ name: string;
548
+ elements: {
549
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
550
+ label?: string | undefined;
551
+ placeholder?: string | undefined;
552
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
553
+ secure?: boolean | undefined;
554
+ required?: boolean | undefined;
555
+ group?: string | undefined;
556
+ region?: "top" | "main" | "bottom" | undefined;
557
+ align?: "left" | "center" | "right" | "full" | undefined;
558
+ labelKind?: "verbatim" | "descriptive" | undefined;
559
+ note?: string | undefined;
560
+ }[];
561
+ group?: string | undefined;
562
+ route?: string | undefined;
563
+ sourceFile?: string | undefined;
564
+ description?: string | undefined;
565
+ parent?: string | undefined;
566
+ isEntry?: boolean | undefined;
567
+ presentation?: "screen" | "modal" | "drawer" | "sheet" | undefined;
568
+ state?: "default" | "empty" | "error" | "loading" | undefined;
569
+ }[];
570
+ edges: {
571
+ from: string;
572
+ to: string;
573
+ trigger?: string | undefined;
574
+ kind?: string | undefined;
575
+ }[];
576
+ meta?: {
577
+ generator?: string | undefined;
578
+ repoRoot?: string | undefined;
579
+ generatedAt?: string | undefined;
580
+ extraction?: "agent" | "static" | "hybrid" | "manual" | undefined;
581
+ } | undefined;
582
+ }, {
583
+ name: string;
584
+ surface: "web" | "mobile" | "crm" | "admin" | "backend" | "desktop" | "other";
585
+ version?: number | undefined;
586
+ screens?: {
587
+ id: string;
588
+ name: string;
589
+ group?: string | undefined;
590
+ route?: string | undefined;
591
+ sourceFile?: string | undefined;
592
+ elements?: {
593
+ type: "heading" | "text" | "input" | "textarea" | "button" | "checkbox" | "radio" | "toggle" | "select" | "listbox" | "card" | "image" | "list" | "divider" | "nav" | "tabs";
594
+ label?: string | undefined;
595
+ placeholder?: string | undefined;
596
+ variant?: "primary" | "secondary" | "destructive" | "ghost" | "link" | undefined;
597
+ secure?: boolean | undefined;
598
+ required?: boolean | undefined;
599
+ group?: string | undefined;
600
+ region?: "top" | "main" | "bottom" | undefined;
601
+ align?: "left" | "center" | "right" | "full" | undefined;
602
+ labelKind?: "verbatim" | "descriptive" | undefined;
603
+ note?: string | undefined;
604
+ }[] | undefined;
605
+ description?: string | undefined;
606
+ parent?: string | undefined;
607
+ isEntry?: boolean | undefined;
608
+ presentation?: "screen" | "modal" | "drawer" | "sheet" | undefined;
609
+ state?: "default" | "empty" | "error" | "loading" | undefined;
610
+ }[] | undefined;
611
+ edges?: {
612
+ from: string;
613
+ to: string;
614
+ trigger?: string | undefined;
615
+ kind?: string | undefined;
616
+ }[] | undefined;
617
+ meta?: {
618
+ generator?: string | undefined;
619
+ repoRoot?: string | undefined;
620
+ generatedAt?: string | undefined;
621
+ extraction?: "agent" | "static" | "hybrid" | "manual" | undefined;
622
+ } | undefined;
623
+ }>;
624
+ export type ProjectMap = z.infer<typeof ProjectMap>;
625
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {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