@db-lyon/flowkit 0.17.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +53 -1
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/config/index.d.ts +4 -2
  4. package/dist/config/index.d.ts.map +1 -1
  5. package/dist/config/index.js +2 -1
  6. package/dist/config/index.js.map +1 -1
  7. package/dist/config/loader.d.ts +11 -0
  8. package/dist/config/loader.d.ts.map +1 -1
  9. package/dist/config/loader.js +4 -0
  10. package/dist/config/loader.js.map +1 -1
  11. package/dist/config/schema.d.ts +1486 -79
  12. package/dist/config/schema.d.ts.map +1 -1
  13. package/dist/config/schema.js +125 -8
  14. package/dist/config/schema.js.map +1 -1
  15. package/dist/config/strict.d.ts +40 -0
  16. package/dist/config/strict.d.ts.map +1 -0
  17. package/dist/config/strict.js +146 -0
  18. package/dist/config/strict.js.map +1 -0
  19. package/dist/flow/index.d.ts +2 -2
  20. package/dist/flow/index.d.ts.map +1 -1
  21. package/dist/flow/index.js +1 -1
  22. package/dist/flow/index.js.map +1 -1
  23. package/dist/flow/runner.d.ts +279 -6
  24. package/dist/flow/runner.d.ts.map +1 -1
  25. package/dist/flow/runner.js +845 -40
  26. package/dist/flow/runner.js.map +1 -1
  27. package/dist/index.d.ts +13 -5
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +6 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/task/base-task.d.ts +55 -1
  32. package/dist/task/base-task.d.ts.map +1 -1
  33. package/dist/task/base-task.js +39 -0
  34. package/dist/task/base-task.js.map +1 -1
  35. package/dist/task/composite.d.ts +66 -0
  36. package/dist/task/composite.d.ts.map +1 -0
  37. package/dist/task/composite.js +21 -0
  38. package/dist/task/composite.js.map +1 -0
  39. package/dist/task/index.d.ts +7 -1
  40. package/dist/task/index.d.ts.map +1 -1
  41. package/dist/task/index.js +3 -0
  42. package/dist/task/index.js.map +1 -1
  43. package/dist/task/options-schema.d.ts +51 -0
  44. package/dist/task/options-schema.d.ts.map +1 -0
  45. package/dist/task/options-schema.js +102 -0
  46. package/dist/task/options-schema.js.map +1 -0
  47. package/dist/task/registry.d.ts +39 -1
  48. package/dist/task/registry.d.ts.map +1 -1
  49. package/dist/task/registry.js +44 -2
  50. package/dist/task/registry.js.map +1 -1
  51. package/dist/task/warnings.d.ts +25 -0
  52. package/dist/task/warnings.d.ts.map +1 -0
  53. package/dist/task/warnings.js +30 -0
  54. package/dist/task/warnings.js.map +1 -0
  55. package/docs/api-reference.md +273 -0
  56. package/docs/configuration.md +262 -1
  57. package/docs/custom-tasks.md +155 -0
  58. package/docs/releases.md +47 -0
  59. package/package.json +1 -1
@@ -1,5 +1,179 @@
1
1
  import { z } from 'zod';
2
2
  export declare const TaskOptionsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3
+ /**
4
+ * One declared task option. JSON-Schema-like: the constraint keywords are the
5
+ * JSON Schema ones (`enum`, `minimum`, `maxLength`, `items`, ...) and are
6
+ * checked with flowkit's built-in validator; `required` and `default` are
7
+ * per-option here rather than on a parent object.
8
+ */
9
+ export declare const OptionSpecSchema: z.ZodObject<{
10
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ /** The option must be present (after defaults and every override layer). */
13
+ required: z.ZodOptional<z.ZodBoolean>;
14
+ /** Used when no layer supplies the option. Lowest precedence of all. */
15
+ default: z.ZodOptional<z.ZodUnknown>;
16
+ enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
17
+ const: z.ZodOptional<z.ZodUnknown>;
18
+ minimum: z.ZodOptional<z.ZodNumber>;
19
+ maximum: z.ZodOptional<z.ZodNumber>;
20
+ exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
21
+ exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
22
+ minLength: z.ZodOptional<z.ZodNumber>;
23
+ maxLength: z.ZodOptional<z.ZodNumber>;
24
+ pattern: z.ZodOptional<z.ZodString>;
25
+ minItems: z.ZodOptional<z.ZodNumber>;
26
+ maxItems: z.ZodOptional<z.ZodNumber>;
27
+ /** JSON Schema for array elements. */
28
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
+ /** JSON Schema properties for an object-valued option. */
30
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
+ additionalProperties: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
32
+ nullable: z.ZodOptional<z.ZodBoolean>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ minimum?: number | undefined;
35
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
36
+ maximum?: number | undefined;
37
+ description?: string | undefined;
38
+ required?: boolean | undefined;
39
+ default?: unknown;
40
+ enum?: unknown[] | undefined;
41
+ const?: unknown;
42
+ exclusiveMinimum?: number | undefined;
43
+ exclusiveMaximum?: number | undefined;
44
+ minLength?: number | undefined;
45
+ maxLength?: number | undefined;
46
+ pattern?: string | undefined;
47
+ minItems?: number | undefined;
48
+ maxItems?: number | undefined;
49
+ items?: Record<string, unknown> | undefined;
50
+ properties?: Record<string, unknown> | undefined;
51
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
52
+ nullable?: boolean | undefined;
53
+ }, {
54
+ minimum?: number | undefined;
55
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
56
+ maximum?: number | undefined;
57
+ description?: string | undefined;
58
+ required?: boolean | undefined;
59
+ default?: unknown;
60
+ enum?: unknown[] | undefined;
61
+ const?: unknown;
62
+ exclusiveMinimum?: number | undefined;
63
+ exclusiveMaximum?: number | undefined;
64
+ minLength?: number | undefined;
65
+ maxLength?: number | undefined;
66
+ pattern?: string | undefined;
67
+ minItems?: number | undefined;
68
+ maxItems?: number | undefined;
69
+ items?: Record<string, unknown> | undefined;
70
+ properties?: Record<string, unknown> | undefined;
71
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
72
+ nullable?: boolean | undefined;
73
+ }>;
74
+ /** A task's declared options, keyed by option name. */
75
+ export declare const OptionSpecsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
76
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
77
+ description: z.ZodOptional<z.ZodString>;
78
+ /** The option must be present (after defaults and every override layer). */
79
+ required: z.ZodOptional<z.ZodBoolean>;
80
+ /** Used when no layer supplies the option. Lowest precedence of all. */
81
+ default: z.ZodOptional<z.ZodUnknown>;
82
+ enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
83
+ const: z.ZodOptional<z.ZodUnknown>;
84
+ minimum: z.ZodOptional<z.ZodNumber>;
85
+ maximum: z.ZodOptional<z.ZodNumber>;
86
+ exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
87
+ exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
88
+ minLength: z.ZodOptional<z.ZodNumber>;
89
+ maxLength: z.ZodOptional<z.ZodNumber>;
90
+ pattern: z.ZodOptional<z.ZodString>;
91
+ minItems: z.ZodOptional<z.ZodNumber>;
92
+ maxItems: z.ZodOptional<z.ZodNumber>;
93
+ /** JSON Schema for array elements. */
94
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
95
+ /** JSON Schema properties for an object-valued option. */
96
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
+ additionalProperties: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
98
+ nullable: z.ZodOptional<z.ZodBoolean>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ minimum?: number | undefined;
101
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
102
+ maximum?: number | undefined;
103
+ description?: string | undefined;
104
+ required?: boolean | undefined;
105
+ default?: unknown;
106
+ enum?: unknown[] | undefined;
107
+ const?: unknown;
108
+ exclusiveMinimum?: number | undefined;
109
+ exclusiveMaximum?: number | undefined;
110
+ minLength?: number | undefined;
111
+ maxLength?: number | undefined;
112
+ pattern?: string | undefined;
113
+ minItems?: number | undefined;
114
+ maxItems?: number | undefined;
115
+ items?: Record<string, unknown> | undefined;
116
+ properties?: Record<string, unknown> | undefined;
117
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
118
+ nullable?: boolean | undefined;
119
+ }, {
120
+ minimum?: number | undefined;
121
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
122
+ maximum?: number | undefined;
123
+ description?: string | undefined;
124
+ required?: boolean | undefined;
125
+ default?: unknown;
126
+ enum?: unknown[] | undefined;
127
+ const?: unknown;
128
+ exclusiveMinimum?: number | undefined;
129
+ exclusiveMaximum?: number | undefined;
130
+ minLength?: number | undefined;
131
+ maxLength?: number | undefined;
132
+ pattern?: string | undefined;
133
+ minItems?: number | undefined;
134
+ maxItems?: number | undefined;
135
+ items?: Record<string, unknown> | undefined;
136
+ properties?: Record<string, unknown> | undefined;
137
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
138
+ nullable?: boolean | undefined;
139
+ }>>;
140
+ /**
141
+ * One declared output: a key the task puts on `TaskResult.data`. Descriptive
142
+ * only; the runner does not check outputs.
143
+ */
144
+ export declare const OutputSpecSchema: z.ZodObject<{
145
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
146
+ description: z.ZodOptional<z.ZodString>;
147
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
148
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
151
+ description?: string | undefined;
152
+ items?: Record<string, unknown> | undefined;
153
+ properties?: Record<string, unknown> | undefined;
154
+ }, {
155
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
156
+ description?: string | undefined;
157
+ items?: Record<string, unknown> | undefined;
158
+ properties?: Record<string, unknown> | undefined;
159
+ }>;
160
+ /** A task's declared outputs, keyed by `data` key. */
161
+ export declare const OutputSpecsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
162
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
163
+ description: z.ZodOptional<z.ZodString>;
164
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
165
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
166
+ }, "strip", z.ZodTypeAny, {
167
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
168
+ description?: string | undefined;
169
+ items?: Record<string, unknown> | undefined;
170
+ properties?: Record<string, unknown> | undefined;
171
+ }, {
172
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
173
+ description?: string | undefined;
174
+ items?: Record<string, unknown> | undefined;
175
+ properties?: Record<string, unknown> | undefined;
176
+ }>>;
3
177
  export declare const TaskDefinitionSchema: z.ZodObject<{
4
178
  /**
5
179
  * The task's implementation. Optional: an option-only entry (no class_path)
@@ -14,22 +188,202 @@ export declare const TaskDefinitionSchema: z.ZodObject<{
14
188
  /** Declarative hints surfaced in listings; not used by the runner. */
15
189
  idempotent: z.ZodOptional<z.ZodBoolean>;
16
190
  reversible: z.ZodOptional<z.ZodBoolean>;
191
+ /**
192
+ * Declared options. Refines (per option, field by field) any static
193
+ * `optionsSchema` on the task class, and step options are validated against
194
+ * the result before the task runs.
195
+ */
196
+ options_schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
197
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
198
+ description: z.ZodOptional<z.ZodString>;
199
+ /** The option must be present (after defaults and every override layer). */
200
+ required: z.ZodOptional<z.ZodBoolean>;
201
+ /** Used when no layer supplies the option. Lowest precedence of all. */
202
+ default: z.ZodOptional<z.ZodUnknown>;
203
+ enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
204
+ const: z.ZodOptional<z.ZodUnknown>;
205
+ minimum: z.ZodOptional<z.ZodNumber>;
206
+ maximum: z.ZodOptional<z.ZodNumber>;
207
+ exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
208
+ exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
209
+ minLength: z.ZodOptional<z.ZodNumber>;
210
+ maxLength: z.ZodOptional<z.ZodNumber>;
211
+ pattern: z.ZodOptional<z.ZodString>;
212
+ minItems: z.ZodOptional<z.ZodNumber>;
213
+ maxItems: z.ZodOptional<z.ZodNumber>;
214
+ /** JSON Schema for array elements. */
215
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
216
+ /** JSON Schema properties for an object-valued option. */
217
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
218
+ additionalProperties: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
219
+ nullable: z.ZodOptional<z.ZodBoolean>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ minimum?: number | undefined;
222
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
223
+ maximum?: number | undefined;
224
+ description?: string | undefined;
225
+ required?: boolean | undefined;
226
+ default?: unknown;
227
+ enum?: unknown[] | undefined;
228
+ const?: unknown;
229
+ exclusiveMinimum?: number | undefined;
230
+ exclusiveMaximum?: number | undefined;
231
+ minLength?: number | undefined;
232
+ maxLength?: number | undefined;
233
+ pattern?: string | undefined;
234
+ minItems?: number | undefined;
235
+ maxItems?: number | undefined;
236
+ items?: Record<string, unknown> | undefined;
237
+ properties?: Record<string, unknown> | undefined;
238
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
239
+ nullable?: boolean | undefined;
240
+ }, {
241
+ minimum?: number | undefined;
242
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
243
+ maximum?: number | undefined;
244
+ description?: string | undefined;
245
+ required?: boolean | undefined;
246
+ default?: unknown;
247
+ enum?: unknown[] | undefined;
248
+ const?: unknown;
249
+ exclusiveMinimum?: number | undefined;
250
+ exclusiveMaximum?: number | undefined;
251
+ minLength?: number | undefined;
252
+ maxLength?: number | undefined;
253
+ pattern?: string | undefined;
254
+ minItems?: number | undefined;
255
+ maxItems?: number | undefined;
256
+ items?: Record<string, unknown> | undefined;
257
+ properties?: Record<string, unknown> | undefined;
258
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
259
+ nullable?: boolean | undefined;
260
+ }>>>;
261
+ /** Declared outputs, for `describe` and docs. Not enforced. */
262
+ outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
263
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
264
+ description: z.ZodOptional<z.ZodString>;
265
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
266
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
269
+ description?: string | undefined;
270
+ items?: Record<string, unknown> | undefined;
271
+ properties?: Record<string, unknown> | undefined;
272
+ }, {
273
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
274
+ description?: string | undefined;
275
+ items?: Record<string, unknown> | undefined;
276
+ properties?: Record<string, unknown> | undefined;
277
+ }>>>;
278
+ /**
279
+ * Mark the task deprecated: `true`, or a string saying why. Running or
280
+ * planning it adds a `deprecated` warning to the result; it still runs.
281
+ */
282
+ deprecated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
283
+ /** The task to use instead, named in the deprecation warning. */
284
+ replaced_by: z.ZodOptional<z.ZodString>;
17
285
  }, "strip", z.ZodTypeAny, {
18
286
  options: Record<string, unknown>;
19
- class_path?: string | undefined;
20
287
  description?: string | undefined;
288
+ class_path?: string | undefined;
21
289
  group?: string | undefined;
22
290
  idempotent?: boolean | undefined;
23
291
  reversible?: boolean | undefined;
292
+ options_schema?: Record<string, {
293
+ minimum?: number | undefined;
294
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
295
+ maximum?: number | undefined;
296
+ description?: string | undefined;
297
+ required?: boolean | undefined;
298
+ default?: unknown;
299
+ enum?: unknown[] | undefined;
300
+ const?: unknown;
301
+ exclusiveMinimum?: number | undefined;
302
+ exclusiveMaximum?: number | undefined;
303
+ minLength?: number | undefined;
304
+ maxLength?: number | undefined;
305
+ pattern?: string | undefined;
306
+ minItems?: number | undefined;
307
+ maxItems?: number | undefined;
308
+ items?: Record<string, unknown> | undefined;
309
+ properties?: Record<string, unknown> | undefined;
310
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
311
+ nullable?: boolean | undefined;
312
+ }> | undefined;
313
+ outputs?: Record<string, {
314
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
315
+ description?: string | undefined;
316
+ items?: Record<string, unknown> | undefined;
317
+ properties?: Record<string, unknown> | undefined;
318
+ }> | undefined;
319
+ deprecated?: string | boolean | undefined;
320
+ replaced_by?: string | undefined;
24
321
  }, {
25
322
  options?: Record<string, unknown> | undefined;
26
- class_path?: string | undefined;
27
323
  description?: string | undefined;
324
+ class_path?: string | undefined;
28
325
  group?: string | undefined;
29
326
  idempotent?: boolean | undefined;
30
327
  reversible?: boolean | undefined;
328
+ options_schema?: Record<string, {
329
+ minimum?: number | undefined;
330
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
331
+ maximum?: number | undefined;
332
+ description?: string | undefined;
333
+ required?: boolean | undefined;
334
+ default?: unknown;
335
+ enum?: unknown[] | undefined;
336
+ const?: unknown;
337
+ exclusiveMinimum?: number | undefined;
338
+ exclusiveMaximum?: number | undefined;
339
+ minLength?: number | undefined;
340
+ maxLength?: number | undefined;
341
+ pattern?: string | undefined;
342
+ minItems?: number | undefined;
343
+ maxItems?: number | undefined;
344
+ items?: Record<string, unknown> | undefined;
345
+ properties?: Record<string, unknown> | undefined;
346
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
347
+ nullable?: boolean | undefined;
348
+ }> | undefined;
349
+ outputs?: Record<string, {
350
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
351
+ description?: string | undefined;
352
+ items?: Record<string, unknown> | undefined;
353
+ properties?: Record<string, unknown> | undefined;
354
+ }> | undefined;
355
+ deprecated?: string | boolean | undefined;
356
+ replaced_by?: string | undefined;
31
357
  }>;
32
- export declare const FlowStepSchema: z.ZodEffects<z.ZodObject<{
358
+ /**
359
+ * A declared preflight check. `when` is evaluated by the runner's
360
+ * `conditionEvaluator` (or the built-in `${...}` truthiness fallback); when it
361
+ * is truthy the check fires and `action` applies: `error` fails before the
362
+ * step (or flow) starts, `skip` skips it, `warn` records a warning and runs it.
363
+ */
364
+ export declare const StepCheckSchema: z.ZodObject<{
365
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
366
+ action: z.ZodEnum<["error", "warn", "skip"]>;
367
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
368
+ message: z.ZodOptional<z.ZodString>;
369
+ }, "strip", z.ZodTypeAny, {
370
+ when: string | boolean;
371
+ action: "error" | "warn" | "skip";
372
+ message?: string | undefined;
373
+ }, {
374
+ when: string | boolean;
375
+ action: "error" | "warn" | "skip";
376
+ message?: string | undefined;
377
+ }>;
378
+ /**
379
+ * The fields of one flow step, as a plain object schema.
380
+ *
381
+ * Exported unrefined so a host can `.extend()` it for its own manifests (a
382
+ * plugin manifest, a code-declared flow) and stay in step with every field the
383
+ * runner understands. Pass the extended schema through `refineFlowStep` to get
384
+ * the same target rule `FlowStepSchema` enforces.
385
+ */
386
+ export declare const FlowStepObjectSchema: z.ZodObject<{
33
387
  task: z.ZodOptional<z.ZodString>;
34
388
  flow: z.ZodOptional<z.ZodString>;
35
389
  options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -48,43 +402,251 @@ export declare const FlowStepSchema: z.ZodEffects<z.ZodObject<{
48
402
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
49
403
  /** If true, a failure of this step is recorded but does not abort the flow. */
50
404
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
405
+ /**
406
+ * Preflight checks, evaluated in order just before the step would run (after
407
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
408
+ */
409
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
410
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
411
+ action: z.ZodEnum<["error", "warn", "skip"]>;
412
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
413
+ message: z.ZodOptional<z.ZodString>;
414
+ }, "strip", z.ZodTypeAny, {
415
+ when: string | boolean;
416
+ action: "error" | "warn" | "skip";
417
+ message?: string | undefined;
418
+ }, {
419
+ when: string | boolean;
420
+ action: "error" | "warn" | "skip";
421
+ message?: string | undefined;
422
+ }>, "many">>;
51
423
  }, "strip", z.ZodTypeAny, {
52
424
  options?: Record<string, unknown> | undefined;
425
+ when?: string | boolean | undefined;
53
426
  task?: string | undefined;
54
427
  flow?: string | undefined;
55
428
  retries?: number | undefined;
56
429
  retryDelay?: number | undefined;
57
430
  retryOn?: string | undefined;
58
- when?: string | boolean | undefined;
59
431
  ignore_failure?: boolean | undefined;
432
+ checks?: {
433
+ when: string | boolean;
434
+ action: "error" | "warn" | "skip";
435
+ message?: string | undefined;
436
+ }[] | undefined;
60
437
  }, {
61
438
  options?: Record<string, unknown> | undefined;
439
+ when?: string | boolean | undefined;
62
440
  task?: string | undefined;
63
441
  flow?: string | undefined;
64
442
  retries?: number | undefined;
65
443
  retryDelay?: number | undefined;
66
444
  retryOn?: string | undefined;
445
+ ignore_failure?: boolean | undefined;
446
+ checks?: {
447
+ when: string | boolean;
448
+ action: "error" | "warn" | "skip";
449
+ message?: string | undefined;
450
+ }[] | undefined;
451
+ }>;
452
+ /**
453
+ * Apply the step target rule to a step object schema, typically one a host
454
+ * built with `FlowStepObjectSchema.extend({ ... })`.
455
+ */
456
+ export declare function refineFlowStep<T extends z.ZodType<{
457
+ task?: string;
458
+ flow?: string;
459
+ }>>(schema: T): z.ZodEffects<T>;
460
+ /** One flow step: `FlowStepObjectSchema` with the target rule applied. */
461
+ export declare const FlowStepSchema: z.ZodEffects<z.ZodObject<{
462
+ task: z.ZodOptional<z.ZodString>;
463
+ flow: z.ZodOptional<z.ZodString>;
464
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
465
+ /** Retry the step up to N additional times on failure. */
466
+ retries: z.ZodOptional<z.ZodNumber>;
467
+ /** Delay between retries, in milliseconds. */
468
+ retryDelay: z.ZodOptional<z.ZodNumber>;
469
+ /** Only retry when the error message contains this substring. */
470
+ retryOn: z.ZodOptional<z.ZodString>;
471
+ /**
472
+ * Conditional execution. A boolean runs/skips the step directly; a string is
473
+ * an expression evaluated at runtime by the runner's `conditionEvaluator`
474
+ * (or the built-in `${...}`-reference truthiness check if none is set). A
475
+ * falsy result skips the step without failing the flow.
476
+ */
477
+ when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
478
+ /** If true, a failure of this step is recorded but does not abort the flow. */
479
+ ignore_failure: z.ZodOptional<z.ZodBoolean>;
480
+ /**
481
+ * Preflight checks, evaluated in order just before the step would run (after
482
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
483
+ */
484
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
485
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
486
+ action: z.ZodEnum<["error", "warn", "skip"]>;
487
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
488
+ message: z.ZodOptional<z.ZodString>;
489
+ }, "strip", z.ZodTypeAny, {
490
+ when: string | boolean;
491
+ action: "error" | "warn" | "skip";
492
+ message?: string | undefined;
493
+ }, {
494
+ when: string | boolean;
495
+ action: "error" | "warn" | "skip";
496
+ message?: string | undefined;
497
+ }>, "many">>;
498
+ }, "strip", z.ZodTypeAny, {
499
+ options?: Record<string, unknown> | undefined;
67
500
  when?: string | boolean | undefined;
501
+ task?: string | undefined;
502
+ flow?: string | undefined;
503
+ retries?: number | undefined;
504
+ retryDelay?: number | undefined;
505
+ retryOn?: string | undefined;
68
506
  ignore_failure?: boolean | undefined;
507
+ checks?: {
508
+ when: string | boolean;
509
+ action: "error" | "warn" | "skip";
510
+ message?: string | undefined;
511
+ }[] | undefined;
512
+ }, {
513
+ options?: Record<string, unknown> | undefined;
514
+ when?: string | boolean | undefined;
515
+ task?: string | undefined;
516
+ flow?: string | undefined;
517
+ retries?: number | undefined;
518
+ retryDelay?: number | undefined;
519
+ retryOn?: string | undefined;
520
+ ignore_failure?: boolean | undefined;
521
+ checks?: {
522
+ when: string | boolean;
523
+ action: "error" | "warn" | "skip";
524
+ message?: string | undefined;
525
+ }[] | undefined;
69
526
  }>, {
70
527
  options?: Record<string, unknown> | undefined;
528
+ when?: string | boolean | undefined;
529
+ task?: string | undefined;
530
+ flow?: string | undefined;
531
+ retries?: number | undefined;
532
+ retryDelay?: number | undefined;
533
+ retryOn?: string | undefined;
534
+ ignore_failure?: boolean | undefined;
535
+ checks?: {
536
+ when: string | boolean;
537
+ action: "error" | "warn" | "skip";
538
+ message?: string | undefined;
539
+ }[] | undefined;
540
+ }, {
541
+ options?: Record<string, unknown> | undefined;
542
+ when?: string | boolean | undefined;
71
543
  task?: string | undefined;
72
544
  flow?: string | undefined;
73
545
  retries?: number | undefined;
74
546
  retryDelay?: number | undefined;
75
547
  retryOn?: string | undefined;
548
+ ignore_failure?: boolean | undefined;
549
+ checks?: {
550
+ when: string | boolean;
551
+ action: "error" | "warn" | "skip";
552
+ message?: string | undefined;
553
+ }[] | undefined;
554
+ }>;
555
+ /** A flow's `steps:` map, keyed by step number. */
556
+ export declare const FlowStepsSchema: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
557
+ task: z.ZodOptional<z.ZodString>;
558
+ flow: z.ZodOptional<z.ZodString>;
559
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
560
+ /** Retry the step up to N additional times on failure. */
561
+ retries: z.ZodOptional<z.ZodNumber>;
562
+ /** Delay between retries, in milliseconds. */
563
+ retryDelay: z.ZodOptional<z.ZodNumber>;
564
+ /** Only retry when the error message contains this substring. */
565
+ retryOn: z.ZodOptional<z.ZodString>;
566
+ /**
567
+ * Conditional execution. A boolean runs/skips the step directly; a string is
568
+ * an expression evaluated at runtime by the runner's `conditionEvaluator`
569
+ * (or the built-in `${...}`-reference truthiness check if none is set). A
570
+ * falsy result skips the step without failing the flow.
571
+ */
572
+ when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
573
+ /** If true, a failure of this step is recorded but does not abort the flow. */
574
+ ignore_failure: z.ZodOptional<z.ZodBoolean>;
575
+ /**
576
+ * Preflight checks, evaluated in order just before the step would run (after
577
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
578
+ */
579
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
580
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
581
+ action: z.ZodEnum<["error", "warn", "skip"]>;
582
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
583
+ message: z.ZodOptional<z.ZodString>;
584
+ }, "strip", z.ZodTypeAny, {
585
+ when: string | boolean;
586
+ action: "error" | "warn" | "skip";
587
+ message?: string | undefined;
588
+ }, {
589
+ when: string | boolean;
590
+ action: "error" | "warn" | "skip";
591
+ message?: string | undefined;
592
+ }>, "many">>;
593
+ }, "strip", z.ZodTypeAny, {
594
+ options?: Record<string, unknown> | undefined;
76
595
  when?: string | boolean | undefined;
596
+ task?: string | undefined;
597
+ flow?: string | undefined;
598
+ retries?: number | undefined;
599
+ retryDelay?: number | undefined;
600
+ retryOn?: string | undefined;
77
601
  ignore_failure?: boolean | undefined;
602
+ checks?: {
603
+ when: string | boolean;
604
+ action: "error" | "warn" | "skip";
605
+ message?: string | undefined;
606
+ }[] | undefined;
78
607
  }, {
79
608
  options?: Record<string, unknown> | undefined;
609
+ when?: string | boolean | undefined;
80
610
  task?: string | undefined;
81
611
  flow?: string | undefined;
82
612
  retries?: number | undefined;
83
613
  retryDelay?: number | undefined;
84
614
  retryOn?: string | undefined;
615
+ ignore_failure?: boolean | undefined;
616
+ checks?: {
617
+ when: string | boolean;
618
+ action: "error" | "warn" | "skip";
619
+ message?: string | undefined;
620
+ }[] | undefined;
621
+ }>, {
622
+ options?: Record<string, unknown> | undefined;
85
623
  when?: string | boolean | undefined;
624
+ task?: string | undefined;
625
+ flow?: string | undefined;
626
+ retries?: number | undefined;
627
+ retryDelay?: number | undefined;
628
+ retryOn?: string | undefined;
86
629
  ignore_failure?: boolean | undefined;
87
- }>;
630
+ checks?: {
631
+ when: string | boolean;
632
+ action: "error" | "warn" | "skip";
633
+ message?: string | undefined;
634
+ }[] | undefined;
635
+ }, {
636
+ options?: Record<string, unknown> | undefined;
637
+ when?: string | boolean | undefined;
638
+ task?: string | undefined;
639
+ flow?: string | undefined;
640
+ retries?: number | undefined;
641
+ retryDelay?: number | undefined;
642
+ retryOn?: string | undefined;
643
+ ignore_failure?: boolean | undefined;
644
+ checks?: {
645
+ when: string | boolean;
646
+ action: "error" | "warn" | "skip";
647
+ message?: string | undefined;
648
+ }[] | undefined;
649
+ }>>;
88
650
  export declare const FlowDefinitionSchema: z.ZodObject<{
89
651
  /**
90
652
  * Optional: a flow override (one that layers steps/hooks onto a same-named
@@ -111,42 +673,80 @@ export declare const FlowDefinitionSchema: z.ZodObject<{
111
673
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
112
674
  /** If true, a failure of this step is recorded but does not abort the flow. */
113
675
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
676
+ /**
677
+ * Preflight checks, evaluated in order just before the step would run (after
678
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
679
+ */
680
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
681
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
682
+ action: z.ZodEnum<["error", "warn", "skip"]>;
683
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
684
+ message: z.ZodOptional<z.ZodString>;
685
+ }, "strip", z.ZodTypeAny, {
686
+ when: string | boolean;
687
+ action: "error" | "warn" | "skip";
688
+ message?: string | undefined;
689
+ }, {
690
+ when: string | boolean;
691
+ action: "error" | "warn" | "skip";
692
+ message?: string | undefined;
693
+ }>, "many">>;
114
694
  }, "strip", z.ZodTypeAny, {
115
695
  options?: Record<string, unknown> | undefined;
696
+ when?: string | boolean | undefined;
116
697
  task?: string | undefined;
117
698
  flow?: string | undefined;
118
699
  retries?: number | undefined;
119
700
  retryDelay?: number | undefined;
120
701
  retryOn?: string | undefined;
121
- when?: string | boolean | undefined;
122
702
  ignore_failure?: boolean | undefined;
703
+ checks?: {
704
+ when: string | boolean;
705
+ action: "error" | "warn" | "skip";
706
+ message?: string | undefined;
707
+ }[] | undefined;
123
708
  }, {
124
709
  options?: Record<string, unknown> | undefined;
710
+ when?: string | boolean | undefined;
125
711
  task?: string | undefined;
126
712
  flow?: string | undefined;
127
713
  retries?: number | undefined;
128
714
  retryDelay?: number | undefined;
129
715
  retryOn?: string | undefined;
130
- when?: string | boolean | undefined;
131
716
  ignore_failure?: boolean | undefined;
717
+ checks?: {
718
+ when: string | boolean;
719
+ action: "error" | "warn" | "skip";
720
+ message?: string | undefined;
721
+ }[] | undefined;
132
722
  }>, {
133
723
  options?: Record<string, unknown> | undefined;
724
+ when?: string | boolean | undefined;
134
725
  task?: string | undefined;
135
726
  flow?: string | undefined;
136
727
  retries?: number | undefined;
137
728
  retryDelay?: number | undefined;
138
729
  retryOn?: string | undefined;
139
- when?: string | boolean | undefined;
140
730
  ignore_failure?: boolean | undefined;
731
+ checks?: {
732
+ when: string | boolean;
733
+ action: "error" | "warn" | "skip";
734
+ message?: string | undefined;
735
+ }[] | undefined;
141
736
  }, {
142
737
  options?: Record<string, unknown> | undefined;
738
+ when?: string | boolean | undefined;
143
739
  task?: string | undefined;
144
740
  flow?: string | undefined;
145
741
  retries?: number | undefined;
146
742
  retryDelay?: number | undefined;
147
743
  retryOn?: string | undefined;
148
- when?: string | boolean | undefined;
149
744
  ignore_failure?: boolean | undefined;
745
+ checks?: {
746
+ when: string | boolean;
747
+ action: "error" | "warn" | "skip";
748
+ message?: string | undefined;
749
+ }[] | undefined;
150
750
  }>>>;
151
751
  /** Runs before the first step. Failure fails the flow before steps execute. */
152
752
  on_start: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -168,42 +768,80 @@ export declare const FlowDefinitionSchema: z.ZodObject<{
168
768
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
169
769
  /** If true, a failure of this step is recorded but does not abort the flow. */
170
770
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
771
+ /**
772
+ * Preflight checks, evaluated in order just before the step would run (after
773
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
774
+ */
775
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
776
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
777
+ action: z.ZodEnum<["error", "warn", "skip"]>;
778
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
779
+ message: z.ZodOptional<z.ZodString>;
780
+ }, "strip", z.ZodTypeAny, {
781
+ when: string | boolean;
782
+ action: "error" | "warn" | "skip";
783
+ message?: string | undefined;
784
+ }, {
785
+ when: string | boolean;
786
+ action: "error" | "warn" | "skip";
787
+ message?: string | undefined;
788
+ }>, "many">>;
171
789
  }, "strip", z.ZodTypeAny, {
172
790
  options?: Record<string, unknown> | undefined;
791
+ when?: string | boolean | undefined;
173
792
  task?: string | undefined;
174
793
  flow?: string | undefined;
175
794
  retries?: number | undefined;
176
795
  retryDelay?: number | undefined;
177
796
  retryOn?: string | undefined;
178
- when?: string | boolean | undefined;
179
797
  ignore_failure?: boolean | undefined;
798
+ checks?: {
799
+ when: string | boolean;
800
+ action: "error" | "warn" | "skip";
801
+ message?: string | undefined;
802
+ }[] | undefined;
180
803
  }, {
181
804
  options?: Record<string, unknown> | undefined;
805
+ when?: string | boolean | undefined;
182
806
  task?: string | undefined;
183
807
  flow?: string | undefined;
184
808
  retries?: number | undefined;
185
809
  retryDelay?: number | undefined;
186
810
  retryOn?: string | undefined;
187
- when?: string | boolean | undefined;
188
811
  ignore_failure?: boolean | undefined;
812
+ checks?: {
813
+ when: string | boolean;
814
+ action: "error" | "warn" | "skip";
815
+ message?: string | undefined;
816
+ }[] | undefined;
189
817
  }>, {
190
818
  options?: Record<string, unknown> | undefined;
819
+ when?: string | boolean | undefined;
191
820
  task?: string | undefined;
192
821
  flow?: string | undefined;
193
822
  retries?: number | undefined;
194
823
  retryDelay?: number | undefined;
195
824
  retryOn?: string | undefined;
196
- when?: string | boolean | undefined;
197
825
  ignore_failure?: boolean | undefined;
826
+ checks?: {
827
+ when: string | boolean;
828
+ action: "error" | "warn" | "skip";
829
+ message?: string | undefined;
830
+ }[] | undefined;
198
831
  }, {
199
832
  options?: Record<string, unknown> | undefined;
833
+ when?: string | boolean | undefined;
200
834
  task?: string | undefined;
201
835
  flow?: string | undefined;
202
836
  retries?: number | undefined;
203
837
  retryDelay?: number | undefined;
204
838
  retryOn?: string | undefined;
205
- when?: string | boolean | undefined;
206
839
  ignore_failure?: boolean | undefined;
840
+ checks?: {
841
+ when: string | boolean;
842
+ action: "error" | "warn" | "skip";
843
+ message?: string | undefined;
844
+ }[] | undefined;
207
845
  }>, "many">>;
208
846
  /** Runs after all steps succeed. */
209
847
  on_success: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -225,42 +863,80 @@ export declare const FlowDefinitionSchema: z.ZodObject<{
225
863
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
226
864
  /** If true, a failure of this step is recorded but does not abort the flow. */
227
865
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
866
+ /**
867
+ * Preflight checks, evaluated in order just before the step would run (after
868
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
869
+ */
870
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
871
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
872
+ action: z.ZodEnum<["error", "warn", "skip"]>;
873
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
874
+ message: z.ZodOptional<z.ZodString>;
875
+ }, "strip", z.ZodTypeAny, {
876
+ when: string | boolean;
877
+ action: "error" | "warn" | "skip";
878
+ message?: string | undefined;
879
+ }, {
880
+ when: string | boolean;
881
+ action: "error" | "warn" | "skip";
882
+ message?: string | undefined;
883
+ }>, "many">>;
228
884
  }, "strip", z.ZodTypeAny, {
229
885
  options?: Record<string, unknown> | undefined;
886
+ when?: string | boolean | undefined;
230
887
  task?: string | undefined;
231
888
  flow?: string | undefined;
232
889
  retries?: number | undefined;
233
890
  retryDelay?: number | undefined;
234
891
  retryOn?: string | undefined;
235
- when?: string | boolean | undefined;
236
892
  ignore_failure?: boolean | undefined;
893
+ checks?: {
894
+ when: string | boolean;
895
+ action: "error" | "warn" | "skip";
896
+ message?: string | undefined;
897
+ }[] | undefined;
237
898
  }, {
238
899
  options?: Record<string, unknown> | undefined;
900
+ when?: string | boolean | undefined;
239
901
  task?: string | undefined;
240
902
  flow?: string | undefined;
241
903
  retries?: number | undefined;
242
904
  retryDelay?: number | undefined;
243
905
  retryOn?: string | undefined;
244
- when?: string | boolean | undefined;
245
906
  ignore_failure?: boolean | undefined;
907
+ checks?: {
908
+ when: string | boolean;
909
+ action: "error" | "warn" | "skip";
910
+ message?: string | undefined;
911
+ }[] | undefined;
246
912
  }>, {
247
913
  options?: Record<string, unknown> | undefined;
914
+ when?: string | boolean | undefined;
248
915
  task?: string | undefined;
249
916
  flow?: string | undefined;
250
917
  retries?: number | undefined;
251
918
  retryDelay?: number | undefined;
252
919
  retryOn?: string | undefined;
253
- when?: string | boolean | undefined;
254
920
  ignore_failure?: boolean | undefined;
921
+ checks?: {
922
+ when: string | boolean;
923
+ action: "error" | "warn" | "skip";
924
+ message?: string | undefined;
925
+ }[] | undefined;
255
926
  }, {
256
927
  options?: Record<string, unknown> | undefined;
928
+ when?: string | boolean | undefined;
257
929
  task?: string | undefined;
258
930
  flow?: string | undefined;
259
931
  retries?: number | undefined;
260
932
  retryDelay?: number | undefined;
261
933
  retryOn?: string | undefined;
262
- when?: string | boolean | undefined;
263
934
  ignore_failure?: boolean | undefined;
935
+ checks?: {
936
+ when: string | boolean;
937
+ action: "error" | "warn" | "skip";
938
+ message?: string | undefined;
939
+ }[] | undefined;
264
940
  }>, "many">>;
265
941
  /** Runs on any step failure. */
266
942
  on_failure: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -282,42 +958,80 @@ export declare const FlowDefinitionSchema: z.ZodObject<{
282
958
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
283
959
  /** If true, a failure of this step is recorded but does not abort the flow. */
284
960
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
961
+ /**
962
+ * Preflight checks, evaluated in order just before the step would run (after
963
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
964
+ */
965
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
966
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
967
+ action: z.ZodEnum<["error", "warn", "skip"]>;
968
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
969
+ message: z.ZodOptional<z.ZodString>;
970
+ }, "strip", z.ZodTypeAny, {
971
+ when: string | boolean;
972
+ action: "error" | "warn" | "skip";
973
+ message?: string | undefined;
974
+ }, {
975
+ when: string | boolean;
976
+ action: "error" | "warn" | "skip";
977
+ message?: string | undefined;
978
+ }>, "many">>;
285
979
  }, "strip", z.ZodTypeAny, {
286
980
  options?: Record<string, unknown> | undefined;
981
+ when?: string | boolean | undefined;
287
982
  task?: string | undefined;
288
983
  flow?: string | undefined;
289
984
  retries?: number | undefined;
290
985
  retryDelay?: number | undefined;
291
986
  retryOn?: string | undefined;
292
- when?: string | boolean | undefined;
293
987
  ignore_failure?: boolean | undefined;
988
+ checks?: {
989
+ when: string | boolean;
990
+ action: "error" | "warn" | "skip";
991
+ message?: string | undefined;
992
+ }[] | undefined;
294
993
  }, {
295
994
  options?: Record<string, unknown> | undefined;
995
+ when?: string | boolean | undefined;
296
996
  task?: string | undefined;
297
997
  flow?: string | undefined;
298
998
  retries?: number | undefined;
299
999
  retryDelay?: number | undefined;
300
1000
  retryOn?: string | undefined;
301
- when?: string | boolean | undefined;
302
1001
  ignore_failure?: boolean | undefined;
1002
+ checks?: {
1003
+ when: string | boolean;
1004
+ action: "error" | "warn" | "skip";
1005
+ message?: string | undefined;
1006
+ }[] | undefined;
303
1007
  }>, {
304
1008
  options?: Record<string, unknown> | undefined;
1009
+ when?: string | boolean | undefined;
305
1010
  task?: string | undefined;
306
1011
  flow?: string | undefined;
307
1012
  retries?: number | undefined;
308
1013
  retryDelay?: number | undefined;
309
1014
  retryOn?: string | undefined;
310
- when?: string | boolean | undefined;
311
1015
  ignore_failure?: boolean | undefined;
1016
+ checks?: {
1017
+ when: string | boolean;
1018
+ action: "error" | "warn" | "skip";
1019
+ message?: string | undefined;
1020
+ }[] | undefined;
312
1021
  }, {
313
1022
  options?: Record<string, unknown> | undefined;
1023
+ when?: string | boolean | undefined;
314
1024
  task?: string | undefined;
315
1025
  flow?: string | undefined;
316
1026
  retries?: number | undefined;
317
1027
  retryDelay?: number | undefined;
318
1028
  retryOn?: string | undefined;
319
- when?: string | boolean | undefined;
320
1029
  ignore_failure?: boolean | undefined;
1030
+ checks?: {
1031
+ when: string | boolean;
1032
+ action: "error" | "warn" | "skip";
1033
+ message?: string | undefined;
1034
+ }[] | undefined;
321
1035
  }>, "many">>;
322
1036
  /** Runs after success or failure, after on_success/on_failure. */
323
1037
  finally: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -339,151 +1053,281 @@ export declare const FlowDefinitionSchema: z.ZodObject<{
339
1053
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
340
1054
  /** If true, a failure of this step is recorded but does not abort the flow. */
341
1055
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
1056
+ /**
1057
+ * Preflight checks, evaluated in order just before the step would run (after
1058
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
1059
+ */
1060
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1061
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
1062
+ action: z.ZodEnum<["error", "warn", "skip"]>;
1063
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
1064
+ message: z.ZodOptional<z.ZodString>;
1065
+ }, "strip", z.ZodTypeAny, {
1066
+ when: string | boolean;
1067
+ action: "error" | "warn" | "skip";
1068
+ message?: string | undefined;
1069
+ }, {
1070
+ when: string | boolean;
1071
+ action: "error" | "warn" | "skip";
1072
+ message?: string | undefined;
1073
+ }>, "many">>;
342
1074
  }, "strip", z.ZodTypeAny, {
343
1075
  options?: Record<string, unknown> | undefined;
1076
+ when?: string | boolean | undefined;
344
1077
  task?: string | undefined;
345
1078
  flow?: string | undefined;
346
1079
  retries?: number | undefined;
347
1080
  retryDelay?: number | undefined;
348
1081
  retryOn?: string | undefined;
349
- when?: string | boolean | undefined;
350
1082
  ignore_failure?: boolean | undefined;
1083
+ checks?: {
1084
+ when: string | boolean;
1085
+ action: "error" | "warn" | "skip";
1086
+ message?: string | undefined;
1087
+ }[] | undefined;
351
1088
  }, {
352
1089
  options?: Record<string, unknown> | undefined;
1090
+ when?: string | boolean | undefined;
353
1091
  task?: string | undefined;
354
1092
  flow?: string | undefined;
355
1093
  retries?: number | undefined;
356
1094
  retryDelay?: number | undefined;
357
1095
  retryOn?: string | undefined;
358
- when?: string | boolean | undefined;
359
1096
  ignore_failure?: boolean | undefined;
1097
+ checks?: {
1098
+ when: string | boolean;
1099
+ action: "error" | "warn" | "skip";
1100
+ message?: string | undefined;
1101
+ }[] | undefined;
360
1102
  }>, {
361
1103
  options?: Record<string, unknown> | undefined;
1104
+ when?: string | boolean | undefined;
362
1105
  task?: string | undefined;
363
1106
  flow?: string | undefined;
364
1107
  retries?: number | undefined;
365
1108
  retryDelay?: number | undefined;
366
1109
  retryOn?: string | undefined;
367
- when?: string | boolean | undefined;
368
1110
  ignore_failure?: boolean | undefined;
1111
+ checks?: {
1112
+ when: string | boolean;
1113
+ action: "error" | "warn" | "skip";
1114
+ message?: string | undefined;
1115
+ }[] | undefined;
369
1116
  }, {
370
1117
  options?: Record<string, unknown> | undefined;
1118
+ when?: string | boolean | undefined;
371
1119
  task?: string | undefined;
372
1120
  flow?: string | undefined;
373
1121
  retries?: number | undefined;
374
1122
  retryDelay?: number | undefined;
375
1123
  retryOn?: string | undefined;
376
- when?: string | boolean | undefined;
377
1124
  ignore_failure?: boolean | undefined;
1125
+ checks?: {
1126
+ when: string | boolean;
1127
+ action: "error" | "warn" | "skip";
1128
+ message?: string | undefined;
1129
+ }[] | undefined;
378
1130
  }>, "many">>;
379
1131
  /** If true, invoke rollback records from completed steps in reverse order on failure. */
380
1132
  rollback_on_failure: z.ZodOptional<z.ZodBoolean>;
1133
+ /** Preflight checks for the whole flow, evaluated before any of its steps or hooks. */
1134
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1135
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
1136
+ action: z.ZodEnum<["error", "warn", "skip"]>;
1137
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
1138
+ message: z.ZodOptional<z.ZodString>;
1139
+ }, "strip", z.ZodTypeAny, {
1140
+ when: string | boolean;
1141
+ action: "error" | "warn" | "skip";
1142
+ message?: string | undefined;
1143
+ }, {
1144
+ when: string | boolean;
1145
+ action: "error" | "warn" | "skip";
1146
+ message?: string | undefined;
1147
+ }>, "many">>;
1148
+ /**
1149
+ * How runtime `params` reach the steps of a run started on this flow.
1150
+ * `flat` (the default): every key goes to every step. `step`: each key is a
1151
+ * step selector (a task name or a step path such as `2` or `2/1`) whose value
1152
+ * is the options for the matching steps only.
1153
+ */
1154
+ options_scope: z.ZodOptional<z.ZodEnum<["flat", "step"]>>;
1155
+ /** Mark the flow deprecated: `true`, or a string saying why. It still runs. */
1156
+ deprecated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
1157
+ /** The flow to use instead, named in the deprecation warning. */
1158
+ replaced_by: z.ZodOptional<z.ZodString>;
381
1159
  }, "strip", z.ZodTypeAny, {
382
1160
  steps: Record<string, {
383
1161
  options?: Record<string, unknown> | undefined;
1162
+ when?: string | boolean | undefined;
384
1163
  task?: string | undefined;
385
1164
  flow?: string | undefined;
386
1165
  retries?: number | undefined;
387
1166
  retryDelay?: number | undefined;
388
1167
  retryOn?: string | undefined;
389
- when?: string | boolean | undefined;
390
1168
  ignore_failure?: boolean | undefined;
1169
+ checks?: {
1170
+ when: string | boolean;
1171
+ action: "error" | "warn" | "skip";
1172
+ message?: string | undefined;
1173
+ }[] | undefined;
391
1174
  }>;
392
1175
  description?: string | null | undefined;
1176
+ deprecated?: string | boolean | undefined;
1177
+ replaced_by?: string | undefined;
1178
+ checks?: {
1179
+ when: string | boolean;
1180
+ action: "error" | "warn" | "skip";
1181
+ message?: string | undefined;
1182
+ }[] | undefined;
393
1183
  on_start?: {
394
1184
  options?: Record<string, unknown> | undefined;
1185
+ when?: string | boolean | undefined;
395
1186
  task?: string | undefined;
396
1187
  flow?: string | undefined;
397
1188
  retries?: number | undefined;
398
1189
  retryDelay?: number | undefined;
399
1190
  retryOn?: string | undefined;
400
- when?: string | boolean | undefined;
401
1191
  ignore_failure?: boolean | undefined;
1192
+ checks?: {
1193
+ when: string | boolean;
1194
+ action: "error" | "warn" | "skip";
1195
+ message?: string | undefined;
1196
+ }[] | undefined;
402
1197
  }[] | undefined;
403
1198
  on_success?: {
404
1199
  options?: Record<string, unknown> | undefined;
1200
+ when?: string | boolean | undefined;
405
1201
  task?: string | undefined;
406
1202
  flow?: string | undefined;
407
1203
  retries?: number | undefined;
408
1204
  retryDelay?: number | undefined;
409
1205
  retryOn?: string | undefined;
410
- when?: string | boolean | undefined;
411
1206
  ignore_failure?: boolean | undefined;
1207
+ checks?: {
1208
+ when: string | boolean;
1209
+ action: "error" | "warn" | "skip";
1210
+ message?: string | undefined;
1211
+ }[] | undefined;
412
1212
  }[] | undefined;
413
1213
  on_failure?: {
414
1214
  options?: Record<string, unknown> | undefined;
1215
+ when?: string | boolean | undefined;
415
1216
  task?: string | undefined;
416
1217
  flow?: string | undefined;
417
1218
  retries?: number | undefined;
418
1219
  retryDelay?: number | undefined;
419
1220
  retryOn?: string | undefined;
420
- when?: string | boolean | undefined;
421
1221
  ignore_failure?: boolean | undefined;
1222
+ checks?: {
1223
+ when: string | boolean;
1224
+ action: "error" | "warn" | "skip";
1225
+ message?: string | undefined;
1226
+ }[] | undefined;
422
1227
  }[] | undefined;
423
1228
  finally?: {
424
1229
  options?: Record<string, unknown> | undefined;
1230
+ when?: string | boolean | undefined;
425
1231
  task?: string | undefined;
426
1232
  flow?: string | undefined;
427
1233
  retries?: number | undefined;
428
1234
  retryDelay?: number | undefined;
429
1235
  retryOn?: string | undefined;
430
- when?: string | boolean | undefined;
431
1236
  ignore_failure?: boolean | undefined;
1237
+ checks?: {
1238
+ when: string | boolean;
1239
+ action: "error" | "warn" | "skip";
1240
+ message?: string | undefined;
1241
+ }[] | undefined;
432
1242
  }[] | undefined;
433
1243
  rollback_on_failure?: boolean | undefined;
1244
+ options_scope?: "flat" | "step" | undefined;
434
1245
  }, {
435
1246
  description?: string | null | undefined;
1247
+ deprecated?: string | boolean | undefined;
1248
+ replaced_by?: string | undefined;
1249
+ checks?: {
1250
+ when: string | boolean;
1251
+ action: "error" | "warn" | "skip";
1252
+ message?: string | undefined;
1253
+ }[] | undefined;
436
1254
  steps?: Record<string, {
437
1255
  options?: Record<string, unknown> | undefined;
1256
+ when?: string | boolean | undefined;
438
1257
  task?: string | undefined;
439
1258
  flow?: string | undefined;
440
1259
  retries?: number | undefined;
441
1260
  retryDelay?: number | undefined;
442
1261
  retryOn?: string | undefined;
443
- when?: string | boolean | undefined;
444
1262
  ignore_failure?: boolean | undefined;
1263
+ checks?: {
1264
+ when: string | boolean;
1265
+ action: "error" | "warn" | "skip";
1266
+ message?: string | undefined;
1267
+ }[] | undefined;
445
1268
  }> | undefined;
446
1269
  on_start?: {
447
1270
  options?: Record<string, unknown> | undefined;
1271
+ when?: string | boolean | undefined;
448
1272
  task?: string | undefined;
449
1273
  flow?: string | undefined;
450
1274
  retries?: number | undefined;
451
1275
  retryDelay?: number | undefined;
452
1276
  retryOn?: string | undefined;
453
- when?: string | boolean | undefined;
454
1277
  ignore_failure?: boolean | undefined;
1278
+ checks?: {
1279
+ when: string | boolean;
1280
+ action: "error" | "warn" | "skip";
1281
+ message?: string | undefined;
1282
+ }[] | undefined;
455
1283
  }[] | undefined;
456
1284
  on_success?: {
457
1285
  options?: Record<string, unknown> | undefined;
1286
+ when?: string | boolean | undefined;
458
1287
  task?: string | undefined;
459
1288
  flow?: string | undefined;
460
1289
  retries?: number | undefined;
461
1290
  retryDelay?: number | undefined;
462
1291
  retryOn?: string | undefined;
463
- when?: string | boolean | undefined;
464
1292
  ignore_failure?: boolean | undefined;
1293
+ checks?: {
1294
+ when: string | boolean;
1295
+ action: "error" | "warn" | "skip";
1296
+ message?: string | undefined;
1297
+ }[] | undefined;
465
1298
  }[] | undefined;
466
1299
  on_failure?: {
467
1300
  options?: Record<string, unknown> | undefined;
1301
+ when?: string | boolean | undefined;
468
1302
  task?: string | undefined;
469
1303
  flow?: string | undefined;
470
1304
  retries?: number | undefined;
471
1305
  retryDelay?: number | undefined;
472
1306
  retryOn?: string | undefined;
473
- when?: string | boolean | undefined;
474
1307
  ignore_failure?: boolean | undefined;
1308
+ checks?: {
1309
+ when: string | boolean;
1310
+ action: "error" | "warn" | "skip";
1311
+ message?: string | undefined;
1312
+ }[] | undefined;
475
1313
  }[] | undefined;
476
1314
  finally?: {
477
1315
  options?: Record<string, unknown> | undefined;
1316
+ when?: string | boolean | undefined;
478
1317
  task?: string | undefined;
479
1318
  flow?: string | undefined;
480
1319
  retries?: number | undefined;
481
1320
  retryDelay?: number | undefined;
482
1321
  retryOn?: string | undefined;
483
- when?: string | boolean | undefined;
484
1322
  ignore_failure?: boolean | undefined;
1323
+ checks?: {
1324
+ when: string | boolean;
1325
+ action: "error" | "warn" | "skip";
1326
+ message?: string | undefined;
1327
+ }[] | undefined;
485
1328
  }[] | undefined;
486
1329
  rollback_on_failure?: boolean | undefined;
1330
+ options_scope?: "flat" | "step" | undefined;
487
1331
  }>;
488
1332
  /**
489
1333
  * A tool an agent may call. References an existing flowkit primitive — a `task`,
@@ -708,20 +1552,172 @@ export declare const EngineConfigSchema: z.ZodObject<{
708
1552
  /** Declarative hints surfaced in listings; not used by the runner. */
709
1553
  idempotent: z.ZodOptional<z.ZodBoolean>;
710
1554
  reversible: z.ZodOptional<z.ZodBoolean>;
1555
+ /**
1556
+ * Declared options. Refines (per option, field by field) any static
1557
+ * `optionsSchema` on the task class, and step options are validated against
1558
+ * the result before the task runs.
1559
+ */
1560
+ options_schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1561
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
1562
+ description: z.ZodOptional<z.ZodString>;
1563
+ /** The option must be present (after defaults and every override layer). */
1564
+ required: z.ZodOptional<z.ZodBoolean>;
1565
+ /** Used when no layer supplies the option. Lowest precedence of all. */
1566
+ default: z.ZodOptional<z.ZodUnknown>;
1567
+ enum: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1568
+ const: z.ZodOptional<z.ZodUnknown>;
1569
+ minimum: z.ZodOptional<z.ZodNumber>;
1570
+ maximum: z.ZodOptional<z.ZodNumber>;
1571
+ exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
1572
+ exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
1573
+ minLength: z.ZodOptional<z.ZodNumber>;
1574
+ maxLength: z.ZodOptional<z.ZodNumber>;
1575
+ pattern: z.ZodOptional<z.ZodString>;
1576
+ minItems: z.ZodOptional<z.ZodNumber>;
1577
+ maxItems: z.ZodOptional<z.ZodNumber>;
1578
+ /** JSON Schema for array elements. */
1579
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1580
+ /** JSON Schema properties for an object-valued option. */
1581
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1582
+ additionalProperties: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
1583
+ nullable: z.ZodOptional<z.ZodBoolean>;
1584
+ }, "strip", z.ZodTypeAny, {
1585
+ minimum?: number | undefined;
1586
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1587
+ maximum?: number | undefined;
1588
+ description?: string | undefined;
1589
+ required?: boolean | undefined;
1590
+ default?: unknown;
1591
+ enum?: unknown[] | undefined;
1592
+ const?: unknown;
1593
+ exclusiveMinimum?: number | undefined;
1594
+ exclusiveMaximum?: number | undefined;
1595
+ minLength?: number | undefined;
1596
+ maxLength?: number | undefined;
1597
+ pattern?: string | undefined;
1598
+ minItems?: number | undefined;
1599
+ maxItems?: number | undefined;
1600
+ items?: Record<string, unknown> | undefined;
1601
+ properties?: Record<string, unknown> | undefined;
1602
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
1603
+ nullable?: boolean | undefined;
1604
+ }, {
1605
+ minimum?: number | undefined;
1606
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1607
+ maximum?: number | undefined;
1608
+ description?: string | undefined;
1609
+ required?: boolean | undefined;
1610
+ default?: unknown;
1611
+ enum?: unknown[] | undefined;
1612
+ const?: unknown;
1613
+ exclusiveMinimum?: number | undefined;
1614
+ exclusiveMaximum?: number | undefined;
1615
+ minLength?: number | undefined;
1616
+ maxLength?: number | undefined;
1617
+ pattern?: string | undefined;
1618
+ minItems?: number | undefined;
1619
+ maxItems?: number | undefined;
1620
+ items?: Record<string, unknown> | undefined;
1621
+ properties?: Record<string, unknown> | undefined;
1622
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
1623
+ nullable?: boolean | undefined;
1624
+ }>>>;
1625
+ /** Declared outputs, for `describe` and docs. Not enforced. */
1626
+ outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1627
+ type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, z.ZodArray<z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>, "many">]>>;
1628
+ description: z.ZodOptional<z.ZodString>;
1629
+ items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1630
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1631
+ }, "strip", z.ZodTypeAny, {
1632
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1633
+ description?: string | undefined;
1634
+ items?: Record<string, unknown> | undefined;
1635
+ properties?: Record<string, unknown> | undefined;
1636
+ }, {
1637
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1638
+ description?: string | undefined;
1639
+ items?: Record<string, unknown> | undefined;
1640
+ properties?: Record<string, unknown> | undefined;
1641
+ }>>>;
1642
+ /**
1643
+ * Mark the task deprecated: `true`, or a string saying why. Running or
1644
+ * planning it adds a `deprecated` warning to the result; it still runs.
1645
+ */
1646
+ deprecated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
1647
+ /** The task to use instead, named in the deprecation warning. */
1648
+ replaced_by: z.ZodOptional<z.ZodString>;
711
1649
  }, "strip", z.ZodTypeAny, {
712
1650
  options: Record<string, unknown>;
713
- class_path?: string | undefined;
714
1651
  description?: string | undefined;
1652
+ class_path?: string | undefined;
715
1653
  group?: string | undefined;
716
1654
  idempotent?: boolean | undefined;
717
1655
  reversible?: boolean | undefined;
1656
+ options_schema?: Record<string, {
1657
+ minimum?: number | undefined;
1658
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1659
+ maximum?: number | undefined;
1660
+ description?: string | undefined;
1661
+ required?: boolean | undefined;
1662
+ default?: unknown;
1663
+ enum?: unknown[] | undefined;
1664
+ const?: unknown;
1665
+ exclusiveMinimum?: number | undefined;
1666
+ exclusiveMaximum?: number | undefined;
1667
+ minLength?: number | undefined;
1668
+ maxLength?: number | undefined;
1669
+ pattern?: string | undefined;
1670
+ minItems?: number | undefined;
1671
+ maxItems?: number | undefined;
1672
+ items?: Record<string, unknown> | undefined;
1673
+ properties?: Record<string, unknown> | undefined;
1674
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
1675
+ nullable?: boolean | undefined;
1676
+ }> | undefined;
1677
+ outputs?: Record<string, {
1678
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1679
+ description?: string | undefined;
1680
+ items?: Record<string, unknown> | undefined;
1681
+ properties?: Record<string, unknown> | undefined;
1682
+ }> | undefined;
1683
+ deprecated?: string | boolean | undefined;
1684
+ replaced_by?: string | undefined;
718
1685
  }, {
719
1686
  options?: Record<string, unknown> | undefined;
720
- class_path?: string | undefined;
721
1687
  description?: string | undefined;
1688
+ class_path?: string | undefined;
722
1689
  group?: string | undefined;
723
1690
  idempotent?: boolean | undefined;
724
1691
  reversible?: boolean | undefined;
1692
+ options_schema?: Record<string, {
1693
+ minimum?: number | undefined;
1694
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1695
+ maximum?: number | undefined;
1696
+ description?: string | undefined;
1697
+ required?: boolean | undefined;
1698
+ default?: unknown;
1699
+ enum?: unknown[] | undefined;
1700
+ const?: unknown;
1701
+ exclusiveMinimum?: number | undefined;
1702
+ exclusiveMaximum?: number | undefined;
1703
+ minLength?: number | undefined;
1704
+ maxLength?: number | undefined;
1705
+ pattern?: string | undefined;
1706
+ minItems?: number | undefined;
1707
+ maxItems?: number | undefined;
1708
+ items?: Record<string, unknown> | undefined;
1709
+ properties?: Record<string, unknown> | undefined;
1710
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
1711
+ nullable?: boolean | undefined;
1712
+ }> | undefined;
1713
+ outputs?: Record<string, {
1714
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
1715
+ description?: string | undefined;
1716
+ items?: Record<string, unknown> | undefined;
1717
+ properties?: Record<string, unknown> | undefined;
1718
+ }> | undefined;
1719
+ deprecated?: string | boolean | undefined;
1720
+ replaced_by?: string | undefined;
725
1721
  }>>>;
726
1722
  flows: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
727
1723
  /**
@@ -749,42 +1745,80 @@ export declare const EngineConfigSchema: z.ZodObject<{
749
1745
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
750
1746
  /** If true, a failure of this step is recorded but does not abort the flow. */
751
1747
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
1748
+ /**
1749
+ * Preflight checks, evaluated in order just before the step would run (after
1750
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
1751
+ */
1752
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1753
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
1754
+ action: z.ZodEnum<["error", "warn", "skip"]>;
1755
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
1756
+ message: z.ZodOptional<z.ZodString>;
1757
+ }, "strip", z.ZodTypeAny, {
1758
+ when: string | boolean;
1759
+ action: "error" | "warn" | "skip";
1760
+ message?: string | undefined;
1761
+ }, {
1762
+ when: string | boolean;
1763
+ action: "error" | "warn" | "skip";
1764
+ message?: string | undefined;
1765
+ }>, "many">>;
752
1766
  }, "strip", z.ZodTypeAny, {
753
1767
  options?: Record<string, unknown> | undefined;
1768
+ when?: string | boolean | undefined;
754
1769
  task?: string | undefined;
755
1770
  flow?: string | undefined;
756
1771
  retries?: number | undefined;
757
1772
  retryDelay?: number | undefined;
758
1773
  retryOn?: string | undefined;
759
- when?: string | boolean | undefined;
760
1774
  ignore_failure?: boolean | undefined;
1775
+ checks?: {
1776
+ when: string | boolean;
1777
+ action: "error" | "warn" | "skip";
1778
+ message?: string | undefined;
1779
+ }[] | undefined;
761
1780
  }, {
762
1781
  options?: Record<string, unknown> | undefined;
1782
+ when?: string | boolean | undefined;
763
1783
  task?: string | undefined;
764
1784
  flow?: string | undefined;
765
1785
  retries?: number | undefined;
766
1786
  retryDelay?: number | undefined;
767
1787
  retryOn?: string | undefined;
768
- when?: string | boolean | undefined;
769
1788
  ignore_failure?: boolean | undefined;
1789
+ checks?: {
1790
+ when: string | boolean;
1791
+ action: "error" | "warn" | "skip";
1792
+ message?: string | undefined;
1793
+ }[] | undefined;
770
1794
  }>, {
771
1795
  options?: Record<string, unknown> | undefined;
1796
+ when?: string | boolean | undefined;
772
1797
  task?: string | undefined;
773
1798
  flow?: string | undefined;
774
1799
  retries?: number | undefined;
775
1800
  retryDelay?: number | undefined;
776
1801
  retryOn?: string | undefined;
777
- when?: string | boolean | undefined;
778
1802
  ignore_failure?: boolean | undefined;
1803
+ checks?: {
1804
+ when: string | boolean;
1805
+ action: "error" | "warn" | "skip";
1806
+ message?: string | undefined;
1807
+ }[] | undefined;
779
1808
  }, {
780
1809
  options?: Record<string, unknown> | undefined;
1810
+ when?: string | boolean | undefined;
781
1811
  task?: string | undefined;
782
1812
  flow?: string | undefined;
783
1813
  retries?: number | undefined;
784
1814
  retryDelay?: number | undefined;
785
1815
  retryOn?: string | undefined;
786
- when?: string | boolean | undefined;
787
1816
  ignore_failure?: boolean | undefined;
1817
+ checks?: {
1818
+ when: string | boolean;
1819
+ action: "error" | "warn" | "skip";
1820
+ message?: string | undefined;
1821
+ }[] | undefined;
788
1822
  }>>>;
789
1823
  /** Runs before the first step. Failure fails the flow before steps execute. */
790
1824
  on_start: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -806,42 +1840,80 @@ export declare const EngineConfigSchema: z.ZodObject<{
806
1840
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
807
1841
  /** If true, a failure of this step is recorded but does not abort the flow. */
808
1842
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
1843
+ /**
1844
+ * Preflight checks, evaluated in order just before the step would run (after
1845
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
1846
+ */
1847
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1848
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
1849
+ action: z.ZodEnum<["error", "warn", "skip"]>;
1850
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
1851
+ message: z.ZodOptional<z.ZodString>;
1852
+ }, "strip", z.ZodTypeAny, {
1853
+ when: string | boolean;
1854
+ action: "error" | "warn" | "skip";
1855
+ message?: string | undefined;
1856
+ }, {
1857
+ when: string | boolean;
1858
+ action: "error" | "warn" | "skip";
1859
+ message?: string | undefined;
1860
+ }>, "many">>;
809
1861
  }, "strip", z.ZodTypeAny, {
810
1862
  options?: Record<string, unknown> | undefined;
1863
+ when?: string | boolean | undefined;
811
1864
  task?: string | undefined;
812
1865
  flow?: string | undefined;
813
1866
  retries?: number | undefined;
814
1867
  retryDelay?: number | undefined;
815
1868
  retryOn?: string | undefined;
816
- when?: string | boolean | undefined;
817
1869
  ignore_failure?: boolean | undefined;
1870
+ checks?: {
1871
+ when: string | boolean;
1872
+ action: "error" | "warn" | "skip";
1873
+ message?: string | undefined;
1874
+ }[] | undefined;
818
1875
  }, {
819
1876
  options?: Record<string, unknown> | undefined;
1877
+ when?: string | boolean | undefined;
820
1878
  task?: string | undefined;
821
1879
  flow?: string | undefined;
822
1880
  retries?: number | undefined;
823
1881
  retryDelay?: number | undefined;
824
1882
  retryOn?: string | undefined;
825
- when?: string | boolean | undefined;
826
1883
  ignore_failure?: boolean | undefined;
1884
+ checks?: {
1885
+ when: string | boolean;
1886
+ action: "error" | "warn" | "skip";
1887
+ message?: string | undefined;
1888
+ }[] | undefined;
827
1889
  }>, {
828
1890
  options?: Record<string, unknown> | undefined;
1891
+ when?: string | boolean | undefined;
829
1892
  task?: string | undefined;
830
1893
  flow?: string | undefined;
831
1894
  retries?: number | undefined;
832
1895
  retryDelay?: number | undefined;
833
1896
  retryOn?: string | undefined;
834
- when?: string | boolean | undefined;
835
1897
  ignore_failure?: boolean | undefined;
1898
+ checks?: {
1899
+ when: string | boolean;
1900
+ action: "error" | "warn" | "skip";
1901
+ message?: string | undefined;
1902
+ }[] | undefined;
836
1903
  }, {
837
1904
  options?: Record<string, unknown> | undefined;
1905
+ when?: string | boolean | undefined;
838
1906
  task?: string | undefined;
839
1907
  flow?: string | undefined;
840
1908
  retries?: number | undefined;
841
1909
  retryDelay?: number | undefined;
842
1910
  retryOn?: string | undefined;
843
- when?: string | boolean | undefined;
844
1911
  ignore_failure?: boolean | undefined;
1912
+ checks?: {
1913
+ when: string | boolean;
1914
+ action: "error" | "warn" | "skip";
1915
+ message?: string | undefined;
1916
+ }[] | undefined;
845
1917
  }>, "many">>;
846
1918
  /** Runs after all steps succeed. */
847
1919
  on_success: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -863,42 +1935,80 @@ export declare const EngineConfigSchema: z.ZodObject<{
863
1935
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
864
1936
  /** If true, a failure of this step is recorded but does not abort the flow. */
865
1937
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
1938
+ /**
1939
+ * Preflight checks, evaluated in order just before the step would run (after
1940
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
1941
+ */
1942
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1943
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
1944
+ action: z.ZodEnum<["error", "warn", "skip"]>;
1945
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
1946
+ message: z.ZodOptional<z.ZodString>;
1947
+ }, "strip", z.ZodTypeAny, {
1948
+ when: string | boolean;
1949
+ action: "error" | "warn" | "skip";
1950
+ message?: string | undefined;
1951
+ }, {
1952
+ when: string | boolean;
1953
+ action: "error" | "warn" | "skip";
1954
+ message?: string | undefined;
1955
+ }>, "many">>;
866
1956
  }, "strip", z.ZodTypeAny, {
867
1957
  options?: Record<string, unknown> | undefined;
1958
+ when?: string | boolean | undefined;
868
1959
  task?: string | undefined;
869
1960
  flow?: string | undefined;
870
1961
  retries?: number | undefined;
871
1962
  retryDelay?: number | undefined;
872
1963
  retryOn?: string | undefined;
873
- when?: string | boolean | undefined;
874
1964
  ignore_failure?: boolean | undefined;
1965
+ checks?: {
1966
+ when: string | boolean;
1967
+ action: "error" | "warn" | "skip";
1968
+ message?: string | undefined;
1969
+ }[] | undefined;
875
1970
  }, {
876
1971
  options?: Record<string, unknown> | undefined;
1972
+ when?: string | boolean | undefined;
877
1973
  task?: string | undefined;
878
1974
  flow?: string | undefined;
879
1975
  retries?: number | undefined;
880
1976
  retryDelay?: number | undefined;
881
1977
  retryOn?: string | undefined;
882
- when?: string | boolean | undefined;
883
1978
  ignore_failure?: boolean | undefined;
1979
+ checks?: {
1980
+ when: string | boolean;
1981
+ action: "error" | "warn" | "skip";
1982
+ message?: string | undefined;
1983
+ }[] | undefined;
884
1984
  }>, {
885
1985
  options?: Record<string, unknown> | undefined;
1986
+ when?: string | boolean | undefined;
886
1987
  task?: string | undefined;
887
1988
  flow?: string | undefined;
888
1989
  retries?: number | undefined;
889
1990
  retryDelay?: number | undefined;
890
1991
  retryOn?: string | undefined;
891
- when?: string | boolean | undefined;
892
1992
  ignore_failure?: boolean | undefined;
1993
+ checks?: {
1994
+ when: string | boolean;
1995
+ action: "error" | "warn" | "skip";
1996
+ message?: string | undefined;
1997
+ }[] | undefined;
893
1998
  }, {
894
1999
  options?: Record<string, unknown> | undefined;
2000
+ when?: string | boolean | undefined;
895
2001
  task?: string | undefined;
896
2002
  flow?: string | undefined;
897
2003
  retries?: number | undefined;
898
2004
  retryDelay?: number | undefined;
899
2005
  retryOn?: string | undefined;
900
- when?: string | boolean | undefined;
901
2006
  ignore_failure?: boolean | undefined;
2007
+ checks?: {
2008
+ when: string | boolean;
2009
+ action: "error" | "warn" | "skip";
2010
+ message?: string | undefined;
2011
+ }[] | undefined;
902
2012
  }>, "many">>;
903
2013
  /** Runs on any step failure. */
904
2014
  on_failure: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -920,42 +2030,80 @@ export declare const EngineConfigSchema: z.ZodObject<{
920
2030
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
921
2031
  /** If true, a failure of this step is recorded but does not abort the flow. */
922
2032
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
2033
+ /**
2034
+ * Preflight checks, evaluated in order just before the step would run (after
2035
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
2036
+ */
2037
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2038
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
2039
+ action: z.ZodEnum<["error", "warn", "skip"]>;
2040
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
2041
+ message: z.ZodOptional<z.ZodString>;
2042
+ }, "strip", z.ZodTypeAny, {
2043
+ when: string | boolean;
2044
+ action: "error" | "warn" | "skip";
2045
+ message?: string | undefined;
2046
+ }, {
2047
+ when: string | boolean;
2048
+ action: "error" | "warn" | "skip";
2049
+ message?: string | undefined;
2050
+ }>, "many">>;
923
2051
  }, "strip", z.ZodTypeAny, {
924
2052
  options?: Record<string, unknown> | undefined;
2053
+ when?: string | boolean | undefined;
925
2054
  task?: string | undefined;
926
2055
  flow?: string | undefined;
927
2056
  retries?: number | undefined;
928
2057
  retryDelay?: number | undefined;
929
2058
  retryOn?: string | undefined;
930
- when?: string | boolean | undefined;
931
2059
  ignore_failure?: boolean | undefined;
2060
+ checks?: {
2061
+ when: string | boolean;
2062
+ action: "error" | "warn" | "skip";
2063
+ message?: string | undefined;
2064
+ }[] | undefined;
932
2065
  }, {
933
2066
  options?: Record<string, unknown> | undefined;
2067
+ when?: string | boolean | undefined;
934
2068
  task?: string | undefined;
935
2069
  flow?: string | undefined;
936
2070
  retries?: number | undefined;
937
2071
  retryDelay?: number | undefined;
938
2072
  retryOn?: string | undefined;
939
- when?: string | boolean | undefined;
940
2073
  ignore_failure?: boolean | undefined;
2074
+ checks?: {
2075
+ when: string | boolean;
2076
+ action: "error" | "warn" | "skip";
2077
+ message?: string | undefined;
2078
+ }[] | undefined;
941
2079
  }>, {
942
2080
  options?: Record<string, unknown> | undefined;
2081
+ when?: string | boolean | undefined;
943
2082
  task?: string | undefined;
944
2083
  flow?: string | undefined;
945
2084
  retries?: number | undefined;
946
2085
  retryDelay?: number | undefined;
947
2086
  retryOn?: string | undefined;
948
- when?: string | boolean | undefined;
949
2087
  ignore_failure?: boolean | undefined;
2088
+ checks?: {
2089
+ when: string | boolean;
2090
+ action: "error" | "warn" | "skip";
2091
+ message?: string | undefined;
2092
+ }[] | undefined;
950
2093
  }, {
951
2094
  options?: Record<string, unknown> | undefined;
2095
+ when?: string | boolean | undefined;
952
2096
  task?: string | undefined;
953
2097
  flow?: string | undefined;
954
2098
  retries?: number | undefined;
955
2099
  retryDelay?: number | undefined;
956
2100
  retryOn?: string | undefined;
957
- when?: string | boolean | undefined;
958
2101
  ignore_failure?: boolean | undefined;
2102
+ checks?: {
2103
+ when: string | boolean;
2104
+ action: "error" | "warn" | "skip";
2105
+ message?: string | undefined;
2106
+ }[] | undefined;
959
2107
  }>, "many">>;
960
2108
  /** Runs after success or failure, after on_success/on_failure. */
961
2109
  finally: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -977,151 +2125,281 @@ export declare const EngineConfigSchema: z.ZodObject<{
977
2125
  when: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
978
2126
  /** If true, a failure of this step is recorded but does not abort the flow. */
979
2127
  ignore_failure: z.ZodOptional<z.ZodBoolean>;
2128
+ /**
2129
+ * Preflight checks, evaluated in order just before the step would run (after
2130
+ * `when`), and reported without running anything by `FlowRunner.preflight`.
2131
+ */
2132
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2133
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
2134
+ action: z.ZodEnum<["error", "warn", "skip"]>;
2135
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
2136
+ message: z.ZodOptional<z.ZodString>;
2137
+ }, "strip", z.ZodTypeAny, {
2138
+ when: string | boolean;
2139
+ action: "error" | "warn" | "skip";
2140
+ message?: string | undefined;
2141
+ }, {
2142
+ when: string | boolean;
2143
+ action: "error" | "warn" | "skip";
2144
+ message?: string | undefined;
2145
+ }>, "many">>;
980
2146
  }, "strip", z.ZodTypeAny, {
981
2147
  options?: Record<string, unknown> | undefined;
2148
+ when?: string | boolean | undefined;
982
2149
  task?: string | undefined;
983
2150
  flow?: string | undefined;
984
2151
  retries?: number | undefined;
985
2152
  retryDelay?: number | undefined;
986
2153
  retryOn?: string | undefined;
987
- when?: string | boolean | undefined;
988
2154
  ignore_failure?: boolean | undefined;
2155
+ checks?: {
2156
+ when: string | boolean;
2157
+ action: "error" | "warn" | "skip";
2158
+ message?: string | undefined;
2159
+ }[] | undefined;
989
2160
  }, {
990
2161
  options?: Record<string, unknown> | undefined;
2162
+ when?: string | boolean | undefined;
991
2163
  task?: string | undefined;
992
2164
  flow?: string | undefined;
993
2165
  retries?: number | undefined;
994
2166
  retryDelay?: number | undefined;
995
2167
  retryOn?: string | undefined;
996
- when?: string | boolean | undefined;
997
2168
  ignore_failure?: boolean | undefined;
2169
+ checks?: {
2170
+ when: string | boolean;
2171
+ action: "error" | "warn" | "skip";
2172
+ message?: string | undefined;
2173
+ }[] | undefined;
998
2174
  }>, {
999
2175
  options?: Record<string, unknown> | undefined;
2176
+ when?: string | boolean | undefined;
1000
2177
  task?: string | undefined;
1001
2178
  flow?: string | undefined;
1002
2179
  retries?: number | undefined;
1003
2180
  retryDelay?: number | undefined;
1004
2181
  retryOn?: string | undefined;
1005
- when?: string | boolean | undefined;
1006
2182
  ignore_failure?: boolean | undefined;
2183
+ checks?: {
2184
+ when: string | boolean;
2185
+ action: "error" | "warn" | "skip";
2186
+ message?: string | undefined;
2187
+ }[] | undefined;
1007
2188
  }, {
1008
2189
  options?: Record<string, unknown> | undefined;
2190
+ when?: string | boolean | undefined;
1009
2191
  task?: string | undefined;
1010
2192
  flow?: string | undefined;
1011
2193
  retries?: number | undefined;
1012
2194
  retryDelay?: number | undefined;
1013
2195
  retryOn?: string | undefined;
1014
- when?: string | boolean | undefined;
1015
2196
  ignore_failure?: boolean | undefined;
2197
+ checks?: {
2198
+ when: string | boolean;
2199
+ action: "error" | "warn" | "skip";
2200
+ message?: string | undefined;
2201
+ }[] | undefined;
1016
2202
  }>, "many">>;
1017
2203
  /** If true, invoke rollback records from completed steps in reverse order on failure. */
1018
2204
  rollback_on_failure: z.ZodOptional<z.ZodBoolean>;
2205
+ /** Preflight checks for the whole flow, evaluated before any of its steps or hooks. */
2206
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2207
+ when: z.ZodUnion<[z.ZodString, z.ZodBoolean]>;
2208
+ action: z.ZodEnum<["error", "warn", "skip"]>;
2209
+ /** Shown in the error, skip reason or warning. Defaults to one naming the condition. */
2210
+ message: z.ZodOptional<z.ZodString>;
2211
+ }, "strip", z.ZodTypeAny, {
2212
+ when: string | boolean;
2213
+ action: "error" | "warn" | "skip";
2214
+ message?: string | undefined;
2215
+ }, {
2216
+ when: string | boolean;
2217
+ action: "error" | "warn" | "skip";
2218
+ message?: string | undefined;
2219
+ }>, "many">>;
2220
+ /**
2221
+ * How runtime `params` reach the steps of a run started on this flow.
2222
+ * `flat` (the default): every key goes to every step. `step`: each key is a
2223
+ * step selector (a task name or a step path such as `2` or `2/1`) whose value
2224
+ * is the options for the matching steps only.
2225
+ */
2226
+ options_scope: z.ZodOptional<z.ZodEnum<["flat", "step"]>>;
2227
+ /** Mark the flow deprecated: `true`, or a string saying why. It still runs. */
2228
+ deprecated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
2229
+ /** The flow to use instead, named in the deprecation warning. */
2230
+ replaced_by: z.ZodOptional<z.ZodString>;
1019
2231
  }, "strip", z.ZodTypeAny, {
1020
2232
  steps: Record<string, {
1021
2233
  options?: Record<string, unknown> | undefined;
2234
+ when?: string | boolean | undefined;
1022
2235
  task?: string | undefined;
1023
2236
  flow?: string | undefined;
1024
2237
  retries?: number | undefined;
1025
2238
  retryDelay?: number | undefined;
1026
2239
  retryOn?: string | undefined;
1027
- when?: string | boolean | undefined;
1028
2240
  ignore_failure?: boolean | undefined;
2241
+ checks?: {
2242
+ when: string | boolean;
2243
+ action: "error" | "warn" | "skip";
2244
+ message?: string | undefined;
2245
+ }[] | undefined;
1029
2246
  }>;
1030
2247
  description?: string | null | undefined;
2248
+ deprecated?: string | boolean | undefined;
2249
+ replaced_by?: string | undefined;
2250
+ checks?: {
2251
+ when: string | boolean;
2252
+ action: "error" | "warn" | "skip";
2253
+ message?: string | undefined;
2254
+ }[] | undefined;
1031
2255
  on_start?: {
1032
2256
  options?: Record<string, unknown> | undefined;
2257
+ when?: string | boolean | undefined;
1033
2258
  task?: string | undefined;
1034
2259
  flow?: string | undefined;
1035
2260
  retries?: number | undefined;
1036
2261
  retryDelay?: number | undefined;
1037
2262
  retryOn?: string | undefined;
1038
- when?: string | boolean | undefined;
1039
2263
  ignore_failure?: boolean | undefined;
2264
+ checks?: {
2265
+ when: string | boolean;
2266
+ action: "error" | "warn" | "skip";
2267
+ message?: string | undefined;
2268
+ }[] | undefined;
1040
2269
  }[] | undefined;
1041
2270
  on_success?: {
1042
2271
  options?: Record<string, unknown> | undefined;
2272
+ when?: string | boolean | undefined;
1043
2273
  task?: string | undefined;
1044
2274
  flow?: string | undefined;
1045
2275
  retries?: number | undefined;
1046
2276
  retryDelay?: number | undefined;
1047
2277
  retryOn?: string | undefined;
1048
- when?: string | boolean | undefined;
1049
2278
  ignore_failure?: boolean | undefined;
2279
+ checks?: {
2280
+ when: string | boolean;
2281
+ action: "error" | "warn" | "skip";
2282
+ message?: string | undefined;
2283
+ }[] | undefined;
1050
2284
  }[] | undefined;
1051
2285
  on_failure?: {
1052
2286
  options?: Record<string, unknown> | undefined;
2287
+ when?: string | boolean | undefined;
1053
2288
  task?: string | undefined;
1054
2289
  flow?: string | undefined;
1055
2290
  retries?: number | undefined;
1056
2291
  retryDelay?: number | undefined;
1057
2292
  retryOn?: string | undefined;
1058
- when?: string | boolean | undefined;
1059
2293
  ignore_failure?: boolean | undefined;
2294
+ checks?: {
2295
+ when: string | boolean;
2296
+ action: "error" | "warn" | "skip";
2297
+ message?: string | undefined;
2298
+ }[] | undefined;
1060
2299
  }[] | undefined;
1061
2300
  finally?: {
1062
2301
  options?: Record<string, unknown> | undefined;
2302
+ when?: string | boolean | undefined;
1063
2303
  task?: string | undefined;
1064
2304
  flow?: string | undefined;
1065
2305
  retries?: number | undefined;
1066
2306
  retryDelay?: number | undefined;
1067
2307
  retryOn?: string | undefined;
1068
- when?: string | boolean | undefined;
1069
2308
  ignore_failure?: boolean | undefined;
2309
+ checks?: {
2310
+ when: string | boolean;
2311
+ action: "error" | "warn" | "skip";
2312
+ message?: string | undefined;
2313
+ }[] | undefined;
1070
2314
  }[] | undefined;
1071
2315
  rollback_on_failure?: boolean | undefined;
2316
+ options_scope?: "flat" | "step" | undefined;
1072
2317
  }, {
1073
2318
  description?: string | null | undefined;
2319
+ deprecated?: string | boolean | undefined;
2320
+ replaced_by?: string | undefined;
2321
+ checks?: {
2322
+ when: string | boolean;
2323
+ action: "error" | "warn" | "skip";
2324
+ message?: string | undefined;
2325
+ }[] | undefined;
1074
2326
  steps?: Record<string, {
1075
2327
  options?: Record<string, unknown> | undefined;
2328
+ when?: string | boolean | undefined;
1076
2329
  task?: string | undefined;
1077
2330
  flow?: string | undefined;
1078
2331
  retries?: number | undefined;
1079
2332
  retryDelay?: number | undefined;
1080
2333
  retryOn?: string | undefined;
1081
- when?: string | boolean | undefined;
1082
2334
  ignore_failure?: boolean | undefined;
2335
+ checks?: {
2336
+ when: string | boolean;
2337
+ action: "error" | "warn" | "skip";
2338
+ message?: string | undefined;
2339
+ }[] | undefined;
1083
2340
  }> | undefined;
1084
2341
  on_start?: {
1085
2342
  options?: Record<string, unknown> | undefined;
2343
+ when?: string | boolean | undefined;
1086
2344
  task?: string | undefined;
1087
2345
  flow?: string | undefined;
1088
2346
  retries?: number | undefined;
1089
2347
  retryDelay?: number | undefined;
1090
2348
  retryOn?: string | undefined;
1091
- when?: string | boolean | undefined;
1092
2349
  ignore_failure?: boolean | undefined;
2350
+ checks?: {
2351
+ when: string | boolean;
2352
+ action: "error" | "warn" | "skip";
2353
+ message?: string | undefined;
2354
+ }[] | undefined;
1093
2355
  }[] | undefined;
1094
2356
  on_success?: {
1095
2357
  options?: Record<string, unknown> | undefined;
2358
+ when?: string | boolean | undefined;
1096
2359
  task?: string | undefined;
1097
2360
  flow?: string | undefined;
1098
2361
  retries?: number | undefined;
1099
2362
  retryDelay?: number | undefined;
1100
2363
  retryOn?: string | undefined;
1101
- when?: string | boolean | undefined;
1102
2364
  ignore_failure?: boolean | undefined;
2365
+ checks?: {
2366
+ when: string | boolean;
2367
+ action: "error" | "warn" | "skip";
2368
+ message?: string | undefined;
2369
+ }[] | undefined;
1103
2370
  }[] | undefined;
1104
2371
  on_failure?: {
1105
2372
  options?: Record<string, unknown> | undefined;
2373
+ when?: string | boolean | undefined;
1106
2374
  task?: string | undefined;
1107
2375
  flow?: string | undefined;
1108
2376
  retries?: number | undefined;
1109
2377
  retryDelay?: number | undefined;
1110
2378
  retryOn?: string | undefined;
1111
- when?: string | boolean | undefined;
1112
2379
  ignore_failure?: boolean | undefined;
2380
+ checks?: {
2381
+ when: string | boolean;
2382
+ action: "error" | "warn" | "skip";
2383
+ message?: string | undefined;
2384
+ }[] | undefined;
1113
2385
  }[] | undefined;
1114
2386
  finally?: {
1115
2387
  options?: Record<string, unknown> | undefined;
2388
+ when?: string | boolean | undefined;
1116
2389
  task?: string | undefined;
1117
2390
  flow?: string | undefined;
1118
2391
  retries?: number | undefined;
1119
2392
  retryDelay?: number | undefined;
1120
2393
  retryOn?: string | undefined;
1121
- when?: string | boolean | undefined;
1122
2394
  ignore_failure?: boolean | undefined;
2395
+ checks?: {
2396
+ when: string | boolean;
2397
+ action: "error" | "warn" | "skip";
2398
+ message?: string | undefined;
2399
+ }[] | undefined;
1123
2400
  }[] | undefined;
1124
2401
  rollback_on_failure?: boolean | undefined;
2402
+ options_scope?: "flat" | "step" | undefined;
1125
2403
  }>>>;
1126
2404
  agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1127
2405
  description: z.ZodOptional<z.ZodString>;
@@ -1259,65 +2537,127 @@ export declare const EngineConfigSchema: z.ZodObject<{
1259
2537
  }, "strip", z.ZodTypeAny, {
1260
2538
  tasks: Record<string, {
1261
2539
  options: Record<string, unknown>;
1262
- class_path?: string | undefined;
1263
2540
  description?: string | undefined;
2541
+ class_path?: string | undefined;
1264
2542
  group?: string | undefined;
1265
2543
  idempotent?: boolean | undefined;
1266
2544
  reversible?: boolean | undefined;
2545
+ options_schema?: Record<string, {
2546
+ minimum?: number | undefined;
2547
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
2548
+ maximum?: number | undefined;
2549
+ description?: string | undefined;
2550
+ required?: boolean | undefined;
2551
+ default?: unknown;
2552
+ enum?: unknown[] | undefined;
2553
+ const?: unknown;
2554
+ exclusiveMinimum?: number | undefined;
2555
+ exclusiveMaximum?: number | undefined;
2556
+ minLength?: number | undefined;
2557
+ maxLength?: number | undefined;
2558
+ pattern?: string | undefined;
2559
+ minItems?: number | undefined;
2560
+ maxItems?: number | undefined;
2561
+ items?: Record<string, unknown> | undefined;
2562
+ properties?: Record<string, unknown> | undefined;
2563
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
2564
+ nullable?: boolean | undefined;
2565
+ }> | undefined;
2566
+ outputs?: Record<string, {
2567
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
2568
+ description?: string | undefined;
2569
+ items?: Record<string, unknown> | undefined;
2570
+ properties?: Record<string, unknown> | undefined;
2571
+ }> | undefined;
2572
+ deprecated?: string | boolean | undefined;
2573
+ replaced_by?: string | undefined;
1267
2574
  }>;
1268
2575
  flows: Record<string, {
1269
2576
  steps: Record<string, {
1270
2577
  options?: Record<string, unknown> | undefined;
2578
+ when?: string | boolean | undefined;
1271
2579
  task?: string | undefined;
1272
2580
  flow?: string | undefined;
1273
2581
  retries?: number | undefined;
1274
2582
  retryDelay?: number | undefined;
1275
2583
  retryOn?: string | undefined;
1276
- when?: string | boolean | undefined;
1277
2584
  ignore_failure?: boolean | undefined;
2585
+ checks?: {
2586
+ when: string | boolean;
2587
+ action: "error" | "warn" | "skip";
2588
+ message?: string | undefined;
2589
+ }[] | undefined;
1278
2590
  }>;
1279
2591
  description?: string | null | undefined;
2592
+ deprecated?: string | boolean | undefined;
2593
+ replaced_by?: string | undefined;
2594
+ checks?: {
2595
+ when: string | boolean;
2596
+ action: "error" | "warn" | "skip";
2597
+ message?: string | undefined;
2598
+ }[] | undefined;
1280
2599
  on_start?: {
1281
2600
  options?: Record<string, unknown> | undefined;
2601
+ when?: string | boolean | undefined;
1282
2602
  task?: string | undefined;
1283
2603
  flow?: string | undefined;
1284
2604
  retries?: number | undefined;
1285
2605
  retryDelay?: number | undefined;
1286
2606
  retryOn?: string | undefined;
1287
- when?: string | boolean | undefined;
1288
2607
  ignore_failure?: boolean | undefined;
2608
+ checks?: {
2609
+ when: string | boolean;
2610
+ action: "error" | "warn" | "skip";
2611
+ message?: string | undefined;
2612
+ }[] | undefined;
1289
2613
  }[] | undefined;
1290
2614
  on_success?: {
1291
2615
  options?: Record<string, unknown> | undefined;
2616
+ when?: string | boolean | undefined;
1292
2617
  task?: string | undefined;
1293
2618
  flow?: string | undefined;
1294
2619
  retries?: number | undefined;
1295
2620
  retryDelay?: number | undefined;
1296
2621
  retryOn?: string | undefined;
1297
- when?: string | boolean | undefined;
1298
2622
  ignore_failure?: boolean | undefined;
2623
+ checks?: {
2624
+ when: string | boolean;
2625
+ action: "error" | "warn" | "skip";
2626
+ message?: string | undefined;
2627
+ }[] | undefined;
1299
2628
  }[] | undefined;
1300
2629
  on_failure?: {
1301
2630
  options?: Record<string, unknown> | undefined;
2631
+ when?: string | boolean | undefined;
1302
2632
  task?: string | undefined;
1303
2633
  flow?: string | undefined;
1304
2634
  retries?: number | undefined;
1305
2635
  retryDelay?: number | undefined;
1306
2636
  retryOn?: string | undefined;
1307
- when?: string | boolean | undefined;
1308
2637
  ignore_failure?: boolean | undefined;
2638
+ checks?: {
2639
+ when: string | boolean;
2640
+ action: "error" | "warn" | "skip";
2641
+ message?: string | undefined;
2642
+ }[] | undefined;
1309
2643
  }[] | undefined;
1310
2644
  finally?: {
1311
2645
  options?: Record<string, unknown> | undefined;
2646
+ when?: string | boolean | undefined;
1312
2647
  task?: string | undefined;
1313
2648
  flow?: string | undefined;
1314
2649
  retries?: number | undefined;
1315
2650
  retryDelay?: number | undefined;
1316
2651
  retryOn?: string | undefined;
1317
- when?: string | boolean | undefined;
1318
2652
  ignore_failure?: boolean | undefined;
2653
+ checks?: {
2654
+ when: string | boolean;
2655
+ action: "error" | "warn" | "skip";
2656
+ message?: string | undefined;
2657
+ }[] | undefined;
1319
2658
  }[] | undefined;
1320
2659
  rollback_on_failure?: boolean | undefined;
2660
+ options_scope?: "flat" | "step" | undefined;
1321
2661
  }>;
1322
2662
  agents: Record<string, {
1323
2663
  tools: {
@@ -1348,65 +2688,127 @@ export declare const EngineConfigSchema: z.ZodObject<{
1348
2688
  }, {
1349
2689
  tasks?: Record<string, {
1350
2690
  options?: Record<string, unknown> | undefined;
1351
- class_path?: string | undefined;
1352
2691
  description?: string | undefined;
2692
+ class_path?: string | undefined;
1353
2693
  group?: string | undefined;
1354
2694
  idempotent?: boolean | undefined;
1355
2695
  reversible?: boolean | undefined;
2696
+ options_schema?: Record<string, {
2697
+ minimum?: number | undefined;
2698
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
2699
+ maximum?: number | undefined;
2700
+ description?: string | undefined;
2701
+ required?: boolean | undefined;
2702
+ default?: unknown;
2703
+ enum?: unknown[] | undefined;
2704
+ const?: unknown;
2705
+ exclusiveMinimum?: number | undefined;
2706
+ exclusiveMaximum?: number | undefined;
2707
+ minLength?: number | undefined;
2708
+ maxLength?: number | undefined;
2709
+ pattern?: string | undefined;
2710
+ minItems?: number | undefined;
2711
+ maxItems?: number | undefined;
2712
+ items?: Record<string, unknown> | undefined;
2713
+ properties?: Record<string, unknown> | undefined;
2714
+ additionalProperties?: boolean | Record<string, unknown> | undefined;
2715
+ nullable?: boolean | undefined;
2716
+ }> | undefined;
2717
+ outputs?: Record<string, {
2718
+ type?: "string" | "number" | "boolean" | "object" | "integer" | "array" | "null" | ("string" | "number" | "boolean" | "object" | "integer" | "array" | "null")[] | undefined;
2719
+ description?: string | undefined;
2720
+ items?: Record<string, unknown> | undefined;
2721
+ properties?: Record<string, unknown> | undefined;
2722
+ }> | undefined;
2723
+ deprecated?: string | boolean | undefined;
2724
+ replaced_by?: string | undefined;
1356
2725
  }> | undefined;
1357
2726
  flows?: Record<string, {
1358
2727
  description?: string | null | undefined;
2728
+ deprecated?: string | boolean | undefined;
2729
+ replaced_by?: string | undefined;
2730
+ checks?: {
2731
+ when: string | boolean;
2732
+ action: "error" | "warn" | "skip";
2733
+ message?: string | undefined;
2734
+ }[] | undefined;
1359
2735
  steps?: Record<string, {
1360
2736
  options?: Record<string, unknown> | undefined;
2737
+ when?: string | boolean | undefined;
1361
2738
  task?: string | undefined;
1362
2739
  flow?: string | undefined;
1363
2740
  retries?: number | undefined;
1364
2741
  retryDelay?: number | undefined;
1365
2742
  retryOn?: string | undefined;
1366
- when?: string | boolean | undefined;
1367
2743
  ignore_failure?: boolean | undefined;
2744
+ checks?: {
2745
+ when: string | boolean;
2746
+ action: "error" | "warn" | "skip";
2747
+ message?: string | undefined;
2748
+ }[] | undefined;
1368
2749
  }> | undefined;
1369
2750
  on_start?: {
1370
2751
  options?: Record<string, unknown> | undefined;
2752
+ when?: string | boolean | undefined;
1371
2753
  task?: string | undefined;
1372
2754
  flow?: string | undefined;
1373
2755
  retries?: number | undefined;
1374
2756
  retryDelay?: number | undefined;
1375
2757
  retryOn?: string | undefined;
1376
- when?: string | boolean | undefined;
1377
2758
  ignore_failure?: boolean | undefined;
2759
+ checks?: {
2760
+ when: string | boolean;
2761
+ action: "error" | "warn" | "skip";
2762
+ message?: string | undefined;
2763
+ }[] | undefined;
1378
2764
  }[] | undefined;
1379
2765
  on_success?: {
1380
2766
  options?: Record<string, unknown> | undefined;
2767
+ when?: string | boolean | undefined;
1381
2768
  task?: string | undefined;
1382
2769
  flow?: string | undefined;
1383
2770
  retries?: number | undefined;
1384
2771
  retryDelay?: number | undefined;
1385
2772
  retryOn?: string | undefined;
1386
- when?: string | boolean | undefined;
1387
2773
  ignore_failure?: boolean | undefined;
2774
+ checks?: {
2775
+ when: string | boolean;
2776
+ action: "error" | "warn" | "skip";
2777
+ message?: string | undefined;
2778
+ }[] | undefined;
1388
2779
  }[] | undefined;
1389
2780
  on_failure?: {
1390
2781
  options?: Record<string, unknown> | undefined;
2782
+ when?: string | boolean | undefined;
1391
2783
  task?: string | undefined;
1392
2784
  flow?: string | undefined;
1393
2785
  retries?: number | undefined;
1394
2786
  retryDelay?: number | undefined;
1395
2787
  retryOn?: string | undefined;
1396
- when?: string | boolean | undefined;
1397
2788
  ignore_failure?: boolean | undefined;
2789
+ checks?: {
2790
+ when: string | boolean;
2791
+ action: "error" | "warn" | "skip";
2792
+ message?: string | undefined;
2793
+ }[] | undefined;
1398
2794
  }[] | undefined;
1399
2795
  finally?: {
1400
2796
  options?: Record<string, unknown> | undefined;
2797
+ when?: string | boolean | undefined;
1401
2798
  task?: string | undefined;
1402
2799
  flow?: string | undefined;
1403
2800
  retries?: number | undefined;
1404
2801
  retryDelay?: number | undefined;
1405
2802
  retryOn?: string | undefined;
1406
- when?: string | boolean | undefined;
1407
2803
  ignore_failure?: boolean | undefined;
2804
+ checks?: {
2805
+ when: string | boolean;
2806
+ action: "error" | "warn" | "skip";
2807
+ message?: string | undefined;
2808
+ }[] | undefined;
1408
2809
  }[] | undefined;
1409
2810
  rollback_on_failure?: boolean | undefined;
2811
+ options_scope?: "flat" | "step" | undefined;
1410
2812
  }> | undefined;
1411
2813
  agents?: Record<string, {
1412
2814
  description?: string | undefined;
@@ -1436,8 +2838,13 @@ export declare const EngineConfigSchema: z.ZodObject<{
1436
2838
  }> | undefined;
1437
2839
  }>;
1438
2840
  export type TaskOptions = z.infer<typeof TaskOptionsSchema>;
2841
+ export type OptionSpec = z.infer<typeof OptionSpecSchema>;
2842
+ export type OptionSpecs = z.infer<typeof OptionSpecsSchema>;
2843
+ export type OutputSpec = z.infer<typeof OutputSpecSchema>;
2844
+ export type OutputSpecs = z.infer<typeof OutputSpecsSchema>;
1439
2845
  export type TaskDefinition = z.infer<typeof TaskDefinitionSchema>;
1440
2846
  export type FlowStep = z.infer<typeof FlowStepSchema>;
2847
+ export type StepCheck = z.infer<typeof StepCheckSchema>;
1441
2848
  export type FlowDefinition = z.infer<typeof FlowDefinitionSchema>;
1442
2849
  export type AgentTool = z.infer<typeof AgentToolSchema>;
1443
2850
  export type AgentBudget = z.infer<typeof AgentBudgetSchema>;