import { type BrowserChannel } from './pinnedChrome'; /** Primary receipt dir on the WSL disk: reboot-surviving (never os.tmpdir(), which WSL wipes on VM restart). */ export declare function receiptDir(env?: NodeJS.ProcessEnv): string; /** The pre-fix location, still read (and cleaned) so receipts from older CLI builds are not stranded. */ export declare function legacyReceiptDir(): string; export declare function runningInWsl(): boolean; /** Is the interop surface this module needs actually present? */ export declare function windowsInteropAvailable(): boolean; export interface WinChromeLaunch { /** `http://127.0.0.1:` — hand to chromium.connectOverCDP. */ cdpUrl: string; pid: number; profileWin: string; profileId: string; /** The chrome.exe this launch runs (a Windows path) and where it came from (recorded in the bundle). */ executablePath: string; channel: BrowserChannel; /** Windows pid of this launch's watchdog (0 when none could be started). Ours: captured at launch. */ watcherPid: number; /** The durable receipt this launch wrote (pid, owner identity, profile). */ receipt: Receipt; /** Kills exactly the process tree this launch started and removes its profile. Idempotent. */ kill(): Promise; } /** The Windows-side cache of the pinned Chrome for Testing: `%LOCALAPPDATA%\\helix\\vqa-chrome` (shared with * scripts/win-browser.sh on the VRPC box, so one install serves both). */ export declare function windowsPinCacheWin(local: string): string; /** * The chrome.exe a Windows render runs: HELIX_VQA_WIN_CHROME, else the pinned current-stable Chrome for Testing (win64), * installed from WSL into the Windows-side cache on first use. Never Playwright's bundled pre-stable Chromium (measured * 2026-10-03: chromium-1243 = 153.0.8010.12 carries a WGSL compiler bug no stable user has). */ export declare function findWindowsChrome(opts?: { refresh?: boolean; }): Promise<{ executablePath: string; channel: BrowserChannel; version?: string; }>; export interface Receipt { pid: number; owner: number; /** Linux boot id + owner start time: a pid alone is recycled the moment WSL restarts. Absent on legacy receipts. */ bootId?: string; ownerStart?: string; distro?: string; profileWin: string; profileId: string; startedAt?: number; } /** Is the Linux process that launched this Chrome still the same live process? Unknown counts as alive (never reap * on a guess): a receipt from another WSL distro cannot be judged from here. */ export declare function ownerAlive(rec: Receipt, now?: { bootId?: string; distro?: string; }): boolean; export declare function validReceipt(rec: unknown): rec is Receipt; /** Everything the reaper touches, injectable so the safety properties are unit-testable without Windows. */ export interface ReaperDeps { /** Receipt dirs to read, as plain directories (WSL-disk dirs, the Windows-side dir translated to /mnt/c/...). */ dirs: string[]; ownerAlive(rec: Receipt): boolean; /** Command line of the Windows process with this pid; '' when there is no such process; null when it could not be asked. */ commandLine(pid: number): string | null; killTree(pid: number): void; removeProfile(profileWin: string): void; } /** Reap Chromes whose owning Linux process is gone. Touches only pids WE recorded, only after the owner is provably * dead, and only while that pid's command line still carries our profile id; a recycled pid is never signalled. */ export declare function sweepReceipts(deps: ReaperDeps): number; /** Reap Windows Chromes whose owning Linux process died without cleaning up (SIGKILL, timeout, WSL crash). */ export declare function sweepStaleWindowsChromes(): number; /** The Windows-side watchdog. Pure string so its safety properties are unit-testable: it signals only the captured * pid, only while that pid's command line carries our profile id, never by name. */ export declare function watchdogScript(o: { pid: number; profileId: string; profileWin: string; heartbeatWin: string; receiptWin: string; }): string; /** Linux half of the heartbeat: touches the file while the owner lives and the file exists, then exits by itself. */ export declare function heartbeatLoop(): string; export interface WinChromeOptions { args: string[]; /** Seconds to wait for DevToolsActivePort. */ startTimeoutMs?: number; } /** Memory-saving defaults for a throwaway headless render (Windows commit is the scarce resource on the VRPC box). * None of these touches rendering or the GPU path; caller args come after, so a caller can still override. */ export declare const MEMORY_ARGS: readonly string[]; export declare function launchWindowsChrome(opts: WinChromeOptions): Promise;