//#region src/cli/matrixOptions.d.ts /** * Matrix selection shared by the Pi and compatibility parsers. * * Both frontends pick the same three axes (profile, domains, major mode) out of * the same environment variables with the same defaults. They used to hold two * copies of that logic, and the copies drifted: the inline `--name=value` forms * and the strict value reader existed in the compatibility parser only, so * `./pi.sh --profile=x` silently forwarded an unknown flag to Pi. One copy here * is what keeps them honest. */ /** * One variable per axis. * * These used to come in pairs, `DOOM_PI_*` for what the caller selected and * `DOOMPI_*` for what the harness resolved and published, with the second * outranking the first. A nested run still inherits its launcher's choice under * one name, because the launcher projects into the child environment and * overwrites the same key. Two names for one value only ever meant two ways to * disagree. */ export declare const DOOMPI_PROFILE_ENV = "DOOMPI_PROFILE"; export declare const DOOMPI_DOMAINS_ENV = "DOOMPI_DOMAINS"; export declare const DOOMPI_MAJOR_MODE_ENV = "DOOMPI_MAJOR_MODE"; export declare const DOOMPI_ADDITIONAL_DIRECTORIES_ENV = "DOOMPI_ADDITIONAL_DIRS"; export declare const DOOMPI_PRESET_ENV = "DOOMPI_PRESET"; /** Removed spelling of the major mode axis, reported rather than honored. */ export declare const REMOVED_DOOMPI_LAYER_ENV = "DOOMPI_LAYER"; export declare const PROFILE_OPTION = "--profile"; export declare const DOMAIN_OPTION = "--domain"; export declare const DOMAINS_OPTION = "--domains"; /** * The major mode flag. * * Not `--mode`: Pi owns that one for its output mode, and for a value outside * `text|json|rpc` it consumes both tokens and ignores them without a * diagnostic. A synced `pi --mode dev` would have failed silently. */ export declare const MAJOR_MODE_OPTION = "--major-mode"; export declare const ADD_DIRECTORY_OPTION = "--add-dir"; export declare const REMOVED_LAYER_OPTION = "--layer"; export declare const REMOVED_LAYERS_OPTION = "--layers"; export declare const REMOVED_TARGET_OPTION = "--target"; export declare const DEFAULT_MAJOR_MODE = "copilot"; export declare const DEFAULT_DOMAIN = "default"; export interface OptionMatch { value: string; /** Index of the last argument consumed, for the caller's loop cursor. */ nextIndex: number; /** True for `--name=value`. Callers that re-emit an option preserve the form. */ inline: boolean; } /** * Reads `--name value` or `--name=value`, returning undefined for anything else. * * A value starting with `--` is rejected rather than consumed, so * `--profile --explain` reports a missing value instead of swallowing the next * flag. In compatibility mode this is also what stops the `--` provider * delimiter being taken as a matrix value. */ export declare function readOption(args: string[], index: number, name: string): OptionMatch | undefined; /** Matches `--name` or `--name=value`, for reporting options that were removed. */ export declare function matchesOption(arg: string, name: string): boolean; export declare function parseCsv(value: string): string[]; export declare function parseRequiredCsv(value: string, option: string): string[]; export declare function parseMajorMode(value: string, source: string): string; export declare function parseProfileValue(value: string, source: string): string; /** * Reports any variable left over from the retired `AGENT_HARNESS_*` namespace. * * Called before anything reads the environment, so a stale export fails the * session instead of being quietly outvoted by a default. Both prefixes are * built from the constants above rather than written inline, because a * search-and-replace over this repository is exactly what retired the old one. */ export declare function assertNoRetiredEnvironment(environment: NodeJS.ProcessEnv): void; /** * The major mode a nested run inherits from its launcher, or the default. * * The removed spelling throws rather than being ignored. A stale * `export DOOMPI_LAYER=dev` left in a shell profile would otherwise silently * select `copilot`, which is the exact confusion the rename removed. */ export declare function resolveInheritedMajorMode(environment: NodeJS.ProcessEnv, defaultMajorMode?: string): string; /** The profile a run inherits from its environment, validated once up front. */ export declare function resolveInheritedProfile(environment: NodeJS.ProcessEnv): string | undefined; /** Directories inherited from the launcher environment. */ export declare function resolveAdditionalDirectories(environment: NodeJS.ProcessEnv, baseDirectory: string): string[]; //#endregion //# sourceMappingURL=matrixOptions.d.mts.map