@hexabot-ai/agentic 3.2.3 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bindings/base-binding.js +98 -25
- package/dist/cjs/dsl.types.js +141 -34
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/validation-issue.js +10 -0
- package/dist/cjs/workflow-compiler.js +3 -2
- package/dist/cjs/workflow.js +3 -2
- package/dist/esm/bindings/base-binding.js +98 -25
- package/dist/esm/dsl.types.js +141 -34
- package/dist/esm/index.js +1 -0
- package/dist/esm/validation-issue.js +6 -0
- package/dist/esm/workflow-compiler.js +3 -2
- package/dist/esm/workflow.js +3 -2
- package/dist/types/bindings/base-binding.d.ts +2 -1
- package/dist/types/bindings/base-binding.d.ts.map +1 -1
- package/dist/types/dsl.types.d.ts +4 -1
- package/dist/types/dsl.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/validation-issue.d.ts +16 -0
- package/dist/types/validation-issue.d.ts.map +1 -0
- package/dist/types/workflow-compiler.d.ts.map +1 -1
- package/dist/types/workflow.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/validation.test.ts +235 -17
- package/src/bindings/base-binding.ts +116 -62
- package/src/dsl.types.ts +225 -40
- package/src/index.ts +6 -0
- package/src/validation-issue.ts +38 -0
- package/src/workflow-compiler.ts +3 -2
- package/src/workflow.ts +3 -2
|
@@ -19,9 +19,18 @@ const hasBindingsConfigured = (workflow) => {
|
|
|
19
19
|
const hasNestedBindings = Object.values(defs).some((definition) => definition.bindings && Object.keys(definition.bindings).length > 0);
|
|
20
20
|
return hasNonTaskDefs || hasNestedBindings;
|
|
21
21
|
};
|
|
22
|
-
const
|
|
22
|
+
const toBindingSettingsIssues = (zodIssues, defName) => zodIssues.map((issue) => {
|
|
23
23
|
const path = issue.path.join('.') || '<root>';
|
|
24
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
code: 'binding_settings',
|
|
26
|
+
message: `defs.${defName}.settings.${path}: ${issue.message}`,
|
|
27
|
+
path: [
|
|
28
|
+
'defs',
|
|
29
|
+
defName,
|
|
30
|
+
'settings',
|
|
31
|
+
...issue.path.filter((segment) => typeof segment === 'string' || typeof segment === 'number'),
|
|
32
|
+
],
|
|
33
|
+
};
|
|
25
34
|
});
|
|
26
35
|
const collectDuplicateReferences = (refs) => {
|
|
27
36
|
const seen = new Set();
|
|
@@ -49,7 +58,7 @@ const collectBindingRefs = (bindings) => {
|
|
|
49
58
|
return refs;
|
|
50
59
|
};
|
|
51
60
|
const detectBindingCycles = (defs) => {
|
|
52
|
-
const
|
|
61
|
+
const issues = [];
|
|
53
62
|
const reportedCycles = new Set();
|
|
54
63
|
const states = new Map();
|
|
55
64
|
const stack = [];
|
|
@@ -68,7 +77,11 @@ const detectBindingCycles = (defs) => {
|
|
|
68
77
|
const cycleKey = cyclePath.join('->');
|
|
69
78
|
if (!reportedCycles.has(cycleKey)) {
|
|
70
79
|
reportedCycles.add(cycleKey);
|
|
71
|
-
|
|
80
|
+
issues.push({
|
|
81
|
+
code: 'binding_cycle',
|
|
82
|
+
message: `defs.${defName}.bindings: Circular binding reference detected (${cyclePath.join(' -> ')}).`,
|
|
83
|
+
path: ['defs', defName, 'bindings'],
|
|
84
|
+
});
|
|
72
85
|
}
|
|
73
86
|
return;
|
|
74
87
|
}
|
|
@@ -87,16 +100,22 @@ const detectBindingCycles = (defs) => {
|
|
|
87
100
|
for (const defName of defNames) {
|
|
88
101
|
visit(defName);
|
|
89
102
|
}
|
|
90
|
-
return
|
|
103
|
+
return issues;
|
|
91
104
|
};
|
|
92
|
-
const
|
|
105
|
+
const missingActionIssue = (defName, actionName) => ({
|
|
106
|
+
code: 'missing_action',
|
|
107
|
+
message: `defs.${defName}.action: No action implementation provided for "${actionName}".`,
|
|
108
|
+
path: ['defs', defName, 'action'],
|
|
109
|
+
actionName,
|
|
110
|
+
});
|
|
111
|
+
const resolveSupportedBindingKinds = (definition, defName, kinds, actions, issues) => {
|
|
93
112
|
if (definition.action) {
|
|
94
113
|
if (!actions) {
|
|
95
114
|
return null;
|
|
96
115
|
}
|
|
97
116
|
const action = actions[definition.action];
|
|
98
117
|
if (!action) {
|
|
99
|
-
|
|
118
|
+
issues.push(missingActionIssue(defName, definition.action));
|
|
100
119
|
return [];
|
|
101
120
|
}
|
|
102
121
|
return action.supportedBindings ?? [];
|
|
@@ -107,7 +126,7 @@ const resolveSupportedBindingKinds = (definition, defName, kinds, actions, error
|
|
|
107
126
|
return kinds[definition.kind]?.supportedBindings ?? [];
|
|
108
127
|
};
|
|
109
128
|
export const validateAndResolveBindings = (workflow, options) => {
|
|
110
|
-
const
|
|
129
|
+
const issues = [];
|
|
111
130
|
const resolvedDefs = {};
|
|
112
131
|
const defs = workflow.defs ?? {};
|
|
113
132
|
const resolvedOptions = resolveValidationOptions(options);
|
|
@@ -117,34 +136,52 @@ export const validateAndResolveBindings = (workflow, options) => {
|
|
|
117
136
|
const hasBindingUsage = hasBindingsConfigured(workflow);
|
|
118
137
|
const parsedSettingsByDefName = new Map();
|
|
119
138
|
if (hasBindingUsage && kindNames.length === 0) {
|
|
120
|
-
|
|
139
|
+
issues.push({
|
|
140
|
+
code: 'binding_registry_required',
|
|
141
|
+
message: 'Workflows that declare non-task defs or nested bindings require a non-empty "bindingKinds" registry.',
|
|
142
|
+
});
|
|
121
143
|
}
|
|
122
144
|
for (const [defName, defDefinition] of Object.entries(defs)) {
|
|
123
145
|
if (defDefinition.kind === TASK_KIND) {
|
|
124
146
|
if (defDefinition.action && actions && !actions[defDefinition.action]) {
|
|
125
|
-
|
|
147
|
+
issues.push(missingActionIssue(defName, defDefinition.action));
|
|
126
148
|
}
|
|
127
149
|
continue;
|
|
128
150
|
}
|
|
129
151
|
const kindDefinition = kinds[defDefinition.kind];
|
|
130
152
|
if (!kindDefinition) {
|
|
131
|
-
|
|
153
|
+
issues.push({
|
|
154
|
+
code: 'unknown_binding_kind',
|
|
155
|
+
message: `defs.${defName}.kind: Unknown binding kind "${defDefinition.kind}".`,
|
|
156
|
+
path: ['defs', defName, 'kind'],
|
|
157
|
+
bindingKind: defDefinition.kind,
|
|
158
|
+
});
|
|
132
159
|
continue;
|
|
133
160
|
}
|
|
134
161
|
const actionPolicy = kindDefinition.actionPolicy ?? 'optional';
|
|
135
162
|
if (actionPolicy === 'required' && !defDefinition.action) {
|
|
136
|
-
|
|
163
|
+
issues.push({
|
|
164
|
+
code: 'action_required',
|
|
165
|
+
message: `defs.${defName}.action: Binding kind "${defDefinition.kind}" requires an action.`,
|
|
166
|
+
path: ['defs', defName, 'action'],
|
|
167
|
+
bindingKind: defDefinition.kind,
|
|
168
|
+
});
|
|
137
169
|
}
|
|
138
170
|
if (actionPolicy === 'forbidden' && defDefinition.action) {
|
|
139
|
-
|
|
171
|
+
issues.push({
|
|
172
|
+
code: 'action_forbidden',
|
|
173
|
+
message: `defs.${defName}.action: Binding kind "${defDefinition.kind}" does not allow action declarations.`,
|
|
174
|
+
path: ['defs', defName, 'action'],
|
|
175
|
+
bindingKind: defDefinition.kind,
|
|
176
|
+
});
|
|
140
177
|
}
|
|
141
178
|
if (defDefinition.action && actions && !actions[defDefinition.action]) {
|
|
142
|
-
|
|
179
|
+
issues.push(missingActionIssue(defName, defDefinition.action));
|
|
143
180
|
}
|
|
144
181
|
const { schema } = kindDefinition;
|
|
145
182
|
const parsedPayload = schema.safeParse(defDefinition.settings);
|
|
146
183
|
if (!parsedPayload.success) {
|
|
147
|
-
|
|
184
|
+
issues.push(...toBindingSettingsIssues(parsedPayload.error.issues, defName));
|
|
148
185
|
continue;
|
|
149
186
|
}
|
|
150
187
|
parsedSettingsByDefName.set(defName, parsedPayload.data);
|
|
@@ -154,47 +191,83 @@ export const validateAndResolveBindings = (workflow, options) => {
|
|
|
154
191
|
if (!defBindings) {
|
|
155
192
|
continue;
|
|
156
193
|
}
|
|
157
|
-
const supportedKinds = resolveSupportedBindingKinds(defDefinition, defName, kinds, actions,
|
|
194
|
+
const supportedKinds = resolveSupportedBindingKinds(defDefinition, defName, kinds, actions, issues);
|
|
158
195
|
const shouldValidateSupportedKinds = Array.isArray(supportedKinds);
|
|
159
196
|
for (const [bindingKind, bindingRefs] of Object.entries(defBindings)) {
|
|
197
|
+
const bindingPath = ['defs', defName, 'bindings', bindingKind];
|
|
160
198
|
const kindDefinition = kinds[bindingKind];
|
|
161
199
|
if (!kindDefinition) {
|
|
162
|
-
|
|
200
|
+
issues.push({
|
|
201
|
+
code: 'unknown_binding_kind',
|
|
202
|
+
message: `defs.${defName}.bindings.${bindingKind}: Unknown binding kind "${bindingKind}".`,
|
|
203
|
+
path: bindingPath,
|
|
204
|
+
bindingKind,
|
|
205
|
+
});
|
|
163
206
|
continue;
|
|
164
207
|
}
|
|
165
208
|
const { multiple } = kindDefinition;
|
|
166
209
|
if (multiple && !Array.isArray(bindingRefs)) {
|
|
167
|
-
|
|
210
|
+
issues.push({
|
|
211
|
+
code: 'binding_ref',
|
|
212
|
+
message: `defs.${defName}.bindings.${bindingKind}: Expected an array of def references for binding kind "${bindingKind}".`,
|
|
213
|
+
path: bindingPath,
|
|
214
|
+
bindingKind,
|
|
215
|
+
});
|
|
168
216
|
continue;
|
|
169
217
|
}
|
|
170
218
|
if (!multiple && typeof bindingRefs !== 'string') {
|
|
171
|
-
|
|
219
|
+
issues.push({
|
|
220
|
+
code: 'binding_ref',
|
|
221
|
+
message: `defs.${defName}.bindings.${bindingKind}: Expected a single def reference string for binding kind "${bindingKind}".`,
|
|
222
|
+
path: bindingPath,
|
|
223
|
+
bindingKind,
|
|
224
|
+
});
|
|
172
225
|
continue;
|
|
173
226
|
}
|
|
174
227
|
if (shouldValidateSupportedKinds &&
|
|
175
228
|
supportedKinds &&
|
|
176
229
|
!supportedKinds.includes(bindingKind)) {
|
|
177
230
|
const supportedKindsLabel = supportedKinds.length > 0 ? supportedKinds.join(', ') : '<none>';
|
|
178
|
-
|
|
231
|
+
issues.push({
|
|
232
|
+
code: 'binding_unsupported',
|
|
233
|
+
message: `defs.${defName}.bindings.${bindingKind}: "${defDefinition.action ?? defDefinition.kind}" does not support binding kind "${bindingKind}". Supported binding kinds: ${supportedKindsLabel}.`,
|
|
234
|
+
path: bindingPath,
|
|
235
|
+
bindingKind,
|
|
236
|
+
});
|
|
179
237
|
}
|
|
180
238
|
const refs = toBindingRefs(bindingRefs);
|
|
181
239
|
const duplicateRefs = collectDuplicateReferences(refs);
|
|
182
240
|
if (duplicateRefs.length > 0) {
|
|
183
|
-
|
|
241
|
+
issues.push({
|
|
242
|
+
code: 'binding_ref',
|
|
243
|
+
message: `defs.${defName}.bindings.${bindingKind}: Duplicate def reference(s): ${duplicateRefs.join(', ')}`,
|
|
244
|
+
path: bindingPath,
|
|
245
|
+
bindingKind,
|
|
246
|
+
});
|
|
184
247
|
}
|
|
185
248
|
for (const ref of refs) {
|
|
186
249
|
const definition = defs[ref];
|
|
187
250
|
if (!definition) {
|
|
188
|
-
|
|
251
|
+
issues.push({
|
|
252
|
+
code: 'binding_ref',
|
|
253
|
+
message: `defs.${defName}.bindings.${bindingKind}: Unknown def reference "${ref}".`,
|
|
254
|
+
path: bindingPath,
|
|
255
|
+
bindingKind,
|
|
256
|
+
});
|
|
189
257
|
continue;
|
|
190
258
|
}
|
|
191
259
|
if (definition.kind !== bindingKind) {
|
|
192
|
-
|
|
260
|
+
issues.push({
|
|
261
|
+
code: 'binding_ref',
|
|
262
|
+
message: `defs.${defName}.bindings.${bindingKind}: Def "${ref}" has kind "${definition.kind}" and cannot be mounted as "${bindingKind}".`,
|
|
263
|
+
path: bindingPath,
|
|
264
|
+
bindingKind,
|
|
265
|
+
});
|
|
193
266
|
}
|
|
194
267
|
}
|
|
195
268
|
}
|
|
196
269
|
}
|
|
197
|
-
|
|
270
|
+
issues.push(...detectBindingCycles(defs));
|
|
198
271
|
const inProgress = new Set();
|
|
199
272
|
const mountResolvedDef = (defName) => {
|
|
200
273
|
const existing = resolvedDefs[defName];
|
|
@@ -234,7 +307,7 @@ export const validateAndResolveBindings = (workflow, options) => {
|
|
|
234
307
|
}
|
|
235
308
|
mountResolvedDef(defName);
|
|
236
309
|
}
|
|
237
|
-
return {
|
|
310
|
+
return { issues, resolvedDefs };
|
|
238
311
|
};
|
|
239
312
|
export const mountTaskBindings = (taskBindings, resolvedDefs, bindingKinds, resolveDef) => {
|
|
240
313
|
if (!taskBindings) {
|
package/dist/esm/dsl.types.js
CHANGED
|
@@ -8,6 +8,7 @@ import { parse as parseYaml } from 'yaml';
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { validateAndResolveBindings } from './bindings/base-binding';
|
|
10
10
|
import { SNAKE_CASE_REGEX } from './utils/naming';
|
|
11
|
+
import { mergeSettings } from './workflow-values';
|
|
11
12
|
export const ExpressionStringSchema = z
|
|
12
13
|
.string()
|
|
13
14
|
.regex(/^=/, 'Expression strings must start with "="')
|
|
@@ -232,32 +233,42 @@ export const WorkflowDefinitionSchema = z.strictObject({
|
|
|
232
233
|
flow: z.array(FlowStepSchema),
|
|
233
234
|
outputs: z.record(z.string(), ExpressionStringSchema),
|
|
234
235
|
});
|
|
235
|
-
const collectTaskReferences = (steps) => {
|
|
236
|
+
const collectTaskReferences = (steps, basePath = ['flow']) => {
|
|
236
237
|
const refs = [];
|
|
237
|
-
|
|
238
|
+
steps.forEach((step, index) => {
|
|
239
|
+
const stepPath = [...basePath, index];
|
|
238
240
|
if ('do' in step) {
|
|
239
|
-
refs.push(step.do);
|
|
240
|
-
|
|
241
|
+
refs.push({ taskId: step.do, path: [...stepPath, 'do'] });
|
|
242
|
+
return;
|
|
241
243
|
}
|
|
242
244
|
if ('parallel' in step) {
|
|
243
|
-
refs.push(...collectTaskReferences(step.parallel.steps
|
|
244
|
-
|
|
245
|
+
refs.push(...collectTaskReferences(step.parallel.steps, [
|
|
246
|
+
...stepPath,
|
|
247
|
+
'parallel',
|
|
248
|
+
'steps',
|
|
249
|
+
]));
|
|
250
|
+
return;
|
|
245
251
|
}
|
|
246
252
|
if ('conditional' in step) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
step.conditional.when.forEach((branch, branchIndex) => {
|
|
254
|
+
refs.push(...collectTaskReferences(branch.steps, [
|
|
255
|
+
...stepPath,
|
|
256
|
+
'conditional',
|
|
257
|
+
'when',
|
|
258
|
+
branchIndex,
|
|
259
|
+
'steps',
|
|
260
|
+
]));
|
|
261
|
+
});
|
|
262
|
+
return;
|
|
256
263
|
}
|
|
257
264
|
if ('loop' in step) {
|
|
258
|
-
refs.push(...collectTaskReferences(step.loop.steps
|
|
265
|
+
refs.push(...collectTaskReferences(step.loop.steps, [
|
|
266
|
+
...stepPath,
|
|
267
|
+
'loop',
|
|
268
|
+
'steps',
|
|
269
|
+
]));
|
|
259
270
|
}
|
|
260
|
-
}
|
|
271
|
+
});
|
|
261
272
|
return refs;
|
|
262
273
|
};
|
|
263
274
|
export const isTaskDefinition = (definition) => definition.kind === TASK_KIND;
|
|
@@ -267,9 +278,97 @@ export const extractTaskDefinitions = (defs) => Object.entries(defs).reduce((tas
|
|
|
267
278
|
}
|
|
268
279
|
return tasks;
|
|
269
280
|
}, {});
|
|
270
|
-
const
|
|
281
|
+
const EXECUTION_SETTING_KEYS = new Set(Object.keys(BaseSettingsSchema.shape));
|
|
282
|
+
const isExpressionString = (value) => typeof value === 'string' && value.startsWith('=');
|
|
283
|
+
const toIssuePath = (path) => path.filter((segment) => typeof segment === 'string' || typeof segment === 'number');
|
|
284
|
+
const getValueAtPath = (value, path) => {
|
|
285
|
+
let current = value;
|
|
286
|
+
for (const segment of path) {
|
|
287
|
+
if (current === null || typeof current !== 'object') {
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
current = current[segment];
|
|
291
|
+
}
|
|
292
|
+
return current;
|
|
293
|
+
};
|
|
294
|
+
const extractActionSettings = (settings) => {
|
|
295
|
+
if (!settings || typeof settings !== 'object' || Array.isArray(settings)) {
|
|
296
|
+
return {};
|
|
297
|
+
}
|
|
298
|
+
return Object.fromEntries(Object.entries(settings).filter(([key]) => !EXECUTION_SETTING_KEYS.has(key)));
|
|
299
|
+
};
|
|
300
|
+
const toActionSchemaIssues = ({ actionName, code, payload, schema, section, taskId, }) => {
|
|
301
|
+
const result = schema.safeParse(payload);
|
|
302
|
+
if (result.success) {
|
|
303
|
+
return [];
|
|
304
|
+
}
|
|
305
|
+
return result.error.issues.flatMap((issue) => {
|
|
306
|
+
const issuePath = toIssuePath(issue.path);
|
|
307
|
+
// Expressions are resolved immediately before action execution, so their
|
|
308
|
+
// eventual runtime type cannot be checked while validating the definition.
|
|
309
|
+
if (isExpressionString(getValueAtPath(payload, issuePath))) {
|
|
310
|
+
return [];
|
|
311
|
+
}
|
|
312
|
+
const path = ['defs', taskId, section, ...issuePath];
|
|
313
|
+
return [
|
|
314
|
+
{
|
|
315
|
+
actionName,
|
|
316
|
+
code,
|
|
317
|
+
message: `${path.join('.')}: ${issue.message}`,
|
|
318
|
+
path,
|
|
319
|
+
taskId,
|
|
320
|
+
},
|
|
321
|
+
];
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
const validateTaskActionSchemas = (definition, actions) => {
|
|
325
|
+
if (!actions) {
|
|
326
|
+
return [];
|
|
327
|
+
}
|
|
328
|
+
const issues = [];
|
|
329
|
+
const taskDefinitions = extractTaskDefinitions(definition.defs);
|
|
330
|
+
for (const [taskId, task] of Object.entries(taskDefinitions)) {
|
|
331
|
+
const action = actions[task.action];
|
|
332
|
+
// Missing actions are reported by binding validation and have no schemas
|
|
333
|
+
// available for payload validation.
|
|
334
|
+
if (!action) {
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
if (action.inputSchema) {
|
|
338
|
+
issues.push(...toActionSchemaIssues({
|
|
339
|
+
actionName: task.action,
|
|
340
|
+
code: 'action_inputs',
|
|
341
|
+
payload: task.inputs ?? {},
|
|
342
|
+
schema: action.inputSchema,
|
|
343
|
+
section: 'inputs',
|
|
344
|
+
taskId,
|
|
345
|
+
}));
|
|
346
|
+
}
|
|
347
|
+
if (action.settingSchema) {
|
|
348
|
+
const effectiveSettings = mergeSettings(definition.defaults?.settings, task.settings);
|
|
349
|
+
issues.push(...toActionSchemaIssues({
|
|
350
|
+
actionName: task.action,
|
|
351
|
+
code: 'action_settings',
|
|
352
|
+
payload: extractActionSettings(effectiveSettings),
|
|
353
|
+
schema: action.settingSchema,
|
|
354
|
+
section: 'settings',
|
|
355
|
+
taskId,
|
|
356
|
+
}));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return issues;
|
|
360
|
+
};
|
|
361
|
+
const toSchemaIssues = (zodIssues) => zodIssues.map((issue) => {
|
|
271
362
|
const path = issue.path.join('.') || '<root>';
|
|
272
|
-
return
|
|
363
|
+
return {
|
|
364
|
+
code: 'schema',
|
|
365
|
+
message: `${path}: ${issue.message}`,
|
|
366
|
+
path: issue.path.filter((segment) => typeof segment === 'string' || typeof segment === 'number'),
|
|
367
|
+
};
|
|
368
|
+
});
|
|
369
|
+
const invalidWorkflow = (issues) => ({
|
|
370
|
+
success: false,
|
|
371
|
+
issues,
|
|
273
372
|
});
|
|
274
373
|
export function validateWorkflow(input, options) {
|
|
275
374
|
let candidate = input;
|
|
@@ -279,32 +378,40 @@ export function validateWorkflow(input, options) {
|
|
|
279
378
|
}
|
|
280
379
|
catch (error) {
|
|
281
380
|
const message = error instanceof Error ? error.message : 'Unknown YAML parse error';
|
|
282
|
-
return
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
381
|
+
return invalidWorkflow([
|
|
382
|
+
{ code: 'yaml_parse', message: 'Unable to parse workflow YAML' },
|
|
383
|
+
{ code: 'yaml_parse', message },
|
|
384
|
+
]);
|
|
286
385
|
}
|
|
287
386
|
}
|
|
288
387
|
const parsed = WorkflowDefinitionSchema.safeParse(candidate);
|
|
289
388
|
if (!parsed.success) {
|
|
290
|
-
return
|
|
389
|
+
return invalidWorkflow(toSchemaIssues(parsed.error.issues));
|
|
291
390
|
}
|
|
292
|
-
const
|
|
391
|
+
const issues = [];
|
|
293
392
|
const taskDefinitions = extractTaskDefinitions(parsed.data.defs);
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
393
|
+
const reportedMissingTasks = new Set();
|
|
394
|
+
for (const { taskId, path } of collectTaskReferences(parsed.data.flow)) {
|
|
395
|
+
if (Object.prototype.hasOwnProperty.call(taskDefinitions, taskId) ||
|
|
396
|
+
reportedMissingTasks.has(taskId)) {
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
reportedMissingTasks.add(taskId);
|
|
400
|
+
issues.push({
|
|
401
|
+
code: 'unknown_task',
|
|
402
|
+
message: `Unknown task(s) referenced in flow: ${taskId}`,
|
|
403
|
+
path,
|
|
404
|
+
taskId,
|
|
405
|
+
});
|
|
298
406
|
}
|
|
299
407
|
const bindingValidation = validateAndResolveBindings(parsed.data, {
|
|
300
408
|
bindingKinds: options?.bindingKinds,
|
|
301
409
|
actions: options?.actions,
|
|
302
410
|
});
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
return { success: false, errors };
|
|
411
|
+
issues.push(...bindingValidation.issues);
|
|
412
|
+
issues.push(...validateTaskActionSchemas(parsed.data, options?.actions));
|
|
413
|
+
if (issues.length > 0) {
|
|
414
|
+
return invalidWorkflow(issues);
|
|
308
415
|
}
|
|
309
416
|
return { success: true, data: parsed.data };
|
|
310
417
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { AbstractAction } from './action/abstract-action';
|
|
|
7
7
|
export { defineAction } from './action/action';
|
|
8
8
|
export { BaseWorkflowContext, EWorkflowRunStatus, WORKFLOW_RUN_STATUSES, } from './context';
|
|
9
9
|
export * from './dsl.types';
|
|
10
|
+
export { issueMessages, } from './validation-issue';
|
|
10
11
|
export { compileWorkflow, Workflow, WorkflowEventEmitter, WorkflowRunner, } from './workflow';
|
|
11
12
|
export { StepType } from './workflow-event-emitter';
|
|
12
13
|
export { NonDeterministicWorkflowError } from './runner-runtime-control';
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { mountTaskBindings, validateAndResolveBindings, } from './bindings/base-binding';
|
|
8
8
|
import { extractTaskDefinitions as extractTaskDefinitionsFromDefs } from './dsl.types';
|
|
9
|
+
import { issueMessages } from './validation-issue';
|
|
9
10
|
import { StepType } from './workflow-event-emitter';
|
|
10
11
|
import { compileValue, mergeSettings, } from './workflow-values';
|
|
11
12
|
/** Build a stable identifier for a step using its path and label. */
|
|
@@ -94,8 +95,8 @@ const compileTasks = (definition, options) => {
|
|
|
94
95
|
bindingKinds: options.bindingKinds,
|
|
95
96
|
actions: options.actions,
|
|
96
97
|
});
|
|
97
|
-
if (bindingValidation.
|
|
98
|
-
throw new Error(`Workflow bindings validation failed: ${bindingValidation.
|
|
98
|
+
if (bindingValidation.issues.length > 0) {
|
|
99
|
+
throw new Error(`Workflow bindings validation failed: ${issueMessages(bindingValidation.issues).join('; ')}`);
|
|
99
100
|
}
|
|
100
101
|
assertActionsBound(taskDefinitions, options.actions);
|
|
101
102
|
for (const [taskName, task] of Object.entries(taskDefinitions)) {
|
package/dist/esm/workflow.js
CHANGED
|
@@ -7,6 +7,7 @@ import { stringify as stringifyYaml } from 'yaml';
|
|
|
7
7
|
import { EWorkflowRunStatus, } from './context';
|
|
8
8
|
import { TASK_KIND, WorkflowDefinitionSchema, validateWorkflow, } from './dsl.types';
|
|
9
9
|
import { safeRenameTaskInDefinition as renameTaskInDefinition } from './utils/workflow-definition';
|
|
10
|
+
import { issueMessages } from './validation-issue';
|
|
10
11
|
import { compileWorkflow, } from './workflow-compiler';
|
|
11
12
|
import { WorkflowRunner } from './workflow-runner';
|
|
12
13
|
export { compileWorkflow } from './workflow-compiler';
|
|
@@ -63,7 +64,7 @@ export class Workflow {
|
|
|
63
64
|
actions: options.actions,
|
|
64
65
|
});
|
|
65
66
|
if (!validation.success) {
|
|
66
|
-
throw new Error(`Workflow validation failed: ${validation.
|
|
67
|
+
throw new Error(`Workflow validation failed: ${issueMessages(validation.issues).join('; ')}`);
|
|
67
68
|
}
|
|
68
69
|
const compiled = compileWorkflow(validation.data, options);
|
|
69
70
|
return new Workflow(compiled);
|
|
@@ -78,7 +79,7 @@ export class Workflow {
|
|
|
78
79
|
actions: options.actions,
|
|
79
80
|
});
|
|
80
81
|
if (!validation.success) {
|
|
81
|
-
throw new Error(`Workflow validation failed: ${validation.
|
|
82
|
+
throw new Error(`Workflow validation failed: ${issueMessages(validation.issues).join('; ')}`);
|
|
82
83
|
}
|
|
83
84
|
const compiled = compileWorkflow(validation.data, options);
|
|
84
85
|
return new Workflow(compiled);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type WorkflowValidationIssue } from '../validation-issue';
|
|
2
3
|
export type BindingKindSchema = z.ZodTypeAny;
|
|
3
4
|
export type BindingActionPolicy = 'forbidden' | 'optional' | 'required';
|
|
4
5
|
export type BindingValidationActionMetadata = {
|
|
@@ -43,7 +44,7 @@ export type ValidateAndResolveBindingsOptions = {
|
|
|
43
44
|
actions?: Record<string, BindingValidationActionMetadata>;
|
|
44
45
|
};
|
|
45
46
|
type BindingValidationResult = {
|
|
46
|
-
|
|
47
|
+
issues: WorkflowValidationIssue[];
|
|
47
48
|
resolvedDefs: ResolvedBindingDefs;
|
|
48
49
|
};
|
|
49
50
|
export declare const validateAndResolveBindings: (workflow: BindingAwareWorkflowLike, options?: BindingKindSchemas | ValidateAndResolveBindingsOptions) => BindingValidationResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-binding.d.ts","sourceRoot":"","sources":["../../../src/bindings/base-binding.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAiB,MAAM,KAA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C,GAAG;IAC9C,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;CAC3D,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,MAAM,EAAE,uBAAuB,EAAE,CAAC;IAClC,YAAY,EAAE,mBAAmB,CAAC;CACnC,CAAC;AAgLF,eAAO,MAAM,0BAA0B,GACrC,UAAU,wBAAwB,EAClC,UAAU,kBAAkB,GAAG,iCAAiC,KAC/D,uBAwOF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,cAAc,qBAAqB,GAAG,SAAS,EAC/C,cAAc,mBAAmB,EACjC,eAAe,kBAAkB,EACjC,aAAa,CAAC,OAAO,EAAE,MAAM,KAAK,qBAAqB,GAAG,SAAS,KAClE,oBAkDF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { BindingKindSchemas } from './bindings/base-binding';
|
|
3
|
+
import { type WorkflowValidationIssue } from './validation-issue';
|
|
3
4
|
export declare const ExpressionStringSchema: z.ZodString;
|
|
4
5
|
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
5
6
|
[key: string]: JsonValue;
|
|
@@ -201,6 +202,8 @@ export type WorkflowMetadata = z.infer<typeof WorkflowMetadataSchema>;
|
|
|
201
202
|
export type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
|
|
202
203
|
export type WorkflowValidationActionMetadata = {
|
|
203
204
|
supportedBindings?: readonly string[];
|
|
205
|
+
inputSchema?: z.ZodTypeAny;
|
|
206
|
+
settingSchema?: z.ZodTypeAny;
|
|
204
207
|
};
|
|
205
208
|
export type ValidateWorkflowOptions = {
|
|
206
209
|
bindingKinds?: BindingKindSchemas;
|
|
@@ -211,7 +214,7 @@ export type WorkflowValidationResult = {
|
|
|
211
214
|
data: WorkflowDefinition;
|
|
212
215
|
} | {
|
|
213
216
|
success: false;
|
|
214
|
-
|
|
217
|
+
issues: WorkflowValidationIssue[];
|
|
215
218
|
};
|
|
216
219
|
export declare const isTaskDefinition: (definition: DefDefinition) => definition is TaskDefinition;
|
|
217
220
|
export declare const extractTaskDefinitions: (defs: DefDefinitions) => TaskDefinitions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dsl.types.d.ts","sourceRoot":"","sources":["../../src/dsl.types.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"dsl.types.d.ts","sourceRoot":"","sources":["../../src/dsl.types.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAGlE,eAAO,MAAM,sBAAsB,aAc/B,CAAC;AAEL,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAGjC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAGpC,eAAO,MAAM,sBAAsB;;;;;;;CAOzB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EA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/action';
|
|
|
4
4
|
export type { Action, ActionExecutionArgs, ActionExecutionOutcome, ActionMetadata, Actions, InferActionArgs, InferActionBindings, InferActionContext, InferActionInput, InferActionOutput, InferActionSettings, SuspensionNotice, } from './action/action.types';
|
|
5
5
|
export { BaseWorkflowContext, EWorkflowRunStatus, WORKFLOW_RUN_STATUSES, type ActionSnapshot, type ActionStatus, type StepExecutionRecord, type SuspensionOptions, type WorkflowRunStatus, type WorkflowRuntimeControl, type WorkflowSnapshot, } from './context';
|
|
6
6
|
export * from './dsl.types';
|
|
7
|
+
export { issueMessages, type WorkflowValidationIssue, type WorkflowValidationIssueCode, } from './validation-issue';
|
|
7
8
|
export type { BindingKindDescriptor, BindingKindSchemas, InferMountedBindingValue, InferWorkflowBindings, } from './bindings/base-binding';
|
|
8
9
|
export { compileWorkflow, Workflow, WorkflowEventEmitter, WorkflowRunner, type FlowStepPath, type WorkflowCompileOptions, type WorkflowResumeResult, type WorkflowRunOptions, type WorkflowStartResult, } from './workflow';
|
|
9
10
|
export { StepType } from './workflow-event-emitter';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,YAAY,EACV,MAAM,EACN,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAA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iBAAiB,CAAC;AAErD,OAAO,EACL,qCAAqC,EACrC,mCAAmC,EACnC,KAAK,oCAAoC,EACzC,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,GACpC,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type WorkflowValidationIssueCode = 'yaml_parse' | 'schema' | 'unknown_task' | 'missing_action' | 'action_inputs' | 'action_settings' | 'binding_registry_required' | 'unknown_binding_kind' | 'action_required' | 'action_forbidden' | 'binding_settings' | 'binding_ref' | 'binding_unsupported' | 'binding_cycle';
|
|
2
|
+
export type WorkflowValidationIssue = {
|
|
3
|
+
code: WorkflowValidationIssueCode;
|
|
4
|
+
/** Human-readable message; kept identical to the legacy error strings. */
|
|
5
|
+
message: string;
|
|
6
|
+
/** Path within the YAML document, e.g. ["defs", "my_task", "action"]. */
|
|
7
|
+
path?: Array<string | number>;
|
|
8
|
+
/** Referenced action name, set for action-specific issues where known. */
|
|
9
|
+
actionName?: string;
|
|
10
|
+
/** Referenced task id, set for task-specific issues where known. */
|
|
11
|
+
taskId?: string;
|
|
12
|
+
/** Binding kind involved, set for binding-related issues where known. */
|
|
13
|
+
bindingKind?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const issueMessages: (issues: WorkflowValidationIssue[]) => string[];
|
|
16
|
+
//# sourceMappingURL=validation-issue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-issue.d.ts","sourceRoot":"","sources":["../../src/validation-issue.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,2BAA2B,GACnC,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,gBAAgB,GAChB,eAAe,GACf,iBAAiB,GACjB,2BAA2B,GAC3B,sBAAsB,GACtB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,aAAa,GACb,qBAAqB,GACrB,eAAe,CAAC;AAEpB,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,2BAA2B,CAAC;IAClC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC9B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,QAAQ,uBAAuB,EAAE,KAAG,MAAM,EAClC,CAAC"}
|