@pipelex/mthds-form 0.32.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/dist/brand/index.js +2 -2
  3. package/dist/{chunk-PCNFELNT.js → chunk-5RV3ASMO.js} +141 -69
  4. package/dist/chunk-5RV3ASMO.js.map +1 -0
  5. package/dist/{chunk-VH5CDQDR.js → chunk-AURDKAIC.js} +3 -3
  6. package/dist/{chunk-VH5CDQDR.js.map → chunk-AURDKAIC.js.map} +1 -1
  7. package/dist/{chunk-ZX52CQJ4.js → chunk-CFBK7NO7.js} +3 -3
  8. package/dist/{chunk-ZX52CQJ4.js.map → chunk-CFBK7NO7.js.map} +1 -1
  9. package/dist/{chunk-3GO65HWP.js → chunk-PNNWNRPG.js} +11 -7
  10. package/dist/chunk-PNNWNRPG.js.map +1 -0
  11. package/dist/{chunk-XO5OENNF.js → chunk-TF4RTKLH.js} +32 -5
  12. package/dist/chunk-TF4RTKLH.js.map +1 -0
  13. package/dist/{chunk-IBBAJXIO.js → chunk-XIWBKV7T.js} +3 -3
  14. package/dist/{chunk-IBBAJXIO.js.map → chunk-XIWBKV7T.js.map} +1 -1
  15. package/dist/{chunk-VBXFGUCG.js → chunk-XYS5KCXB.js} +465 -112
  16. package/dist/chunk-XYS5KCXB.js.map +1 -0
  17. package/dist/core/gate.js +2 -2
  18. package/dist/core/index.js +4 -4
  19. package/dist/core/readiness.d.ts +34 -1
  20. package/dist/core/readiness.js +1 -1
  21. package/dist/core/seed.js +2 -2
  22. package/dist/core/values.js +2 -2
  23. package/dist/{field-renderer-Dz03dpig.d.ts → field-renderer-BYN6YrU-.d.ts} +6 -6
  24. package/dist/generative/headless/index.d.ts +53 -16
  25. package/dist/generative/headless/index.js +3 -2
  26. package/dist/generative/index.d.ts +79 -25
  27. package/dist/generative/index.js +942 -275
  28. package/dist/generative/index.js.map +1 -1
  29. package/dist/react/index.d.ts +56 -29
  30. package/dist/react/index.js +4 -4
  31. package/dist/styles.css +1 -1
  32. package/package.json +1 -1
  33. package/dist/chunk-3GO65HWP.js.map +0 -1
  34. package/dist/chunk-PCNFELNT.js.map +0 -1
  35. package/dist/chunk-VBXFGUCG.js.map +0 -1
  36. package/dist/chunk-XO5OENNF.js.map +0 -1
package/dist/core/gate.js CHANGED
@@ -1,6 +1,6 @@
1
- export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-IBBAJXIO.js';
1
+ export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-XIWBKV7T.js';
2
2
  import '../chunk-E6BIXJ6C.js';
3
- import '../chunk-XO5OENNF.js';
3
+ import '../chunk-TF4RTKLH.js';
4
4
  import '../chunk-Y2ND6W4W.js';
5
5
  import '../chunk-LBFZXYCY.js';
6
6
  import '../chunk-OD3VYXUY.js';
@@ -1,9 +1,9 @@
1
1
  export { planFileSave, planStuffSave } from '../chunk-4VAO6BDE.js';
2
- export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-VH5CDQDR.js';
2
+ export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-AURDKAIC.js';
3
3
  export { addChosenFiles, chosenFilesAdded, roomForChosenFiles, sourceFileValue } from '../chunk-L23R3JNQ.js';
4
4
  export { collectStuffFiles } from '../chunk-56WECFBD.js';
5
5
  export { describeValidationError, displayValue, valueAtProperty } from '../chunk-RPA7DNSK.js';
6
- export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-ZX52CQJ4.js';
6
+ export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-CFBK7NO7.js';
7
7
  export { enumValueLabeler, humanizeEnumValue, humanizeFieldName } from '../chunk-GHVVULHY.js';
8
8
  export { narrowFileFormats } from '../chunk-CAKQ5VFT.js';
9
9
  export { NATIVE_CHOICE_CONCEPT_REF, NATIVE_COMPOSITE_CONCEPT_REF, NATIVE_DATE_CONCEPT_REF, NATIVE_HTML_CONCEPT_REF, NATIVE_PAGE_CONCEPT_REF, NATIVE_RATING_CONCEPT_REF, NATIVE_SEARCH_RESULT_CONCEPT_REF, NATIVE_YES_NO_CONCEPT_REF, TYPED_SCALAR_MARKERS, citedSource, formatDateContent, hasTypedScalarMarkers, isNativeCompositeNode, isNativeDateNode, isNativeHtmlNode, isNativePageNode, isNativeSearchResultNode, isViewableUrl, nativeVerdictOf, readChoiceContent, readCompositeContent, readDataUrl, readDateContent, readDocumentContent, readHtmlContent, readImageContent, readPageContent, readRatingContent, readSearchResultContent, readYesNoContent, splitCitations, viewableUrl } from '../chunk-QQK6Y55E.js';
@@ -11,9 +11,9 @@ export { getPipeOutputForm } from '../chunk-JIGRWJTV.js';
11
11
  export { buildResultField, buildRunFields, getPipeInputForm } from '../chunk-ZB4RYUKV.js';
12
12
  export { conceptCategory } from '../chunk-FABY3DEY.js';
13
13
  export { DOCUMENT_FORMATS, IMAGE_FORMATS, acceptLabel, acceptMap, formatsForKind, isAcceptedFile } from '../chunk-XCO6GTEC.js';
14
- export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-IBBAJXIO.js';
14
+ export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-XIWBKV7T.js';
15
15
  export { deflateAllInputs, deflateInput, healStringWrappers, inflateAllInputs, inflateInput, pruneEmptyOptionals, resolveConceptCode } from '../chunk-E6BIXJ6C.js';
16
- export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional } from '../chunk-XO5OENNF.js';
16
+ export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional } from '../chunk-TF4RTKLH.js';
17
17
  import '../chunk-Y2ND6W4W.js';
18
18
  export { normalizeSchemaForRjsf, prepareSchemaForRjsf } from '../chunk-LBFZXYCY.js';
19
19
  export { collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, schemaTypeOf } from '../chunk-OD3VYXUY.js';
@@ -88,6 +88,39 @@ declare function mustBeFilled(field: RunField): boolean;
88
88
  * things stand between me and Run", which is the number a host is displaying.
89
89
  */
90
90
  declare function computeReadiness(fields: RunField[], values: Record<string, unknown>): Readiness;
91
+ /**
92
+ * The top-level fields that stand between the current values and a run, as
93
+ * fields rather than names, in the descriptor's order: the inputs
94
+ * `computeReadiness` counts as missing. A surface that names them in its own
95
+ * words - a humanised label, a run button's description - reads them here, so
96
+ * it names exactly what the count says.
97
+ */
98
+ declare function missingFields(fields: readonly RunField[], values: Record<string, unknown> | undefined): RunField[];
99
+ /**
100
+ * Why the run gate refuses a field, as the structure or the form holding it
101
+ * holds it: a field that must be filled (`mustFill`) and is not is
102
+ * `required`, and a field that need not be but holds something short of what
103
+ * its concept demands is `incomplete`. This is `fieldFilled`'s own rule for a
104
+ * structure's members, so a structure the gate refuses has at least one
105
+ * member it refuses, unless it is a structure that must be touched and holds
106
+ * nothing at all.
107
+ */
108
+ declare function gateRefusal(field: RunField, value: unknown, mustFill: boolean): 'required' | 'incomplete' | undefined;
109
+ /**
110
+ * The fields a person fills to let the run go, at the depth a form draws
111
+ * them: each missing input (`missingFields`), and in place of a structure the
112
+ * members it refuses (`gateRefusal`), at every depth, which is where a form
113
+ * marks them and where a layout that spreads a structure's members over the
114
+ * page puts them. A structure that refuses no member of its own - one that
115
+ * must be touched and holds nothing, with no required member - is itself the
116
+ * field to fill. A list is one field: its rows are the person's own.
117
+ */
118
+ declare function waitingFields(fields: readonly RunField[], values: Record<string, unknown> | undefined): WaitingField[];
119
+ /** A field the run waits for, and the names that lead to it from the inputs, its own last. */
120
+ interface WaitingField {
121
+ field: RunField;
122
+ path: readonly string[];
123
+ }
91
124
  /**
92
125
  * Whether a person should see this field as optional: not required AND carrying no authored
93
126
  * default. The standard marks a defaulted field `required: false` (it can never be missing), but it
@@ -142,4 +175,4 @@ declare function isFoldedOptional(field: RunField, value: unknown): boolean;
142
175
  /** Whether any optional structure among `fields` is open in `values`. */
143
176
  declare function anyOptionalStructureOpen(fields: readonly RunField[], values: Record<string, unknown> | undefined): boolean;
144
177
 
145
- export { type Readiness, anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional };
178
+ export { type Readiness, type WaitingField, anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, gateRefusal, isFilled, isFoldedOptional, isOptionalStructure, missingFields, mustBeFilled, optionalStructureOpen, shownAsOptional, waitingFields };
@@ -1,4 +1,4 @@
1
- export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional } from '../chunk-XO5OENNF.js';
1
+ export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, gateRefusal, isFilled, isFoldedOptional, isOptionalStructure, missingFields, mustBeFilled, optionalStructureOpen, shownAsOptional, waitingFields } from '../chunk-TF4RTKLH.js';
2
2
  import '../chunk-V3OV2XQT.js';
3
3
  //# sourceMappingURL=readiness.js.map
4
4
  //# sourceMappingURL=readiness.js.map
package/dist/core/seed.js CHANGED
@@ -1,5 +1,5 @@
1
- export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-VH5CDQDR.js';
2
- import '../chunk-XO5OENNF.js';
1
+ export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-AURDKAIC.js';
2
+ import '../chunk-TF4RTKLH.js';
3
3
  import '../chunk-V3OV2XQT.js';
4
4
  //# sourceMappingURL=seed.js.map
5
5
  //# sourceMappingURL=seed.js.map
@@ -1,8 +1,8 @@
1
- export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-ZX52CQJ4.js';
1
+ export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-CFBK7NO7.js';
2
2
  import '../chunk-ZB4RYUKV.js';
3
3
  import '../chunk-XCO6GTEC.js';
4
4
  import '../chunk-E6BIXJ6C.js';
5
- import '../chunk-XO5OENNF.js';
5
+ import '../chunk-TF4RTKLH.js';
6
6
  import '../chunk-OD3VYXUY.js';
7
7
  import '../chunk-WYH56SOZ.js';
8
8
  import '../chunk-V3OV2XQT.js';
@@ -1,4 +1,4 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
2
  import { ReactNode, RefObject, Ref } from 'react';
3
3
  import { FileRunField, RunField } from './core/descriptor.js';
4
4
  import { FileFormat } from './core/file-formats.js';
@@ -51,7 +51,7 @@ interface FilePickerEntryProps {
51
51
  * "Choose from your team's files": a full-width row with a folder icon, under
52
52
  * the field's own controls.
53
53
  */
54
- declare function FilePickerEntry({ onOpen, label, disabled, ref, id }: FilePickerEntryProps): react.JSX.Element;
54
+ declare function FilePickerEntry({ onOpen, label, disabled, ref, id }: FilePickerEntryProps): React.JSX.Element;
55
55
  interface FilePickerProps {
56
56
  /** The host's list, and how its rows draw. */
57
57
  source: FilePickerSource;
@@ -106,7 +106,7 @@ interface FilePickerProps {
106
106
  * the field as it was: only Use writes. The sheet's state lives in its body,
107
107
  * which mounts when it opens, so it always opens on a fresh choice.
108
108
  */
109
- declare function FilePicker({ open, onOpenChange, returnFocusTo, onCloseAutoFocus, disabled, ...props }: FilePickerProps): react.JSX.Element;
109
+ declare function FilePicker({ open, onOpenChange, returnFocusTo, onCloseAutoFocus, disabled, ...props }: FilePickerProps): React.JSX.Element;
110
110
 
111
111
  /** The serializable value of a file field. URL is what the runner sends. */
112
112
  interface FileValue {
@@ -167,9 +167,9 @@ interface FileFieldProps {
167
167
  disabled?: boolean;
168
168
  }
169
169
  /** Document variant: a file shown as a PDF preview (or chip for other docs). */
170
- declare function DocumentField(props: FileFieldProps): react.JSX.Element;
170
+ declare function DocumentField(props: FileFieldProps): React.JSX.Element;
171
171
  /** Image variant: a file shown as a real image preview. */
172
- declare function ImageField(props: FileFieldProps): react.JSX.Element;
172
+ declare function ImageField(props: FileFieldProps): React.JSX.Element;
173
173
 
174
174
  /**
175
175
  * The moves a host makes to a list's rows, and what a move does to an id.
@@ -317,6 +317,6 @@ interface FieldRendererProps {
317
317
  * Object and list fields recurse back through here, so the whole form is one
318
318
  * data-driven tree with no per-type branching anywhere else.
319
319
  */
320
- declare function FieldRenderer({ field, value, onChange, id, error, env }: FieldRendererProps): react.JSX.Element;
320
+ declare function FieldRenderer({ field, value, onChange, id, error, env }: FieldRendererProps): React.JSX.Element;
321
321
 
322
322
  export { DocumentField as D, type FieldEnv as F, ImageField as I, type RowMove as R, type UploadedFile as U, type FilePickerSource as a, FieldRenderer as b, type FieldRendererProps as c, FilePicker as d, FilePickerEntry as e, type FilePickerEntryProps as f, type FilePickerProps as g, type FileValue as h };
@@ -17,7 +17,7 @@ import '../../core/file-formats.js';
17
17
  * centred column whose host draws the band above it and the action row's
18
18
  * mechanics, and the result after one, under the host's bar restating the
19
19
  * request. The two moments carry their own components, found by measuring the
20
- * designer against hand-drawn screens of three methods: the composer's frame
20
+ * designer against hand-drawn screens of several methods: the composer's frame
21
21
  * (`Composer`, with the page's h1, the panel and the host's action row) and a
22
22
  * group of inputs inside it, and a result's header, a proportion bar, colour
23
23
  * swatches, a picture, a fact, a labelled detail, a date in words and a list
@@ -1072,11 +1072,17 @@ type GenerativeSpec = typeof catalog._specType;
1072
1072
  * prose, in `methods/layout-design.mthds`.
1073
1073
  */
1074
1074
  declare const COMPONENT_NAMES: readonly string[];
1075
- /** The component names a layout written for `frame` may use, in the order the designer method lists them. */
1075
+ /**
1076
+ * The component names a layout written for `frame` may use, in the order the
1077
+ * designer method lists them. Frozen, like the catalog `frameCatalog` builds
1078
+ * over them: both are shared by every check, so a caller that edited one
1079
+ * would change what every later check accepts.
1080
+ */
1076
1081
  declare function componentNamesFor(frame: Frame): readonly string[];
1077
1082
  /**
1078
1083
  * The catalog a layout written for `frame` is validated against: the same
1079
- * definitions and renderings as `catalog`, held to the frame's vocabulary. A
1084
+ * definitions and renderings as `catalog`, held to the frame's vocabulary.
1085
+ * Built once per frame and shared, so it is frozen with its vocabulary. A
1080
1086
  * composer that names an `AppBar` is refused here as an unknown component,
1081
1087
  * though the entry's registry could render one, because the host's frame
1082
1088
  * already draws what it stands for.
@@ -1272,9 +1278,10 @@ declare function designerCatalog({ frame }?: DesignerCatalogOptions): DesignerCa
1272
1278
  * the catalog as data (`designerCatalog({ frame })`). Both are what a run was
1273
1279
  * actually given, so both are hashed - a reworded rule and a renamed prop each
1274
1280
  * move the pin, exactly as they did when the prompt was rendered here. A run
1275
- * is given the catalog of one frame, and the hash covers all three in a fixed
1276
- * order: one pin a host compares every stored layout with, whichever frame it
1277
- * was written for, and which any frame's vocabulary moving moves. The frame a
1281
+ * is given the catalog of one frame, and the hash covers the method's text
1282
+ * first and then every frame's catalog, in a fixed order: one pin a host
1283
+ * compares every stored layout with, whichever frame it was written for, and
1284
+ * which a reworded rule or any frame's vocabulary moving moves. The frame a
1278
1285
  * layout was written for is its own provenance, beside the hash. The brief is
1279
1286
  * not hashed: it is the per-method half, recorded with each layout. The model
1280
1287
  * pin in the method file moves it too, since the file is hashed whole; a
@@ -1394,23 +1401,53 @@ interface LayoutCheck {
1394
1401
  frame: Frame;
1395
1402
  descriptor: LayoutDescriptor;
1396
1403
  }
1404
+ /**
1405
+ * The checks' answer on a layout: every problem they found, one a line, and
1406
+ * whether they themselves failed on it.
1407
+ */
1408
+ interface LayoutVerdict {
1409
+ /** Every problem, one a line, in the words the repair pass reads; empty means the layout may render. */
1410
+ problems: string[];
1411
+ /**
1412
+ * Whether no repair of the layout can help: a check threw on a layout of
1413
+ * the right shape, a defect in the checks, or the frame or the descriptor
1414
+ * the layout is checked against is not one, a defect in what the host
1415
+ * handed over. Each
1416
+ * is stated among the problems in a line of its own. The layout is refused
1417
+ * all the same - the host keeps the plain form - but a producer stops here
1418
+ * instead of handing the lines to the repair pass, which can change the
1419
+ * layout and neither the checks nor the descriptor.
1420
+ */
1421
+ checksFailed: boolean;
1422
+ }
1397
1423
  /**
1398
1424
  * Everything the host's two checks find wrong with a layout written for
1399
- * `frame`, one problem a line, in the words the repair pass reads: first the
1425
+ * `frame`, and whether the checks themselves failed on it: first the
1400
1426
  * catalog's verdict against the frame's own vocabulary (`frameCatalog`), then
1401
- * whether it fits the descriptor (`layoutProblems`). Empty means the layout
1402
- * may render. A producer feeds the lines, joined, to `repair_layout` as its
1403
- * `problems`; a host deciding whether a stored layout renders needs only
1404
- * whether the list is empty.
1427
+ * whether it fits the descriptor (`layoutProblems`). Empty problems mean the
1428
+ * layout may render. A producer feeds the lines, joined, to `repair_layout`
1429
+ * as its `problems`, unless `checksFailed` says no repair can help; a host
1430
+ * deciding whether a stored layout renders needs only whether the list is
1431
+ * empty, which `layoutCheckProblems` answers alone.
1405
1432
  *
1406
1433
  * It never throws. Its subject is whatever a model wrote, or a layout and a
1407
1434
  * frame a host stored and read back, and a throw is the one answer a host
1408
1435
  * cannot act on: it arrives instead of the problem that would have sent the
1409
- * page to its fallback. So a frame this package does not draw, a missing
1410
- * descriptor, and anything that is not a spec at all are each a problem line,
1411
- * and any throw left in a walk below is caught here and answered as one.
1436
+ * page to its fallback. So a frame this package does not draw, a missing or
1437
+ * misshapen descriptor, and anything not shaped like a spec are each a
1438
+ * problem line, and a throw left in a walk below on a layout of the right
1439
+ * shape is the checks' own failure, a line saying so. The frame and the
1440
+ * descriptor are the host's, and a throw is the checks', so each of those
1441
+ * sets `checksFailed` too: no repair of the layout can mend it.
1442
+ * The shape is checked once, before either check walks the layout.
1443
+ */
1444
+ declare function layoutCheck(spec: Spec, { frame, descriptor }: LayoutCheck): LayoutVerdict;
1445
+ /**
1446
+ * Everything the host's two checks find wrong with a layout written for
1447
+ * `frame`, one problem a line: `layoutCheck`'s problems alone, for a host
1448
+ * that needs only whether a stored layout renders. Never throws.
1412
1449
  */
1413
- declare function layoutCheckProblems(spec: Spec, { frame, descriptor }: LayoutCheck): string[];
1450
+ declare function layoutCheckProblems(spec: Spec, check: LayoutCheck): string[];
1414
1451
 
1415
1452
  /**
1416
1453
  * The brief: the model's view of the descriptor, as DATA.
@@ -1699,4 +1736,4 @@ declare function fixtureLabel(fixture: Provenance & Pick<SpecFixture, 'repairs'>
1699
1736
  /** The fixture a story asks for, or a loud failure: a story must never render a page it did not name. */
1700
1737
  declare function findFixture(fixtures: readonly SpecFixture[], pipeRef: string, id: string): SpecFixture;
1701
1738
 
1702
- export { type BriefSubject, COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, type ComponentRendering, type CriticLoop, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, type DesignerAction, type DesignerBrief, type DesignerCatalog, type DesignerCatalogOptions, type DesignerComponent, type DesignerPathEntry, type DesignerStyle, FRAMES, FRAME_COMPONENTS, type Frame, type GenerativeSpec, ICON_NAMES, INPUTS_ROOT, type InputBriefOptions, type LayoutCheck, type LayoutDescriptor, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, type Producer, type ProductComponentName, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, type ResultBriefOptions, type SpecFixture, type SpecProblem, type SpecVerdict, type ValidationCatalog, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog };
1739
+ export { type BriefSubject, COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, type ComponentRendering, type CriticLoop, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, type DesignerAction, type DesignerBrief, type DesignerCatalog, type DesignerCatalogOptions, type DesignerComponent, type DesignerPathEntry, type DesignerStyle, FRAMES, FRAME_COMPONENTS, type Frame, type GenerativeSpec, ICON_NAMES, INPUTS_ROOT, type InputBriefOptions, type LayoutCheck, type LayoutDescriptor, type LayoutVerdict, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, type Producer, type ProductComponentName, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, type ResultBriefOptions, type SpecFixture, type SpecProblem, type SpecVerdict, type ValidationCatalog, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheck, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog };
@@ -1,6 +1,7 @@
1
- export { COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, FRAMES, FRAME_COMPONENTS, ICON_NAMES, INPUTS_ROOT, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog } from '../../chunk-VBXFGUCG.js';
1
+ export { COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, FRAMES, FRAME_COMPONENTS, ICON_NAMES, INPUTS_ROOT, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheck, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog } from '../../chunk-XYS5KCXB.js';
2
2
  import '../../chunk-QQK6Y55E.js';
3
- import '../../chunk-3GO65HWP.js';
3
+ import '../../chunk-PNNWNRPG.js';
4
+ import '../../chunk-TF4RTKLH.js';
4
5
  import '../../chunk-V3OV2XQT.js';
5
6
  //# sourceMappingURL=index.js.map
6
7
  //# sourceMappingURL=index.js.map
@@ -1,16 +1,16 @@
1
- export { BriefSubject, COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, ComponentRendering, CriticLoop, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, DesignerAction, DesignerBrief, DesignerCatalog, DesignerCatalogOptions, DesignerComponent, DesignerPathEntry, DesignerStyle, FRAMES, FRAME_COMPONENTS, Frame, GenerativeSpec, ICON_NAMES, INPUTS_ROOT, InputBriefOptions, LayoutCheck, LayoutDescriptor, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, Producer, ProductComponentName, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, ResultBriefOptions, SpecFixture, SpecProblem, SpecVerdict, ValidationCatalog, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog } from './headless/index.js';
1
+ export { BriefSubject, COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, ComponentRendering, CriticLoop, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, DesignerAction, DesignerBrief, DesignerCatalog, DesignerCatalogOptions, DesignerComponent, DesignerPathEntry, DesignerStyle, FRAMES, FRAME_COMPONENTS, Frame, GenerativeSpec, ICON_NAMES, INPUTS_ROOT, InputBriefOptions, LayoutCheck, LayoutDescriptor, LayoutVerdict, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, Producer, ProductComponentName, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, ResultBriefOptions, SpecFixture, SpecProblem, SpecVerdict, ValidationCatalog, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheck, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog } from './headless/index.js';
2
2
  import * as _json_render_core from '@json-render/core';
3
- import { Spec, StateStore, StateModel } from '@json-render/core';
3
+ import { Spec, StateStore, StateModel, ValidationConfig } from '@json-render/core';
4
4
  export { Spec, StateModel, StateStore, createStateStore } from '@json-render/core';
5
- import * as react from 'react';
5
+ import * as React from 'react';
6
6
  import * as _json_render_react from '@json-render/react';
7
- import { Components, Renderer } from '@json-render/react';
7
+ import { Components, Renderer, useFieldValidation } from '@json-render/react';
8
8
  import { B as BrandManifest } from '../manifest-D3DLyNEv.js';
9
9
  export { b as brandManifestSchema } from '../manifest-D3DLyNEv.js';
10
10
  import * as zod_v4_core from 'zod/v4/core';
11
11
  import * as zod from 'zod';
12
12
  import { RunField } from '../core/descriptor.js';
13
- import { F as FieldEnv } from '../field-renderer-Dz03dpig.js';
13
+ import { F as FieldEnv } from '../field-renderer-BYN6YrU-.js';
14
14
  export { seedInputs } from '../core/seed.js';
15
15
  import '../styles-Bn8byNdo.js';
16
16
  import '../core/contracts.js';
@@ -31,11 +31,27 @@ import '../core/sources.js';
31
31
  * boundary above the root. When the host passes a handler, the boundary
32
32
  * catches the throw first, renders nothing in its place as json-render's
33
33
  * would, and hands the error to the host after the commit, once per element
34
- * that failed. When it passes none, the boundary throws the error on, so the
35
- * page behaves exactly as json-render alone does: an element's throw is logged
36
- * and dropped, and a root's reaches the host's own boundary. The wrapping does
37
- * not depend on whether there is a handler, so a host that starts or stops
38
- * passing one remounts nothing.
34
+ * that failed. When it passes none, an element's boundary logs the error as
35
+ * json-render's would and renders nothing, and the root's throws it on, to
36
+ * the host's own boundary. The wrapping does not depend on whether there is a
37
+ * handler, so a host that starts or stops passing one remounts nothing.
38
+ *
39
+ * Unlike json-render's, a failed boundary tries again when what it caught a
40
+ * throw from changes - for an element, its resolved props, the list it
41
+ * repeats over when it repeats, and each child's props and visibility as they
42
+ * resolve, since a child's props are resolved in the child's render and a
43
+ * throw there is the element above's to catch; for the root, the layout and
44
+ * the root's own resolved props - so an element that threw on a word where
45
+ * its list belongs draws once the store holds the list, without remounting
46
+ * the page. What changed is judged by content, read when the boundary fails
47
+ * and again only while it has failed, so a host that hands an equal value as
48
+ * a new object at every render - a spec parsed inline, props resolved afresh
49
+ * - does not retry, throw and report again at every render, and one that
50
+ * corrects its layout in place is judged against what failed. And while the
51
+ * page is `loading`, a failure is neither reported nor logged: a layout still
52
+ * streaming may be caught half-written, so the boundary tries again with each
53
+ * new value and once more when the stream ends, and reports only what still
54
+ * fails then.
39
55
  */
40
56
  /** What a host is told of an element that failed to render. */
41
57
  interface ElementErrorInfo {
@@ -82,8 +98,8 @@ interface DescriptorScope {
82
98
  declare function useDescriptorScope(): DescriptorScope;
83
99
  declare function DescriptorProvider({ scope, children, }: {
84
100
  scope: DescriptorScope;
85
- children: react.ReactNode;
86
- }): react.JSX.Element;
101
+ children: React.ReactNode;
102
+ }): React.JSX.Element;
87
103
  /**
88
104
  * Exported for the round-trip test only, not from the entry's index: the pair
89
105
  * is only correct together, so a test that could see just one half of it would
@@ -720,7 +736,7 @@ declare const generativeRenderers: Components<_json_render_core.Catalog<{
720
736
  }>>;
721
737
 
722
738
  /** What a page renders through: this entry's registry unless a host brings its own. */
723
- type PageRegistry = react.ComponentProps<typeof Renderer>['registry'];
739
+ type PageRegistry = React.ComponentProps<typeof Renderer>['registry'];
724
740
  interface GenerativePageProps {
725
741
  /** The layout to render; `null` while a stream has produced nothing yet. */
726
742
  spec: Spec | null;
@@ -731,7 +747,8 @@ interface GenerativePageProps {
731
747
  /**
732
748
  * What `run` does. Receives the state at the moment the call to action was
733
749
  * pressed. Return the run's promise and a press while it is pending starts
734
- * nothing.
750
+ * nothing. Not called while a field's own checks (its `checks` prop) fail:
751
+ * the press shows each failing field its message instead.
735
752
  */
736
753
  onRun?: (state: StateModel) => void | Promise<unknown>;
737
754
  /** Whether a stream is still arriving. */
@@ -752,7 +769,10 @@ interface GenerativePageProps {
752
769
  * the page and catches its throw in a boundary of its own, so a boundary
753
770
  * around the page never fires; this is how a host hears of it, and falls
754
771
  * back to its plain view if it wants the whole page to. The element renders
755
- * nothing in its place either way. Without it, json-render logs the error.
772
+ * nothing in its place either way, and draws again once what it renders
773
+ * from changes. Not called while `loading`: what still fails when the stream
774
+ * ends is reported then. Without it, the error is logged as json-render logs
775
+ * it, and the root's goes on to the host's own boundary around the page.
756
776
  */
757
777
  onElementError?: ElementErrorHandler;
758
778
  }
@@ -764,7 +784,7 @@ interface GenerativePageProps {
764
784
  * kernel's readiness is computed from, and generation is nowhere in the
765
785
  * request path: a layout is a data file, and this renders it.
766
786
  */
767
- declare function GenerativePage({ spec, store, scope, onRun, loading, registry, brand, onElementError, }: GenerativePageProps): react.JSX.Element;
787
+ declare function GenerativePage({ spec, store, scope, onRun, loading, registry, brand, onElementError, }: GenerativePageProps): React.JSX.Element;
768
788
  /** The store's current state, re-rendering on every change. For a receipt beside a page. */
769
789
  declare function useStoreSnapshot(store: StateStore): StateModel;
770
790
 
@@ -782,6 +802,40 @@ declare function useStoreSnapshot(store: StateStore): StateModel;
782
802
  */
783
803
  declare const generativeRegistry: _json_render_react.ComponentRegistry;
784
804
 
805
+ /**
806
+ * A panel that can be hidden - a tab's, a step's, a closed section's - as a
807
+ * refused run sees it: `open` shows this panel, and the reveal it hands its
808
+ * contents opens the panels around it first. The reveal handed down keeps its
809
+ * identity across renders, so no field re-renders when its panel does.
810
+ */
811
+ declare function RevealPanel({ open, children }: {
812
+ open: () => void;
813
+ children: React.ReactNode;
814
+ }): React.JSX.Element;
815
+ /** What `useCheckedField` gives a control: json-render's field validation, and where the focus goes. */
816
+ type CheckedField = ReturnType<typeof useFieldValidation> & {
817
+ /**
818
+ * A ref for the element a refused run puts the focus on: the input, the
819
+ * select's trigger, a radio group's checked option or its first while none
820
+ * is. A control that attaches it is focused when it is the first failing
821
+ * field of a refused run; one that does not is still revealed, after every
822
+ * field that does.
823
+ */
824
+ focusRef: (element: HTMLElement | null) => void;
825
+ };
826
+ /**
827
+ * json-render's `useFieldValidation`, for a control that carries checks. On a
828
+ * page, the field's checks enter the page's record while it is mounted, and
829
+ * the field validates against every check its path carries, so a control
830
+ * hidden or dropped no longer holds the run and two controls on one path
831
+ * agree; and when a run is refused, the first failing field is revealed and
832
+ * focused. A host's own control that carries checks calls this rather than
833
+ * `useFieldValidation` to be held to the same rules, and attaches `focusRef`
834
+ * to the element that should take the focus; outside a page it is
835
+ * `useFieldValidation`.
836
+ */
837
+ declare function useCheckedField(path: string, config: ValidationConfig | undefined): CheckedField;
838
+
785
839
  /**
786
840
  * What the page paints under the work column, when there is anything to paint.
787
841
  *
@@ -797,21 +851,21 @@ declare const generativeRegistry: _json_render_react.ComponentRegistry;
797
851
  */
798
852
  interface ResultSlot {
799
853
  /** What to paint. Nothing is painted at all while this is absent or `null`. */
800
- content: react.ReactNode;
854
+ content: React.ReactNode;
801
855
  /** The heading above it. "Result" unless the host names it. */
802
856
  title?: string;
803
857
  }
804
858
  declare function ResultSlotProvider({ slot, children, }: {
805
859
  slot: ResultSlot | null;
806
- children: react.ReactNode;
807
- }): react.JSX.Element;
860
+ children: React.ReactNode;
861
+ }): React.JSX.Element;
808
862
  /** The slot the nearest page provides, or `null` on a page with no result yet. */
809
863
  declare function useResultSlot(): ResultSlot | null;
810
864
 
811
865
  declare function BrandProvider({ manifest, children, }: {
812
866
  manifest: BrandManifest;
813
- children: react.ReactNode;
814
- }): react.JSX.Element;
867
+ children: React.ReactNode;
868
+ }): React.JSX.Element;
815
869
  declare function useBrand(): BrandManifest;
816
870
 
817
871
  interface BrandBarProps {
@@ -822,7 +876,7 @@ interface BrandBarProps {
822
876
  /** A short code at the end of the bar, such as the pipe's. */
823
877
  tag?: string | null;
824
878
  }
825
- declare function BrandBar({ app, links, tag }: BrandBarProps): react.JSX.Element;
879
+ declare function BrandBar({ app, links, tag }: BrandBarProps): React.JSX.Element;
826
880
 
827
881
  /**
828
882
  * What a host's compose-then-result frame tells the frame components of a
@@ -845,8 +899,8 @@ interface FrameHost {
845
899
  }
846
900
  declare function FrameHostProvider({ host, children, }: {
847
901
  host: FrameHost;
848
- children: react.ReactNode;
849
- }): react.JSX.Element;
902
+ children: React.ReactNode;
903
+ }): React.JSX.Element;
850
904
  declare function useFrameHost(): FrameHost;
851
905
 
852
- export { BrandBar, type BrandBarProps, BrandManifest, BrandProvider, DescriptorProvider, type DescriptorScope, type ElementErrorHandler, type ElementErrorInfo, type FrameHost, FrameHostProvider, GenerativePage, type GenerativePageProps, type PageRegistry, type ResultSlot, ResultSlotProvider, domIdFor, generativeRegistry, generativeRenderers, pathFromDomId, useBrand, useDescriptorScope, useFrameHost, useResultSlot, useStoreSnapshot };
906
+ export { BrandBar, type BrandBarProps, BrandManifest, BrandProvider, type CheckedField, DescriptorProvider, type DescriptorScope, type ElementErrorHandler, type ElementErrorInfo, type FrameHost, FrameHostProvider, GenerativePage, type GenerativePageProps, type PageRegistry, type ResultSlot, ResultSlotProvider, RevealPanel, domIdFor, generativeRegistry, generativeRenderers, pathFromDomId, useBrand, useCheckedField, useDescriptorScope, useFrameHost, useResultSlot, useStoreSnapshot };