import type { BotConfig } from "./types.js"; /** * Nix mode detection: When BOT_NIX_MODE=1, the gateway is running under Nix. * In this mode: * - No auto-install flows should be attempted * - Missing dependencies should produce actionable Nix-specific error messages * - Config is managed externally (read-only from Nix perspective) */ export declare function resolveIsNixMode(env?: NodeJS.ProcessEnv): boolean; export declare const isNixMode: boolean; export declare function resolveLegacyStateDir(homedir?: () => string): string; export declare function resolveLegacyStateDirs(homedir?: () => string): string[]; export declare function resolveNewStateDir(homedir?: () => string): string; /** * State directory for mutable data (sessions, logs, caches). * Can be overridden via BOT_STATE_DIR. * Default: ~/.bot */ export declare function resolveStateDir(env?: NodeJS.ProcessEnv, homedir?: () => string): string; export declare const STATE_DIR: string; /** * Config file path (JSON5). * Can be overridden via BOT_CONFIG_PATH or BOT_CONFIG_PATH. * Default: ~/.bot/bot.json (or $BOT_STATE_DIR/bot.json) */ export declare function resolveCanonicalConfigPath(env?: NodeJS.ProcessEnv, stateDir?: string): string; /** * Resolve the active config path by preferring existing config candidates * before falling back to the canonical path. */ export declare function resolveConfigPathCandidate(env?: NodeJS.ProcessEnv, homedir?: () => string): string; /** * Active config path (prefers existing config files). */ export declare function resolveConfigPath(env?: NodeJS.ProcessEnv, stateDir?: string, homedir?: () => string): string; export declare const CONFIG_PATH: string; /** * Resolve default config path candidates across default locations. * Order: explicit config path → state-dir-derived paths → new default. */ export declare function resolveDefaultConfigCandidates(env?: NodeJS.ProcessEnv, homedir?: () => string): string[]; /** * Writable config path override (optional). * * When BOT_CONFIG_PATH (or BOT_CONFIG_PATH) points to a read-only location * (e.g., a K8s ConfigMap mount), set BOT_CONFIG_WRITE_PATH to a writable * path where user changes should be persisted. * * The write path is also used as the highest-priority read candidate so that * user overrides take precedence over the base ConfigMap config. * * Returns null when no write-path override is configured. */ export declare function resolveConfigWritePath(env?: NodeJS.ProcessEnv): string | null; export declare const DEFAULT_GATEWAY_PORT = 18789; /** * Gateway lock directory (ephemeral). * Default: os.tmpdir()/bot- (uid suffix when available). */ export declare function resolveGatewayLockDir(tmpdir?: () => string): string; /** * OAuth credentials storage directory. * * Precedence: * - `BOT_OAUTH_DIR` (explicit override) * - `$*_STATE_DIR/credentials` (canonical server/default) */ export declare function resolveOAuthDir(env?: NodeJS.ProcessEnv, stateDir?: string): string; export declare function resolveOAuthPath(env?: NodeJS.ProcessEnv, stateDir?: string): string; export declare function resolveGatewayPort(cfg?: BotConfig, env?: NodeJS.ProcessEnv): number;