ai-debug-local-mcp
Version:
🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh
75 lines • 2.55 kB
TypeScript
/**
* Session Stability Manager - P0 Fix for Session Disconnect Issues
*
* Addresses critical feedback:
* - Sessions consistently disconnect after 20-40 seconds
* - "Session is unhealthy or disconnected" errors
* - Need automatic session recovery/reconnection
*/
export interface SessionHealthStatus {
isHealthy: boolean;
reason?: string;
canRecover: boolean;
lastActivity: Date;
connectionAttempts: number;
browserConnected: boolean;
pageResponsive: boolean;
}
export interface SessionRecoveryOptions {
maxRetries: number;
retryDelayMs: number;
preserveUrl: boolean;
restoreContext: boolean;
timeoutMs: number;
}
export declare class SessionStabilityManager {
private static healthChecks;
private static recoveryInProgress;
private static healthMonitorInterval;
private static DEFAULT_RECOVERY_OPTIONS;
/**
* P0 FIX: Enhanced session health validation with auto-recovery
* Replaces the timeout-prone validateSessionHealth in SessionDebugFixes
*/
static validateSessionWithRecovery(session: any, sessions: Map<string, any>, options?: Partial<SessionRecoveryOptions>): Promise<{
isHealthy: boolean;
session: any;
recovered: boolean;
}>;
/**
* Fast, non-blocking session health check
* Avoids timeout issues with page.title() calls
*/
private static checkSessionHealth;
/**
* P0 FIX: Automatic session recovery
* Reconnects browser and restores session context without losing state
*/
private static recoverSession;
/**
* P0 FIX: Proactive session health monitoring
* Monitors sessions and attempts recovery before users encounter issues
*/
static startHealthMonitoring(sessions: Map<string, any>, intervalMs?: number): void;
static stopHealthMonitoring(): void;
/**
* Get health status for debugging
*/
static getSessionHealthStatus(sessionId: string): SessionHealthStatus | null;
/**
* Get health overview for all sessions
*/
static getHealthOverview(): {
totalSessions: number;
healthySessions: number;
unhealthySessions: number;
recoveringSessions: number;
details: Map<string, SessionHealthStatus>;
};
private static updateHealthStatus;
/**
* Enhanced error response with recovery context
*/
static createRecoveryErrorResponse(sessionId: string, error: Error, recoveryAttempted?: boolean): any;
}
//# sourceMappingURL=session-stability-manager.d.ts.map