/** * Lazy command loaders. * * Modules here trigger their `register({...})` side effect on import; the * caller then mounts the requested command via `registry.installOne` (or via * the explicit registrar functions for non-registry commands). * * Keeping this map static-but-thunked means `bin.ts` short-circuits and * `runCli` can resolve a single subcommand without paying for unrelated * command modules. */ import type { Command } from 'commander'; import { type CLIContext } from './registry.js'; export type CommandLoader = () => Promise; export declare const REGISTRY_COMMAND_MODULES: Record; export interface NonRegistryMatcher { matches: (name: string) => boolean; load: (program: Command) => Promise; } export declare const NON_REGISTRY_COMMAND_MATCHERS: NonRegistryMatcher[]; /** * Resolve which command module to load based on argv. Skips global flags * (`--verbose`/`--config `/`--workspace `) and treats * `help ` as if the user had typed ``, so that `xopc help gateway` * loads only the gateway module. */ export declare function resolveCommandName(argv: string[]): string | undefined; export declare function tryLoadCommand(program: Command, ctx: CLIContext, name: string, getCtx?: () => CLIContext): Promise; export declare function loadAllCommands(program: Command, ctx: CLIContext, getCtx?: () => CLIContext): Promise;