import { Context, Effect, Layer } from 'effect'; import type { AgentMessage, AgentResponse } from '../agent/agent'; import type { CheckpointManager } from '../pipeline/checkpoint/manager'; import type { PipelineContext } from '../pipeline/context'; import type { AgentManagerLike, HookManagerLike } from '../pipeline/executor'; import type { Tracer } from '../tracing'; import type { WorkflowIR } from './ir'; import { WorkflowInputValidationError, WorkflowOutputValidationError } from './errors'; export interface WorkflowExecutionOptions { readonly agentManager: AgentManagerLike; readonly hookManager?: HookManagerLike; readonly tracer?: Tracer; readonly pipelineManager?: { readonly getPipeline: (id: string) => { readonly execute: (input: unknown) => Promise; } | undefined; }; readonly workflowResolver?: (workflowId: string, input: unknown) => Effect.Effect; readonly checkpointManager?: CheckpointManager; readonly conversationId?: string; readonly history?: AgentMessage[]; readonly runId?: string; readonly startStep?: number; readonly restoredContext?: PipelineContext; readonly sequentialVisibility?: boolean; } export interface WorkflowExecutionResult { readonly success: boolean; readonly status: 'completed' | 'failed' | 'paused' | 'aborted'; readonly context: PipelineContext; readonly outputs: Record; readonly executedNodes: string[]; readonly finalOutput?: unknown; readonly error?: Error; readonly failedNodeId?: string; readonly abortedBy?: string; readonly runId: string; readonly pauseRequest?: { readonly prompt: string; readonly choices?: string[]; readonly schema?: Record; readonly metadata?: Record; }; } export interface WorkflowExecutorService { readonly execute: (workflow: WorkflowIR, input: unknown, options: WorkflowExecutionOptions) => Effect.Effect; } export declare const WorkflowExecutorService: Context.Tag; /** Convert structured workflow input only when it crosses a conversational string boundary. */ export declare function workflowInputToMessage(input: unknown): string; export declare function getPublicWorkflowOutputs(workflow: WorkflowIR, outputs: Record): Record; export declare const executeWorkflowEffect: (workflow: WorkflowIR, input: unknown, options: WorkflowExecutionOptions) => Effect.Effect<{ success: false; status: "aborted"; context: { outputs: Record; input: unknown; history: AgentMessage[]; metadata: Record; pipelineId: string; conversationId?: string; }; outputs: Record; executedNodes: string[]; abortedBy: string; runId: string; finalOutput?: undefined; pauseRequest?: undefined; } | { success: false; status: "aborted"; context: { outputs: Record; input: unknown; history: AgentMessage[]; metadata: Record; pipelineId: string; conversationId?: string; }; outputs: Record; executedNodes: string[]; finalOutput: unknown; abortedBy: string; runId: string; pauseRequest?: undefined; } | { success: false; status: "paused"; context: PipelineContext; outputs: Record; executedNodes: string[]; finalOutput: unknown; runId: string; pauseRequest: { prompt: string; choices: string[] | undefined; schema: Record | undefined; metadata: Record | undefined; }; abortedBy?: undefined; } | { success: true; status: "completed"; context: PipelineContext; outputs: Record; executedNodes: string[]; finalOutput: unknown; runId: string; abortedBy?: undefined; pauseRequest?: undefined; } | { success: false; status: "failed"; context: { outputs: Record; input: unknown; history: AgentMessage[]; metadata: Record; pipelineId: string; conversationId?: string; }; outputs: Record; executedNodes: string[]; finalOutput: unknown; error: Error; failedNodeId: string; runId: string; }, WorkflowInputValidationError | WorkflowOutputValidationError, never>; export declare const WorkflowExecutorServiceLive: Layer.Layer; //# sourceMappingURL=execute.d.ts.map