/** Parsed result when `--version`, `--help`, `doctor`, `update`, `config`, `init`, or a fast-path subcommand is requested. */ export type ForgeAction = "version" | "help" | "doctor" | "update" | "config" | "init" | "uninstall" | "reset" | "subcommand" | null; /** * Whitelist of bare subcommands that bypass pi and exec a bundled cjs tool * directly. Each entry maps the user-typed subcommand to the cjs filename * under `dist/forge-payload/.tools/`. Direct exec keeps these <100ms vs the * ~26s cold-start an agent loop would incur. */ export declare const FAST_PATH_SUBCOMMANDS: Readonly>; export interface ParseResult { /** Action for forge to handle before invoking pi, or null if pi should run. */ forgeAction: ForgeAction; /** Argv to pass directly to pi's `main()`. */ piArgv: string[]; /** Env vars to set before invoking pi. */ env: Record; /** When forgeAction === "subcommand", the cjs filename to exec. */ subcommandTool?: string; /** When forgeAction === "subcommand", argv to pass after the cjs filename. */ subcommandArgs?: string[]; } export interface ParseError { error: string; } export type ParseResultOrError = ParseResult | ParseError; export declare function isParseError(r: ParseResultOrError): r is ParseError; /** * Parse forge CLI arguments and split them into forge-owned actions, * pi-bound argv, and env overrides. * * Never calls process.exit — caller is responsible. * * @implements {import("./shared-parser.js").SubcommandArgsParser} */ export declare function parseForgeArgv(argv: string[]): ParseResultOrError;