export declare const CFT_LAST_KNOWN_GOOD_URL = "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json"; export type CftPlatform = 'mac-arm64' | 'mac-x64' | 'linux64' | 'win64'; /** Re-resolve stable when the pin is older than this (best effort: an offline host keeps the build it has). */ export declare const PIN_MAX_AGE_MS: number; export interface PinnedChrome { version: string; platform: CftPlatform; /** Path as the launching OS sees it (a Windows path for win64 installed from WSL). */ executablePath: string; /** Where the install lives as THIS process sees it. */ dir: string; resolvedFrom: string; resolvedAt: string; } export declare function cftPlatform(platform?: NodeJS.Platform, arch?: string): CftPlatform; /** Path of the executable inside an unpacked CfT zip, relative to the install dir. */ export declare function executableRel(platform: CftPlatform): string; /** Default cache dir for this OS. `HELIX_VQA_CHROME_CACHE` overrides. */ export declare function defaultCacheDir(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, home?: string): string; /** The current Stable build for a platform, from the official last-known-good endpoint. Pure over the parsed JSON. */ export declare function stableFromJson(json: unknown, platform: CftPlatform): { version: string; url: string; }; export declare function resolveStable(platform: CftPlatform, fetchImpl?: typeof fetch): Promise<{ version: string; url: string; }>; /** The pin recorded in `cacheDir`, if its executable is still there. `toLocal` maps a recorded path to one this process can stat. */ export declare function readPin(cacheDir: string, platform: CftPlatform): PinnedChrome | null; export interface InstallOptions { platform?: CftPlatform; /** Cache dir as THIS process sees it. */ cacheDir?: string; /** Turn the local executable path into the one the launching OS uses (WSL → Windows path for win64). */ toLaunchPath?: (localPath: string) => string; /** Re-resolve stable even when a fresh pin exists. */ refresh?: boolean; log?: (msg: string) => void; fetchImpl?: typeof fetch; } /** * Make sure the current-stable Chrome for Testing is installed and pinned; return it. Idempotent and cheap when the * pin is fresh (no network). A pin older than PIN_MAX_AGE_MS (or `refresh`) re-resolves stable; if that fails the * existing pin is kept, so an offline host still renders on the last stable it had. */ export declare function ensurePinnedChrome(opts?: InstallOptions): Promise; /** Where the executable came from, recorded in every bundle as `harness.browser.channel`. */ export type BrowserChannel = 'pinned-cft' | 'env-override' | 'explicit' | 'remote-cdp'; export interface ResolvedExecutable { executablePath: string; channel: BrowserChannel; pinned?: PinnedChrome; } /** * The executable a local (non-CDP) render launches: an explicit path, else `HELIX_VQA_CHROME`, else the pinned * current-stable Chrome for Testing (installed on first use). Never Playwright's bundled build, never the system Chrome. */ export declare function resolveVqaExecutable(opts?: { explicit?: string; env?: NodeJS.ProcessEnv; log?: (m: string) => void; }): Promise;