/** Canonical environment-variable reader. */ export interface ReadEnvOptions { /** Environment object to read from. Defaults to `process.env`. */ env?: NodeJS.ProcessEnv; /** Value to return when the canonical name is not set. */ defaultValue?: string; } export declare function readEnv(canonicalKey: string, options?: ReadEnvOptions): string | undefined; /** Boolean form of {@link readEnv}: truthy when the value is `1`/`true`/`yes`/`on`. */ export declare function readEnvBool(canonicalKey: string, options?: Omit & { defaultValue?: boolean; }): boolean; /** Canonical setting resolver: per-agent runtime setting first, then env. */ /** * Minimal structural shape of a runtime that can resolve a setting. Kept local * (rather than importing `IAgentRuntime`) to avoid coupling simple settings * consumers to the complete runtime type graph. */ export interface SettingReader { getSetting(key: string): string | boolean | number | null; } export type ResolveSettingOptions = ReadEnvOptions; /** * Resolve a configuration value the way single-tenant / headless plugins want * it: the per-agent runtime setting first, then `process.env` as a deployment * fallback, then an optional default. * * This opt-in fallback must not be used for tenant settings in shared hosts. * AgentRuntime.getSetting stays agent-scoped and never reads process.env. * * Runtime values are coerced to string. The env fallback uses {@link readEnv} * semantics (trimmed; empty strings treated as unset). * * @param runtime - Runtime to read the per-agent setting from (may be null) * @param key - Setting / environment variable name * @param options - `defaultValue` and/or an explicit `env` record * @returns The resolved string, `options.defaultValue`, or `undefined` */ export declare function resolveSetting(runtime: SettingReader | null | undefined, key: string, options?: ResolveSettingOptions): string | undefined; /** Node environment access with explicit cache invalidation after settings reload. */ export declare class Environment { private readonly cache; get(key: string, defaultValue?: string): string | undefined; set(key: string, value: string | boolean | number): void; has(key: string): boolean; getAll(): Record; getBoolean(key: string, defaultValue?: boolean): boolean; getNumber(key: string, defaultValue?: number): number | undefined; clearCache(): void; } export declare function getEnvironment(): Environment; export declare function getEnv(key: string, defaultValue?: string): string | undefined; export declare function setEnv(key: string, value: string | boolean | number): void; export declare function hasEnv(key: string): boolean; export declare function getBooleanEnv(key: string, defaultValue?: boolean): boolean; export declare function getNumberEnv(key: string, defaultValue?: number): number | undefined;