export type BrowserAgentStep = { kind: "step"; n: number; attempt?: number; url?: string | null; }; export type BrowserAgentRetry = { kind: "retry"; reason?: string | null; }; export type BrowserAgentDone = { kind: "done"; /** True only when the agent said it succeeded AND the end state backs it up. */ ok: boolean; /** Whether the end state backs up the claim. `ok` without this is a claim. */ verified: boolean; unverifiedReason?: string | null; claimed?: string | null; url?: string | null; title?: string | null; visitedUrls?: string[]; steps?: number; ms?: number; error?: string; }; export type BrowserAgentEvent = BrowserAgentStep | BrowserAgentRetry | BrowserAgentDone; /** * Bring the service up if it is not already. * * Started detached and unref'd: a browser task outliving the turn that asked * for it is correct — the warm browser is the whole point — and a koi restart * should not kill a Chrome the user is watching. */ /** * Bring the browser-agent service up ahead of any task. Called at gateway * boot: without it the FIRST browser task of a session paid the whole cold * chain in the middle of a request — spawning python, importing browser-use * (measured 12-20s on this machine), then launching Chrome — while the * person sat watching a spinner. Warmed at boot, a task starts acting in * well under a second. */ export declare function prewarmBrowserAgent(): Promise; /** * Run a natural-language browser task. * * `onEvent` receives each step as it happens — feed it to the work strip so the * person can see which page it is on rather than watching a spinner. */ export declare function runBrowserTask(task: string, options?: { maxSteps?: number; onEvent?: (event: BrowserAgentEvent) => void; }): Promise; /** * The one-line summary the koi is allowed to say out loud. * * It always names the page actually reached, and when the end state does not * support the claim it SAYS SO. This is the sentence that stops "I opened it * for you" from being said about a page that never opened. */ export declare function describeBrowserTaskResult(result: BrowserAgentDone): string;