@orkestrel/scaffold 0.0.115 → 0.0.116

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 (70) hide show
  1. package/dist/bin/main.js +137 -15
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +1 -1
  4. package/dist/host/claude/agents/orkestrel.md +1 -1
  5. package/dist/host/claude/rules/names.md +3 -1
  6. package/dist/host/guides/abort.md +17 -17
  7. package/dist/host/guides/agent.md +445 -445
  8. package/dist/host/guides/brief.md +143 -143
  9. package/dist/host/guides/browser.md +731 -731
  10. package/dist/host/guides/budget.md +39 -39
  11. package/dist/host/guides/capture.md +298 -298
  12. package/dist/host/guides/console.md +109 -109
  13. package/dist/host/guides/contract.md +335 -335
  14. package/dist/host/guides/csv.md +30 -30
  15. package/dist/host/guides/database.md +163 -163
  16. package/dist/host/guides/emitter.md +17 -17
  17. package/dist/host/guides/form.md +99 -99
  18. package/dist/host/guides/guide.md +361 -183
  19. package/dist/host/guides/html.md +49 -49
  20. package/dist/host/guides/indexeddb.md +40 -40
  21. package/dist/host/guides/interpret.md +139 -139
  22. package/dist/host/guides/lsp.md +114 -114
  23. package/dist/host/guides/markdown.md +68 -68
  24. package/dist/host/guides/mcp.md +3745 -3745
  25. package/dist/host/guides/middleware.md +170 -170
  26. package/dist/host/guides/msg.md +95 -95
  27. package/dist/host/guides/ndjson.md +8 -8
  28. package/dist/host/guides/ollama.md +56 -56
  29. package/dist/host/guides/pool.md +21 -21
  30. package/dist/host/guides/probe.md +82 -82
  31. package/dist/host/guides/process.md +99 -99
  32. package/dist/host/guides/program.md +98 -96
  33. package/dist/host/guides/qualifier.md +70 -70
  34. package/dist/host/guides/queue.md +37 -37
  35. package/dist/host/guides/rater.md +38 -38
  36. package/dist/host/guides/reason.md +308 -308
  37. package/dist/host/guides/relation.md +50 -50
  38. package/dist/host/guides/router.md +58 -58
  39. package/dist/host/guides/scaffold.md +554 -419
  40. package/dist/host/guides/sea.md +128 -128
  41. package/dist/host/guides/server.md +100 -100
  42. package/dist/host/guides/sqlite.md +28 -28
  43. package/dist/host/guides/sse.md +20 -20
  44. package/dist/host/guides/study.md +444 -444
  45. package/dist/host/guides/table.md +82 -82
  46. package/dist/host/guides/template.md +41 -41
  47. package/dist/host/guides/terminal.md +121 -121
  48. package/dist/host/guides/test.md +273 -273
  49. package/dist/host/guides/timeout.md +18 -18
  50. package/dist/host/guides/tool.md +27 -27
  51. package/dist/host/guides/toolbox.md +166 -166
  52. package/dist/host/guides/websocket.md +54 -54
  53. package/dist/host/guides/worker.md +24 -24
  54. package/dist/host/guides/workflow.md +187 -187
  55. package/dist/host/guides/workspace.md +55 -55
  56. package/dist/host/manifest.json +55 -55
  57. package/dist/host/tests/setupPolicy.ts +5 -3
  58. package/dist/src/core/index.cjs +89 -3
  59. package/dist/src/core/index.cjs.map +1 -1
  60. package/dist/src/core/index.d.cts +229 -144
  61. package/dist/src/core/index.d.ts +229 -144
  62. package/dist/src/core/index.js +87 -4
  63. package/dist/src/core/index.js.map +1 -1
  64. package/dist/src/server/index.cjs +292 -66
  65. package/dist/src/server/index.cjs.map +1 -1
  66. package/dist/src/server/index.d.cts +188 -6
  67. package/dist/src/server/index.d.ts +188 -6
  68. package/dist/src/server/index.js +287 -69
  69. package/dist/src/server/index.js.map +1 -1
  70. package/package.json +4 -3
@@ -46,34 +46,34 @@ The reserved `on` option wires initial listeners at construction; the optional `
46
46
 
47
47
  ### Factories
48
48
 
49
- | API | Kind | Summary |
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
- | API | Kind | Summary |
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
- | API | Kind | Summary |
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
- | Type | Kind | Shape | 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 } plus 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. |
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
 
@@ -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
- | API | Kind | Shape | Summary |
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 | `FieldBase plus { control, default?, placeholder? }` | Represents a single line of text. |
66
- | `EditorField` | interface | `FieldBase plus { control, default?, placeholder? }` | Represents text over many lines. |
67
- | `PasswordField` | interface | `FieldBase plus { control, mask? }` | Represents a secret, obscured as it is typed. |
68
- | `NumberField` | interface | `FieldBase plus { control, default?, placeholder? }` | Represents a number. |
69
- | `DateField` | interface | `FieldBase plus { control, default? }` | Represents a calendar date, held as the control's own `YYYY-MM-DD` string. |
70
- | `TimeField` | interface | `FieldBase plus { control, default? }` | Represents a time of day, held as the control's own `HH:MM` string, with seconds optional. |
71
- | `DatetimeField` | interface | `FieldBase plus { control, default? }` | Represents a date and a time of day together, with no zone, held as the control's own string. |
72
- | `ColorField` | interface | `FieldBase plus { control, default? }` | Represents a color, held as the control's own six-digit `#rrggbb` string. |
73
- | `ConfirmField` | interface | `FieldBase plus { control, default? }` | Represents a single on/off box, holding a boolean. |
74
- | `SelectField` | interface | `FieldBase plus { control, choices, default?, open? }` | Represents one choice out of a list. |
75
- | `CheckboxField` | interface | `FieldBase plus { control, choices, default? }` | Represents any number of choices out of a list, holding the checked values. |
76
- | `ListField` | interface | `FieldBase plus { control, default? }` | Represents an ordered list of free-text strings. |
77
- | `FileField` | interface | `FieldBase plus { control, accept?, multiple? }` | Represents one or more files, by name. |
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
- | API | Kind | Shape | Summary |
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
- | API | Kind | Shape | Summary |
108
- | ----------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
109
- | `Form` | class | `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 } plus 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 | `{ fill, touch, validate, disable, enable, submit, prepare, accept, abort, clear, abandon }` | 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 | `FormError` | Determines whether an unknown value is a form error. |
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
- | API | Kind | Shape | Summary |
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 | `number` | Caps the accepted source length for an authored regular expression, at 256. |
155
- | `FIELD_LIMIT` | const | `number` | Caps the number of fields one schema may declare, at 512. |
156
- | `GROUP_LIMIT` | const | `number` | Caps the number of groups one schema may declare, at 64. |
157
- | `CHOICE_LIMIT` | const | `number` | Caps the number of choices one `select` or `checkbox` field may offer, at 1024. |
158
- | `LIST_LIMIT` | const | `number` | Caps the number of entries one list-valued answer may hold, at 1024. |
159
- | `NAME_LIMIT` | const | `number` | Caps the length, in UTF-16 code units, of a schema, group, or field name, at 128. |
160
- | `STRING_LIMIT` | const | `number` | Caps the length, in UTF-16 code units, of any single retained string, at 65536. |
161
- | `TEXT_LIMIT` | const | `number` | Caps the total length, in UTF-16 code units, of every string one schema retains, at 1048576. |
162
- | `NODE_LIMIT` | const | `number` | Caps the total number of records, arrays, and leaves one schema retains, at 16384. |
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
- | API | Kind | Shape | Summary |
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
- | API | Kind | Summary |
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
- | API | Kind | Summary |
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
- | API | Kind | Summary |
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
- | Symbol | Kind | Shape | Summary |
252
- | ---------------------- | --------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
253
- | `FormControl` | type | `HTMLInputElement` or `HTMLSelectElement` or `HTMLTextAreaElement` | Represents a native answer control admitted by the binding. |
254
- | `FormBindingErrorCode` | type | `'CONTROL'` or `'PENDING'` or `'DOM'` | Names a native binding refusal. |
255
- | `FormBindingEventMap` | type | `{ render, write, submit, error }` | 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 } plus 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 | `FormBindingInterface` | Implements a controlled native form over a borrowed document. |
261
- | `FormBindingError` | class | `{ code, context }` | Reports an incompatible control, overlapping submission, or native DOM failure. |
262
- | `createFormBinding` | function | `(element, document, options?) => 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, controls) => boolean` | Checks a native control population against a field's declared value shape. |
266
- | `readNativeMessages` | function | `(control, errors) => readonly string[]` | Reads native constraint messages not already reported by document rules. |
267
- | `readFormControls` | function | `(field, controls) => FieldValue or undefined` | Reads one compatible native population using the document's blank-to-absence semantics. |
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