/** * Backend readiness preflight for the `browser_use` tool. * * Reuses the same doctor functions that power the Settings → Browser page so * the agent never tries to launch a backend that the UI already knows is * broken. Produces a structured signal the chat surface can render as a * "Setup browser" card instead of a bare error string. */ import type { Config } from '../config/schema.js'; export type BrowserBackendKind = 'extension' | 'local' | 'cloakbrowser' | 'cdp' | 'cloud'; export type BrowserNotReadyReason = 'extension_not_installed' | 'extension_bridge_offline' | 'extension_not_connected' | 'local_chromium_missing' | 'cloakbrowser_not_installed' | 'cdp_unreachable' | 'cloud_api_key_missing'; export interface BrowserSetupHint { backend: BrowserBackendKind; reason: BrowserNotReadyReason; /** Raw probe diagnostic; surfaced behind a disclosure for debugging. */ detail?: string; /** Deep link into Settings → Browser focused on the right backend tab. */ deepLink: string; } export declare class BrowserNotReadyError extends Error { readonly hint: BrowserSetupHint; constructor(hint: BrowserSetupHint); } /** Map backend → settings tab id (matches `BROWSER_BACKEND_TABS` on the web side). */ export declare function buildBrowserSetupDeepLink(backend: BrowserBackendKind): string; /** * Probe the currently-configured browser backend. Returns `null` when ready. * * Probe budget is small (filesystem stats + loopback fetches with a 2s timeout) * so it's safe to call before every `browser_use` invocation — but callers * typically cache the result for a few seconds to handle bursts. */ export declare function checkBrowserReadiness(cfg: Config | undefined): Promise;