/**
 * Crash Prevention System
 * Comprehensive stability measures to prevent MCP server crashes
 */
import { EventEmitter } from 'events';
export interface SystemHealth {
    memoryUsage: {
        rss: number;
        heapTotal: number;
        heapUsed: number;
        external: number;
        arrayBuffers: number;
    };
    cpuUsage: {
        user: number;
        system: number;
    };
    uptime: number;
    loadAverage: number[];
    freeMemory: number;
    totalMemory: number;
    isUnderPressure: boolean;
}
export interface CrashRisk {
    level: 'low' | 'medium' | 'high' | 'critical';
    factors: string[];
    recommendedActions: string[];
    autoActionsEnabled: boolean;
}
export declare class CrashPrevention extends EventEmitter {
    private static instance;
    private monitoringInterval;
    private healthHistory;
    private maxHistorySize;
    private alertThresholds;
    private criticalActions;
    static getInstance(): CrashPrevention;
    /**
     * Start continuous system monitoring
     */
    startMonitoring(): void;
    /**
     * Stop monitoring
     */
    stopMonitoring(): void;
    /**
     * Collect current system health metrics
     */
    private collectSystemHealth;
    /**
     * Determine if system is under pressure
     */
    private isSystemUnderPressure;
    /**
     * Analyze crash risk based on current and historical data
     */
    private analyzeCrashRisk;
    /**
     * Analyze memory growth trend
     */
    private analyzeMemoryGrowth;
    /**
     * Generate recommended actions based on risk factors
     */
    private generateRecommendations;
    /**
     * Execute automatic actions for critical situations
     */
    private executeAutomaticActions;
    /**
     * Get current system health
     */
    getCurrentHealth(): SystemHealth | null;
    /**
     * Get health history
     */
    getHealthHistory(): SystemHealth[];
    /**
     * Force immediate health check and risk analysis
     */
    performHealthCheck(): {
        health: SystemHealth;
        risk: CrashRisk;
    };
    /**
     * Update alert thresholds
     */
    updateThresholds(thresholds: Partial<typeof this.alertThresholds>): void;
    /**
     * Enable/disable automatic actions
     */
    updateCriticalActions(actions: Partial<typeof this.criticalActions>): void;
}
//# sourceMappingURL=crash-prevention.d.ts.map