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

116 lines • 3.1 kB
import { Page } from 'playwright'; import { NetworkRequest as LegacyNetworkRequest } from '../types'; export interface NetworkRequest { requestId: string; url: string; method: string; headers: Record<string, string>; postData?: string | null; timestamp: number; frameUrl?: string; } export interface NetworkResponse { requestId: string; url: string; status: number; statusText: string; headers: Record<string, string>; bodySize: number; responseTime: number; timestamp: number; } export interface NetworkError { type: 'http_error' | 'timeout' | 'connection_error'; url: string; status?: number; statusText?: string; message: string; timestamp: number; requestId?: string; } export interface NetworkMetrics { totalRequests: number; successfulRequests: number; failedRequests: number; averageResponseTime: number; totalDataTransferred: number; } export interface NetworkReport { metrics: NetworkMetrics; requests: NetworkRequest[]; responses: NetworkResponse[]; errors: NetworkError[]; summary: string; insights: string[]; } /** * NetworkCoordinator - Consolidates network request/response debugging functionality * * Provides unified interface for: * - Network request interception and monitoring * - Response capture and analysis * - Performance metrics tracking * - Error detection and reporting * - Network debugging report generation */ export declare class NetworkCoordinator { private isMonitoring; private capturedRequests; private capturedResponses; private networkErrors; private requestTimings; private currentPage?; private routeHandler?; private responseHandler?; constructor(); /** * Setup network monitoring on the given page */ setupNetworkMonitoring(page: Page): Promise<void>; /** * Handle intercepted network requests */ private handleRequest; /** * Handle network responses */ private handleResponse; /** * Get captured network requests */ getCapturedRequests(): NetworkRequest[]; /** * Get API requests (alias for getCapturedRequests for consistency with LocalDebugEngine) * Returns requests in the legacy format expected by ReactStateCoordinator */ getApiRequests(): LegacyNetworkRequest[]; /** * Get captured network responses */ getCapturedResponses(): NetworkResponse[]; /** * Get detected network errors */ getNetworkErrors(): NetworkError[]; /** * Get network performance metrics */ getNetworkMetrics(): NetworkMetrics; /** * Generate comprehensive network debugging report */ generateNetworkReport(): NetworkReport; /** * Cleanup network monitoring and reset state */ cleanup(): void; /** * Generate unique request ID */ private generateRequestId; /** * Find request ID by URL (best effort matching) */ private findRequestId; } //# sourceMappingURL=network-coordinator.d.ts.map