import { EventEmitter } from 'events';
import { Workflow, ExecutionContext, OrchestratorError } from '../types/core.js';
import { EnhancedExecutionContext } from '../types/enhanced-core.js';
import { AgentSpecReader } from './filesystem.js';
export interface EnhancedWorkflowExecutionEvent {
    type: 'step_started' | 'step_completed' | 'step_failed' | 'delegation_enforced' | 'bypass_prevented' | 'workflow_completed' | 'workflow_failed';
    workflowId: string;
    stepId?: string;
    agentUsed?: string;
    delegationEnforced?: boolean;
    data?: any;
    error?: OrchestratorError;
    timestamp: Date;
}
export interface EnhancedStepExecutionResult {
    success: boolean;
    outputs: Record<string, any>;
    error?: OrchestratorError;
    metadata: {
        executionTime: number;
        retryCount: number;
        agentUsed: string;
        delegationEnforced: boolean;
        bypassPrevented: boolean;
        executionMethod: 'direct' | 'delegated' | 'enforced';
        sessionId?: string;
    };
}
export interface DelegationConfig {
    enforcementLevel: 'strict' | 'moderate' | 'advisory';
    autoClassification: boolean;
    allowDirectExecution: boolean;
    bypassPatterns: string[];
    mandatoryAgents: string[];
}
export declare class EnhancedWorkflowEngine extends EventEmitter {
    private agentReader;
    private activeExecutions;
    private stepExecutors;
    private delegationInterceptor;
    private agentRouter;
    private taskClassifier;
    private delegationConfig;
    constructor(agentReader: AgentSpecReader, delegationConfig?: Partial<DelegationConfig>);
    private setupEnhancedStepExecutors;
    executeWorkflow(workflow: Workflow, initialInputs?: Record<string, any>): Promise<EnhancedExecutionContext>;
    private buildEnhancedExecutionPlan;
    private buildExecutionPlan;
    private executeStepWithDelegationEnforcement;
    private shouldEnforceDelegation;
    private executeWithForcedDelegation;
    private executeStepStandard;
    private sanitizeContextForAgent;
    private extractOutputsFromAgentResult;
    private executeFrontendTaskWithDelegation;
    private executeBackendTaskWithDelegation;
    private executeDevOpsTaskWithDelegation;
    private executePromptGenerationWithDelegation;
    private executeAnalysisWithDelegation;
    private executeCodeGenerationWithDelegation;
    private executeValidationWithDelegation;
    private executeGenericStepWithDelegation;
    private executeWithRetry;
    private buildPrompt;
    private performAnalysis;
    private executeAgentTask;
    private generateSessionId;
    getActiveExecutions(): ExecutionContext[];
    getExecutionContext(sessionId: string): ExecutionContext | undefined;
    cancelExecution(sessionId: string): Promise<boolean>;
    getDelegationStats(): Record<string, any>;
    updateDelegationConfig(config: Partial<DelegationConfig>): void;
}
//# sourceMappingURL=enhanced-workflow.d.ts.map