import { EventEmitter } from 'events'; import { AgentCommunicationHub } from './agent-communication'; import { MCPManager } from './mcp-client'; export interface AgentDefinition { id: string; type: string; name: string; version: string; capabilities: string[]; requirements: { memory: number; cpu: number; storage: number; network: boolean; mcpServers: string[]; }; configuration: Record; metadata: { author: string; description: string; tags: string[]; complianceLevel: string; }; } export interface AgentInstance { id: string; definition: AgentDefinition; status: AgentStatus; pid?: number; startTime: number; lastHealthCheck: number; metrics: AgentMetrics; configuration: Record; environment: Record; } export declare enum AgentStatus { INITIALIZING = "initializing", STARTING = "starting", RUNNING = "running", BUSY = "busy", IDLE = "idle", PAUSED = "paused", STOPPING = "stopping", STOPPED = "stopped", ERROR = "error", CRASHED = "crashed", UNRESPONSIVE = "unresponsive" } export interface AgentMetrics { cpuUsage: number; memoryUsage: number; tasksCompleted: number; tasksInProgress: number; errorCount: number; uptime: number; lastTaskDuration: number; averageTaskDuration: number; responseTime: number; } export interface HealthCheckResult { status: 'healthy' | 'degraded' | 'unhealthy' | 'critical'; timestamp: number; checks: { name: string; status: boolean; message?: string; duration: number; }[]; overallScore: number; } export interface AgentEvent { type: 'lifecycle' | 'health' | 'performance' | 'error'; agentId: string; timestamp: number; data: any; severity: 'info' | 'warn' | 'error' | 'critical'; } export declare class AgentLifecycleManager extends EventEmitter { private logger; private validator; private communicationHub; private mcpManager; private agents; private agentDefinitions; private healthCheckResults; private eventHistory; private readonly healthCheckInterval; private readonly metricsCollectionInterval; private readonly maxEventHistory; private readonly shutdownTimeout; private healthCheckTimer?; private metricsTimer?; constructor(communicationHub: AgentCommunicationHub, mcpManager: MCPManager); registerAgentDefinition(definition: AgentDefinition): void; createAgent(definitionId: string, instanceId?: string, config?: Record): Promise; startAgent(instance: AgentInstance): Promise; stopAgent(agentId: string, reason?: string): Promise; restartAgent(agentId: string, reason?: string): Promise; pauseAgent(agentId: string): Promise; resumeAgent(agentId: string): Promise; performHealthCheck(instance: AgentInstance): Promise; getAgent(agentId: string): AgentInstance | null; getAllAgents(): AgentInstance[]; getAgentsByStatus(status: AgentStatus): AgentInstance[]; getHealthHistory(agentId: string): HealthCheckResult[]; getAgentEvents(agentId: string, limit?: number): AgentEvent[]; shutdown(): Promise; private validateAgentDefinition; private validateRequirements; private initializeMCPConnections; private initializeMetrics; private createEnvironment; private waitForShutdown; private forceStopAgent; private cleanupAgentResources; private updateInstance; private logEvent; private generateInstanceId; private startHealthMonitoring; private startMetricsCollection; private updateMetrics; } //# sourceMappingURL=agent-lifecycle.d.ts.map