import { type Environment } from '../config/environments.js'; /** * The environment named by a `--to` / `--from` flag. * * A CliError rather than citty's own handling because the flag takes a free string and the set it * has to come from is small enough to just print. */ export declare function environmentNamed(flag: string, value: string): Environment; /** * Which environment the project at `sourceRoot` was built against, or null when nothing says. * * Deliberately NOT `resolveEnvironmentForCommand`. That chain answers "which server should THIS * INVOCATION talk to", and its top two inputs — `--env` and `BITMAGIC_ENV` — are properties of the * shell, not of the project. Promote runs from the destination lane, so under the `.envrc` setup * this command exists for, `BITMAGIC_ENV` is already `prod` when the question is asked; asking the * chain would answer "prod" about a dev project and the command would refuse itself. * * So only the two inputs that are facts about where the project LIVES are read: its own * `bitmagic.json` pin first, then the `.bitmagic-env` marker of the folder holding it. Null when * neither says, which is what makes `--from` necessary rather than decorative. */ export declare function sourceEnvironmentOf(sourceRoot: string): Environment | null; /** * The refusal when source and target are the same environment, or null when they differ. * * Worth its own message because the command would otherwise "work": it would mint a second game on * the same server, copy the project onto it, find nothing foreign to rehost, and hand back a fork * whose assets all still live under the original game's prefix. That is `bitmagic init` with extra * steps, and someone who typed `promote` did not mean it. */ export declare function sameEnvironmentRefusal(from: Environment, to: Environment): string | null; /** * The refusal when the destination sits in a folder marked for a different environment, or null * when its markers agree or say nothing. * * This is the failure the whole guard exists for, and it is silent without one. A promoted prod * project written under `dev-games/` inherits that folder's `.bitmagic-env` — and, worse, the * `BITMAGIC_ENV=dev` its sibling `.envrc` exports, which outranks the project's own pin in * `selectEnvironment`. Every later command in it would then aim at dev while the project file says * prod: `check` against the wrong engine, `verify` and `publish` against the wrong server. The * project would look right and be wrong. * * `readFolderEnvironment` walks upward and tolerates a directory that does not exist yet, so this * answers for a destination that is about to be created. No marker anywhere is not a disagreement — * a developer with no lane folders has nothing to contradict. */ export declare function laneMismatchRefusal(targetDir: string, to: Environment): string | null; /** * The default destination: the source project's own name, under the working directory. * * Named after the source rather than suffixed, because the two projects live in different lane * folders — `prod-games/icy-boat-driver` beside `dev-games/icy-boat-driver` reads as the same game * on two environments, which is what it is, while `icy-boat-driver-prod` inside a folder already * called `prod-games` says it twice. */ export declare function defaultTargetDir(sourceRoot: string, cwd: string): string; export declare const promoteCommand: import("citty").CommandDef<{ readonly project: { readonly type: "positional"; readonly required: true; readonly description: "The project to promote, e.g. ../dev-games/icy-boat-driver."; }; readonly dir: { readonly type: "positional"; readonly required: false; readonly description: "Where to create the promoted project. Defaults to ./."; }; readonly to: { readonly type: "string"; readonly description: "Environment to promote onto. Defaults to prod."; }; readonly from: { readonly type: "string"; readonly description: "Environment the project is really on, when its bitmagic.json does not pin one."; }; readonly name: { readonly type: "string"; readonly description: "Project name for package.json. Defaults to the directory name."; }; readonly 'no-rehost': { readonly type: "boolean"; readonly description: string; }; readonly force: { readonly type: "boolean"; readonly description: "Promote into a non-empty directory, or one marked for another environment."; }; readonly json: { readonly type: "boolean"; readonly description: "Print the result as JSON on stdout; all progress goes to stderr."; }; }>;