/** * Main orchestrator for Claude-Flow */ import { Config, AgentProfile, AgentSession, Task, HealthStatus, OrchestratorMetrics } from "../utils/types.js"; import { IEventBus } from "./event-bus.js"; import { ILogger } from "./logger.js"; import { ITerminalManager } from "../terminal/manager.js"; import { IMemoryManager } from "../memory/manager.js"; import { ICoordinationManager } from "../coordination/manager.js"; import { IMCPServer } from "../mcp/server.js"; export interface ISessionManager { createSession(profile: AgentProfile): Promise; getSession(sessionId: string): AgentSession | undefined; getActiveSessions(): AgentSession[]; terminateSession(sessionId: string): Promise; terminateAllSessions(): Promise; persistSessions(): Promise; restoreSessions(): Promise; removeSession(sessionId: string): void; } export interface IOrchestrator { initialize(): Promise; shutdown(): Promise; spawnAgent(profile: AgentProfile): Promise; terminateAgent(agentId: string): Promise; assignTask(task: Task): Promise; getHealthStatus(): Promise; getMetrics(): Promise; performMaintenance(): Promise; } export interface SessionPersistence { sessions: Array; taskQueue: Task[]; metrics: { completedTasks: number; failedTasks: number; totalTaskDuration: number; }; savedAt: Date; } /** * Main orchestrator implementation with enhanced features */ export declare class Orchestrator implements IOrchestrator { private config; private terminalManager; private memoryManager; private coordinationManager; private mcpServer; private eventBus; private logger; private initialized; private shutdownInProgress; private sessionManager; private healthCheckInterval?; private maintenanceInterval?; private metricsInterval?; private agents; private taskQueue; private taskHistory; private startTime; private metrics; private healthCheckCircuitBreaker; private taskAssignmentCircuitBreaker; constructor(config: Config, terminalManager: ITerminalManager, memoryManager: IMemoryManager, coordinationManager: ICoordinationManager, mcpServer: IMCPServer, eventBus: IEventBus, logger: ILogger); initialize(): Promise; shutdown(): Promise; spawnAgent(profile: AgentProfile): Promise; terminateAgent(agentId: string): Promise; assignTask(task: Task): Promise; getHealthStatus(): Promise; getMetrics(): Promise; performMaintenance(): Promise; private setupEventHandlers; private startHealthChecks; private startMaintenanceTasks; private startMetricsCollection; private stopBackgroundTasks; private shutdownComponents; private emergencyShutdown; private processTaskQueue; private getAvailableAgents; private selectAgentForTask; private getComponentHealth; private processHealthResult; private initializeComponent; private shutdownComponent; private validateAgentProfile; private validateTask; private handleAgentError; private handleTaskFailure; private handleSystemError; private resolveDeadlock; private cancelAgentTasks; private startAgentHealthMonitoring; private recoverUnhealthyComponents; private cleanupTerminatedSessions; private cleanupTaskHistory; private processShutdownTasks; } //# sourceMappingURL=orchestrator.d.ts.map