@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
27 lines • 1.37 kB
TypeScript
import type { NOOPAccessor } from '../../../../accessor/base.ts';
import { PathSpec } from '../../../../types.ts';
import type { CommandFnResult, Context } from '../../../config.ts';
import type { ReadOnlyRefusal } from './types.ts';
/**
* What a non-branch operand named, for the refusal that says so.
*
* git tells a tag and a remote-tracking branch apart from a bare commit in the
* same sentence, so the refusal can say which one the caller reached for.
*/
export declare function expectedKind(known: ReadonlyMap<string, string>, name: string): string;
/**
* Switch to a branch, creating it under `-c`.
*
* The same move `checkout` makes, with a narrower grammar: only a branch is
* accepted, so a commit, tag or remote-tracking name is refused unless
* `--detach` says that a detached HEAD is what was meant. That is the whole
* reason git split the verb off, and it holds here for the same reason: a
* detached HEAD is the state an agent loses commits in.
*/
export declare function switchBranch(_accessor: NOOPAccessor, paths: PathSpec[], texts: string[], ctx: Context): Promise<CommandFnResult>;
/**
* switch's refusal by a read-only mount: the new branch's ref under a `-c` with
* no start point, whose lock git takes first, and the index's otherwise.
*/
export declare const switchReadOnly: ReadOnlyRefusal;
//# sourceMappingURL=switch.d.ts.map