import { LLMAgent, ChatEntry } from "../agent/llm-agent.js"; /** * Built-in slash commands list - single source of truth */ export declare const BUILT_IN_COMMANDS = "Built-in Commands:\n /? - Introspect tools and environment (alias for /introspect)\n /clear - Clear chat history (current session + persisted)\n /compact - Reduce context size (keep last 20 messages)\n /context - Show context usage info\n /context view - View full context in pager (markdown format)\n /context edit - Edit context JSON file (opens in $EDITOR)\n /context reload - Reload context from file immediately (no confirmation)\n /help - Show this help\n /ink - Switch to Ink UI mode (restart required)\n /introspect - Introspect tools and environment\n /models - Switch between available models\n /mood [color] - Set current mood\n /no-ink - Switch to plain console mode (restart required)\n /persona [color] - Set current persona\n /rephrase [text] - Request rephrasing of last response\n Optional text prefills assistant's new response\n /system rephrase [text] - Same as /rephrase but as system message\n /restart - Restart the application (exit code 51)\n /exit - Exit application\n exit, quit - Exit application"; /** * Help text shared across all modes */ export declare const HELP_TEXT = "ZAI CLI Help:\n\nBuilt-in Commands:\n /? - Introspect tools and environment (alias for /introspect)\n /clear - Clear chat history (current session + persisted)\n /compact - Reduce context size (keep last 20 messages)\n /context - Show context usage info\n /context view - View full context in pager (markdown format)\n /context edit - Edit context JSON file (opens in $EDITOR)\n /context reload - Reload context from file immediately (no confirmation)\n /help - Show this help\n /ink - Switch to Ink UI mode (restart required)\n /introspect - Introspect tools and environment\n /models - Switch between available models\n /mood [color] - Set current mood\n /no-ink - Switch to plain console mode (restart required)\n /persona [color] - Set current persona\n /rephrase [text] - Request rephrasing of last response\n Optional text prefills assistant's new response\n /system rephrase [text] - Same as /rephrase but as system message\n /restart - Restart the application (exit code 51)\n /exit - Exit application\n exit, quit - Exit application\n\nCLI Options:\n --fresh - Start with a fresh session (don't load previous history)\n\nGit Commands:\n /commit-and-push - AI-generated commit + push to remote\n\nEnhanced Input Features:\n \u2191/\u2193 Arrow - Navigate command history\n Ctrl+C - Clear input (press twice to exit)\n Ctrl+D - Exit on blank line\n Ctrl+\u2190/\u2192 - Move by word\n Ctrl+A/E - Move to line start/end\n Ctrl+W - Delete word before cursor\n Ctrl+K - Delete to end of line\n Ctrl+U - Delete to start of line\n ESC - Cancel current action / close menus\n ESC (twice) - Clear input line\n Shift+Tab - Toggle auto-edit mode (bypass confirmations)\n\nDirect Commands (executed immediately):\n !command - Execute any shell command directly\n\nModel Configuration:\n Edit ~/.grok/models.json to add custom models (Claude, GPT, Gemini, etc.)\n\nHistory Persistence:\n Chat history is automatically saved and restored between sessions.\n Use /clear to reset both current and persisted history.\n Use /compact to compact current and persisted history.\n\nFor complex operations, just describe what you want in natural language.\nExamples:\n \"edit package.json and add a new script\"\n \"create a new React component called Header\"\n \"show me all TypeScript files in this project\""; /** * Interface for slash command handlers * Allows different contexts (UI vs headless) to provide their own implementations */ export interface SlashCommandContext { agent: LLMAgent; addChatEntry: (entry: ChatEntry) => void; clearInput?: () => void; resetHistory?: () => void; setProcessingStates?: (states: { isProcessing?: boolean; isStreaming?: boolean; tokenCount?: number; processingTime?: number; }) => void; setTotalTokenUsage?: (updater: number | ((prev: number) => number)) => void; isHeadless?: boolean; isInkMode?: boolean; } /** * Process slash commands * Returns true if command was handled, false if it should be processed as normal input */ export declare function processSlashCommand(input: string, context: SlashCommandContext): Promise;