import { EventEmitter } from 'events';
/**
 * Workflow Engine
 * Manages multi-agent task execution with state persistence
 */
interface WorkflowStep {
    id: string;
    agent: string;
    task: string;
    dependsOn?: string[];
    status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
    output?: string;
    error?: string;
    startedAt?: Date;
    completedAt?: Date;
}
interface Workflow {
    id: string;
    name: string;
    description: string;
    steps: WorkflowStep[];
    context: Record<string, any>;
    status: 'pending' | 'running' | 'completed' | 'failed';
    createdAt: Date;
    updatedAt: Date;
}
interface WorkflowDefinition {
    name: string;
    description: string;
    steps: Array<{
        agent: string;
        task: string;
        dependsOn?: string[];
    }>;
}
export declare class WorkflowEngine extends EventEmitter {
    private workflowsDir;
    private activeWorkflows;
    constructor();
    private ensureDirectories;
    /**
     * Create a new workflow
     */
    createWorkflow(_name: string, definition: WorkflowDefinition, context?: Record<string, any>): Workflow;
    /**
     * Execute a workflow
     */
    executeWorkflow(workflowId: string): Promise<Workflow>;
    /**
     * Execute a single step
     */
    private executeStep;
    /**
     * Execute agent (placeholder for actual implementation)
     */
    private executeAgent;
    /**
     * Save workflow state
     */
    private saveWorkflow;
    /**
     * Load workflow
     */
    loadWorkflow(workflowId: string): Workflow | null;
    /**
     * Get workflow status
     */
    getWorkflowStatus(workflowId: string): {
        status: string;
        progress: {
            completed: number;
            total: number;
        };
        steps: WorkflowStep[];
    } | null;
    /**
     * Resume a failed workflow
     */
    resumeWorkflow(workflowId: string): Promise<Workflow>;
    /**
     * Cancel a running workflow
     */
    cancelWorkflow(workflowId: string): boolean;
    /**
     * List all workflows
     */
    listWorkflows(): Array<{
        id: string;
        name: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
    }>;
    /**
     * Get predefined workflow definitions
     */
    getPredefinedWorkflows(): Record<string, WorkflowDefinition>;
    /**
     * Run a predefined workflow
     */
    runPredefinedWorkflow(workflowName: string, context?: Record<string, any>): Promise<Workflow>;
    /**
     * Generate unique ID
     */
    private generateId;
}
export declare const workflowEngine: WorkflowEngine;
export {};
//# sourceMappingURL=workflow-engine.d.ts.map