import type { BrowserDriverResolution, BrowserProvisionIo, CommandOutcome } from './browser-types.js'; /** * The driver version this build expects. Kept in step with the dependency in * package.json by a test, because a compiled binary has no package.json to read * and would otherwise install whatever npm happened to consider latest. */ export declare const DRIVER_VERSION = "1.62.0"; interface DriverModule { readonly chromium: { readonly executablePath: () => string; }; } /** Which surface's storage a driver search or install belongs to. */ export interface BrowserDriverLocation { /** * The product's storage root segment under `~/.goodvibes/`, the formalized * surface-scoped mechanism, so no product's driver lands in another's * directory and this module never has to know any product's name. */ readonly surfaceRoot: string; /** Home directory owning that storage. Defaults to this process's HOME. */ readonly homeDirectory?: string | undefined; } /** * Where the driver lives when this build is a compiled binary. * * A single-file executable has no node_modules, so `require('playwright-core')` * finds nothing and browser control would silently not exist in the shipped * artifact. These are the places a driver can be instead: shipped beside the * executable, provisioned into the surface's own storage, or pointed at * explicitly. Resolution tries the ordinary module path first, so an npm * install behaves exactly as before. */ export declare function driverSearchDirectories(location?: BrowserDriverLocation): readonly string[]; /** Where a driver is installed for this surface when nothing ships one. */ export declare function managedDriverRoot(homeDirectory: string, surfaceRoot: string): string; /** * A candidate directory counts as a driver only if it holds everything the * driver is used for: the manifest, the module entry, AND the CLI the browser * install step executes. * * Requiring cli.js here is load-bearing. The search stops at the first match, * so a directory that satisfied a weaker test, a partial extraction, or an * older release's incomplete driver, used to shadow a perfectly good driver * further down the list and could not be recovered from: resolveDriver would * reject it for the missing cli.js, provisioning would install a working copy * into the managed directory, and the search would hand back the broken one * again on the very next call. Skipping an unusable candidate lets the next one * win, and lets self-provisioning actually take effect. */ export declare const DRIVER_REQUIRED_FILES: readonly string[]; /** The driver package directory, wherever it turns out to be. */ export declare function findDriverDirectory(location: BrowserDriverLocation | undefined, searchDirectories?: readonly string[]): string | null; export declare function loadDriverModule(location: BrowserDriverLocation): DriverModule | null; export declare function resolveDriver(location: BrowserDriverLocation): BrowserDriverResolution; /** * Playwright's own browser cache location, honoring the standard override. * The home directory is passed in rather than discovered, so the cache a build * uses is always something its composition root chose. */ export declare function defaultBrowsersPath(homeDirectory: string): string; /** * Runs one command and waits for it. * * The timeout signals THIS child and nothing else: no process-group signal, no * name matching, no sweep of other processes. A provisioning timeout can never * reach a browser, the failure mode that killed a live logged-in browser * session before this capability existed. */ export declare function runCommand(command: string, args: readonly string[], options: { readonly timeoutMs: number; readonly env?: Readonly>; readonly cwd?: string; }): Promise; export interface BrowserProvisionIoOptions { /** Home directory owning the managed browser cache. */ readonly homeDirectory: string; /** * The product's storage root segment under `~/.goodvibes/`. Required, because * a self-installed driver has to land somewhere a specific product owns. */ readonly surfaceRoot: string; /** * What to tell someone whose driver is neither present nor installable, * phrased for how THIS build was installed. Optional: without one the * provisioning policy falls back to a generic sentence. */ readonly driverFix?: (() => string) | undefined; } /** Where the driver package is published. Pinned to the version this build expects. */ export declare function driverTarballUrl(version?: string): string; export declare function createBrowserProvisionIo(options: BrowserProvisionIoOptions): BrowserProvisionIo; export {}; //# sourceMappingURL=browser-provision-io.d.ts.map