/** * Build command groups for `cleo --help` from the CORE capability SSoT. * * This module is the single source of truth for "which CLI command belongs to * which help category." Previously the CLI package contained a hardcoded * `COMMAND_GROUPS` array that had to be manually updated when new commands * were added. By moving the mapping here, new operations annotated with a * `cliCategory` in the capability matrix will automatically appear in the * correct group without any CLI-package changes. * * @task T9815 * @module */ import type { CliCategory } from '@cleocode/contracts'; /** * Maps each top-level CLI command name to its help display category. * * New commands MUST be added here (or their OperationCapability entry must * carry a `cliCommand` + `cliCategory` annotation in capability-matrix.ts). */ export declare const CLI_COMMAND_CATEGORIES: Readonly>; /** * A single command group as consumed by the help renderer. * Mirrors the `CommandGroup` interface in `help-renderer.ts`. */ export interface CommandGroup { /** Display name for the group (e.g. "Task Management"). */ readonly name: string; /** Ordered list of CLI command names in this group. */ readonly commands: readonly string[]; } /** * Build an ordered array of command groups from the CORE command-category map. * * Commands are grouped by their `cliCategory`. Groups appear in the canonical * display order defined by `CLI_CATEGORY_ORDER`. Within each group, commands * are ordered by their first appearance in `categoryOverrides` (if provided) * then by their position in `CLI_COMMAND_CATEGORIES`. * * @param registeredCommands - Set of CLI command names that are actually * registered in the current build. Pass the `Object.keys(subCommands)` from * the CLI entry point. Only registered commands are included in the output. * Pass `undefined` to include all commands in the category map (useful for * testing without a live CLI manifest). * @param categoryOverrides - Optional per-command category overrides (e.g. * from a capability-matrix OperationCapability annotated with `cliCategory`). * Keys are CLI command names; values are the target category. * @returns Ordered array of `CommandGroup` objects ready for the help renderer. * Empty groups are omitted. */ export declare function buildCommandGroups(registeredCommands?: ReadonlySet | readonly string[], categoryOverrides?: Readonly>): CommandGroup[]; //# sourceMappingURL=build-command-groups.d.ts.map