import { Logger } from 'pino'; export interface CDPBrowserInfo { id: string; title: string; type: string; url: string; webSocketDebuggerUrl: string; version: string; description?: string; } export interface CDPConnectionOptions { host: string; port: number; timeout?: number; maxRetries?: number; retryDelay?: number; } export interface CDPContext { id: string; url: string; title: string; type: string; isActive: boolean; createdAt: number; lastUsed: number; } export declare class CDPBrowserManager { private contexts; private activeConnections; private reconnectAttempts; private logger; private config; constructor(logger: Logger, config: any); /** * Detects running browsers with CDP enabled */ detectBrowsers(): Promise; /** * Detects browsers from remote CDP server */ private detectRemoteBrowsers; /** * Detects browsers locally by scanning ports */ private detectLocalBrowsers; /** * Checks if a browser is running on a specific port */ private checkBrowserPort; /** * Connects to a CDP browser */ connectToBrowser(browserInfo: CDPBrowserInfo, options?: CDPConnectionOptions): Promise; /** * Establishes WebSocket connection to CDP browser */ private establishConnection; /** * Initializes CDP session with basic commands */ private initializeCDPSession; /** * Sends a CDP command via WebSocket */ sendCDPCommand(ws: WebSocket, command: any): Promise; /** * Handles incoming CDP messages */ private handleCDPMessage; /** * Handles console messages from CDP */ private handleConsoleMessage; /** * Handles connection close */ private handleConnectionClose; /** * Attempts to reconnect to a CDP browser */ private attemptReconnection; /** * Navigates to a URL using CDP */ navigateToUrl(contextId: string, url: string): Promise; /** * Waits for navigation to complete */ private waitForNavigation; /** * Executes JavaScript in the browser context */ executeScript(contextId: string, script: string): Promise; /** * Takes a screenshot using CDP */ takeScreenshot(contextId: string, options?: { fullPage?: boolean; format?: string; }): Promise; /** * Gets page content using CDP */ getPageContent(contextId: string): Promise; /** * Closes a CDP context */ closeContext(contextId: string): Promise; /** * Gets all active contexts */ getActiveContexts(): CDPContext[]; /** * Gets context information */ getContext(contextId: string): CDPContext | undefined; /** * Cleanup method */ cleanup(): Promise; /** * Utility method for sleeping */ private sleep; } //# sourceMappingURL=cdp-browser-manager.d.ts.map