import { WebSocket } from "ws";
export interface CDPEvent {
    method: string;
    params: Record<string, unknown>;
    timestamp: number;
    sessionId?: string;
}
export interface CDPConnection {
    ws: WebSocket;
    sessionId: string | null;
    nextId: number;
}
export declare class CDPMonitor {
    private browser;
    private connection;
    private debugPort;
    private eventHandlers;
    private profileDir;
    private screenshotDir;
    private logger;
    private debug;
    private browserPath?;
    private isShuttingDown;
    private pendingRequests;
    private networkIdleTimer;
    private pluginReactScan;
    private cdpUrl;
    private lastScreenshotTime;
    private minScreenshotInterval;
    private navigationInProgress;
    private chromePids;
    private onWindowClosedCallback;
    private appServerPort?;
    private mcpServerPort?;
    private headless;
    constructor(profileDir: string, screenshotDir: string, logger: (source: string, message: string) => void, debug?: boolean, browserPath?: string, pluginReactScan?: boolean, appServerPort?: string, mcpServerPort?: string, debugPort?: number, headless?: boolean);
    private debugLog;
    /**
     * Check if a URL should be monitored (i.e., it's from the user's app server, not dev3000's MCP server or external sites)
     */
    private shouldMonitorUrl;
    start(): Promise<void>;
    getCdpUrl(): string | null;
    getChromePids(): number[];
    setOnWindowClosedCallback(callback: (() => void) | null): void;
    private discoverChromePids;
    private createLoadingPage;
    private setupRuntimeCrashMonitoring;
    /**
     * Kill any existing Chrome process using this profile directory.
     * This prevents issues where Chrome defers to an existing instance
     * instead of starting a new one with CDP enabled.
     */
    private killExistingChromeWithProfile;
    private launchChrome;
    private connectToCDP;
    private attemptReconnect;
    private sendCDPCommand;
    private enableCDPDomains;
    private setupEventHandlers;
    private onCDPEvent;
    private handleCDPMessage;
    navigateToApp(port: string): Promise<void>;
    private setupInteractionTracking;
    private startInteractionPolling;
    private scheduleNetworkIdleScreenshot;
    private takeScreenshot;
    executeInteraction(interaction: {
        type: string;
        coordinates?: {
            x: number;
            y: number;
        };
        key?: string;
        code?: string;
        modifiers?: Record<string, unknown>;
        to?: {
            x: number;
            y: number;
        };
        from?: {
            x: number;
            y: number;
        };
    }): Promise<void>;
    shutdown(): Promise<void>;
    private killInstanceChromeProcesses;
}
//# sourceMappingURL=cdp-monitor.d.ts.map