/**
 * Lazy command registry.
 *
 * The CLI entry point (src/index.ts) used to statically import every command
 * module and call its `registerXCommand(program)` on every invocation. That
 * loaded the entire command tree (~50 modules) before the first line of output,
 * dominating cold-start latency.
 *
 * This module maps each user-typed top-level command name to a thunk that
 * dynamically imports ONLY the module(s) that command needs. Fast commands
 * (`--version`, `view`, ...) now pay for just the one module they use; the full
 * tree is loaded only on the rare slow paths (unknown-command spellcheck, bare
 * help) via `registerAllEagerCommands` in src/index.ts.
 *
 * Parity is non-negotiable: the name -> loader map below mirrors exactly which
 * module registers which top-level command on `main`. Multi-command modules
 * (versions, packages) map several names to the same loader; `prune` needs BOTH
 * versions (which creates `prune <specs...>`) and prune.js (which attaches the
 * `cleanup` subcommand to it), in that order — see commands/prune.ts.
 */
import { Command } from 'commander';
export { KNOWN_TOP_LEVEL_COMMANDS, RETIRED_TOP_LEVEL_COMMANDS } from '../lib/startup/command-registry.js';
/** A function that registers one or more commands onto the root program. */
export type Registrar = (program: Command) => void;
/** A thunk that dynamically imports a command module and returns its registrar. */
export type ModuleLoader = () => Promise<Registrar>;
export declare const loadView: ModuleLoader;
export declare const loadInspect: ModuleLoader;
export declare const loadFeedback: ModuleLoader;
export declare const loadCommands: ModuleLoader;
export declare const loadHooks: ModuleLoader;
export declare const loadSkills: ModuleLoader;
export declare const loadRules: ModuleLoader;
export declare const loadMemory: ModuleLoader;
export declare const loadPermissions: ModuleLoader;
export declare const loadMcp: ModuleLoader;
export declare const loadCli: ModuleLoader;
export declare const loadSubagents: ModuleLoader;
export declare const loadPlugins: ModuleLoader;
export declare const loadWorkflows: ModuleLoader;
export declare const loadVersions: ModuleLoader;
export declare const loadUpdate: ModuleLoader;
export declare const loadImport: ModuleLoader;
export declare const loadPackages: ModuleLoader;
export declare const loadRoutines: ModuleLoader;
export declare const loadMonitors: ModuleLoader;
export declare const loadProjects: ModuleLoader;
export declare const loadRun: ModuleLoader;
export declare const loadOpen: ModuleLoader;
export declare const loadReconnect: ModuleLoader;
export declare const loadFork: ModuleLoader;
export declare const loadConfig: ModuleLoader;
export declare const loadModels: ModuleLoader;
export declare const loadModes: ModuleLoader;
export declare const loadPrune: ModuleLoader;
export declare const loadTrash: ModuleLoader;
export declare const loadRestore: ModuleLoader;
export declare const loadDoctor: ModuleLoader;
export declare const loadRoute: ModuleLoader;
export declare const loadHarness: ModuleLoader;
export declare const loadSecrets: ModuleLoader;
export declare const loadMenubar: ModuleLoader;
export declare const loadSync: ModuleLoader;
export declare const loadRefreshRules: ModuleLoader;
export declare const loadFactory: ModuleLoader;
export declare const loadInsights: ModuleLoader;
export declare const loadTrace: ModuleLoader;
export declare const loadPty: ModuleLoader;
export declare const loadTmux: ModuleLoader;
export declare const loadWatchdog: ModuleLoader;
export declare const loadBrowser: ModuleLoader;
export declare const loadComputer: ModuleLoader;
export declare const loadLogs: ModuleLoader;
export declare const loadEvents: ModuleLoader;
export declare const loadSsh: ModuleLoader;
export declare const loadRepo: ModuleLoader;
export declare const loadSetup: ModuleLoader;
export declare const loadUninstall: ModuleLoader;
export declare const loadUpgrade: ModuleLoader;
export declare const loadSessions: ModuleLoader;
export declare const loadTeams: ModuleLoader;
export declare const loadCloud: ModuleLoader;
export declare const loadMessage: ModuleLoader;
export declare const loadSend: ModuleLoader;
export declare const loadFeed: ModuleLoader;
export declare const loadMailboxes: ModuleLoader;
export declare const loadArtifacts: ModuleLoader;
export declare const loadWebhooks: ModuleLoader;
export declare const loadHumans: ModuleLoader;
export declare const loadAccounts: ModuleLoader;
export declare const loadDaemon: ModuleLoader;
export declare const loadAuth: ModuleLoader;
export declare const loadTraces: ModuleLoader;
export declare const loadReminders: ModuleLoader;
/**
 * Commands whose modules pull in the SQLite-backed session/cloud stack. They are
 * registered AFTER `applyGlobalHelpConventions` (mirroring main's order: help
 * conventions at module top-level, lazy registration just before parse), so they
 * inherit the root's custom help formatter rather than getting the per-command
 * recursive pass. Keeping that ordering preserves their `--help` output exactly.
 */
export declare const LAZY_COMMAND_NAMES: ReadonlySet<string>;
/**
 * User-typed top-level command name -> ordered list of module loaders to run.
 *
 * Most names map to a single loader. The exceptions encode real coupling on main:
 *  - `add`/`use`/`list`/`remove`/`rm`/`purge` all come from the versions module.
 *  - `registry`/`search`/`install`/`packages` all come from the packages module.
 *  - `trash` and `restore` are separate registrars in the trash module.
 *  - `prune` needs versions FIRST (it creates `prune <specs...>`) then prune.js
 *    (which finds that command and attaches the `cleanup` subcommand).
 *
 * Inline deprecated aliases (memory/perms/exec/jobs/cron) and the inline
 * `upgrade` command are NOT here — they are closures over entry-point state and
 * are handled directly in src/index.ts.
 */
export declare const COMMAND_LOADERS: Record<string, ModuleLoader[]>;
/**
 * Register every module in {@link COMMAND_LOADERS} onto one fresh program and
 * return it — the full public command tree, deduped by loader identity so a
 * loader mapped to several names (e.g. `add`/`use`/`list` -> versions) runs once.
 *
 * Off the hot path only: the command-index generator (`scripts/gen-command-index.ts`)
 * and the tests build the tree from this. Startup never calls it — src/index.ts
 * registers just the one requested command via `registerEagerForRequest`. The
 * inline aliases/tombstones ({@link INLINE_COMMAND_NAMES}) are NOT included: they
 * are closures over entry-point state that src/index.ts registers directly.
 */
export declare function buildFullCommandTree(): Promise<Command>;
/**
 * Register every module in {@link COMMAND_LOADERS} onto the given program.
 * Used by help paths that need the complete visible command tree.
 */
export declare function registerAllCommands(program: Command): Promise<void>;
