/** * Per-step AI driver. Asks a `DriverProvider` what to do next, every * step (subject to budget + timeout). The provider sees the page * screenshot, the candidate list, recent action history, and the most * recent invariant violations — enough to reason about which interaction * is most likely to surface a bug. * * Soft-failure protocol: provider returns `null`, throws, or times out → * the driver returns `null` so the outer composite/fallback can defer * to a cheaper driver (e.g. weighted-random). Soft failures still cost * budget (the wall clock was spent). */ import { DriverBudget, type DriverBudgetOptions } from "./budget.js"; import type { Driver, DriverProvider, ScreenshotMode } from "./types.js"; export interface AiDriverOptions { provider: DriverProvider; /** Per-call timeout (ms). Default: 8000. */ timeoutMs?: number; /** Default: "viewport". */ screenshotMode?: ScreenshotMode; /** Skip when fewer than N candidates. Default: 2. */ minCandidatesToConsult?: number; /** Optional goal string forwarded to the provider. */ goal?: string; /** Cost ceiling — call count / USD. Default: unlimited. */ budget?: DriverBudget | DriverBudgetOptions; } export declare function aiDriver(opts: AiDriverOptions): Driver; /** Exposed for tests / callers that want to inspect spend. */ export declare function aiDriverBudget(driver: Driver): DriverBudget | null; //# sourceMappingURL=ai-driver.d.ts.map