export interface DegradationConfig { memoryThresholds: { warning: number; degraded: number; critical: number; }; degradationActions: { reduceThinkingBlocks: boolean; limitConversations: boolean; disableComplexFeatures: boolean; enableAggressiveCleanup: boolean; }; recoveryThresholds: { memoryRecoveryThreshold: number; stabilityRequiredMs: number; }; } export declare const DEFAULT_DEGRADATION_CONFIG: DegradationConfig; export type DegradationLevel = 'normal' | 'warning' | 'degraded' | 'critical'; export interface DegradationStatus { level: DegradationLevel; activeSince: number; actions: string[]; metrics: { memoryPressure: string; conversationCount: number; activeOperations: number; estimatedMemoryUsage: number; }; recommendations: string[]; } /** * Graceful Degradation Manager * Monitors system health and applies degradation strategies under pressure */ export declare class GracefulDegradationManager { private static instance; private config; private currentLevel; private levelChangedAt; private appliedActions; private recoveryStartTime?; private constructor(); static getInstance(config?: DegradationConfig): GracefulDegradationManager; /** * Assess current system state and determine degradation level */ assessSystemHealth(): DegradationStatus; /** * Determine degradation level based on system metrics */ private determineDegradationLevel; /** * Change degradation level and apply appropriate actions */ private changeDegradationLevel; /** * Apply degradation actions for the current level */ private applyDegradationActions; /** * Apply warning level actions */ private applyWarningActions; /** * Apply degraded level actions */ private applyDegradedActions; /** * Apply critical level actions */ private applyCriticalActions; /** * Roll back degradation actions when level improves */ private rollbackDegradationActions; /** * Check if system can recover to a better degradation level */ private checkRecovery; /** * Generate recommendations based on current system state */ private generateRecommendations; /** * Get current degradation configuration */ getConfiguration(): DegradationConfig; /** * Update degradation configuration */ updateConfiguration(newConfig: Partial): void; /** * Check if specific features should be disabled */ isFeatureDisabled(feature: 'extended_thinking' | 'complex_workflows' | 'large_responses'): boolean; /** * Get simplified status for API responses */ getSimplifiedStatus(): { healthy: boolean; level: DegradationLevel; message: string; }; } export declare const gracefulDegradationManager: GracefulDegradationManager; /** * Helper function to check if Extended Thinking should be limited */ export declare function shouldLimitExtendedThinking(): { shouldLimit: boolean; reason?: string; fallbackConfig?: { maxThinkingBlocks: number; maxBudgetTokens: number; }; }; /** * Helper function to check if new conversations should be limited */ export declare function shouldLimitNewConversations(): { shouldLimit: boolean; reason?: string; }; //# sourceMappingURL=gracefulDegradation.d.ts.map