/**
 * Extension browser provider — connects to the xopc Chrome Extension via WebSocket.
 *
 * The xopc process starts a WebSocket server; the Chrome Extension connects as a client.
 * Commands are sent over the WS connection and results are returned asynchronously.
 */
export type ExtensionAction = 'open' | 'navigate' | 'reload' | 'back' | 'forward' | 'get_url' | 'get_title' | 'state' | 'snapshot' | 'screenshot' | 'content' | 'evaluate' | 'click' | 'type' | 'scroll' | 'wait' | 'query_selector' | 'query_selector_all' | 'wait_for_selector' | 'mouse_move' | 'mouse_click' | 'mouse_down' | 'mouse_up' | 'mouse_wheel' | 'keys' | 'keyboard_type' | 'keyboard_down' | 'keyboard_up' | 'keyboard_insert_text' | 'get_bounding_box' | 'get_element_text' | 'get_element_attribute' | 'get_elements_count' | 'set_input_files' | 'scroll_into_view' | 'set_viewport_size' | 'get_viewport_size' | 'network_start' | 'network_events' | 'network_stop' | 'dialog' | 'get_cookies' | 'set_cookies' | 'clear_cookies' | 'close' | 'new_tab' | 'list_tabs' | 'cdp' | 'ping';
export interface ExtensionCommand {
    id: string;
    action: ExtensionAction;
    tabId?: number;
    args?: Record<string, unknown>;
    timeout?: number;
}
export interface ExtensionResult {
    id: string;
    ok: boolean;
    data?: unknown;
    error?: string;
    durationMs?: number;
}
export interface ExtensionProviderConfig {
    /** WebSocket server port. Default: 19820. */
    port?: number;
    /** Host to bind. Default: 127.0.0.1. */
    host?: string;
    /** Timeout waiting for extension connection (ms). Default: 30000. */
    connectionTimeout?: number;
    /** Default command timeout (ms). Default: 30000. */
    commandTimeout?: number;
}
/**
 * Manages a WebSocket server that the Chrome Extension connects to.
 * Sends commands and receives results over the connection.
 */
export declare class ExtensionBrowserProvider {
    readonly name = "extension";
    private server;
    private wss;
    private clientWs;
    private pending;
    private commandCounter;
    private connected;
    private readonly config;
    private connectionWaiters;
    constructor(config?: ExtensionProviderConfig);
    /** Start the WebSocket server and wait for the extension to connect. */
    start(): Promise<void>;
    /** Wait for the Chrome Extension to connect. */
    waitForConnection(timeoutMs?: number): Promise<void>;
    /** Send a command to the extension and wait for the result. */
    sendCommand(action: ExtensionAction, args?: Record<string, unknown>, options?: {
        tabId?: number;
        timeout?: number;
    }): Promise<ExtensionResult>;
    /** Whether the extension is currently connected. */
    isConnected(): boolean;
    /** Close the Chrome Extension client without stopping the WebSocket server. */
    disconnectClient(): void;
    /** Shutdown the WebSocket server. */
    shutdown(): Promise<void>;
    private _handleMessage;
}
