export { filterProcessEnv, isSafeEnvName, isSafeEnvValue } from "./spawn-env"; export { isValidEnvName, parseEnvFile, parseShellEnvFile } from "./env-file"; export declare function $inheritedEnv(name: string): string | undefined; /** * Intentional re-export of Bun.env. * * All users should import this env module (import { $env } from "@gajae-code/utils") * before using environment variables. This ensures that .env files have been loaded and * overrides (project, home) have been applied, so $env always reflects the correct values. * * Provider credential resolution must not use this merged view because it includes the * caller's cwd/.env. Use $credentialEnv/$pickCredentialEnv for model authentication. */ export declare const $env: Record; /** * Resolve the first environment variable value from the given keys. * @param keys - The keys to resolve. * @returns The first environment variable value, or undefined if no value is found. */ export declare function $pickenv(...keys: string[]): string | undefined; /** * Resolve credential-bearing environment variables without consulting the caller's project .env. * * GJC loads cwd/.env into $env for project-aware tools, but model-provider authentication should * only use values explicitly inherited from the launching shell or GJC/user-owned config files. */ export declare function $credentialEnv(name: string): string | undefined; /** * Resolve a credential that may rotate in the trusted agent `.env` while this * process remains alive. * * Presence in the agent file establishes that file as the credential's * authority, even when the launching shell inherited an older value. This is * what lets an atomic token rotation repair a long-lived shell instead of * falling back to its revoked snapshot. Removal is authoritative too, so a * deleted token cannot silently reappear from that snapshot. Project `.env` * files are never consulted; shell values retain their normal precedence for * names the agent file does not own. */ export declare function $rotatingCredentialEnv(name: string): string | undefined; /** * Resolve the first credential env value from the given keys, excluding cwd/.env overlays. */ export declare function $pickCredentialEnv(...keys: string[]): string | undefined; /** * Parses a positive decimal integer from `$env[name]`. * Empty, invalid, unsafe, zero, or negative values return `defaultValue`. */ export declare function $envpos(name: string, defaultValue: number): number; /** True when `BUN_ENV` or `NODE_ENV` is the string `test`. */ export declare function isBunTestRuntime(): boolean; /** * True when this code is running inside a `bun build --compile` standalone * binary. Detects via the embedded virtual-filesystem path markers * (`$bunfs`, `~BUN`, or its URL-encoded form `%7EBUN`) in `import.meta.url`, * which Bun rewrites for every module bundled into the executable. The * `PI_COMPILED` env var (set by the build script's `--define`) is checked * first for cheap fast-path detection. */ export declare function isCompiledBinary(): boolean; export declare function $flag(name: string, def?: boolean): boolean; /** Resolve the first flag among keys that has a set value (GJC-first, PI fallback). Matches $flag semantics per key. */ export declare function $pickflag(...keys: string[]): boolean; /** Resolve the first positive integer among keys, else defaultValue (GJC-first). Set-but-invalid keys are skipped. */ export declare function $pickenvpos(keys: string[], defaultValue: number): number;