/** * Where user-facing browser caches (CloakBrowser binaries, CDP launcher * profiles, etc.) are allowed to live. * * Restricting the writable set to the user's home directory makes it safe to * expose `cacheDir` / `userDataDir` over the gateway HTTP API: an attacker who * already controls the gateway session cannot trick the install/launch flow * into seeding files under `/etc`, `/usr/local`, etc. * * Leading `~` and `~/` are expanded against the current process owner's home. */ export interface CacheDirCheckOk { ok: true; resolved: string; } export interface CacheDirCheckErr { ok: false; message: string; resolved: string; } export type CacheDirCheck = CacheDirCheckOk | CacheDirCheckErr; export declare function expandHome(input: string): string; /** * Returns `{ ok: true, resolved }` when `input` is an absolute (or `~`-rooted) * path that resolves inside the user's home directory. Empty / missing input * is allowed (callers fall back to their own default). */ export declare function checkCacheDir(input: string | undefined | null): CacheDirCheck; /** Throws when the path violates the policy. */ export declare function assertCacheDir(input: string | undefined | null): string;