/**
 * Chrome Discovery Service
 *
 * Auto-discovers running Chrome processes and provides CDP (Chrome DevTools
 * Protocol) connection for Live Attach mode. Matches OpenClaw's one-toggle
 * attach capability while preserving Crewly's privacy/stealth advantages.
 *
 * Discovery strategy:
 * 1. Scan for Chrome processes with --remote-debugging-port
 * 2. If none, check common CDP ports (9222, 9229)
 * 3. If Chrome is running without CDP, offer to launch a CDP-enabled instance
 *
 * @see https://github.com/stevehuang0115/crewly/issues/175
 * @module services/browser/chrome-discovery.service
 */
/** Discovered Chrome instance with CDP info */
export interface ChromeInstance {
    /** Process ID */
    pid: number;
    /** CDP WebSocket URL (e.g., ws://127.0.0.1:9222/devtools/browser/xxx) */
    wsUrl?: string;
    /** CDP HTTP endpoint (e.g., http://127.0.0.1:9222) */
    httpEndpoint: string;
    /** Remote debugging port */
    port: number;
    /** Chrome profile directory in use */
    profileDir?: string;
    /** Whether this is the user's primary Chrome instance */
    isPrimary: boolean;
    /** Browser version string */
    version?: string;
}
/** Result of Chrome discovery scan */
export interface DiscoveryResult {
    /** Whether any Chrome with CDP was found */
    found: boolean;
    /** Discovered Chrome instances with CDP enabled */
    instances: ChromeInstance[];
    /** Whether Chrome is running at all (even without CDP) */
    chromeRunning: boolean;
    /** Suggestion for the user if no CDP instance found */
    suggestion?: string;
}
/**
 * ChromeDiscoveryService auto-discovers Chrome browser instances
 * with CDP enabled for Live Attach mode.
 */
export declare class ChromeDiscoveryService {
    private static instance;
    private readonly logger;
    private constructor();
    /**
     * Get the singleton instance.
     *
     * @returns ChromeDiscoveryService instance
     */
    static getInstance(): ChromeDiscoveryService;
    /**
     * Reset singleton (for testing).
     */
    static resetInstance(): void;
    /**
     * Discover all Chrome instances with CDP enabled.
     *
     * Scans running processes and common CDP ports to find attachable
     * Chrome instances. Returns connection info for each.
     *
     * @returns Discovery result with found instances
     */
    discover(): Promise<DiscoveryResult>;
    /**
     * Attempt to connect to CDP on a specific port and retrieve instance info.
     *
     * @param port - Port to probe
     * @returns ChromeInstance if CDP is active, null otherwise
     */
    probePort(port: number): Promise<ChromeInstance | null>;
    /**
     * Scan running processes for Chrome instances with --remote-debugging-port.
     *
     * @returns Array of partial ChromeInstance with PID and port info
     */
    scanProcesses(): Array<{
        pid: number;
        port: number;
        profileDir?: string;
        isPrimary: boolean;
    }>;
    /**
     * Check if any Chrome process is running (with or without CDP).
     *
     * @returns True if Chrome is running
     */
    isChromeRunning(): boolean;
    /**
     * Find Chrome binary path for the current platform.
     *
     * @returns Path to Chrome binary, or null if not found
     */
    findChromeBinary(): string | null;
    /**
     * Get the default user Chrome profile directory.
     *
     * @returns Path to default Chrome user data dir
     */
    getDefaultProfileDir(): string;
}
//# sourceMappingURL=chrome-discovery.service.d.ts.map