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