/** Default cap on a single `direnv` invocation. The first export for a devenv * `.envrc` can build a shell; callers may raise this via `bash.direnvLoadTimeoutMs`. */ export declare const DEFAULT_DIRENV_TIMEOUT_MS = 30000; /** Walk up from `startDir` to the nearest directory containing an `.envrc`. */ export declare function findEnvrc(startDir: string): Promise; export interface DirenvExportDiff { /** Variables direnv sets to a concrete value. */ readonly set: Readonly>; /** Variables direnv removes (JSON `null`). */ readonly unset: readonly string[]; } /** Parse `direnv export json` output (`{VAR: value|null}`) into set/unset halves. */ export declare function parseDirenvExport(jsonText: string): DirenvExportDiff; /** Test-only: filtered parent-env baseline (versioned against live Bun.env). */ export declare function cleanSpawnEnvForTests(): Record; export declare function clearDirenvCachesForTests(): void; /** * Resolve the nearest `.envrc` from `cwd` and return its `direnv export` diff * (variables to set, and variables direnv removes). Returns `null` when there * is no `.envrc`, `direnv` is not installed, the `.envrc` is not on direnv's * allow list, or the export fails/times out. * * direnv's own allow list is honored — an `.envrc` the user has not * `direnv allow`ed is NEVER executed or auto-allowed. This keeps OMP's trust * boundary identical to the user's own shell: cloning a repo with a poisoned * `.envrc` grants it nothing until the user explicitly allows it. * * Re-invokes `direnv export json` with its previous DIRENV_* state, so direnv * reuses the loaded environment until a watched input changes. High-resolution * stats of `.envrc` and every watched path (including direnv's allow/deny * files) catch same-second edits that direnv's whole-second timestamps miss. * While those stats are unchanged, an entry verified by direnv within the last * {@link DIRENV_WARM_TTL_MS} is reused without spawning direnv at all. * A warm export that reports any change is discarded and re-run cold, so a * revoked allow or an input the stat guard missed never leaves the result * relative to stale direnv state. The returned diff is always relative to the * clean process environment. */ export declare function loadDirenvEnv(cwd: string, opts?: { timeoutMs?: number; signal?: AbortSignal; }): Promise;