UNPKG

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

97 lines • 2.51 kB
/** * Network Resilience Manager * Handles connection timeouts, retry logic, circuit breakers, and connection pooling */ export interface NetworkOptions { timeout?: number; maxRetries?: number; retryDelay?: number; maxConcurrentConnections?: number; keepAlive?: boolean; circuitBreakerThreshold?: number; } export interface NetworkStats { totalRequests: number; successfulRequests: number; failedRequests: number; timeouts: number; circuitBreakerTrips: number; averageResponseTime: number; activeConnections: number; } export declare class NetworkResilienceManager { private static instance; private httpAgent; private httpsAgent; private circuitBreakers; private connectionPool; private stats; private responseTimes; private readonly maxResponseTimesSamples; private constructor(); static getInstance(): NetworkResilienceManager; /** * Make a resilient HTTP request with retries and circuit breaker */ makeRequest<T>(url: string, options?: RequestInit & NetworkOptions): Promise<T>; /** * Make multiple concurrent requests with connection limiting */ makeConcurrentRequests<T>(requests: Array<{ url: string; options?: RequestInit & NetworkOptions; }>, concurrencyLimit?: number): Promise<Array<{ success: boolean; result?: T; error?: Error; }>>; /** * Test network connectivity to a URL */ testConnectivity(url: string, timeoutMs?: number): Promise<boolean>; /** * Check if error is non-retryable */ private isNonRetryableError; /** * Get or create circuit breaker for domain */ private getCircuitBreaker; /** * Extract domain from URL */ private getDomain; /** * Record successful request */ private recordSuccess; /** * Record failed request */ private recordFailure; /** * Record response time for metrics */ private recordResponseTime; /** * Get network statistics */ getNetworkStats(): NetworkStats; /** * Reset circuit breaker for domain */ resetCircuitBreaker(domain: string): void; /** * Reset all circuit breakers */ resetAllCircuitBreakers(): void; /** * Close all connections and cleanup */ cleanup(): void; /** * Sleep utility */ private sleep; } //# sourceMappingURL=network-resilience-manager.d.ts.map