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