/** * The Checkly CLI's cache directories, in precedence order. A * `CHECKLY_CACHE_DIR` override is the sole location. Otherwise the primary * is the project-local `node_modules/.cache/checkly` (the conventional * tool-cache location — incremental installs leave it alone, and CI setups * that cache `node_modules` persist it automatically), backed by a * per-user platform cache directory (macOS: `~/Library/Caches/checkly`, * Windows: `%LOCALAPPDATA%\checkly\Cache`, elsewhere: * `$XDG_CACHE_HOME/checkly` or `~/.cache/checkly`) that serves as a read * tier and as the write fallback when the project location isn't writable * (e.g. a read-only checkout). */ export declare function resolveCacheDirs(env?: NodeJS.ProcessEnv, projectRoot?: string, platform?: NodeJS.Platform, homedir?: string): string[]; /** * A content-addressed store of package tarballs, keyed by the lockfile's * integrity hash, spread over one or more root directories in precedence * order (typically the project-local cache backed by the per-user one). * Reads consult every root and verify the content, so a corrupt entry * degrades to a cache miss rather than a user-facing error. Writes go to * the first root that accepts them, so an unwritable project tree falls * back to the per-user cache instead of failing — unless the unwritable * root already holds a verifying entry, which satisfies the write as-is. */ export declare class TarballCache { #private; constructor(rootDirs: string | string[]); static default(env?: NodeJS.ProcessEnv, projectRoot?: string, platform?: NodeJS.Platform, homedir?: string): TarballCache; /** * Returns the path of a cached, integrity-verified tarball, or undefined * on a miss. A file that fails verification is deleted best-effort. */ get(integrity: string): Promise; /** * Stores verified tarball content in the first writable root and returns * its path. The write is atomic (temp file + rename), so concurrent * processes sharing the cache never observe a torn file — and because * the store is content-addressed, losing a write race is itself a * success: a write that fails while the destination already holds * content matching the integrity returns that entry instead of erroring. * The caller is responsible for verifying the content against the * lockfile integrity beforehand. */ put(integrity: string, content: Buffer): Promise; } /** * Looks up a tarball in npm's cache (cacache), which stores raw registry * tarballs content-addressed by the same sha512 the lockfile records, at * `content-v2/sha512///`. Returns verified * content, or undefined when absent, unverifiable, or keyed by an * algorithm other than sha512. Read-only: npm's cache is never written to. */ export declare function lookupNpmCacache(integrity: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, homedir?: string): Promise;