export type FlagSpec = { name: string; takesValue: boolean; repeatable?: boolean; aliases?: string[]; hidden?: boolean; }; export type CommandSpec = { path: string[]; flags: FlagSpec[]; }; export declare const REGISTRY: CommandSpec[]; /** Resolve `args` to its registered CommandSpec by longest matching path prefix. Returns * undefined for anything unregistered (a ghost, a stub, or a genuinely unknown command) — the * caller's job is to do nothing in that case, preserving today's existing (non-)behavior there. */ export declare function commandSpecFor(args: string[]): CommandSpec | undefined; /** Every accepted flag TOKEN for one command — its own flags' names AND aliases. `includeHidden` * (default true) controls whether deliberately-undocumented flags are included; a hidden flag * must stay ACCEPTED even when not shown in any help text or "accepted flags" hint — the field * and this machinery stay for the next one, though no flag is currently declared `hidden` (ZTB-42 * removed the two that were, `--verify-commits` and `--blob`; both had proved genuinely inert and * were dropped outright rather than kept as accepted no-ops). Exported (as `flagTokensForTest`) * purely for cliRegistry.test.ts's registry<->help drift test — not part of the runtime API other * exports above serve. */ declare function flagTokens(spec: CommandSpec, includeHidden?: boolean): string[]; export declare const flagTokensForTest: typeof flagTokens; /** cliCheck.ts's/cliImport.ts's KNOWN_FLAGS allow-lists derive their flag SET from here — one * source of truth for "is this a real flag on this command", even though those two commands keep * their own (position-insensitive) unknown-flag scan and error wording. */ export declare function flagSetFor(path: string[]): Set; /** A flags-only usage fragment, e.g. `[--json ] [--dry-run]`, rendered straight from the * registry (hidden flags omitted) — used by cliHelp.ts for `issue patch`/`issue delete`, whose * usage line the AC requires be generated from this table rather than hand-written prose. */ export declare function usageFromRegistry(path: string[]): string; /** Every flag token registered ANYWHERE in the table (all commands, hidden included) — used by the * meta-scan (cliRegistry.test.ts) to check that every flag literal actually parsed somewhere in * src/ is registered on at least one command. */ export declare function allRegisteredFlagTokens(): Set; /** The POSITIONAL tokens of a registered command invocation — every token that is neither a flag * nor a recognized value-taking flag's consumed value. Walks exactly like `rejectUnknownFlags` * (same `=` handling, same guarded consume-next for a recognized value flag in space form — see * ZTB-41 note on `walkArgs`), via the shared `walkArgs`, so the two can never disagree about which * token is a value. Returns `[]` for an unregistered command path. `args` is the full command * vector (e.g. `['evidence','add',...]`) — this resolves the command's own spec and slices its * path off. */ export declare function positionalArgs(args: string[]): string[]; /** Dispatch-time unknown-flag validation. Called from cli.ts's main() AFTER the help/version/ * completions interceptions (those must stay config-free and never reach here) and BEFORE * `handleInitCommand`, so it covers every real command. Never rejects an invocation that works * today: an unregistered command path is a silent no-op (existing backend/handler error paths are * untouched), and (since ZTB-41) the walk below is deliberately STRICTER than markdownBackend's own * flagVal/optionValue-family parsers at the one shape where they used to diverge (a space-form * value token that itself looks like a flag) — see `walkArgs`'s docstring — so a * genuinely-working-today invocation is never misread; the only effect on a previously-silent * mismatch is a loud rejection here before any handler runs. */ export declare function rejectUnknownFlags(args: string[]): void; export {};