import type { BrowserContext } from "playwright-core";
import type { DipclawConfig } from "../config/types.js";
/**
 * CloakBrowser backend (cs-only) — a fully self-contained, extension-free
 * browser backend. Launches the C++-patched stealth Chromium shipped by the
 * `cloakbrowser` npm package via Playwright's persistent-context API, so the
 * rest of the agent (actions/snapshot/dispatch) keeps operating on a standard
 * Playwright `BrowserContext` — same as the chrome+CDP path.
 *
 * Unlike chrome mode, this backend does NOT load the OmniFlow extension at all.
 * Everything it needs comes from the养号 session blob, read in Node:
 *  - proxy     -> CloakBrowser `--proxy-server` flag
 *  - timezone  -> CloakBrowser `timezone` option (undetectable binary flag)
 *  - cookies   -> Playwright `context.addCookies()` (native, no extension)
 *  - fingerprint (canvas/WebGL/audio/webdriver) -> CloakBrowser binary
 *  - behavioral -> humanize.ts (unchanged, backend-agnostic)
 *
 * Dropping the extension removes the "unpacked extension present" fingerprint
 * signal, which is the whole point of CloakBrowser's stealth posture. The blob
 * is the same one chrome mode imports via OmniFlow, so both backends route
 * through the identical exit IP and login state.
 *
 * The cloakbrowser package is imported lazily so chrome-mode workers never load
 * it, and `ensureBinary()` pre-fetches the ~200MB binary if a host was
 * provisioned before the deploy-time `postinstall` pre-download ran. The binary
 * cache (`~/.cloakbrowser`, override `CLOAKBROWSER_CACHE_DIR`) is shared across
 * all worker processes on the host, so this downloads at most once per host.
 */
export interface CloakBrowserLaunchParams {
    userDataDir: string;
    config: DipclawConfig;
}
/**
 * Launch a CloakBrowser persistent context, inject养号 cookies, and return it.
 * Cookies are injected (awaited) before the context is handed back, so the
 * first task navigation already carries the login state — no race where a page
 * opens before cookies land.
 */
export declare function launchCloakBrowserContext(params: CloakBrowserLaunchParams): Promise<BrowserContext>;
