import { z } from 'zod'; /** JSON-serializable primitive value */ type JsonPrimitive = string | number | boolean | null; /** JSON-serializable value (recursive) */ type JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue; }; /** JSON-serializable object */ type JsonObject = { [key: string]: JsonValue; }; /** Input parameter value types */ type InputValue = string | number | boolean; /** Input parameters record */ type WorkflowInputs = Record; interface WorkflowPluginConfig { /** Directory paths to scan for workflow definitions */ workflowDirs?: string[]; /** Path to SQLite/LibSQL database for persistence */ dbPath?: string; /** Global timeout for workflow execution (ms) */ timeout?: number; /** Enable verbose logging */ verbose?: boolean; } declare const DEFAULT_CONFIG: Required; /** Step types supported by the workflow engine */ type StepType = "shell" | "tool" | "agent" | "suspend" | "http" | "file"; /** HTTP methods supported by the HTTP step */ type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; /** File actions supported by the file step */ type FileAction = "read" | "write" | "delete"; /** Base step definition */ interface BaseStepDefinition { id: string; type: StepType; description?: string; /** Step IDs that must complete before this step runs */ after?: string[]; /** Condition expression to determine if step should run */ condition?: string; /** Step-specific timeout in ms */ timeout?: number; /** Retry configuration */ retry?: { attempts: number; delay?: number; }; } /** Shell command step */ interface ShellStepDefinition extends BaseStepDefinition { type: "shell"; command: string; /** Working directory for the command */ cwd?: string; /** Environment variables */ env?: Record; /** Whether to fail the workflow if command exits non-zero */ failOnError?: boolean; } /** Opencode tool invocation step */ interface ToolStepDefinition extends BaseStepDefinition { type: "tool"; tool: string; args?: JsonObject; } /** LLM agent prompt step */ interface AgentStepDefinition extends BaseStepDefinition { type: "agent"; prompt: string; model?: string; /** System prompt override */ system?: string; /** Max tokens for response */ maxTokens?: number; } /** Suspend step for human-in-the-loop */ interface SuspendStepDefinition extends BaseStepDefinition { type: "suspend"; /** Message to display when suspending */ message?: string; /** Schema for expected resume data (JSON Schema format) */ resumeSchema?: JsonObject; } /** HTTP request step for API calls */ interface HttpStepDefinition extends BaseStepDefinition { type: "http"; /** HTTP method */ method: HttpMethod; /** URL to request (supports interpolation) */ url: string; /** Request headers (supports interpolation) */ headers?: Record; /** Request body (for POST/PUT/PATCH) */ body?: JsonValue; /** Whether to fail the workflow if response is not OK (default: true) */ failOnError?: boolean; } /** File operations step for platform-independent file handling */ interface FileStepDefinition extends BaseStepDefinition { type: "file"; /** File operation action */ action: FileAction; /** File path (supports interpolation) */ path: string; /** Content to write (for write action, supports interpolation) */ content?: string | JsonValue; } /** Union of all step definition types */ type StepDefinition = ShellStepDefinition | ToolStepDefinition | AgentStepDefinition | SuspendStepDefinition | HttpStepDefinition | FileStepDefinition; /** Complete workflow definition */ interface WorkflowDefinition { id: string; name?: string; description?: string; /** Version of the workflow definition */ version?: string; /** Input parameters schema - maps param name to type name */ inputs?: Record; /** Ordered list of steps */ steps: StepDefinition[]; /** Tags for categorization */ tags?: string[]; /** Trigger configuration */ trigger?: { /** Auto-run on specific events */ event?: string; /** Cron schedule */ schedule?: string; }; } /** Workflow execution status */ type WorkflowRunStatus = "pending" | "running" | "suspended" | "completed" | "failed" | "cancelled"; /** Shell step output */ interface ShellStepOutput { stdout: string; stderr: string; exitCode: number; skipped?: boolean; } /** Tool step output */ interface ToolStepOutput { result: JsonValue; skipped?: boolean; } /** Agent step output */ interface AgentStepOutput { response: string; skipped?: boolean; } /** Suspend step output */ interface SuspendStepOutput { resumed: boolean; data?: JsonValue; skipped?: boolean; } /** HTTP step output */ interface HttpStepOutput { status: number; /** Parsed JSON body, or null if response is not valid JSON */ body: JsonValue; /** Raw response text (useful when JSON parsing fails or for non-JSON responses) */ text: string; headers: Record; skipped?: boolean; } /** File step output */ interface FileStepOutput { /** Content read from file (for read action) */ content?: string; /** Success indicator (for write/delete actions) */ success?: boolean; skipped?: boolean; } /** Union of all step output types */ type StepOutput = ShellStepOutput | ToolStepOutput | AgentStepOutput | SuspendStepOutput | HttpStepOutput | FileStepOutput; /** Step execution result */ interface StepResult { stepId: string; status: "success" | "failed" | "skipped"; output?: StepOutput; error?: string; startedAt: Date; completedAt?: Date; duration?: number; } /** Workflow run record */ interface WorkflowRun { runId: string; workflowId: string; status: WorkflowRunStatus; inputs: WorkflowInputs; stepResults: Record; currentStepId?: string; suspendedData?: JsonValue; startedAt: Date; completedAt?: Date; error?: string; } /** Context passed during step execution */ interface StepExecutionContext { /** Workflow inputs */ inputs: WorkflowInputs; /** Results from previous steps (stepId -> output) */ steps: Record; /** Opencode client reference */ client: OpencodeClient; /** Shell executor */ shell: ShellExecutor; /** Logging utilities */ log: Logger; } /** Opencode client interface (subset of actual client) */ interface OpencodeClient { tools: Record Promise; }>; llm: { chat: (options: { model?: string; messages: Array<{ role: string; content: string; }>; maxTokens?: number; }) => Promise<{ content: string; }>; }; app: { log: (message: string, level?: "info" | "warn" | "error") => void; }; } /** Shell command executor */ type ShellExecutor = (command: string, options?: { cwd?: string; env?: Record; timeout?: number; }) => Promise<{ stdout: string; stderr: string; exitCode: number; }>; /** Logger interface */ interface Logger { info: (message: string) => void; warn: (message: string) => void; error: (message: string) => void; debug: (message: string) => void; } declare const BaseStepSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["shell", "tool", "agent", "suspend", "http", "file"]>; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; }, "strip", z.ZodTypeAny, { id: string; type: "tool" | "file" | "shell" | "agent" | "suspend" | "http"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }, { id: string; type: "tool" | "file" | "shell" | "agent" | "suspend" | "http"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }>; declare const ShellStepSchema: z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"shell">; command: z.ZodString; cwd: z.ZodOptional; env: z.ZodOptional>; failOnError: z.ZodDefault>; }, "strip", z.ZodTypeAny, { command: string; id: string; type: "shell"; failOnError: boolean; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; }, { command: string; id: string; type: "shell"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; failOnError?: boolean | undefined; }>; declare const ToolStepSchema: z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"tool">; tool: z.ZodString; args: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; }, { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; }>; declare const AgentStepSchema: z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"agent">; prompt: z.ZodString; model: z.ZodOptional; system: z.ZodOptional; maxTokens: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; }, { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; }>; declare const SuspendStepSchema: z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"suspend">; message: z.ZodOptional; resumeSchema: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; }, { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; }>; declare const HttpStepSchema: z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"http">; method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>; url: z.ZodString; headers: z.ZodOptional>; body: z.ZodOptional>; failOnError: z.ZodDefault>; }, "strip", z.ZodTypeAny, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; failOnError: boolean; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; failOnError?: boolean | undefined; }>; declare const FileStepSchema: z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"file">; action: z.ZodEnum<["read", "write", "delete"]>; path: z.ZodString; content: z.ZodOptional]>>; }, "strip", z.ZodTypeAny, { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }, { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }>; declare const StepSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"shell">; command: z.ZodString; cwd: z.ZodOptional; env: z.ZodOptional>; failOnError: z.ZodDefault>; }, "strip", z.ZodTypeAny, { command: string; id: string; type: "shell"; failOnError: boolean; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; }, { command: string; id: string; type: "shell"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; failOnError?: boolean | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"tool">; tool: z.ZodString; args: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; }, { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"agent">; prompt: z.ZodString; model: z.ZodOptional; system: z.ZodOptional; maxTokens: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; }, { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"suspend">; message: z.ZodOptional; resumeSchema: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; }, { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"http">; method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>; url: z.ZodString; headers: z.ZodOptional>; body: z.ZodOptional>; failOnError: z.ZodDefault>; }, "strip", z.ZodTypeAny, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; failOnError: boolean; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; failOnError?: boolean | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"file">; action: z.ZodEnum<["read", "write", "delete"]>; path: z.ZodString; content: z.ZodOptional]>>; }, "strip", z.ZodTypeAny, { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }, { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }>]>; declare const WorkflowDefinitionSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodOptional; description: z.ZodOptional; version: z.ZodOptional; inputs: z.ZodOptional>>; steps: z.ZodArray; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"shell">; command: z.ZodString; cwd: z.ZodOptional; env: z.ZodOptional>; failOnError: z.ZodDefault>; }, "strip", z.ZodTypeAny, { command: string; id: string; type: "shell"; failOnError: boolean; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; }, { command: string; id: string; type: "shell"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; failOnError?: boolean | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"tool">; tool: z.ZodString; args: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; }, { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"agent">; prompt: z.ZodString; model: z.ZodOptional; system: z.ZodOptional; maxTokens: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; }, { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"suspend">; message: z.ZodOptional; resumeSchema: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; }, { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"http">; method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>; url: z.ZodString; headers: z.ZodOptional>; body: z.ZodOptional>; failOnError: z.ZodDefault>; }, "strip", z.ZodTypeAny, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; failOnError: boolean; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }, { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; failOnError?: boolean | undefined; }>, z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; after: z.ZodOptional>; condition: z.ZodOptional; timeout: z.ZodOptional; retry: z.ZodOptional; }, "strip", z.ZodTypeAny, { attempts: number; delay?: number | undefined; }, { attempts: number; delay?: number | undefined; }>>; } & { type: z.ZodLiteral<"file">; action: z.ZodEnum<["read", "write", "delete"]>; path: z.ZodString; content: z.ZodOptional]>>; }, "strip", z.ZodTypeAny, { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }, { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; }>]>, "many">; tags: z.ZodOptional>; trigger: z.ZodOptional; schedule: z.ZodOptional; }, "strip", z.ZodTypeAny, { event?: string | undefined; schedule?: string | undefined; }, { event?: string | undefined; schedule?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { id: string; steps: ({ command: string; id: string; type: "shell"; failOnError: boolean; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; } | { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; } | { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; } | { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; } | { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; failOnError: boolean; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; } | { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; })[]; description?: string | undefined; name?: string | undefined; version?: string | undefined; inputs?: Record | undefined; tags?: string[] | undefined; trigger?: { event?: string | undefined; schedule?: string | undefined; } | undefined; }, { id: string; steps: ({ command: string; id: string; type: "shell"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; cwd?: string | undefined; env?: Record | undefined; failOnError?: boolean | undefined; } | { tool: string; id: string; type: "tool"; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; args?: Record | undefined; } | { id: string; type: "agent"; prompt: string; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; model?: string | undefined; system?: string | undefined; maxTokens?: number | undefined; } | { id: string; type: "suspend"; timeout?: number | undefined; message?: string | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; resumeSchema?: Record | undefined; } | { method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"; id: string; type: "http"; url: string; body?: JsonValue | undefined; headers?: Record | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; failOnError?: boolean | undefined; } | { id: string; path: string; type: "file"; action: "read" | "write" | "delete"; content?: JsonValue | undefined; timeout?: number | undefined; description?: string | undefined; after?: string[] | undefined; condition?: string | undefined; retry?: { attempts: number; delay?: number | undefined; } | undefined; })[]; description?: string | undefined; name?: string | undefined; version?: string | undefined; inputs?: Record | undefined; tags?: string[] | undefined; trigger?: { event?: string | undefined; schedule?: string | undefined; } | undefined; }>; interface WorkflowEventPayload { workflowId: string; runId: string; status: WorkflowRunStatus; stepId?: string; error?: string; } interface WorkflowRegistry { workflows: Map; runs: Map; getWorkflow(id: string): WorkflowDefinition | undefined; listWorkflows(): WorkflowDefinition[]; getRun(runId: string): WorkflowRun | undefined; listRuns(workflowId?: string): WorkflowRun[]; } export { type AgentStepDefinition as A, type BaseStepDefinition as B, AgentStepSchema as C, DEFAULT_CONFIG as D, SuspendStepSchema as E, type FileAction as F, HttpStepSchema as G, type HttpMethod as H, type InputValue as I, type JsonPrimitive as J, FileStepSchema as K, type Logger as L, StepSchema as M, WorkflowDefinitionSchema as N, type OpencodeClient as O, type StepType as S, type ToolStepDefinition as T, type WorkflowInputs as W, type JsonValue as a, type JsonObject as b, type WorkflowPluginConfig as c, type ShellStepDefinition as d, type SuspendStepDefinition as e, type HttpStepDefinition as f, type FileStepDefinition as g, type StepDefinition as h, type WorkflowDefinition as i, type WorkflowRunStatus as j, type ShellStepOutput as k, type ToolStepOutput as l, type AgentStepOutput as m, type SuspendStepOutput as n, type HttpStepOutput as o, type FileStepOutput as p, type StepOutput as q, type StepResult as r, type WorkflowRun as s, type StepExecutionContext as t, type ShellExecutor as u, type WorkflowEventPayload as v, type WorkflowRegistry as w, BaseStepSchema as x, ShellStepSchema as y, ToolStepSchema as z };