@pipelex/mthds-form 0.4.0 → 0.6.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 +15 -6
- package/dist/{chunk-6XD6UZSU.js → chunk-25I6JDIK.js} +2 -2
- package/dist/chunk-25I6JDIK.js.map +1 -0
- package/dist/chunk-2JWRG53S.js +33 -0
- package/dist/chunk-2JWRG53S.js.map +1 -0
- package/dist/chunk-45C2MKK6.js +94 -0
- package/dist/chunk-45C2MKK6.js.map +1 -0
- package/dist/chunk-4BSBBG2T.js +80 -0
- package/dist/chunk-4BSBBG2T.js.map +1 -0
- package/dist/{chunk-7BMOPXDY.js → chunk-GCXV76WU.js} +17 -9
- package/dist/chunk-GCXV76WU.js.map +1 -0
- package/dist/chunk-IIU3YK4O.js +16 -0
- package/dist/chunk-IIU3YK4O.js.map +1 -0
- package/dist/chunk-J4L32LD6.js +137 -0
- package/dist/chunk-J4L32LD6.js.map +1 -0
- package/dist/{chunk-KFZ5MZOM.js → chunk-LBFZXYCY.js} +3 -3
- package/dist/{chunk-KFZ5MZOM.js.map → chunk-LBFZXYCY.js.map} +1 -1
- package/dist/{chunk-O4O3QNVC.js → chunk-OD3VYXUY.js} +13 -3
- package/dist/chunk-OD3VYXUY.js.map +1 -0
- package/dist/{chunk-XEPD5VJQ.js → chunk-R7B7ID25.js} +8 -8
- package/dist/chunk-R7B7ID25.js.map +1 -0
- package/dist/{chunk-WXBSM2CE.js → chunk-T4NSAGOS.js} +8 -8
- package/dist/chunk-T4NSAGOS.js.map +1 -0
- package/dist/{chunk-HARYEWNG.js → chunk-XYQ7NXQZ.js} +2 -2
- package/dist/chunk-XYQ7NXQZ.js.map +1 -0
- package/dist/chunk-YEVVR6FE.js +66 -0
- package/dist/chunk-YEVVR6FE.js.map +1 -0
- package/dist/core/contracts.d.ts +27 -56
- package/dist/core/contracts.js +1 -1
- package/dist/core/derive.d.ts +79 -11
- package/dist/core/derive.js +4 -4
- package/dist/core/descriptor.d.ts +70 -26
- package/dist/core/descriptor.js +1 -1
- package/dist/core/file-formats.d.ts +102 -0
- package/dist/core/file-formats.js +3 -0
- package/dist/core/file-formats.js.map +1 -0
- package/dist/core/gate.d.ts +1 -1
- package/dist/core/gate.js +7 -8
- package/dist/core/gating-fields.d.ts +38 -0
- package/dist/core/gating-fields.js +6 -0
- package/dist/core/gating-fields.js.map +1 -0
- package/dist/core/index.d.ts +8 -3
- package/dist/core/index.js +14 -10
- package/dist/core/native-content.d.ts +219 -0
- package/dist/core/native-content.js +4 -0
- package/dist/core/{native-concepts.js.map → native-content.js.map} +1 -1
- package/dist/core/normalize-schema.js +2 -2
- package/dist/core/output-form.d.ts +45 -0
- package/dist/core/output-form.js +5 -0
- package/dist/core/output-form.js.map +1 -0
- package/dist/core/readiness.d.ts +2 -0
- package/dist/core/schema-utils.d.ts +13 -1
- package/dist/core/schema-utils.js +1 -1
- package/dist/core/stuff-files.d.ts +52 -0
- package/dist/core/stuff-files.js +5 -0
- package/dist/core/stuff-files.js.map +1 -0
- package/dist/core/values.d.ts +10 -3
- package/dist/core/values.js +7 -7
- package/dist/core/wire-format.js +3 -4
- package/dist/react/index.d.ts +278 -1
- package/dist/react/index.js +1378 -29
- package/dist/react/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +17 -3
- package/dist/chunk-6XD6UZSU.js.map +0 -1
- package/dist/chunk-7BMOPXDY.js.map +0 -1
- package/dist/chunk-HARYEWNG.js.map +0 -1
- package/dist/chunk-NMT7BRLO.js +0 -40
- package/dist/chunk-NMT7BRLO.js.map +0 -1
- package/dist/chunk-O4O3QNVC.js.map +0 -1
- package/dist/chunk-VMLXO5JS.js +0 -132
- package/dist/chunk-VMLXO5JS.js.map +0 -1
- package/dist/chunk-WXBSM2CE.js.map +0 -1
- package/dist/chunk-XEPD5VJQ.js.map +0 -1
- package/dist/core/native-concepts.d.ts +0 -78
- package/dist/core/native-concepts.js +0 -3
package/dist/core/index.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export { describeValidationError, displayValue, valueAtProperty } from '../chunk-RPA7DNSK.js';
|
|
2
|
-
export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromStore, setValueAtPath, storeInputDataFromRunValues } from '../chunk-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
2
|
+
export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromStore, setValueAtPath, storeInputDataFromRunValues } from '../chunk-T4NSAGOS.js';
|
|
3
|
+
export { getPipeOutputForm } from '../chunk-IIU3YK4O.js';
|
|
4
|
+
export { collectStuffFiles } from '../chunk-4BSBBG2T.js';
|
|
5
|
+
export { NATIVE_COMPOSITE_CONCEPT_REF, NATIVE_DATE_CONCEPT_REF, NATIVE_HTML_CONCEPT_REF, TYPED_SCALAR_MARKERS, formatDateContent, hasTypedScalarMarkers, isNativeCompositeNode, isNativeDateNode, isNativeHtmlNode, isViewableUrl, readCompositeContent, readDateContent, readDocumentContent, readHtmlContent, readImageContent } from '../chunk-45C2MKK6.js';
|
|
6
|
+
export { buildResultField, buildRunFields, getPipeInputForm } from '../chunk-J4L32LD6.js';
|
|
7
|
+
export { conceptCategory } from '../chunk-25I6JDIK.js';
|
|
8
|
+
export { DOCUMENT_FORMATS, IMAGE_FORMATS, acceptLabelForKind, acceptMapForKind, formatsForKind, isAcceptedFile } from '../chunk-2JWRG53S.js';
|
|
9
|
+
export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-R7B7ID25.js';
|
|
10
|
+
export { deflateAllInputs, deflateInput, healStringWrappers, inflateAllInputs, inflateInput, pruneEmptyOptionals, resolveConceptCode } from '../chunk-GCXV76WU.js';
|
|
11
|
+
export { normalizeSchemaForRjsf, prepareSchemaForRjsf } from '../chunk-LBFZXYCY.js';
|
|
7
12
|
export { computeReadiness, fieldFilled, isFilled, mustBeFilled } from '../chunk-PM55AHRO.js';
|
|
8
|
-
export { buildRunFields } from '../chunk-VMLXO5JS.js';
|
|
9
|
-
export { collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, schemaTypeOf } from '../chunk-O4O3QNVC.js';
|
|
10
|
-
export { buildPipeRef, getPipeIOContract, inputMustBeFilled, isFixedCountInput, isOptionalInput, isPluralInput } from '../chunk-HARYEWNG.js';
|
|
11
|
-
import '../chunk-V3OV2XQT.js';
|
|
12
13
|
export { validateRunInputsSchema } from '../chunk-VTPUDBSJ.js';
|
|
13
14
|
export { asCalendarDate, dayWithinDateTime, isAcceptableDate, isAcceptableDateTime, toDateInputValue, toStoredDateValue } from '../chunk-GKV77RAS.js';
|
|
14
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-YEVVR6FE.js';
|
|
16
|
+
export { collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, schemaTypeOf } from '../chunk-OD3VYXUY.js';
|
|
17
|
+
export { buildPipeRef, getPipeIOContract, inputMustBeFilled, isFixedCountInput, isOptionalInput, isPluralInput } from '../chunk-XYQ7NXQZ.js';
|
|
18
|
+
import '../chunk-V3OV2XQT.js';
|
|
15
19
|
//# sourceMappingURL=index.js.map
|
|
16
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How to READ the native content models — the result side's twin of
|
|
3
|
+
* `./file-formats`.
|
|
4
|
+
*
|
|
5
|
+
* A renderer handed a result knows the field's `kind` from the descriptor, and
|
|
6
|
+
* for the kinds whose value is a structured content model rather than a bare
|
|
7
|
+
* scalar (`document`, `image`, `date`) it must then read that model's members.
|
|
8
|
+
* **That is reading the standard, not sniffing at it.** The distinction is the
|
|
9
|
+
* whole reason this module exists as data rather than as heuristics inside a
|
|
10
|
+
* control: a reader keyed by a STATED kind consults a pinned definition, where
|
|
11
|
+
* a reader that works out *which* kind it is holding by counting properties is
|
|
12
|
+
* guessing — and guessing is exactly what [../../docs/derivation-swap.md]
|
|
13
|
+
* records removing from the input side.
|
|
14
|
+
*
|
|
15
|
+
* ## Where each shape comes from
|
|
16
|
+
*
|
|
17
|
+
* `native.Image` and `native.Document` are pinned by the standard, in
|
|
18
|
+
* `docs/spec/native-concepts.md` § "The Pinned Set (MTHDS 1.0.0)". Both carry a
|
|
19
|
+
* required `url` — a storage URI, an HTTP(S) URL, or a base64 data URL — and
|
|
20
|
+
* optional presentation members beside it. Nothing here adds a member the spec
|
|
21
|
+
* does not state.
|
|
22
|
+
*
|
|
23
|
+
* `native.Date` is pinned the same way (`{date, time}`), but a `date` FIELD
|
|
24
|
+
* inside a structured concept is not a `native.Date` value: it is a python
|
|
25
|
+
* `datetime.date`, and the serialization layer stamps it with its class. So a
|
|
26
|
+
* date arrives in one of three legal shapes, all three of which a run really
|
|
27
|
+
* produces:
|
|
28
|
+
*
|
|
29
|
+
* "2026-03-14" a plain ISO string
|
|
30
|
+
* { date: "2026-03-14", __class__: "date", … } a typed scalar
|
|
31
|
+
* { date: "2026-03-14", time: "15:40:00" } native.Date
|
|
32
|
+
*
|
|
33
|
+
* The typed-scalar envelope is the one shape the standard does NOT pin — it is
|
|
34
|
+
* a serialization fact, measured off a real run rather than read off a spec —
|
|
35
|
+
* and it is called out as such here so nobody mistakes it for normative.
|
|
36
|
+
*
|
|
37
|
+
* This module lives in core, not beside the control that renders it, for the
|
|
38
|
+
* reason `file-formats.ts` established: a host that shows a result its own way
|
|
39
|
+
* needs the same answer the control uses, and two copies of an answer is two
|
|
40
|
+
* places for it to drift. Pure data and pure functions — no React.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* `native.Document`, read.
|
|
44
|
+
*
|
|
45
|
+
* `url` is the only required member; everything else is a producer's courtesy,
|
|
46
|
+
* so a reader that demands any of them describes a value the standard permits
|
|
47
|
+
* as malformed.
|
|
48
|
+
*/
|
|
49
|
+
interface DocumentContentView {
|
|
50
|
+
url: string;
|
|
51
|
+
publicUrl?: string;
|
|
52
|
+
mimeType?: string;
|
|
53
|
+
filename?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
snippet?: string;
|
|
56
|
+
}
|
|
57
|
+
/** `native.Image`, read. `width`/`height` are optional but PAIRED by the spec. */
|
|
58
|
+
interface ImageContentView {
|
|
59
|
+
url: string;
|
|
60
|
+
publicUrl?: string;
|
|
61
|
+
caption?: string;
|
|
62
|
+
mimeType?: string;
|
|
63
|
+
filename?: string;
|
|
64
|
+
width?: number;
|
|
65
|
+
height?: number;
|
|
66
|
+
sourcePrompt?: string;
|
|
67
|
+
}
|
|
68
|
+
/** `native.Date` (and the typed-scalar envelope a nested `date` field arrives in). */
|
|
69
|
+
interface DateContentView {
|
|
70
|
+
/** ISO 8601 calendar date, `YYYY-MM-DD`. */
|
|
71
|
+
date: string;
|
|
72
|
+
/** ISO 8601 time of day, present only when the source stated one. */
|
|
73
|
+
time?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Read a `document`-kind value. `undefined` when the value carries no `url`,
|
|
77
|
+
* which is the one member the standard requires — a caller renders its own
|
|
78
|
+
* absence rather than being handed a half-value to test.
|
|
79
|
+
*/
|
|
80
|
+
declare function readDocumentContent(value: unknown): DocumentContentView | undefined;
|
|
81
|
+
/** Read an `image`-kind value. Same contract as `readDocumentContent`. */
|
|
82
|
+
declare function readImageContent(value: unknown): ImageContentView | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* `native.Html`, read.
|
|
85
|
+
*
|
|
86
|
+
* The only content model here that is NOT reached by a field kind, and the
|
|
87
|
+
* reason is a deliberate decision of the standard: the kind vocabulary has no
|
|
88
|
+
* `html` member, so a `native.Html` value is an `object` node over its two
|
|
89
|
+
* declared fields. That is right for the descriptor — the kinds name how a value
|
|
90
|
+
* is ENTERED, and markup is entered as text — and wrong for a result view, which
|
|
91
|
+
* would otherwise print a page's source at a reader.
|
|
92
|
+
*
|
|
93
|
+
* So this one is keyed by CONCEPT rather than by kind, through
|
|
94
|
+
* `isNativeHtmlNode` below. That is a membership test on facts the descriptor
|
|
95
|
+
* states (`concept_ref`, `refines`), which the standard's own page calls out as
|
|
96
|
+
* the supported way to ask "does this refine `native.X`?" — the opposite of
|
|
97
|
+
* inspecting a value to guess what it is.
|
|
98
|
+
*/
|
|
99
|
+
interface HtmlContentView {
|
|
100
|
+
/** The markup itself. The one required member. */
|
|
101
|
+
innerHtml: string;
|
|
102
|
+
/** A class name for a wrapper a consumer may put around it, when stated. */
|
|
103
|
+
cssClass?: string;
|
|
104
|
+
}
|
|
105
|
+
/** Read an `native.Html` value. `undefined` when it carries no markup. */
|
|
106
|
+
declare function readHtmlContent(value: unknown): HtmlContentView | undefined;
|
|
107
|
+
/** The concept refs whose content model is multi-property, spelled once each. */
|
|
108
|
+
declare const NATIVE_HTML_CONCEPT_REF = "native.Html";
|
|
109
|
+
declare const NATIVE_DATE_CONCEPT_REF = "native.Date";
|
|
110
|
+
declare const NATIVE_COMPOSITE_CONCEPT_REF = "native.Composite";
|
|
111
|
+
/** One member of a composite: the name it was composed under, and its content. */
|
|
112
|
+
interface CompositeMember {
|
|
113
|
+
name: string;
|
|
114
|
+
value: unknown;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Read a `native.Composite` — a named composition of contents.
|
|
118
|
+
*
|
|
119
|
+
* The members are returned in the order the payload states them, which is the
|
|
120
|
+
* order the method composed them in and the only order there is: a composite
|
|
121
|
+
* declares no fields, so there is no authored order to prefer over it.
|
|
122
|
+
*
|
|
123
|
+
* `undefined` for anything that is not a record, so the caller falls back.
|
|
124
|
+
*/
|
|
125
|
+
declare function readCompositeContent(value: unknown): CompositeMember[] | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Whether a descriptor node carries markup — its concept IS `native.Html`, or
|
|
128
|
+
* refines it.
|
|
129
|
+
*
|
|
130
|
+
* The refinement chain is checked, not just the leaf, because a method may
|
|
131
|
+
* declare `legal.ClauseMarkup` refining `native.Html` and a reader of that result
|
|
132
|
+
* wants the markup rendered just the same. `refines` is on the wire for exactly
|
|
133
|
+
* this question.
|
|
134
|
+
*/
|
|
135
|
+
declare function isNativeHtmlNode(node: {
|
|
136
|
+
conceptRef?: string;
|
|
137
|
+
refines?: readonly string[];
|
|
138
|
+
}): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Whether a node IS a `native.Date` — the other content model the kind
|
|
141
|
+
* vocabulary cannot name.
|
|
142
|
+
*
|
|
143
|
+
* `native.Date` is `{date, time}`, two properties, so nothing unwraps it and its
|
|
144
|
+
* node is an `object`. Correct for the descriptor and wrong for a reader: a date
|
|
145
|
+
* result rendered structurally is a two-field card whose second field says "not
|
|
146
|
+
* provided", where the answer is a date. The `date` ARM already reads exactly
|
|
147
|
+
* this model — `readDateContent` takes `{date, time}` — it just never fires,
|
|
148
|
+
* because the kind says `object`.
|
|
149
|
+
*
|
|
150
|
+
* A `date` FIELD inside a structure is a different thing and needs none of this:
|
|
151
|
+
* it carries `kind: "date"` already.
|
|
152
|
+
*/
|
|
153
|
+
declare function isNativeDateNode(node: {
|
|
154
|
+
conceptRef?: string;
|
|
155
|
+
refines?: readonly string[];
|
|
156
|
+
}): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Whether a node is a `native.Composite` — a named bag of contents.
|
|
159
|
+
*
|
|
160
|
+
* The third concept the kind vocabulary cannot name, and the one where it is
|
|
161
|
+
* least able to: a composite declares no members at all, so its descriptor is
|
|
162
|
+
* `kind: "unknown"` and its payload schema is `{additionalProperties: true}`
|
|
163
|
+
* with no properties. Both are TRUE — the standard's escape hatch, honestly
|
|
164
|
+
* used — and both leave a renderer with nothing to read, so the default
|
|
165
|
+
* fallback prints the whole thing as a JSON blob.
|
|
166
|
+
*
|
|
167
|
+
* That is the worst available answer to a value that is, by definition, a map
|
|
168
|
+
* of ordinary `StuffContent`s. Keyed by concept, a renderer can at least show
|
|
169
|
+
* the members as the named things they are. See `CompositeValue`.
|
|
170
|
+
*/
|
|
171
|
+
declare function isNativeCompositeNode(node: {
|
|
172
|
+
conceptRef?: string;
|
|
173
|
+
refines?: readonly string[];
|
|
174
|
+
}): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Read a `date`-kind value, in any of the three shapes a run produces.
|
|
177
|
+
*
|
|
178
|
+
* The `date` member is read one level deep, because `native.Date`'s own `date`
|
|
179
|
+
* member is a `datetime.date` and therefore arrives inside the same typed-scalar
|
|
180
|
+
* envelope the whole value may already be wrapped in. One level is enough and
|
|
181
|
+
* the recursion is bounded on purpose: a second envelope would be a
|
|
182
|
+
* serialization bug, and following it forever would turn one into a hang.
|
|
183
|
+
*/
|
|
184
|
+
declare function readDateContent(value: unknown): DateContentView | undefined;
|
|
185
|
+
/** `{date}` / `{date, time}` as one line, which is how both are read aloud. */
|
|
186
|
+
declare function formatDateContent(content: DateContentView): string;
|
|
187
|
+
/**
|
|
188
|
+
* Whether a browser can paint this URL as-is.
|
|
189
|
+
*
|
|
190
|
+
* A `pipelex-storage://` reference cannot be resolved client-side — that is the
|
|
191
|
+
* upload seam's job (see [../../docs/upload-seam.md]) — so a renderer with no
|
|
192
|
+
* resolver must show the reference rather than a broken `<img>`. `file:` is
|
|
193
|
+
* deliberately NOT viewable: a run on a developer's machine writes one, and a
|
|
194
|
+
* browser refuses to load it from a page served over http.
|
|
195
|
+
*
|
|
196
|
+
* **A root-relative path counts**, and leaving it out was a real bug rather
|
|
197
|
+
* than an omission. A host's URL resolver naturally hands back a path on its
|
|
198
|
+
* OWN origin — `/api/assets/…`, an authenticated route that streams the object
|
|
199
|
+
* — which is the whole point of resolving rather than exposing storage. This
|
|
200
|
+
* predicate rejected it for having no scheme, so the resolved URL was thrown
|
|
201
|
+
* away and the arms fell back to the payload's `public_url`: a presigned URL
|
|
202
|
+
* that had already expired. The image stayed broken with the fix in place.
|
|
203
|
+
*
|
|
204
|
+
* `//host/path` is deliberately excluded. It is protocol-relative, so it points
|
|
205
|
+
* at another origin while looking like a path.
|
|
206
|
+
*/
|
|
207
|
+
declare function isViewableUrl(url: string | undefined): url is string;
|
|
208
|
+
/**
|
|
209
|
+
* The typed-scalar markers the serialization layer stamps onto a value.
|
|
210
|
+
*
|
|
211
|
+
* Exported so a host can recognise (and strip) them; nothing in the kernel
|
|
212
|
+
* BRANCHES on them, which is the point — a reader keyed by these would be
|
|
213
|
+
* reading the serializer instead of the standard.
|
|
214
|
+
*/
|
|
215
|
+
declare const TYPED_SCALAR_MARKERS: readonly ["__class__", "__module__"];
|
|
216
|
+
/** Whether a record carries the typed-scalar markers. Informational. */
|
|
217
|
+
declare function hasTypedScalarMarkers(value: unknown): boolean;
|
|
218
|
+
|
|
219
|
+
export { type CompositeMember, type DateContentView, type DocumentContentView, type HtmlContentView, type ImageContentView, NATIVE_COMPOSITE_CONCEPT_REF, NATIVE_DATE_CONCEPT_REF, NATIVE_HTML_CONCEPT_REF, TYPED_SCALAR_MARKERS, formatDateContent, hasTypedScalarMarkers, isNativeCompositeNode, isNativeDateNode, isNativeHtmlNode, isViewableUrl, readCompositeContent, readDateContent, readDocumentContent, readHtmlContent, readImageContent };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { NATIVE_COMPOSITE_CONCEPT_REF, NATIVE_DATE_CONCEPT_REF, NATIVE_HTML_CONCEPT_REF, TYPED_SCALAR_MARKERS, formatDateContent, hasTypedScalarMarkers, isNativeCompositeNode, isNativeDateNode, isNativeHtmlNode, isViewableUrl, readCompositeContent, readDateContent, readDocumentContent, readHtmlContent, readImageContent } from '../chunk-45C2MKK6.js';
|
|
2
|
+
import '../chunk-V3OV2XQT.js';
|
|
3
|
+
//# sourceMappingURL=native-content.js.map
|
|
4
|
+
//# sourceMappingURL=native-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"native-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"native-content.js"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { normalizeSchemaForRjsf, prepareSchemaForRjsf } from '../chunk-
|
|
2
|
-
export { hoistDefsToRoot } from '../chunk-
|
|
1
|
+
export { normalizeSchemaForRjsf, prepareSchemaForRjsf } from '../chunk-LBFZXYCY.js';
|
|
2
|
+
export { hoistDefsToRoot } from '../chunk-OD3VYXUY.js';
|
|
3
3
|
//# sourceMappingURL=normalize-schema.js.map
|
|
4
4
|
//# sourceMappingURL=normalize-schema.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { OutputForm, PipeOutputFormDescriptor } from 'mthds/protocol';
|
|
2
|
+
export { OutputForm, PipeOutputFormDescriptor } from 'mthds/protocol';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The output-form descriptor lookup.
|
|
6
|
+
*
|
|
7
|
+
* **This module used to declare the artifact; now it only addresses it.** The
|
|
8
|
+
* types come from `mthds/protocol`, exactly as the input side's do — the
|
|
9
|
+
* standard grew `output_form` as a page of its own, and grew `json_schema` on
|
|
10
|
+
* the output contract in the same version, so a renderer reads both off the wire
|
|
11
|
+
* instead of having them supplied beside it. What is left here is the twin of
|
|
12
|
+
* `getPipeInputForm`: the lookup, and the tolerance for the same two key
|
|
13
|
+
* conventions. [docs/contract-mirror.md](../../docs/contract-mirror.md) states
|
|
14
|
+
* the rule this now obeys — the contract types are the standard's, not this
|
|
15
|
+
* package's, and a member this package wants on one is a change to the standard
|
|
16
|
+
* before it is a change here.
|
|
17
|
+
*
|
|
18
|
+
* **An output is a concept ref exactly like an input is.** Same concept, same
|
|
19
|
+
* structure, same field kinds, same nesting; what differs is only the three SLOT
|
|
20
|
+
* facts an output has none of (an authored `name`, the three-valued `presence`,
|
|
21
|
+
* `gating`), all three optional on the standard's node precisely so a node can
|
|
22
|
+
* exist without them. That is why `buildResultField` maps an output node through
|
|
23
|
+
* the very mapper `buildRunFields` uses, and why there is no second node union
|
|
24
|
+
* anywhere in this package.
|
|
25
|
+
*
|
|
26
|
+
* | | Inputs | Outputs |
|
|
27
|
+
* | --- | --- | --- |
|
|
28
|
+
* | identity, plurality, optionality | `pipe_io_contracts` | `pipe_io_contracts` |
|
|
29
|
+
* | shape / JSON Schema | `json_schema` on the input contract | `json_schema` on the output contract |
|
|
30
|
+
* | presentation view | `input_form` | `output_form` |
|
|
31
|
+
*
|
|
32
|
+
* The two rows that used to read "nothing" are the change this package was built
|
|
33
|
+
* against while it was still a proposal; `wip/output-form-standard-change.md` is
|
|
34
|
+
* the argument that landed it. The one asymmetry the language keeps is
|
|
35
|
+
* `presence` versus `optional`: `!` MUST NOT appear on an output, so a
|
|
36
|
+
* three-valued output marker would have an arm nothing could ever produce.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Look a pipe's output descriptor up by code — the exact twin of
|
|
41
|
+
* `getPipeInputForm`, tolerant of the same two key conventions.
|
|
42
|
+
*/
|
|
43
|
+
declare function getPipeOutputForm(outputForm: OutputForm | null | undefined, domain: string | null | undefined, pipeCode: string | null | undefined): PipeOutputFormDescriptor | undefined;
|
|
44
|
+
|
|
45
|
+
export { getPipeOutputForm };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"output-form.js"}
|
package/dist/core/readiness.d.ts
CHANGED
|
@@ -47,6 +47,18 @@ declare function derefSchema(schema: JsonSchema, defs: Record<string, JsonSchema
|
|
|
47
47
|
* the callers did inline.
|
|
48
48
|
*/
|
|
49
49
|
declare function resolveSchemaIndirection(schema: JsonSchema, defs: Record<string, JsonSchema>): JsonSchema;
|
|
50
|
+
/**
|
|
51
|
+
* Resolve one schema node to its fixpoint under `derefSchema` +
|
|
52
|
+
* `collapseNullable`, so a nullable REFERENCE - pydantic's `anyOf: [{$ref},
|
|
53
|
+
* {type:'null'}]` for an Optional concept-typed field - resolves the same way
|
|
54
|
+
* a bare `$ref` or an inline nullable does. One pass of either helper cannot:
|
|
55
|
+
* collapsing the nullable surfaces a `$ref` that was inside a branch, and
|
|
56
|
+
* dereferencing can surface a nullable the definition holds. Sibling keys
|
|
57
|
+
* still merge over the definition (`derefSchema`'s semantics - unlike
|
|
58
|
+
* `resolveSchemaIndirection`, which replaces). Identity is the fixpoint test:
|
|
59
|
+
* both helpers return the schema unchanged when they have nothing to do.
|
|
60
|
+
*/
|
|
61
|
+
declare function resolveSchemaNode(schema: JsonSchema, defs: Record<string, JsonSchema>): JsonSchema;
|
|
50
62
|
interface CollectDefsOptions {
|
|
51
63
|
/**
|
|
52
64
|
* Whether the walk descends into JSON arrays (`anyOf`/`allOf` branches,
|
|
@@ -71,4 +83,4 @@ declare function collectSchemaDefs(schema: JsonSchema, into: Record<string, Json
|
|
|
71
83
|
*/
|
|
72
84
|
declare function hoistDefsToRoot(schema: JsonSchema): JsonSchema;
|
|
73
85
|
|
|
74
|
-
export { type CollectDefsOptions, type JsonSchema, collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, schemaTypeOf };
|
|
86
|
+
export { type CollectDefsOptions, type JsonSchema, collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, resolveSchemaNode, schemaTypeOf };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, schemaTypeOf } from '../chunk-
|
|
1
|
+
export { collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, resolveSchemaNode, schemaTypeOf } from '../chunk-OD3VYXUY.js';
|
|
2
2
|
//# sourceMappingURL=schema-utils.js.map
|
|
3
3
|
//# sourceMappingURL=schema-utils.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RunField } from './descriptor.js';
|
|
2
|
+
import './contracts.js';
|
|
3
|
+
import 'mthds/protocol';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* One file a stuff carries: what to fetch, and what to call it once saved.
|
|
7
|
+
*/
|
|
8
|
+
interface StuffFile {
|
|
9
|
+
/**
|
|
10
|
+
* The durable reference or URL the value states, for a file held BY
|
|
11
|
+
* REFERENCE. Absent for inline content, which needs no fetch.
|
|
12
|
+
*/
|
|
13
|
+
url?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The content itself, for a file the stuff carries INLINE — markup, today.
|
|
16
|
+
* Exactly one of `url` and `text` is set.
|
|
17
|
+
*/
|
|
18
|
+
text?: string;
|
|
19
|
+
/** The extension to save inline content under, without the dot. */
|
|
20
|
+
extension?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The URL that works outside this session, when the value carries one. A host
|
|
23
|
+
* whose display URL is session-scoped (an owner-checked proxy route) needs
|
|
24
|
+
* this for anything that leaves the browser.
|
|
25
|
+
*/
|
|
26
|
+
publicUrl?: string;
|
|
27
|
+
/** The file's own name when it states one — otherwise the caller derives it. */
|
|
28
|
+
filename?: string;
|
|
29
|
+
mimeType?: string;
|
|
30
|
+
/** Where it sat, dotted: `report.attachments.2.scan`. Names a saved file. */
|
|
31
|
+
path: string;
|
|
32
|
+
kind: 'image' | 'document' | 'markup';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Every file inside a stuff, found by walking the DESCRIPTOR — never the value.
|
|
36
|
+
*
|
|
37
|
+
* The distinction is the whole point. A payload walk would have to decide what
|
|
38
|
+
* a file is by looking at it: an object with a `url`, a string that ends in
|
|
39
|
+
* `.pdf`. That is the guessing this package exists to remove, and it is wrong in
|
|
40
|
+
* both directions — a method whose output legitimately has a `url` field of its
|
|
41
|
+
* own is not a document, and a stored image whose reference carries no extension
|
|
42
|
+
* is. The descriptor already states `kind: "image"` or `kind: "document"`, so
|
|
43
|
+
* the walk reads the declaration and consults the value only for the members
|
|
44
|
+
* that declaration promises.
|
|
45
|
+
*
|
|
46
|
+
* Ordering is the authored one, depth-first, which is the order the rendered
|
|
47
|
+
* view puts them in — so a download of three images numbers them the way the
|
|
48
|
+
* reader saw them.
|
|
49
|
+
*/
|
|
50
|
+
declare function collectStuffFiles(field: RunField, value: unknown): StuffFile[];
|
|
51
|
+
|
|
52
|
+
export { type StuffFile, collectStuffFiles };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"stuff-files.js"}
|
package/dist/core/values.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { PipeInputContract, PipeIOContract, PipeInputFormDescriptor } from 'mthds/protocol';
|
|
1
2
|
import { RunField } from './descriptor.js';
|
|
2
|
-
import
|
|
3
|
+
import './contracts.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Bridges the `MethodRunner`'s field values to the rest of the host.
|
|
@@ -80,8 +81,14 @@ declare function outputsFromPipeOutput(pipeOutput: unknown, inputKeys: string[])
|
|
|
80
81
|
* inputs that produced the result. Returns `null` when no inputs are present.
|
|
81
82
|
*/
|
|
82
83
|
declare function inputDataFromWorkingMemory(workingMemory: unknown, inputSchemas: InputSchemas): Dict | null;
|
|
83
|
-
/**
|
|
84
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Field descriptors for a method's main pipe - the wire descriptor mapped over
|
|
86
|
+
* the contract, or `[]` while either artifact has not arrived yet. The
|
|
87
|
+
* descriptor comes back from `validate` beside `pipe_io_contracts` when the
|
|
88
|
+
* request opts in with `views: ["input_form"]`; `getPipeInputForm` is the
|
|
89
|
+
* lookup that matches `getPipeIOContract`.
|
|
90
|
+
*/
|
|
91
|
+
declare function fieldsForContract(contract: PipeIOContract | undefined, descriptor: PipeInputFormDescriptor | undefined): RunField[];
|
|
85
92
|
/**
|
|
86
93
|
* Immutably set a value at a dotted/indexed path (`a.0.b`). Used to write an
|
|
87
94
|
* uploaded file's URL back to a field anywhere in the (possibly nested) tree.
|
package/dist/core/values.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromStore, setValueAtPath, storeInputDataFromRunValues } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromStore, setValueAtPath, storeInputDataFromRunValues } from '../chunk-T4NSAGOS.js';
|
|
2
|
+
import '../chunk-J4L32LD6.js';
|
|
3
|
+
import '../chunk-2JWRG53S.js';
|
|
4
|
+
import '../chunk-GCXV76WU.js';
|
|
3
5
|
import '../chunk-PM55AHRO.js';
|
|
4
|
-
import '../chunk-VMLXO5JS.js';
|
|
5
|
-
import '../chunk-O4O3QNVC.js';
|
|
6
|
-
import '../chunk-HARYEWNG.js';
|
|
7
|
-
import '../chunk-V3OV2XQT.js';
|
|
8
6
|
import '../chunk-GKV77RAS.js';
|
|
9
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-OD3VYXUY.js';
|
|
8
|
+
import '../chunk-XYQ7NXQZ.js';
|
|
9
|
+
import '../chunk-V3OV2XQT.js';
|
|
10
10
|
//# sourceMappingURL=values.js.map
|
|
11
11
|
//# sourceMappingURL=values.js.map
|
package/dist/core/wire-format.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { deflateAllInputs, deflateInput, healStringWrappers, inflateAllInputs, inflateInput, pruneEmptyOptionals, resolveConceptCode } from '../chunk-
|
|
2
|
-
import '../chunk-O4O3QNVC.js';
|
|
3
|
-
import '../chunk-V3OV2XQT.js';
|
|
1
|
+
export { deflateAllInputs, deflateInput, healStringWrappers, inflateAllInputs, inflateInput, pruneEmptyOptionals, resolveConceptCode } from '../chunk-GCXV76WU.js';
|
|
4
2
|
import '../chunk-GKV77RAS.js';
|
|
5
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-OD3VYXUY.js';
|
|
4
|
+
import '../chunk-V3OV2XQT.js';
|
|
6
5
|
//# sourceMappingURL=wire-format.js.map
|
|
7
6
|
//# sourceMappingURL=wire-format.js.map
|