/** * Slash Commands - Interactive command system for CLI * Supports /help, /cost, /clear, /model, /tokens, /plan, /undo, /diff, /commit, /exit, /settings, /map */ export interface SlashCommand { name: string; aliases?: string[]; description: string; usage?: string; execute: (args: string[], context: SlashCommandContext) => Promise; } export interface SlashCommandContext { sessionId?: string; model?: string; tokenCount?: number; costTracker?: CostTracker; history?: string[]; settings?: Record; onOutput?: (message: string) => void; } export interface SlashCommandResult { success: boolean; message?: string; data?: any; shouldExit?: boolean; } export interface CostTracker { totalTokens: number; totalCost: number; requests: number; addUsage(model: string, inputTokens: number, outputTokens: number, latencyMs?: number): any; reset(): void; getSummary(): string; } /** * Slash Command Registry */ declare class SlashCommandRegistry { private commands; private aliases; constructor(); register(command: SlashCommand): void; get(name: string): SlashCommand | undefined; getAll(): SlashCommand[]; has(name: string): boolean; } export declare function getRegistry(): SlashCommandRegistry; export declare function registerCommand(command: SlashCommand): void; /** * Parse slash command from input */ export declare function parseSlashCommand(input: string): { command: string; args: string[]; } | null; /** * Execute a slash command */ export declare function executeSlashCommand(input: string, context: SlashCommandContext): Promise; /** * Check if input is a slash command */ export declare function isSlashCommand(input: string): boolean; /** * Slash Command Handler for CLI integration */ export declare class SlashCommandHandler { private context; constructor(initialContext?: Partial); handle(input: string): Promise; isCommand(input: string): boolean; getContext(): SlashCommandContext; updateContext(updates: Partial): void; registerCommand(command: SlashCommand): void; } export declare function createSlashCommandHandler(context?: Partial): SlashCommandHandler; export {};