/** * Resolve the auth/environment mode for `qfg run`. * * The rule is **binary and mutually exclusive** — never resolve in * precedence order, because a "match-only" exception drifts silently and * masks misconfiguration in CI. * * Mode A — `QUONFIG_BACKEND_SDK_KEY` set: * The SDK key encodes both project and environment. If `--environment` * OR `QUONFIG_ENVIRONMENT` is also present, return an `error` — even * if they would agree, because tolerating that case lets a stale env * var quietly drift past us until the day it disagrees. * * Mode B — no SDK key: * Require EXACTLY ONE of `--environment` flag or `QUONFIG_ENVIRONMENT` * env var. Both → error. Neither → error. There is no interactive * prompt — `qfg run` is scripted, and prompting mid-`&&`-chain is * worse UX than failing loud. * * Empty strings are treated as "unset" because shells routinely emit * `EXPORT_FOO=` when a var is declared but has no value, and silently * picking Mode A with an empty key would surface as a confusing 401 from * api-delivery much later. */ export interface ResolveRunEnvironmentInput { /** Value of the `--environment` flag (or undefined). */ envFlag: string | undefined; /** Value of `QUONFIG_ENVIRONMENT` env var (or undefined). */ envFromEnvironment: string | undefined; /** Value of `QUONFIG_BACKEND_SDK_KEY` (or undefined). */ sdkKey: string | undefined; } export type ResolveRunEnvironmentResult = { mode: 'sdk-key'; sdkKey: string; } | { mode: 'user'; environmentName: string; } | { mode: 'error'; message: string; }; export declare const RUN_MODE_AMBIGUOUS_ERROR: string; export declare const RUN_MODE_NO_ENV_ERROR: string; export declare const RUN_MODE_BOTH_ENV_ERROR = "qfg run: pass exactly one of --environment or QUONFIG_ENVIRONMENT (both are set)."; export declare const resolveRunEnvironmentMode: (input: ResolveRunEnvironmentInput) => ResolveRunEnvironmentResult;