import type { BrowserProvisionIo, BrowserProvisionReport } from './browser-types.js'; export interface EnsureBrowserOptions { /** * Set false to report what is present without downloading anything. * * This covers the DRIVER install as well as the browser download. `status` is * a read-only action in every place the tool is gated * (BROWSER_TOOL_READ_ONLY_ACTIONS, and READ_ONLY_BROWSER_ACTIONS in the * permission classifier), and it says so in the CLI help, a status call that * fetched a package from the registry and wrote it into the owner's home was * doing exactly what the read-only classification promises it will not, and * it also destroyed the one thing status is for: observing whether a driver is * actually there. */ readonly allowDownload?: boolean; readonly installTimeoutMs?: number; /** Reinstall even when the cached binary verifies. Used by explicit repair. */ readonly forceReinstall?: boolean; } export interface InstallRuntimeCandidate { readonly command: string; /** Extra environment this candidate needs. Empty for an ordinary interpreter. */ readonly env: Readonly>; } /** * Runtimes able to execute the Playwright install CLI, most specific first. * * The browser install step is a Node-style script (the driver's cli.js), so * something has to interpret it. Only looking for `bun` or `node` on PATH made * the managed browser download unreachable on exactly the machine this whole * capability is built for: a downloaded binary, no package manager, no * interpreter installed. On such a machine the install step failed instantly * and the agent could only fall back to a system Chrome/Chromium, so a user * with neither got no browser at all, which is the same "browser control does * not exist in the shipped artifact" outcome shipping the driver was meant to * end. * * A `bun build --compile` executable already CONTAINS a Bun runtime, and * BUN_BE_BUN=1 makes it behave as the bun CLI instead of running its embedded * entry point. So the agent binary interprets the install CLI itself, and goes * first: an install that depends on nothing outside the artifact is the one * most likely to work. */ export declare function installRuntimeCandidatesFor(execPath: string): readonly InstallRuntimeCandidate[]; export declare function installRuntimeCandidates(): readonly InstallRuntimeCandidate[]; /** * One line naming the setup a provisioning act actually performed, or null when * everything was already in place. * * Provisioning that installs a driver or downloads a browser can take minutes. * A call that quietly did that and then returned as though nothing happened * reads as a slow browser rather than as one-act setup, so every result that * involved real work carries this receipt back to the caller. */ export declare function describeProvisionWork(report: BrowserProvisionReport | null): string | null; /** * Ensures a usable browser binary exists, installing it if needed. * * Concurrent callers share one provisioning act: a second browser call arriving * mid-download waits for the same install instead of starting a competing one. */ export declare function ensureBrowserBinary(io: BrowserProvisionIo, options?: EnsureBrowserOptions): Promise; //# sourceMappingURL=browser-provisioning.d.ts.map