@shipfox/workflow-document 2.0.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.
- package/LICENSE +21 -0
- package/README.md +208 -0
- package/dist/document/index.d.ts +4 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +5 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/step-enums.d.ts +53 -0
- package/dist/document/step-enums.d.ts.map +1 -0
- package/dist/document/step-enums.js +42 -0
- package/dist/document/step-enums.js.map +1 -0
- package/dist/document/workflow-document-parser.d.ts +10 -0
- package/dist/document/workflow-document-parser.d.ts.map +1 -0
- package/dist/document/workflow-document-parser.js +18 -0
- package/dist/document/workflow-document-parser.js.map +1 -0
- package/dist/document/workflow-document.d.ts +366 -0
- package/dist/document/workflow-document.d.ts.map +1 -0
- package/dist/document/workflow-document.js +339 -0
- package/dist/document/workflow-document.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { agentThinkingSchema, harnessSchema } from './step-enums.js';
|
|
3
|
+
const stringOrStringArraySchema = z.union([
|
|
4
|
+
z.string().min(1),
|
|
5
|
+
z.array(z.string().min(1)).min(1)
|
|
6
|
+
]);
|
|
7
|
+
const nonEmptyRecordSchema = (valueSchema)=>z.record(z.string().min(1), valueSchema).refine((value)=>Object.keys(value).length > 0, {
|
|
8
|
+
message: 'Expected at least one entry'
|
|
9
|
+
});
|
|
10
|
+
// Runner shell steps execute on Unix shells, so workflow env names follow the
|
|
11
|
+
// portable POSIX-style variable shape.
|
|
12
|
+
const envNameSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
|
|
13
|
+
const envStringValueSchema = z.string().refine((value)=>!value.includes('\u0000'), {
|
|
14
|
+
message: 'Env string values cannot contain null bytes'
|
|
15
|
+
});
|
|
16
|
+
export const WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES = 128;
|
|
17
|
+
export const WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES = 32 * 1024;
|
|
18
|
+
export const workflowDocumentStepOutputTypes = [
|
|
19
|
+
'string',
|
|
20
|
+
'number',
|
|
21
|
+
'boolean',
|
|
22
|
+
'json'
|
|
23
|
+
];
|
|
24
|
+
export const WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;
|
|
25
|
+
export const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES = WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES;
|
|
26
|
+
export const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH = 64;
|
|
27
|
+
const utf8Encoder = new TextEncoder();
|
|
28
|
+
export const workflowDocumentEnvSchema = z.record(envNameSchema, z.union([
|
|
29
|
+
envStringValueSchema,
|
|
30
|
+
z.number(),
|
|
31
|
+
z.boolean()
|
|
32
|
+
])).superRefine((env, ctx)=>{
|
|
33
|
+
const entries = Object.keys(env).length;
|
|
34
|
+
if (entries > WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES) {
|
|
35
|
+
ctx.addIssue({
|
|
36
|
+
code: 'custom',
|
|
37
|
+
message: `Env cannot define more than ${WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES} entries.`
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const serializedBytes = utf8Encoder.encode(JSON.stringify(env)).byteLength;
|
|
41
|
+
if (serializedBytes > WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES) {
|
|
42
|
+
ctx.addIssue({
|
|
43
|
+
code: 'custom',
|
|
44
|
+
message: `Env cannot serialize to more than ${WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES} bytes.`
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const workflowDocumentStepOutputKeyPattern = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
49
|
+
const workflowDocumentStepOutputTypeSchema = z.enum(workflowDocumentStepOutputTypes);
|
|
50
|
+
const workflowDocumentStepOutputDeclarationSchema = z.union([
|
|
51
|
+
workflowDocumentStepOutputTypeSchema.transform((type)=>({
|
|
52
|
+
type
|
|
53
|
+
})),
|
|
54
|
+
z.strictObject({
|
|
55
|
+
type: workflowDocumentStepOutputTypeSchema,
|
|
56
|
+
schema: z.unknown().optional()
|
|
57
|
+
})
|
|
58
|
+
]).superRefine((declaration, ctx)=>{
|
|
59
|
+
const schema = 'schema' in declaration ? declaration.schema : undefined;
|
|
60
|
+
if (declaration.type !== 'json' && schema !== undefined) {
|
|
61
|
+
ctx.addIssue({
|
|
62
|
+
code: 'custom',
|
|
63
|
+
path: [
|
|
64
|
+
'schema'
|
|
65
|
+
],
|
|
66
|
+
message: '`schema` is only supported for json outputs.'
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (schema === undefined) return;
|
|
71
|
+
if (!isJsonSchemaDocument(schema)) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
code: 'custom',
|
|
74
|
+
path: [
|
|
75
|
+
'schema'
|
|
76
|
+
],
|
|
77
|
+
message: 'Schema must be a valid JSON Schema document.'
|
|
78
|
+
});
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const serializedBytes = utf8Encoder.encode(JSON.stringify(schema)).byteLength;
|
|
82
|
+
if (serializedBytes > WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES) {
|
|
83
|
+
ctx.addIssue({
|
|
84
|
+
code: 'custom',
|
|
85
|
+
path: [
|
|
86
|
+
'schema'
|
|
87
|
+
],
|
|
88
|
+
message: `Output JSON Schema cannot serialize to more than ${WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES} bytes.`
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const depth = maxJsonDepth(schema);
|
|
92
|
+
if (depth > WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH) {
|
|
93
|
+
ctx.addIssue({
|
|
94
|
+
code: 'custom',
|
|
95
|
+
path: [
|
|
96
|
+
'schema'
|
|
97
|
+
],
|
|
98
|
+
message: `Output JSON Schema cannot be nested deeper than ${WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH} levels.`
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export const workflowDocumentStepOutputsSchema = z.record(z.string(), workflowDocumentStepOutputDeclarationSchema).superRefine((outputs, ctx)=>{
|
|
103
|
+
const entries = Object.keys(outputs).length;
|
|
104
|
+
if (entries > WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES) {
|
|
105
|
+
ctx.addIssue({
|
|
106
|
+
code: 'custom',
|
|
107
|
+
message: `Step outputs cannot define more than ${WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES} entries.`
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
for (const key of Object.keys(outputs)){
|
|
111
|
+
if (workflowDocumentStepOutputKeyPattern.test(key)) continue;
|
|
112
|
+
ctx.addIssue({
|
|
113
|
+
code: 'custom',
|
|
114
|
+
path: [
|
|
115
|
+
key
|
|
116
|
+
],
|
|
117
|
+
message: 'Output keys must be CEL identifiers.'
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const workflowDocumentTriggerBaseSchema = {
|
|
122
|
+
source: z.string().min(1),
|
|
123
|
+
with: z.record(z.string(), z.unknown()).optional(),
|
|
124
|
+
filter: z.string().min(1).optional(),
|
|
125
|
+
config: z.record(z.string(), z.unknown()).optional()
|
|
126
|
+
};
|
|
127
|
+
export const triggerSourceConfigSchemas = {
|
|
128
|
+
cron: z.strictObject({
|
|
129
|
+
schedule: z.string().min(1).optional(),
|
|
130
|
+
timezone: z.string().min(1).optional()
|
|
131
|
+
})
|
|
132
|
+
};
|
|
133
|
+
const triggerSourceConfigSchemaRegistry = triggerSourceConfigSchemas;
|
|
134
|
+
export const workflowDocumentTriggerSchema = z.strictObject({
|
|
135
|
+
...workflowDocumentTriggerBaseSchema,
|
|
136
|
+
event: z.string().min(1)
|
|
137
|
+
}).superRefine((trigger, ctx)=>{
|
|
138
|
+
if (trigger.config === undefined) return;
|
|
139
|
+
const configSchema = triggerSourceConfigSchemaRegistry[trigger.source];
|
|
140
|
+
if (configSchema === undefined) {
|
|
141
|
+
ctx.addIssue({
|
|
142
|
+
code: 'custom',
|
|
143
|
+
path: [
|
|
144
|
+
'config'
|
|
145
|
+
],
|
|
146
|
+
message: `\`config\` is not supported for source \`${trigger.source}\`.`
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const configResult = configSchema.safeParse(trigger.config);
|
|
151
|
+
if (configResult.success) return;
|
|
152
|
+
for (const configIssue of configResult.error.issues){
|
|
153
|
+
ctx.addIssue({
|
|
154
|
+
...configIssue,
|
|
155
|
+
path: [
|
|
156
|
+
'config',
|
|
157
|
+
...configIssue.path
|
|
158
|
+
]
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
const workflowDocumentListeningSchema = z.strictObject({
|
|
163
|
+
on: z.array(workflowDocumentTriggerSchema).min(1),
|
|
164
|
+
until: z.array(workflowDocumentTriggerSchema).min(1).optional(),
|
|
165
|
+
timeout: z.string().min(1).optional(),
|
|
166
|
+
max_executions: z.number().int().positive().optional(),
|
|
167
|
+
batch: z.strictObject({
|
|
168
|
+
debounce: z.string().min(1).optional(),
|
|
169
|
+
max_size: z.number().int().positive().optional(),
|
|
170
|
+
max_wait: z.string().min(1).optional()
|
|
171
|
+
}).refine((value)=>value.debounce !== undefined || value.max_size !== undefined || value.max_wait !== undefined, {
|
|
172
|
+
message: 'Expected debounce, max_size, or max_wait'
|
|
173
|
+
}).optional(),
|
|
174
|
+
on_resolve: z.enum([
|
|
175
|
+
'finish',
|
|
176
|
+
'cancel'
|
|
177
|
+
]).optional()
|
|
178
|
+
}).superRefine((listening, ctx)=>{
|
|
179
|
+
for (const field of [
|
|
180
|
+
'on',
|
|
181
|
+
'until'
|
|
182
|
+
]){
|
|
183
|
+
for (const [index, trigger] of (listening[field] ?? []).entries()){
|
|
184
|
+
if (trigger.config !== undefined) {
|
|
185
|
+
ctx.addIssue({
|
|
186
|
+
code: 'custom',
|
|
187
|
+
path: [
|
|
188
|
+
field,
|
|
189
|
+
index,
|
|
190
|
+
'config'
|
|
191
|
+
],
|
|
192
|
+
message: '`config` is only supported on top-level triggers.'
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
const workflowDocumentStepGateSchema = z.strictObject({
|
|
199
|
+
success: z.string().min(1).optional(),
|
|
200
|
+
on_failure: z.strictObject({
|
|
201
|
+
restart_from: z.string().min(1),
|
|
202
|
+
feedback: z.string().min(1).optional()
|
|
203
|
+
}).optional()
|
|
204
|
+
}).refine((value)=>value.success !== undefined || value.on_failure !== undefined, {
|
|
205
|
+
message: 'Expected success or on_failure'
|
|
206
|
+
});
|
|
207
|
+
export const workflowDocumentCheckoutSchema = z.strictObject({
|
|
208
|
+
permissions: z.strictObject({
|
|
209
|
+
contents: z.enum([
|
|
210
|
+
'read',
|
|
211
|
+
'write'
|
|
212
|
+
]).optional()
|
|
213
|
+
}).optional(),
|
|
214
|
+
'persist-credentials': z.boolean().optional()
|
|
215
|
+
});
|
|
216
|
+
export const workflowDocumentStepIntegrationSelectionSchema = z.array(z.string().min(1)).min(1);
|
|
217
|
+
export const workflowDocumentStepIntegrationSchema = z.strictObject({
|
|
218
|
+
connection: z.string().min(1).optional(),
|
|
219
|
+
include: workflowDocumentStepIntegrationSelectionSchema,
|
|
220
|
+
exclude: workflowDocumentStepIntegrationSelectionSchema.optional(),
|
|
221
|
+
allow_write: z.boolean().optional()
|
|
222
|
+
});
|
|
223
|
+
// A step is a run step (`run`) or an inline agent step (`prompt`), never
|
|
224
|
+
// both. They share one strict object so an unknown key is still rejected; the
|
|
225
|
+
// `superRefine` discriminates by which payload keys are present and emits one
|
|
226
|
+
// targeted issue per failure mode (a plain union would surface every branch's
|
|
227
|
+
// errors at once). The `agent` keyword is declared only so the reserved-keyword
|
|
228
|
+
// case produces a clear message instead of a generic "unrecognized key".
|
|
229
|
+
export const workflowDocumentStepSchema = z.strictObject({
|
|
230
|
+
key: z.string().min(1).optional(),
|
|
231
|
+
if: z.string().min(1).optional(),
|
|
232
|
+
name: z.string().min(1).optional(),
|
|
233
|
+
run: z.string().min(1).optional(),
|
|
234
|
+
model: z.string().min(1).optional(),
|
|
235
|
+
prompt: z.string().min(1).optional(),
|
|
236
|
+
harness: harnessSchema.optional(),
|
|
237
|
+
thinking: agentThinkingSchema.optional(),
|
|
238
|
+
provider: z.string().min(1).optional(),
|
|
239
|
+
tools: z.array(z.string().min(1)).min(1).optional(),
|
|
240
|
+
integrations: z.array(workflowDocumentStepIntegrationSchema).min(1).optional(),
|
|
241
|
+
agent: z.unknown().optional(),
|
|
242
|
+
gate: workflowDocumentStepGateSchema.optional(),
|
|
243
|
+
env: workflowDocumentEnvSchema.optional(),
|
|
244
|
+
outputs: workflowDocumentStepOutputsSchema.optional()
|
|
245
|
+
}).superRefine((step, ctx)=>{
|
|
246
|
+
if (step.agent !== undefined) {
|
|
247
|
+
ctx.addIssue({
|
|
248
|
+
code: 'custom',
|
|
249
|
+
path: [
|
|
250
|
+
'agent'
|
|
251
|
+
],
|
|
252
|
+
message: 'The "agent" keyword is reserved for a future step kind and is not supported yet.'
|
|
253
|
+
});
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (step.run !== undefined) {
|
|
257
|
+
for (const key of [
|
|
258
|
+
'model',
|
|
259
|
+
'prompt',
|
|
260
|
+
'harness',
|
|
261
|
+
'thinking',
|
|
262
|
+
'provider',
|
|
263
|
+
'tools',
|
|
264
|
+
'integrations'
|
|
265
|
+
]){
|
|
266
|
+
if (step[key] !== undefined) {
|
|
267
|
+
ctx.addIssue({
|
|
268
|
+
code: 'custom',
|
|
269
|
+
path: [
|
|
270
|
+
key
|
|
271
|
+
],
|
|
272
|
+
message: `"${key}" is not valid on a run step.`
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const isAgent = step.model !== undefined || step.prompt !== undefined || step.harness !== undefined || step.thinking !== undefined || step.provider !== undefined || step.tools !== undefined || step.integrations !== undefined;
|
|
279
|
+
if (!isAgent) {
|
|
280
|
+
ctx.addIssue({
|
|
281
|
+
code: 'custom',
|
|
282
|
+
message: 'A step must define either "run" or an agent "prompt".'
|
|
283
|
+
});
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (step.env !== undefined) {
|
|
287
|
+
ctx.addIssue({
|
|
288
|
+
code: 'custom',
|
|
289
|
+
path: [
|
|
290
|
+
'env'
|
|
291
|
+
],
|
|
292
|
+
message: '"env" is supported only on run steps.'
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
if (step.prompt === undefined) {
|
|
296
|
+
ctx.addIssue({
|
|
297
|
+
code: 'custom',
|
|
298
|
+
path: [
|
|
299
|
+
'prompt'
|
|
300
|
+
],
|
|
301
|
+
message: 'An agent step requires "prompt".'
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
export const workflowDocumentJobSchema = z.strictObject({
|
|
306
|
+
needs: stringOrStringArraySchema.optional(),
|
|
307
|
+
if: z.string().min(1).optional(),
|
|
308
|
+
runner: stringOrStringArraySchema.optional(),
|
|
309
|
+
success: z.string().min(1).optional(),
|
|
310
|
+
outputs: nonEmptyRecordSchema(z.string().min(1)).optional(),
|
|
311
|
+
execution_timeout: z.string().min(1).optional(),
|
|
312
|
+
checkout: workflowDocumentCheckoutSchema.optional(),
|
|
313
|
+
listening: workflowDocumentListeningSchema.optional(),
|
|
314
|
+
name: z.string().min(1).optional(),
|
|
315
|
+
env: workflowDocumentEnvSchema.optional(),
|
|
316
|
+
steps: z.array(workflowDocumentStepSchema).min(1)
|
|
317
|
+
});
|
|
318
|
+
export const workflowDocumentSchema = z.strictObject({
|
|
319
|
+
name: z.string().min(1),
|
|
320
|
+
runner: stringOrStringArraySchema.optional(),
|
|
321
|
+
env: workflowDocumentEnvSchema.optional(),
|
|
322
|
+
triggers: nonEmptyRecordSchema(workflowDocumentTriggerSchema).optional(),
|
|
323
|
+
jobs: nonEmptyRecordSchema(workflowDocumentJobSchema)
|
|
324
|
+
});
|
|
325
|
+
function maxJsonDepth(value) {
|
|
326
|
+
if (value === null || typeof value !== 'object') return 0;
|
|
327
|
+
if (Array.isArray(value)) {
|
|
328
|
+
if (value.length === 0) return 1;
|
|
329
|
+
return 1 + Math.max(...value.map(maxJsonDepth));
|
|
330
|
+
}
|
|
331
|
+
const entries = Object.values(value);
|
|
332
|
+
if (entries.length === 0) return 1;
|
|
333
|
+
return 1 + Math.max(...entries.map(maxJsonDepth));
|
|
334
|
+
}
|
|
335
|
+
function isJsonSchemaDocument(value) {
|
|
336
|
+
return typeof value === 'boolean' || typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
//# sourceMappingURL=workflow-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/document/workflow-document.ts"],"sourcesContent":["import {z} from 'zod';\nimport {agentThinkingSchema, harnessSchema} from './step-enums.js';\n\nconst stringOrStringArraySchema = z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]);\nconst nonEmptyRecordSchema = <ValueSchema extends z.ZodType>(valueSchema: ValueSchema) =>\n z\n .record(z.string().min(1), valueSchema)\n .refine((value) => Object.keys(value).length > 0, {message: 'Expected at least one entry'});\n\n// Runner shell steps execute on Unix shells, so workflow env names follow the\n// portable POSIX-style variable shape.\nconst envNameSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);\nconst envStringValueSchema = z.string().refine((value) => !value.includes('\\u0000'), {\n message: 'Env string values cannot contain null bytes',\n});\nexport const WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES = 128;\nexport const WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES = 32 * 1024;\nexport const workflowDocumentStepOutputTypes = ['string', 'number', 'boolean', 'json'] as const;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES =\n WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH = 64;\n\nconst utf8Encoder = new TextEncoder();\n\nexport const workflowDocumentEnvSchema = z\n .record(envNameSchema, z.union([envStringValueSchema, z.number(), z.boolean()]))\n .superRefine((env, ctx) => {\n const entries = Object.keys(env).length;\n if (entries > WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES) {\n ctx.addIssue({\n code: 'custom',\n message: `Env cannot define more than ${WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES} entries.`,\n });\n }\n\n const serializedBytes = utf8Encoder.encode(JSON.stringify(env)).byteLength;\n if (serializedBytes > WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES) {\n ctx.addIssue({\n code: 'custom',\n message: `Env cannot serialize to more than ${WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES} bytes.`,\n });\n }\n });\n\nconst workflowDocumentStepOutputKeyPattern = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n\nconst workflowDocumentStepOutputTypeSchema = z.enum(workflowDocumentStepOutputTypes);\n\nconst workflowDocumentStepOutputDeclarationSchema = z\n .union([\n workflowDocumentStepOutputTypeSchema.transform((type) => ({type})),\n z.strictObject({\n type: workflowDocumentStepOutputTypeSchema,\n schema: z.unknown().optional(),\n }),\n ])\n .superRefine((declaration, ctx) => {\n const schema = 'schema' in declaration ? declaration.schema : undefined;\n if (declaration.type !== 'json' && schema !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: '`schema` is only supported for json outputs.',\n });\n return;\n }\n\n if (schema === undefined) return;\n\n if (!isJsonSchemaDocument(schema)) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: 'Schema must be a valid JSON Schema document.',\n });\n return;\n }\n\n const serializedBytes = utf8Encoder.encode(JSON.stringify(schema)).byteLength;\n if (serializedBytes > WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: `Output JSON Schema cannot serialize to more than ${WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES} bytes.`,\n });\n }\n\n const depth = maxJsonDepth(schema);\n if (depth > WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: `Output JSON Schema cannot be nested deeper than ${WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH} levels.`,\n });\n }\n });\n\nexport const workflowDocumentStepOutputsSchema = z\n .record(z.string(), workflowDocumentStepOutputDeclarationSchema)\n .superRefine((outputs, ctx) => {\n const entries = Object.keys(outputs).length;\n if (entries > WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES) {\n ctx.addIssue({\n code: 'custom',\n message: `Step outputs cannot define more than ${WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES} entries.`,\n });\n }\n\n for (const key of Object.keys(outputs)) {\n if (workflowDocumentStepOutputKeyPattern.test(key)) continue;\n ctx.addIssue({\n code: 'custom',\n path: [key],\n message: 'Output keys must be CEL identifiers.',\n });\n }\n });\n\nconst workflowDocumentTriggerBaseSchema = {\n source: z.string().min(1),\n with: z.record(z.string(), z.unknown()).optional(),\n filter: z.string().min(1).optional(),\n config: z.record(z.string(), z.unknown()).optional(),\n} satisfies z.ZodRawShape;\n\nexport const triggerSourceConfigSchemas = {\n cron: z.strictObject({\n schedule: z.string().min(1).optional(),\n timezone: z.string().min(1).optional(),\n }),\n} satisfies Record<string, z.ZodType>;\nconst triggerSourceConfigSchemaRegistry: Readonly<Record<string, z.ZodType>> =\n triggerSourceConfigSchemas;\n\nexport const workflowDocumentTriggerSchema = z\n .strictObject({\n ...workflowDocumentTriggerBaseSchema,\n event: z.string().min(1),\n })\n .superRefine((trigger, ctx) => {\n if (trigger.config === undefined) return;\n\n const configSchema = triggerSourceConfigSchemaRegistry[trigger.source];\n if (configSchema === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['config'],\n message: `\\`config\\` is not supported for source \\`${trigger.source}\\`.`,\n });\n return;\n }\n\n const configResult = configSchema.safeParse(trigger.config);\n if (configResult.success) return;\n\n for (const configIssue of configResult.error.issues) {\n ctx.addIssue({\n ...configIssue,\n path: ['config', ...configIssue.path],\n });\n }\n });\n\nconst workflowDocumentListeningSchema = z\n .strictObject({\n on: z.array(workflowDocumentTriggerSchema).min(1),\n until: z.array(workflowDocumentTriggerSchema).min(1).optional(),\n timeout: z.string().min(1).optional(),\n max_executions: z.number().int().positive().optional(),\n batch: z\n .strictObject({\n debounce: z.string().min(1).optional(),\n max_size: z.number().int().positive().optional(),\n max_wait: z.string().min(1).optional(),\n })\n .refine(\n (value) =>\n value.debounce !== undefined ||\n value.max_size !== undefined ||\n value.max_wait !== undefined,\n {message: 'Expected debounce, max_size, or max_wait'},\n )\n .optional(),\n on_resolve: z.enum(['finish', 'cancel']).optional(),\n })\n .superRefine((listening, ctx) => {\n for (const field of ['on', 'until'] as const) {\n for (const [index, trigger] of (listening[field] ?? []).entries()) {\n if (trigger.config !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [field, index, 'config'],\n message: '`config` is only supported on top-level triggers.',\n });\n }\n }\n }\n });\n\nconst workflowDocumentStepGateSchema = z\n .strictObject({\n success: z.string().min(1).optional(),\n on_failure: z\n .strictObject({\n restart_from: z.string().min(1),\n feedback: z.string().min(1).optional(),\n })\n .optional(),\n })\n .refine((value) => value.success !== undefined || value.on_failure !== undefined, {\n message: 'Expected success or on_failure',\n });\n\nexport const workflowDocumentCheckoutSchema = z.strictObject({\n permissions: z\n .strictObject({\n contents: z.enum(['read', 'write']).optional(),\n })\n .optional(),\n 'persist-credentials': z.boolean().optional(),\n});\n\nexport const workflowDocumentStepIntegrationSelectionSchema = z.array(z.string().min(1)).min(1);\n\nexport const workflowDocumentStepIntegrationSchema = z.strictObject({\n connection: z.string().min(1).optional(),\n include: workflowDocumentStepIntegrationSelectionSchema,\n exclude: workflowDocumentStepIntegrationSelectionSchema.optional(),\n allow_write: z.boolean().optional(),\n});\n\n// A step is a run step (`run`) or an inline agent step (`prompt`), never\n// both. They share one strict object so an unknown key is still rejected; the\n// `superRefine` discriminates by which payload keys are present and emits one\n// targeted issue per failure mode (a plain union would surface every branch's\n// errors at once). The `agent` keyword is declared only so the reserved-keyword\n// case produces a clear message instead of a generic \"unrecognized key\".\nexport const workflowDocumentStepSchema = z\n .strictObject({\n key: z.string().min(1).optional(),\n if: z.string().min(1).optional(),\n name: z.string().min(1).optional(),\n run: z.string().min(1).optional(),\n model: z.string().min(1).optional(),\n prompt: z.string().min(1).optional(),\n harness: harnessSchema.optional(),\n thinking: agentThinkingSchema.optional(),\n provider: z.string().min(1).optional(),\n tools: z.array(z.string().min(1)).min(1).optional(),\n integrations: z.array(workflowDocumentStepIntegrationSchema).min(1).optional(),\n agent: z.unknown().optional(),\n gate: workflowDocumentStepGateSchema.optional(),\n env: workflowDocumentEnvSchema.optional(),\n outputs: workflowDocumentStepOutputsSchema.optional(),\n })\n .superRefine((step, ctx) => {\n if (step.agent !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['agent'],\n message: 'The \"agent\" keyword is reserved for a future step kind and is not supported yet.',\n });\n return;\n }\n\n if (step.run !== undefined) {\n for (const key of [\n 'model',\n 'prompt',\n 'harness',\n 'thinking',\n 'provider',\n 'tools',\n 'integrations',\n ] as const) {\n if (step[key] !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [key],\n message: `\"${key}\" is not valid on a run step.`,\n });\n }\n }\n return;\n }\n\n const isAgent =\n step.model !== undefined ||\n step.prompt !== undefined ||\n step.harness !== undefined ||\n step.thinking !== undefined ||\n step.provider !== undefined ||\n step.tools !== undefined ||\n step.integrations !== undefined;\n\n if (!isAgent) {\n ctx.addIssue({\n code: 'custom',\n message: 'A step must define either \"run\" or an agent \"prompt\".',\n });\n return;\n }\n\n if (step.env !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['env'],\n message: '\"env\" is supported only on run steps.',\n });\n }\n if (step.prompt === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['prompt'],\n message: 'An agent step requires \"prompt\".',\n });\n }\n });\n\nexport const workflowDocumentJobSchema = z.strictObject({\n needs: stringOrStringArraySchema.optional(),\n if: z.string().min(1).optional(),\n runner: stringOrStringArraySchema.optional(),\n success: z.string().min(1).optional(),\n outputs: nonEmptyRecordSchema(z.string().min(1)).optional(),\n execution_timeout: z.string().min(1).optional(),\n checkout: workflowDocumentCheckoutSchema.optional(),\n listening: workflowDocumentListeningSchema.optional(),\n name: z.string().min(1).optional(),\n env: workflowDocumentEnvSchema.optional(),\n steps: z.array(workflowDocumentStepSchema).min(1),\n});\n\nexport const workflowDocumentSchema = z.strictObject({\n name: z.string().min(1),\n runner: stringOrStringArraySchema.optional(),\n env: workflowDocumentEnvSchema.optional(),\n triggers: nonEmptyRecordSchema(workflowDocumentTriggerSchema).optional(),\n jobs: nonEmptyRecordSchema(workflowDocumentJobSchema),\n});\n\nexport type WorkflowDocument = z.infer<typeof workflowDocumentSchema>;\nexport type WorkflowDocumentJobCheckout = z.infer<typeof workflowDocumentCheckoutSchema>;\nexport type WorkflowDocumentEnv = z.infer<typeof workflowDocumentEnvSchema>;\nexport type WorkflowDocumentJob = z.infer<typeof workflowDocumentJobSchema>;\nexport type WorkflowDocumentJobListening = z.infer<typeof workflowDocumentListeningSchema>;\nexport type WorkflowDocumentRunStepGate = z.infer<typeof workflowDocumentStepGateSchema>;\nexport type WorkflowDocumentStepIntegration = z.infer<typeof workflowDocumentStepIntegrationSchema>;\nexport type WorkflowDocumentStepOutputType = (typeof workflowDocumentStepOutputTypes)[number];\nexport type WorkflowDocumentStepOutputs = z.infer<typeof workflowDocumentStepOutputsSchema>;\nexport type WorkflowDocumentStep = z.infer<typeof workflowDocumentStepSchema>;\nexport type WorkflowDocumentTrigger = z.infer<typeof workflowDocumentTriggerSchema>;\n\nfunction maxJsonDepth(value: unknown): number {\n if (value === null || typeof value !== 'object') return 0;\n if (Array.isArray(value)) {\n if (value.length === 0) return 1;\n return 1 + Math.max(...value.map(maxJsonDepth));\n }\n\n const entries = Object.values(value);\n if (entries.length === 0) return 1;\n return 1 + Math.max(...entries.map(maxJsonDepth));\n}\n\nfunction isJsonSchemaDocument(value: unknown): boolean {\n return (\n typeof value === 'boolean' ||\n (typeof value === 'object' && value !== null && !Array.isArray(value))\n );\n}\n"],"names":["z","agentThinkingSchema","harnessSchema","stringOrStringArraySchema","union","string","min","array","nonEmptyRecordSchema","valueSchema","record","refine","value","Object","keys","length","message","envNameSchema","regex","envStringValueSchema","includes","WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES","WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES","workflowDocumentStepOutputTypes","WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH","utf8Encoder","TextEncoder","workflowDocumentEnvSchema","number","boolean","superRefine","env","ctx","entries","addIssue","code","serializedBytes","encode","JSON","stringify","byteLength","workflowDocumentStepOutputKeyPattern","workflowDocumentStepOutputTypeSchema","enum","workflowDocumentStepOutputDeclarationSchema","transform","type","strictObject","schema","unknown","optional","declaration","undefined","path","isJsonSchemaDocument","depth","maxJsonDepth","workflowDocumentStepOutputsSchema","outputs","key","test","workflowDocumentTriggerBaseSchema","source","with","filter","config","triggerSourceConfigSchemas","cron","schedule","timezone","triggerSourceConfigSchemaRegistry","workflowDocumentTriggerSchema","event","trigger","configSchema","configResult","safeParse","success","configIssue","error","issues","workflowDocumentListeningSchema","on","until","timeout","max_executions","int","positive","batch","debounce","max_size","max_wait","on_resolve","listening","field","index","workflowDocumentStepGateSchema","on_failure","restart_from","feedback","workflowDocumentCheckoutSchema","permissions","contents","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepIntegrationSchema","connection","include","exclude","allow_write","workflowDocumentStepSchema","if","name","run","model","prompt","harness","thinking","provider","tools","integrations","agent","gate","step","isAgent","workflowDocumentJobSchema","needs","runner","execution_timeout","checkout","steps","workflowDocumentSchema","triggers","jobs","Array","isArray","Math","max","map","values"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,mBAAmB,EAAEC,aAAa,QAAO,kBAAkB;AAEnE,MAAMC,4BAA4BH,EAAEI,KAAK,CAAC;IAACJ,EAAEK,MAAM,GAAGC,GAAG,CAAC;IAAIN,EAAEO,KAAK,CAACP,EAAEK,MAAM,GAAGC,GAAG,CAAC,IAAIA,GAAG,CAAC;CAAG;AAChG,MAAME,uBAAuB,CAAgCC,cAC3DT,EACGU,MAAM,CAACV,EAAEK,MAAM,GAAGC,GAAG,CAAC,IAAIG,aAC1BE,MAAM,CAAC,CAACC,QAAUC,OAAOC,IAAI,CAACF,OAAOG,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;IAC7C8E,UAAU5B,+BAA+BlD,QAAQ;IACjD2C,WAAWZ,gCAAgC/B,QAAQ;IACnD6D,MAAMjH,EAAEK,MAAM,GAAGC,GAAG,CAAC,GAAG8C,QAAQ;IAChCnB,KAAKJ,0BAA0BuB,QAAQ;IACvC+E,OAAOnI,EAAEO,KAAK,CAACwG,4BAA4BzG,GAAG,CAAC;AACjD,GAAG;AAEH,OAAO,MAAM8H,yBAAyBpI,EAAEiD,YAAY,CAAC;IACnDgE,MAAMjH,EAAEK,MAAM,GAAGC,GAAG,CAAC;IACrB0H,QAAQ7H,0BAA0BiD,QAAQ;IAC1CnB,KAAKJ,0BAA0BuB,QAAQ;IACvCiF,UAAU7H,qBAAqBiE,+BAA+BrB,QAAQ;IACtEkF,MAAM9H,qBAAqBsH;AAC7B,GAAG;AAcH,SAASpE,aAAa9C,KAAc;IAClC,IAAIA,UAAU,QAAQ,OAAOA,UAAU,UAAU,OAAO;IACxD,IAAI2H,MAAMC,OAAO,CAAC5H,QAAQ;QACxB,IAAIA,MAAMG,MAAM,KAAK,GAAG,OAAO;QAC/B,OAAO,IAAI0H,KAAKC,GAAG,IAAI9H,MAAM+H,GAAG,CAACjF;IACnC;IAEA,MAAMvB,UAAUtB,OAAO+H,MAAM,CAAChI;IAC9B,IAAIuB,QAAQpB,MAAM,KAAK,GAAG,OAAO;IACjC,OAAO,IAAI0H,KAAKC,GAAG,IAAIvG,QAAQwG,GAAG,CAACjF;AACrC;AAEA,SAASF,qBAAqB5C,KAAc;IAC1C,OACE,OAAOA,UAAU,aAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAAC2H,MAAMC,OAAO,CAAC5H;AAEnE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { type AgentThinking, agentThinkingByHarness, agentThinkingSchema, claudeAgentThinkingSchema, DEFAULT_AGENT_THINKING, DEFAULT_HARNESS, DEFAULT_MODEL_PROVIDER, type Harness, harnessSchema, InvalidWorkflowDocumentError, invalidWorkflowDocumentErrorCode, parseWorkflowDocument, piAgentThinkingSchema, thinkingLevelsForHarness, triggerSourceConfigSchemas, WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES, WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES, type WorkflowDocument, type WorkflowDocumentEnv, type WorkflowDocumentJob, type WorkflowDocumentJobCheckout, type WorkflowDocumentRunStepGate, type WorkflowDocumentStep, type WorkflowDocumentStepIntegration, type WorkflowDocumentStepOutputs, type WorkflowDocumentStepOutputType, type WorkflowDocumentTrigger, workflowDocumentEnvSchema, workflowDocumentSchema, workflowDocumentStepIntegrationSchema, workflowDocumentStepIntegrationSelectionSchema, workflowDocumentStepOutputsSchema, workflowDocumentStepOutputTypes, workflowDocumentStepSchema, } from '#document/index.js';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,KAAK,OAAO,EACZ,aAAa,EACb,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,0CAA0C,EAC1C,8CAA8C,EAC9C,yDAAyD,EACzD,0CAA0C,EAC1C,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,qCAAqC,EACrC,8CAA8C,EAC9C,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { agentThinkingByHarness, agentThinkingSchema, claudeAgentThinkingSchema, DEFAULT_AGENT_THINKING, DEFAULT_HARNESS, DEFAULT_MODEL_PROVIDER, harnessSchema, InvalidWorkflowDocumentError, invalidWorkflowDocumentErrorCode, parseWorkflowDocument, piAgentThinkingSchema, thinkingLevelsForHarness, triggerSourceConfigSchemas, WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES, WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES, workflowDocumentEnvSchema, workflowDocumentSchema, workflowDocumentStepIntegrationSchema, workflowDocumentStepIntegrationSelectionSchema, workflowDocumentStepOutputsSchema, workflowDocumentStepOutputTypes, workflowDocumentStepSchema } from '#document/index.js';
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type AgentThinking,\n agentThinkingByHarness,\n agentThinkingSchema,\n claudeAgentThinkingSchema,\n DEFAULT_AGENT_THINKING,\n DEFAULT_HARNESS,\n DEFAULT_MODEL_PROVIDER,\n type Harness,\n harnessSchema,\n InvalidWorkflowDocumentError,\n invalidWorkflowDocumentErrorCode,\n parseWorkflowDocument,\n piAgentThinkingSchema,\n thinkingLevelsForHarness,\n triggerSourceConfigSchemas,\n WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES,\n WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES,\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH,\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES,\n WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES,\n type WorkflowDocument,\n type WorkflowDocumentEnv,\n type WorkflowDocumentJob,\n type WorkflowDocumentJobCheckout,\n type WorkflowDocumentRunStepGate,\n type WorkflowDocumentStep,\n type WorkflowDocumentStepIntegration,\n type WorkflowDocumentStepOutputs,\n type WorkflowDocumentStepOutputType,\n type WorkflowDocumentTrigger,\n workflowDocumentEnvSchema,\n workflowDocumentSchema,\n workflowDocumentStepIntegrationSchema,\n workflowDocumentStepIntegrationSelectionSchema,\n workflowDocumentStepOutputsSchema,\n workflowDocumentStepOutputTypes,\n workflowDocumentStepSchema,\n} from '#document/index.js';\n"],"names":["agentThinkingByHarness","agentThinkingSchema","claudeAgentThinkingSchema","DEFAULT_AGENT_THINKING","DEFAULT_HARNESS","DEFAULT_MODEL_PROVIDER","harnessSchema","InvalidWorkflowDocumentError","invalidWorkflowDocumentErrorCode","parseWorkflowDocument","piAgentThinkingSchema","thinkingLevelsForHarness","triggerSourceConfigSchemas","WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES","WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES","workflowDocumentEnvSchema","workflowDocumentSchema","workflowDocumentStepIntegrationSchema","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepOutputsSchema","workflowDocumentStepOutputTypes","workflowDocumentStepSchema"],"mappings":"AAAA,SAEEA,sBAAsB,EACtBC,mBAAmB,EACnBC,yBAAyB,EACzBC,sBAAsB,EACtBC,eAAe,EACfC,sBAAsB,EAEtBC,aAAa,EACbC,4BAA4B,EAC5BC,gCAAgC,EAChCC,qBAAqB,EACrBC,qBAAqB,EACrBC,wBAAwB,EACxBC,0BAA0B,EAC1BC,iCAAiC,EACjCC,0CAA0C,EAC1CC,8CAA8C,EAC9CC,yDAAyD,EACzDC,0CAA0C,EAW1CC,yBAAyB,EACzBC,sBAAsB,EACtBC,qCAAqC,EACrCC,8CAA8C,EAC9CC,iCAAiC,EACjCC,+BAA+B,EAC/BC,0BAA0B,QACrB,qBAAqB"}
|