@pipelex/mthds-form 0.31.0 → 0.32.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 (33) hide show
  1. package/README.md +5 -2
  2. package/dist/brand/index.d.ts +4 -2
  3. package/dist/brand/index.js +4 -2
  4. package/dist/brand/index.js.map +1 -1
  5. package/dist/{chunk-UZNRJWN5.js → chunk-3GO65HWP.js} +3 -31
  6. package/dist/chunk-3GO65HWP.js.map +1 -0
  7. package/dist/{chunk-XVGAQ4RK.js → chunk-IBBAJXIO.js} +4 -4
  8. package/dist/{chunk-XVGAQ4RK.js.map → chunk-IBBAJXIO.js.map} +1 -1
  9. package/dist/{chunk-ENK5QTUK.js → chunk-PCNFELNT.js} +6 -6
  10. package/dist/{chunk-ENK5QTUK.js.map → chunk-PCNFELNT.js.map} +1 -1
  11. package/dist/chunk-QGFR57OH.js +35 -0
  12. package/dist/chunk-QGFR57OH.js.map +1 -0
  13. package/dist/chunk-VBXFGUCG.js +2221 -0
  14. package/dist/chunk-VBXFGUCG.js.map +1 -0
  15. package/dist/{chunk-HVWE3TTC.js → chunk-ZB4RYUKV.js} +3 -3
  16. package/dist/{chunk-HVWE3TTC.js.map → chunk-ZB4RYUKV.js.map} +1 -1
  17. package/dist/{chunk-2UCH4AAO.js → chunk-ZX52CQJ4.js} +3 -3
  18. package/dist/{chunk-2UCH4AAO.js.map → chunk-ZX52CQJ4.js.map} +1 -1
  19. package/dist/core/derive.js +2 -2
  20. package/dist/core/gate.js +3 -3
  21. package/dist/core/index.js +12 -12
  22. package/dist/core/values.js +3 -3
  23. package/dist/generative/headless/index.d.ts +1702 -0
  24. package/dist/generative/headless/index.js +6 -0
  25. package/dist/generative/headless/index.js.map +1 -0
  26. package/dist/generative/index.d.ts +69 -1698
  27. package/dist/generative/index.js +334 -2286
  28. package/dist/generative/index.js.map +1 -1
  29. package/dist/manifest-D3DLyNEv.d.ts +17 -0
  30. package/dist/react/index.js +7 -7
  31. package/dist/{styles-BoXPBjF4.d.ts → styles-Bn8byNdo.d.ts} +1 -17
  32. package/package.json +5 -1
  33. package/dist/chunk-UZNRJWN5.js.map +0 -1
@@ -0,0 +1,1702 @@
1
+ import * as _json_render_core from '@json-render/core';
2
+ import { Spec } from '@json-render/core';
3
+ export { Spec } from '@json-render/core';
4
+ import { z } from 'zod';
5
+ import { RunField } from '../../core/descriptor.js';
6
+ import { d as AppStyleId } from '../../styles-Bn8byNdo.js';
7
+ import '../../core/contracts.js';
8
+ import 'mthds/protocol';
9
+ import '../../core/file-formats.js';
10
+
11
+ /**
12
+ * The frames a layout is written for, and the vocabulary each adds.
13
+ *
14
+ * `page` is a whole product page of its own, the frame every layout had
15
+ * before a host drew one around it. `composer` and `result` are the two
16
+ * moments of a host's compose-then-result app: the inputs before a run, in a
17
+ * centred column whose host draws the band above it and the action row's
18
+ * mechanics, and the result after one, under the host's bar restating the
19
+ * request. The two moments carry their own components, found by measuring the
20
+ * designer against hand-drawn screens of three methods: the composer's frame
21
+ * (`Composer`, with the page's h1, the panel and the host's action row) and a
22
+ * group of inputs inside it, and a result's header, a proportion bar, colour
23
+ * swatches, a picture, a fact, a labelled detail, a date in words and a list
24
+ * of short texts. A date range, chips for a list of texts and compact rows
25
+ * for a list of structures were found too, and went to the kernel's own
26
+ * controls instead, since they improve the plain form as much as a designed
27
+ * one: a composer delegates those inputs to `MthdsField`.
28
+ *
29
+ * Zod only, importable from node: `designerCatalog()` renders these into the
30
+ * data the designer method takes. Each description says what the component IS
31
+ * and how it renders, never where a page must put it.
32
+ */
33
+ /** The frame a layout is written for: a whole product page, or one of the two moments of a host's compose-then-result app. */
34
+ declare const FRAMES: readonly ["page", "composer", "result"];
35
+ type Frame = (typeof FRAMES)[number];
36
+ /** The components the composer frame adds to the catalog. */
37
+ declare const COMPOSER_COMPONENTS: readonly ["Composer", "FieldGroup"];
38
+ /** The components the result frame adds to the catalog. */
39
+ declare const RESULT_COMPONENTS: readonly ["ResultHeader", "ProportionBar", "Swatches", "Picture", "Fact", "Detail", "DateText", "TextList"];
40
+ /** Every component a frame adds, which the `page` frame's vocabulary leaves out. */
41
+ declare const FRAME_COMPONENTS: readonly ["Composer", "FieldGroup", "ResultHeader", "ProportionBar", "Swatches", "Picture", "Fact", "Detail", "DateText", "TextList"];
42
+
43
+ /**
44
+ * Whether a spec is one this catalog can render - the check every source
45
+ * passes, whoever wrote it.
46
+ *
47
+ * Three layers, because json-render's own `catalog.validate()` covers only the
48
+ * first two once a catalog has more than one component: it checks the element
49
+ * TYPE against the component names, but `propsOf` degrades to "any record"
50
+ * when several definitions could apply, so a misspelt or invented prop passes.
51
+ * The per-component prop check is therefore this module's, and it has to be
52
+ * expression-aware: a bound prop's raw value is `{ "$state": "/path" }`, which
53
+ * the component's own zod schema (`z.string()`) would reject, so a dynamic
54
+ * expression is accepted wherever the prop EXISTS and a literal is parsed
55
+ * against the prop's schema.
56
+ *
57
+ * The checks are the same whichever catalog a spec was written against; the
58
+ * catalog is a parameter, this entry's own by default, so a host that defines
59
+ * a vocabulary of its own is validated by the same code and not by a copy of
60
+ * it.
61
+ *
62
+ * What a component renders beyond its schema - the heading its title is, the
63
+ * landmark it renders as, the fixed number of children it lays out, the panel
64
+ * per entry of one of its props - is a fact about its renderer that no schema
65
+ * states, so the catalog carries it as `renders`, declared beside the
66
+ * definitions, and the validator reads it off the catalog it is handed rather
67
+ * than assuming it from a component's name, which a host's vocabulary may
68
+ * reuse for something that renders nothing of the kind. This entry's catalog
69
+ * declares its own; a host's declares what its renderers do, or nothing, and
70
+ * is then held only to what its schemas and its `Heading` elements say.
71
+ */
72
+ /**
73
+ * What one component renders beyond what its props schema says, and what the
74
+ * validator holds a layout to on that account. Every member is optional: a
75
+ * component with none is held to its schema alone.
76
+ */
77
+ interface ComponentRendering {
78
+ /**
79
+ * The heading its renderer emits, at this level - a `Hero`'s headline is
80
+ * the h1 - and, when it emits one only if a prop is set, the prop: a `Card`
81
+ * renders its `title` as an h3 and nothing when it has none.
82
+ */
83
+ heading?: {
84
+ level: 1 | 2 | 3 | 4;
85
+ when?: string;
86
+ };
87
+ /** What it renders as that a page has one of - a landmark, in the words a refusal uses: "the page's banner". */
88
+ once?: string;
89
+ /** The number of children its renderer lays out, dropping the rest in silence, and what they are. */
90
+ children?: {
91
+ count: number;
92
+ roles: string;
93
+ };
94
+ /** A panelled container: the prop that lists its panels, one child per entry, and what one is called. */
95
+ panels?: {
96
+ prop: string;
97
+ noun: string;
98
+ };
99
+ }
100
+ /** What the validator reads off a catalog: its names, its definitions, and what its components render. */
101
+ interface ValidationCatalog {
102
+ componentNames: readonly string[];
103
+ /** The catalog's own action names. A `defineCatalog` result carries this already. */
104
+ actionNames?: readonly string[];
105
+ data: unknown;
106
+ /** The schema the catalog was defined against, for the actions its runtime handles without a handler. */
107
+ schema?: {
108
+ builtInActions?: readonly {
109
+ name: string;
110
+ }[];
111
+ };
112
+ /** What each component renders beyond its schema, by component name. Absent, no component renders a heading, a landmark or a fixed set of children. */
113
+ renders?: Readonly<Record<string, ComponentRendering>>;
114
+ }
115
+ interface SpecProblem {
116
+ elementKey?: string;
117
+ message: string;
118
+ }
119
+ interface SpecVerdict {
120
+ ok: boolean;
121
+ problems: SpecProblem[];
122
+ }
123
+ /**
124
+ * Whether a spec is one this catalog can render.
125
+ *
126
+ * The checks live in `checkAgainstCatalog`; this is the boundary that keeps the
127
+ * documented promise around them - it answers with problems, not exceptions.
128
+ * That promise was not kept: `validateSpec` throws on `repeat: null`, on
129
+ * `children: 5`, on `props: 5`, on a null element and on a missing `elements`
130
+ * map, all of which a model can emit. A host calls this to decide whether it is
131
+ * safe to render, so a throw leaves it with no verdict at the one moment it
132
+ * needs one, and the fallback to the plain form never fires.
133
+ */
134
+ declare function validateAgainstCatalog(spec: Spec, catalog?: ValidationCatalog): SpecVerdict;
135
+ /** The problems as one block, for a failing test or a repair prompt. */
136
+ declare function formatProblems(problems: readonly SpecProblem[]): string;
137
+
138
+ /**
139
+ * The catalog: everything the base vocabulary has, plus the chrome of a
140
+ * product page - a bar with the logo, a hero, a workspace that puts a panel
141
+ * beside the work, a section, a raised rail, the summary rows a rail can be
142
+ * made of, a call to action, a footer line. They are vocabulary, not a
143
+ * template: the designer method prescribes no composition, and a layout uses
144
+ * whichever of them serve it. Each description says what the component IS and
145
+ * how it renders - a heading level, a landmark, a fixed child count - and never
146
+ * where it must go or whether a page must have it, because the descriptions
147
+ * travel to the model as data and would otherwise be the mandate the method
148
+ * gave up. The vocabulary names no brand: the logo is whichever the manifest
149
+ * carries and the accent is whichever the host's theme tokens set.
150
+ *
151
+ * Rule 1 holds here as it does everywhere in this entry: a component takes
152
+ * copy and bound values, never a schema, and the fields the kernel owns are
153
+ * still `MthdsField` elements naming a path.
154
+ */
155
+ declare const PRODUCT_COMPONENTS: readonly ["AppBar", "Hero", "Workspace", "Section", "Rail", "SummaryRow", "Cta", "Footer"];
156
+ type ProductComponentName = (typeof PRODUCT_COMPONENTS)[number];
157
+ /**
158
+ * What this entry's components render beyond their schemas - the heading a
159
+ * title is, the landmark a bar or a footer renders as, the two children a
160
+ * split lays out, the panel per tab or step - declared once here, where the
161
+ * descriptions above say the same in prose for the model, and carried on the
162
+ * catalog so the validator reads it off whichever catalog it is handed. A
163
+ * host validating against a vocabulary of its own declares what its
164
+ * renderers do, or nothing.
165
+ */
166
+ declare const COMPONENT_RENDERINGS: Readonly<Record<string, ComponentRendering>>;
167
+ declare const catalog: _json_render_core.Catalog<{
168
+ spec: _json_render_core.SchemaType<"object", {
169
+ root: _json_render_core.SchemaType<"string", unknown>;
170
+ elements: _json_render_core.SchemaType<"record", _json_render_core.SchemaType<"object", {
171
+ type: _json_render_core.SchemaType<"ref", string>;
172
+ props: _json_render_core.SchemaType<"propsOf", string>;
173
+ children: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"string", unknown>>;
174
+ slots: {
175
+ optional: true;
176
+ kind: "record";
177
+ inner?: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"string", unknown>> | undefined;
178
+ };
179
+ visible: {
180
+ optional: true;
181
+ kind: "any";
182
+ inner?: unknown;
183
+ };
184
+ repeat: {
185
+ optional: true;
186
+ kind: "any";
187
+ inner?: unknown;
188
+ };
189
+ }>>;
190
+ }>;
191
+ catalog: _json_render_core.SchemaType<"object", {
192
+ components: _json_render_core.SchemaType<"map", {
193
+ props: _json_render_core.SchemaType<"zod", unknown>;
194
+ slots: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"string", unknown>>;
195
+ description: _json_render_core.SchemaType<"string", unknown>;
196
+ example: _json_render_core.SchemaType<"any", unknown>;
197
+ }>;
198
+ actions: _json_render_core.SchemaType<"map", {
199
+ params: _json_render_core.SchemaType<"zod", unknown>;
200
+ description: _json_render_core.SchemaType<"string", unknown>;
201
+ }>;
202
+ }>;
203
+ }, {
204
+ components: {
205
+ Composer: {
206
+ props: z.ZodObject<{
207
+ headline: z.ZodString;
208
+ lede: z.ZodNullable<z.ZodString>;
209
+ runLabel: z.ZodString;
210
+ columns: z.ZodNullable<z.ZodEnum<{
211
+ 1: "1";
212
+ 2: "2";
213
+ }>>;
214
+ notes: z.ZodNullable<z.ZodArray<z.ZodString>>;
215
+ }, z.core.$strip>;
216
+ slots: string[];
217
+ events: string[];
218
+ description: string;
219
+ example: {
220
+ headline: string;
221
+ lede: string;
222
+ runLabel: string;
223
+ columns: string;
224
+ };
225
+ };
226
+ FieldGroup: {
227
+ props: z.ZodObject<{
228
+ title: z.ZodNullable<z.ZodString>;
229
+ }, z.core.$strip>;
230
+ slots: string[];
231
+ description: string;
232
+ example: {
233
+ title: string;
234
+ };
235
+ };
236
+ ResultHeader: {
237
+ props: z.ZodObject<{
238
+ eyebrow: z.ZodNullable<z.ZodString>;
239
+ title: z.ZodString;
240
+ subtitle: z.ZodNullable<z.ZodString>;
241
+ }, z.core.$strip>;
242
+ slots: never[];
243
+ description: string;
244
+ example: {
245
+ eyebrow: string;
246
+ title: {
247
+ $state: string;
248
+ };
249
+ subtitle: {
250
+ $template: string;
251
+ };
252
+ };
253
+ };
254
+ ProportionBar: {
255
+ props: z.ZodObject<{
256
+ label: z.ZodString;
257
+ total: z.ZodNullable<z.ZodNumber>;
258
+ of: z.ZodNullable<z.ZodNumber>;
259
+ unit: z.ZodNullable<z.ZodString>;
260
+ items: z.ZodNullable<z.ZodArray<z.ZodAny>>;
261
+ labelKey: z.ZodString;
262
+ valueKey: z.ZodString;
263
+ }, z.core.$strip>;
264
+ slots: never[];
265
+ description: string;
266
+ example: {
267
+ label: string;
268
+ total: {
269
+ $state: string;
270
+ };
271
+ unit: {
272
+ $state: string;
273
+ };
274
+ items: {
275
+ $state: string;
276
+ };
277
+ labelKey: string;
278
+ valueKey: string;
279
+ };
280
+ };
281
+ Swatches: {
282
+ props: z.ZodObject<{
283
+ colors: z.ZodArray<z.ZodString>;
284
+ }, z.core.$strip>;
285
+ slots: never[];
286
+ description: string;
287
+ example: {
288
+ colors: {
289
+ $item: string;
290
+ }[];
291
+ };
292
+ };
293
+ Picture: {
294
+ props: z.ZodObject<{
295
+ path: z.ZodString;
296
+ alt: z.ZodNullable<z.ZodString>;
297
+ aspect: z.ZodNullable<z.ZodEnum<{
298
+ "1:1": "1:1";
299
+ "16:9": "16:9";
300
+ "4:3": "4:3";
301
+ auto: "auto";
302
+ }>>;
303
+ }, z.core.$strip>;
304
+ slots: never[];
305
+ description: string;
306
+ example: {
307
+ path: string;
308
+ alt: string;
309
+ aspect: string;
310
+ };
311
+ };
312
+ Fact: {
313
+ props: z.ZodObject<{
314
+ label: z.ZodString;
315
+ value: z.ZodAny;
316
+ detail: z.ZodNullable<z.ZodString>;
317
+ }, z.core.$strip>;
318
+ slots: never[];
319
+ description: string;
320
+ example: {
321
+ label: string;
322
+ value: {
323
+ $state: string;
324
+ };
325
+ };
326
+ };
327
+ DateText: {
328
+ props: z.ZodObject<{
329
+ value: z.ZodNullable<z.ZodString>;
330
+ style: z.ZodNullable<z.ZodEnum<{
331
+ long: "long";
332
+ short: "short";
333
+ weekday: "weekday";
334
+ }>>;
335
+ tone: z.ZodNullable<z.ZodEnum<{
336
+ default: "default";
337
+ muted: "muted";
338
+ accent: "accent";
339
+ }>>;
340
+ }, z.core.$strip>;
341
+ slots: never[];
342
+ description: string;
343
+ example: {
344
+ value: {
345
+ $item: string;
346
+ };
347
+ style: string;
348
+ tone: string;
349
+ };
350
+ };
351
+ TextList: {
352
+ props: z.ZodObject<{
353
+ items: z.ZodNullable<z.ZodArray<z.ZodString>>;
354
+ marker: z.ZodNullable<z.ZodEnum<{
355
+ number: "number";
356
+ check: "check";
357
+ bullet: "bullet";
358
+ }>>;
359
+ }, z.core.$strip>;
360
+ slots: never[];
361
+ description: string;
362
+ example: {
363
+ items: {
364
+ $state: string;
365
+ };
366
+ marker: string;
367
+ };
368
+ };
369
+ Detail: {
370
+ props: z.ZodObject<{
371
+ label: z.ZodString;
372
+ value: z.ZodAny;
373
+ }, z.core.$strip>;
374
+ slots: never[];
375
+ description: string;
376
+ example: {
377
+ label: string;
378
+ value: {
379
+ $item: string;
380
+ };
381
+ };
382
+ };
383
+ AppBar: {
384
+ props: z.ZodObject<{
385
+ app: z.ZodString;
386
+ links: z.ZodNullable<z.ZodArray<z.ZodString>>;
387
+ tag: z.ZodNullable<z.ZodString>;
388
+ }, z.core.$strip>;
389
+ slots: never[];
390
+ description: string;
391
+ example: {
392
+ app: string;
393
+ links: string[];
394
+ tag: string;
395
+ };
396
+ };
397
+ Hero: {
398
+ props: z.ZodObject<{
399
+ headline: z.ZodString;
400
+ lede: z.ZodNullable<z.ZodString>;
401
+ eyebrow: z.ZodNullable<z.ZodString>;
402
+ }, z.core.$strip>;
403
+ slots: never[];
404
+ description: string;
405
+ example: {
406
+ headline: string;
407
+ lede: string;
408
+ };
409
+ };
410
+ Workspace: {
411
+ props: z.ZodObject<{
412
+ rail: z.ZodNullable<z.ZodEnum<{
413
+ right: "right";
414
+ left: "left";
415
+ }>>;
416
+ }, z.core.$strip>;
417
+ slots: string[];
418
+ description: string;
419
+ example: {
420
+ rail: string;
421
+ };
422
+ };
423
+ Section: {
424
+ props: z.ZodObject<{
425
+ number: z.ZodNullable<z.ZodString>;
426
+ title: z.ZodString;
427
+ lede: z.ZodNullable<z.ZodString>;
428
+ }, z.core.$strip>;
429
+ slots: string[];
430
+ description: string;
431
+ example: {
432
+ number: string;
433
+ title: string;
434
+ };
435
+ };
436
+ Rail: {
437
+ props: z.ZodObject<{
438
+ title: z.ZodString;
439
+ }, z.core.$strip>;
440
+ slots: string[];
441
+ description: string;
442
+ example: {
443
+ title: string;
444
+ };
445
+ };
446
+ SummaryRow: {
447
+ props: z.ZodObject<{
448
+ label: z.ZodString;
449
+ value: z.ZodNullable<z.ZodAny>;
450
+ detail: z.ZodNullable<z.ZodAny>;
451
+ separator: z.ZodNullable<z.ZodString>;
452
+ placeholder: z.ZodNullable<z.ZodString>;
453
+ }, z.core.$strip>;
454
+ slots: never[];
455
+ description: string;
456
+ example: {
457
+ label: string;
458
+ value: {
459
+ $state: string;
460
+ };
461
+ detail: {
462
+ $state: string;
463
+ };
464
+ };
465
+ };
466
+ Cta: {
467
+ props: z.ZodObject<{
468
+ label: z.ZodString;
469
+ hint: z.ZodNullable<z.ZodString>;
470
+ }, z.core.$strip>;
471
+ slots: never[];
472
+ events: string[];
473
+ description: string;
474
+ example: {
475
+ label: string;
476
+ hint: string;
477
+ };
478
+ };
479
+ Footer: {
480
+ props: z.ZodObject<{
481
+ text: z.ZodString;
482
+ tag: z.ZodNullable<z.ZodString>;
483
+ }, z.core.$strip>;
484
+ slots: never[];
485
+ description: string;
486
+ example: {
487
+ text: string;
488
+ tag: string;
489
+ };
490
+ };
491
+ Card: {
492
+ props: z.ZodObject<{
493
+ description: z.ZodNullable<z.ZodString>;
494
+ title: z.ZodNullable<z.ZodString>;
495
+ }, z.core.$strip>;
496
+ description: string;
497
+ slots: string[];
498
+ example: {
499
+ title: string;
500
+ description: string;
501
+ };
502
+ };
503
+ Stack: {
504
+ props: z.ZodObject<{
505
+ direction: z.ZodNullable<z.ZodEnum<{
506
+ horizontal: "horizontal";
507
+ vertical: "vertical";
508
+ }>>;
509
+ gap: z.ZodNullable<z.ZodEnum<{
510
+ sm: "sm";
511
+ md: "md";
512
+ lg: "lg";
513
+ none: "none";
514
+ xl: "xl";
515
+ }>>;
516
+ align: z.ZodNullable<z.ZodEnum<{
517
+ start: "start";
518
+ center: "center";
519
+ end: "end";
520
+ stretch: "stretch";
521
+ }>>;
522
+ justify: z.ZodNullable<z.ZodEnum<{
523
+ start: "start";
524
+ center: "center";
525
+ end: "end";
526
+ between: "between";
527
+ around: "around";
528
+ }>>;
529
+ }, z.core.$strip>;
530
+ slots: string[];
531
+ description: string;
532
+ example: {
533
+ direction: string;
534
+ gap: string;
535
+ };
536
+ };
537
+ Grid: {
538
+ props: z.ZodObject<{
539
+ gap: z.ZodNullable<z.ZodEnum<{
540
+ sm: "sm";
541
+ md: "md";
542
+ lg: "lg";
543
+ xl: "xl";
544
+ }>>;
545
+ columns: z.ZodNullable<z.ZodNumber>;
546
+ }, z.core.$strip>;
547
+ slots: string[];
548
+ description: string;
549
+ example: {
550
+ columns: number;
551
+ gap: string;
552
+ };
553
+ };
554
+ Separator: {
555
+ props: z.ZodObject<{
556
+ orientation: z.ZodNullable<z.ZodEnum<{
557
+ horizontal: "horizontal";
558
+ vertical: "vertical";
559
+ }>>;
560
+ }, z.core.$strip>;
561
+ description: string;
562
+ };
563
+ Collapsible: {
564
+ props: z.ZodObject<{
565
+ title: z.ZodString;
566
+ defaultOpen: z.ZodNullable<z.ZodBoolean>;
567
+ }, z.core.$strip>;
568
+ slots: string[];
569
+ description: string;
570
+ };
571
+ Heading: {
572
+ props: z.ZodObject<{
573
+ text: z.ZodString;
574
+ level: z.ZodNullable<z.ZodEnum<{
575
+ h1: "h1";
576
+ h2: "h2";
577
+ h3: "h3";
578
+ h4: "h4";
579
+ }>>;
580
+ }, z.core.$strip>;
581
+ description: string;
582
+ example: {
583
+ text: string;
584
+ level: string;
585
+ };
586
+ };
587
+ Text: {
588
+ props: z.ZodObject<{
589
+ text: z.ZodString;
590
+ variant: z.ZodNullable<z.ZodEnum<{
591
+ body: "body";
592
+ caption: "caption";
593
+ muted: "muted";
594
+ lead: "lead";
595
+ code: "code";
596
+ }>>;
597
+ }, z.core.$strip>;
598
+ description: string;
599
+ example: {
600
+ text: string;
601
+ };
602
+ };
603
+ Badge: {
604
+ props: z.ZodObject<{
605
+ text: z.ZodString;
606
+ variant: z.ZodNullable<z.ZodEnum<{
607
+ default: "default";
608
+ secondary: "secondary";
609
+ destructive: "destructive";
610
+ outline: "outline";
611
+ }>>;
612
+ }, z.core.$strip>;
613
+ description: string;
614
+ example: {
615
+ text: string;
616
+ variant: string;
617
+ };
618
+ };
619
+ Alert: {
620
+ props: z.ZodObject<{
621
+ title: z.ZodString;
622
+ message: z.ZodNullable<z.ZodString>;
623
+ type: z.ZodNullable<z.ZodEnum<{
624
+ success: "success";
625
+ info: "info";
626
+ warning: "warning";
627
+ error: "error";
628
+ }>>;
629
+ }, z.core.$strip>;
630
+ description: string;
631
+ example: {
632
+ title: string;
633
+ message: string;
634
+ type: string;
635
+ };
636
+ };
637
+ Progress: {
638
+ props: z.ZodObject<{
639
+ value: z.ZodNumber;
640
+ max: z.ZodNullable<z.ZodNumber>;
641
+ label: z.ZodNullable<z.ZodString>;
642
+ }, z.core.$strip>;
643
+ description: string;
644
+ example: {
645
+ value: number;
646
+ max: number;
647
+ label: string;
648
+ };
649
+ };
650
+ Avatar: {
651
+ description: string;
652
+ props: z.ZodObject<{
653
+ src: z.ZodNullable<z.ZodString>;
654
+ name: z.ZodString;
655
+ size: z.ZodNullable<z.ZodEnum<{
656
+ sm: "sm";
657
+ md: "md";
658
+ lg: "lg";
659
+ }>>;
660
+ }, z.core.$strip>;
661
+ example: {
662
+ name: string;
663
+ size: string;
664
+ };
665
+ };
666
+ Input: {
667
+ props: z.ZodObject<{
668
+ label: z.ZodString;
669
+ name: z.ZodString;
670
+ type: z.ZodNullable<z.ZodEnum<{
671
+ number: "number";
672
+ text: "text";
673
+ email: "email";
674
+ password: "password";
675
+ }>>;
676
+ placeholder: z.ZodNullable<z.ZodString>;
677
+ value: z.ZodNullable<z.ZodString>;
678
+ checks: z.ZodNullable<z.ZodArray<z.ZodObject<{
679
+ type: z.ZodString;
680
+ message: z.ZodString;
681
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
682
+ }, z.core.$strip>>>;
683
+ validateOn: z.ZodNullable<z.ZodEnum<{
684
+ change: "change";
685
+ blur: "blur";
686
+ submit: "submit";
687
+ }>>;
688
+ }, z.core.$strip>;
689
+ events: string[];
690
+ description: string;
691
+ example: {
692
+ label: string;
693
+ name: string;
694
+ type: string;
695
+ placeholder: string;
696
+ };
697
+ };
698
+ Textarea: {
699
+ props: z.ZodObject<{
700
+ label: z.ZodString;
701
+ name: z.ZodString;
702
+ placeholder: z.ZodNullable<z.ZodString>;
703
+ rows: z.ZodNullable<z.ZodNumber>;
704
+ value: z.ZodNullable<z.ZodString>;
705
+ checks: z.ZodNullable<z.ZodArray<z.ZodObject<{
706
+ type: z.ZodString;
707
+ message: z.ZodString;
708
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
709
+ }, z.core.$strip>>>;
710
+ validateOn: z.ZodNullable<z.ZodEnum<{
711
+ change: "change";
712
+ blur: "blur";
713
+ submit: "submit";
714
+ }>>;
715
+ }, z.core.$strip>;
716
+ description: string;
717
+ };
718
+ Select: {
719
+ props: z.ZodObject<{
720
+ label: z.ZodString;
721
+ name: z.ZodString;
722
+ options: z.ZodArray<z.ZodString>;
723
+ placeholder: z.ZodNullable<z.ZodString>;
724
+ value: z.ZodNullable<z.ZodString>;
725
+ checks: z.ZodNullable<z.ZodArray<z.ZodObject<{
726
+ type: z.ZodString;
727
+ message: z.ZodString;
728
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
729
+ }, z.core.$strip>>>;
730
+ validateOn: z.ZodNullable<z.ZodEnum<{
731
+ change: "change";
732
+ blur: "blur";
733
+ submit: "submit";
734
+ }>>;
735
+ }, z.core.$strip>;
736
+ events: string[];
737
+ description: string;
738
+ };
739
+ Radio: {
740
+ props: z.ZodObject<{
741
+ label: z.ZodString;
742
+ name: z.ZodString;
743
+ options: z.ZodArray<z.ZodString>;
744
+ value: z.ZodNullable<z.ZodString>;
745
+ checks: z.ZodNullable<z.ZodArray<z.ZodObject<{
746
+ type: z.ZodString;
747
+ message: z.ZodString;
748
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
749
+ }, z.core.$strip>>>;
750
+ validateOn: z.ZodNullable<z.ZodEnum<{
751
+ change: "change";
752
+ blur: "blur";
753
+ submit: "submit";
754
+ }>>;
755
+ }, z.core.$strip>;
756
+ events: string[];
757
+ description: string;
758
+ };
759
+ Checkbox: {
760
+ props: z.ZodObject<{
761
+ label: z.ZodString;
762
+ name: z.ZodString;
763
+ checked: z.ZodNullable<z.ZodBoolean>;
764
+ checks: z.ZodNullable<z.ZodArray<z.ZodObject<{
765
+ type: z.ZodString;
766
+ message: z.ZodString;
767
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
768
+ }, z.core.$strip>>>;
769
+ validateOn: z.ZodNullable<z.ZodEnum<{
770
+ change: "change";
771
+ blur: "blur";
772
+ submit: "submit";
773
+ }>>;
774
+ }, z.core.$strip>;
775
+ events: string[];
776
+ description: string;
777
+ };
778
+ Switch: {
779
+ props: z.ZodObject<{
780
+ label: z.ZodString;
781
+ name: z.ZodString;
782
+ checked: z.ZodNullable<z.ZodBoolean>;
783
+ checks: z.ZodNullable<z.ZodArray<z.ZodObject<{
784
+ type: z.ZodString;
785
+ message: z.ZodString;
786
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
787
+ }, z.core.$strip>>>;
788
+ validateOn: z.ZodNullable<z.ZodEnum<{
789
+ change: "change";
790
+ blur: "blur";
791
+ submit: "submit";
792
+ }>>;
793
+ }, z.core.$strip>;
794
+ events: string[];
795
+ description: string;
796
+ };
797
+ Button: {
798
+ props: z.ZodObject<{
799
+ label: z.ZodString;
800
+ variant: z.ZodNullable<z.ZodEnum<{
801
+ secondary: "secondary";
802
+ primary: "primary";
803
+ danger: "danger";
804
+ }>>;
805
+ disabled: z.ZodNullable<z.ZodBoolean>;
806
+ }, z.core.$strip>;
807
+ events: string[];
808
+ description: string;
809
+ example: {
810
+ label: string;
811
+ variant: string;
812
+ };
813
+ };
814
+ Split: {
815
+ props: z.ZodObject<{
816
+ ratio: z.ZodNullable<z.ZodEnum<{
817
+ "1:1": "1:1";
818
+ "1:2": "1:2";
819
+ "2:1": "2:1";
820
+ }>>;
821
+ gap: z.ZodNullable<z.ZodEnum<{
822
+ md: "md";
823
+ lg: "lg";
824
+ xl: "xl";
825
+ }>>;
826
+ }, z.core.$strip>;
827
+ slots: string[];
828
+ description: string;
829
+ example: {
830
+ ratio: string;
831
+ gap: string;
832
+ };
833
+ };
834
+ Tabs: {
835
+ props: z.ZodObject<{
836
+ tabs: z.ZodArray<z.ZodObject<{
837
+ label: z.ZodString;
838
+ value: z.ZodString;
839
+ }, z.core.$strip>>;
840
+ }, z.core.$strip>;
841
+ slots: string[];
842
+ description: string;
843
+ example: {
844
+ tabs: {
845
+ label: string;
846
+ value: string;
847
+ }[];
848
+ };
849
+ };
850
+ Steps: {
851
+ props: z.ZodObject<{
852
+ steps: z.ZodArray<z.ZodString>;
853
+ nextLabel: z.ZodNullable<z.ZodString>;
854
+ backLabel: z.ZodNullable<z.ZodString>;
855
+ }, z.core.$strip>;
856
+ slots: string[];
857
+ description: string;
858
+ example: {
859
+ steps: string[];
860
+ nextLabel: string;
861
+ };
862
+ };
863
+ Icon: {
864
+ props: z.ZodObject<{
865
+ name: z.ZodEnum<{
866
+ Sparkles: "Sparkles";
867
+ Rocket: "Rocket";
868
+ Compass: "Compass";
869
+ Map: "Map";
870
+ MapPin: "MapPin";
871
+ Route: "Route";
872
+ Plane: "Plane";
873
+ Train: "Train";
874
+ Car: "Car";
875
+ Ship: "Ship";
876
+ Hotel: "Hotel";
877
+ Home: "Home";
878
+ Building2: "Building2";
879
+ Landmark: "Landmark";
880
+ Globe: "Globe";
881
+ Mountain: "Mountain";
882
+ Leaf: "Leaf";
883
+ Sun: "Sun";
884
+ Moon: "Moon";
885
+ Calendar: "Calendar";
886
+ Clock: "Clock";
887
+ Hourglass: "Hourglass";
888
+ Users: "Users";
889
+ User: "User";
890
+ Baby: "Baby";
891
+ Accessibility: "Accessibility";
892
+ Heart: "Heart";
893
+ Star: "Star";
894
+ Utensils: "Utensils";
895
+ Coffee: "Coffee";
896
+ Music: "Music";
897
+ Camera: "Camera";
898
+ Image: "Image";
899
+ Ticket: "Ticket";
900
+ Gift: "Gift";
901
+ Wallet: "Wallet";
902
+ Banknote: "Banknote";
903
+ Coins: "Coins";
904
+ Receipt: "Receipt";
905
+ Percent: "Percent";
906
+ Hash: "Hash";
907
+ TrendingUp: "TrendingUp";
908
+ BarChart3: "BarChart3";
909
+ FileText: "FileText";
910
+ Upload: "Upload";
911
+ Paperclip: "Paperclip";
912
+ Mail: "Mail";
913
+ Phone: "Phone";
914
+ Tag: "Tag";
915
+ Layers: "Layers";
916
+ ListChecks: "ListChecks";
917
+ CheckCircle2: "CheckCircle2";
918
+ AlertCircle: "AlertCircle";
919
+ Info: "Info";
920
+ Shield: "Shield";
921
+ Flag: "Flag";
922
+ Bookmark: "Bookmark";
923
+ Briefcase: "Briefcase";
924
+ Package: "Package";
925
+ Truck: "Truck";
926
+ Lightbulb: "Lightbulb";
927
+ Zap: "Zap";
928
+ Pencil: "Pencil";
929
+ Send: "Send";
930
+ }>;
931
+ size: z.ZodNullable<z.ZodEnum<{
932
+ sm: "sm";
933
+ md: "md";
934
+ lg: "lg";
935
+ }>>;
936
+ }, z.core.$strip>;
937
+ slots: never[];
938
+ description: string;
939
+ example: {
940
+ name: string;
941
+ size: string;
942
+ };
943
+ };
944
+ Segmented: {
945
+ props: z.ZodObject<{
946
+ label: z.ZodString;
947
+ name: z.ZodString;
948
+ options: z.ZodArray<z.ZodString>;
949
+ value: z.ZodNullable<z.ZodString>;
950
+ }, z.core.$strip>;
951
+ slots: never[];
952
+ description: string;
953
+ example: {
954
+ label: string;
955
+ name: string;
956
+ options: string[];
957
+ value: {
958
+ $bindState: string;
959
+ };
960
+ };
961
+ };
962
+ NumberInput: {
963
+ props: z.ZodObject<{
964
+ label: z.ZodString;
965
+ name: z.ZodString;
966
+ value: z.ZodNullable<z.ZodNumber>;
967
+ placeholder: z.ZodNullable<z.ZodString>;
968
+ unit: z.ZodNullable<z.ZodString>;
969
+ min: z.ZodNullable<z.ZodNumber>;
970
+ max: z.ZodNullable<z.ZodNumber>;
971
+ step: z.ZodNullable<z.ZodNumber>;
972
+ }, z.core.$strip>;
973
+ slots: never[];
974
+ description: string;
975
+ example: {
976
+ label: string;
977
+ name: string;
978
+ value: {
979
+ $bindState: string;
980
+ };
981
+ placeholder: string;
982
+ };
983
+ };
984
+ MthdsField: {
985
+ props: z.ZodObject<{
986
+ path: z.ZodString;
987
+ label: z.ZodNullable<z.ZodString>;
988
+ hint: z.ZodNullable<z.ZodString>;
989
+ }, z.core.$strip>;
990
+ slots: never[];
991
+ description: string;
992
+ example: {
993
+ path: string;
994
+ };
995
+ };
996
+ MthdsResult: {
997
+ props: z.ZodObject<{
998
+ path: z.ZodString;
999
+ hideLabel: z.ZodNullable<z.ZodBoolean>;
1000
+ }, z.core.$strip>;
1001
+ slots: never[];
1002
+ description: string;
1003
+ example: {
1004
+ path: string;
1005
+ };
1006
+ };
1007
+ DataTable: {
1008
+ props: z.ZodObject<{
1009
+ rows: z.ZodAny;
1010
+ columns: z.ZodArray<z.ZodObject<{
1011
+ path: z.ZodString;
1012
+ label: z.ZodString;
1013
+ format: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1014
+ number: "number";
1015
+ date: "date";
1016
+ text: "text";
1017
+ }>>>;
1018
+ }, z.core.$strip>>;
1019
+ caption: z.ZodNullable<z.ZodString>;
1020
+ }, z.core.$strip>;
1021
+ slots: never[];
1022
+ description: string;
1023
+ example: {
1024
+ rows: {
1025
+ $state: string;
1026
+ };
1027
+ columns: {
1028
+ path: string;
1029
+ label: string;
1030
+ }[];
1031
+ };
1032
+ };
1033
+ Metric: {
1034
+ props: z.ZodObject<{
1035
+ label: z.ZodString;
1036
+ value: z.ZodAny;
1037
+ unit: z.ZodNullable<z.ZodString>;
1038
+ format: z.ZodNullable<z.ZodEnum<{
1039
+ plain: "plain";
1040
+ integer: "integer";
1041
+ decimal: "decimal";
1042
+ compact: "compact";
1043
+ }>>;
1044
+ }, z.core.$strip>;
1045
+ slots: never[];
1046
+ description: string;
1047
+ example: {
1048
+ label: string;
1049
+ value: {
1050
+ $state: string;
1051
+ };
1052
+ unit: string;
1053
+ format: string;
1054
+ };
1055
+ };
1056
+ };
1057
+ actions: {
1058
+ run: {
1059
+ params: z.ZodObject<{}, z.core.$strip>;
1060
+ description: string;
1061
+ };
1062
+ };
1063
+ }> & {
1064
+ renders: Readonly<Record<string, ComponentRendering>>;
1065
+ };
1066
+ /** The spec type a layout is written against. */
1067
+ type GenerativeSpec = typeof catalog._specType;
1068
+ /**
1069
+ * Every component name the catalog knows, the shadcn subset first. This is
1070
+ * the order the designer method lists them in, since `designerCatalog()`
1071
+ * walks it; the rules and the direction that name them are the method's own
1072
+ * prose, in `methods/layout-design.mthds`.
1073
+ */
1074
+ declare const COMPONENT_NAMES: readonly string[];
1075
+ /** The component names a layout written for `frame` may use, in the order the designer method lists them. */
1076
+ declare function componentNamesFor(frame: Frame): readonly string[];
1077
+ /**
1078
+ * The catalog a layout written for `frame` is validated against: the same
1079
+ * definitions and renderings as `catalog`, held to the frame's vocabulary. A
1080
+ * composer that names an `AppBar` is refused here as an unknown component,
1081
+ * though the entry's registry could render one, because the host's frame
1082
+ * already draws what it stands for.
1083
+ */
1084
+ declare function frameCatalog(frame: Frame): ValidationCatalog;
1085
+
1086
+ /** The shadcn subset, by name. The order is the order the prompt lists them. */
1087
+ declare const PICKED_SHADCN: readonly ["Card", "Stack", "Grid", "Separator", "Heading", "Text", "Badge", "Alert", "Collapsible", "Progress", "Avatar", "Input", "Textarea", "Select", "Radio", "Checkbox", "Switch", "Button"];
1088
+ /** Our own, by name. */
1089
+ declare const CUSTOM_COMPONENTS: readonly ["Split", "Tabs", "Steps", "Icon", "Segmented", "NumberInput", "MthdsField", "MthdsResult", "DataTable", "Metric"];
1090
+ /**
1091
+ * The value formats a `Metric` can apply. A model picks one; the registry
1092
+ * formats with `Intl.NumberFormat`.
1093
+ */
1094
+ declare const METRIC_FORMATS: readonly ["plain", "integer", "decimal", "compact"];
1095
+ /**
1096
+ * The icons a spec may name: lucide's, a closed list so a misspelt name fails
1097
+ * validation rather than rendering nothing. Chosen for what pages about
1098
+ * methods talk about - people, places, money, time, files, standing.
1099
+ */
1100
+ declare const ICON_NAMES: readonly ["Sparkles", "Rocket", "Compass", "Map", "MapPin", "Route", "Plane", "Train", "Car", "Ship", "Hotel", "Home", "Building2", "Landmark", "Globe", "Mountain", "Leaf", "Sun", "Moon", "Calendar", "Clock", "Hourglass", "Users", "User", "Baby", "Accessibility", "Heart", "Star", "Utensils", "Coffee", "Music", "Camera", "Image", "Ticket", "Gift", "Wallet", "Banknote", "Coins", "Receipt", "Percent", "Hash", "TrendingUp", "BarChart3", "FileText", "Upload", "Paperclip", "Mail", "Phone", "Tag", "Layers", "ListChecks", "CheckCircle2", "AlertCircle", "Info", "Shield", "Flag", "Bookmark", "Briefcase", "Package", "Truck", "Lightbulb", "Zap", "Pencil", "Send"];
1101
+
1102
+ /** One action a page may bind to an event: its name, what it does, and whether the runtime handles it on its own. */
1103
+ declare const ActionSchema: z.ZodObject<{
1104
+ name: z.ZodString;
1105
+ description: z.ZodString;
1106
+ built_in: z.ZodBoolean;
1107
+ }, z.core.$strip>;
1108
+ type Action = z.infer<typeof ActionSchema>;
1109
+ /** The page's half of the prompt, as data: which page it is and for which pipe, every path in the state with what it is, which paths are delegated and what gates the run, and on a result page the state of one real run - rendered from the method's own descriptor and from nothing else. */
1110
+ declare const BriefSchema: z.ZodObject<{
1111
+ side: z.ZodEnum<{
1112
+ input: "input";
1113
+ result: "result";
1114
+ }>;
1115
+ pipe_ref: z.ZodString;
1116
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1117
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1118
+ paths: z.ZodArray<z.ZodLazy<z.ZodObject<{
1119
+ depth: z.ZodNumber;
1120
+ path: z.ZodString;
1121
+ kind: z.ZodString;
1122
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1123
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1124
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1125
+ required: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1126
+ gating: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1127
+ notes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1128
+ default: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1129
+ delegated: z.ZodBoolean;
1130
+ relative: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1131
+ item_kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1132
+ item_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1133
+ item_laid_out: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1134
+ }, z.core.$strip>>>;
1135
+ run_control: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1136
+ returns: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1137
+ frame: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1138
+ page: "page";
1139
+ composer: "composer";
1140
+ result: "result";
1141
+ }>>>;
1142
+ style: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodObject<{
1143
+ name: z.ZodString;
1144
+ direction: z.ZodString;
1145
+ }, z.core.$strip>>>>;
1146
+ sample_state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1147
+ }, z.core.$strip>;
1148
+ type Brief = z.infer<typeof BriefSchema>;
1149
+ /** The vocabulary a page may be made of: the components a renderer implements and the actions a page may bind to an event, each with its contract. */
1150
+ declare const CatalogSchema: z.ZodObject<{
1151
+ components: z.ZodArray<z.ZodLazy<z.ZodObject<{
1152
+ name: z.ZodString;
1153
+ props: z.ZodString;
1154
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1155
+ accepts_children: z.ZodBoolean;
1156
+ slots: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1157
+ events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1158
+ }, z.core.$strip>>>;
1159
+ actions: z.ZodArray<z.ZodLazy<z.ZodObject<{
1160
+ name: z.ZodString;
1161
+ description: z.ZodString;
1162
+ built_in: z.ZodBoolean;
1163
+ }, z.core.$strip>>>;
1164
+ }, z.core.$strip>;
1165
+ type Catalog = z.infer<typeof CatalogSchema>;
1166
+ /** One component of the catalog: its name, the signature of its props, what it is for, and what it accepts. */
1167
+ declare const ComponentSchema: z.ZodObject<{
1168
+ name: z.ZodString;
1169
+ props: z.ZodString;
1170
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1171
+ accepts_children: z.ZodBoolean;
1172
+ slots: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1173
+ events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1174
+ }, z.core.$strip>;
1175
+ type Component = z.infer<typeof ComponentSchema>;
1176
+ /** The designer's plan for one page, settled before any element is written: what the page is for, how it is composed - a decision the plan makes, with no shape given in advance - what each region shows or collects and with which components, what runs the method, and what is delegated. */
1177
+ declare const PagePlanSchema: z.ZodObject<{
1178
+ purpose: z.ZodString;
1179
+ title: z.ZodString;
1180
+ composition: z.ZodString;
1181
+ regions: z.ZodArray<z.ZodLazy<z.ZodObject<{
1182
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1183
+ purpose: z.ZodString;
1184
+ container: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1185
+ elements: z.ZodArray<z.ZodString>;
1186
+ }, z.core.$strip>>>;
1187
+ call_to_action: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1188
+ defaults: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1189
+ delegated: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1190
+ }, z.core.$strip>;
1191
+ type PagePlan = z.infer<typeof PagePlanSchema>;
1192
+ /** One path of the state, as the brief describes it: where it is, what it holds, what it is called, what constrains it, and whether the page lays it out or hands it back to the kernel's own control. */
1193
+ declare const PathEntrySchema: z.ZodObject<{
1194
+ depth: z.ZodNumber;
1195
+ path: z.ZodString;
1196
+ kind: z.ZodString;
1197
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1198
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1199
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1200
+ required: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1201
+ gating: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1202
+ notes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1203
+ default: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1204
+ delegated: z.ZodBoolean;
1205
+ relative: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1206
+ item_kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1207
+ item_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1208
+ item_laid_out: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1209
+ }, z.core.$strip>;
1210
+ type PathEntry = z.infer<typeof PathEntrySchema>;
1211
+ /** An app style: a named look the components draw - faces, weights, radii, panels and rhythm - and the one sentence that says what it is, which the composition follows. */
1212
+ declare const StyleSchema: z.ZodObject<{
1213
+ name: z.ZodString;
1214
+ direction: z.ZodString;
1215
+ }, z.core.$strip>;
1216
+ type Style = z.infer<typeof StyleSchema>;
1217
+
1218
+ /**
1219
+ * The catalog as the designer method's `catalog` input: the vocabulary as
1220
+ * DATA, which the method's own prompt lays out.
1221
+ *
1222
+ * The prompt a model reads is the method - `methods/layout-design.mthds`
1223
+ * carries every paragraph of it as prose and loops over these two lists for
1224
+ * the component and action sections. What this package contributes is what
1225
+ * only code can state: each component's props signature, rendered from its
1226
+ * zod schema, beside the description and the slots its definition declares.
1227
+ * One function so the fixture pass, the briefs and the tests hand over one
1228
+ * value, and the hash stamped on a captured layout covers what was actually
1229
+ * sent.
1230
+ *
1231
+ * The shapes are the method's own: codegen projects the `Catalog`,
1232
+ * `Component` and `Action` structures the bundle declares into
1233
+ * `src/generated/layout-design/`, and the aliases below are those types. So a
1234
+ * field renamed in the bundle fails the type check on the literals here
1235
+ * rather than a run, and the value goes over as the content of a structured
1236
+ * input, verbatim. The import is type-only: the generated zod schemas stay
1237
+ * out of the entry, which ships no validator for this value.
1238
+ */
1239
+ /** The `Catalog` structure of `methods/layout-design.mthds`, as codegen projects it. */
1240
+ type DesignerCatalog = Catalog;
1241
+ /** One component of the catalog: its name, its props signature, what it is for, what it accepts. */
1242
+ type DesignerComponent = Component;
1243
+ /** One action a page may bind to an event. */
1244
+ type DesignerAction = Action;
1245
+ /** The concept a run request names for the `catalog` input: the method's own, domain-qualified. */
1246
+ declare const DESIGNER_CATALOG_CONCEPT = "generative.Catalog";
1247
+ /** What a catalog is built for. */
1248
+ interface DesignerCatalogOptions {
1249
+ /**
1250
+ * The frame the layout is written for: `page` (the default), a whole
1251
+ * product page; `composer` or `result`, a moment of a host's
1252
+ * compose-then-result app, whose vocabulary leaves out what that host draws
1253
+ * and adds the frame's own components (`componentNamesFor`).
1254
+ */
1255
+ frame?: Frame;
1256
+ }
1257
+ /**
1258
+ * The catalog as the designer method's `catalog` input, for one frame. The
1259
+ * same frame's `frameCatalog` is what the layout it produces is validated
1260
+ * against, so the vocabulary a model was shown and the one it is held to are
1261
+ * one list.
1262
+ */
1263
+ declare function designerCatalog({ frame }?: DesignerCatalogOptions): DesignerCatalog;
1264
+
1265
+ /**
1266
+ * The hash that pairs a captured layout with the prompt it was produced
1267
+ * against: the first twelve hex digits of the SHA-256 of `promptHashSubject`,
1268
+ * which is the designer method's text and the catalog of every frame.
1269
+ *
1270
+ * The prompt is no longer one string this package renders: it is the method
1271
+ * (`methods/layout-design.mthds`, every paragraph as prose) applied to
1272
+ * the catalog as data (`designerCatalog({ frame })`). Both are what a run was
1273
+ * actually given, so both are hashed - a reworded rule and a renamed prop each
1274
+ * move the pin, exactly as they did when the prompt was rendered here. A run
1275
+ * is given the catalog of one frame, and the hash covers all three in a fixed
1276
+ * order: one pin a host compares every stored layout with, whichever frame it
1277
+ * was written for, and which any frame's vocabulary moving moves. The frame a
1278
+ * layout was written for is its own provenance, beside the hash. The brief is
1279
+ * not hashed: it is the per-method half, recorded with each layout. The model
1280
+ * pin in the method file moves it too, since the file is hashed whole; a
1281
+ * fixture records its model on its own, so that costs a regeneration, never a
1282
+ * misread.
1283
+ *
1284
+ * It is a PIN rather than a computation, so that this entry stays importable
1285
+ * from a browser (hashing would mean `node:crypto` or an async Web Crypto
1286
+ * call, and a host compares this value synchronously while deciding whether a
1287
+ * stored layout still stands - and the entry must not read the method file).
1288
+ * `__tests__/prompt.test.ts` recomputes it from the file and the catalog and
1289
+ * fails on any drift, so the pin cannot go stale quietly: a catalog, rule or
1290
+ * direction change is a failing test, which is exactly what it was for.
1291
+ *
1292
+ * A stored layout whose hash is not this one is not rendered - the host falls
1293
+ * back to the kernel's own form - because the vocabulary it was written in is
1294
+ * no longer the vocabulary this entry renders.
1295
+ */
1296
+ declare const PROMPT_HASH = "30cf9bc059f6";
1297
+ /**
1298
+ * What the hash is computed over: the method's text as shipped, then the
1299
+ * catalog of each frame as a run request carries it, in `FRAMES` order. The
1300
+ * one recipe the test, the fixture pass and a host's producer share, so the
1301
+ * pin they check and the stamp they write agree: a producer that runs the
1302
+ * method off a checkout hashes this string (SHA-256, the first twelve hex
1303
+ * digits) and compares it with `PROMPT_HASH` before it spends anything. It is
1304
+ * a string rather than the hash so the entry stays free of a hashing
1305
+ * dependency and importable from a browser.
1306
+ */
1307
+ declare function promptHashSubject(method: string): string;
1308
+
1309
+ /**
1310
+ * Whether a stored layout still fits the descriptor it will be rendered over.
1311
+ *
1312
+ * A layout is produced once per method version and stored; a descriptor is
1313
+ * derived from the method every time it is read. Those two can part company -
1314
+ * a method's input is renamed, a structure loses a member - and when they do,
1315
+ * a delegated path resolves to nothing and a bound path writes into a corner of
1316
+ * the state the run never reads. Neither fails loudly on its own, so the host
1317
+ * asks this before it renders and falls back to the kernel's own form when the
1318
+ * answer is no.
1319
+ *
1320
+ * Two directions, and the second is the one a corpus cannot notice. The first
1321
+ * is staleness: every path the layout MENTIONS is a path the descriptor still
1322
+ * has, which is the corpus test's check lifted out of the test and into the
1323
+ * product. The second is coverage: every path the descriptor REQUIRES is one
1324
+ * the layout offers somewhere. A layout that simply omits an input is not
1325
+ * stale and validates perfectly - it renders a page with no field for a
1326
+ * required input, the run gate then refuses the run for that input, and the
1327
+ * person has nowhere to type it. A page you cannot complete is worse than the
1328
+ * plain form, which is what the fallback is for.
1329
+ *
1330
+ * It answers with problems, not exceptions, and that is a promise rather than
1331
+ * a habit: a host calls this to decide whether it is safe to render, so a
1332
+ * throw leaves it with no verdict at the one moment it needs one. A layout is
1333
+ * model-produced and may be malformed in ways the walk below trips on
1334
+ * (`children: 5`, a null element, no `elements` map at all), and the other
1335
+ * gate, which refuses those shapes outright, is exported separately - so
1336
+ * neither may assume the other ran first.
1337
+ *
1338
+ * A third check sits between the two and is about KIND rather than presence:
1339
+ * a path a layout shows as a value must be a scalar, and a path it reads into
1340
+ * a prop that takes a list must be a list. A `SummaryRow` whose `value` reads
1341
+ * `/inputs/document`, a structure of a url and a filename, is not stale - the
1342
+ * path exists - and it validates perfectly; it renders `[object Object]`,
1343
+ * because the renderer stringifies what it is handed and nothing anywhere said
1344
+ * the path was not a value. An `AppBar` whose `links` read that same structure
1345
+ * is the mirror image: its renderer maps over what it is handed, renders
1346
+ * nothing for a structure and throws for a text. Only the descriptor knows
1347
+ * what kind a path is, so this is where that is said.
1348
+ *
1349
+ * What is NOT checked here is whether the layout validates against the catalog
1350
+ * - that is `validateAgainstCatalog`, and a host runs both.
1351
+ */
1352
+ interface LayoutDescriptor {
1353
+ /** The input page's top-level fields, for `/inputs/...` paths. */
1354
+ inputs?: readonly RunField[];
1355
+ /** The result page's descriptor, for `/result/...` paths. */
1356
+ result?: RunField;
1357
+ }
1358
+ /**
1359
+ * Every way this layout no longer fits, in the words a host can count by:
1360
+ * one line per element or path, empty when it fits.
1361
+ *
1362
+ * The checks live in `collectLayoutProblems`; this is the boundary that keeps
1363
+ * the promise in the header around them. A malformed spec is one line, naming
1364
+ * what the walk tripped on, which is a verdict the fallback can act on where a
1365
+ * throw was not.
1366
+ */
1367
+ declare function layoutProblems(descriptor: LayoutDescriptor, spec: Spec): string[];
1368
+ /** The predicate: `layoutProblems` is empty. */
1369
+ declare function layoutFits(descriptor: LayoutDescriptor, spec: Spec): boolean;
1370
+
1371
+ /**
1372
+ * What a producer of layouts needs beside the method, the catalog and the
1373
+ * brief: the line a creative seed travels as, the checks a produced layout is
1374
+ * held to, and how many times a refused one goes back to the method's repair
1375
+ * pass. Nothing here calls a model; the producer is the host's, on the far
1376
+ * side of this seam (docs/generative-ui.md, "Producing a layout").
1377
+ */
1378
+ /**
1379
+ * The one line a creative seed reaches the designer method as, under its
1380
+ * `seed` input. The planner's seed procedure was written against this line,
1381
+ * so a host that hands the method a seed sends it, rather than restating it.
1382
+ */
1383
+ declare function seedLine(seed: string): string;
1384
+ /**
1385
+ * How many times a producer hands a refused layout to the method's
1386
+ * `repair_layout` pass before it gives up and the host keeps the plain form.
1387
+ * The refusals the designer makes are slips of one prop or one heading, which
1388
+ * one pass told what it broke fixes; a second covers a fix that broke a rule
1389
+ * of its own, and a third would be paying for a page that is not converging.
1390
+ */
1391
+ declare const REPAIR_ATTEMPTS = 2;
1392
+ /** What a layout is checked against: the frame it was written for and the descriptor it binds. */
1393
+ interface LayoutCheck {
1394
+ frame: Frame;
1395
+ descriptor: LayoutDescriptor;
1396
+ }
1397
+ /**
1398
+ * Everything the host's two checks find wrong with a layout written for
1399
+ * `frame`, one problem a line, in the words the repair pass reads: first the
1400
+ * catalog's verdict against the frame's own vocabulary (`frameCatalog`), then
1401
+ * whether it fits the descriptor (`layoutProblems`). Empty means the layout
1402
+ * may render. A producer feeds the lines, joined, to `repair_layout` as its
1403
+ * `problems`; a host deciding whether a stored layout renders needs only
1404
+ * whether the list is empty.
1405
+ *
1406
+ * It never throws. Its subject is whatever a model wrote, or a layout and a
1407
+ * frame a host stored and read back, and a throw is the one answer a host
1408
+ * cannot act on: it arrives instead of the problem that would have sent the
1409
+ * page to its fallback. So a frame this package does not draw, a missing
1410
+ * descriptor, and anything that is not a spec at all are each a problem line,
1411
+ * and any throw left in a walk below is caught here and answered as one.
1412
+ */
1413
+ declare function layoutCheckProblems(spec: Spec, { frame, descriptor }: LayoutCheck): string[];
1414
+
1415
+ /**
1416
+ * The brief: the model's view of the descriptor, as DATA.
1417
+ *
1418
+ * Rule 1, restated for a model. The model's input is the DESCRIPTOR, never JSON
1419
+ * Schema: it receives the kinds, the labels, the descriptions, the choices, the
1420
+ * presence and what gates the run - projected from `RunField[]` here, and from
1421
+ * nowhere else, into the `Brief` structure the designer method declares. On the
1422
+ * result side it also receives one real run's loaded state, so it can judge
1423
+ * magnitudes, but it never sees the wire: the state it reads is what
1424
+ * `payloadToState` produced, with the envelopes already gone.
1425
+ *
1426
+ * Nothing here is prose. The sentences a model reads - the headings, how a
1427
+ * path line is worded, what "delegated" says - are the method's own, in the
1428
+ * `render_brief` stage of `methods/layout-design.mthds`: a Jinja2 template
1429
+ * over this value, and the one place the brief's wording is edited. What this
1430
+ * module contributes is what only code can state: every path, flattened in
1431
+ * reading order with its depth, its kind in words, its constraints in words,
1432
+ * and which of them the kernel keeps. The shape is the method's own: codegen
1433
+ * projects its `Brief` and `PathEntry` structures into
1434
+ * `src/generated/layout-design/`, and the aliases below are those types,
1435
+ * imported type-only so the generated schemas stay out of the entry. A field
1436
+ * renamed in the bundle fails the type check on the literals here rather than
1437
+ * a run.
1438
+ *
1439
+ * Pure, no React, and the only place the descriptor is projected for a model.
1440
+ * What a path is marked as (delegated or not) is decided here too, so the
1441
+ * projection, the brief and the validator agree on which paths the kernel
1442
+ * renders.
1443
+ */
1444
+ /** The `Brief` structure of `methods/layout-design.mthds`, as codegen projects it. */
1445
+ type DesignerBrief = Brief;
1446
+ /** One path of the brief: where it is, what it holds, what constrains it, whether the kernel keeps it. */
1447
+ type DesignerPathEntry = PathEntry;
1448
+ /** The style a brief carries: its name and its direction, as `APP_STYLES` states them. */
1449
+ type DesignerStyle = Style;
1450
+ /** The concept a run request names for the `brief` input: the method's own, domain-qualified. */
1451
+ declare const DESIGNER_BRIEF_CONCEPT = "generative.Brief";
1452
+ interface BriefSubject {
1453
+ /** `results.nested_result`. */
1454
+ pipeRef: string;
1455
+ /** The pipe's description, when the wire carries one. */
1456
+ description?: string;
1457
+ /**
1458
+ * The method's name as a host lists it - an authored method's, since a host
1459
+ * has one for every method it lists; absent on a synthesized carrier, which
1460
+ * no host lists. The brief hands it to the layout as the one product name
1461
+ * the page may carry, because the brand catalog's AppBar asks for a name
1462
+ * and a brief that gives none gets one invented.
1463
+ */
1464
+ name?: string;
1465
+ }
1466
+ /**
1467
+ * On the input side, the kinds the catalog's inputs cannot enter - and one
1468
+ * shape of a kind they otherwise can. The standard puts no floor on a choice,
1469
+ * so an enum may carry `""`; the catalog's own choices may not, because no
1470
+ * dropdown row or pill can offer nothing, and the validator refuses an empty
1471
+ * option. A model told to list the brief's choices exactly would copy the
1472
+ * empty one into a layout the validator then refuses, so the brief hands the
1473
+ * input back to the kernel's own control instead.
1474
+ */
1475
+ declare function isDelegatedInput(field: RunField): boolean;
1476
+ /**
1477
+ * On the result side, the kinds and concepts the catalog cannot show.
1478
+ *
1479
+ * A native value is one of them, and so is a list of one: the native
1480
+ * predicates refuse a `list` node, because a list of dates is a list and not a
1481
+ * date, but no catalog component reads a date's `{date, time}` either, so the
1482
+ * kernel renders the list whole - one value per line, as the result view does.
1483
+ *
1484
+ * The result frame's vocabulary shows two of them itself: a picture
1485
+ * (`Picture`) and a date in words (`DateText`), so on a result page written
1486
+ * for that frame neither is delegated. A date with a time stays delegated:
1487
+ * `DateText` writes the day alone, and the kernel's result shows the time.
1488
+ */
1489
+ declare function isDelegatedResult(field: RunField, frame?: Frame): boolean;
1490
+ /** How an input page's brief is built: the frame it is written for, the team's style, and what a run returns. */
1491
+ interface InputBriefOptions {
1492
+ /** `page` (the default), a whole product page; `composer`, the inputs of a host's compose-then-result app. */
1493
+ frame?: Extract<Frame, 'page' | 'composer'>;
1494
+ /**
1495
+ * The style the team's apps wear. The brief carries its name and its
1496
+ * direction, which the composition follows; its faces, radii and panels are
1497
+ * the components' to draw and never reach the brief. Absent, the brief
1498
+ * names no style.
1499
+ */
1500
+ style?: AppStyleId;
1501
+ /** The result's descriptor, from which a composer's brief says what one run gives back. */
1502
+ result?: RunField;
1503
+ }
1504
+ /** How a result page's brief is built: the frame it is written for and the team's style. */
1505
+ interface ResultBriefOptions {
1506
+ /** `page` (the default), a whole product page; `result`, the result page of a host's compose-then-result app. */
1507
+ frame?: Extract<Frame, 'page' | 'result'>;
1508
+ /** The style the team's apps wear (see `InputBriefOptions.style`). */
1509
+ style?: AppStyleId;
1510
+ }
1511
+ /** The brief for an INPUT page: the form a run is started from. */
1512
+ declare function inputBrief(subject: BriefSubject, fields: readonly RunField[], { frame, style, result }?: InputBriefOptions): DesignerBrief;
1513
+ /** The brief for a RESULT page: what one run produced, laid out. */
1514
+ declare function resultBrief(subject: BriefSubject, field: RunField, state: unknown, { frame, style }?: ResultBriefOptions): DesignerBrief;
1515
+
1516
+ /**
1517
+ * A spec as JSONL patches, and back.
1518
+ *
1519
+ * json-render's wire format is RFC 6902 patches, one per line, root first and
1520
+ * parents before children, so a renderer can paint a partial tree at every
1521
+ * line. A model emits that format; a projected or authored spec is a finished
1522
+ * object. This is the bridge: any of the three sources can be replayed through
1523
+ * `specToJsonl`, and what a model emitted is compiled through `specFromJsonl`
1524
+ * before it is validated.
1525
+ */
1526
+ /**
1527
+ * The patch lines for a spec: `/root`, then every element reachable from the
1528
+ * root in breadth-first order (a parent always precedes its children), then
1529
+ * any element the root does not reach (kept, so a validator can report it),
1530
+ * then one patch per top-level `state` key.
1531
+ */
1532
+ declare function specToJsonl(spec: Spec): string;
1533
+ /**
1534
+ * The spec a JSONL stream compiles to. Blank lines and non-JSON lines are
1535
+ * skipped by the compiler; a line whose `path` or `from` would reach a
1536
+ * prototype is dropped here, before the compiler sees it; and a line the
1537
+ * compiler refuses is dropped too, which is why the stream is applied one line
1538
+ * at a time.
1539
+ *
1540
+ * A batch compile made a single bad line fatal to the whole layout. Two of them
1541
+ * are reachable from produced text: a `test` op whose value does not match
1542
+ * throws `Test operation failed`, and a non-string `path` throws
1543
+ * `path.startsWith is not a function`. A host follows the documented flow -
1544
+ * compile, then ask the two gates - so a throw here arrives before there is any
1545
+ * verdict to act on, and the fallback that exists for exactly this case never
1546
+ * fires. Skipping the line degrades instead: what survives is a partial spec,
1547
+ * which the gates then judge on its merits and reject if it is not renderable.
1548
+ */
1549
+ declare function specFromJsonl(jsonl: string): Spec;
1550
+ /** The individual patch lines of a stream, for a replay that feeds them one at a time. */
1551
+ declare function jsonlLines(jsonl: string): string[];
1552
+
1553
+ /**
1554
+ * The two state trees, and how a path into either maps back onto the
1555
+ * descriptor.
1556
+ *
1557
+ * An input page binds at `/inputs/<name>`, recursing into structures as the
1558
+ * descriptor does; a result page binds at `/result/<path>`. Both are JSON
1559
+ * Pointers (RFC 6901), because that is what json-render's state store reads.
1560
+ * Nothing here knows a value - a path is resolved against the DESCRIPTOR, which
1561
+ * is how the two escape hatches find the `RunField` to hand the kernel.
1562
+ */
1563
+ declare const INPUTS_ROOT = "/inputs";
1564
+ declare const RESULT_ROOT = "/result";
1565
+ /** `/inputs` + `invoice` + `billed_to` → `/inputs/invoice/billed_to`. */
1566
+ declare function joinPath(root: string, ...segments: readonly string[]): string;
1567
+ /** The segments of a pointer, root excluded: `/inputs/a/b` under `/inputs` → `['a', 'b']`. */
1568
+ declare function segmentsUnder(root: string, path: string): string[] | undefined;
1569
+ /**
1570
+ * The descriptor node a path names, or `undefined` when the path leaves the
1571
+ * tree. An object's children are found by name; a list's are found by index,
1572
+ * and every index resolves to the same item descriptor.
1573
+ */
1574
+ declare function fieldAtSegments(fields: readonly RunField[], segments: readonly string[]): RunField | undefined;
1575
+ /** `/inputs/<...>` resolved against a form's top-level fields. */
1576
+ declare function inputFieldAtPath(fields: readonly RunField[], path: string): RunField | undefined;
1577
+ /** `/result/<...>` resolved against a result descriptor; `/result` itself is the root. */
1578
+ declare function resultFieldAtPath(field: RunField, path: string): RunField | undefined;
1579
+ /**
1580
+ * The base path a relative hatch path resolves against, statically: the chain
1581
+ * of `repeat`s from the root down to `key`, each contributing its list path
1582
+ * and a first index. `undefined` outside any repeat. Mirrors what
1583
+ * `useRepeatScope` gives the hatch at render time, for a test that never
1584
+ * renders.
1585
+ *
1586
+ * The walk up the parent chain STOPS on a key it has already seen. A layout is
1587
+ * model-produced, and an element that is its own ancestor - `children: ["self"]`
1588
+ * at its simplest - is a shape json-render's `validateSpec` accepts without a
1589
+ * word, so without the guard this loop never terminates. Since a host calls
1590
+ * this through `layoutFits` precisely to decide whether an untrusted layout is
1591
+ * safe to render, the gate hanging is worse than the layout it was asked about.
1592
+ */
1593
+ declare function repeatBasePathOf(spec: Spec, key: string, parents?: Map<string, string>): string | undefined;
1594
+ /** A hatch's path as the layer resolves it: absolute as written, or relative to the repeat it sits in. */
1595
+ declare function absoluteHatchPath(spec: Spec, key: string, path: string, parents?: Map<string, string>): string | undefined;
1596
+
1597
+ /**
1598
+ * A payload, as the result tree a spec binds to at `/result`.
1599
+ *
1600
+ * - a `date` becomes the ISO string (`2026-03-14`, or `2026-03-14 15:40:00`
1601
+ * when a time rides along), whatever envelope it arrived in;
1602
+ * - a `list` becomes an array whether the wire sent one or the plural
1603
+ * envelope `{items: [...]}`, each item loaded by the item descriptor;
1604
+ * - an `object` is loaded member by member, keeping any member the descriptor
1605
+ * does not name as it came;
1606
+ * - a `document` or `image` passes through verbatim: the pinned content model
1607
+ * is what `ResultField` reads, and its member names (`url`, `filename`) are
1608
+ * the ones a model would bind to anyway;
1609
+ * - the three native concepts the kind vocabulary cannot name (`native.Html`,
1610
+ * `native.Date`, `native.Composite`) pass through whole, for the escape
1611
+ * hatch to render - and a list of one is still a list, an array of whole
1612
+ * values, which is what the kernel renders when the brief delegates it;
1613
+ * - a scalar passes through.
1614
+ *
1615
+ * A top-level scalar's `contentKey` wrapper is NOT unwrapped: `ResultField`
1616
+ * unwraps it itself, and the brief names the wrapped path (`/result/text`), so
1617
+ * the model and the escape hatch read the same tree.
1618
+ */
1619
+ declare function payloadToState(field: RunField, payload: unknown): unknown;
1620
+
1621
+ /**
1622
+ * A spec with its provenance - the shape every fixture takes, whoever produced
1623
+ * it, so a story renders any of them without knowing which it holds.
1624
+ *
1625
+ * A spec is a payload's twin: the one artifact no projection can produce. So
1626
+ * it follows the payload's rules - produced by a pass, committed with its
1627
+ * provenance - plus what a spec needs and a payload does not: WHO produced it,
1628
+ * on WHICH model, under WHAT prompt (its hash), and, when the run was given
1629
+ * one, the creative seed and the critic loop. The stories and the comparison
1630
+ * viewer are titled from this record and from nothing else, so a page is
1631
+ * never labelled with a role ("authored", "generated") but with what actually
1632
+ * made it.
1633
+ */
1634
+ /** How a spec came to be. */
1635
+ type Producer =
1636
+ /** The designer method, `methods/layout-design.mthds`, run on the hosted API. */
1637
+ 'pipelex-method'
1638
+ /** A Claude Code subagent in a fresh context, given the method, the catalog data and the brief and nothing else. */
1639
+ | 'claude-code-subagent'
1640
+ /** The Claude Code session working in this repo, writing the spec by hand in TypeScript. */
1641
+ | 'claude-code-session';
1642
+ interface CriticLoop {
1643
+ /** The model that judged the screenshots. */
1644
+ model: string;
1645
+ /** How many critique-and-revise rounds ran. */
1646
+ rounds: number;
1647
+ }
1648
+ interface SpecFixture {
1649
+ /** `results.nested_result`. */
1650
+ pipeRef: string;
1651
+ producer: Producer;
1652
+ /** The model id: the one the method ran with, or the Claude Code model behind the agent. */
1653
+ model: string;
1654
+ /** The creative seed handed over with the brief, verbatim, when one was. */
1655
+ seed?: string;
1656
+ /** The critic loop the producer ran, when one did. */
1657
+ critic?: CriticLoop;
1658
+ /** The frame it was written for, when not a whole product page: `composer` or `result`. */
1659
+ frame?: Exclude<Frame, 'page'>;
1660
+ /** The style the brief carried, when it carried one. */
1661
+ style?: AppStyleId;
1662
+ /**
1663
+ * How many times the method's repair pass re-emitted it before it passed
1664
+ * the checks, when it needed any: the page as stored is the last pass's.
1665
+ */
1666
+ repairs?: number;
1667
+ /** The first twelve hex digits of the SHA-256 of the catalog prompt at the time. */
1668
+ promptHash: string;
1669
+ /** The day it was produced, `YYYY-MM-DD`. */
1670
+ date: string;
1671
+ /** The brief it was produced from, repo-relative. */
1672
+ brief: string;
1673
+ /** The JSONL patch lines, exactly as emitted, or as `specToJsonl` renders a hand-written spec. */
1674
+ jsonl: string;
1675
+ /** The compiled spec. */
1676
+ spec: Spec;
1677
+ /**
1678
+ * The planner's plan, when the producer was the designer method: the
1679
+ * intermediate the builder was handed, read from the run's working memory.
1680
+ * It is what a person reads to see why a page has the shape it has, and it
1681
+ * is the one stage a comparison between two runs can be made at. Absent for
1682
+ * a producer that plans nowhere the harness can read.
1683
+ */
1684
+ plan?: PagePlan;
1685
+ }
1686
+ type Provenance = Pick<SpecFixture, 'producer' | 'model' | 'seed' | 'critic' | 'frame' | 'style'>;
1687
+ /**
1688
+ * The id a story and a screenshot are keyed by: producer, model, the frame and
1689
+ * the style it was written for, and the two procedures that change what a run
1690
+ * is. `pipelex-method--gpt-5.5--seeded`,
1691
+ * `pipelex-method--gpt-6.1-sol--composer--soft--seeded`.
1692
+ */
1693
+ declare function fixtureId(fixture: Provenance): string;
1694
+ /**
1695
+ * The honest title: what made the page. `Pipelex method · gpt-5.5 · with a
1696
+ * seed`, never a role ("authored", "generated").
1697
+ */
1698
+ declare function fixtureLabel(fixture: Provenance & Pick<SpecFixture, 'repairs'>): string;
1699
+ /** The fixture a story asks for, or a loud failure: a story must never render a page it did not name. */
1700
+ declare function findFixture(fixtures: readonly SpecFixture[], pipeRef: string, id: string): SpecFixture;
1701
+
1702
+ export { type BriefSubject, COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, type ComponentRendering, type CriticLoop, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, type DesignerAction, type DesignerBrief, type DesignerCatalog, type DesignerCatalogOptions, type DesignerComponent, type DesignerPathEntry, type DesignerStyle, FRAMES, FRAME_COMPONENTS, type Frame, type GenerativeSpec, ICON_NAMES, INPUTS_ROOT, type InputBriefOptions, type LayoutCheck, type LayoutDescriptor, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, type Producer, type ProductComponentName, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, type ResultBriefOptions, type SpecFixture, type SpecProblem, type SpecVerdict, type ValidationCatalog, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog };