UNPKG

aiwg

Version:

Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo

61 lines 1.78 kB
/** * CLI Router - Registry-Based Command Dispatch with Hook Support * * Main CLI entry point using the extension registry for command routing. * Replaces the monolithic switch/case with O(1) handler lookup. * Integrates hook system for lifecycle events. * * @implements @.aiwg/requirements/use-cases/UC-004-extension-system.md * @architecture @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md * @tests @test/unit/cli/router.test.ts * @issue #33 * @issue #58 */ import { type LoadedRegistry } from '../extensions/loader.js'; import { HookRegistry } from './hooks/index.js'; declare let cachedRegistry: LoadedRegistry | null; /** * Initialize the CLI router * * Loads the extension registry with capability indexing and caches it * for subsequent calls. * * @returns Loaded registry with handlers */ export declare function initRouter(): Promise<LoadedRegistry>; /** * Get the global hook registry * * Allows external code to register hooks. * * @returns Global hook registry */ export declare function getHookRegistry(): HookRegistry; /** * Main CLI entry point - registry-based routing with hooks * * Routes commands to handlers via the extension registry. Handles alias * resolution, unknown commands, and help display. Executes hooks at * appropriate lifecycle points. * * @param args - Command line arguments * @param options - Execution options * * @example * ```typescript * // Route 'use' command * await run(['use', 'sdlc']); * * // Handle alias * await run(['--help']); * * // Show help when no args * await run([]); * ``` */ export declare function run(args: string[], options?: { cwd?: string; signal?: AbortSignal; }): Promise<void>; export { cachedRegistry }; //# sourceMappingURL=router.d.ts.map