import { type InstallOutcome } from './web-install-types.js'; export { probeBrowserInstalled } from './browser-cache-probe.js'; export type { BrowserProbe, InstallOutcome } from './web-install-types.js'; /** * R2: the size of the one-time download, named so it is never a surprise. * * Measured, not guessed (perf baseline S3, P6): one install of the pin writes * **704 MiB** — `chromium-1243` 433 MiB plus `chromium_headless_shell-1243` * 271 MiB. The old "~150–300 MB" was the wire estimate and understated the * figure the machine actually pays. Nothing reaps obsolete revisions either, so * each pin bump adds another ~700 MiB beside the old one (1.4 GiB held here). */ export declare const INSTALL_SIZE_WARNING = "downloading chromium (~700 MB on disk, one time)"; /** * `PEAKS_WEB_DISABLED=1`, and nothing else. `'0'`, `'true'`, `''` and `'1 '` * are all "not disabled" — the flag is an explicit opt-out, so a typo must fail * towards the local browser rather than silently skipping it. */ export declare function isWebDisabled(env: NodeJS.ProcessEnv): boolean; /** * The exact argv of the one-time download (tech-doc §3.3): * `npx --yes --package playwright@ -- playwright install chromium`, with * `--force` before the browser name for the recovery path. * * Exported so the exact arguments are asserted by a unit test WITHOUT spawning * anything — the download is ~700 MB and must not be a test's side effect. */ export declare function installCommandLine(options?: { force?: boolean; }): string[]; /** * Take the chromium install lock (O_EXCL). `false` when another process holds a * live lock; a STALE one — owner pid dead, unreadable body, or older than * `INSTALL_LOCK_STALE_MS` — is reclaimed and retried once (R6). * * **The reclaim is a rename, not an unlink** (R15). `O_EXCL` serializes the * *create*, but only if the removal that precedes it cannot be replayed against * a fresh file: two callers that both read the same dead-pid body used to * interleave as `A unlink → A create → B unlink (A's FRESH lock) → B create`, * leaving both holding. `rename` gives the reclaim the same atomicity the * create has — a given file can only be moved once, so exactly one reclaimer * wins — and the O_EXCL create serializes whatever follows. */ export declare function acquireInstallLock(): boolean; /** Release the install lock, but only when this process is its owner. */ export declare function releaseInstallLock(): void; /** * Run `playwright install chromium` once, under the lock. Returns an outcome on * every path — a held lock, a non-zero exit, a timeout, a thrown spawn — so a * caller never sees an exception from here (R2). * * **Callers are CLIs, never the daemon** (R3). The spawn below blocks the * event loop for the whole download (one real acquisition measured 170 s), so * running it inside the daemon starved `/health` — `status` read `orphaned`, * `stop` could not prove ownership and left the daemon running — while the CLI * gave up at 30 s and reported failure. Acquisition is therefore delegated: the * daemon answers the op with the tier-3 envelope and this verb, on the human's * channel, performs the download. */ export declare function installChromium(options?: { readonly force?: boolean; }): Promise;