/** * Static slash-command hints per harness (interactive TUI / agent session). * Live ACP `available_commands_update` merges on top during dispatch. */ import type { AgentCommand } from './provider-types.js'; const CLAUDE_COMMANDS: AgentCommand[] = [ { name: 'help', description: 'Show available slash commands' }, { name: 'clear', description: 'Clear conversation history' }, { name: 'compact', description: 'Compact context window' }, { name: 'cost', description: 'Show session cost' }, { name: 'memory', description: 'Manage project memory' }, { name: 'model', description: 'Switch model' }, { name: 'permissions', description: 'View or change permission mode' }, { name: 'review', description: 'Review current changes' }, { name: 'status', description: 'Show session status' }, { name: 'vim', description: 'Toggle vim-style input' }, ]; const OPENCODE_COMMANDS: AgentCommand[] = [ { name: 'help', description: 'Show available commands' }, { name: 'new', description: 'Start a new session' }, { name: 'models', description: 'List or switch models' }, { name: 'agents', description: 'List or switch agents' }, { name: 'compact', description: 'Compact context' }, { name: 'share', description: 'Share session' }, { name: 'export', description: 'Export session' }, ]; const CURSOR_COMMANDS: AgentCommand[] = [ { name: 'help', description: 'Show available slash commands' }, { name: 'clear', description: 'Clear conversation' }, { name: 'compact', description: 'Compact context' }, { name: 'resume', description: 'Resume a prior session' }, ]; const GOOSE_COMMANDS: AgentCommand[] = [ { name: 'help', description: 'Show available commands' }, { name: 'clear', description: 'Clear conversation' }, { name: 'compact', description: 'Compact context' }, { name: 'exit', description: 'Exit session' }, ]; const QWEN_COMMANDS: AgentCommand[] = [ { name: 'help', description: 'Show available slash commands' }, { name: 'clear', description: 'Clear conversation' }, { name: 'memory', description: 'Manage memory' }, { name: 'hooks', description: 'Manage hooks' }, { name: 'review', description: 'Review changes' }, ]; const COPILOT_COMMANDS: AgentCommand[] = [ { name: 'help', description: 'Show available commands' }, { name: 'explain', description: 'Explain selected code' }, { name: 'fix', description: 'Fix issues in context' }, { name: 'tests', description: 'Generate or run tests' }, { name: 'doc', description: 'Generate documentation' }, { name: 'clear', description: 'Clear conversation' }, ]; /** boocode harness uses /api/skills — merged on the frontend. */ export const PROVIDER_COMMANDS: Record = { claude: CLAUDE_COMMANDS, opencode: OPENCODE_COMMANDS, cursor: CURSOR_COMMANDS, goose: GOOSE_COMMANDS, qwen: QWEN_COMMANDS, copilot: COPILOT_COMMANDS, boocode: [], }; export function getManifestCommands(provider: string): AgentCommand[] { return PROVIDER_COMMANDS[provider] ?? []; } export function mergeCommands(...lists: AgentCommand[][]): AgentCommand[] { const byName = new Map(); for (const list of lists) { for (const cmd of list) { byName.set(cmd.name, cmd); } } return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name)); }