@shipfox/workflow-document 2.1.3 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { checkoutTargetValidationIssues } from './checkout-target-validation.js';
2
3
  import { agentThinkingSchema, harnessSchema } from './step-enums.js';
3
4
  const stringOrStringArraySchema = z.union([
4
5
  z.string().min(1),
@@ -7,6 +8,32 @@ const stringOrStringArraySchema = z.union([
7
8
  const nonEmptyRecordSchema = (valueSchema)=>z.record(z.string().min(1), valueSchema).refine((value)=>Object.keys(value).length > 0, {
8
9
  message: 'Expected at least one entry'
9
10
  });
11
+ export const WORKFLOW_LITERAL_NAME_PATTERN = /^(?:[^$]|\$\$\{\{|\$(?!\{\{))*$/;
12
+ // The inverse of a literal name: a literal prefix followed by an unescaped
13
+ // `${{`. An enum field that also accepts a template matches one or the other.
14
+ export const WORKFLOW_INTERPOLATED_VALUE_PATTERN = /^(?:[^$]|\$\$\{\{|\$(?!\{\{))*\$\{\{/;
15
+ // Reasoning effort is an enum so editors can complete it, and a template so a
16
+ // workflow can choose the effort from run context. The resolved value is
17
+ // checked against the harness levels when the step is dispatched.
18
+ export const agentThinkingFieldSchema = z.union([
19
+ agentThinkingSchema,
20
+ z.string().regex(WORKFLOW_INTERPOLATED_VALUE_PATTERN, {
21
+ message: 'Agent thinking must be a supported level or a $' + '{{ }} interpolation that resolves to one.'
22
+ })
23
+ ]).meta({
24
+ description: 'Reasoning effort for an agent step. Supported values depend on the resolved harness. Accepts a $' + '{{ }} interpolation. When omitted, Shipfox uses the provider default, or `xhigh` when none is configured.'
25
+ });
26
+ const workflowNameSchema = literalNameSchema('Workflow name must be literal. Move runtime interpolation to run_name.').meta({
27
+ description: 'Static literal human-readable workflow name.'
28
+ });
29
+ const jobNameSchema = literalNameSchema('Job name must be literal. Move runtime interpolation to execution_name.').meta({
30
+ description: 'Static literal human-readable job name.'
31
+ });
32
+ function literalNameSchema(message) {
33
+ return z.string().min(1).regex(WORKFLOW_LITERAL_NAME_PATTERN, {
34
+ message
35
+ });
36
+ }
10
37
  // Runner shell steps execute on Unix shells, so workflow env names follow the
11
38
  // portable POSIX-style variable shape.
12
39
  const envNameSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
@@ -21,6 +48,7 @@ export const workflowDocumentStepOutputTypes = [
21
48
  'boolean',
22
49
  'json'
23
50
  ];
51
+ export const WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;
24
52
  export const WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;
25
53
  export const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES = WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES;
26
54
  export const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH = 64;
@@ -131,10 +159,10 @@ const workflowDocumentTriggerBaseSchema = {
131
159
  description: 'Integration connection slug or built-in trigger source. See [Trigger sources](/reference/trigger-sources).'
132
160
  }),
133
161
  with: z.record(z.string(), z.unknown()).optional().meta({
134
- description: 'Provider-specific values used to match or configure the trigger. See [expressions](/reference/expressions#context-available).'
162
+ description: 'Provider-specific values used to match or configure the trigger. See [Trigger sources](/reference/trigger-sources).'
135
163
  }),
136
164
  filter: z.string().min(1).optional().meta({
137
- description: 'CEL condition that filters matching events. It is not supported for `manual` or `cron` triggers. See [trigger filters](/reference/expressions#trigger-filters).'
165
+ description: 'CEL condition that filters matching events. It is not supported for `manual` or `cron` triggers. See [Expressions](/reference/expressions) and [Contexts](/reference/contexts#context-availability).'
138
166
  }),
139
167
  config: z.record(z.string(), z.unknown()).optional().meta({
140
168
  description: 'Source-specific configuration. It is supported only for top-level triggers with a known built-in source. See [cron triggers](/reference/trigger-sources#cron).'
@@ -252,20 +280,63 @@ const workflowDocumentStepGateSchema = z.strictObject({
252
280
  }).refine((value)=>value.success !== undefined || value.on_failure !== undefined, {
253
281
  message: 'Expected success or on_failure'
254
282
  });
283
+ const workflowDocumentCheckoutPermissionsSchema = z.strictObject({
284
+ contents: z.enum([
285
+ 'read',
286
+ 'write'
287
+ ]).optional().meta({
288
+ description: 'Repository contents permission granted to checkout.'
289
+ })
290
+ }).optional().meta({
291
+ description: 'Repository permissions used during checkout.'
292
+ });
293
+ const workflowDocumentPersistCredentialsSchema = z.boolean().optional().meta({
294
+ description: 'Whether checkout credentials remain available to later run steps.'
295
+ });
255
296
  export const workflowDocumentCheckoutSchema = z.strictObject({
256
- permissions: z.strictObject({
257
- contents: z.enum([
258
- 'read',
259
- 'write'
260
- ]).optional().meta({
261
- description: 'Repository contents permission granted to checkout.'
262
- })
263
- }).optional().meta({
264
- description: 'Repository permissions used during checkout.'
297
+ project: z.string().min(1).optional().meta({
298
+ description: 'Shipfox project id to check out. Exclusive with connection and repository.'
299
+ }),
300
+ connection: z.string().min(1).optional().meta({
301
+ description: 'Integration connection slug to use for checkout.'
265
302
  }),
266
- 'persist-credentials': z.boolean().optional().meta({
267
- description: 'Whether checkout credentials remain available to later run steps.'
303
+ repository: z.string().min(1).optional().meta({
304
+ description: 'Repository to check out, as owner/name or a bare name.'
305
+ }),
306
+ ref: z.string().min(1).optional().meta({
307
+ description: 'Repository ref to check out.'
308
+ }),
309
+ 'fetch-depth': z.number().int().min(0).optional().meta({
310
+ description: 'Number of commits to fetch. Use 0 for full history.'
311
+ }),
312
+ path: z.string().min(1).optional().meta({
313
+ description: 'Relative path under the job workspace where this repository is checked out.'
314
+ }),
315
+ permissions: workflowDocumentCheckoutPermissionsSchema,
316
+ 'persist-credentials': workflowDocumentPersistCredentialsSchema,
317
+ force: z.boolean().optional().meta({
318
+ description: 'Whether checkout may replace an occupied destination.'
268
319
  })
320
+ }).superRefine((checkout, ctx)=>{
321
+ for (const validationIssue of checkoutTargetValidationIssues(checkout)){
322
+ const message = validationIssue.kind === 'project-with-connection' ? '"connection" cannot be combined with "project".' : validationIssue.kind === 'project-with-repository' ? '"repository" cannot be combined with "project".' : '"connection" requires "repository".';
323
+ ctx.addIssue({
324
+ code: 'custom',
325
+ path: [
326
+ validationIssue.path
327
+ ],
328
+ message
329
+ });
330
+ }
331
+ });
332
+ const workflowDocumentJobCheckoutSchema = z.union([
333
+ z.strictObject({
334
+ permissions: workflowDocumentCheckoutPermissionsSchema,
335
+ 'persist-credentials': workflowDocumentPersistCredentialsSchema
336
+ }),
337
+ z.literal(false)
338
+ ]).meta({
339
+ description: 'Checkout settings for repository content and credentials, or false to skip checkout.'
269
340
  });
270
341
  export const workflowDocumentStepIntegrationSelectionSchema = z.array(z.string().min(1)).min(1);
271
342
  export const workflowDocumentStepIntegrationSchema = z.strictObject({
@@ -291,25 +362,32 @@ export const workflowDocumentAgentStepFields = [
291
362
  'tools',
292
363
  'integrations'
293
364
  ];
294
- // A step is a run step (`run`) or an inline agent step (`prompt`), never
295
- // both. They share one strict object so an unknown key is still rejected; the
296
- // `superRefine` discriminates by which payload keys are present and emits one
297
- // targeted issue per failure mode (a plain union would surface every branch's
298
- // errors at once). The `agent` keyword is declared only so the reserved-keyword
299
- // case produces a clear message instead of a generic "unrecognized key".
365
+ // A step is a run step (`run`), an inline agent step (`prompt`), or a checkout
366
+ // step (`checkout`), never two kinds at once. They share one strict object so
367
+ // an unknown key is still rejected; the `superRefine` discriminates by which
368
+ // payload keys are present and emits one targeted issue per failure mode (a
369
+ // plain union would surface every branch's errors at once). The `agent`
370
+ // keyword is declared only so the reserved-keyword case produces a clear
371
+ // message instead of a generic "unrecognized key".
300
372
  export const workflowDocumentStepSchema = z.strictObject({
301
373
  key: z.string().min(1).optional().meta({
302
374
  description: 'Stable step key for dependencies and outputs.'
303
375
  }),
304
376
  if: z.string().min(1).optional().meta({
305
- description: 'CEL condition wrapped in exactly one $' + '{{ }} interpolation. See [conditionals](/reference/expressions#conditionals-if).'
377
+ description: 'CEL condition wrapped in exactly one $' + '{{ }} interpolation. See [conditionals](/reference/expressions#syntax).'
306
378
  }),
307
379
  name: z.string().min(1).optional().meta({
308
380
  description: 'Human-readable step name.'
309
381
  }),
382
+ working_directory: z.string().min(1).optional().meta({
383
+ description: 'Working directory for the step, relative to the job workspace.'
384
+ }),
310
385
  run: z.string().min(1).optional().meta({
311
386
  description: 'Shell command for a run step. Do not combine it with agent-only fields.'
312
387
  }),
388
+ checkout: workflowDocumentCheckoutSchema.optional().meta({
389
+ description: 'Repository checkout settings for this step.'
390
+ }),
313
391
  model: z.string().min(1).optional().meta({
314
392
  description: 'Model ID for an agent step. It requires `prompt` and is not valid on a run step.'
315
393
  }),
@@ -319,9 +397,7 @@ export const workflowDocumentStepSchema = z.strictObject({
319
397
  harness: harnessSchema.optional().meta({
320
398
  description: 'Agent harness. When omitted, Shipfox uses the workspace default harness, or `pi` when none is configured.'
321
399
  }),
322
- thinking: agentThinkingSchema.optional().meta({
323
- description: 'Reasoning effort for an agent step. Supported values depend on the resolved harness. When omitted, Shipfox uses the provider default, or `xhigh` when none is configured.'
324
- }),
400
+ thinking: agentThinkingFieldSchema.optional(),
325
401
  provider: z.string().min(1).optional().meta({
326
402
  description: 'Model provider ID for an agent step. It requires `prompt` and is not valid on a run step.'
327
403
  }),
@@ -354,6 +430,38 @@ export const workflowDocumentStepSchema = z.strictObject({
354
430
  });
355
431
  return;
356
432
  }
433
+ if (step.checkout !== undefined) {
434
+ if (step.run !== undefined) {
435
+ ctx.addIssue({
436
+ code: 'custom',
437
+ path: [
438
+ 'run'
439
+ ],
440
+ message: '"run" is not valid on a checkout step.'
441
+ });
442
+ }
443
+ for (const key of workflowDocumentAgentStepFields){
444
+ if (step[key] !== undefined) {
445
+ ctx.addIssue({
446
+ code: 'custom',
447
+ path: [
448
+ key
449
+ ],
450
+ message: `"${key}" is not valid on a checkout step.`
451
+ });
452
+ }
453
+ }
454
+ if (step.env !== undefined) {
455
+ ctx.addIssue({
456
+ code: 'custom',
457
+ path: [
458
+ 'env'
459
+ ],
460
+ message: '"env" is not valid on a checkout step.'
461
+ });
462
+ }
463
+ return;
464
+ }
357
465
  if (step.run !== undefined) {
358
466
  for (const key of workflowDocumentAgentStepFields){
359
467
  if (step[key] !== undefined) {
@@ -372,7 +480,7 @@ export const workflowDocumentStepSchema = z.strictObject({
372
480
  if (!isAgent) {
373
481
  ctx.addIssue({
374
482
  code: 'custom',
375
- message: 'A step must define either "run" or an agent "prompt".'
483
+ message: 'A step must define either "run", an agent "prompt", or "checkout".'
376
484
  });
377
485
  return;
378
486
  }
@@ -395,33 +503,41 @@ export const workflowDocumentStepSchema = z.strictObject({
395
503
  });
396
504
  }
397
505
  });
506
+ const workflowDocumentJobOutputsSchema = nonEmptyRecordSchema(z.string().min(1)).superRefine((outputs, ctx)=>{
507
+ const entries = Object.keys(outputs).length;
508
+ if (entries > WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES) {
509
+ ctx.addIssue({
510
+ code: 'custom',
511
+ message: `Job outputs cannot define more than ${WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES} entries.`
512
+ });
513
+ }
514
+ });
398
515
  export const workflowDocumentJobSchema = z.strictObject({
399
516
  needs: stringOrStringArraySchema.optional().meta({
400
517
  description: 'Job key or keys that must complete before this job starts.'
401
518
  }),
402
519
  if: z.string().min(1).optional().meta({
403
- description: 'CEL condition wrapped in exactly one $' + '{{ }} interpolation. See [conditionals](/reference/expressions#conditionals-if).'
520
+ description: 'CEL condition wrapped in exactly one $' + '{{ }} interpolation. See [conditionals](/reference/expressions#syntax).'
404
521
  }),
405
522
  runner: stringOrStringArraySchema.optional().meta({
406
523
  description: 'Runner label or ordered fallback labels for this job. See [runners and execution environments](/understand/runners-and-execution-environments).'
407
524
  }),
408
525
  success: z.string().min(1).optional().meta({
409
- description: 'CEL expression that determines whether the job succeeds. See [job success](/reference/expressions#job-success-success).'
526
+ description: 'CEL expression that determines whether the job succeeds. See [Expressions](/reference/expressions#functions-and-macros) and [Contexts](/reference/contexts#context-availability).'
410
527
  }),
411
- outputs: nonEmptyRecordSchema(z.string().min(1)).optional().meta({
412
- description: 'Named job outputs mapped from step values.'
528
+ outputs: workflowDocumentJobOutputsSchema.optional().meta({
529
+ description: `Named job outputs mapped from step values. A mapping with exactly one expression preserves an inferred non-string source type. Each job allows up to ${WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES} declarations.`
413
530
  }),
414
531
  execution_timeout: z.string().min(1).optional().meta({
415
532
  description: 'Maximum duration for one job execution.'
416
533
  }),
417
- checkout: workflowDocumentCheckoutSchema.optional().meta({
418
- description: 'Checkout settings for repository content and credentials.'
419
- }),
534
+ checkout: workflowDocumentJobCheckoutSchema.optional(),
420
535
  listening: workflowDocumentListeningSchema.optional().meta({
421
536
  description: 'Event-listening configuration for this job. See [listening jobs](/understand/listening-jobs).'
422
537
  }),
423
- name: z.string().min(1).optional().meta({
424
- description: 'Human-readable job name.'
538
+ name: jobNameSchema.optional(),
539
+ execution_name: z.string().min(1).optional().meta({
540
+ description: 'Dynamic name for each job execution. Supports workflow expressions.'
425
541
  }),
426
542
  env: workflowDocumentEnvSchema.optional().meta({
427
543
  description: 'Environment variables for run steps in this job. They do not apply to agent steps. See [secrets and variables](/reference/secrets-variables).'
@@ -431,8 +547,9 @@ export const workflowDocumentJobSchema = z.strictObject({
431
547
  })
432
548
  });
433
549
  export const workflowDocumentSchema = z.strictObject({
434
- name: z.string().min(1).meta({
435
- description: 'Human-readable workflow name.'
550
+ name: workflowNameSchema,
551
+ run_name: z.string().min(1).optional().meta({
552
+ description: 'Dynamic name for each workflow run. Supports workflow expressions.'
436
553
  }),
437
554
  runner: stringOrStringArraySchema.optional().meta({
438
555
  description: 'Default runner label or ordered fallback labels for run jobs. See [runners and execution environments](/understand/runners-and-execution-environments).'
@@ -1 +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 .meta({\n description: `Environment variables as string, number, or boolean values. Each map allows up to ${WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES} entries and ${WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES} serialized bytes.`,\n });\n\nconst workflowDocumentStepOutputKeyPattern = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n\nconst workflowDocumentStepOutputTypeSchema = z.enum(workflowDocumentStepOutputTypes).meta({\n description: 'Declared output type. Use `json` when the output has a JSON Schema.',\n});\n\nconst workflowDocumentStepOutputDeclarationSchema = z\n .union([\n workflowDocumentStepOutputTypeSchema.transform((type) => ({type})),\n z.strictObject({\n type: workflowDocumentStepOutputTypeSchema,\n schema: z\n .unknown()\n .optional()\n .meta({\n description:\n 'JSON Schema for a `json` output. It allows up to ' +\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES +\n ' serialized bytes and ' +\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH +\n ' nesting levels.',\n }),\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 .meta({\n description: `Named step outputs. Keys must be CEL identifiers and each step allows up to ${WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES} declarations.`,\n });\n\nconst workflowDocumentTriggerBaseSchema = {\n source: z.string().min(1).meta({\n description:\n 'Integration connection slug or built-in trigger source. See [Trigger sources](/reference/trigger-sources).',\n }),\n with: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'Provider-specific values used to match or configure the trigger. See [expressions](/reference/expressions#context-available).',\n }),\n filter: z.string().min(1).optional().meta({\n description:\n 'CEL condition that filters matching events. It is not supported for `manual` or `cron` triggers. See [trigger filters](/reference/expressions#trigger-filters).',\n }),\n config: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'Source-specific configuration. It is supported only for top-level triggers with a known built-in source. See [cron triggers](/reference/trigger-sources#cron).',\n }),\n} satisfies z.ZodRawShape;\n\nexport const triggerSourceConfigSchemas = {\n cron: z.strictObject({\n schedule: z.string().min(1).optional().meta({\n description: 'Cron expression that schedules the workflow.',\n }),\n timezone: z.string().min(1).optional().meta({\n description: 'IANA time zone used to evaluate `schedule`.',\n }),\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).meta({\n description: 'Provider event name that starts the workflow.',\n }),\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).meta({\n description: 'Events that start listening. Listening triggers cannot use `config`.',\n }),\n until: z.array(workflowDocumentTriggerSchema).min(1).optional().meta({\n description:\n 'Events that resolve listening. Listening jobs need this, `timeout`, or `max_executions`; these triggers cannot use `config`.',\n }),\n timeout: z.string().min(1).optional().meta({\n description:\n 'Maximum duration to listen before resolving. A listening job needs this, `until`, or `max_executions`.',\n }),\n max_executions: z.number().int().positive().optional().meta({\n description:\n 'Maximum number of matching events before resolving. A listening job needs this, `until`, or `timeout`.',\n }),\n batch: z\n .strictObject({\n debounce: z.string().min(1).optional().meta({\n description: 'Quiet period to wait for more matching events before processing a batch.',\n }),\n max_size: z.number().int().positive().optional().meta({\n description: 'Maximum number of matching events in one batch.',\n }),\n max_wait: z.string().min(1).optional().meta({\n description: 'Maximum time to wait before processing a partial batch.',\n }),\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 .meta({\n description:\n 'Optional batching policy. Set at least one of `debounce`, `max_size`, or `max_wait`.',\n }),\n on_resolve: z.enum(['finish', 'cancel']).optional().meta({\n description: 'How the job resolves when its listening condition is met.',\n }),\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().meta({\n description:\n 'CEL expression that must evaluate to true for the step to succeed. See [gate outcomes](/understand/feedback-loops#gate-outcomes).',\n }),\n on_failure: z\n .strictObject({\n restart_from: z.string().min(1).meta({\n description:\n 'Key of an earlier step in the same job to restart from after a failed gate.',\n }),\n feedback: z.string().min(1).optional().meta({\n description: 'Feedback supplied when the gate fails before restarting.',\n }),\n })\n .optional()\n .meta({\n description:\n 'Restart behavior when the success gate fails. See [feedback loops](/understand/feedback-loops).',\n }),\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().meta({\n description: 'Repository contents permission granted to checkout.',\n }),\n })\n .optional()\n .meta({\n description: 'Repository permissions used during checkout.',\n }),\n 'persist-credentials': z.boolean().optional().meta({\n description: 'Whether checkout credentials remain available to later run steps.',\n }),\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().meta({\n description: 'Integration connection slug to use for these tools.',\n }),\n include: workflowDocumentStepIntegrationSelectionSchema.meta({\n description: 'Tool selectors to make available to the agent.',\n }),\n exclude: workflowDocumentStepIntegrationSelectionSchema.optional().meta({\n description: 'Tool selectors to remove from the included tools.',\n }),\n allow_write: z.boolean().optional().meta({\n description: 'Allows write-capable integration tools. Omit or set false for read-only access.',\n }),\n});\n\nexport const workflowDocumentAgentStepFields = [\n 'model',\n 'prompt',\n 'harness',\n 'thinking',\n 'provider',\n 'tools',\n 'integrations',\n] as const;\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\n .string()\n .min(1)\n .optional()\n .meta({description: 'Stable step key for dependencies and outputs.'}),\n if: z\n .string()\n .min(1)\n .optional()\n .meta({\n description:\n 'CEL condition wrapped in exactly one $' +\n '{{ }} interpolation. See [conditionals](/reference/expressions#conditionals-if).',\n }),\n name: z.string().min(1).optional().meta({description: 'Human-readable step name.'}),\n run: z.string().min(1).optional().meta({\n description: 'Shell command for a run step. Do not combine it with agent-only fields.',\n }),\n model: z.string().min(1).optional().meta({\n description:\n 'Model ID for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n prompt: z.string().min(1).optional().meta({\n description: 'Prompt for an agent step. It is required when any agent-only field is set.',\n }),\n harness: harnessSchema.optional().meta({\n description:\n 'Agent harness. When omitted, Shipfox uses the workspace default harness, or `pi` when none is configured.',\n }),\n thinking: agentThinkingSchema.optional().meta({\n description:\n 'Reasoning effort for an agent step. Supported values depend on the resolved harness. When omitted, Shipfox uses the provider default, or `xhigh` when none is configured.',\n }),\n provider: z.string().min(1).optional().meta({\n description:\n 'Model provider ID for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n tools: z.array(z.string().min(1)).min(1).optional().meta({\n description:\n 'Built-in tool IDs for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n integrations: z.array(workflowDocumentStepIntegrationSchema).min(1).optional().meta({\n description:\n 'Integration tools available to an agent step. It requires `prompt` and is not valid on a run step. See [integration tools](/how-to/author-workflows/use-integration-tools).',\n }),\n agent: z.unknown().optional().meta({\n description: 'Reserved keyword. It is rejected; use `prompt` to define an agent step.',\n }),\n gate: workflowDocumentStepGateSchema.optional().meta({\n description: 'Success gate and optional restart behavior after the step runs.',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description: 'Environment variables for a run step. They are not valid on an agent step.',\n }),\n outputs: workflowDocumentStepOutputsSchema.optional().meta({\n description: 'Named output declarations produced by this step.',\n }),\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 workflowDocumentAgentStepFields) {\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 = workflowDocumentAgentStepFields.some((field) => step[field] !== 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().meta({\n description: 'Job key or keys that must complete before this job starts.',\n }),\n if: z\n .string()\n .min(1)\n .optional()\n .meta({\n description:\n 'CEL condition wrapped in exactly one $' +\n '{{ }} interpolation. See [conditionals](/reference/expressions#conditionals-if).',\n }),\n runner: stringOrStringArraySchema.optional().meta({\n description:\n 'Runner label or ordered fallback labels for this job. See [runners and execution environments](/understand/runners-and-execution-environments).',\n }),\n success: z.string().min(1).optional().meta({\n description:\n 'CEL expression that determines whether the job succeeds. See [job success](/reference/expressions#job-success-success).',\n }),\n outputs: nonEmptyRecordSchema(z.string().min(1)).optional().meta({\n description: 'Named job outputs mapped from step values.',\n }),\n execution_timeout: z.string().min(1).optional().meta({\n description: 'Maximum duration for one job execution.',\n }),\n checkout: workflowDocumentCheckoutSchema.optional().meta({\n description: 'Checkout settings for repository content and credentials.',\n }),\n listening: workflowDocumentListeningSchema.optional().meta({\n description:\n 'Event-listening configuration for this job. See [listening jobs](/understand/listening-jobs).',\n }),\n name: z.string().min(1).optional().meta({description: 'Human-readable job name.'}),\n env: workflowDocumentEnvSchema.optional().meta({\n description:\n 'Environment variables for run steps in this job. They do not apply to agent steps. See [secrets and variables](/reference/secrets-variables).',\n }),\n steps: z.array(workflowDocumentStepSchema).min(1).meta({\n description: 'Ordered run or agent steps. Each job needs at least one step.',\n }),\n});\n\nexport const workflowDocumentSchema = z.strictObject({\n name: z.string().min(1).meta({description: 'Human-readable workflow name.'}),\n runner: stringOrStringArraySchema.optional().meta({\n description:\n 'Default runner label or ordered fallback labels for run jobs. See [runners and execution environments](/understand/runners-and-execution-environments).',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description:\n 'Workflow-level environment variables for run steps. They do not apply to agent steps. See [secrets and variables](/reference/secrets-variables).',\n }),\n triggers: nonEmptyRecordSchema(workflowDocumentTriggerSchema).optional().meta({\n description:\n 'Named events that start workflow runs. A workflow can have at most one `manual` trigger.',\n }),\n jobs: nonEmptyRecordSchema(workflowDocumentJobSchema).meta({\n description: 'Named jobs that make up the workflow. At least one job is required.',\n }),\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","meta","description","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","workflowDocumentAgentStepFields","workflowDocumentStepSchema","if","name","run","model","prompt","harness","thinking","provider","tools","integrations","agent","gate","step","isAgent","some","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,MAAM,GAAG,GAAG;QAACC,SAAS;IAA6B;AAE7F,8EAA8E;AAC9E,uCAAuC;AACvC,MAAMC,gBAAgBjB,EAAEK,MAAM,GAAGa,KAAK,CAAC;AACvC,M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Q,GAAGX,IAAI,CAAC;QAC7CC,aACE;IACJ;IACA6F,UAAUjI,qBAAqBmE,+BAA+BrB,QAAQ,GAAGX,IAAI,CAAC;QAC5EC,aACE;IACJ;IACA8F,MAAMlI,qBAAqB0H,2BAA2BvF,IAAI,CAAC;QACzDC,aAAa;IACf;AACF,GAAG;AAcH,SAASgB,aAAahD,KAAc;IAClC,IAAIA,UAAU,QAAQ,OAAOA,UAAU,UAAU,OAAO;IACxD,IAAI+H,MAAMC,OAAO,CAAChI,QAAQ;QACxB,IAAIA,MAAMG,MAAM,KAAK,GAAG,OAAO;QAC/B,OAAO,IAAI8H,KAAKC,GAAG,IAAIlI,MAAMmI,GAAG,CAACnF;IACnC;IAEA,MAAMzB,UAAUtB,OAAOmI,MAAM,CAACpI;IAC9B,IAAIuB,QAAQpB,MAAM,KAAK,GAAG,OAAO;IACjC,OAAO,IAAI8H,KAAKC,GAAG,IAAI3G,QAAQ4G,GAAG,CAACnF;AACrC;AAEA,SAASF,qBAAqB9C,KAAc;IAC1C,OACE,OAAOA,UAAU,aAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAAC+H,MAAMC,OAAO,CAAChI;AAEnE"}
1
+ {"version":3,"sources":["../../src/document/workflow-document.ts"],"sourcesContent":["import {z} from 'zod';\nimport {checkoutTargetValidationIssues} from './checkout-target-validation.js';\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\nexport const WORKFLOW_LITERAL_NAME_PATTERN = /^(?:[^$]|\\$\\$\\{\\{|\\$(?!\\{\\{))*$/;\n// The inverse of a literal name: a literal prefix followed by an unescaped\n// `${{`. An enum field that also accepts a template matches one or the other.\nexport const WORKFLOW_INTERPOLATED_VALUE_PATTERN = /^(?:[^$]|\\$\\$\\{\\{|\\$(?!\\{\\{))*\\$\\{\\{/;\n\n// Reasoning effort is an enum so editors can complete it, and a template so a\n// workflow can choose the effort from run context. The resolved value is\n// checked against the harness levels when the step is dispatched.\nexport const agentThinkingFieldSchema = z\n .union([\n agentThinkingSchema,\n z.string().regex(WORKFLOW_INTERPOLATED_VALUE_PATTERN, {\n message:\n 'Agent thinking must be a supported level or a $' +\n '{{ }} interpolation that resolves to one.',\n }),\n ])\n .meta({\n description:\n 'Reasoning effort for an agent step. Supported values depend on the resolved harness. Accepts a $' +\n '{{ }} interpolation. When omitted, Shipfox uses the provider default, or `xhigh` when none is configured.',\n });\n\nconst workflowNameSchema = literalNameSchema(\n 'Workflow name must be literal. Move runtime interpolation to run_name.',\n).meta({description: 'Static literal human-readable workflow name.'});\nconst jobNameSchema = literalNameSchema(\n 'Job name must be literal. Move runtime interpolation to execution_name.',\n).meta({description: 'Static literal human-readable job name.'});\n\nfunction literalNameSchema(message: string) {\n return z.string().min(1).regex(WORKFLOW_LITERAL_NAME_PATTERN, {message});\n}\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_JOB_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;\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 .meta({\n description: `Environment variables as string, number, or boolean values. Each map allows up to ${WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES} entries and ${WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES} serialized bytes.`,\n });\n\nconst workflowDocumentStepOutputKeyPattern = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n\nconst workflowDocumentStepOutputTypeSchema = z.enum(workflowDocumentStepOutputTypes).meta({\n description: 'Declared output type. Use `json` when the output has a JSON Schema.',\n});\n\nconst workflowDocumentStepOutputDeclarationSchema = z\n .union([\n workflowDocumentStepOutputTypeSchema.transform((type) => ({type})),\n z.strictObject({\n type: workflowDocumentStepOutputTypeSchema,\n schema: z\n .unknown()\n .optional()\n .meta({\n description:\n 'JSON Schema for a `json` output. It allows up to ' +\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES +\n ' serialized bytes and ' +\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH +\n ' nesting levels.',\n }),\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 .meta({\n description: `Named step outputs. Keys must be CEL identifiers and each step allows up to ${WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES} declarations.`,\n });\n\nconst workflowDocumentTriggerBaseSchema = {\n source: z.string().min(1).meta({\n description:\n 'Integration connection slug or built-in trigger source. See [Trigger sources](/reference/trigger-sources).',\n }),\n with: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'Provider-specific values used to match or configure the trigger. See [Trigger sources](/reference/trigger-sources).',\n }),\n filter: z.string().min(1).optional().meta({\n description:\n 'CEL condition that filters matching events. It is not supported for `manual` or `cron` triggers. See [Expressions](/reference/expressions) and [Contexts](/reference/contexts#context-availability).',\n }),\n config: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'Source-specific configuration. It is supported only for top-level triggers with a known built-in source. See [cron triggers](/reference/trigger-sources#cron).',\n }),\n} satisfies z.ZodRawShape;\n\nexport const triggerSourceConfigSchemas = {\n cron: z.strictObject({\n schedule: z.string().min(1).optional().meta({\n description: 'Cron expression that schedules the workflow.',\n }),\n timezone: z.string().min(1).optional().meta({\n description: 'IANA time zone used to evaluate `schedule`.',\n }),\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).meta({\n description: 'Provider event name that starts the workflow.',\n }),\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).meta({\n description: 'Events that start listening. Listening triggers cannot use `config`.',\n }),\n until: z.array(workflowDocumentTriggerSchema).min(1).optional().meta({\n description:\n 'Events that resolve listening. Listening jobs need this, `timeout`, or `max_executions`; these triggers cannot use `config`.',\n }),\n timeout: z.string().min(1).optional().meta({\n description:\n 'Maximum duration to listen before resolving. A listening job needs this, `until`, or `max_executions`.',\n }),\n max_executions: z.number().int().positive().optional().meta({\n description:\n 'Maximum number of matching events before resolving. A listening job needs this, `until`, or `timeout`.',\n }),\n batch: z\n .strictObject({\n debounce: z.string().min(1).optional().meta({\n description: 'Quiet period to wait for more matching events before processing a batch.',\n }),\n max_size: z.number().int().positive().optional().meta({\n description: 'Maximum number of matching events in one batch.',\n }),\n max_wait: z.string().min(1).optional().meta({\n description: 'Maximum time to wait before processing a partial batch.',\n }),\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 .meta({\n description:\n 'Optional batching policy. Set at least one of `debounce`, `max_size`, or `max_wait`.',\n }),\n on_resolve: z.enum(['finish', 'cancel']).optional().meta({\n description: 'How the job resolves when its listening condition is met.',\n }),\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().meta({\n description:\n 'CEL expression that must evaluate to true for the step to succeed. See [gate outcomes](/understand/feedback-loops#gate-outcomes).',\n }),\n on_failure: z\n .strictObject({\n restart_from: z.string().min(1).meta({\n description:\n 'Key of an earlier step in the same job to restart from after a failed gate.',\n }),\n feedback: z.string().min(1).optional().meta({\n description: 'Feedback supplied when the gate fails before restarting.',\n }),\n })\n .optional()\n .meta({\n description:\n 'Restart behavior when the success gate fails. See [feedback loops](/understand/feedback-loops).',\n }),\n })\n .refine((value) => value.success !== undefined || value.on_failure !== undefined, {\n message: 'Expected success or on_failure',\n });\n\nconst workflowDocumentCheckoutPermissionsSchema = z\n .strictObject({\n contents: z.enum(['read', 'write']).optional().meta({\n description: 'Repository contents permission granted to checkout.',\n }),\n })\n .optional()\n .meta({\n description: 'Repository permissions used during checkout.',\n });\n\nconst workflowDocumentPersistCredentialsSchema = z.boolean().optional().meta({\n description: 'Whether checkout credentials remain available to later run steps.',\n});\n\nexport const workflowDocumentCheckoutSchema = z\n .strictObject({\n project: z.string().min(1).optional().meta({\n description: 'Shipfox project id to check out. Exclusive with connection and repository.',\n }),\n connection: z.string().min(1).optional().meta({\n description: 'Integration connection slug to use for checkout.',\n }),\n repository: z.string().min(1).optional().meta({\n description: 'Repository to check out, as owner/name or a bare name.',\n }),\n ref: z.string().min(1).optional().meta({\n description: 'Repository ref to check out.',\n }),\n 'fetch-depth': z.number().int().min(0).optional().meta({\n description: 'Number of commits to fetch. Use 0 for full history.',\n }),\n path: z.string().min(1).optional().meta({\n description: 'Relative path under the job workspace where this repository is checked out.',\n }),\n permissions: workflowDocumentCheckoutPermissionsSchema,\n 'persist-credentials': workflowDocumentPersistCredentialsSchema,\n force: z.boolean().optional().meta({\n description: 'Whether checkout may replace an occupied destination.',\n }),\n })\n .superRefine((checkout, ctx) => {\n for (const validationIssue of checkoutTargetValidationIssues(checkout)) {\n const message =\n validationIssue.kind === 'project-with-connection'\n ? '\"connection\" cannot be combined with \"project\".'\n : validationIssue.kind === 'project-with-repository'\n ? '\"repository\" cannot be combined with \"project\".'\n : '\"connection\" requires \"repository\".';\n ctx.addIssue({\n code: 'custom',\n path: [validationIssue.path],\n message,\n });\n }\n });\n\nconst workflowDocumentJobCheckoutSchema = z\n .union([\n z.strictObject({\n permissions: workflowDocumentCheckoutPermissionsSchema,\n 'persist-credentials': workflowDocumentPersistCredentialsSchema,\n }),\n z.literal(false),\n ])\n .meta({\n description:\n 'Checkout settings for repository content and credentials, or false to skip checkout.',\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().meta({\n description: 'Integration connection slug to use for these tools.',\n }),\n include: workflowDocumentStepIntegrationSelectionSchema.meta({\n description: 'Tool selectors to make available to the agent.',\n }),\n exclude: workflowDocumentStepIntegrationSelectionSchema.optional().meta({\n description: 'Tool selectors to remove from the included tools.',\n }),\n allow_write: z.boolean().optional().meta({\n description: 'Allows write-capable integration tools. Omit or set false for read-only access.',\n }),\n});\n\nexport const workflowDocumentAgentStepFields = [\n 'model',\n 'prompt',\n 'harness',\n 'thinking',\n 'provider',\n 'tools',\n 'integrations',\n] as const;\n\n// A step is a run step (`run`), an inline agent step (`prompt`), or a checkout\n// step (`checkout`), never two kinds at once. They share one strict object so\n// an unknown key is still rejected; the `superRefine` discriminates by which\n// payload keys are present and emits one targeted issue per failure mode (a\n// plain union would surface every branch's errors at once). The `agent`\n// keyword is declared only so the reserved-keyword case produces a clear\n// message instead of a generic \"unrecognized key\".\nexport const workflowDocumentStepSchema = z\n .strictObject({\n key: z\n .string()\n .min(1)\n .optional()\n .meta({description: 'Stable step key for dependencies and outputs.'}),\n if: z\n .string()\n .min(1)\n .optional()\n .meta({\n description:\n 'CEL condition wrapped in exactly one $' +\n '{{ }} interpolation. See [conditionals](/reference/expressions#syntax).',\n }),\n name: z.string().min(1).optional().meta({description: 'Human-readable step name.'}),\n working_directory: z.string().min(1).optional().meta({\n description: 'Working directory for the step, relative to the job workspace.',\n }),\n run: z.string().min(1).optional().meta({\n description: 'Shell command for a run step. Do not combine it with agent-only fields.',\n }),\n checkout: workflowDocumentCheckoutSchema.optional().meta({\n description: 'Repository checkout settings for this step.',\n }),\n model: z.string().min(1).optional().meta({\n description:\n 'Model ID for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n prompt: z.string().min(1).optional().meta({\n description: 'Prompt for an agent step. It is required when any agent-only field is set.',\n }),\n harness: harnessSchema.optional().meta({\n description:\n 'Agent harness. When omitted, Shipfox uses the workspace default harness, or `pi` when none is configured.',\n }),\n thinking: agentThinkingFieldSchema.optional(),\n provider: z.string().min(1).optional().meta({\n description:\n 'Model provider ID for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n tools: z.array(z.string().min(1)).min(1).optional().meta({\n description:\n 'Built-in tool IDs for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n integrations: z.array(workflowDocumentStepIntegrationSchema).min(1).optional().meta({\n description:\n 'Integration tools available to an agent step. It requires `prompt` and is not valid on a run step. See [integration tools](/how-to/author-workflows/use-integration-tools).',\n }),\n agent: z.unknown().optional().meta({\n description: 'Reserved keyword. It is rejected; use `prompt` to define an agent step.',\n }),\n gate: workflowDocumentStepGateSchema.optional().meta({\n description: 'Success gate and optional restart behavior after the step runs.',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description: 'Environment variables for a run step. They are not valid on an agent step.',\n }),\n outputs: workflowDocumentStepOutputsSchema.optional().meta({\n description: 'Named output declarations produced by this step.',\n }),\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.checkout !== undefined) {\n if (step.run !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['run'],\n message: '\"run\" is not valid on a checkout step.',\n });\n }\n for (const key of workflowDocumentAgentStepFields) {\n if (step[key] !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [key],\n message: `\"${key}\" is not valid on a checkout step.`,\n });\n }\n }\n if (step.env !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['env'],\n message: '\"env\" is not valid on a checkout step.',\n });\n }\n return;\n }\n\n if (step.run !== undefined) {\n for (const key of workflowDocumentAgentStepFields) {\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 = workflowDocumentAgentStepFields.some((field) => step[field] !== undefined);\n\n if (!isAgent) {\n ctx.addIssue({\n code: 'custom',\n message: 'A step must define either \"run\", an agent \"prompt\", or \"checkout\".',\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\nconst workflowDocumentJobOutputsSchema = nonEmptyRecordSchema(z.string().min(1)).superRefine(\n (outputs, ctx) => {\n const entries = Object.keys(outputs).length;\n if (entries > WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES) {\n ctx.addIssue({\n code: 'custom',\n message: `Job outputs cannot define more than ${WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES} entries.`,\n });\n }\n },\n);\n\nexport const workflowDocumentJobSchema = z.strictObject({\n needs: stringOrStringArraySchema.optional().meta({\n description: 'Job key or keys that must complete before this job starts.',\n }),\n if: z\n .string()\n .min(1)\n .optional()\n .meta({\n description:\n 'CEL condition wrapped in exactly one $' +\n '{{ }} interpolation. See [conditionals](/reference/expressions#syntax).',\n }),\n runner: stringOrStringArraySchema.optional().meta({\n description:\n 'Runner label or ordered fallback labels for this job. See [runners and execution environments](/understand/runners-and-execution-environments).',\n }),\n success: z.string().min(1).optional().meta({\n description:\n 'CEL expression that determines whether the job succeeds. See [Expressions](/reference/expressions#functions-and-macros) and [Contexts](/reference/contexts#context-availability).',\n }),\n outputs: workflowDocumentJobOutputsSchema.optional().meta({\n description: `Named job outputs mapped from step values. A mapping with exactly one expression preserves an inferred non-string source type. Each job allows up to ${WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES} declarations.`,\n }),\n execution_timeout: z.string().min(1).optional().meta({\n description: 'Maximum duration for one job execution.',\n }),\n checkout: workflowDocumentJobCheckoutSchema.optional(),\n listening: workflowDocumentListeningSchema.optional().meta({\n description:\n 'Event-listening configuration for this job. See [listening jobs](/understand/listening-jobs).',\n }),\n name: jobNameSchema.optional(),\n execution_name: z.string().min(1).optional().meta({\n description: 'Dynamic name for each job execution. Supports workflow expressions.',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description:\n 'Environment variables for run steps in this job. They do not apply to agent steps. See [secrets and variables](/reference/secrets-variables).',\n }),\n steps: z.array(workflowDocumentStepSchema).min(1).meta({\n description: 'Ordered run or agent steps. Each job needs at least one step.',\n }),\n});\n\nexport const workflowDocumentSchema = z.strictObject({\n name: workflowNameSchema,\n run_name: z.string().min(1).optional().meta({\n description: 'Dynamic name for each workflow run. Supports workflow expressions.',\n }),\n runner: stringOrStringArraySchema.optional().meta({\n description:\n 'Default runner label or ordered fallback labels for run jobs. See [runners and execution environments](/understand/runners-and-execution-environments).',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description:\n 'Workflow-level environment variables for run steps. They do not apply to agent steps. See [secrets and variables](/reference/secrets-variables).',\n }),\n triggers: nonEmptyRecordSchema(workflowDocumentTriggerSchema).optional().meta({\n description:\n 'Named events that start workflow runs. A workflow can have at most one `manual` trigger.',\n }),\n jobs: nonEmptyRecordSchema(workflowDocumentJobSchema).meta({\n description: 'Named jobs that make up the workflow. At least one job is required.',\n }),\n});\n\nexport type WorkflowDocument = z.infer<typeof workflowDocumentSchema>;\nexport type WorkflowDocumentCheckout = z.infer<typeof workflowDocumentCheckoutSchema>;\nexport type WorkflowDocumentJobCheckout = z.infer<typeof workflowDocumentJobCheckoutSchema>;\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","checkoutTargetValidationIssues","agentThinkingSchema","harnessSchema","stringOrStringArraySchema","union","string","min","array","nonEmptyRecordSchema","valueSchema","record","refine","value","Object","keys","length","message","WORKFLOW_LITERAL_NAME_PATTERN","WORKFLOW_INTERPOLATED_VALUE_PATTERN","agentThinkingFieldSchema","regex","meta","description","workflowNameSchema","literalNameSchema","jobNameSchema","envNameSchema","envStringValueSchema","includes","WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES","WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES","workflowDocumentStepOutputTypes","WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES","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","workflowDocumentCheckoutPermissionsSchema","contents","workflowDocumentPersistCredentialsSchema","workflowDocumentCheckoutSchema","project","connection","repository","ref","permissions","force","checkout","validationIssue","kind","workflowDocumentJobCheckoutSchema","literal","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepIntegrationSchema","include","exclude","allow_write","workflowDocumentAgentStepFields","workflowDocumentStepSchema","if","name","working_directory","run","model","prompt","harness","thinking","provider","tools","integrations","agent","gate","step","isAgent","some","workflowDocumentJobOutputsSchema","workflowDocumentJobSchema","needs","runner","execution_timeout","execution_name","steps","workflowDocumentSchema","run_name","triggers","jobs","Array","isArray","Math","max","map","values"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,8BAA8B,QAAO,kCAAkC;AAC/E,SAAQC,mBAAmB,EAAEC,aAAa,QAAO,kBAAkB;AAEnE,MAAMC,4BAA4BJ,EAAEK,KAAK,CAAC;IAACL,EAAEM,MAAM,GAAGC,GAAG,CAAC;IAAIP,EAAEQ,KAAK,CAACR,EAAEM,MAAM,GAAGC,GAAG,CAAC,IAAIA,GAAG,CAAC;CAAG;AAChG,MAAME,uBAAuB,CAAgCC,cAC3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UAAU/B,OAAOwJ,MAAM,CAACzJ;IAC9B,IAAIgC,QAAQ7B,MAAM,KAAK,GAAG,OAAO;IACjC,OAAO,IAAImJ,KAAKC,GAAG,IAAIvH,QAAQwH,GAAG,CAACjG;AACrC;AAEA,SAASF,qBAAqBrD,KAAc;IAC1C,OACE,OAAOA,UAAU,aAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACoJ,MAAMC,OAAO,CAACrJ;AAEnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-json-schema.d.ts","sourceRoot":"","sources":["../../src/document/workflow-json-schema.ts"],"names":[],"mappings":"AAIA,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,MAAM,WAAW,8BAA8B;IAC7C,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,uBAAuB,CAAC,EACtC,EAAuD,GACxD,GAAE,8BAAmC,GAAG,UAAU,CAwClD"}
1
+ {"version":3,"file":"workflow-json-schema.d.ts","sourceRoot":"","sources":["../../src/document/workflow-json-schema.ts"],"names":[],"mappings":"AAQA,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,MAAM,WAAW,8BAA8B;IAC7C,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,uBAAuB,CAAC,EACtC,EAAuD,GACxD,GAAE,8BAAmC,GAAG,UAAU,CAkDlD"}