@orkestrel/scaffold 0.0.115 → 0.0.117
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/dist/bin/main.js +138 -16
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +1 -1
- package/dist/host/claude/agents/orkestrel.md +2 -2
- package/dist/host/claude/rules/names.md +3 -1
- package/dist/host/guides/abort.md +17 -17
- package/dist/host/guides/agent.md +445 -445
- package/dist/host/guides/brief.md +143 -143
- package/dist/host/guides/browser.md +731 -731
- package/dist/host/guides/budget.md +39 -39
- package/dist/host/guides/capture.md +298 -298
- package/dist/host/guides/console.md +109 -109
- package/dist/host/guides/contract.md +335 -335
- package/dist/host/guides/csv.md +30 -30
- package/dist/host/guides/database.md +163 -163
- package/dist/host/guides/emitter.md +17 -17
- package/dist/host/guides/form.md +99 -99
- package/dist/host/guides/guide.md +368 -183
- package/dist/host/guides/html.md +49 -49
- package/dist/host/guides/indexeddb.md +40 -40
- package/dist/host/guides/interpret.md +139 -139
- package/dist/host/guides/lsp.md +114 -114
- package/dist/host/guides/markdown.md +68 -68
- package/dist/host/guides/mcp.md +3745 -3745
- package/dist/host/guides/middleware.md +170 -170
- package/dist/host/guides/msg.md +95 -95
- package/dist/host/guides/ndjson.md +8 -8
- package/dist/host/guides/ollama.md +56 -56
- package/dist/host/guides/pool.md +21 -21
- package/dist/host/guides/probe.md +82 -82
- package/dist/host/guides/process.md +99 -99
- package/dist/host/guides/program.md +98 -96
- package/dist/host/guides/qualifier.md +70 -70
- package/dist/host/guides/queue.md +37 -37
- package/dist/host/guides/rater.md +38 -38
- package/dist/host/guides/reason.md +308 -308
- package/dist/host/guides/relation.md +50 -50
- package/dist/host/guides/router.md +58 -58
- package/dist/host/guides/scaffold.md +558 -419
- package/dist/host/guides/sea.md +128 -128
- package/dist/host/guides/server.md +100 -100
- package/dist/host/guides/sqlite.md +28 -28
- package/dist/host/guides/sse.md +20 -20
- package/dist/host/guides/study.md +444 -444
- package/dist/host/guides/table.md +82 -82
- package/dist/host/guides/template.md +41 -41
- package/dist/host/guides/terminal.md +121 -121
- package/dist/host/guides/test.md +273 -273
- package/dist/host/guides/timeout.md +18 -18
- package/dist/host/guides/tool.md +27 -27
- package/dist/host/guides/toolbox.md +166 -166
- package/dist/host/guides/websocket.md +54 -54
- package/dist/host/guides/worker.md +24 -24
- package/dist/host/guides/workflow.md +187 -187
- package/dist/host/guides/workspace.md +55 -55
- package/dist/host/manifest.json +55 -55
- package/dist/host/tests/setupPolicy.ts +5 -3
- package/dist/src/core/index.cjs +90 -4
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +229 -144
- package/dist/src/core/index.d.ts +229 -144
- package/dist/src/core/index.js +88 -5
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +295 -66
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +193 -6
- package/dist/src/server/index.d.ts +193 -6
- package/dist/src/server/index.js +290 -69
- package/dist/src/server/index.js.map +1 -1
- package/package.json +5 -4
|
@@ -46,34 +46,34 @@ The reserved `on` option wires initial listeners at construction; the optional `
|
|
|
46
46
|
|
|
47
47
|
### Factories
|
|
48
48
|
|
|
49
|
-
|
|
|
50
|
-
| --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
-
| `createEmitter` | function | Creates a typed synchronous event emitter and returns it as an `EmitterInterface<TMap>`, wiring the initial `on` hooks and the `error` handler its options carry. |
|
|
49
|
+
| Name | Kind | Signature | Summary |
|
|
50
|
+
| --------------- | -------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `createEmitter` | function | `<TMap extends EventMap>(options?: EmitterOptions<TMap>) => EmitterInterface<TMap>` | Creates a typed synchronous event emitter and returns it as an `EmitterInterface<TMap>`, wiring the initial `on` hooks and the `error` handler its options carry. |
|
|
52
52
|
|
|
53
53
|
### Helpers
|
|
54
54
|
|
|
55
|
-
|
|
|
56
|
-
| ------------- | -------- | ---------------------------------------------------------------------------- |
|
|
57
|
-
| `extractKeys` | function | Extracts the own enumerable keys of a mapped object, typed as its key union. |
|
|
55
|
+
| Name | Kind | Signature | Summary |
|
|
56
|
+
| ------------- | -------- | --------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
57
|
+
| `extractKeys` | function | `<T extends object>(object: T) => ReadonlyArray<keyof T>` | Extracts the own enumerable keys of a mapped object, typed as its key union. |
|
|
58
58
|
|
|
59
59
|
### Classes
|
|
60
60
|
|
|
61
|
-
|
|
|
62
|
-
| --------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
-
| `Emitter` | class | Implements `EmitterInterface` over one listener `Set` per event, so every public method is precisely typed with no assertion. A stateful entity owns one as a `#emitter` field and exposes it through `readonly emitter`; it never inherits from it. |
|
|
61
|
+
| Name | Kind | Signature | Summary |
|
|
62
|
+
| --------- | ----- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| `Emitter` | class | `new <TMap extends EventMap>(options?: EmitterOptions<TMap>) => EmitterInterface<TMap>` | Implements `EmitterInterface` over one listener `Set` per event, so every public method is precisely typed with no assertion. A stateful entity owns one as a `#emitter` field and exposes it through `readonly emitter`; it never inherits from it. |
|
|
64
64
|
|
|
65
65
|
### Types
|
|
66
66
|
|
|
67
67
|
A `Shape` cell holds an interface's data members as bare names in braces, `?` marking an optional member and `plus` introducing its call-signature members, and a type alias's own type literal with a union's arms escaped as `\|`.
|
|
68
68
|
|
|
69
|
-
|
|
|
70
|
-
| --------------------- | --------- |
|
|
71
|
-
| `EventMap` | type | `Record<string, readonly unknown[]>`
|
|
72
|
-
| `EmitterHandler` | type | `(...args: TArgs) => void`
|
|
73
|
-
| `EmitterErrorHandler` | type | `(error: unknown, event: string) => void`
|
|
74
|
-
| `EmitterHooks` | type | `{ readonly [K in keyof TMap]?: EmitterHandler<TMap[K]
|
|
75
|
-
| `EmitterOptions` | interface | `{ on?, error? }`
|
|
76
|
-
| `EmitterInterface` | interface | `{ destroyed
|
|
69
|
+
| Name | Kind | Signature | Summary |
|
|
70
|
+
| --------------------- | --------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| `EventMap` | type | `Record<string, readonly unknown[]>` | Maps each event name to the argument tuple its listeners receive. |
|
|
72
|
+
| `EmitterHandler` | type | `(...args: TArgs) => void` | Represents a listener for one event's argument tuple. |
|
|
73
|
+
| `EmitterErrorHandler` | type | `(error: unknown, event: string) => void` | Represents the emitter's own listener-error handler — the `error` option, invoked when a listener throws during `emit`, with the caught error and the stringified event name. |
|
|
74
|
+
| `EmitterHooks` | type | `{ readonly [K in keyof TMap]?: EmitterHandler<TMap[K]>; }` | Declares the initial event listeners for an emitter — the reserved `on` option: a partial map of event name to its handler, wired at construction. |
|
|
75
|
+
| `EmitterOptions` | interface | `{ on?, error? }` | Configures `createEmitter` and the `Emitter` constructor. |
|
|
76
|
+
| `EmitterInterface` | interface | `{ destroyed, on(), once(), off(), emit(), count(), clear(), destroy() }` | Represents the contract a consumer of an emitter holds: the `destroyed` reading, the `on` / `once` / `off` registration trio, the synchronous `emit`, and the `count` / `clear` / `destroy` set that reports on and releases listeners. |
|
|
77
77
|
|
|
78
78
|
The `destroyed` boolean is a `readonly` data member of `EmitterInterface` (a preceding Surface row) — its call-signature methods are documented under [Methods](#methods).
|
|
79
79
|
|
package/dist/host/guides/form.md
CHANGED
|
@@ -54,7 +54,7 @@ optional member and `plus` introducing its call-signature members, and a type al
|
|
|
54
54
|
literal with a union's arms escaped as `\|`. An extended interface's name comes before `plus`,
|
|
55
55
|
with the members it adds after.
|
|
56
56
|
|
|
57
|
-
|
|
|
57
|
+
| Name | Kind | Signature | Summary |
|
|
58
58
|
| --------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
59
59
|
| `FormSchema` | interface | `{ name?, label?, help?, groups?, fields }` | Describes everything a form asks. |
|
|
60
60
|
| `FormGroup` | interface | `{ name, label, help? }` | Represents a named section of a form. |
|
|
@@ -62,19 +62,19 @@ with the members it adds after.
|
|
|
62
62
|
| `FieldBase` | interface | `{ name, label?, help?, group?, hidden?, disabled?, locked?, rule?, meta? }` | Declares what every field carries, whatever its control. |
|
|
63
63
|
| `FieldControl` | type | `'text' \| 'editor' \| 'password' \| 'number' \| 'date' \| 'time' \| 'datetime' \| 'color' \| 'confirm' \| 'select' \| 'checkbox' \| 'list' \| 'file'` | Names the control a field presents to the person answering it. |
|
|
64
64
|
| `FieldChoice` | interface | `{ value, label, help?, disabled? }` | Represents one option a `select` or `checkbox` field offers. |
|
|
65
|
-
| `TextField` | interface | `
|
|
66
|
-
| `EditorField` | interface | `
|
|
67
|
-
| `PasswordField` | interface | `
|
|
68
|
-
| `NumberField` | interface | `
|
|
69
|
-
| `DateField` | interface | `
|
|
70
|
-
| `TimeField` | interface | `
|
|
71
|
-
| `DatetimeField` | interface | `
|
|
72
|
-
| `ColorField` | interface | `
|
|
73
|
-
| `ConfirmField` | interface | `
|
|
74
|
-
| `SelectField` | interface | `
|
|
75
|
-
| `CheckboxField` | interface | `
|
|
76
|
-
| `ListField` | interface | `
|
|
77
|
-
| `FileField` | interface | `
|
|
65
|
+
| `TextField` | interface | `{ control, default?, placeholder? }` | Represents a single line of text. |
|
|
66
|
+
| `EditorField` | interface | `{ control, default?, placeholder? }` | Represents text over many lines. |
|
|
67
|
+
| `PasswordField` | interface | `{ control, mask? }` | Represents a secret, obscured as it is typed. |
|
|
68
|
+
| `NumberField` | interface | `{ control, default?, placeholder? }` | Represents a number. |
|
|
69
|
+
| `DateField` | interface | `{ control, default? }` | Represents a calendar date, held as the control's own `YYYY-MM-DD` string. |
|
|
70
|
+
| `TimeField` | interface | `{ control, default? }` | Represents a time of day, held as the control's own `HH:MM` string, with seconds optional. |
|
|
71
|
+
| `DatetimeField` | interface | `{ control, default? }` | Represents a date and a time of day together, with no zone, held as the control's own string. |
|
|
72
|
+
| `ColorField` | interface | `{ control, default? }` | Represents a color, held as the control's own six-digit `#rrggbb` string. |
|
|
73
|
+
| `ConfirmField` | interface | `{ control, default? }` | Represents a single on/off box, holding a boolean. |
|
|
74
|
+
| `SelectField` | interface | `{ control, choices, default?, open? }` | Represents one choice out of a list. |
|
|
75
|
+
| `CheckboxField` | interface | `{ control, choices, default? }` | Represents any number of choices out of a list, holding the checked values. |
|
|
76
|
+
| `ListField` | interface | `{ control, default? }` | Represents an ordered list of free-text strings. |
|
|
77
|
+
| `FileField` | interface | `{ control, accept?, multiple? }` | Represents one or more files, by name. |
|
|
78
78
|
|
|
79
79
|
### Answers and rules
|
|
80
80
|
|
|
@@ -84,7 +84,7 @@ A `Shape` cell holds an interface's data members as bare names in braces, `?` ma
|
|
|
84
84
|
optional member and `plus` introducing its call-signature members, and a type alias's own type
|
|
85
85
|
literal with a union's arms escaped as `\|`.
|
|
86
86
|
|
|
87
|
-
|
|
|
87
|
+
| Name | Kind | Signature | Summary |
|
|
88
88
|
| ------------------- | --------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
89
89
|
| `FieldValue` | type | `string \| number \| boolean \| readonly string[]` | Represents every value a field can hold. |
|
|
90
90
|
| `FormValues` | type | `Readonly<Record<string, FieldValue>>` | Represents a form's answers, keyed by field name. |
|
|
@@ -104,20 +104,20 @@ literal with a union's arms escaped as `\|`. A function row's `Shape` cell holds
|
|
|
104
104
|
and a guard row's the type it narrows to. A class row's `Shape` cell holds the interface it
|
|
105
105
|
implements, or its constructor signature where it implements none.
|
|
106
106
|
|
|
107
|
-
|
|
|
108
|
-
| ----------------------- | --------- |
|
|
109
|
-
| `Form` | class | `FormInterface`
|
|
110
|
-
| `FormInterface` | interface | `{ emitter, schema, values, baseline, pending, errors, touched, disabled, status, valid, dirty, answer
|
|
111
|
-
| `createForm` | function | `(schema: FormSchema, options?: FormOptions) => FormInterface`
|
|
112
|
-
| `FormOptions` | interface | `{ on?, error?, values?, messages? }`
|
|
113
|
-
| `FormStatus` | type | `'editing' \| 'settled' \| 'abandoned'`
|
|
114
|
-
| `FormResult` | type | `Result<FormValues, readonly FieldError[]>`
|
|
115
|
-
| `FormSubmission` | interface | `{ values, signal }`
|
|
116
|
-
| `FormPreparationResult` | type | `Result<FormSubmission, readonly FieldError[]>`
|
|
117
|
-
| `FormEventMap` | type | `{ fill, touch
|
|
118
|
-
| `FormError` | class | `new (code: FormErrorCode, message: string, context?: JSONRecord) => FormError`
|
|
119
|
-
| `FormErrorCode` | type | `'SCHEMA' \| 'FIELD' \| 'CONTROL' \| 'SETTLED' \| 'ABANDONED' \| 'PENDING'`
|
|
120
|
-
| `isFormError` | function | `FormError`
|
|
107
|
+
| Name | Kind | Signature | Summary |
|
|
108
|
+
| ----------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
|
109
|
+
| `Form` | class | `new (schema: FormSchema, options?: FormOptions) => FormInterface` | Implements `FormInterface` exactly, over an owned schema, the answers given against it, and the errors they carry. |
|
|
110
|
+
| `FormInterface` | interface | `{ emitter, schema, values, baseline, pending, errors, touched, disabled, status, valid, dirty, answer, field(), fill(), touch(), invalidate(), disable(), enable(), submit(), prepare(), accept(), abort(), clear(), destroy() }` | Declares the contract a form exposes: the state it holds and the calls that move it. |
|
|
111
|
+
| `createForm` | function | `(schema: FormSchema, options?: FormOptions) => FormInterface` | Opens a form against a schema. |
|
|
112
|
+
| `FormOptions` | interface | `{ on?, error?, values?, messages? }` | Describes how to open a form. |
|
|
113
|
+
| `FormStatus` | type | `'editing' \| 'settled' \| 'abandoned'` | Represents where a form sits in its life. |
|
|
114
|
+
| `FormResult` | type | `Result<FormValues, readonly FieldError[]>` | Reports what a submit answers with: the values, or every error that stopped them. |
|
|
115
|
+
| `FormSubmission` | interface | `{ values, signal }` | Carries an owned, frozen answer snapshot and the signal for its pending acknowledgement. |
|
|
116
|
+
| `FormPreparationResult` | type | `Result<FormSubmission, readonly FieldError[]>` | Reports a prepared submission, or every error that prevented its preparation. |
|
|
117
|
+
| `FormEventMap` | type | `{ readonly fill: readonly [name: string, value: FieldValue \| undefined]; readonly touch: readonly [name: string]; readonly validate: readonly [errors: readonly FieldError[]]; readonly disable: readonly [name: string]; readonly enable: readonly [name: string]; readonly submit: readonly [values: FormValues]; readonly prepare: readonly [submission: FormSubmission]; readonly accept: readonly [submission: FormSubmission]; readonly abort: readonly [submission: FormSubmission]; readonly clear: readonly []; readonly abandon: readonly []; }` | Lists everything a form announces. |
|
|
118
|
+
| `FormError` | class | `new (code: FormErrorCode, message: string, context?: JSONRecord) => FormError` | Represents an error raised by the form domain. |
|
|
119
|
+
| `FormErrorCode` | type | `'SCHEMA' \| 'FIELD' \| 'CONTROL' \| 'SETTLED' \| 'ABANDONED' \| 'PENDING'` | Names the machine-readable code a form error carries. |
|
|
120
|
+
| `isFormError` | function | `(input: unknown) => input is FormError` | Determines whether an unknown value is a form error. |
|
|
121
121
|
|
|
122
122
|
`FormInterface`'s readonly data members are the names in its `Shape` cell before `plus`, and they
|
|
123
123
|
stay here rather than in `## Methods`; the call-signature members after `plus` are documented under
|
|
@@ -136,7 +136,7 @@ control; `COLOR_PATTERN`, `DATE_PATTERN`, `TIME_PATTERN`, and `DATETIME_PATTERN`
|
|
|
136
136
|
|
|
137
137
|
A `Shape` cell holds the constant's declared type.
|
|
138
138
|
|
|
139
|
-
|
|
|
139
|
+
| Name | Kind | Signature | Summary |
|
|
140
140
|
| ---------------------- | ----- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
141
141
|
| `FIELD_CONTROLS` | const | `readonly FieldControl[]` | Lists every field control, in the order declared by the public contract. |
|
|
142
142
|
| `FIELD_BASE_KEYS` | const | `readonly string[]` | Lists the members every field declares, whatever its control. |
|
|
@@ -151,15 +151,15 @@ A `Shape` cell holds the constant's declared type.
|
|
|
151
151
|
| `DATE_PATTERN` | const | `Readonly<RegExp>` | Matches an ISO calendar date string in `YYYY-MM-DD` form. |
|
|
152
152
|
| `TIME_PATTERN` | const | `Readonly<RegExp>` | Matches a 24-hour time string with optional seconds. |
|
|
153
153
|
| `DATETIME_PATTERN` | const | `Readonly<RegExp>` | Matches an ISO local date and time string with optional seconds. |
|
|
154
|
-
| `PATTERN_LIMIT` | const | `
|
|
155
|
-
| `FIELD_LIMIT` | const | `
|
|
156
|
-
| `GROUP_LIMIT` | const | `
|
|
157
|
-
| `CHOICE_LIMIT` | const | `
|
|
158
|
-
| `LIST_LIMIT` | const | `
|
|
159
|
-
| `NAME_LIMIT` | const | `
|
|
160
|
-
| `STRING_LIMIT` | const | `
|
|
161
|
-
| `TEXT_LIMIT` | const | `
|
|
162
|
-
| `NODE_LIMIT` | const | `
|
|
154
|
+
| `PATTERN_LIMIT` | const | `256` | Caps the accepted source length for an authored regular expression, at 256. |
|
|
155
|
+
| `FIELD_LIMIT` | const | `512` | Caps the number of fields one schema may declare, at 512. |
|
|
156
|
+
| `GROUP_LIMIT` | const | `64` | Caps the number of groups one schema may declare, at 64. |
|
|
157
|
+
| `CHOICE_LIMIT` | const | `1024` | Caps the number of choices one `select` or `checkbox` field may offer, at 1024. |
|
|
158
|
+
| `LIST_LIMIT` | const | `1024` | Caps the number of entries one list-valued answer may hold, at 1024. |
|
|
159
|
+
| `NAME_LIMIT` | const | `128` | Caps the length, in UTF-16 code units, of a schema, group, or field name, at 128. |
|
|
160
|
+
| `STRING_LIMIT` | const | `65536` | Caps the length, in UTF-16 code units, of any single retained string, at 65536. |
|
|
161
|
+
| `TEXT_LIMIT` | const | `1048576` | Caps the total length, in UTF-16 code units, of every string one schema retains, at 1048576. |
|
|
162
|
+
| `NODE_LIMIT` | const | `16384` | Caps the total number of records, arrays, and leaves one schema retains, at 16384. |
|
|
163
163
|
|
|
164
164
|
### Guards
|
|
165
165
|
|
|
@@ -170,18 +170,18 @@ also refuses a number that is not finite, so `NaN` and `Infinity` are not field
|
|
|
170
170
|
|
|
171
171
|
In a guard table a `Shape` cell holds the type the guard narrows to.
|
|
172
172
|
|
|
173
|
-
|
|
|
174
|
-
| ---------------- | -------- |
|
|
175
|
-
| `isFieldControl` | function | `FieldControl` | Determines whether an unknown value is a declared field control. |
|
|
176
|
-
| `isFormStatus` | function | `FormStatus` | Determines whether an unknown value is a form lifecycle status. |
|
|
177
|
-
| `isFieldValue` | function | `FieldValue` | Determines whether an unknown value has a form field value shape. |
|
|
178
|
-
| `isFieldChoice` | function | `FieldChoice` | Determines whether an unknown value is one exact field choice record. |
|
|
179
|
-
| `isFieldRule` | function | `FieldRule` | Determines whether an unknown value is one exact field rule record. |
|
|
180
|
-
| `isFormField` | function | `FormField` | Determines whether an unknown value is one exact discriminated form field. |
|
|
181
|
-
| `isFormGroup` | function | `FormGroup` | Determines whether an unknown value is one exact form group record. |
|
|
182
|
-
| `isFormSchema` | function | `FormSchema` | Determines whether an unknown value is one exact structural form schema. |
|
|
183
|
-
| `isFormValues` | function | `FormValues` | Determines whether an unknown value is a record of field values. |
|
|
184
|
-
| `isFieldError` | function | `FieldError` | Determines whether an unknown value is one exact field error record. |
|
|
173
|
+
| Name | Kind | Signature | Summary |
|
|
174
|
+
| ---------------- | -------- | ------------------------------------------- | -------------------------------------------------------------------------- |
|
|
175
|
+
| `isFieldControl` | function | `(input: unknown) => input is FieldControl` | Determines whether an unknown value is a declared field control. |
|
|
176
|
+
| `isFormStatus` | function | `(input: unknown) => input is FormStatus` | Determines whether an unknown value is a form lifecycle status. |
|
|
177
|
+
| `isFieldValue` | function | `(input: unknown) => input is FieldValue` | Determines whether an unknown value has a form field value shape. |
|
|
178
|
+
| `isFieldChoice` | function | `(input: unknown) => input is FieldChoice` | Determines whether an unknown value is one exact field choice record. |
|
|
179
|
+
| `isFieldRule` | function | `(input: unknown) => input is FieldRule` | Determines whether an unknown value is one exact field rule record. |
|
|
180
|
+
| `isFormField` | function | `(input: unknown) => input is FormField` | Determines whether an unknown value is one exact discriminated form field. |
|
|
181
|
+
| `isFormGroup` | function | `(input: unknown) => input is FormGroup` | Determines whether an unknown value is one exact form group record. |
|
|
182
|
+
| `isFormSchema` | function | `(input: unknown) => input is FormSchema` | Determines whether an unknown value is one exact structural form schema. |
|
|
183
|
+
| `isFormValues` | function | `(input: unknown) => input is FormValues` | Determines whether an unknown value is a record of field values. |
|
|
184
|
+
| `isFieldError` | function | `(input: unknown) => input is FieldError` | Determines whether an unknown value is one exact field error record. |
|
|
185
185
|
|
|
186
186
|
### Helpers
|
|
187
187
|
|
|
@@ -189,26 +189,26 @@ The pure leaves the form composes: the prototype-safe record write, `createField
|
|
|
189
189
|
failure builder, the control shape test, the evaluation engine, the derivations, and the wire
|
|
190
190
|
projection.
|
|
191
191
|
|
|
192
|
-
|
|
|
193
|
-
| ------------------ | -------- | ------------------------------------------------------------------------------- |
|
|
194
|
-
| `defineEntry` | function | Writes one own enumerable data property onto a record. |
|
|
195
|
-
| `freezeEntry` | function | Writes one own enumerable data property that cannot be rewritten or removed. |
|
|
196
|
-
| `matchesField` | function | Checks whether a value has the shape required by one field control. |
|
|
197
|
-
| `matchesAnswer` | function | Decides whether a raw binding value projects to an answered field. |
|
|
198
|
-
| `appliesRule` | function | Checks whether a named rule applies to one field control. |
|
|
199
|
-
| `evaluateField` | function | Evaluates one field rule against its current value. |
|
|
200
|
-
| `evaluateForm` | function | Evaluates every active field in schema order. |
|
|
201
|
-
| `computeDefaults` | function | Computes the values explicitly seeded by a schema. |
|
|
202
|
-
| `matchesValue` | function | Compares two field values by scalar identity or ordered list content. |
|
|
203
|
-
| `extractChanges` | function | Extracts the names whose answers differ between two form value records. |
|
|
204
|
-
| `matchesValues` | function | Compares two form value records by keys and value content. |
|
|
205
|
-
| `formatMessage` | function | Resolves and interpolates one rule message. |
|
|
206
|
-
| `createFieldError` | function | Creates one named-rule failure against a field. |
|
|
207
|
-
| `serializeForm` | function | Projects a schema into JSON while removing custom validators and absent values. |
|
|
208
|
-
| `extractGroups` | function | Selects referenced groups in first-reference field order. |
|
|
209
|
-
| `auditSchema` | function | Audits a structurally valid schema for domain invariants. |
|
|
210
|
-
| `failsFieldBound` | function | Checks whether a field value violates a numeric or temporal bound. |
|
|
211
|
-
| `failsTextRule` | function | Checks whether text violates an enabled lexical field rule. |
|
|
192
|
+
| Name | Kind | Signature | Summary |
|
|
193
|
+
| ------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
194
|
+
| `defineEntry` | function | `<T>(target: Record<string, T>, name: string, value: T) => void` | Writes one own enumerable data property onto a record. |
|
|
195
|
+
| `freezeEntry` | function | `<T>(target: Record<string, T>, name: string, value: T) => void` | Writes one own enumerable data property that cannot be rewritten or removed. |
|
|
196
|
+
| `matchesField` | function | `(field: FormField, value: unknown) => value is FieldValue` | Checks whether a value has the shape required by one field control. |
|
|
197
|
+
| `matchesAnswer` | function | `(value: FieldValue \| undefined) => boolean` | Decides whether a raw binding value projects to an answered field. |
|
|
198
|
+
| `appliesRule` | function | `(control: FieldControl, rule: FieldRuleName) => boolean` | Checks whether a named rule applies to one field control. |
|
|
199
|
+
| `evaluateField` | function | `(field: FormField, value: FieldValue \| undefined, values: FormValues, messages?: Readonly<Partial<Record<FieldRuleName, string>>>) => readonly FieldError[]` | Evaluates one field rule against its current value. |
|
|
200
|
+
| `evaluateForm` | function | `(schema: FormSchema, values: FormValues, options?: EvaluationOptions) => readonly FieldError[]` | Evaluates every active field in schema order. |
|
|
201
|
+
| `computeDefaults` | function | `(schema: FormSchema) => FormValues` | Computes the values explicitly seeded by a schema. |
|
|
202
|
+
| `matchesValue` | function | `(a: FieldValue, b: FieldValue) => boolean` | Compares two field values by scalar identity or ordered list content. |
|
|
203
|
+
| `extractChanges` | function | `(current: FormValues, opened: FormValues) => ReadonlySet<string>` | Extracts the names whose answers differ between two form value records. |
|
|
204
|
+
| `matchesValues` | function | `(a: FormValues, b: FormValues) => boolean` | Compares two form value records by keys and value content. |
|
|
205
|
+
| `formatMessage` | function | `(rule: FieldRuleName, limit?: number \| string, messages?: Readonly<Partial<Record<FieldRuleName, string>>>) => string` | Resolves and interpolates one rule message. |
|
|
206
|
+
| `createFieldError` | function | `(field: FormField, rule: FieldRuleName, limit: number \| string \| undefined, messages?: Readonly<Partial<Record<FieldRuleName, string>>>) => FieldError` | Creates one named-rule failure against a field. |
|
|
207
|
+
| `serializeForm` | function | `(schema: FormSchema) => JSONRecord` | Projects a schema into JSON while removing custom validators and absent values. |
|
|
208
|
+
| `extractGroups` | function | `(schema: FormSchema) => readonly FormGroup[]` | Selects referenced groups in first-reference field order. |
|
|
209
|
+
| `auditSchema` | function | `(schema: FormSchema) => readonly string[]` | Audits a structurally valid schema for domain invariants. |
|
|
210
|
+
| `failsFieldBound` | function | `(field: FormField, value: FieldValue \| undefined, rule: FieldRule, minimum: boolean) => boolean` | Checks whether a field value violates a numeric or temporal bound. |
|
|
211
|
+
| `failsTextRule` | function | `(rule: FieldRule, constraint: FieldRuleName, entry: string) => boolean` | Checks whether text violates an enabled lexical field rule. |
|
|
212
212
|
|
|
213
213
|
The evaluation engine exposes its bound and lexical predicates for independent rule checks.
|
|
214
214
|
The boolean selects the minimum bound when true and the maximum bound when false.
|
|
@@ -226,45 +226,45 @@ Owned frozen snapshots. The form takes one of the schema at construction, so a l
|
|
|
226
226
|
schema the caller passed changes nothing inside the form, and no list the form hands back is a live
|
|
227
227
|
internal reference.
|
|
228
228
|
|
|
229
|
-
|
|
|
230
|
-
| ----------------- | -------- | ------------------------------------------------------- |
|
|
231
|
-
| `cloneValue` | function | Clones one form value into an owned frozen snapshot. |
|
|
232
|
-
| `cloneChoices` | function | Clones a field's choices into an owned frozen snapshot. |
|
|
233
|
-
| `cloneFormField` | function | Clones one form field into an owned frozen snapshot. |
|
|
234
|
-
| `cloneFormSchema` | function | Clones a form schema into an owned frozen snapshot. |
|
|
229
|
+
| Name | Kind | Signature | Summary |
|
|
230
|
+
| ----------------- | -------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
231
|
+
| `cloneValue` | function | `((value: readonly string[]) => readonly string[]) & ((value: FieldValue) => FieldValue)` | Clones one form value into an owned frozen snapshot. |
|
|
232
|
+
| `cloneChoices` | function | `(choices: readonly FieldChoice[]) => readonly FieldChoice[]` | Clones a field's choices into an owned frozen snapshot. |
|
|
233
|
+
| `cloneFormField` | function | `(field: FormField) => FormField` | Clones one form field into an owned frozen snapshot. |
|
|
234
|
+
| `cloneFormSchema` | function | `(schema: FormSchema) => FormSchema` | Clones a form schema into an owned frozen snapshot. |
|
|
235
235
|
|
|
236
236
|
### Parsers
|
|
237
237
|
|
|
238
238
|
The wire boundary. Each returns `undefined` on refusal rather than throwing, and each returns an
|
|
239
239
|
owned value rather than the caller's.
|
|
240
240
|
|
|
241
|
-
|
|
|
242
|
-
| ------------- | -------- | ----------------------------------------------------------------------- |
|
|
243
|
-
| `parseForm` | function | Parses unknown wire data into an owned, semantically sound form schema. |
|
|
244
|
-
| `parseValue` | function | Parses one answer against its field control. |
|
|
245
|
-
| `parseValues` | function | Parses a strict answer record against the fields declared by a schema. |
|
|
241
|
+
| Name | Kind | Signature | Summary |
|
|
242
|
+
| ------------- | -------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
243
|
+
| `parseForm` | function | `(input: unknown) => FormSchema \| undefined` | Parses unknown wire data into an owned, semantically sound form schema. |
|
|
244
|
+
| `parseValue` | function | `(field: FormField, input: unknown) => FieldValue \| undefined` | Parses one answer against its field control. |
|
|
245
|
+
| `parseValues` | function | `(schema: FormSchema, input: unknown) => FormValues \| undefined` | Parses a strict answer record against the fields declared by a schema. |
|
|
246
246
|
|
|
247
247
|
### Native browser binding
|
|
248
248
|
|
|
249
249
|
The browser entry publishes the controlled native form and its host readers.
|
|
250
250
|
|
|
251
|
-
|
|
|
252
|
-
| ---------------------- | --------- |
|
|
253
|
-
| `FormControl` | type | `HTMLInputElement
|
|
254
|
-
| `FormBindingErrorCode` | type | `'CONTROL'
|
|
255
|
-
| `FormBindingEventMap` | type | `{ render
|
|
256
|
-
| `FormBindingOptions` | interface | `{ feedback?, summary?, presentations?, defer?, on?, error? }`
|
|
257
|
-
| `FormBindingInterface` | interface | `{ element, document, destroyed, emitter
|
|
258
|
-
| `FormBindingAttribute` | interface | `{ original, value }`
|
|
259
|
-
| `FormBindingValidity` | interface | `{ original, value }`
|
|
260
|
-
| `FormBinding` | class | `FormBindingInterface`
|
|
261
|
-
| `FormBindingError` | class | `
|
|
262
|
-
| `createFormBinding` | function | `(element, document, options
|
|
263
|
-
| `isFormBindingError` | function | `(value: unknown) => value is FormBindingError`
|
|
264
|
-
| `isFormControl` | function | `(value: unknown) => value is FormControl`
|
|
265
|
-
| `matchesFormControls` | function | `(field, controls) => boolean`
|
|
266
|
-
| `readNativeMessages` | function | `(control, errors) => readonly string[]`
|
|
267
|
-
| `readFormControls` | function | `(field, controls) => FieldValue
|
|
251
|
+
| Name | Kind | Signature | Summary |
|
|
252
|
+
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
253
|
+
| `FormControl` | type | `HTMLInputElement \| HTMLSelectElement \| HTMLTextAreaElement` | Represents a native answer control admitted by the binding. |
|
|
254
|
+
| `FormBindingErrorCode` | type | `'CONTROL' \| 'PENDING' \| 'DOM'` | Names a native binding refusal. |
|
|
255
|
+
| `FormBindingEventMap` | type | `{ readonly render: readonly []; readonly write: readonly [control: FormControl]; readonly submit: readonly [submission: FormSubmission, submitter: HTMLElement \| undefined]; readonly error: readonly [error: unknown]; }` | Lists the native binding's notifications after their associated DOM effects. |
|
|
256
|
+
| `FormBindingOptions` | interface | `{ feedback?, summary?, presentations?, defer?, on?, error? }` | Configures neutral feedback destinations and isolated event listeners. |
|
|
257
|
+
| `FormBindingInterface` | interface | `{ element, document, destroyed, emitter, read(), refresh(), destroy() }` | Declares a native form's borrowed document and synchronization lifecycle. |
|
|
258
|
+
| `FormBindingAttribute` | interface | `{ original, value }` | Records an attribute's authored value and the binding's last contribution. |
|
|
259
|
+
| `FormBindingValidity` | interface | `{ original, value }` | Records the binding's custom-validity contribution beside the authored message. |
|
|
260
|
+
| `FormBinding` | class | `new (element: HTMLFormElement, document: FormInterface, options?: FormBindingOptions) => FormBindingInterface` | Implements a controlled native form over a borrowed document. |
|
|
261
|
+
| `FormBindingError` | class | `new (code: FormBindingErrorCode, message: string, context?: Readonly<Record<string, unknown>>) => FormBindingError` | Reports an incompatible control, overlapping submission, or native DOM failure. |
|
|
262
|
+
| `createFormBinding` | function | `(element: HTMLFormElement, document: FormInterface, options?: FormBindingOptions) => FormBindingInterface` | Creates a native form binding exposed through its lifecycle interface. |
|
|
263
|
+
| `isFormBindingError` | function | `(value: unknown) => value is FormBindingError` | Checks whether a value is a native binding refusal. |
|
|
264
|
+
| `isFormControl` | function | `(value: unknown) => value is FormControl` | Checks whether a value is a native answer control. |
|
|
265
|
+
| `matchesFormControls` | function | `(field: FormField, controls: readonly FormControl[]) => boolean` | Checks a native control population against a field's declared value shape. |
|
|
266
|
+
| `readNativeMessages` | function | `(control: FormControl, errors: readonly FieldError[]) => readonly string[]` | Reads native constraint messages not already reported by document rules. |
|
|
267
|
+
| `readFormControls` | function | `(field: FormField, controls: readonly FormControl[]) => FieldValue \| undefined` | Reads one compatible native population using the document's blank-to-absence semantics. |
|
|
268
268
|
|
|
269
269
|
The standalone reader uses the same admission rules as the binding.
|
|
270
270
|
|