@cat-factory/contracts 0.229.0 → 0.230.1
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/entities.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/execution.d.ts +2 -2
- package/dist/execution.js +2 -2
- package/dist/form-fields.d.ts +203 -0
- package/dist/form-fields.d.ts.map +1 -0
- package/dist/form-fields.js +315 -0
- package/dist/form-fields.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/initiative-preset.d.ts +34 -93
- package/dist/initiative-preset.d.ts.map +1 -1
- package/dist/initiative-preset.js +30 -182
- package/dist/initiative-preset.js.map +1 -1
- package/dist/initiative.d.ts +14 -9
- package/dist/initiative.d.ts.map +1 -1
- package/dist/initiative.js +15 -15
- package/dist/initiative.js.map +1 -1
- package/dist/input-gate.js +1 -1
- package/dist/input-gate.js.map +1 -1
- package/dist/merge.d.ts +2 -2
- package/dist/merge.js +2 -2
- package/dist/primitives.d.ts +10 -5
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +11 -5
- package/dist/primitives.js.map +1 -1
- package/dist/public-decisions.d.ts +2 -2
- package/dist/public-decisions.js +3 -3
- package/dist/public-decisions.js.map +1 -1
- package/dist/requests.d.ts +1 -1
- package/dist/routes/board.d.ts +14 -14
- package/dist/routes/bug-hunt.d.ts +2 -2
- package/dist/routes/execution.d.ts +2 -2
- package/dist/routes/initiative.d.ts +17 -17
- package/dist/routes/input-gate.js +2 -2
- package/dist/routes/input-gate.js.map +1 -1
- package/dist/routes/public-decisions.d.ts +1 -1
- package/dist/routes/public-decisions.js +2 -2
- package/dist/routes/public-decisions.js.map +1 -1
- package/dist/routes/tasks.d.ts +3 -3
- package/dist/routes/workspaces.d.ts +42 -26
- package/dist/routes/workspaces.d.ts.map +1 -1
- package/dist/snapshot.d.ts +21 -13
- package/dist/snapshot.d.ts.map +1 -1
- package/dist/task-types.d.ts +42 -28
- package/dist/task-types.d.ts.map +1 -1
- package/dist/task-types.js +30 -25
- package/dist/task-types.js.map +1 -1
- package/dist/workspace-settings.d.ts +1 -1
- package/dist/workspace-settings.js +1 -1
- package/package.json +1 -1
package/dist/entities.d.ts
CHANGED
|
@@ -223,7 +223,7 @@ export declare const blockSchema: v.ObjectSchema<{
|
|
|
223
223
|
readonly prNumber: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
224
224
|
readonly prUrl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 500, undefined>]>, undefined>;
|
|
225
225
|
readonly reviewFocus: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4000, undefined>]>, undefined>;
|
|
226
|
-
readonly custom: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, undefined>;
|
|
226
|
+
readonly custom: v.OptionalSchema<v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>, v.MaxLengthAction<string[], 50, undefined>]>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, undefined>;
|
|
227
227
|
}, undefined>, undefined>, undefined>;
|
|
228
228
|
/**
|
|
229
229
|
* Whether this task is purely TECHNICAL (a refactor / non-functional / internal change
|
package/dist/errors.js
CHANGED
|
@@ -171,7 +171,7 @@ export const CONFLICT_REASONS = [
|
|
|
171
171
|
// useful to a headless integration: a redelivered webhook reads it as "already filed" and
|
|
172
172
|
// follows the existing task instead of filing a duplicate.
|
|
173
173
|
'ticket_already_linked',
|
|
174
|
-
// A caller tried to resolve a run's PRE-
|
|
174
|
+
// A caller tried to resolve a run's PRE-DISPATCH INPUT GATE that is not (or is no longer) parked
|
|
175
175
|
// on it: the gate passed, the workspace has it off, or another surface already answered it.
|
|
176
176
|
// The remedy is "nothing to do here": the SPA refreshes the run rather than re-offering a
|
|
177
177
|
// decision that has already been taken.
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,WAAW;IACX,YAAY;IACZ,UAAU;IACV,qBAAqB;IACrB,WAAW;IACX,aAAa;IACb,cAAc;IACd,cAAc;CACN,CAAA;AAIV;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,kBAAkB,EAAE,UAAU,CAAU,CAAA;AAI3E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,wBAAwB;IACxB,8FAA8F;IAC9F,4FAA4F;IAC5F,+FAA+F;IAC/F,8EAA8E;IAC9E,sBAAsB;IACtB,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;IAC1B,6BAA6B;IAC7B,4BAA4B;IAC5B,mBAAmB;IACnB,gBAAgB;IAChB,6FAA6F;IAC7F,uFAAuF;IACvF,4FAA4F;IAC5F,0BAA0B;IAC1B,uBAAuB;IACvB,sBAAsB;IACtB,yBAAyB;IACzB,6BAA6B;IAC7B,kFAAkF;IAClF,kFAAkF;IAClF,0BAA0B;IAC1B,4FAA4F;IAC5F,uFAAuF;IACvF,6B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0E;IAC1E,EAAE;IACF,8FAA8F;IAC9F,4FAA4F;IAC5F,4FAA4F;IAC5F,wFAAwF;IACxF,wDAAwD;IACxD,iCAAiC;IACjC,4FAA4F;IAC5F,uFAAuF;IACvF,uFAAuF;IACvF,2FAA2F;IAC3F,yFAAyF;IACzF,8DAA8D;IAC9D,oCAAoC;IACpC,0FAA0F;IAC1F,wFAAwF;IACxF,gFAAgF;IAChF,4FAA4F;IAC5F,0FAA0F;IAC1F,2DAA2D;IAC3D,uBAAuB;IACvB,iGAAiG;IACjG,4FAA4F;IAC5F,0FAA0F;IAC1F,wCAAwC;IACxC,uBAAuB;IACvB,gGAAgG;IAChG,4FAA4F;IAC5F,+FAA+F;IAC/F,4EAA4E;IAC5E,EAAE;IACF,2FAA2F;IAC3F,iGAAiG;IACjG,4FAA4F;IAC5F,sEAAsE;IACtE,mBAAmB;CACX,CAAA;AAIV;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,+BAA+B;IAC/B,mCAAmC;CAC3B,CAAA;AAIV;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,qBAAqB,EAAE,yBAAyB,CAAU,CAAA"}
|
package/dist/execution.d.ts
CHANGED
|
@@ -2409,7 +2409,7 @@ export type IntakeOrigin = v.InferOutput<typeof intakeOriginSchema>;
|
|
|
2409
2409
|
* pull request, so the human sees a real diff on a real branch, but nothing merges — neither the
|
|
2410
2410
|
* `merger` step's auto-merge nor the manual merge endpoint.
|
|
2411
2411
|
*
|
|
2412
|
-
* The PR is deliberately still opened. The deliverable a non-
|
|
2412
|
+
* The PR is deliberately still opened. The deliverable a non-developer initiator needs to SEE is the diff,
|
|
2413
2413
|
* and withholding the push would leave them reading prose about work they cannot inspect; what
|
|
2414
2414
|
* makes the mode a sandbox is that the change cannot reach the default branch, not that it stays
|
|
2415
2415
|
* invisible.
|
|
@@ -4309,7 +4309,7 @@ export declare const executionInstanceSchema: v.ObjectSchema<{
|
|
|
4309
4309
|
}, undefined>, undefined>;
|
|
4310
4310
|
}, undefined>, undefined>;
|
|
4311
4311
|
/**
|
|
4312
|
-
* The PRE-
|
|
4312
|
+
* The PRE-DISPATCH INPUT GATE's verdict on the task this run implements (see
|
|
4313
4313
|
* {@link runInputGateSchema}): the structural check of the authored input that runs before
|
|
4314
4314
|
* the first agent step is dispatched, so a task nobody could act on parks having spent no
|
|
4315
4315
|
* tokens at all.
|
package/dist/execution.js
CHANGED
|
@@ -1207,7 +1207,7 @@ export const intakeOriginSchema = v.picklist(['ui', 'public-api']);
|
|
|
1207
1207
|
* pull request, so the human sees a real diff on a real branch, but nothing merges — neither the
|
|
1208
1208
|
* `merger` step's auto-merge nor the manual merge endpoint.
|
|
1209
1209
|
*
|
|
1210
|
-
* The PR is deliberately still opened. The deliverable a non-
|
|
1210
|
+
* The PR is deliberately still opened. The deliverable a non-developer initiator needs to SEE is the diff,
|
|
1211
1211
|
* and withholding the push would leave them reading prose about work they cannot inspect; what
|
|
1212
1212
|
* makes the mode a sandbox is that the change cannot reach the default branch, not that it stays
|
|
1213
1213
|
* invisible.
|
|
@@ -1382,7 +1382,7 @@ export const executionInstanceSchema = v.object({
|
|
|
1382
1382
|
*/
|
|
1383
1383
|
diagnostics: v.optional(runDiagnosticsSchema),
|
|
1384
1384
|
/**
|
|
1385
|
-
* The PRE-
|
|
1385
|
+
* The PRE-DISPATCH INPUT GATE's verdict on the task this run implements (see
|
|
1386
1386
|
* {@link runInputGateSchema}): the structural check of the authored input that runs before
|
|
1387
1387
|
* the first agent step is dispatched, so a task nobody could act on parks having spent no
|
|
1388
1388
|
* tokens at all.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
/** Bound on a field `key`, and on a key in a filled {@link descriptorFieldValuesSchema} bag. */
|
|
3
|
+
export declare const DESCRIPTOR_FIELD_KEY_MAX = 80;
|
|
4
|
+
/** Bound on a single string / string-array element value. */
|
|
5
|
+
export declare const DESCRIPTOR_FIELD_VALUE_MAX = 2000;
|
|
6
|
+
/** Bound on the number of elements in a `checkbox-group` (multi-value) answer. */
|
|
7
|
+
export declare const DESCRIPTOR_FIELD_ARRAY_MAX = 50;
|
|
8
|
+
/** One filled value: a scalar (`text`/`select`/`path`/…), a multi-select, a toggle, or a number. */
|
|
9
|
+
export declare const descriptorFieldValueSchema: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>, v.MaxLengthAction<string[], 50, undefined>]>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>;
|
|
10
|
+
export type DescriptorFieldValue = v.InferOutput<typeof descriptorFieldValueSchema>;
|
|
11
|
+
/** A filled descriptor form: a bounded map from field `key` to its value. */
|
|
12
|
+
export declare const descriptorFieldValuesSchema: v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>, v.MaxLengthAction<string[], 50, undefined>]>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
13
|
+
export type DescriptorFieldValues = v.InferOutput<typeof descriptorFieldValuesSchema>;
|
|
14
|
+
/**
|
|
15
|
+
* How a field is rendered and collected. The first six mirror `ProviderConfigField`'s types
|
|
16
|
+
* exactly; `checkbox-group` (a multi-select, value `string[]`) and `path` (a repo-relative
|
|
17
|
+
* directory, {@link isSafeRepoDirPath}-validated) are the two the preset form added.
|
|
18
|
+
*
|
|
19
|
+
* A surface may admit a SUBSET (each declares its own picklist over these members) but never a
|
|
20
|
+
* member outside them: the renderer and the validators below switch over exactly this union.
|
|
21
|
+
*/
|
|
22
|
+
export declare const descriptorFieldTypeSchema: v.PicklistSchema<["text", "password", "select", "number", "checkbox", "textarea", "checkbox-group", "path"], undefined>;
|
|
23
|
+
export type DescriptorFieldType = v.InferOutput<typeof descriptorFieldTypeSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* Single-condition visibility for a field: it renders only when the referenced field's value
|
|
26
|
+
* matches. `equals` compares a scalar value; `includes` tests membership in a `checkbox-group`
|
|
27
|
+
* value ("show `diagramsDir` only when `docTypes` includes `diagrams`"). Deliberately ONE
|
|
28
|
+
* condition: resist growing this into a recursive schema renderer (that is the descriptor-forms
|
|
29
|
+
* initiative's separate line item).
|
|
30
|
+
*/
|
|
31
|
+
export declare const descriptorFieldShowWhenSchema: v.ObjectSchema<{
|
|
32
|
+
/** The `key` of the field whose value gates this one's visibility. */
|
|
33
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
34
|
+
/**
|
|
35
|
+
* Show when the referenced scalar value equals this. A union so `equals` can gate a `checkbox`
|
|
36
|
+
* (boolean) or `number` field, not only a `select`/`text` string. The comparison is strict, so
|
|
37
|
+
* the type must match the referenced field's value.
|
|
38
|
+
*/
|
|
39
|
+
readonly equals: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
40
|
+
/** Show when the referenced `checkbox-group` value includes this. */
|
|
41
|
+
readonly includes: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
42
|
+
}, undefined>;
|
|
43
|
+
export type DescriptorFieldShowWhen = v.InferOutput<typeof descriptorFieldShowWhenSchema>;
|
|
44
|
+
/** One choice of a `select` / `checkbox-group` field. */
|
|
45
|
+
export declare const descriptorFieldOptionSchema: v.ObjectSchema<{
|
|
46
|
+
/** The value stored when this choice is picked (an enum-stable string). */
|
|
47
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
48
|
+
/** The caption shown in the form, and rendered in place of the value in prose. */
|
|
49
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
50
|
+
}, undefined>;
|
|
51
|
+
export type DescriptorFieldOption = v.InferOutput<typeof descriptorFieldOptionSchema>;
|
|
52
|
+
/**
|
|
53
|
+
* Everything a descriptor field carries EXCEPT its `type`, which each surface narrows to its own
|
|
54
|
+
* admitted picklist. Spread into that surface's own `v.object({ ...descriptorFieldEntries, type })`
|
|
55
|
+
* so the shared bounds cannot drift per surface and a new shared attribute reaches both at once.
|
|
56
|
+
*/
|
|
57
|
+
export declare const descriptorFieldEntries: {
|
|
58
|
+
/** Stable key the value is stored/sent under (e.g. `docTypes`, `entity`). */
|
|
59
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>;
|
|
60
|
+
/** Human label for the form field (deployment-supplied English). */
|
|
61
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
62
|
+
/** Optional helper text shown under the field. */
|
|
63
|
+
readonly help: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>, undefined>;
|
|
64
|
+
/** Optional input placeholder. */
|
|
65
|
+
readonly placeholder: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
66
|
+
/** Whether the value is required (absent means optional). A hidden field is never required. */
|
|
67
|
+
readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
68
|
+
/** Choices for a `select` / `checkbox-group` field; ignored for the other types. */
|
|
69
|
+
readonly options: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
70
|
+
/** The value stored when this choice is picked (an enum-stable string). */
|
|
71
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
72
|
+
/** The caption shown in the form, and rendered in place of the value in prose. */
|
|
73
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
74
|
+
}, undefined>, undefined>, undefined>;
|
|
75
|
+
/** The scalar default (`text`/`select`/`path`/`number`/`checkbox`), used to seed the form. */
|
|
76
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
|
|
77
|
+
/** The multi-select default for a `checkbox-group` field. */
|
|
78
|
+
readonly defaultValues: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>, v.MaxLengthAction<string[], 50, undefined>]>, undefined>;
|
|
79
|
+
/** Single-condition visibility; absent means always shown. */
|
|
80
|
+
readonly showWhen: v.OptionalSchema<v.ObjectSchema<{
|
|
81
|
+
/** The `key` of the field whose value gates this one's visibility. */
|
|
82
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
83
|
+
/**
|
|
84
|
+
* Show when the referenced scalar value equals this. A union so `equals` can gate a `checkbox`
|
|
85
|
+
* (boolean) or `number` field, not only a `select`/`text` string. The comparison is strict, so
|
|
86
|
+
* the type must match the referenced field's value.
|
|
87
|
+
*/
|
|
88
|
+
readonly equals: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
89
|
+
/** Show when the referenced `checkbox-group` value includes this. */
|
|
90
|
+
readonly includes: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
91
|
+
}, undefined>, undefined>;
|
|
92
|
+
/**
|
|
93
|
+
* Max length for a string value (characters), enforced by the input AND the validator.
|
|
94
|
+
*
|
|
95
|
+
* Capped at {@link DESCRIPTOR_FIELD_VALUE_MAX}, the bound the filled bag itself carries: a
|
|
96
|
+
* descriptor allowed to declare more would render an input that accepts what the wire schema
|
|
97
|
+
* then refuses, and that refusal arrives as a raw schema error from the request parse rather
|
|
98
|
+
* than the readable per-field message {@link validateDescriptorFields} produces.
|
|
99
|
+
*/
|
|
100
|
+
readonly maxLength: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2000, undefined>]>, undefined>;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* A descriptor field admitting EVERY type: the shape the shared helpers below take. A surface's
|
|
104
|
+
* own narrower field type is structurally assignable to it, so `validate`/`sanitize`/`render`
|
|
105
|
+
* work against a preset's fields and a task type's alike with no adapter.
|
|
106
|
+
*/
|
|
107
|
+
export declare const descriptorFieldSchema: v.ObjectSchema<{
|
|
108
|
+
/** Stable key the value is stored/sent under (e.g. `docTypes`, `entity`). */
|
|
109
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>;
|
|
110
|
+
/** Human label for the form field (deployment-supplied English). */
|
|
111
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
112
|
+
/** Optional helper text shown under the field. */
|
|
113
|
+
readonly help: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>, undefined>;
|
|
114
|
+
/** Optional input placeholder. */
|
|
115
|
+
readonly placeholder: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
116
|
+
/** Whether the value is required (absent means optional). A hidden field is never required. */
|
|
117
|
+
readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
118
|
+
/** Choices for a `select` / `checkbox-group` field; ignored for the other types. */
|
|
119
|
+
readonly options: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
120
|
+
/** The value stored when this choice is picked (an enum-stable string). */
|
|
121
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
122
|
+
/** The caption shown in the form, and rendered in place of the value in prose. */
|
|
123
|
+
readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
|
|
124
|
+
}, undefined>, undefined>, undefined>;
|
|
125
|
+
/** The scalar default (`text`/`select`/`path`/`number`/`checkbox`), used to seed the form. */
|
|
126
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
|
|
127
|
+
/** The multi-select default for a `checkbox-group` field. */
|
|
128
|
+
readonly defaultValues: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>]>, undefined>, v.MaxLengthAction<string[], 50, undefined>]>, undefined>;
|
|
129
|
+
/** Single-condition visibility; absent means always shown. */
|
|
130
|
+
readonly showWhen: v.OptionalSchema<v.ObjectSchema<{
|
|
131
|
+
/** The `key` of the field whose value gates this one's visibility. */
|
|
132
|
+
readonly key: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
133
|
+
/**
|
|
134
|
+
* Show when the referenced scalar value equals this. A union so `equals` can gate a `checkbox`
|
|
135
|
+
* (boolean) or `number` field, not only a `select`/`text` string. The comparison is strict, so
|
|
136
|
+
* the type must match the referenced field's value.
|
|
137
|
+
*/
|
|
138
|
+
readonly equals: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
139
|
+
/** Show when the referenced `checkbox-group` value includes this. */
|
|
140
|
+
readonly includes: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
141
|
+
}, undefined>, undefined>;
|
|
142
|
+
/**
|
|
143
|
+
* Max length for a string value (characters), enforced by the input AND the validator.
|
|
144
|
+
*
|
|
145
|
+
* Capped at {@link DESCRIPTOR_FIELD_VALUE_MAX}, the bound the filled bag itself carries: a
|
|
146
|
+
* descriptor allowed to declare more would render an input that accepts what the wire schema
|
|
147
|
+
* then refuses, and that refusal arrives as a raw schema error from the request parse rather
|
|
148
|
+
* than the readable per-field message {@link validateDescriptorFields} produces.
|
|
149
|
+
*/
|
|
150
|
+
readonly maxLength: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2000, undefined>]>, undefined>;
|
|
151
|
+
/** Field type; absent is treated as `text`. */
|
|
152
|
+
readonly type: v.OptionalSchema<v.PicklistSchema<["text", "password", "select", "number", "checkbox", "textarea", "checkbox-group", "path"], undefined>, undefined>;
|
|
153
|
+
}, undefined>;
|
|
154
|
+
export type DescriptorField = v.InferOutput<typeof descriptorFieldSchema>;
|
|
155
|
+
/**
|
|
156
|
+
* Whether `path` is a SAFE repo-relative DIRECTORY (the `path`-field analogue of `isSafeDocPath`,
|
|
157
|
+
* minus the `.md` requirement). A `path` value is used verbatim as an in-repo placement dir that
|
|
158
|
+
* agents commit under, so it must not escape the repo: no `..` traversal, no absolute path (`/…`
|
|
159
|
+
* or a Windows drive), no backslash / NUL. An empty string is NOT a valid path (callers treat
|
|
160
|
+
* "unset" separately). A trailing slash is tolerated.
|
|
161
|
+
*/
|
|
162
|
+
export declare function isSafeRepoDirPath(path: string): boolean;
|
|
163
|
+
/** Whether a field is visible given the current values (its `showWhen` condition). */
|
|
164
|
+
export declare function isDescriptorFieldVisible(field: DescriptorField, values: DescriptorFieldValues): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Validate filled values against a field list, returning a list of human-readable problems (EMPTY
|
|
167
|
+
* means valid). Pure + total (never throws), so a controller maps a non-empty result to a single
|
|
168
|
+
* `ValidationError` and the SPA disables its submit button off the same call. Enforces: no unknown
|
|
169
|
+
* keys, the right value type per field, required VISIBLE fields present,
|
|
170
|
+
* `select`/`checkbox-group` values drawn from the declared options, declared `maxLength` respected,
|
|
171
|
+
* and `path` values that stay inside the repo ({@link isSafeRepoDirPath}). Hidden fields (failing
|
|
172
|
+
* `showWhen`) are not required and their stale values are ignored.
|
|
173
|
+
*/
|
|
174
|
+
export declare function validateDescriptorFields(fields: readonly DescriptorField[], values: DescriptorFieldValues): string[];
|
|
175
|
+
/**
|
|
176
|
+
* Reduce filled values to the ones SAFE to freeze: only fields the list declares, that are
|
|
177
|
+
* currently VISIBLE (their `showWhen` holds), and that {@link validateDescriptorFields} actually
|
|
178
|
+
* inspected. Unknown keys and hidden fields, whose stale values validation deliberately skips, are
|
|
179
|
+
* dropped, so a hidden field can never freeze an unvalidated value (e.g. a `path` that escapes the
|
|
180
|
+
* repo). Pure + total; run AFTER validation, on values already known valid.
|
|
181
|
+
*
|
|
182
|
+
* The UNFILLED values go too, and that is the same rule rather than a second one: validation
|
|
183
|
+
* short-circuits on a value that says nothing, so a `false` on a `text` field, a blank string or
|
|
184
|
+
* an empty multi-select reaches here having passed NO type check. Keeping them would freeze a
|
|
185
|
+
* wrong-typed answer the prompt fold then renders to every agent as the operation's own brief
|
|
186
|
+
* (`notes: false` reads as `Notes: No`), and would put a `custom` bag on a row that collected
|
|
187
|
+
* nothing, when its presence is what tells the dispatch projection parameters WERE collected. The
|
|
188
|
+
* one exception is {@link isExplicitOptOut}.
|
|
189
|
+
*/
|
|
190
|
+
export declare function sanitizeDescriptorFields(fields: readonly DescriptorField[], values: DescriptorFieldValues): DescriptorFieldValues;
|
|
191
|
+
/**
|
|
192
|
+
* Render one filled value as human-readable prose (option captions preferred over raw values,
|
|
193
|
+
* `checkbox-group` joined, boolean as `Yes`/`No`). Shared by the initiative create flow's
|
|
194
|
+
* skip-interview qa seeding, the operation prompt fold, and the SPA form review, so a field reads
|
|
195
|
+
* identically everywhere. Deployment-supplied English. Pure + total.
|
|
196
|
+
*
|
|
197
|
+
* `field` is OPTIONAL because a bag key can outlive the descriptor that declared it (a node whose
|
|
198
|
+
* build predates a re-registration still has to render the row it stored). With no field there is
|
|
199
|
+
* no option list to consult, so the raw value is the answer; the caller does not have to invent a
|
|
200
|
+
* fieldless descriptor to say so.
|
|
201
|
+
*/
|
|
202
|
+
export declare function renderDescriptorFieldValue(field: DescriptorField | undefined, value: DescriptorFieldValue): string;
|
|
203
|
+
//# sourceMappingURL=form-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-fields.d.ts","sourceRoot":"","sources":["../src/form-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAuB5B,gGAAgG;AAChG,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,OAAO,CAAA;AAC9C,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAE5C,oGAAoG;AACpG,eAAO,MAAM,0BAA0B,8XAQrC,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAA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AoF;;QAvBpF,2EAA2E;;QAE3E,kFAAkF;;;IAuBlF,8FAA8F;;IAE9F,6DAA6D;;IAO7D,8DAA8D;;QAjD9D,sEAAsE;;QAEtE;;;;WAIG;;QAEH,qEAAqE;;;IA2CrE;;;;;;;OAOG;;IAaH,+CAA+C;;aAE/C,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAMzE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMvD;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAeT;AA4CD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,MAAM,EAAE,qBAAqB,GAC5B,MAAM,EAAE,CAuBV;AAiCD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,MAAM,EAAE,qBAAqB,GAC5B,qBAAqB,CAUvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,eAAe,GAAG,SAAS,EAClC,KAAK,EAAE,oBAAoB,GAC1B,MAAM,CAOR"}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// ONE descriptor-driven form vocabulary, shared by every surface where a DEPLOYMENT declares a
|
|
4
|
+
// small form and the platform collects, validates, freezes and renders the answers as data:
|
|
5
|
+
//
|
|
6
|
+
// - an initiative PRESET's create form (`initiative-preset.ts`, values on `presetInputs`)
|
|
7
|
+
// - a reusable OPERATION's per-case brief (a custom task type's `fields` in `task-types.ts`,
|
|
8
|
+
// values in the sparse `taskTypeFields.custom` bag)
|
|
9
|
+
//
|
|
10
|
+
// The two grew the same shape independently, and the second was the poorer copy: four input types
|
|
11
|
+
// against eight, no defaults, no conditional visibility, and no shared validation, so a form that
|
|
12
|
+
// rendered correctly in one surface was unexpressible in the other. This module is the union, and
|
|
13
|
+
// each surface declares only WHICH TYPES it admits over it (see `taskTypeFieldTypeSchema`, which
|
|
14
|
+
// excludes `password` by construction: a task field value reaches prompts, the board snapshot and
|
|
15
|
+
// telemetry, so a secret belongs in the capability-credential store instead).
|
|
16
|
+
//
|
|
17
|
+
// Everything here is PURE and total, because the same rule has to hold at four doors: the SPA's
|
|
18
|
+
// submit button, the internal create controller, the public API, and (for rendering) the prompt
|
|
19
|
+
// fold. Descriptor labels/help/option captions are DEPLOYMENT-authored English rendered verbatim
|
|
20
|
+
// (the `describeConfig` convention); only the chrome around them is i18n.
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
/** Bound on a field `key`, and on a key in a filled {@link descriptorFieldValuesSchema} bag. */
|
|
23
|
+
export const DESCRIPTOR_FIELD_KEY_MAX = 80;
|
|
24
|
+
/** Bound on a single string / string-array element value. */
|
|
25
|
+
export const DESCRIPTOR_FIELD_VALUE_MAX = 2000;
|
|
26
|
+
/** Bound on the number of elements in a `checkbox-group` (multi-value) answer. */
|
|
27
|
+
export const DESCRIPTOR_FIELD_ARRAY_MAX = 50;
|
|
28
|
+
/** One filled value: a scalar (`text`/`select`/`path`/…), a multi-select, a toggle, or a number. */
|
|
29
|
+
export const descriptorFieldValueSchema = v.union([
|
|
30
|
+
v.pipe(v.string(), v.maxLength(DESCRIPTOR_FIELD_VALUE_MAX)),
|
|
31
|
+
v.pipe(v.array(v.pipe(v.string(), v.maxLength(DESCRIPTOR_FIELD_VALUE_MAX))), v.maxLength(DESCRIPTOR_FIELD_ARRAY_MAX)),
|
|
32
|
+
v.boolean(),
|
|
33
|
+
v.number(),
|
|
34
|
+
]);
|
|
35
|
+
/** A filled descriptor form: a bounded map from field `key` to its value. */
|
|
36
|
+
export const descriptorFieldValuesSchema = v.record(v.pipe(v.string(), v.minLength(1), v.maxLength(DESCRIPTOR_FIELD_KEY_MAX)), descriptorFieldValueSchema);
|
|
37
|
+
/**
|
|
38
|
+
* How a field is rendered and collected. The first six mirror `ProviderConfigField`'s types
|
|
39
|
+
* exactly; `checkbox-group` (a multi-select, value `string[]`) and `path` (a repo-relative
|
|
40
|
+
* directory, {@link isSafeRepoDirPath}-validated) are the two the preset form added.
|
|
41
|
+
*
|
|
42
|
+
* A surface may admit a SUBSET (each declares its own picklist over these members) but never a
|
|
43
|
+
* member outside them: the renderer and the validators below switch over exactly this union.
|
|
44
|
+
*/
|
|
45
|
+
export const descriptorFieldTypeSchema = v.picklist([
|
|
46
|
+
'text',
|
|
47
|
+
'password',
|
|
48
|
+
'select',
|
|
49
|
+
'number',
|
|
50
|
+
'checkbox',
|
|
51
|
+
'textarea',
|
|
52
|
+
'checkbox-group',
|
|
53
|
+
'path',
|
|
54
|
+
]);
|
|
55
|
+
/**
|
|
56
|
+
* Single-condition visibility for a field: it renders only when the referenced field's value
|
|
57
|
+
* matches. `equals` compares a scalar value; `includes` tests membership in a `checkbox-group`
|
|
58
|
+
* value ("show `diagramsDir` only when `docTypes` includes `diagrams`"). Deliberately ONE
|
|
59
|
+
* condition: resist growing this into a recursive schema renderer (that is the descriptor-forms
|
|
60
|
+
* initiative's separate line item).
|
|
61
|
+
*/
|
|
62
|
+
export const descriptorFieldShowWhenSchema = v.object({
|
|
63
|
+
/** The `key` of the field whose value gates this one's visibility. */
|
|
64
|
+
key: v.pipe(v.string(), v.minLength(1)),
|
|
65
|
+
/**
|
|
66
|
+
* Show when the referenced scalar value equals this. A union so `equals` can gate a `checkbox`
|
|
67
|
+
* (boolean) or `number` field, not only a `select`/`text` string. The comparison is strict, so
|
|
68
|
+
* the type must match the referenced field's value.
|
|
69
|
+
*/
|
|
70
|
+
equals: v.optional(v.union([v.string(), v.boolean(), v.number()])),
|
|
71
|
+
/** Show when the referenced `checkbox-group` value includes this. */
|
|
72
|
+
includes: v.optional(v.string()),
|
|
73
|
+
});
|
|
74
|
+
/** One choice of a `select` / `checkbox-group` field. */
|
|
75
|
+
export const descriptorFieldOptionSchema = v.object({
|
|
76
|
+
/** The value stored when this choice is picked (an enum-stable string). */
|
|
77
|
+
value: v.pipe(v.string(), v.minLength(1), v.maxLength(120)),
|
|
78
|
+
/** The caption shown in the form, and rendered in place of the value in prose. */
|
|
79
|
+
label: v.pipe(v.string(), v.minLength(1), v.maxLength(120)),
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Everything a descriptor field carries EXCEPT its `type`, which each surface narrows to its own
|
|
83
|
+
* admitted picklist. Spread into that surface's own `v.object({ ...descriptorFieldEntries, type })`
|
|
84
|
+
* so the shared bounds cannot drift per surface and a new shared attribute reaches both at once.
|
|
85
|
+
*/
|
|
86
|
+
export const descriptorFieldEntries = {
|
|
87
|
+
/** Stable key the value is stored/sent under (e.g. `docTypes`, `entity`). */
|
|
88
|
+
key: v.pipe(v.string(), v.minLength(1), v.maxLength(DESCRIPTOR_FIELD_KEY_MAX)),
|
|
89
|
+
/** Human label for the form field (deployment-supplied English). */
|
|
90
|
+
label: v.pipe(v.string(), v.minLength(1), v.maxLength(120)),
|
|
91
|
+
/** Optional helper text shown under the field. */
|
|
92
|
+
help: v.optional(v.pipe(v.string(), v.maxLength(300))),
|
|
93
|
+
/** Optional input placeholder. */
|
|
94
|
+
placeholder: v.optional(v.pipe(v.string(), v.maxLength(200))),
|
|
95
|
+
/** Whether the value is required (absent means optional). A hidden field is never required. */
|
|
96
|
+
required: v.optional(v.boolean()),
|
|
97
|
+
/** Choices for a `select` / `checkbox-group` field; ignored for the other types. */
|
|
98
|
+
options: v.optional(v.array(descriptorFieldOptionSchema)),
|
|
99
|
+
/** The scalar default (`text`/`select`/`path`/`number`/`checkbox`), used to seed the form. */
|
|
100
|
+
default: v.optional(v.pipe(v.string(), v.maxLength(DESCRIPTOR_FIELD_VALUE_MAX))),
|
|
101
|
+
/** The multi-select default for a `checkbox-group` field. */
|
|
102
|
+
defaultValues: v.optional(v.pipe(v.array(v.pipe(v.string(), v.maxLength(DESCRIPTOR_FIELD_VALUE_MAX))), v.maxLength(DESCRIPTOR_FIELD_ARRAY_MAX))),
|
|
103
|
+
/** Single-condition visibility; absent means always shown. */
|
|
104
|
+
showWhen: v.optional(descriptorFieldShowWhenSchema),
|
|
105
|
+
/**
|
|
106
|
+
* Max length for a string value (characters), enforced by the input AND the validator.
|
|
107
|
+
*
|
|
108
|
+
* Capped at {@link DESCRIPTOR_FIELD_VALUE_MAX}, the bound the filled bag itself carries: a
|
|
109
|
+
* descriptor allowed to declare more would render an input that accepts what the wire schema
|
|
110
|
+
* then refuses, and that refusal arrives as a raw schema error from the request parse rather
|
|
111
|
+
* than the readable per-field message {@link validateDescriptorFields} produces.
|
|
112
|
+
*/
|
|
113
|
+
maxLength: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(DESCRIPTOR_FIELD_VALUE_MAX))),
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* A descriptor field admitting EVERY type: the shape the shared helpers below take. A surface's
|
|
117
|
+
* own narrower field type is structurally assignable to it, so `validate`/`sanitize`/`render`
|
|
118
|
+
* work against a preset's fields and a task type's alike with no adapter.
|
|
119
|
+
*/
|
|
120
|
+
export const descriptorFieldSchema = v.object({
|
|
121
|
+
...descriptorFieldEntries,
|
|
122
|
+
/** Field type; absent is treated as `text`. */
|
|
123
|
+
type: v.optional(descriptorFieldTypeSchema),
|
|
124
|
+
});
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
// Path safety, visibility, validation, sanitization, rendering: the pure rules every door shares.
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
/**
|
|
129
|
+
* Whether `path` is a SAFE repo-relative DIRECTORY (the `path`-field analogue of `isSafeDocPath`,
|
|
130
|
+
* minus the `.md` requirement). A `path` value is used verbatim as an in-repo placement dir that
|
|
131
|
+
* agents commit under, so it must not escape the repo: no `..` traversal, no absolute path (`/…`
|
|
132
|
+
* or a Windows drive), no backslash / NUL. An empty string is NOT a valid path (callers treat
|
|
133
|
+
* "unset" separately). A trailing slash is tolerated.
|
|
134
|
+
*/
|
|
135
|
+
export function isSafeRepoDirPath(path) {
|
|
136
|
+
const p = path.trim();
|
|
137
|
+
if (!p || p.length > 300)
|
|
138
|
+
return false;
|
|
139
|
+
if (p.startsWith('/') || /^[a-zA-Z]:/.test(p))
|
|
140
|
+
return false;
|
|
141
|
+
if (p.includes('\\') || p.includes('\0'))
|
|
142
|
+
return false;
|
|
143
|
+
return !p.split('/').some((segment) => segment === '..');
|
|
144
|
+
}
|
|
145
|
+
/** Whether a field is visible given the current values (its `showWhen` condition). */
|
|
146
|
+
export function isDescriptorFieldVisible(field, values) {
|
|
147
|
+
const cond = field.showWhen;
|
|
148
|
+
if (!cond)
|
|
149
|
+
return true;
|
|
150
|
+
const value = values[cond.key];
|
|
151
|
+
if (cond.equals !== undefined) {
|
|
152
|
+
// An unchecked checkbox is ABSENT from the values (an off box stays unset: see the form
|
|
153
|
+
// renderer's drop-when-empty rule), so an absent value reads as `false` when the condition
|
|
154
|
+
// compares against a boolean. Without this, `equals: false` would never match at initial
|
|
155
|
+
// render (only after a toggle on then off), hiding a field that should be shown.
|
|
156
|
+
const actual = value === undefined && typeof cond.equals === 'boolean' ? false : value;
|
|
157
|
+
return actual === cond.equals;
|
|
158
|
+
}
|
|
159
|
+
if (cond.includes !== undefined)
|
|
160
|
+
return Array.isArray(value) && value.includes(cond.includes);
|
|
161
|
+
// A `showWhen` with neither predicate is a malformed condition; treat as always visible.
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
/** Whether a filled value matches the field's declared type (structural, pre-semantic check). */
|
|
165
|
+
function valueMatchesFieldType(field, value) {
|
|
166
|
+
switch (field.type) {
|
|
167
|
+
case 'checkbox-group':
|
|
168
|
+
return Array.isArray(value);
|
|
169
|
+
case 'checkbox':
|
|
170
|
+
return typeof value === 'boolean';
|
|
171
|
+
case 'number':
|
|
172
|
+
return typeof value === 'number';
|
|
173
|
+
default:
|
|
174
|
+
// text / password / select / textarea / path (and the untyped default) are strings.
|
|
175
|
+
return typeof value === 'string';
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Whether a value counts as FILLED. A checkbox is "present" only when checked, so a required
|
|
180
|
+
* checkbox means "must be checked" and an unchecked `false` counts as unset. A numeric `0` is a
|
|
181
|
+
* real answer (the strict comparisons never match it).
|
|
182
|
+
*/
|
|
183
|
+
function isFilled(value) {
|
|
184
|
+
if (value === undefined || value === false)
|
|
185
|
+
return false;
|
|
186
|
+
if (typeof value === 'string')
|
|
187
|
+
return value.trim() !== '';
|
|
188
|
+
if (Array.isArray(value))
|
|
189
|
+
return value.length > 0;
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Whether a value {@link isFilled} rejects is nonetheless an ANSWER worth freezing. Exactly one
|
|
194
|
+
* is: an explicit `false` on a `checkbox`, which is the opt-OUT of a default-ON toggle. Absent and
|
|
195
|
+
* `false` are the same value there and opposite facts, so dropping it would leave a consumer
|
|
196
|
+
* reading `inputs[key] !== false` (the tech-migration preset's `humanReview`) unable to ever
|
|
197
|
+
* observe the unchecked state, and the toggle would be dead.
|
|
198
|
+
*
|
|
199
|
+
* A `false` on any OTHER field type is not an answer at all: it is a wrong-typed value that
|
|
200
|
+
* {@link validateDescriptorFields} never type-checked, because the fill check short-circuits
|
|
201
|
+
* first. Same for a blank string or an empty multi-select, which say nothing anywhere.
|
|
202
|
+
*/
|
|
203
|
+
function isExplicitOptOut(field, value) {
|
|
204
|
+
return field.type === 'checkbox' && value === false;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Validate filled values against a field list, returning a list of human-readable problems (EMPTY
|
|
208
|
+
* means valid). Pure + total (never throws), so a controller maps a non-empty result to a single
|
|
209
|
+
* `ValidationError` and the SPA disables its submit button off the same call. Enforces: no unknown
|
|
210
|
+
* keys, the right value type per field, required VISIBLE fields present,
|
|
211
|
+
* `select`/`checkbox-group` values drawn from the declared options, declared `maxLength` respected,
|
|
212
|
+
* and `path` values that stay inside the repo ({@link isSafeRepoDirPath}). Hidden fields (failing
|
|
213
|
+
* `showWhen`) are not required and their stale values are ignored.
|
|
214
|
+
*/
|
|
215
|
+
export function validateDescriptorFields(fields, values) {
|
|
216
|
+
const problems = [];
|
|
217
|
+
const byKey = new Map(fields.map((f) => [f.key, f]));
|
|
218
|
+
for (const key of Object.keys(values)) {
|
|
219
|
+
if (!byKey.has(key))
|
|
220
|
+
problems.push(`Unknown field "${key}".`);
|
|
221
|
+
}
|
|
222
|
+
for (const field of fields) {
|
|
223
|
+
if (!isDescriptorFieldVisible(field, values))
|
|
224
|
+
continue;
|
|
225
|
+
const value = values[field.key];
|
|
226
|
+
if (!isFilled(value)) {
|
|
227
|
+
if (field.required)
|
|
228
|
+
problems.push(`Field "${field.key}" is required.`);
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
if (!valueMatchesFieldType(field, value)) {
|
|
232
|
+
problems.push(`Field "${field.key}" has the wrong type for a ${field.type ?? 'text'} field.`);
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
problems.push(...semanticProblems(field, value));
|
|
236
|
+
}
|
|
237
|
+
return problems;
|
|
238
|
+
}
|
|
239
|
+
/** The per-type semantic checks, once the value is present and structurally right. */
|
|
240
|
+
function semanticProblems(field, value) {
|
|
241
|
+
const problems = [];
|
|
242
|
+
const optionValues = new Set((field.options ?? []).map((o) => o.value));
|
|
243
|
+
if (field.type === 'select' && optionValues.size > 0 && !optionValues.has(value)) {
|
|
244
|
+
problems.push(`Field "${field.key}" has a value outside its options.`);
|
|
245
|
+
}
|
|
246
|
+
if (field.type === 'checkbox-group' && optionValues.size > 0) {
|
|
247
|
+
for (const entry of value) {
|
|
248
|
+
if (!optionValues.has(entry))
|
|
249
|
+
problems.push(`Field "${field.key}" has an option "${entry}" outside its choices.`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (field.type === 'path' && !isSafeRepoDirPath(value)) {
|
|
253
|
+
problems.push(`Field "${field.key}" must be a relative path inside the repo (no "..", absolute, or backslash segments).`);
|
|
254
|
+
}
|
|
255
|
+
// A declared `maxLength` binds the SERVER too, not only the input's own attribute: a form is not
|
|
256
|
+
// the only door (the public API fills the same fields), so the descriptor's stated bound has to
|
|
257
|
+
// hold where the value is actually frozen.
|
|
258
|
+
if (field.maxLength !== undefined &&
|
|
259
|
+
typeof value === 'string' &&
|
|
260
|
+
value.length > field.maxLength) {
|
|
261
|
+
problems.push(`Field "${field.key}" exceeds its maximum length of ${field.maxLength}.`);
|
|
262
|
+
}
|
|
263
|
+
return problems;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Reduce filled values to the ones SAFE to freeze: only fields the list declares, that are
|
|
267
|
+
* currently VISIBLE (their `showWhen` holds), and that {@link validateDescriptorFields} actually
|
|
268
|
+
* inspected. Unknown keys and hidden fields, whose stale values validation deliberately skips, are
|
|
269
|
+
* dropped, so a hidden field can never freeze an unvalidated value (e.g. a `path` that escapes the
|
|
270
|
+
* repo). Pure + total; run AFTER validation, on values already known valid.
|
|
271
|
+
*
|
|
272
|
+
* The UNFILLED values go too, and that is the same rule rather than a second one: validation
|
|
273
|
+
* short-circuits on a value that says nothing, so a `false` on a `text` field, a blank string or
|
|
274
|
+
* an empty multi-select reaches here having passed NO type check. Keeping them would freeze a
|
|
275
|
+
* wrong-typed answer the prompt fold then renders to every agent as the operation's own brief
|
|
276
|
+
* (`notes: false` reads as `Notes: No`), and would put a `custom` bag on a row that collected
|
|
277
|
+
* nothing, when its presence is what tells the dispatch projection parameters WERE collected. The
|
|
278
|
+
* one exception is {@link isExplicitOptOut}.
|
|
279
|
+
*/
|
|
280
|
+
export function sanitizeDescriptorFields(fields, values) {
|
|
281
|
+
const sanitized = {};
|
|
282
|
+
for (const field of fields) {
|
|
283
|
+
if (!isDescriptorFieldVisible(field, values))
|
|
284
|
+
continue;
|
|
285
|
+
const value = values[field.key];
|
|
286
|
+
if (value === undefined)
|
|
287
|
+
continue;
|
|
288
|
+
if (!isFilled(value) && !isExplicitOptOut(field, value))
|
|
289
|
+
continue;
|
|
290
|
+
sanitized[field.key] = value;
|
|
291
|
+
}
|
|
292
|
+
return sanitized;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Render one filled value as human-readable prose (option captions preferred over raw values,
|
|
296
|
+
* `checkbox-group` joined, boolean as `Yes`/`No`). Shared by the initiative create flow's
|
|
297
|
+
* skip-interview qa seeding, the operation prompt fold, and the SPA form review, so a field reads
|
|
298
|
+
* identically everywhere. Deployment-supplied English. Pure + total.
|
|
299
|
+
*
|
|
300
|
+
* `field` is OPTIONAL because a bag key can outlive the descriptor that declared it (a node whose
|
|
301
|
+
* build predates a re-registration still has to render the row it stored). With no field there is
|
|
302
|
+
* no option list to consult, so the raw value is the answer; the caller does not have to invent a
|
|
303
|
+
* fieldless descriptor to say so.
|
|
304
|
+
*/
|
|
305
|
+
export function renderDescriptorFieldValue(field, value) {
|
|
306
|
+
const labelOf = (raw) => (field?.options ?? []).find((o) => o.value === raw)?.label ?? raw;
|
|
307
|
+
if (Array.isArray(value))
|
|
308
|
+
return value.map(labelOf).join(', ');
|
|
309
|
+
if (typeof value === 'boolean')
|
|
310
|
+
return value ? 'Yes' : 'No';
|
|
311
|
+
if (typeof value === 'number')
|
|
312
|
+
return String(value);
|
|
313
|
+
return labelOf(value);
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=form-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-fields.js","sourceRoot":"","sources":["../src/form-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,8EAA8E;AAC9E,+FAA+F;AAC/F,4FAA4F;AAC5F,EAAE;AACF,4F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,CAAC,CAAA;IAC9D,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IAC3D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACnD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAA;AACvB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ export * from './package-registries.js';
|
|
|
77
77
|
export * from './agent-config.js';
|
|
78
78
|
export * from './result-views.js';
|
|
79
79
|
export * from './agent-presentation.js';
|
|
80
|
+
export * from './form-fields.js';
|
|
80
81
|
export * from './task-types.js';
|
|
81
82
|
export * from './testing.js';
|
|
82
83
|
export * from './compute-provisioning.js';
|