import type { WorkflowRunInspectionOptions } from "@automatalabs/workflows"; import { z } from "zod"; declare const permissionResponseSchema: z.ZodObject<{ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{ outcome: z.ZodLiteral<"cancelled">; }, z.core.$strict>, z.ZodObject<{ outcome: z.ZodLiteral<"selected">; optionId: z.ZodString; }, z.core.$strict>], "outcome">; }, z.core.$strict>; export declare const WORKFLOW_RESULT_CHUNK_BYTES_DEFAULT = 16384; export declare const WORKFLOW_RESULT_CHUNK_BYTES_MAX = 16384; export declare const WORKFLOW_RESULT_CHUNK_BYTES_MIN = 4; declare const setupResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ action: z.ZodLiteral<"accept">; content: z.ZodRecord; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"decline">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"cancel">; }, z.core.$strict>], "action">; /** * Public field catalog: one validator per tool field. Every field except `action` is published as * an optional property of the flat workflowToolInputSchema; which fields an action accepts is * enforced by that schema, not by this catalog. */ export declare const workflowToolInputShape: { readonly action: z.ZodEnum<{ resume: "resume"; result: "result"; status: "status"; config: "config"; run: "run"; pause: "pause"; stop: "stop"; "setup-response": "setup-response"; "permissions-response": "permissions-response"; }>; readonly script: z.ZodString; readonly scriptPath: z.ZodString; readonly projectDir: z.ZodString; readonly harnesses: z.ZodArray; readonly modelSpecs: z.ZodArray; readonly modelFilter: z.ZodString; readonly args: z.ZodUnknown; readonly maxAgents: z.ZodNumber; readonly concurrency: z.ZodNumber; readonly agentRetries: z.ZodNumber; readonly checkpointReplies: z.ZodRecord; readonly setupId: z.ZodString; readonly runId: z.ZodString; readonly permissionId: z.ZodString; readonly response: z.ZodUnion; content: z.ZodRecord; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"decline">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"cancel">; }, z.core.$strict>], "action">, z.ZodObject<{ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{ outcome: z.ZodLiteral<"cancelled">; }, z.core.$strict>, z.ZodObject<{ outcome: z.ZodLiteral<"selected">; optionId: z.ZodString; }, z.core.$strict>], "outcome">; }, z.core.$strict>]>; readonly callIndex: z.ZodNumber; readonly forceOwner: z.ZodBoolean; readonly lastN: z.ZodNumber; readonly labelGlob: z.ZodString; readonly logLines: z.ZodNumber; readonly offset: z.ZodNumber; readonly maxBytes: z.ZodNumber; }; /** The canonical action branches; run and stop contain structural sub-variants. */ export declare const workflowToolInputBranches: { readonly config: z.ZodObject<{ action: z.ZodLiteral<"config">; projectDir: z.ZodOptional; harnesses: z.ZodOptional>; modelSpecs: z.ZodOptional>; modelFilter: z.ZodOptional; }, z.core.$strict>; readonly run: z.ZodXor; args: z.ZodOptional; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; action: z.ZodLiteral<"run">; script: z.ZodString; }, z.core.$strict>, z.ZodObject<{ projectDir: z.ZodOptional; args: z.ZodOptional; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; action: z.ZodLiteral<"run">; scriptPath: z.ZodString; }, z.core.$strict>]>; readonly resume: z.ZodObject<{ action: z.ZodLiteral<"resume">; runId: z.ZodString; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; checkpointReplies: z.ZodOptional>; }, z.core.$strict>; readonly "setup-response": z.ZodObject<{ action: z.ZodLiteral<"setup-response">; runId: z.ZodString; setupId: z.ZodString; response: z.ZodDiscriminatedUnion<[z.ZodObject<{ action: z.ZodLiteral<"accept">; content: z.ZodRecord; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"decline">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"cancel">; }, z.core.$strict>], "action">; }, z.core.$strict>; readonly status: z.ZodObject<{ runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"status">; }, z.core.$strict>; readonly result: z.ZodObject<{ action: z.ZodLiteral<"result">; runId: z.ZodString; offset: z.ZodOptional; maxBytes: z.ZodOptional; }, z.core.$strict>; readonly "permissions-response": z.ZodObject<{ action: z.ZodLiteral<"permissions-response">; runId: z.ZodString; permissionId: z.ZodString; response: z.ZodObject<{ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{ outcome: z.ZodLiteral<"cancelled">; }, z.core.$strict>, z.ZodObject<{ outcome: z.ZodLiteral<"selected">; optionId: z.ZodString; }, z.core.$strict>], "outcome">; }, z.core.$strict>; }, z.core.$strict>; readonly stop: z.ZodXor; runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"stop">; }, z.core.$strict>, z.ZodObject<{ callIndex: z.ZodNumber; runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"stop">; }, z.core.$strict>]>; readonly pause: z.ZodObject<{ runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"pause">; }, z.core.$strict>; }; /** * The strict per-action union. Runtime-only: it is the typed narrowing step behind * workflowToolInputSchema and is never published, because its JSON Schema is a top-level oneOf. */ export declare const workflowToolCanonicalInputSchema: z.ZodXor; projectDir: z.ZodOptional; harnesses: z.ZodOptional>; modelSpecs: z.ZodOptional>; modelFilter: z.ZodOptional; }, z.core.$strict>, z.ZodXor; args: z.ZodOptional; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; action: z.ZodLiteral<"run">; script: z.ZodString; }, z.core.$strict>, z.ZodObject<{ projectDir: z.ZodOptional; args: z.ZodOptional; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; action: z.ZodLiteral<"run">; scriptPath: z.ZodString; }, z.core.$strict>]>, z.ZodObject<{ action: z.ZodLiteral<"resume">; runId: z.ZodString; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; checkpointReplies: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"setup-response">; runId: z.ZodString; setupId: z.ZodString; response: z.ZodDiscriminatedUnion<[z.ZodObject<{ action: z.ZodLiteral<"accept">; content: z.ZodRecord; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"decline">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"cancel">; }, z.core.$strict>], "action">; }, z.core.$strict>, z.ZodObject<{ runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"status">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"result">; runId: z.ZodString; offset: z.ZodOptional; maxBytes: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"permissions-response">; runId: z.ZodString; permissionId: z.ZodString; response: z.ZodObject<{ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{ outcome: z.ZodLiteral<"cancelled">; }, z.core.$strict>, z.ZodObject<{ outcome: z.ZodLiteral<"selected">; optionId: z.ZodString; }, z.core.$strict>], "outcome">; }, z.core.$strict>; }, z.core.$strict>, z.ZodXor; runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"stop">; }, z.core.$strict>, z.ZodObject<{ callIndex: z.ZodNumber; runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"stop">; }, z.core.$strict>]>, z.ZodObject<{ runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"pause">; }, z.core.$strict>]>; /** * The published and runtime tool schema. Its JSON Schema (the pipe's input side) is one flat * strict object; validation additionally enforces each action's field rules and then narrows the * input through the strict per-action union to the WorkflowToolInput shapes. */ export declare const workflowToolInputSchema: z.ZodPipe; concurrency: z.ZodOptional; runId: z.ZodOptional; callIndex: z.ZodOptional; projectDir: z.ZodOptional; lastN: z.ZodOptional; logLines: z.ZodOptional; labelGlob: z.ZodOptional; maxAgents: z.ZodOptional; script: z.ZodOptional; checkpointReplies: z.ZodOptional>; args: z.ZodOptional; response: z.ZodOptional; content: z.ZodRecord; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"decline">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"cancel">; }, z.core.$strict>], "action">, z.ZodObject<{ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{ outcome: z.ZodLiteral<"cancelled">; }, z.core.$strict>, z.ZodObject<{ outcome: z.ZodLiteral<"selected">; optionId: z.ZodString; }, z.core.$strict>], "outcome">; }, z.core.$strict>]>>; harnesses: z.ZodOptional>; modelSpecs: z.ZodOptional>; scriptPath: z.ZodOptional; modelFilter: z.ZodOptional; setupId: z.ZodOptional; permissionId: z.ZodOptional; forceOwner: z.ZodOptional; offset: z.ZodOptional; maxBytes: z.ZodOptional; action: z.ZodEnum<{ resume: "resume"; result: "result"; status: "status"; config: "config"; run: "run"; pause: "pause"; stop: "stop"; "setup-response": "setup-response"; "permissions-response": "permissions-response"; }>; }, z.core.$strict>, z.ZodXor; projectDir: z.ZodOptional; harnesses: z.ZodOptional>; modelSpecs: z.ZodOptional>; modelFilter: z.ZodOptional; }, z.core.$strict>, z.ZodXor; args: z.ZodOptional; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; action: z.ZodLiteral<"run">; script: z.ZodString; }, z.core.$strict>, z.ZodObject<{ projectDir: z.ZodOptional; args: z.ZodOptional; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; action: z.ZodLiteral<"run">; scriptPath: z.ZodString; }, z.core.$strict>]>, z.ZodObject<{ action: z.ZodLiteral<"resume">; runId: z.ZodString; maxAgents: z.ZodOptional; concurrency: z.ZodOptional; agentRetries: z.ZodOptional; checkpointReplies: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"setup-response">; runId: z.ZodString; setupId: z.ZodString; response: z.ZodDiscriminatedUnion<[z.ZodObject<{ action: z.ZodLiteral<"accept">; content: z.ZodRecord; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"decline">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"cancel">; }, z.core.$strict>], "action">; }, z.core.$strict>, z.ZodObject<{ runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"status">; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"result">; runId: z.ZodString; offset: z.ZodOptional; maxBytes: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ action: z.ZodLiteral<"permissions-response">; runId: z.ZodString; permissionId: z.ZodString; response: z.ZodObject<{ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{ outcome: z.ZodLiteral<"cancelled">; }, z.core.$strict>, z.ZodObject<{ outcome: z.ZodLiteral<"selected">; optionId: z.ZodString; }, z.core.$strict>], "outcome">; }, z.core.$strict>; }, z.core.$strict>, z.ZodXor; runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"stop">; }, z.core.$strict>, z.ZodObject<{ callIndex: z.ZodNumber; runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"stop">; }, z.core.$strict>]>, z.ZodObject<{ runId: z.ZodString; lastN: z.ZodOptional; labelGlob: z.ZodOptional; logLines: z.ZodOptional; action: z.ZodLiteral<"pause">; }, z.core.$strict>]>>; interface WorkflowExecuteToolInputBase { action: "run"; /** Absolute project directory selecting the run store and default execution cwd. */ projectDir?: string; args?: unknown; maxAgents?: number; concurrency?: number; agentRetries?: number; } type WorkflowExplicitContent = { script: string; scriptPath?: never; } | { script?: never; scriptPath: string; }; export type WorkflowExecuteToolInput = WorkflowExecuteToolInputBase & WorkflowExplicitContent; /** Same-ID continuation of one durably admitted run. */ export interface WorkflowResumeToolInput { action: "resume"; /** The exact persisted run to continue. */ runId: string; maxAgents?: number; concurrency?: number; agentRetries?: number; checkpointReplies?: Record; } export interface WorkflowSetupResponseToolInput { action: "setup-response"; runId: string; setupId: string; response: z.infer; } export interface WorkflowConfigToolInput { action: "config"; projectDir?: string; harnesses?: string[]; modelSpecs?: string[]; modelFilter?: string; } export interface WorkflowStatusToolInput extends WorkflowRunInspectionOptions { action: "status"; runId: string; } export interface WorkflowResultToolInput { action: "result"; runId: string; offset?: number; maxBytes?: number; } export interface WorkflowPermissionResponseToolInput { action: "permissions-response"; runId: string; permissionId: string; response: z.infer; } type WorkflowStopToolInputBase = WorkflowRunInspectionOptions & { action: "stop"; runId: string; }; export type WorkflowStopToolInput = WorkflowStopToolInputBase & ({ callIndex: number; forceOwner?: never; } | { callIndex?: never; forceOwner?: boolean; }); export type WorkflowPauseToolInput = WorkflowRunInspectionOptions & { action: "pause"; runId: string; }; export type WorkflowToolInput = WorkflowConfigToolInput | WorkflowExecuteToolInput | WorkflowResumeToolInput | WorkflowSetupResponseToolInput | WorkflowStatusToolInput | WorkflowResultToolInput | WorkflowPermissionResponseToolInput | WorkflowStopToolInput | WorkflowPauseToolInput; export interface ParseWorkflowToolInputOptions { /** Require projectDir for config/run on the shared multi-project daemon. */ requireProjectDir?: boolean; } /** Validate one canonical branch and apply runtime defaults. */ export declare function parseWorkflowToolInput(supplied: unknown, options?: ParseWorkflowToolInputOptions): WorkflowToolInput; /** Clamp only execution resource knobs; status values are rejected rather than clamped. */ export declare function clampWorkflowInput(input: T): T; export {}; //# sourceMappingURL=workflow-tool-input.d.ts.map