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