/** * CLI command discovery (Phase 40 / PH40-02). * * The harness CLI is composed from multiple sources — built-in commands * declared in `src/cli/commands/`, plus future workspace-scoped or * plugin-contributed commands. This module owns the *registration* * boundary so the router never sees malformed entries. * * Two primitives are exposed: * - {@link validateCommand} — fail fast on bad shape (empty name, * whitespace-in-name, empty summary). * - {@link discoverCommands} — flatten a list of `CommandSource`s into * a single registration-ordered array, * rejecting duplicate command names. * * No I/O happens here — discovery is *static*. The CLI substrate stays * synchronous and side-effect-free until a command's handler runs. */ import type { CliCommand } from "./router.js"; export type CommandSource = { /** Source label, used only for diagnostic messages. */ name: string; commands: readonly CliCommand[]; }; /** * Validate a single CLI command. Throws a `[Hivemind]`-prefixed error if * the command shape is unusable. */ export declare function validateCommand(command: CliCommand): void; /** * Flatten an ordered list of `CommandSource`s into a single registration * order. Validates every entry and rejects duplicate command names with a * `[Hivemind]`-prefixed error that names both colliding sources. */ export declare function discoverCommands(sources: readonly CommandSource[]): CliCommand[]; //# sourceMappingURL=discovery.d.ts.map