import { EnvironmentConfiguration, RootConfiguration, RootConfigurationFile } from "./types.js"; export declare const readRootConfigurationFile: (configPath: string) => { rootPath: string; rootDir: string; config: RootConfigurationFile; }; export declare const writeRootConfigurationFile: (configPath: string, config: RootConfigurationFile) => void; export declare const mergeEnvironmentConfigurations: (primary?: Record, fallback?: Record) => Record; export declare const readRootConfiguration: (configPath: string, activeEnvironmentName?: string) => RootConfiguration; /** * Resolve the environment profile a command should act on. * * Resolution order: * 1. An explicitly named env (`--environment-name` / `-n`). * 2. The configured `defaultEnvProfile`. * 3. The sole env profile, when exactly one is configured — a * single-environment config then works without anyone having to * designate a default. Declining "set as default" during * `setup init` must not strand the only environment. * * Throws `INPUT_INVALID` when none applies — no profiles configured, or * several with no default to disambiguate them — and `ENV_NOT_FOUND` * when the resolved name has no matching profile (a stale * `--environment-name` or `defaultEnvProfile`). * * `root` is returned read with the resolved name as the active env, so * callers see correct env-override layering without re-reading. */ export declare const resolveActiveEnvironment: (configPath: string, explicitEnvName: string | undefined) => { envName: string; env: EnvironmentConfiguration; root: RootConfiguration; };