import { EventEmitter } from 'events'; import { AgentCommunicationHub } from './agent-communication'; import { TaskAnalysis, AgentAssignment } from './task-router'; import { AntiHallucinationValidator } from '../utils/anti-hallucination'; export interface WorkflowStep { id: string; agentId: string; action: string; dependencies: string[]; inputs: Record; outputs: Record; status: 'pending' | 'running' | 'completed' | 'failed' | 'blocked'; startTime?: number; endTime?: number; retryCount: number; maxRetries: number; estimatedDuration: number; } export interface CoordinationContext { workflowId: string; taskId: string; strategy: 'single' | 'parallel' | 'sequential' | 'hierarchical'; steps: WorkflowStep[]; assignments: AgentAssignment[]; globalState: Record; conflicts: Conflict[]; status: 'planning' | 'executing' | 'completed' | 'failed' | 'conflict'; startTime: number; lastUpdate: number; metadata: { priority: number; riskLevel: string; complianceRequirements: string[]; }; } export interface Conflict { id: string; type: ConflictType; description: string; involvedAgents: string[]; severity: 'low' | 'medium' | 'high' | 'critical'; detectedAt: number; resolution?: ConflictResolution; status: 'detected' | 'resolving' | 'resolved' | 'escalated'; } export declare enum ConflictType { RESOURCE_CONTENTION = "resource_contention", INCONSISTENT_OUTPUT = "inconsistent_output", DEPENDENCY_DEADLOCK = "dependency_deadlock", CAPABILITY_OVERLAP = "capability_overlap", PRIORITY_CONFLICT = "priorityconflict", TIMELINE_CONFLICT = "timelineconflict", VALIDATION_DISAGREEMENT = "validation_disagreement", APPROACH_DISAGREEMENT = "approach_disagreement" } export interface ConflictResolution { strategy: ResolutionStrategy; decision: string; resolvedBy: string; implementation: Record; timestamp: number; confidence: number; } export declare enum ResolutionStrategy { VOTING = "voting", PRIORITY_BASED = "priority_based", EXPERTISE_BASED = "expertise_based", CONSENSUS = "consensus", ARBITRATION = "arbitration", ROLLBACK = "rollback", RESTART = "restart", ESCALATION = "escalation" } export declare class CoordinationManager extends EventEmitter { private logger; private _validator; private communicationHub; private workflows; private resourceLocks; private conflictHistory; private readonly _maxWorkflowDuration; private readonly conflictDetectionInterval; private readonly resourceLockTimeout; constructor(communicationHub: AgentCommunicationHub); createWorkflow(taskId: string, assignments: AgentAssignment[], strategy: 'single' | 'parallel' | 'sequential' | 'hierarchical', analysis: TaskAnalysis): Promise; executeWorkflow(workflowId: string): Promise; detectConflicts(workflowId: string): Promise; resolveConflict(workflowId: string, _conflictId: string): Promise; acquireResourceLock(resourceId: string, agentId: string, workflowId: string): Promise; releaseResourceLock(resourceId: string, agentId: string): void; getWorkflowStatus(workflowId: string): CoordinationContext | null; cancelWorkflow(workflowId: string, reason: string): Promise; private generateWorkflowSteps; private executeSingleAgent; private executeParallel; private executeSequential; private executeHierarchical; private executeStep; private waitForStepCompletion; private detectResourceContention; private detectDependencyDeadlocks; private detectInconsistentOutputs; private detectTimelineConflicts; private resolveConflictByType; private resolveResourceContention; private resolveDependencyDeadlock; private resolveByVoting; private applyResolution; private resolveDependencyOrder; private getActionForRole; private getMaxRetries; private getStepResources; private calculatePriority; private updateWorkflowContext; private generateWorkflowId; private generateConflictId; private startConflictDetection; private startResourceCleanup; get validator(): AntiHallucinationValidator; get maxWorkflowDuration(): number; } //# sourceMappingURL=coordination-manager.d.ts.map