@shipfox/workflow-document 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/document/index.d.ts +1 -1
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +1 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/workflow-document-parser.d.ts +2 -2
- package/dist/document/workflow-document-parser.d.ts.map +1 -1
- package/dist/document/workflow-document-parser.js +18 -5
- package/dist/document/workflow-document-parser.js.map +1 -1
- package/dist/document/workflow-document.d.ts +271 -13
- package/dist/document/workflow-document.d.ts.map +1 -1
- package/dist/document/workflow-document.js +291 -20
- package/dist/document/workflow-document.js.map +1 -1
- package/dist/document/workflow-json-schema.d.ts.map +1 -1
- package/dist/document/workflow-json-schema.js +16 -1
- package/dist/document/workflow-json-schema.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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 = /^(?:[^$]|\\$\\$\\{\\{|\\$(?!\\{\\{))*\\$\\{\\{/;\n\n// Reasoning effort is an enum so editors can complete it, and a template so a\n// workflow can choose the effort from run context. The resolved value is\n// checked against the harness levels when the step is dispatched.\nexport const agentThinkingFieldSchema = z\n .union([\n agentThinkingSchema,\n z.string().regex(WORKFLOW_INTERPOLATED_VALUE_PATTERN, {\n message:\n 'Agent thinking must be a supported level or a $' +\n '{{ }} interpolation that resolves to one.',\n }),\n ])\n .meta({\n description:\n 'Reasoning effort for an agent step. Supported values depend on the resolved harness. Accepts a $' +\n '{{ }} interpolation. When omitted, Shipfox uses the provider default, or `xhigh` when none is configured.',\n });\n\nconst workflowNameSchema = literalNameSchema(\n 'Workflow name must be literal. Move runtime interpolation to run_name.',\n).meta({description: 'Static literal human-readable workflow name.'});\nconst jobNameSchema = literalNameSchema(\n 'Job name must be literal. Move runtime interpolation to execution_name.',\n).meta({description: 'Static literal human-readable job name.'});\n\nfunction literalNameSchema(message: string) {\n return z.string().min(1).regex(WORKFLOW_LITERAL_NAME_PATTERN, {message});\n}\n\n// Runner shell steps execute on Unix shells, so workflow env names follow the\n// portable POSIX-style variable shape.\nconst envNameSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);\nconst envStringValueSchema = z.string().refine((value) => !value.includes('\\u0000'), {\n message: 'Env string values cannot contain null bytes',\n});\nexport const WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES = 128;\nexport const WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES = 32 * 1024;\nexport const workflowDocumentStepOutputTypes = ['string', 'number', 'boolean', 'json'] as const;\nexport const WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES =\n WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH = 64;\n\nconst utf8Encoder = new TextEncoder();\n\nexport const workflowDocumentEnvSchema = z\n .record(envNameSchema, z.union([envStringValueSchema, z.number(), z.boolean()]))\n .superRefine((env, ctx) => {\n const entries = Object.keys(env).length;\n if (entries > WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES) {\n ctx.addIssue({\n code: 'custom',\n message: `Env cannot define more than ${WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES} entries.`,\n });\n }\n\n const serializedBytes = utf8Encoder.encode(JSON.stringify(env)).byteLength;\n if (serializedBytes > WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES) {\n ctx.addIssue({\n code: 'custom',\n message: `Env cannot serialize to more than ${WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES} bytes.`,\n });\n }\n })\n .meta({\n description: `Environment variables as string, number, or boolean values. Each map allows up to ${WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES} entries and ${WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES} serialized bytes.`,\n });\n\nconst workflowDocumentStepOutputKeyPattern = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n\nconst workflowDocumentStepOutputTypeSchema = z.enum(workflowDocumentStepOutputTypes).meta({\n description: 'Declared output type. Use `json` when the output has a JSON Schema.',\n});\n\nconst workflowDocumentStepOutputDeclarationSchema = z\n .union([\n workflowDocumentStepOutputTypeSchema.transform((type) => ({type})),\n z.strictObject({\n type: workflowDocumentStepOutputTypeSchema,\n schema: z\n .unknown()\n .optional()\n .meta({\n description:\n 'JSON Schema for a `json` output. It allows up to ' +\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES +\n ' serialized bytes and ' +\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH +\n ' nesting levels.',\n }),\n }),\n ])\n .superRefine((declaration, ctx) => {\n const schema = 'schema' in declaration ? declaration.schema : undefined;\n if (declaration.type !== 'json' && schema !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: '`schema` is only supported for json outputs.',\n });\n return;\n }\n\n if (schema === undefined) return;\n\n if (!isJsonSchemaDocument(schema)) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: 'Schema must be a valid JSON Schema document.',\n });\n return;\n }\n\n const serializedBytes = utf8Encoder.encode(JSON.stringify(schema)).byteLength;\n if (serializedBytes > WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: `Output JSON Schema cannot serialize to more than ${WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES} bytes.`,\n });\n }\n\n const depth = maxJsonDepth(schema);\n if (depth > WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH) {\n ctx.addIssue({\n code: 'custom',\n path: ['schema'],\n message: `Output JSON Schema cannot be nested deeper than ${WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH} levels.`,\n });\n }\n });\n\nexport const workflowDocumentStepOutputsSchema = z\n .record(z.string(), workflowDocumentStepOutputDeclarationSchema)\n .superRefine((outputs, ctx) => {\n const entries = Object.keys(outputs).length;\n if (entries > WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES) {\n ctx.addIssue({\n code: 'custom',\n message: `Step outputs cannot define more than ${WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES} entries.`,\n });\n }\n\n for (const key of Object.keys(outputs)) {\n if (workflowDocumentStepOutputKeyPattern.test(key)) continue;\n ctx.addIssue({\n code: 'custom',\n path: [key],\n message: 'Output keys must be CEL identifiers.',\n });\n }\n })\n .meta({\n description: `Named step outputs. Keys must be CEL identifiers and each step allows up to ${WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES} declarations.`,\n });\n\nconst workflowDocumentTriggerBaseSchema = {\n source: z.string().min(1).meta({\n description:\n 'Integration connection slug or built-in trigger source. See [Trigger sources](/reference/trigger-sources).',\n }),\n with: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'Provider-specific values used to match or configure the trigger. See [Trigger sources](/reference/trigger-sources).',\n }),\n filter: z.string().min(1).optional().meta({\n description:\n 'CEL condition that filters matching events. It is not supported for `manual` or `cron` triggers. See [Expressions](/reference/expressions) and [Contexts](/reference/contexts#context-availability).',\n }),\n config: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'Source-specific configuration. It is supported only for top-level triggers with a known built-in source. See [cron triggers](/reference/trigger-sources#cron).',\n }),\n} satisfies z.ZodRawShape;\n\nexport const triggerSourceConfigSchemas = {\n cron: z.strictObject({\n schedule: z.string().min(1).optional().meta({\n description: 'Cron expression that schedules the workflow.',\n }),\n timezone: z.string().min(1).optional().meta({\n description: 'IANA time zone used to evaluate `schedule`.',\n }),\n }),\n} satisfies Record<string, z.ZodType>;\nconst triggerSourceConfigSchemaRegistry: Readonly<Record<string, z.ZodType>> =\n triggerSourceConfigSchemas;\n\nexport const workflowDocumentTriggerSchema = z\n .strictObject({\n ...workflowDocumentTriggerBaseSchema,\n event: z.string().min(1).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\nexport const workflowDocumentAgentStepFields = [\n 'model',\n 'prompt',\n 'harness',\n 'thinking',\n 'provider',\n 'tools',\n 'integrations',\n] as const;\n\n// A step is a run step (`run`), an inline agent step (`prompt`), or a checkout\n// step (`checkout`), never two kinds at once. They share one strict object so\n// an unknown key is still rejected; the `superRefine` discriminates by which\n// payload keys are present and emits one targeted issue per failure mode (a\n// plain union would surface every branch's errors at once). The `agent`\n// keyword is declared only so the reserved-keyword case produces a clear\n// message instead of a generic \"unrecognized key\".\nexport const workflowDocumentStepSchema = z\n .strictObject({\n key: z\n .string()\n .min(1)\n .optional()\n .meta({description: 'Stable step key for dependencies and outputs.'}),\n if: z\n .string()\n .min(1)\n .optional()\n .meta({\n description:\n 'CEL condition wrapped in exactly one $' +\n '{{ }} interpolation. See [conditionals](/reference/expressions#syntax).',\n }),\n name: z.string().min(1).optional().meta({description: 'Human-readable step name.'}),\n working_directory: z.string().min(1).optional().meta({\n description: 'Working directory for the step, relative to the job workspace.',\n }),\n run: z.string().min(1).optional().meta({\n description: 'Shell command for a run step. Do not combine it with agent-only fields.',\n }),\n checkout: workflowDocumentCheckoutSchema.optional().meta({\n description: 'Repository checkout settings for this step.',\n }),\n model: z.string().min(1).optional().meta({\n description:\n 'Model ID for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n prompt: z.string().min(1).optional().meta({\n description: 'Prompt for an agent step. It is required when any agent-only field is set.',\n }),\n harness: harnessSchema.optional().meta({\n description:\n 'Agent harness. When omitted, Shipfox uses the workspace default harness, or `pi` when none is configured.',\n }),\n thinking: agentThinkingFieldSchema.optional(),\n provider: z.string().min(1).optional().meta({\n description:\n 'Model provider ID for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n tools: z.array(z.string().min(1)).min(1).optional().meta({\n description:\n 'Built-in tool IDs for an agent step. It requires `prompt` and is not valid on a run step.',\n }),\n integrations: z.array(workflowDocumentStepIntegrationSchema).min(1).optional().meta({\n description:\n 'Integration tools available to an agent step. It requires `prompt` and is not valid on a run step. See [integration tools](/how-to/author-workflows/use-integration-tools).',\n }),\n agent: z.unknown().optional().meta({\n description: 'Reserved keyword. It is rejected; use `prompt` to define an agent step.',\n }),\n gate: workflowDocumentStepGateSchema.optional().meta({\n description: 'Success gate and optional restart behavior after the step runs.',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description: 'Environment variables for a run step. They are not valid on an agent step.',\n }),\n outputs: workflowDocumentStepOutputsSchema.optional().meta({\n description: 'Named output declarations produced by this step.',\n }),\n })\n .superRefine((step, ctx) => {\n if (step.agent !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['agent'],\n message: 'The \"agent\" keyword is reserved for a future step kind and is not supported yet.',\n });\n return;\n }\n\n if (step.checkout !== undefined) {\n if (step.run !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['run'],\n message: '\"run\" is not valid on a checkout step.',\n });\n }\n for (const key of workflowDocumentAgentStepFields) {\n if (step[key] !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [key],\n message: `\"${key}\" is not valid on a checkout step.`,\n });\n }\n }\n if (step.env !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['env'],\n message: '\"env\" is not valid on a checkout step.',\n });\n }\n return;\n }\n\n if (step.run !== undefined) {\n for (const key of workflowDocumentAgentStepFields) {\n if (step[key] !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: [key],\n message: `\"${key}\" is not valid on a run step.`,\n });\n }\n }\n return;\n }\n\n const isAgent = workflowDocumentAgentStepFields.some((field) => step[field] !== undefined);\n\n if (!isAgent) {\n ctx.addIssue({\n code: 'custom',\n message: 'A step must define either \"run\", an agent \"prompt\", or \"checkout\".',\n });\n return;\n }\n\n if (step.env !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['env'],\n message: '\"env\" is supported only on run steps.',\n });\n }\n if (step.prompt === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['prompt'],\n message: 'An agent step requires \"prompt\".',\n });\n }\n });\n\nconst workflowDocumentJobOutputsSchema = nonEmptyRecordSchema(z.string().min(1)).superRefine(\n (outputs, ctx) => {\n const entries = Object.keys(outputs).length;\n if (entries > WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES) {\n ctx.addIssue({\n code: 'custom',\n message: `Job outputs cannot define more than ${WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES} entries.`,\n });\n }\n },\n);\n\nexport const workflowDocumentJobSchema = z.strictObject({\n needs: stringOrStringArraySchema.optional().meta({\n description: 'Job key or keys that must complete before this job starts.',\n }),\n if: z\n .string()\n .min(1)\n .optional()\n .meta({\n description:\n 'CEL condition wrapped in exactly one $' +\n '{{ }} interpolation. See [conditionals](/reference/expressions#syntax).',\n }),\n runner: stringOrStringArraySchema.optional().meta({\n description:\n 'Runner label or ordered fallback labels for this job. See [runners and execution environments](/understand/runners-and-execution-environments).',\n }),\n success: z.string().min(1).optional().meta({\n description:\n 'CEL expression that determines whether the job succeeds. See [Expressions](/reference/expressions#functions-and-macros) and [Contexts](/reference/contexts#context-availability).',\n }),\n outputs: workflowDocumentJobOutputsSchema.optional().meta({\n description: `Named job outputs mapped from step values. A mapping with exactly one expression preserves an inferred non-string source type. Each job allows up to ${WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES} declarations.`,\n }),\n execution_timeout: z.string().min(1).optional().meta({\n description: 'Maximum duration for one job execution.',\n }),\n checkout: workflowDocumentJobCheckoutSchema.optional(),\n listening: workflowDocumentListeningSchema.optional().meta({\n description:\n 'Event-listening configuration for this job. See [listening jobs](/understand/listening-jobs).',\n }),\n name: jobNameSchema.optional(),\n execution_name: z.string().min(1).optional().meta({\n description: 'Dynamic name for each job execution. Supports workflow expressions.',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description:\n 'Environment variables for run steps in this job. They do not apply to agent steps. See [secrets and variables](/reference/secrets-variables).',\n }),\n steps: z.array(workflowDocumentStepSchema).min(1).meta({\n description: 'Ordered run or agent steps. Each job needs at least one step.',\n }),\n});\n\nexport const workflowDocumentSchema = z.strictObject({\n name: workflowNameSchema,\n run_name: z.string().min(1).optional().meta({\n description: 'Dynamic name for each workflow run. Supports workflow expressions.',\n }),\n runner: stringOrStringArraySchema.optional().meta({\n description:\n 'Default runner label or ordered fallback labels for run jobs. See [runners and execution environments](/understand/runners-and-execution-environments).',\n }),\n env: workflowDocumentEnvSchema.optional().meta({\n description:\n 'Workflow-level environment variables for run steps. They do not apply to agent steps. See [secrets and variables](/reference/secrets-variables).',\n }),\n triggers: nonEmptyRecordSchema(workflowDocumentTriggerSchema).optional().meta({\n description:\n 'Named events that start workflow runs. A workflow can have at most one `manual` trigger.',\n }),\n jobs: nonEmptyRecordSchema(workflowDocumentJobSchema).meta({\n description: 'Named jobs that make up the workflow. At least one job is required.',\n }),\n});\n\nexport type WorkflowDocument = z.infer<typeof workflowDocumentSchema>;\nexport type WorkflowDocumentCheckout = z.infer<typeof workflowDocumentCheckoutSchema>;\nexport type WorkflowDocumentJobCheckout = z.infer<typeof workflowDocumentJobCheckoutSchema>;\nexport type WorkflowDocumentEnv = z.infer<typeof workflowDocumentEnvSchema>;\nexport type WorkflowDocumentJob = z.infer<typeof workflowDocumentJobSchema>;\nexport type WorkflowDocumentJobListening = z.infer<typeof workflowDocumentListeningSchema>;\nexport type WorkflowDocumentRunStepGate = z.infer<typeof workflowDocumentStepGateSchema>;\nexport type WorkflowDocumentStepIntegration = z.infer<typeof workflowDocumentStepIntegrationSchema>;\nexport type WorkflowDocumentStepOutputType = (typeof workflowDocumentStepOutputTypes)[number];\nexport type WorkflowDocumentStepOutputs = z.infer<typeof workflowDocumentStepOutputsSchema>;\nexport type WorkflowDocumentStep = z.infer<typeof workflowDocumentStepSchema>;\nexport type WorkflowDocumentTrigger = z.infer<typeof workflowDocumentTriggerSchema>;\n\nfunction maxJsonDepth(value: unknown): number {\n if (value === null || typeof value !== 'object') return 0;\n if (Array.isArray(value)) {\n if (value.length === 0) return 1;\n return 1 + Math.max(...value.map(maxJsonDepth));\n }\n\n const entries = Object.values(value);\n if (entries.length === 0) return 1;\n return 1 + Math.max(...entries.map(maxJsonDepth));\n}\n\nfunction isJsonSchemaDocument(value: unknown): boolean {\n return (\n typeof value === 'boolean' ||\n (typeof value === 'object' && value !== null && !Array.isArray(value))\n );\n}\n"],"names":["z","checkoutTargetValidationIssues","agentThinkingSchema","harnessSchema","stringOrStringArraySchema","union","string","min","array","nonEmptyRecordSchema","valueSchema","record","refine","value","Object","keys","length","message","WORKFLOW_LITERAL_NAME_PATTERN","WORKFLOW_INTERPOLATED_VALUE_PATTERN","agentThinkingFieldSchema","regex","meta","description","workflowNameSchema","literalNameSchema","jobNameSchema","envNameSchema","envStringValueSchema","includes","WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES","WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES","workflowDocumentStepOutputTypes","WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES","WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH","utf8Encoder","TextEncoder","workflowDocumentEnvSchema","number","boolean","superRefine","env","ctx","entries","addIssue","code","serializedBytes","encode","JSON","stringify","byteLength","workflowDocumentStepOutputKeyPattern","workflowDocumentStepOutputTypeSchema","enum","workflowDocumentStepOutputDeclarationSchema","transform","type","strictObject","schema","unknown","optional","declaration","undefined","path","isJsonSchemaDocument","depth","maxJsonDepth","workflowDocumentStepOutputsSchema","outputs","key","test","workflowDocumentTriggerBaseSchema","source","with","filter","config","triggerSourceConfigSchemas","cron","schedule","timezone","triggerSourceConfigSchemaRegistry","workflowDocumentTriggerSchema","event","trigger","configSchema","configResult","safeParse","success","configIssue","error","issues","workflowDocumentListeningSchema","on","until","timeout","max_executions","int","positive","batch","debounce","max_size","max_wait","on_resolve","listening","field","index","workflowDocumentStepGateSchema","on_failure","restart_from","feedback","workflowDocumentCheckoutPermissionsSchema","contents","workflowDocumentPersistCredentialsSchema","workflowDocumentCheckoutSchema","project","connection","repository","ref","permissions","force","checkout","validationIssue","kind","workflowDocumentJobCheckoutSchema","literal","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepIntegrationSchema","include","exclude","allow_write","workflowDocumentAgentStepFields","workflowDocumentStepSchema","if","name","working_directory","run","model","prompt","harness","thinking","provider","tools","integrations","agent","gate","step","isAgent","some","workflowDocumentJobOutputsSchema","workflowDocumentJobSchema","needs","runner","execution_timeout","execution_name","steps","workflowDocumentSchema","run_name","triggers","jobs","Array","isArray","Math","max","map","values"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,8BAA8B,QAAO,kCAAkC;AAC/E,SAAQC,mBAAmB,EAAEC,aAAa,QAAO,kBAAkB;AAEnE,MAAMC,4BAA4BJ,EAAEK,KAAK,CAAC;IAACL,EAAEM,MAAM,GAAGC,GAAG,CAAC;IAAIP,EAAEQ,KAAK,CAACR,EAAEM,MAAM,GAAGC,GAAG,CAAC,IAAIA,GAAG,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C,GAAG,IAAIvJ,MAAMwJ,GAAG,CAACjG;IACnC;IAEA,MAAMvB,UAAU/B,OAAOwJ,MAAM,CAACzJ;IAC9B,IAAIgC,QAAQ7B,MAAM,KAAK,GAAG,OAAO;IACjC,OAAO,IAAImJ,KAAKC,GAAG,IAAIvH,QAAQwH,GAAG,CAACjG;AACrC;AAEA,SAASF,qBAAqBrD,KAAc;IAC1C,OACE,OAAOA,UAAU,aAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACoJ,MAAMC,OAAO,CAACrJ;AAEnE"}
|
|
1
|
+
{"version":3,"sources":["../../src/document/workflow-document.ts"],"sourcesContent":["import {z} from 'zod';\nimport {checkoutTargetValidationIssues} from './checkout-target-validation.js';\nimport {agentThinkingSchema, harnessSchema} from './step-enums.js';\n\nconst stringOrStringArraySchema = z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]);\nconst nonEmptyRecordSchema = <ValueSchema extends z.ZodType>(valueSchema: ValueSchema) =>\n z\n .record(z.string().min(1), valueSchema)\n .refine((value) => Object.keys(value).length > 0, {message: 'Expected at least one entry'});\n\nexport const WORKFLOW_LITERAL_NAME_PATTERN = /^(?:[^$]|\\$\\$\\{\\{|\\$(?!\\{\\{))*$/;\n// The inverse of a literal name: a literal prefix followed by an unescaped\n// `${{`. An enum field that also accepts a template matches one or the other.\nexport const WORKFLOW_INTERPOLATED_VALUE_PATTERN = /^(?:[^$]|\\$\\$\\{\\{|\\$(?!\\{\\{))*\\$\\{\\{/;\n\n// Reasoning effort is an enum so editors can complete it, and a template so a\n// workflow can choose the effort from run context. The resolved value is\n// checked against the harness levels when the step is dispatched.\nexport const agentThinkingFieldSchema = z\n .union([\n agentThinkingSchema,\n z.string().regex(WORKFLOW_INTERPOLATED_VALUE_PATTERN, {\n message:\n 'Agent thinking must be a supported level or a $' +\n '{{ }} interpolation that resolves to one.',\n }),\n ])\n .meta({\n description:\n 'Reasoning effort for an agent step. Supported values depend on the resolved harness. Accepts a $' +\n '{{ }} interpolation. When omitted, Shipfox uses the provider default, or `xhigh` when none is configured.',\n });\n\nconst workflowNameSchema = literalNameSchema(\n 'Workflow name must be literal. Move runtime interpolation to run_name.',\n).meta({description: 'Static literal human-readable workflow name.'});\nconst jobNameSchema = literalNameSchema(\n 'Job name must be literal. Move runtime interpolation to execution_name.',\n).meta({description: 'Static literal human-readable job name.'});\n\nfunction literalNameSchema(message: string) {\n return z.string().min(1).regex(WORKFLOW_LITERAL_NAME_PATTERN, {message});\n}\n\n// Runner shell steps execute on Unix shells, so workflow env names follow the\n// portable POSIX-style variable shape.\nconst envNameSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);\nconst envStringValueSchema = z.string().refine((value) => !value.includes('\\u0000'), {\n message: 'Env string values cannot contain null bytes',\n});\nexport const WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES = 128;\nexport const WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES = 32 * 1024;\nexport const workflowDocumentStepOutputTypes = ['string', 'number', 'boolean', 'json'] as const;\nexport const WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES = WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES =\n WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES;\nexport const WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH = 64;\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\nexport const workflowDocumentAgentStepFields = [\n 'model',\n 'prompt',\n 'harness',\n 'thinking',\n 'provider',\n 'tools',\n 'integrations',\n] as const;\n\n// A step is a run step (`run`), an inline agent step (`prompt`), or a checkout\n// step (`checkout`), never two kinds at once. They share one strict object so\n// an unknown key is still rejected; the `superRefine` discriminates by which\n// payload keys are present and emits one targeted issue per failure mode (a\n// plain union would surface every branch's errors at once). The `agent`\n// keyword is declared only so the reserved-keyword case produces a clear\n// message instead of a generic \"unrecognized key\". 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 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 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","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","workflowDocumentAgentStepFields","workflowDocumentStepBaseSchema","if","name","working_directory","run","model","prompt","harness","thinking","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","max","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;AAE1F,8EAA8E;AAC9E,yEAAyE;AACzE,kEAAkE;AAClE,OAAO,MAAMC,2BAA2BpB,EACrCK,KAAK,CAAC;IACLH;IACAF,EAAEM,MAAM,GAAGe,KAAK,CAACF,qCAAqC;QACpDF,SACE,oDACA;IACJ;CACD,EACAK,IAAI,CAAC;IACJC,aACE,qGACA;AACJ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jE;AAEnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-json-schema.d.ts","sourceRoot":"","sources":["../../src/document/workflow-json-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow-json-schema.d.ts","sourceRoot":"","sources":["../../src/document/workflow-json-schema.ts"],"names":[],"mappings":"AASA,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,MAAM,WAAW,8BAA8B;IAC7C,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,uBAAuB,CAAC,EACtC,EAAuD,GACxD,GAAE,8BAAmC,GAAG,UAAU,CAuDlD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { thinkingLevelsForHarness } from './step-enums.js';
|
|
3
|
-
import { WORKFLOW_LITERAL_NAME_PATTERN, workflowDocumentAgentStepFields, workflowDocumentSchema } from './workflow-document.js';
|
|
3
|
+
import { WORKFLOW_LITERAL_NAME_PATTERN, workflowDocumentAgentStepFields, workflowDocumentSchema, workflowDocumentStepOutputDeclarationSchema } from './workflow-document.js';
|
|
4
4
|
export function buildWorkflowJsonSchema({ id = 'https://www.shipfox.io/docs/workflow.schema.json' } = {}) {
|
|
5
5
|
const schema = z.toJSONSchema(workflowDocumentSchema, {
|
|
6
6
|
io: 'input',
|
|
@@ -14,7 +14,12 @@ export function buildWorkflowJsonSchema({ id = 'https://www.shipfox.io/docs/work
|
|
|
14
14
|
const thinkingBranches = objects(thinkingSchema.anyOf);
|
|
15
15
|
const thinkingEnumBranch = thinkingBranches.find((branch)=>Array.isArray(branch.enum)) ?? {};
|
|
16
16
|
const thinkingTemplateBranches = thinkingBranches.filter((branch)=>!Array.isArray(branch.enum));
|
|
17
|
+
// The reserved step fields (`agent` and the tool step fields) stay out of
|
|
18
|
+
// the editor schema until they are authorable.
|
|
17
19
|
delete stepProperties.agent;
|
|
20
|
+
delete stepProperties.tool;
|
|
21
|
+
delete stepProperties.connection;
|
|
22
|
+
delete stepProperties.with;
|
|
18
23
|
projectWorkflowValidation(schema, stepSchema);
|
|
19
24
|
const thinkingConditionals = [
|
|
20
25
|
'pi',
|
|
@@ -161,6 +166,16 @@ function projectWorkflowValidation(schema, stepSchema) {
|
|
|
161
166
|
'success',
|
|
162
167
|
'on_failure'
|
|
163
168
|
]);
|
|
169
|
+
// The step `outputs` field also accepts the reserved tool-step mapping form;
|
|
170
|
+
// the editor schema keeps describing the declaration form until tool steps
|
|
171
|
+
// are enabled.
|
|
172
|
+
const outputs = object(propertiesOf(stepSchema).outputs);
|
|
173
|
+
outputs.additionalProperties = z.toJSONSchema(workflowDocumentStepOutputDeclarationSchema, {
|
|
174
|
+
io: 'input',
|
|
175
|
+
unrepresentable: 'any'
|
|
176
|
+
});
|
|
177
|
+
const additionalProperties = outputs.additionalProperties;
|
|
178
|
+
delete additionalProperties.$schema;
|
|
164
179
|
}
|
|
165
180
|
function addLiteralNamePattern(schema) {
|
|
166
181
|
if (schema === undefined) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/document/workflow-json-schema.ts"],"sourcesContent":["import {z} from 'zod';\nimport {thinkingLevelsForHarness} from './step-enums.js';\nimport {\n WORKFLOW_LITERAL_NAME_PATTERN,\n workflowDocumentAgentStepFields,\n workflowDocumentSchema,\n} from './workflow-document.js';\n\ntype JsonSchema = Record<string, unknown>;\n\nexport interface BuildWorkflowJsonSchemaOptions {\n id?: string;\n}\n\nexport function buildWorkflowJsonSchema({\n id = 'https://www.shipfox.io/docs/workflow.schema.json',\n}: BuildWorkflowJsonSchemaOptions = {}): JsonSchema {\n const schema = z.toJSONSchema(workflowDocumentSchema, {\n io: 'input',\n unrepresentable: 'any',\n }) as JsonSchema;\n const stepSchema = stepSchemaFor(schema);\n const stepProperties = propertiesOf(stepSchema);\n const thinkingSchema = object(stepProperties.thinking);\n // `thinking` accepts an enum value or a template, so the per-harness branch\n // narrows the enum alternative and keeps the template alternative intact.\n const thinkingBranches = objects(thinkingSchema.anyOf);\n const thinkingEnumBranch = thinkingBranches.find((branch) => Array.isArray(branch.enum)) ?? {};\n const thinkingTemplateBranches = thinkingBranches.filter((branch) => !Array.isArray(branch.enum));\n\n delete stepProperties.agent;\n projectWorkflowValidation(schema, stepSchema);\n const thinkingConditionals = (['pi', 'claude'] as const).map((harness) => {\n const conditional: JsonSchema = {\n if: {\n properties: {\n harness: {\n ...object(stepProperties.harness),\n const: harness,\n },\n },\n required: ['harness'],\n },\n };\n // biome-ignore lint/suspicious/noThenProperty: JSON Schema uses \"then\" for a conditional branch.\n conditional.then = {\n properties: {\n thinking: {\n ...(typeof thinkingSchema.description === 'string'\n ? {description: thinkingSchema.description}\n : {}),\n anyOf: [\n {...thinkingEnumBranch, enum: [...thinkingLevelsForHarness(harness)]},\n ...thinkingTemplateBranches,\n ],\n },\n },\n };\n return conditional;\n });\n stepSchema.allOf = [...objects(stepSchema.allOf), ...thinkingConditionals];\n schema.$schema = 'https://json-schema.org/draft/2020-12/schema';\n schema.$id = id;\n schema.title = 'Shipfox Workflow';\n\n return schema;\n}\n\nfunction projectWorkflowValidation(schema: JsonSchema, stepSchema: JsonSchema) {\n const rootProperties = propertiesOf(schema);\n const jobs = object(rootProperties.jobs);\n const triggers = object(rootProperties.triggers);\n addLiteralNamePattern(rootProperties.name);\n jobs.minProperties = 1;\n triggers.minProperties = 1;\n\n stepSchema.allOf = [\n ...objects(stepSchema.allOf),\n {\n oneOf: [\n {\n required: ['run'],\n not: {\n anyOf: [\n ...workflowDocumentAgentStepFields.map((field) => ({required: [field]})),\n {required: ['checkout']},\n ],\n },\n },\n {\n required: ['prompt'],\n not: {anyOf: [{required: ['run']}, {required: ['checkout']}, {required: ['env']}]},\n },\n {\n required: ['checkout'],\n not: {\n anyOf: [\n {required: ['run']},\n ...workflowDocumentAgentStepFields.map((field) => ({required: [field]})),\n {required: ['env']},\n ],\n },\n },\n ],\n },\n ];\n\n const job = object(jobs.additionalProperties);\n addLiteralNamePattern(propertiesOf(job).name);\n projectCheckoutTargetValidation(propertiesOf(stepSchema).checkout);\n const jobOutputs = object(propertiesOf(job).outputs);\n jobOutputs.minProperties = 1;\n const listening = object(propertiesOf(job).listening);\n const batch = object(propertiesOf(listening).batch);\n addAtLeastOneConstraint(batch, ['debounce', 'max_size', 'max_wait']);\n\n const gate = object(propertiesOf(stepSchema).gate);\n addAtLeastOneConstraint(gate, ['success', 'on_failure']);\n}\n\nfunction addLiteralNamePattern(schema: JsonSchema | undefined) {\n if (schema === undefined) return;\n schema.pattern = WORKFLOW_LITERAL_NAME_PATTERN.source;\n}\n\nfunction projectCheckoutTargetValidation(schema: JsonSchema | undefined) {\n const checkout = objectSchemaFor(schema);\n if (Object.keys(checkout).length === 0) return;\n\n checkout.allOf = [\n ...objects(checkout.allOf),\n {\n not: {\n allOf: [\n {required: ['project']},\n {anyOf: [{required: ['connection']}, {required: ['repository']}]},\n ],\n },\n },\n (() => {\n const conditional: JsonSchema = {if: {required: ['connection']}};\n // biome-ignore lint/suspicious/noThenProperty: JSON Schema uses \"then\" for a conditional branch.\n conditional.then = {required: ['repository']};\n return conditional;\n })(),\n ];\n}\n\nfunction addAtLeastOneConstraint(schema: JsonSchema, fields: string[]) {\n schema.allOf = [...objects(schema.allOf), {anyOf: fields.map((field) => ({required: [field]}))}];\n}\n\nfunction stepSchemaFor(schema: JsonSchema): JsonSchema {\n const jobs = object(propertiesOf(schema).jobs);\n const job = object(jobs.additionalProperties);\n const steps = object(propertiesOf(job).steps);\n return object(steps.items);\n}\n\nfunction propertiesOf(schema: JsonSchema): Record<string, JsonSchema> {\n const properties = object(schema.properties);\n schema.properties = properties;\n return properties as Record<string, JsonSchema>;\n}\n\nfunction object(value: unknown): JsonSchema {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as JsonSchema)\n : {};\n}\n\nfunction objectSchemaFor(value: unknown): JsonSchema {\n const schema = object(value);\n if (schema.type === 'object' || schema.properties) return schema;\n return (\n objects(schema.anyOf).find((option) => option.type === 'object' || option.properties) ?? {}\n );\n}\n\nfunction objects(value: unknown): JsonSchema[] {\n return Array.isArray(value)\n ? value.filter(\n (item): item is JsonSchema =>\n typeof item === 'object' && item !== null && !Array.isArray(item),\n )\n : [];\n}\n"],"names":["z","thinkingLevelsForHarness","WORKFLOW_LITERAL_NAME_PATTERN","workflowDocumentAgentStepFields","workflowDocumentSchema","buildWorkflowJsonSchema","id","schema","toJSONSchema","io","unrepresentable","stepSchema","stepSchemaFor","stepProperties","propertiesOf","thinkingSchema","object","thinking","thinkingBranches","objects","anyOf","thinkingEnumBranch","find","branch","Array","isArray","enum","thinkingTemplateBranches","filter","agent","projectWorkflowValidation","thinkingConditionals","map","harness","conditional","if","properties","const","required","then","description","allOf","$schema","$id","title","rootProperties","jobs","triggers","addLiteralNamePattern","name","minProperties","oneOf","not","field","job","additionalProperties","projectCheckoutTargetValidation","checkout","jobOutputs","outputs","listening","batch","addAtLeastOneConstraint","gate","undefined","pattern","source","objectSchemaFor","Object","keys","length","fields","steps","items","value","type","option","item"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,wBAAwB,QAAO,kBAAkB;AACzD,SACEC,6BAA6B,EAC7BC,+BAA+B,EAC/BC,sBAAsB,QACjB,yBAAyB;AAQhC,OAAO,SAASC,wBAAwB,EACtCC,KAAK,kDAAkD,EACxB,GAAG,CAAC,CAAC;IACpC,MAAMC,SAASP,EAAEQ,YAAY,CAACJ,wBAAwB;QACpDK,IAAI;QACJC,iBAAiB;IACnB;IACA,MAAMC,aAAaC,cAAcL;IACjC,MAAMM,iBAAiBC,aAAaH;IACpC,MAAMI,iBAAiBC,OAAOH,eAAeI,QAAQ;IACrD,4EAA4E;IAC5E,0EAA0E;IAC1E,MAAMC,mBAAmBC,QAAQJ,eAAeK,KAAK;IACrD,MAAMC,qBAAqBH,iBAAiBI,IAAI,CAAC,CAACC,SAAWC,MAAMC,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AAc;IAC5B,OAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAAClD,MAAMC,OAAO,CAACiD,SAChEA,QACD,CAAC;AACP;AAEA,SAASP,gBAAgBO,KAAc;IACrC,MAAMnE,SAASS,OAAO0D;IACtB,IAAInE,OAAOoE,IAAI,KAAK,YAAYpE,OAAO6B,UAAU,EAAE,OAAO7B;IAC1D,OACEY,QAAQZ,OAAOa,KAAK,EAAEE,IAAI,CAAC,CAACsD,SAAWA,OAAOD,IAAI,KAAK,YAAYC,OAAOxC,UAAU,KAAK,CAAC;AAE9F;AAEA,SAASjB,QAAQuD,KAAc;IAC7B,OAAOlD,MAAMC,OAAO,CAACiD,SACjBA,MAAM9C,MAAM,CACV,CAACiD,OACC,OAAOA,SAAS,YAAYA,SAAS,QAAQ,CAACrD,MAAMC,OAAO,CAACoD,SAEhE,EAAE;AACR"}
|
|
1
|
+
{"version":3,"sources":["../../src/document/workflow-json-schema.ts"],"sourcesContent":["import {z} from 'zod';\nimport {thinkingLevelsForHarness} from './step-enums.js';\nimport {\n WORKFLOW_LITERAL_NAME_PATTERN,\n workflowDocumentAgentStepFields,\n workflowDocumentSchema,\n workflowDocumentStepOutputDeclarationSchema,\n} from './workflow-document.js';\n\ntype JsonSchema = Record<string, unknown>;\n\nexport interface BuildWorkflowJsonSchemaOptions {\n id?: string;\n}\n\nexport function buildWorkflowJsonSchema({\n id = 'https://www.shipfox.io/docs/workflow.schema.json',\n}: BuildWorkflowJsonSchemaOptions = {}): JsonSchema {\n const schema = z.toJSONSchema(workflowDocumentSchema, {\n io: 'input',\n unrepresentable: 'any',\n }) as JsonSchema;\n const stepSchema = stepSchemaFor(schema);\n const stepProperties = propertiesOf(stepSchema);\n const thinkingSchema = object(stepProperties.thinking);\n // `thinking` accepts an enum value or a template, so the per-harness branch\n // narrows the enum alternative and keeps the template alternative intact.\n const thinkingBranches = objects(thinkingSchema.anyOf);\n const thinkingEnumBranch = thinkingBranches.find((branch) => Array.isArray(branch.enum)) ?? {};\n const thinkingTemplateBranches = thinkingBranches.filter((branch) => !Array.isArray(branch.enum));\n\n // The reserved step fields (`agent` and the tool step fields) stay out of\n // the editor schema until they are authorable.\n delete stepProperties.agent;\n delete stepProperties.tool;\n delete stepProperties.connection;\n delete stepProperties.with;\n projectWorkflowValidation(schema, stepSchema);\n const thinkingConditionals = (['pi', 'claude'] as const).map((harness) => {\n const conditional: JsonSchema = {\n if: {\n properties: {\n harness: {\n ...object(stepProperties.harness),\n const: harness,\n },\n },\n required: ['harness'],\n },\n };\n // biome-ignore lint/suspicious/noThenProperty: JSON Schema uses \"then\" for a conditional branch.\n conditional.then = {\n properties: {\n thinking: {\n ...(typeof thinkingSchema.description === 'string'\n ? {description: thinkingSchema.description}\n : {}),\n anyOf: [\n {...thinkingEnumBranch, enum: [...thinkingLevelsForHarness(harness)]},\n ...thinkingTemplateBranches,\n ],\n },\n },\n };\n return conditional;\n });\n stepSchema.allOf = [...objects(stepSchema.allOf), ...thinkingConditionals];\n schema.$schema = 'https://json-schema.org/draft/2020-12/schema';\n schema.$id = id;\n schema.title = 'Shipfox Workflow';\n\n return schema;\n}\n\nfunction projectWorkflowValidation(schema: JsonSchema, stepSchema: JsonSchema) {\n const rootProperties = propertiesOf(schema);\n const jobs = object(rootProperties.jobs);\n const triggers = object(rootProperties.triggers);\n addLiteralNamePattern(rootProperties.name);\n jobs.minProperties = 1;\n triggers.minProperties = 1;\n\n stepSchema.allOf = [\n ...objects(stepSchema.allOf),\n {\n oneOf: [\n {\n required: ['run'],\n not: {\n anyOf: [\n ...workflowDocumentAgentStepFields.map((field) => ({required: [field]})),\n {required: ['checkout']},\n ],\n },\n },\n {\n required: ['prompt'],\n not: {anyOf: [{required: ['run']}, {required: ['checkout']}, {required: ['env']}]},\n },\n {\n required: ['checkout'],\n not: {\n anyOf: [\n {required: ['run']},\n ...workflowDocumentAgentStepFields.map((field) => ({required: [field]})),\n {required: ['env']},\n ],\n },\n },\n ],\n },\n ];\n\n const job = object(jobs.additionalProperties);\n addLiteralNamePattern(propertiesOf(job).name);\n projectCheckoutTargetValidation(propertiesOf(stepSchema).checkout);\n const jobOutputs = object(propertiesOf(job).outputs);\n jobOutputs.minProperties = 1;\n const listening = object(propertiesOf(job).listening);\n const batch = object(propertiesOf(listening).batch);\n addAtLeastOneConstraint(batch, ['debounce', 'max_size', 'max_wait']);\n\n const gate = object(propertiesOf(stepSchema).gate);\n addAtLeastOneConstraint(gate, ['success', 'on_failure']);\n\n // The step `outputs` field also accepts the reserved tool-step mapping form;\n // the editor schema keeps describing the declaration form until tool steps\n // are enabled.\n const outputs = object(propertiesOf(stepSchema).outputs);\n outputs.additionalProperties = z.toJSONSchema(workflowDocumentStepOutputDeclarationSchema, {\n io: 'input',\n unrepresentable: 'any',\n });\n const additionalProperties = outputs.additionalProperties as JsonSchema;\n delete additionalProperties.$schema;\n}\n\nfunction addLiteralNamePattern(schema: JsonSchema | undefined) {\n if (schema === undefined) return;\n schema.pattern = WORKFLOW_LITERAL_NAME_PATTERN.source;\n}\n\nfunction projectCheckoutTargetValidation(schema: JsonSchema | undefined) {\n const checkout = objectSchemaFor(schema);\n if (Object.keys(checkout).length === 0) return;\n\n checkout.allOf = [\n ...objects(checkout.allOf),\n {\n not: {\n allOf: [\n {required: ['project']},\n {anyOf: [{required: ['connection']}, {required: ['repository']}]},\n ],\n },\n },\n (() => {\n const conditional: JsonSchema = {if: {required: ['connection']}};\n // biome-ignore lint/suspicious/noThenProperty: JSON Schema uses \"then\" for a conditional branch.\n conditional.then = {required: ['repository']};\n return conditional;\n })(),\n ];\n}\n\nfunction addAtLeastOneConstraint(schema: JsonSchema, fields: string[]) {\n schema.allOf = [...objects(schema.allOf), {anyOf: fields.map((field) => ({required: [field]}))}];\n}\n\nfunction stepSchemaFor(schema: JsonSchema): JsonSchema {\n const jobs = object(propertiesOf(schema).jobs);\n const job = object(jobs.additionalProperties);\n const steps = object(propertiesOf(job).steps);\n return object(steps.items);\n}\n\nfunction propertiesOf(schema: JsonSchema): Record<string, JsonSchema> {\n const properties = object(schema.properties);\n schema.properties = properties;\n return properties as Record<string, JsonSchema>;\n}\n\nfunction object(value: unknown): JsonSchema {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as JsonSchema)\n : {};\n}\n\nfunction objectSchemaFor(value: unknown): JsonSchema {\n const schema = object(value);\n if (schema.type === 'object' || schema.properties) return schema;\n return (\n objects(schema.anyOf).find((option) => option.type === 'object' || option.properties) ?? {}\n );\n}\n\nfunction objects(value: unknown): JsonSchema[] {\n return Array.isArray(value)\n ? value.filter(\n (item): item is JsonSchema =>\n typeof item === 'object' && item !== null && !Array.isArray(item),\n )\n : [];\n}\n"],"names":["z","thinkingLevelsForHarness","WORKFLOW_LITERAL_NAME_PATTERN","workflowDocumentAgentStepFields","workflowDocumentSchema","workflowDocumentStepOutputDeclarationSchema","buildWorkflowJsonSchema","id","schema","toJSONSchema","io","unrepresentable","stepSchema","stepSchemaFor","stepProperties","propertiesOf","thinkingSchema","object","thinking","thinkingBranches","objects","anyOf","thinkingEnumBranch","find","branch","Array","isArray","enum","thinkingTemplateBranches","filter","agent","tool","connection","with","projectWorkflowValidation","thinkingConditionals","map","harness","conditional","if","properties","const","required","then","description","allOf","$schema","$id","title","rootProperties","jobs","triggers","addLiteralNamePattern","name","minProperties","oneOf","not","field","job","additionalProperties","projectCheckoutTargetValidation","checkout","jobOutputs","outputs","listening","batch","addAtLeastOneConstraint","gate","undefined","pattern","source","objectSchemaFor","Object","keys","length","fields","steps","items","value","type","option","item"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,wBAAwB,QAAO,kBAAkB;AACzD,SACEC,6BAA6B,EAC7BC,+BAA+B,EAC/BC,sBAAsB,EACtBC,2CAA2C,QACtC,yBAAyB;AAQhC,OAAO,SAASC,wBAAwB,EACtCC,KAAK,kDAAkD,EACxB,GAAG,CAAC,CAAC;IACpC,MAAMC,SAASR,EAAES,YAAY,CAACL,wBAAwB;QACpDM,IA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+1,2 @@
|
|
|
1
|
-
export { type AgentThinking, agentThinkingByHarness, agentThinkingSchema, type BuildWorkflowJsonSchemaOptions, buildWorkflowJsonSchema, type CheckoutTargetValidationIssue, checkoutTargetValidationIssues, claudeAgentThinkingSchema, DEFAULT_AGENT_THINKING, DEFAULT_HARNESS, DEFAULT_MODEL_PROVIDER, type Harness, harnessSchema, InvalidWorkflowDocumentError, invalidWorkflowDocumentErrorCode, parseWorkflowDocument, piAgentThinkingSchema, thinkingLevelsForHarness, triggerSourceConfigSchemas, WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES, WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES, type WorkflowDocument, type WorkflowDocumentCheckout, type WorkflowDocumentEnv, type WorkflowDocumentJob, type WorkflowDocumentJobCheckout, type WorkflowDocumentRunStepGate, type WorkflowDocumentStep, type WorkflowDocumentStepIntegration, type WorkflowDocumentStepOutputs, type WorkflowDocumentStepOutputType, type WorkflowDocumentTrigger, workflowDocumentEnvSchema, workflowDocumentSchema, workflowDocumentStepIntegrationSchema, workflowDocumentStepIntegrationSelectionSchema, workflowDocumentStepOutputsSchema, workflowDocumentStepOutputTypes, workflowDocumentStepSchema, } from '#document/index.js';
|
|
1
|
+
export { type AgentThinking, agentThinkingByHarness, agentThinkingSchema, type BuildWorkflowJsonSchemaOptions, buildWorkflowJsonSchema, type CheckoutTargetValidationIssue, checkoutTargetValidationIssues, claudeAgentThinkingSchema, DEFAULT_AGENT_THINKING, DEFAULT_HARNESS, DEFAULT_MODEL_PROVIDER, type Harness, harnessSchema, InvalidWorkflowDocumentError, invalidWorkflowDocumentErrorCode, parseWorkflowDocument, piAgentThinkingSchema, thinkingLevelsForHarness, triggerSourceConfigSchemas, WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES, WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES, WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH, WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES, type WorkflowDocument, type WorkflowDocumentCheckout, type WorkflowDocumentEnv, type WorkflowDocumentJob, type WorkflowDocumentJobCheckout, type WorkflowDocumentRunStepGate, type WorkflowDocumentStep, type WorkflowDocumentStepIntegration, type WorkflowDocumentStepOutputs, type WorkflowDocumentStepOutputType, type WorkflowDocumentToolStepOutputs, type WorkflowDocumentToolWith, type WorkflowDocumentTrigger, workflowDocumentEnvSchema, workflowDocumentSchema, workflowDocumentStepIntegrationSchema, workflowDocumentStepIntegrationSelectionSchema, workflowDocumentStepOutputsSchema, workflowDocumentStepOutputTypes, workflowDocumentStepSchema, workflowDocumentToolStepOutputsSchema, workflowDocumentToolStepWithSchema, } from '#document/index.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,8BAA8B,EACnC,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,8BAA8B,EAC9B,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,KAAK,OAAO,EACZ,aAAa,EACb,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,0CAA0C,EAC1C,yCAAyC,EACzC,8CAA8C,EAC9C,yDAAyD,EACzD,0CAA0C,EAC1C,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,qCAAqC,EACrC,8CAA8C,EAC9C,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,8BAA8B,EACnC,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,8BAA8B,EAC9B,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,KAAK,OAAO,EACZ,aAAa,EACb,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,0CAA0C,EAC1C,yCAAyC,EACzC,8CAA8C,EAC9C,yDAAyD,EACzD,0CAA0C,EAC1C,qCAAqC,EACrC,gDAAgD,EAChD,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,qCAAqC,EACrC,8CAA8C,EAC9C,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,qCAAqC,EACrC,kCAAkC,GACnC,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { agentThinkingByHarness, agentThinkingSchema, buildWorkflowJsonSchema, checkoutTargetValidationIssues, claudeAgentThinkingSchema, DEFAULT_AGENT_THINKING, DEFAULT_HARNESS, DEFAULT_MODEL_PROVIDER, harnessSchema, InvalidWorkflowDocumentError, invalidWorkflowDocumentErrorCode, parseWorkflowDocument, piAgentThinkingSchema, thinkingLevelsForHarness, triggerSourceConfigSchemas, WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES, WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES, workflowDocumentEnvSchema, workflowDocumentSchema, workflowDocumentStepIntegrationSchema, workflowDocumentStepIntegrationSelectionSchema, workflowDocumentStepOutputsSchema, workflowDocumentStepOutputTypes, workflowDocumentStepSchema } from '#document/index.js';
|
|
1
|
+
export { agentThinkingByHarness, agentThinkingSchema, buildWorkflowJsonSchema, checkoutTargetValidationIssues, claudeAgentThinkingSchema, DEFAULT_AGENT_THINKING, DEFAULT_HARNESS, DEFAULT_MODEL_PROVIDER, harnessSchema, InvalidWorkflowDocumentError, invalidWorkflowDocumentErrorCode, parseWorkflowDocument, piAgentThinkingSchema, thinkingLevelsForHarness, triggerSourceConfigSchemas, WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES, WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH, WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES, WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES, WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH, WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES, workflowDocumentEnvSchema, workflowDocumentSchema, workflowDocumentStepIntegrationSchema, workflowDocumentStepIntegrationSelectionSchema, workflowDocumentStepOutputsSchema, workflowDocumentStepOutputTypes, workflowDocumentStepSchema, workflowDocumentToolStepOutputsSchema, workflowDocumentToolStepWithSchema } from '#document/index.js';
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type AgentThinking,\n agentThinkingByHarness,\n agentThinkingSchema,\n type BuildWorkflowJsonSchemaOptions,\n buildWorkflowJsonSchema,\n type CheckoutTargetValidationIssue,\n checkoutTargetValidationIssues,\n claudeAgentThinkingSchema,\n DEFAULT_AGENT_THINKING,\n DEFAULT_HARNESS,\n DEFAULT_MODEL_PROVIDER,\n type Harness,\n harnessSchema,\n InvalidWorkflowDocumentError,\n invalidWorkflowDocumentErrorCode,\n parseWorkflowDocument,\n piAgentThinkingSchema,\n thinkingLevelsForHarness,\n triggerSourceConfigSchemas,\n WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES,\n WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES,\n WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES,\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH,\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES,\n WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES,\n type WorkflowDocument,\n type WorkflowDocumentCheckout,\n type WorkflowDocumentEnv,\n type WorkflowDocumentJob,\n type WorkflowDocumentJobCheckout,\n type WorkflowDocumentRunStepGate,\n type WorkflowDocumentStep,\n type WorkflowDocumentStepIntegration,\n type WorkflowDocumentStepOutputs,\n type WorkflowDocumentStepOutputType,\n type WorkflowDocumentTrigger,\n workflowDocumentEnvSchema,\n workflowDocumentSchema,\n workflowDocumentStepIntegrationSchema,\n workflowDocumentStepIntegrationSelectionSchema,\n workflowDocumentStepOutputsSchema,\n workflowDocumentStepOutputTypes,\n workflowDocumentStepSchema,\n} from '#document/index.js';\n"],"names":["agentThinkingByHarness","agentThinkingSchema","buildWorkflowJsonSchema","checkoutTargetValidationIssues","claudeAgentThinkingSchema","DEFAULT_AGENT_THINKING","DEFAULT_HARNESS","DEFAULT_MODEL_PROVIDER","harnessSchema","InvalidWorkflowDocumentError","invalidWorkflowDocumentErrorCode","parseWorkflowDocument","piAgentThinkingSchema","thinkingLevelsForHarness","triggerSourceConfigSchemas","WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES","WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES","workflowDocumentEnvSchema","workflowDocumentSchema","workflowDocumentStepIntegrationSchema","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepOutputsSchema","workflowDocumentStepOutputTypes","workflowDocumentStepSchema"],"mappings":"AAAA,SAEEA,sBAAsB,EACtBC,mBAAmB,EAEnBC,uBAAuB,EAEvBC,8BAA8B,EAC9BC,yBAAyB,EACzBC,sBAAsB,EACtBC,eAAe,EACfC,sBAAsB,EAEtBC,aAAa,EACbC,4BAA4B,EAC5BC,gCAAgC,EAChCC,qBAAqB,EACrBC,qBAAqB,EACrBC,wBAAwB,EACxBC,0BAA0B,EAC1BC,iCAAiC,EACjCC,0CAA0C,EAC1CC,yCAAyC,EACzCC,8CAA8C,EAC9CC,yDAAyD,EACzDC,0CAA0C,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type AgentThinking,\n agentThinkingByHarness,\n agentThinkingSchema,\n type BuildWorkflowJsonSchemaOptions,\n buildWorkflowJsonSchema,\n type CheckoutTargetValidationIssue,\n checkoutTargetValidationIssues,\n claudeAgentThinkingSchema,\n DEFAULT_AGENT_THINKING,\n DEFAULT_HARNESS,\n DEFAULT_MODEL_PROVIDER,\n type Harness,\n harnessSchema,\n InvalidWorkflowDocumentError,\n invalidWorkflowDocumentErrorCode,\n parseWorkflowDocument,\n piAgentThinkingSchema,\n thinkingLevelsForHarness,\n triggerSourceConfigSchemas,\n WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES,\n WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES,\n WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES,\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH,\n WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES,\n WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES,\n WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH,\n WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES,\n type WorkflowDocument,\n type WorkflowDocumentCheckout,\n type WorkflowDocumentEnv,\n type WorkflowDocumentJob,\n type WorkflowDocumentJobCheckout,\n type WorkflowDocumentRunStepGate,\n type WorkflowDocumentStep,\n type WorkflowDocumentStepIntegration,\n type WorkflowDocumentStepOutputs,\n type WorkflowDocumentStepOutputType,\n type WorkflowDocumentToolStepOutputs,\n type WorkflowDocumentToolWith,\n type WorkflowDocumentTrigger,\n workflowDocumentEnvSchema,\n workflowDocumentSchema,\n workflowDocumentStepIntegrationSchema,\n workflowDocumentStepIntegrationSelectionSchema,\n workflowDocumentStepOutputsSchema,\n workflowDocumentStepOutputTypes,\n workflowDocumentStepSchema,\n workflowDocumentToolStepOutputsSchema,\n workflowDocumentToolStepWithSchema,\n} from '#document/index.js';\n"],"names":["agentThinkingByHarness","agentThinkingSchema","buildWorkflowJsonSchema","checkoutTargetValidationIssues","claudeAgentThinkingSchema","DEFAULT_AGENT_THINKING","DEFAULT_HARNESS","DEFAULT_MODEL_PROVIDER","harnessSchema","InvalidWorkflowDocumentError","invalidWorkflowDocumentErrorCode","parseWorkflowDocument","piAgentThinkingSchema","thinkingLevelsForHarness","triggerSourceConfigSchemas","WORKFLOW_DOCUMENT_ENV_MAX_ENTRIES","WORKFLOW_DOCUMENT_ENV_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_JOB_OUTPUTS_MAX_ENTRIES","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_DEPTH","WORKFLOW_DOCUMENT_STEP_OUTPUT_SCHEMA_MAX_SERIALIZED_BYTES","WORKFLOW_DOCUMENT_STEP_OUTPUTS_MAX_ENTRIES","WORKFLOW_DOCUMENT_TOOL_WITH_MAX_DEPTH","WORKFLOW_DOCUMENT_TOOL_WITH_MAX_SERIALIZED_BYTES","workflowDocumentEnvSchema","workflowDocumentSchema","workflowDocumentStepIntegrationSchema","workflowDocumentStepIntegrationSelectionSchema","workflowDocumentStepOutputsSchema","workflowDocumentStepOutputTypes","workflowDocumentStepSchema","workflowDocumentToolStepOutputsSchema","workflowDocumentToolStepWithSchema"],"mappings":"AAAA,SAEEA,sBAAsB,EACtBC,mBAAmB,EAEnBC,uBAAuB,EAEvBC,8BAA8B,EAC9BC,yBAAyB,EACzBC,sBAAsB,EACtBC,eAAe,EACfC,sBAAsB,EAEtBC,aAAa,EACbC,4BAA4B,EAC5BC,gCAAgC,EAChCC,qBAAqB,EACrBC,qBAAqB,EACrBC,wBAAwB,EACxBC,0BAA0B,EAC1BC,iCAAiC,EACjCC,0CAA0C,EAC1CC,yCAAyC,EACzCC,8CAA8C,EAC9CC,yDAAyD,EACzDC,0CAA0C,EAC1CC,qCAAqC,EACrCC,gDAAgD,EAchDC,yBAAyB,EACzBC,sBAAsB,EACtBC,qCAAqC,EACrCC,8CAA8C,EAC9CC,iCAAiC,EACjCC,+BAA+B,EAC/BC,0BAA0B,EAC1BC,qCAAqC,EACrCC,kCAAkC,QAC7B,qBAAqB"}
|