@shipfox/workflow-document 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/document/step-enums.d.ts +2 -0
- package/dist/document/step-enums.d.ts.map +1 -1
- package/dist/document/step-enums.js +2 -1
- package/dist/document/step-enums.js.map +1 -1
- package/dist/document/workflow-document.d.ts.map +1 -1
- package/dist/document/workflow-document.js +9 -2
- package/dist/document/workflow-document.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -158,14 +158,15 @@ parseWorkflowDocument({
|
|
|
158
158
|
`model`, `harness`, `thinking`, `provider`, `tools`, and `integrations` are
|
|
159
159
|
valid only on an agent step; using them on a run step is rejected. `thinking`
|
|
160
160
|
is validated against a fixed set (`off`, `minimal`, `low`, `medium`, `high`,
|
|
161
|
-
`xhigh`). Provider, model, tool, integration connection, and integration
|
|
161
|
+
`xhigh`, `max`). Provider, model, tool, integration connection, and integration
|
|
162
162
|
catalog checks belong to the model layer, not this parser. The `agent` key is
|
|
163
163
|
reserved for a future step kind and is rejected today. The `tool`,
|
|
164
164
|
`connection`, and `with` fields and the expression `outputs` mapping form are
|
|
165
165
|
reserved for the upcoming tool step kind; any step carrying one of these
|
|
166
166
|
fields is rejected with "Tool steps are not available yet." Their shape still parses:
|
|
167
167
|
`with` is a JSON tree of tool inputs limited to 32768 serialized bytes and 16
|
|
168
|
-
nesting levels, and its `method` key is rejected.
|
|
168
|
+
nesting levels, and its `method` key is rejected. `tool` and `connection` must
|
|
169
|
+
be literal names; interpolated values such as `${{ ... }}` are rejected at parse.
|
|
169
170
|
- `env` can be declared on the workflow, a job, or a run step. Values may be
|
|
170
171
|
strings, numbers, or booleans; the model layer stringifies numbers and
|
|
171
172
|
booleans before a run is saved. Values are literal. Expression interpolation
|
|
@@ -8,6 +8,7 @@ export declare const DEFAULT_HARNESS: "pi";
|
|
|
8
8
|
export declare const piAgentThinkingSchema: z.ZodEnum<{
|
|
9
9
|
high: "high";
|
|
10
10
|
low: "low";
|
|
11
|
+
max: "max";
|
|
11
12
|
medium: "medium";
|
|
12
13
|
minimal: "minimal";
|
|
13
14
|
off: "off";
|
|
@@ -35,6 +36,7 @@ export declare const agentThinkingByHarness: {
|
|
|
35
36
|
readonly pi: z.ZodEnum<{
|
|
36
37
|
high: "high";
|
|
37
38
|
low: "low";
|
|
39
|
+
max: "max";
|
|
38
40
|
medium: "medium";
|
|
39
41
|
minimal: "minimal";
|
|
40
42
|
off: "off";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-enums.d.ts","sourceRoot":"","sources":["../../src/document/step-enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,aAAa;;;EAGxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,eAAO,MAAM,eAAe,MAAkC,CAAC;AAE/D,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"step-enums.d.ts","sourceRoot":"","sources":["../../src/document/step-enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,aAAa;;;EAGxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,eAAO,MAAM,eAAe,MAAkC,CAAC;AAE/D,eAAO,MAAM,qBAAqB;;;;;;;;EAQhC,CAAC;AACH,eAAO,MAAM,yBAAyB;;;;;;EAAoD,CAAC;AAC3F,eAAO,MAAM,mBAAmB;;;;;;;;EAK5B,CAAC;AAEL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB,SAA2C,CAAC;AAE/E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;CAMlC,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,aAAa,EAAE,CAEnF;AAGD,eAAO,MAAM,sBAAsB,EAAG,WAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/document/step-enums.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const harnessSchema = z.enum(['pi', 'claude']).meta({\n description:\n 'Agent harness. When omitted, Shipfox uses the workspace default harness, or `pi` when none is configured.',\n});\nexport type Harness = z.infer<typeof harnessSchema>;\nexport const DEFAULT_HARNESS = 'pi' as const satisfies Harness;\n\nexport const piAgentThinkingSchema = z.enum(['off'
|
|
1
|
+
{"version":3,"sources":["../../src/document/step-enums.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const harnessSchema = z.enum(['pi', 'claude']).meta({\n description:\n 'Agent harness. When omitted, Shipfox uses the workspace default harness, or `pi` when none is configured.',\n});\nexport type Harness = z.infer<typeof harnessSchema>;\nexport const DEFAULT_HARNESS = 'pi' as const satisfies Harness;\n\nexport const piAgentThinkingSchema = z.enum([\n 'off',\n 'minimal',\n 'low',\n 'medium',\n 'high',\n 'xhigh',\n 'max',\n]);\nexport const claudeAgentThinkingSchema = z.enum(['low', 'medium', 'high', 'xhigh', 'max']);\nexport const agentThinkingSchema = z\n .enum(['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'])\n .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\nexport type AgentThinking = z.infer<typeof agentThinkingSchema>;\n\nexport const DEFAULT_AGENT_THINKING = 'xhigh' as const satisfies AgentThinking;\n\nexport const agentThinkingByHarness = {\n pi: piAgentThinkingSchema,\n claude: claudeAgentThinkingSchema,\n} as const satisfies Record<\n Harness,\n typeof piAgentThinkingSchema | typeof claudeAgentThinkingSchema\n>;\n\nexport function thinkingLevelsForHarness(harness: Harness): readonly AgentThinking[] {\n return agentThinkingByHarness[harness].options;\n}\n\n// Used by later resolution layers when no workspace or instance provider is configured.\nexport const DEFAULT_MODEL_PROVIDER = 'anthropic' as const;\n"],"names":["z","harnessSchema","enum","meta","description","DEFAULT_HARNESS","piAgentThinkingSchema","claudeAgentThinkingSchema","agentThinkingSchema","DEFAULT_AGENT_THINKING","agentThinkingByHarness","pi","claude","thinkingLevelsForHarness","harness","options","DEFAULT_MODEL_PROVIDER"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,gBAAgBD,EAAEE,IAAI,CAAC;IAAC;IAAM;CAAS,EAAEC,IAAI,CAAC;IACzDC,aACE;AACJ,GAAG;AAEH,OAAO,MAAMC,kBAAkB,KAAgC;AAE/D,OAAO,MAAMC,wBAAwBN,EAAEE,IAAI,CAAC;IAC1C;IACA;IACA;IACA;IACA;IACA;IACA;CACD,EAAE;AACH,OAAO,MAAMK,4BAA4BP,EAAEE,IAAI,CAAC;IAAC;IAAO;IAAU;IAAQ;IAAS;CAAM,EAAE;AAC3F,OAAO,MAAMM,sBAAsBR,EAChCE,IAAI,CAAC;IAAC;IAAO;IAAW;IAAO;IAAU;IAAQ;IAAS;CAAM,EAChEC,IAAI,CAAC;IACJC,aACE;AACJ,GAAG;AAIL,OAAO,MAAMK,yBAAyB,QAAyC;AAE/E,OAAO,MAAMC,yBAAyB;IACpCC,IAAIL;IACJM,QAAQL;AACV,EAGE;AAEF,OAAO,SAASM,yBAAyBC,OAAgB;IACvD,OAAOJ,sBAAsB,CAACI,QAAQ,CAACC,OAAO;AAChD;AAEA,wFAAwF;AACxF,OAAO,MAAMC,yBAAyB,YAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-document.d.ts","sourceRoot":"","sources":["../../src/document/workflow-document.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAC3F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACzF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AACpG,MAAM,MAAM,8BAA8B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AACpG,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC1F,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -739,10 +739,10 @@ const workflowDocumentStepBaseSchema = z.strictObject({
|
|
|
739
739
|
agent: z.unknown().optional().meta({
|
|
740
740
|
description: 'Reserved keyword. It is rejected; use `prompt` to define an agent step.'
|
|
741
741
|
}),
|
|
742
|
-
tool:
|
|
742
|
+
tool: literalNameSchema('Tool id must be literal. Interpolation is rejected.').optional().meta({
|
|
743
743
|
description: 'Literal integration tool id for a tool step. It is rejected; tool steps are not available yet.'
|
|
744
744
|
}),
|
|
745
|
-
connection:
|
|
745
|
+
connection: literalNameSchema('Connection slug must be literal. Interpolation is rejected.').optional().meta({
|
|
746
746
|
description: 'Literal integration connection slug for a tool step. It is rejected; tool steps are not available yet.'
|
|
747
747
|
}),
|
|
748
748
|
with: workflowDocumentToolStepWithSchema.optional(),
|
|
@@ -768,6 +768,13 @@ export const workflowDocumentStepSchema = workflowDocumentStepBaseSchema.superRe
|
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
770
|
const reservedToolField = step.tool !== undefined ? 'tool' : step.connection !== undefined ? 'connection' : undefined;
|
|
771
|
+
const reservedToolValue = reservedToolField === 'tool' ? step.tool : reservedToolField === 'connection' ? step.connection : undefined;
|
|
772
|
+
if (reservedToolValue !== undefined && !WORKFLOW_LITERAL_NAME_PATTERN.test(reservedToolValue)) {
|
|
773
|
+
// The field-level literal-name check already rejected the interpolated
|
|
774
|
+
// value; skip the reserved-field issue so one defect does not report
|
|
775
|
+
// twice at the same path.
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
771
778
|
if (reservedToolField !== undefined || step.with !== undefined) {
|
|
772
779
|
ctx.addIssue({
|
|
773
780
|
code: 'custom',
|
|
@@ -1 +1 @@
|
|
|
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 = /^(?:[^$]|\\$\\$\\{\\{|\\$(?!\\{\\{))*\\$\\{\\{/;\nexport const WORKFLOW_SESSION_KEY_MAX_LENGTH = 128;\nexport const WORKFLOW_SESSION_KEY_PATTERN_SOURCE = '^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$';\nexport const WORKFLOW_SESSION_KEY_PATTERN = new RegExp(WORKFLOW_SESSION_KEY_PATTERN_SOURCE);\nconst workflowSessionKeyLiteralPartPattern = /^[A-Za-z0-9._-]*$/;\nconst workflowSessionKeyLiteralPartStartPattern = /^[A-Za-z0-9]/;\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;\nexport const WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES = 32 * 1024;\nexport const WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH = 16;\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\n// Tool inputs are a JSON tree: scalars, nested mappings, and sequences. String\n// leaves accept `${{ }}` interpolation; the expression layer validates them.\ntype WorkflowDocumentJsonValue =\n | string\n | number\n | boolean\n | null\n | WorkflowDocumentJsonValue[]\n | {[key: string]: WorkflowDocumentJsonValue};\n\nexport const workflowDocumentToolStepWithSchema = z\n // Validate nested values in an iterative refinement. A recursive Zod schema\n // would traverse hostile depth before the tool-input limits can reject it.\n .record(z.string().min(1), z.unknown())\n .superRefine((withValue, ctx) => {\n // The server injects `method` for `family.method` tools, so the author can\n // never set it.\n if ('method' in withValue) {\n ctx.addIssue({\n code: 'custom',\n path: ['method'],\n message:\n '`method` is not a valid tool input; the server injects it for `family.method` tools.',\n });\n }\n\n validateWorkflowDocumentToolWith(withValue, ctx);\n })\n .transform((withValue) => withValue as Record<string, WorkflowDocumentJsonValue>)\n .meta({\n description:\n 'Tool inputs as a JSON tree. The map allows up to ' +\n WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES +\n ' serialized bytes and ' +\n WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH +\n ' nesting levels. Tool steps are not available yet.',\n });\n\ntype WorkflowDocumentToolWithValidationTask =\n | {kind: 'value'; value: unknown; depth: number; path: (string | number)[]}\n | {kind: 'end'; value: object; byteLength: number}\n | {kind: 'bytes'; byteLength: number};\n\nfunction validateWorkflowDocumentToolWith(\n withValue: Readonly<Record<string, unknown>>,\n ctx: z.RefinementCtx,\n) {\n const activeObjects = new Set<object>();\n const tasks: WorkflowDocumentToolWithValidationTask[] = [\n {kind: 'value', value: withValue, depth: 1, path: []},\n ];\n let serializedBytes = 0;\n\n const addSerializedBytes = (byteLength: number): boolean => {\n serializedBytes += byteLength;\n if (serializedBytes <= WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES) return true;\n\n ctx.addIssue({\n code: 'custom',\n message: `Tool \\`with\\` cannot serialize to more than ${WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES} bytes.`,\n });\n return false;\n };\n\n while (tasks.length > 0) {\n const task = tasks.pop();\n if (task === undefined) continue;\n\n if (task.kind === 'bytes') {\n if (!addSerializedBytes(task.byteLength)) return;\n continue;\n }\n\n if (task.kind === 'end') {\n activeObjects.delete(task.value);\n if (!addSerializedBytes(task.byteLength)) return;\n continue;\n }\n\n const {value, depth, path} = task;\n if (value === null) {\n if (!addSerializedBytes(4)) return;\n continue;\n }\n if (typeof value === 'string' || typeof value === 'boolean') {\n if (!addSerializedBytes(jsonPrimitiveByteLength(value))) return;\n continue;\n }\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be JSON-compatible.',\n });\n return;\n }\n if (!addSerializedBytes(jsonPrimitiveByteLength(value))) return;\n continue;\n }\n if (typeof value !== 'object' || value === null) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be JSON-compatible.',\n });\n return;\n }\n\n if (depth > WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH) {\n ctx.addIssue({\n code: 'custom',\n message: `Tool \\`with\\` cannot be nested deeper than ${WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH} levels.`,\n });\n return;\n }\n if (activeObjects.has(value)) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be a JSON tree.',\n });\n return;\n }\n\n activeObjects.add(value);\n if (Array.isArray(value)) {\n if (!addSerializedBytes(1)) return;\n tasks.push({kind: 'end', value, byteLength: 1});\n for (let index = value.length - 1; index >= 0; index -= 1) {\n tasks.push({kind: 'value', value: value[index], depth: depth + 1, path: [...path, index]});\n if (index > 0) tasks.push({kind: 'bytes', byteLength: 1});\n }\n continue;\n }\n\n if (!isJsonRecord(value)) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be a JSON tree.',\n });\n return;\n }\n\n if (!addSerializedBytes(1)) return;\n tasks.push({kind: 'end', value, byteLength: 1});\n const entries = Object.entries(value);\n for (let index = entries.length - 1; index >= 0; index -= 1) {\n const entry = entries[index];\n if (entry === undefined) continue;\n const [key, child] = entry;\n tasks.push({kind: 'value', value: child, depth: depth + 1, path: [...path, key]});\n tasks.push({kind: 'bytes', byteLength: jsonPrimitiveByteLength(key) + 1});\n if (index > 0) tasks.push({kind: 'bytes', byteLength: 1});\n }\n }\n}\n\nfunction jsonPrimitiveByteLength(value: string | number | boolean): number {\n return utf8Encoder.encode(JSON.stringify(value)).byteLength;\n}\n\nfunction jsonSerializedByteLength(value: unknown): number | undefined {\n try {\n const serialized = JSON.stringify(value);\n return serialized === undefined ? undefined : utf8Encoder.encode(serialized).byteLength;\n } catch {\n return undefined;\n }\n}\n\nfunction isJsonRecord(value: object): value is Record<string, unknown> {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nconst workflowDocumentStepOutputTypeSchema = z.enum(workflowDocumentStepOutputTypes).meta({\n description: 'Declared output type. Use `json` when the output has a JSON Schema.',\n});\n\nconst workflowDocumentToolStepOutputMappingValueSchema = z\n .string()\n .min(1)\n .refine((value) => value.includes('$' + '{{'), {\n message: 'Tool-step output mappings must use a $' + '{{ }} expression.',\n });\n\nexport const 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 = jsonSerializedByteLength(schema);\n if (serializedBytes === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: 'Schema must be a serializable JSON Schema document.',\n });\n return;\n }\n\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\nfunction stepOutputsAreMappingForm(outputs: Readonly<Record<string, unknown>>): boolean {\n const interpolationOpen = '$' + '{{';\n const values = Object.values(outputs);\n return values.some((value) => typeof value === 'string' && value.includes(interpolationOpen));\n}\n\nfunction stepOutputsRecordChecks(outputs: Readonly<Record<string, unknown>>, ctx: z.RefinementCtx) {\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\nexport const workflowDocumentStepOutputsSchema = z\n .record(z.string(), workflowDocumentStepOutputDeclarationSchema)\n .superRefine((outputs, ctx) => stepOutputsRecordChecks(outputs, ctx))\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\n// The tool-step `outputs` form maps output keys to a single `${{ }}` expression\n// over `result`. The expression layer validates the interpolation; the mapping\n// form is rejected with the reserved tool step fields until tool steps exist.\nexport const workflowDocumentToolStepOutputsSchema = z\n .record(z.string(), workflowDocumentToolStepOutputMappingValueSchema)\n .superRefine((outputs, ctx) => stepOutputsRecordChecks(outputs, ctx))\n .meta({\n description:\n 'Tool-step output mappings over `result`. Each value is exactly one $' +\n '{{ }} expression. Tool steps are not available yet.',\n });\n\n// `outputs` carries the declaration form on run, agent, and checkout steps and\n// the expression mapping form on tool steps. One value union accepts both so a\n// reserved tool step parses and is rejected by the step `superRefine`; zod\n// reports the declaration branch's own issues for malformed declarations, and\n// the step `superRefine` rejects the mapping form on every other step kind.\nconst workflowDocumentStepOutputValueSchema = z.union([\n workflowDocumentStepOutputDeclarationSchema,\n workflowDocumentToolStepOutputMappingValueSchema,\n]);\n\nconst workflowDocumentStepOutputsFieldSchema = z\n .record(z.string(), workflowDocumentStepOutputValueSchema)\n .superRefine((outputs, ctx) => stepOutputsRecordChecks(outputs, ctx));\n\nconst workflowDocumentTriggerBaseSchema = {\n source: z.string().min(1).meta({\n description:\n 'Integration connection slug or built-in trigger source. See [Integrations](/integrations) for provider 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 the provider event catalog in [Integrations](/integrations).',\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 [Schedule workflows](/how-to/author-workflows/schedule-workflows).',\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).optional().meta({\n description:\n 'Event name that starts the workflow. Omit it to accept every event the source delivers. Sources that deliver one event, such as `manual`, `cron`, and custom webhooks, do not need it.',\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\n// A session names an agent conversation that continues across steps of one run.\n// The shorthand string form names the session and resumes it; the long form\n// adds an explicit mode. The key is a field template, evaluated at step\n// dispatch with the same context roots the prompt sees.\nconst workflowSessionKeyLiteralSchema = z\n .string()\n .min(1)\n .max(WORKFLOW_SESSION_KEY_MAX_LENGTH)\n .regex(WORKFLOW_SESSION_KEY_PATTERN, {\n message:\n 'Literal session keys must start with a letter or number and contain only letters, numbers, dots, underscores, or hyphens.',\n });\nconst workflowSessionKeyTemplateSchema = z\n .string()\n .min(1)\n .regex(WORKFLOW_INTERPOLATED_VALUE_PATTERN, {\n message: 'Session keys with interpolation must use a $' + '{{ }} template.',\n })\n .refine(isValidWorkflowSessionKeyTemplateLiteralParts, {\n message:\n 'Literal parts of interpolated session keys may contain only letters, numbers, dots, underscores, or hyphens, and may not exceed 128 characters in total.',\n });\nconst workflowSessionKeySchema = z.union([\n workflowSessionKeyLiteralSchema,\n workflowSessionKeyTemplateSchema,\n]);\n\nexport const workflowDocumentSessionSchema = z\n .union([\n workflowSessionKeyLiteralSchema,\n workflowSessionKeyTemplateSchema,\n z.strictObject({\n key: workflowSessionKeySchema.meta({\n description: 'Session key, or a $' + '{{ }} interpolation that resolves to one.',\n }),\n mode: z.enum(['resume', 'fork']).optional().meta({\n description:\n 'Session mode. `resume` continues the session and writes back; `fork` reads a snapshot and never writes. Defaults to `resume`.',\n }),\n }),\n ])\n .meta({\n description:\n 'Named agent session continued across steps of one workflow run. A string names the session and resumes it; an object adds the mode.',\n });\n\nexport function isValidWorkflowSessionKeyTemplateLiteralParts(source: string): boolean {\n let cursor = 0;\n let expressionSeen = false;\n let literalLength = 0;\n\n while (true) {\n const opener = source.indexOf('${{', cursor);\n const literalEnd = opener === -1 ? source.length : opener;\n const literal = source.slice(cursor, literalEnd);\n literalLength += literal.length;\n\n if (\n literalLength > WORKFLOW_SESSION_KEY_MAX_LENGTH ||\n !workflowSessionKeyLiteralPartPattern.test(literal) ||\n (!expressionSeen &&\n literal.length > 0 &&\n !workflowSessionKeyLiteralPartStartPattern.test(literal))\n ) {\n return false;\n }\n\n if (opener === -1) return expressionSeen;\n\n const close = findWorkflowSessionKeyTemplateClose(source, opener);\n if (close === -1) return false;\n\n expressionSeen = true;\n cursor = close + 2;\n }\n}\n\nfunction findWorkflowSessionKeyTemplateClose(source: string, openerIndex: number): number {\n let index = openerIndex + 3;\n let depth = 0;\n\n while (index < source.length) {\n const stringEnd = scanWorkflowSessionKeyStringLiteral(source, index);\n if (stringEnd !== null) {\n index = stringEnd;\n continue;\n }\n\n if (source.startsWith('//', index)) {\n const newline = source.indexOf('\\n', index + 2);\n index = newline === -1 ? source.length : newline;\n continue;\n }\n\n if (depth === 0 && source.startsWith('}}', index)) return index;\n\n const char = source[index];\n if (char === '(' || char === '[' || char === '{') {\n depth += 1;\n } else if ((char === ')' || char === ']' || char === '}') && depth > 0) {\n depth -= 1;\n }\n\n index += 1;\n }\n\n return -1;\n}\n\nfunction scanWorkflowSessionKeyStringLiteral(source: string, index: number): number | null {\n for (const prefix of ['r', 'R', 'b', 'B', ''] as const) {\n if (!source.startsWith(prefix, index)) continue;\n\n const quoteIndex = index + prefix.length;\n const quote = source[quoteIndex];\n if (quote !== '\"' && quote !== \"'\") continue;\n\n const tripleQuote = quote.repeat(3);\n if (source.startsWith(tripleQuote, quoteIndex)) {\n return scanWorkflowSessionKeyQuotedString(\n source,\n quoteIndex + 3,\n tripleQuote,\n prefix === 'r' || prefix === 'R',\n );\n }\n\n return scanWorkflowSessionKeyQuotedString(\n source,\n quoteIndex + 1,\n quote,\n prefix === 'r' || prefix === 'R',\n );\n }\n\n return null;\n}\n\nfunction scanWorkflowSessionKeyQuotedString(\n source: string,\n startIndex: number,\n delimiter: string,\n raw: boolean,\n): number {\n let index = startIndex;\n while (index < source.length) {\n if (!raw && source[index] === '\\\\') {\n index += 2;\n continue;\n }\n\n if (source.startsWith(delimiter, index)) return index + delimiter.length;\n\n index += 1;\n }\n\n return source.length;\n}\n\nexport const workflowDocumentAgentStepFields = [\n 'model',\n 'prompt',\n 'harness',\n 'thinking',\n 'provider',\n 'tools',\n 'integrations',\n 'session',\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\". The `tool`, `connection`,\n// `with`, and tool-step `outputs` mapping form are declared the same way: they\n// parse so their shape is checked, then any step carrying a reserved tool field\n// is rejected until the tool step kind exists.\nconst workflowDocumentStepBaseSchema = z.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: '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 session: workflowDocumentSessionSchema.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 tool: z.string().min(1).optional().meta({\n description:\n 'Literal integration tool id for a tool step. It is rejected; tool steps are not available yet.',\n }),\n connection: z.string().min(1).optional().meta({\n description:\n 'Literal integration connection slug for a tool step. It is rejected; tool steps are not available yet.',\n }),\n with: workflowDocumentToolStepWithSchema.optional(),\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: workflowDocumentStepOutputsFieldSchema.optional().meta({\n description:\n 'Named output declarations produced by this step, or on a tool step a mapping of output keys to exactly one $' +\n '{{ }} expression over `result`. Tool steps are not available yet.',\n }),\n});\n\ntype WorkflowDocumentStepSchemaOutput = Omit<\n z.infer<typeof workflowDocumentStepBaseSchema>,\n 'outputs'\n> & {\n outputs?: WorkflowDocumentStepOutputs;\n};\n\nexport const workflowDocumentStepSchema = workflowDocumentStepBaseSchema\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 const reservedToolField =\n step.tool !== undefined ? 'tool' : step.connection !== undefined ? 'connection' : undefined;\n if (reservedToolField !== undefined || step.with !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [reservedToolField ?? 'with'],\n message: 'Tool steps are not available yet.',\n });\n return;\n }\n\n if (step.outputs !== undefined && stepOutputsAreMappingForm(step.outputs)) {\n ctx.addIssue({\n code: 'custom',\n path: ['outputs'],\n message: 'The `outputs` mapping form is reserved for tool steps.',\n });\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 .transform<WorkflowDocumentStepSchemaOutput>(({outputs, ...step}) =>\n outputs === undefined ? step : {...step, outputs: outputs as WorkflowDocumentStepOutputs},\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 WorkflowDocumentStep = z.infer<typeof workflowDocumentStepSchema>;\nexport type WorkflowDocumentJob = z.infer<typeof workflowDocumentJobSchema>;\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 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 WorkflowDocumentToolStepOutputs = z.infer<typeof workflowDocumentToolStepOutputsSchema>;\nexport type WorkflowDocumentToolWith = z.infer<typeof workflowDocumentToolStepWithSchema>;\nexport type WorkflowDocumentSession = z.infer<typeof workflowDocumentSessionSchema>;\nexport type WorkflowDocumentTrigger = z.infer<typeof workflowDocumentTriggerSchema>;\n\ntype JsonDepthTask =\n | {kind: 'enter'; value: unknown; depth: number}\n | {kind: 'leave'; value: object};\n\nfunction maxJsonDepth(value: unknown): number {\n let maximumDepth = 0;\n const activeObjects = new Set<object>();\n const pending: JsonDepthTask[] = [{kind: 'enter', value, depth: 0}];\n\n while (pending.length > 0) {\n const current = pending.pop();\n if (current === undefined) continue;\n\n if (current.kind === 'leave') {\n activeObjects.delete(current.value);\n continue;\n }\n\n if (current.value === null || typeof current.value !== 'object') continue;\n if (activeObjects.has(current.value)) continue;\n\n activeObjects.add(current.value);\n const depth = current.depth + 1;\n maximumDepth = Math.max(maximumDepth, depth);\n pending.push({kind: 'leave', value: current.value});\n const children = Object.values(current.value);\n for (let index = children.length - 1; index >= 0; index -= 1) {\n pending.push({kind: 'enter', value: children[index], depth});\n }\n }\n\n return maximumDepth;\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","WORKFLOW_SESSION_KEY_MAX_LENGTH","WORKFLOW_SESSION_KEY_PATTERN_SOURCE","WORKFLOW_SESSION_KEY_PATTERN","RegExp","workflowSessionKeyLiteralPartPattern","workflowSessionKeyLiteralPartStartPattern","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","WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH","utf8Encoder","TextEncoder","workflowDocumentEnvSchema","number","boolean","superRefine","env","ctx","entries","addIssue","code","serializedBytes","encode","JSON","stringify","byteLength","workflowDocumentStepOutputKeyPattern","workflowDocumentToolStepWithSchema","unknown","withValue","path","validateWorkflowDocumentToolWith","transform","activeObjects","Set","tasks","kind","depth","addSerializedBytes","task","pop","undefined","delete","jsonPrimitiveByteLength","Number","isFinite","has","add","Array","isArray","push","index","isJsonRecord","entry","key","child","jsonSerializedByteLength","serialized","prototype","getPrototypeOf","workflowDocumentStepOutputTypeSchema","enum","workflowDocumentToolStepOutputMappingValueSchema","workflowDocumentStepOutputDeclarationSchema","type","strictObject","schema","optional","declaration","isJsonSchemaDocument","maxJsonDepth","stepOutputsAreMappingForm","outputs","interpolationOpen","values","some","stepOutputsRecordChecks","test","workflowDocumentStepOutputsSchema","workflowDocumentToolStepOutputsSchema","workflowDocumentStepOutputValueSchema","workflowDocumentStepOutputsFieldSchema","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","workflowDocumentStepGateSchema","on_failure","restart_from","feedback","workflowDocumentCheckoutPermissionsSchema","contents","workflowDocumentPersistCredentialsSchema","workflowDocumentCheckoutSchema","project","connection","repository","ref","permissions","force","checkout","validationIssue","workflowDocumentJobCheckoutSchema","literal","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepIntegrationSchema","include","exclude","allow_write","workflowSessionKeyLiteralSchema","max","workflowSessionKeyTemplateSchema","isValidWorkflowSessionKeyTemplateLiteralParts","workflowSessionKeySchema","workflowDocumentSessionSchema","mode","cursor","expressionSeen","literalLength","opener","indexOf","literalEnd","slice","close","findWorkflowSessionKeyTemplateClose","openerIndex","stringEnd","scanWorkflowSessionKeyStringLiteral","startsWith","newline","char","prefix","quoteIndex","quote","tripleQuote","repeat","scanWorkflowSessionKeyQuotedString","startIndex","delimiter","raw","workflowDocumentAgentStepFields","workflowDocumentStepBaseSchema","if","name","working_directory","run","model","prompt","harness","thinking","session","provider","tools","integrations","agent","tool","gate","workflowDocumentStepSchema","step","reservedToolField","isAgent","workflowDocumentJobOutputsSchema","workflowDocumentJobSchema","needs","runner","execution_timeout","execution_name","steps","workflowDocumentSchema","run_name","triggers","jobs","maximumDepth","pending","current","Math","children"],"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,cAC3DV,EACGW,MAAM,CAACX,EAAEM,MAAM,GAAGC,GAAG,CAAC,IAAIG,aAC1BE,MAAM,CAAC,CAACC,QAAUC,OAAOC,IAAI,CAACF,OAAOG,MAAM,GAAG,GAAG;QAACC,SAAS;IAA6B;AAE7F,OAAO,MAAMC,gCAAgC,kCAAkC;AAC/E,2EAA2E;AAC3E,8EAA8E;AAC9E,OAAO,MAAMC,sCAAsC,uCAAuC;AAC1F,OAAO,MAAMC,kCAAkC,IAAI;AACnD,OAAO,MAAMC,sCAAsC,qCAAqC;AACxF,OAAO,MAAMC,+BAA+B,IAAIC,OAA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MAAM+N,UAAUD,QAAQnK,GAAG;QAC3B,IAAIoK,YAAYnK,WAAW;QAE3B,IAAImK,QAAQxK,IAAI,KAAK,SAAS;YAC5BH,cAAcS,MAAM,CAACkK,QAAQlO,KAAK;YAClC;QACF;QAEA,IAAIkO,QAAQlO,KAAK,KAAK,QAAQ,OAAOkO,QAAQlO,KAAK,KAAK,UAAU;QACjE,IAAIuD,cAAca,GAAG,CAAC8J,QAAQlO,KAAK,GAAG;QAEtCuD,cAAcc,GAAG,CAAC6J,QAAQlO,KAAK;QAC/B,MAAM2D,QAAQuK,QAAQvK,KAAK,GAAG;QAC9BqK,eAAeG,KAAKjE,GAAG,CAAC8D,cAAcrK;QACtCsK,QAAQzJ,IAAI,CAAC;YAACd,MAAM;YAAS1D,OAAOkO,QAAQlO,KAAK;QAAA;QACjD,MAAMoO,WAAWnO,OAAO+F,MAAM,CAACkI,QAAQlO,KAAK;QAC5C,IAAK,IAAIyE,QAAQ2J,SAASjO,MAAM,GAAG,GAAGsE,SAAS,GAAGA,SAAS,EAAG;YAC5DwJ,QAAQzJ,IAAI,CAAC;gBAACd,MAAM;gBAAS1D,OAAOoO,QAAQ,CAAC3J,MAAM;gBAAEd;YAAK;QAC5D;IACF;IAEA,OAAOqK;AACT;AAEA,SAASrI,qBAAqB3F,KAAc;IAC1C,OACE,OAAOA,UAAU,aAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACsE,MAAMC,OAAO,CAACvE;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 = /^(?:[^$]|\\$\\$\\{\\{|\\$(?!\\{\\{))*\\$\\{\\{/;\nexport const WORKFLOW_SESSION_KEY_MAX_LENGTH = 128;\nexport const WORKFLOW_SESSION_KEY_PATTERN_SOURCE = '^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$';\nexport const WORKFLOW_SESSION_KEY_PATTERN = new RegExp(WORKFLOW_SESSION_KEY_PATTERN_SOURCE);\nconst workflowSessionKeyLiteralPartPattern = /^[A-Za-z0-9._-]*$/;\nconst workflowSessionKeyLiteralPartStartPattern = /^[A-Za-z0-9]/;\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;\nexport const WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES = 32 * 1024;\nexport const WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH = 16;\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\n// Tool inputs are a JSON tree: scalars, nested mappings, and sequences. String\n// leaves accept `${{ }}` interpolation; the expression layer validates them.\ntype WorkflowDocumentJsonValue =\n | string\n | number\n | boolean\n | null\n | WorkflowDocumentJsonValue[]\n | {[key: string]: WorkflowDocumentJsonValue};\n\nexport const workflowDocumentToolStepWithSchema = z\n // Validate nested values in an iterative refinement. A recursive Zod schema\n // would traverse hostile depth before the tool-input limits can reject it.\n .record(z.string().min(1), z.unknown())\n .superRefine((withValue, ctx) => {\n // The server injects `method` for `family.method` tools, so the author can\n // never set it.\n if ('method' in withValue) {\n ctx.addIssue({\n code: 'custom',\n path: ['method'],\n message:\n '`method` is not a valid tool input; the server injects it for `family.method` tools.',\n });\n }\n\n validateWorkflowDocumentToolWith(withValue, ctx);\n })\n .transform((withValue) => withValue as Record<string, WorkflowDocumentJsonValue>)\n .meta({\n description:\n 'Tool inputs as a JSON tree. The map allows up to ' +\n WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES +\n ' serialized bytes and ' +\n WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH +\n ' nesting levels. Tool steps are not available yet.',\n });\n\ntype WorkflowDocumentToolWithValidationTask =\n | {kind: 'value'; value: unknown; depth: number; path: (string | number)[]}\n | {kind: 'end'; value: object; byteLength: number}\n | {kind: 'bytes'; byteLength: number};\n\nfunction validateWorkflowDocumentToolWith(\n withValue: Readonly<Record<string, unknown>>,\n ctx: z.RefinementCtx,\n) {\n const activeObjects = new Set<object>();\n const tasks: WorkflowDocumentToolWithValidationTask[] = [\n {kind: 'value', value: withValue, depth: 1, path: []},\n ];\n let serializedBytes = 0;\n\n const addSerializedBytes = (byteLength: number): boolean => {\n serializedBytes += byteLength;\n if (serializedBytes <= WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES) return true;\n\n ctx.addIssue({\n code: 'custom',\n message: `Tool \\`with\\` cannot serialize to more than ${WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES} bytes.`,\n });\n return false;\n };\n\n while (tasks.length > 0) {\n const task = tasks.pop();\n if (task === undefined) continue;\n\n if (task.kind === 'bytes') {\n if (!addSerializedBytes(task.byteLength)) return;\n continue;\n }\n\n if (task.kind === 'end') {\n activeObjects.delete(task.value);\n if (!addSerializedBytes(task.byteLength)) return;\n continue;\n }\n\n const {value, depth, path} = task;\n if (value === null) {\n if (!addSerializedBytes(4)) return;\n continue;\n }\n if (typeof value === 'string' || typeof value === 'boolean') {\n if (!addSerializedBytes(jsonPrimitiveByteLength(value))) return;\n continue;\n }\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be JSON-compatible.',\n });\n return;\n }\n if (!addSerializedBytes(jsonPrimitiveByteLength(value))) return;\n continue;\n }\n if (typeof value !== 'object' || value === null) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be JSON-compatible.',\n });\n return;\n }\n\n if (depth > WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH) {\n ctx.addIssue({\n code: 'custom',\n message: `Tool \\`with\\` cannot be nested deeper than ${WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH} levels.`,\n });\n return;\n }\n if (activeObjects.has(value)) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be a JSON tree.',\n });\n return;\n }\n\n activeObjects.add(value);\n if (Array.isArray(value)) {\n if (!addSerializedBytes(1)) return;\n tasks.push({kind: 'end', value, byteLength: 1});\n for (let index = value.length - 1; index >= 0; index -= 1) {\n tasks.push({kind: 'value', value: value[index], depth: depth + 1, path: [...path, index]});\n if (index > 0) tasks.push({kind: 'bytes', byteLength: 1});\n }\n continue;\n }\n\n if (!isJsonRecord(value)) {\n ctx.addIssue({\n code: 'custom',\n path,\n message: 'Tool `with` values must be a JSON tree.',\n });\n return;\n }\n\n if (!addSerializedBytes(1)) return;\n tasks.push({kind: 'end', value, byteLength: 1});\n const entries = Object.entries(value);\n for (let index = entries.length - 1; index >= 0; index -= 1) {\n const entry = entries[index];\n if (entry === undefined) continue;\n const [key, child] = entry;\n tasks.push({kind: 'value', value: child, depth: depth + 1, path: [...path, key]});\n tasks.push({kind: 'bytes', byteLength: jsonPrimitiveByteLength(key) + 1});\n if (index > 0) tasks.push({kind: 'bytes', byteLength: 1});\n }\n }\n}\n\nfunction jsonPrimitiveByteLength(value: string | number | boolean): number {\n return utf8Encoder.encode(JSON.stringify(value)).byteLength;\n}\n\nfunction jsonSerializedByteLength(value: unknown): number | undefined {\n try {\n const serialized = JSON.stringify(value);\n return serialized === undefined ? undefined : utf8Encoder.encode(serialized).byteLength;\n } catch {\n return undefined;\n }\n}\n\nfunction isJsonRecord(value: object): value is Record<string, unknown> {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nconst workflowDocumentStepOutputTypeSchema = z.enum(workflowDocumentStepOutputTypes).meta({\n description: 'Declared output type. Use `json` when the output has a JSON Schema.',\n});\n\nconst workflowDocumentToolStepOutputMappingValueSchema = z\n .string()\n .min(1)\n .refine((value) => value.includes('$' + '{{'), {\n message: 'Tool-step output mappings must use a $' + '{{ }} expression.',\n });\n\nexport const 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 = jsonSerializedByteLength(schema);\n if (serializedBytes === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: 'Schema must be a serializable JSON Schema document.',\n });\n return;\n }\n\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\nfunction stepOutputsAreMappingForm(outputs: Readonly<Record<string, unknown>>): boolean {\n const interpolationOpen = '$' + '{{';\n const values = Object.values(outputs);\n return values.some((value) => typeof value === 'string' && value.includes(interpolationOpen));\n}\n\nfunction stepOutputsRecordChecks(outputs: Readonly<Record<string, unknown>>, ctx: z.RefinementCtx) {\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\nexport const workflowDocumentStepOutputsSchema = z\n .record(z.string(), workflowDocumentStepOutputDeclarationSchema)\n .superRefine((outputs, ctx) => stepOutputsRecordChecks(outputs, ctx))\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\n// The tool-step `outputs` form maps output keys to a single `${{ }}` expression\n// over `result`. The expression layer validates the interpolation; the mapping\n// form is rejected with the reserved tool step fields until tool steps exist.\nexport const workflowDocumentToolStepOutputsSchema = z\n .record(z.string(), workflowDocumentToolStepOutputMappingValueSchema)\n .superRefine((outputs, ctx) => stepOutputsRecordChecks(outputs, ctx))\n .meta({\n description:\n 'Tool-step output mappings over `result`. Each value is exactly one $' +\n '{{ }} expression. Tool steps are not available yet.',\n });\n\n// `outputs` carries the declaration form on run, agent, and checkout steps and\n// the expression mapping form on tool steps. One value union accepts both so a\n// reserved tool step parses and is rejected by the step `superRefine`; zod\n// reports the declaration branch's own issues for malformed declarations, and\n// the step `superRefine` rejects the mapping form on every other step kind.\nconst workflowDocumentStepOutputValueSchema = z.union([\n workflowDocumentStepOutputDeclarationSchema,\n workflowDocumentToolStepOutputMappingValueSchema,\n]);\n\nconst workflowDocumentStepOutputsFieldSchema = z\n .record(z.string(), workflowDocumentStepOutputValueSchema)\n .superRefine((outputs, ctx) => stepOutputsRecordChecks(outputs, ctx));\n\nconst workflowDocumentTriggerBaseSchema = {\n source: z.string().min(1).meta({\n description:\n 'Integration connection slug or built-in trigger source. See [Integrations](/integrations) for provider 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 the provider event catalog in [Integrations](/integrations).',\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 [Schedule workflows](/how-to/author-workflows/schedule-workflows).',\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).optional().meta({\n description:\n 'Event name that starts the workflow. Omit it to accept every event the source delivers. Sources that deliver one event, such as `manual`, `cron`, and custom webhooks, do not need it.',\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\n// A session names an agent conversation that continues across steps of one run.\n// The shorthand string form names the session and resumes it; the long form\n// adds an explicit mode. The key is a field template, evaluated at step\n// dispatch with the same context roots the prompt sees.\nconst workflowSessionKeyLiteralSchema = z\n .string()\n .min(1)\n .max(WORKFLOW_SESSION_KEY_MAX_LENGTH)\n .regex(WORKFLOW_SESSION_KEY_PATTERN, {\n message:\n 'Literal session keys must start with a letter or number and contain only letters, numbers, dots, underscores, or hyphens.',\n });\nconst workflowSessionKeyTemplateSchema = z\n .string()\n .min(1)\n .regex(WORKFLOW_INTERPOLATED_VALUE_PATTERN, {\n message: 'Session keys with interpolation must use a $' + '{{ }} template.',\n })\n .refine(isValidWorkflowSessionKeyTemplateLiteralParts, {\n message:\n 'Literal parts of interpolated session keys may contain only letters, numbers, dots, underscores, or hyphens, and may not exceed 128 characters in total.',\n });\nconst workflowSessionKeySchema = z.union([\n workflowSessionKeyLiteralSchema,\n workflowSessionKeyTemplateSchema,\n]);\n\nexport const workflowDocumentSessionSchema = z\n .union([\n workflowSessionKeyLiteralSchema,\n workflowSessionKeyTemplateSchema,\n z.strictObject({\n key: workflowSessionKeySchema.meta({\n description: 'Session key, or a $' + '{{ }} interpolation that resolves to one.',\n }),\n mode: z.enum(['resume', 'fork']).optional().meta({\n description:\n 'Session mode. `resume` continues the session and writes back; `fork` reads a snapshot and never writes. Defaults to `resume`.',\n }),\n }),\n ])\n .meta({\n description:\n 'Named agent session continued across steps of one workflow run. A string names the session and resumes it; an object adds the mode.',\n });\n\nexport function isValidWorkflowSessionKeyTemplateLiteralParts(source: string): boolean {\n let cursor = 0;\n let expressionSeen = false;\n let literalLength = 0;\n\n while (true) {\n const opener = source.indexOf('${{', cursor);\n const literalEnd = opener === -1 ? source.length : opener;\n const literal = source.slice(cursor, literalEnd);\n literalLength += literal.length;\n\n if (\n literalLength > WORKFLOW_SESSION_KEY_MAX_LENGTH ||\n !workflowSessionKeyLiteralPartPattern.test(literal) ||\n (!expressionSeen &&\n literal.length > 0 &&\n !workflowSessionKeyLiteralPartStartPattern.test(literal))\n ) {\n return false;\n }\n\n if (opener === -1) return expressionSeen;\n\n const close = findWorkflowSessionKeyTemplateClose(source, opener);\n if (close === -1) return false;\n\n expressionSeen = true;\n cursor = close + 2;\n }\n}\n\nfunction findWorkflowSessionKeyTemplateClose(source: string, openerIndex: number): number {\n let index = openerIndex + 3;\n let depth = 0;\n\n while (index < source.length) {\n const stringEnd = scanWorkflowSessionKeyStringLiteral(source, index);\n if (stringEnd !== null) {\n index = stringEnd;\n continue;\n }\n\n if (source.startsWith('//', index)) {\n const newline = source.indexOf('\\n', index + 2);\n index = newline === -1 ? source.length : newline;\n continue;\n }\n\n if (depth === 0 && source.startsWith('}}', index)) return index;\n\n const char = source[index];\n if (char === '(' || char === '[' || char === '{') {\n depth += 1;\n } else if ((char === ')' || char === ']' || char === '}') && depth > 0) {\n depth -= 1;\n }\n\n index += 1;\n }\n\n return -1;\n}\n\nfunction scanWorkflowSessionKeyStringLiteral(source: string, index: number): number | null {\n for (const prefix of ['r', 'R', 'b', 'B', ''] as const) {\n if (!source.startsWith(prefix, index)) continue;\n\n const quoteIndex = index + prefix.length;\n const quote = source[quoteIndex];\n if (quote !== '\"' && quote !== \"'\") continue;\n\n const tripleQuote = quote.repeat(3);\n if (source.startsWith(tripleQuote, quoteIndex)) {\n return scanWorkflowSessionKeyQuotedString(\n source,\n quoteIndex + 3,\n tripleQuote,\n prefix === 'r' || prefix === 'R',\n );\n }\n\n return scanWorkflowSessionKeyQuotedString(\n source,\n quoteIndex + 1,\n quote,\n prefix === 'r' || prefix === 'R',\n );\n }\n\n return null;\n}\n\nfunction scanWorkflowSessionKeyQuotedString(\n source: string,\n startIndex: number,\n delimiter: string,\n raw: boolean,\n): number {\n let index = startIndex;\n while (index < source.length) {\n if (!raw && source[index] === '\\\\') {\n index += 2;\n continue;\n }\n\n if (source.startsWith(delimiter, index)) return index + delimiter.length;\n\n index += 1;\n }\n\n return source.length;\n}\n\nexport const workflowDocumentAgentStepFields = [\n 'model',\n 'prompt',\n 'harness',\n 'thinking',\n 'provider',\n 'tools',\n 'integrations',\n 'session',\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\". The `tool`, `connection`,\n// `with`, and tool-step `outputs` mapping form are declared the same way: they\n// parse so their shape is checked, then any step carrying a reserved tool field\n// is rejected until the tool step kind exists.\nconst workflowDocumentStepBaseSchema = z.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: '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 session: workflowDocumentSessionSchema.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 tool: literalNameSchema('Tool id must be literal. Interpolation is rejected.').optional().meta({\n description:\n 'Literal integration tool id for a tool step. It is rejected; tool steps are not available yet.',\n }),\n connection: literalNameSchema('Connection slug must be literal. Interpolation is rejected.')\n .optional()\n .meta({\n description:\n 'Literal integration connection slug for a tool step. It is rejected; tool steps are not available yet.',\n }),\n with: workflowDocumentToolStepWithSchema.optional(),\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: workflowDocumentStepOutputsFieldSchema.optional().meta({\n description:\n 'Named output declarations produced by this step, or on a tool step a mapping of output keys to exactly one $' +\n '{{ }} expression over `result`. Tool steps are not available yet.',\n }),\n});\n\ntype WorkflowDocumentStepSchemaOutput = Omit<\n z.infer<typeof workflowDocumentStepBaseSchema>,\n 'outputs'\n> & {\n outputs?: WorkflowDocumentStepOutputs;\n};\n\nexport const workflowDocumentStepSchema = workflowDocumentStepBaseSchema\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 const reservedToolField =\n step.tool !== undefined ? 'tool' : step.connection !== undefined ? 'connection' : undefined;\n const reservedToolValue =\n reservedToolField === 'tool'\n ? step.tool\n : reservedToolField === 'connection'\n ? step.connection\n : undefined;\n if (reservedToolValue !== undefined && !WORKFLOW_LITERAL_NAME_PATTERN.test(reservedToolValue)) {\n // The field-level literal-name check already rejected the interpolated\n // value; skip the reserved-field issue so one defect does not report\n // twice at the same path.\n return;\n }\n if (reservedToolField !== undefined || step.with !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [reservedToolField ?? 'with'],\n message: 'Tool steps are not available yet.',\n });\n return;\n }\n\n if (step.outputs !== undefined && stepOutputsAreMappingForm(step.outputs)) {\n ctx.addIssue({\n code: 'custom',\n path: ['outputs'],\n message: 'The `outputs` mapping form is reserved for tool steps.',\n });\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 .transform<WorkflowDocumentStepSchemaOutput>(({outputs, ...step}) =>\n outputs === undefined ? step : {...step, outputs: outputs as WorkflowDocumentStepOutputs},\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 WorkflowDocumentStep = z.infer<typeof workflowDocumentStepSchema>;\nexport type WorkflowDocumentJob = z.infer<typeof workflowDocumentJobSchema>;\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 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 WorkflowDocumentToolStepOutputs = z.infer<typeof workflowDocumentToolStepOutputsSchema>;\nexport type WorkflowDocumentToolWith = z.infer<typeof workflowDocumentToolStepWithSchema>;\nexport type WorkflowDocumentSession = z.infer<typeof workflowDocumentSessionSchema>;\nexport type WorkflowDocumentTrigger = z.infer<typeof workflowDocumentTriggerSchema>;\n\ntype JsonDepthTask =\n | {kind: 'enter'; value: unknown; depth: number}\n | {kind: 'leave'; value: object};\n\nfunction maxJsonDepth(value: unknown): number {\n let maximumDepth = 0;\n const activeObjects = new Set<object>();\n const pending: JsonDepthTask[] = [{kind: 'enter', value, depth: 0}];\n\n while (pending.length > 0) {\n const current = pending.pop();\n if (current === undefined) continue;\n\n if (current.kind === 'leave') {\n activeObjects.delete(current.value);\n continue;\n }\n\n if (current.value === null || typeof current.value !== 'object') continue;\n if (activeObjects.has(current.value)) continue;\n\n activeObjects.add(current.value);\n const depth = current.depth + 1;\n maximumDepth = Math.max(maximumDepth, depth);\n pending.push({kind: 'leave', value: current.value});\n const children = Object.values(current.value);\n for (let index = children.length - 1; index >= 0; index -= 1) {\n pending.push({kind: 'enter', value: children[index], depth});\n }\n }\n\n return maximumDepth;\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","WORKFLOW_SESSION_KEY_MAX_LENGTH","WORKFLOW_SESSION_KEY_PATTERN_SOURCE","WORKFLOW_SESSION_KEY_PATTERN","RegExp","workflowSessionKeyLiteralPartPattern","workflowSessionKeyLiteralPartStartPattern","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","WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH","utf8Encoder","TextEncoder","workflowDocumentEnvSchema","number","boolean","superRefine","env","ctx","entries","addIssue","code","serializedBytes","encode","JSON","stringify","byteLength","workflowDocumentStepOutputKeyPattern","workflowDocumentToolStepWithSchema","unknown","withValue","path","validateWorkflowDocumentToolWith","transform","activeObjects","Set","tasks","kind","depth","addSerializedBytes","task","pop","undefined","delete","jsonPrimitiveByteLength","Number","isFinite","has","add","Array","isArray","push","index","isJsonRecord","entry","key","child","jsonSerializedByteLength","serialized","prototype","getPrototypeOf","workflowDocumentStepOutputTypeSchema","enum","workflowDocumentToolStepOutputMappingValueSchema","workflowDocumentStepOutputDeclarationSchema","type","strictObject","schema","optional","declaration","isJsonSchemaDocument","maxJsonDepth","stepOutputsAreMappingForm","outputs","interpolationOpen","values","some","stepOutputsRecordChecks","test","workflowDocumentStepOutputsSchema","workflowDocumentToolStepOutputsSchema","workflowDocumentStepOutputValueSchema","workflowDocumentStepOutputsFieldSchema","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","workflowDocumentStepGateSchema","on_failure","restart_from","feedback","workflowDocumentCheckoutPermissionsSchema","contents","workflowDocumentPersistCredentialsSchema","workflowDocumentCheckoutSchema","project","connection","repository","ref","permissions","force","checkout","validationIssue","workflowDocumentJobCheckoutSchema","literal","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepIntegrationSchema","include","exclude","allow_write","workflowSessionKeyLiteralSchema","max","workflowSessionKeyTemplateSchema","isValidWorkflowSessionKeyTemplateLiteralParts","workflowSessionKeySchema","workflowDocumentSessionSchema","mode","cursor","expressionSeen","literalLength","opener","indexOf","literalEnd","slice","close","findWorkflowSessionKeyTemplateClose","openerIndex","stringEnd","scanWorkflowSessionKeyStringLiteral","startsWith","newline","char","prefix","quoteIndex","quote","tripleQuote","repeat","scanWorkflowSessionKeyQuotedString","startIndex","delimiter","raw","workflowDocumentAgentStepFields","workflowDocumentStepBaseSchema","if","name","working_directory","run","model","prompt","harness","thinking","session","provider","tools","integrations","agent","tool","gate","workflowDocumentStepSchema","step","reservedToolField","reservedToolValue","isAgent","workflowDocumentJobOutputsSchema","workflowDocumentJobSchema","needs","runner","execution_timeout","execution_name","steps","workflowDocumentSchema","run_name","triggers","jobs","maximumDepth","pending","current","Math","children"],"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,cAC3DV,EACGW,MAAM,CAACX,EAAEM,MAAM,GAAGC,GAAG,CAAC,IAAIG,aAC1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