import type { SKYKOIConfig } from "./types.js"; /** * Nix mode detection: When SKYKOI_NIX_MODE=1 (or SKYKOI_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 SKYKOI_STATE_DIR. * Default: ~/.skykoi */ export declare function resolveStateDir(env?: NodeJS.ProcessEnv, homedir?: () => string): string; export declare const STATE_DIR: string; /** * Config file path (JSON5). * Can be overridden via SKYKOI_CONFIG_PATH. * Default: ~/.skykoi/skykoi.json (or $SKYKOI_STATE_DIR/skykoi.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[]; export declare const DEFAULT_GATEWAY_PORT = 18789; /** * Gateway lock directory. * * Lives in the install-owned home, not the OS temp directory. Temp is swept — * by the OS on macOS, by tmpfiles.d on Linux, by cleanup tools on Windows — * and a lock that can vanish under a running gateway is not a lock. It also * meant two gateways with different TMPDIRs (a service and a shell) could not * see each other's lock at all and both bound the port. */ export declare function resolveGatewayLockDir(env?: NodeJS.ProcessEnv): string; /** * Where locks used to live. Read during acquisition so a gateway started by an * older build is still seen as the holder: during the changeover the two are * different processes looking at different directories, which is exactly the * double-bind this lock exists to prevent. */ export declare function resolveLegacyGatewayLockDir(tmpdir?: () => string): string; /** * OAuth credentials storage directory. * * Precedence: * - `SKYKOI_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?: SKYKOIConfig, env?: NodeJS.ProcessEnv): number;