/** * Single source of truth for Codeep's TUI slash commands. * * The `/` autocomplete in `App.ts` and alias resolution in the dispatcher * (`commands.ts`) derive from this registry. Adding a command means: * * 1. an entry in `COMMANDS` below; * 2. a handler — a `case` in `renderer/commands.ts`, a `case` in `App.ts`, or * a built-in skill of the same name; * 3. a row in `HELP_LAYOUT` at the bottom of this file; * 4. `npm run export:commands`, which regenerates the website's command * reference (`Codeep-web/src/data/commands.json`) from this file. * * `registry.test.ts` fails if 2 or 3 is missed: a command offered in the * autocomplete with no handler answers "Unknown command" (this is how * `/account` shipped broken), and one missing from `HELP_LAYOUT` is invisible * in `/help` and on the website. * * The ACP server (VS Code, Zed) is NOT derived from here: it keeps its own * `AVAILABLE_COMMANDS` list in `acp/server.ts` and resolves its own aliases, * so a command added here is not automatically offered to editors. * * ## What lives here vs. elsewhere * * - **`CommandDef`** is metadata only: name, aliases, description, category. * The actual handler logic stays in `renderer/commands.ts` (CLI) and * `acp/commands.ts` (ACP) — those files keep their per-command `case` * blocks, but they now look up the canonical name/description/alias map here. * - **Argument syntax** (e.g. `/rename `, `/mcp browse [id]`) is * documented via the optional `usage` field — surfaced in `/help` only. * The autocomplete list shows just the bare command name. * - **Hidden commands** (`hidden: true`) are valid and dispatched, but don't * appear in the autocomplete dropdown or `/help`. Use for aliases that * would clutter the list (single-letter shortcuts) and internal commands. * * ## Invariants (enforced by `registry.test.ts`) * * - No two commands share a name or alias. * - Every `category` referenced exists in `CATEGORY_ORDER`. * - `usage` keys never collide with a sibling command's name. */ /** Display categories, in the order `/help` shows them. */ export declare const CATEGORY_ORDER: readonly ["general", "sessions", "checkpoints", "agent", "git", "code", "skills", "settings", "extensions", "cloud", "codegen", "thinking"]; export type CommandCategory = (typeof CATEGORY_ORDER)[number]; /** Human-readable title for each category (used by `/help`). */ export declare const CATEGORY_TITLES: Record; export interface CommandDef { /** Primary command name, without the leading `/`. */ name: string; /** Alternate names that dispatch to the same handler. Hidden from `/help` * by default (set `aliasListed: true` to show them, e.g. `/effort`). */ aliases?: string[]; /** One-line description shown in autocomplete and `/help`. */ description: string; /** Display group in `/help`. */ category: CommandCategory; /** Extra usage rows shown only in `/help` (e.g. `/mcp browse [id]`). * Each entry is rendered as a separate row under the same command. */ usage?: string[]; /** When true, the command is valid but hidden from autocomplete + `/help`. * Used for single-letter shortcuts and internal aliases. */ hidden?: boolean; /** When true, an alias is listed in `/help` alongside the primary name * (e.g. `/effort` appears next to `/thinking`). Default false — most * aliases are hidden shortcuts. */ aliasListed?: boolean; } /** * The registry. Order within a category is preserved as-is in `/help`, * so keep entries grouped by category in source for readability. */ export declare const COMMANDS: CommandDef[]; /** `name → description` for every visible (non-hidden) command + listed alias. * This is the data behind the `/` autocomplete dropdown in `App.ts`. * * Single-letter aliases (the `c`/`t`/`d`/… shortcuts) are deliberately * EXCLUDED from the dropdown — bare one-letter rows just clutter it (they * stay fully routable via the dispatcher + show in `/help` as `(/c)` suffixes). * Multi-letter listed aliases (`effort`, `stats`) are kept; they read as real * commands, not noise. */ export declare const COMMAND_DESCRIPTIONS: Record; /** Every valid command name, including hidden ones and aliases — used by the * dispatcher to validate input before looking up a handler. */ export declare const ALL_COMMAND_NAMES: ReadonlySet; export declare function resolveCommand(token: string): CommandDef | undefined; /** All aliases (every value in `aliases` across the registry), for quick * "is this a shortcut?" checks. */ export declare const ALL_ALIASES: ReadonlySet; export interface HelpItemSpec { /** Visible key in `/help`, including the leading `/`. */ key: string; /** One line, sized for the terminal. */ description: string; /** Longer explanation used on the website's command reference instead of * `description`, where a terminal row is too short to say what matters. */ web?: string; } export interface HelpCategorySpec { title: string; items: HelpItemSpec[]; } /** * Hand-curated help layout. Categories appear in this order; each item's `key` * is rendered verbatim. The command registry provides autocomplete + dispatch * metadata; this layout provides the `/help` rendering. They overlap by design * — keeping both lets the help screen document env vars, subcommand flavors, * and recommended workflows that don't fit the strict command/alias shape. */ export declare const HELP_LAYOUT: HelpCategorySpec[];