import { EventEmitter } from 'events'; import type { AgentContext, ISkill, IAgent } from './types'; export type StepType = 'skill' | 'tool' | 'agent' | 'condition' | 'parallel'; export interface WorkflowStep { id: string; type: StepType; name: string; config?: Record; /** For condition steps */ condition?: string; branches?: { if: WorkflowStep[]; else?: WorkflowStep[]; }; /** For parallel steps */ parallel?: WorkflowStep[]; /** Timeout in ms */ timeout?: number; /** Retry count */ retries?: number; } export interface WorkflowDefinition { name: string; description?: string; version?: string; steps: WorkflowStep[]; onError?: 'stop' | 'skip' | 'retry'; } export interface StepResult { stepId: string; status: 'success' | 'skipped' | 'error'; output?: string; error?: string; durationMs: number; } export interface WorkflowResult { workflow: string; status: 'completed' | 'failed' | 'partial'; steps: StepResult[]; totalDurationMs: number; } export declare class WorkflowEngine extends EventEmitter { private workflows; private skills; private agents; private logger; registerWorkflow(workflow: WorkflowDefinition): void; unregisterWorkflow(name: string): void; getWorkflow(name: string): WorkflowDefinition | undefined; listWorkflows(): WorkflowDefinition[]; registerSkill(skill: ISkill): void; registerAgent(agent: IAgent): void; run(name: string, context: AgentContext, input?: string): Promise; private executeSteps; private executeSingleStep; private executeStepAction; private evaluateCondition; } //# sourceMappingURL=workflow.d.ts.map