/** * Graph-based Workflow Engine with conditional branching, parallel execution, * loops, retry, timeout, and error handling. * * This is a standalone engine that works with function-based steps (no skill/agent coupling). * The original WorkflowEngine in workflow.ts is preserved for backward compatibility. */ export interface WorkflowContext { variables: Map; results: Map; currentStep: string; startTime: Date; errors: Array<{ step: string; error: Error; }>; } export interface GraphWorkflowStep { id: string; name: string; type: 'action' | 'condition' | 'parallel' | 'loop'; action?: (context: WorkflowContext) => Promise; condition?: (context: WorkflowContext) => boolean; onTrue?: string; onFalse?: string; parallel?: string[]; loopCondition?: (context: WorkflowContext) => boolean; loopBody?: string; maxIterations?: number; next?: string; retryCount?: number; retryDelay?: number; timeout?: number; onError?: 'stop' | 'skip' | 'retry'; } export interface GraphWorkflow { name: string; entryPoint: string; steps: Map; } export interface GraphWorkflowResult { workflow: string; status: 'completed' | 'failed'; context: WorkflowContext; totalDurationMs: number; } export declare class GraphWorkflowEngine { execute(workflow: GraphWorkflow): Promise; private executeAction; private executeParallel; private executeLoop; } export declare class WorkflowBuilder { private steps; private entry; private workflowName; name(n: string): this; start(id: string): this; addAction(id: string, action: (context: WorkflowContext) => Promise, options?: Partial): this; addCondition(id: string, condition: (context: WorkflowContext) => boolean, onTrue: string, onFalse: string, options?: Partial): this; addParallel(id: string, stepIds: string[], next?: string, options?: Partial): this; addLoop(id: string, condition: (context: WorkflowContext) => boolean, body: string, options?: { maxIterations?: number; next?: string; name?: string; }): this; build(): GraphWorkflow; } export interface OADWorkflowStepDef { id: string; type: 'action' | 'condition' | 'parallel' | 'loop'; name?: string; next?: string; onTrue?: string; onFalse?: string; parallel?: string[]; loopBody?: string; maxIterations?: number; retryCount?: number; retryDelay?: number; timeout?: number; onError?: 'stop' | 'skip' | 'retry'; } export interface OADWorkflowDef { name: string; steps: OADWorkflowStepDef[]; } /** * Parse an OAD workflow definition into a GraphWorkflow. * Action handlers must be supplied via the actionMap. */ export declare function parseOADWorkflow(def: OADWorkflowDef, actionMap?: Map Promise>, conditionMap?: Map boolean>): GraphWorkflow; //# sourceMappingURL=workflow-graph.d.ts.map