import { CommandScanner } from '../command-scan'; /** * The branch a checkout/switch lands on, and whether that command CREATES it. * * `created` is load-bearing rather than cosmetic: `git checkout -b x origin/main` lands on a branch * that is current by construction (nothing to be stale about), whereas landing on an EXISTING local * `main` is exactly the stale-checkout hazard. Data-only, so a class (per CLAUDE.md). */ export declare class BranchSwitch { branch: string; created: boolean; constructor(branch: string, created: boolean); } export declare class BranchSwitchScan { private readonly scanner; constructor(scanner?: CommandScanner); /** * The branch this segment switches to, or null when the segment does not land on a branch at all: * a different command, no target word, `git checkout -` (the previous branch — unknowable here), * or anything after `--` (which ends option parsing, making the rest PATHSPECS, so * `git checkout -- main` restores a FILE named main and moves no branch). * * Flag-tolerant by construction: every leading flag is walked past, so `-q`, `--quiet`, * `--no-track`, `--detach` and friends change nothing about which word is the target. */ targetOf(segment: string): BranchSwitch | null; /** * True only for landing on an EXISTING branch named `main` — the form that can hand you a stale * tree, and the form `git checkout main && git pull origin main` uses. `-b`/`-B`/`-c`/`-C` are * excluded because they create the branch here and now. * * This scan reads raw GIT, and it has to keep doing so even though the workflow messages now * prescribe `pnpm wp-checkout-clean-main` instead: what the guards recommend is not what an agent * necessarily types, the raw pair is still allowed and is still the L0 recovery cure, and a scan * that stopped recognising it would stop catching the bare `git checkout main` it exists to catch. */ landsOnExistingMain(segment: string): boolean; /** The same question for a target already parsed (switchesIn). One spelling, two entry shapes. */ isExistingMain(target: BranchSwitch): boolean; /** Every segment of a whole command that lands on a branch, in order. */ switchesIn(command: string): readonly BranchSwitch[]; private createdBranch; }