Drop both retired providers from BooCoder's provider layer: acp-spawn argv cases, provider-manifest mode blocks + manifest keys, provider-commands maps, the provider-snapshot cursor model-CLI branch (+ orphaned exec/promisify imports), the agent-probe copilot ACP-detect branch, and the now-dead cursor-models module + its test. The PROVIDERS registry array already lacked both. Built-ins unchanged: claude, opencode, goose, qwen, native boocode. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
67 lines
2.5 KiB
TypeScript
67 lines
2.5 KiB
TypeScript
/**
|
|
* 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 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' },
|
|
];
|
|
|
|
/** boocode harness uses /api/skills — merged on the frontend. */
|
|
export const PROVIDER_COMMANDS: Record<string, AgentCommand[]> = {
|
|
claude: CLAUDE_COMMANDS,
|
|
opencode: OPENCODE_COMMANDS,
|
|
goose: GOOSE_COMMANDS,
|
|
qwen: QWEN_COMMANDS,
|
|
boocode: [],
|
|
};
|
|
|
|
export function getManifestCommands(provider: string): AgentCommand[] {
|
|
return PROVIDER_COMMANDS[provider] ?? [];
|
|
}
|
|
|
|
export function mergeCommands(...lists: AgentCommand[][]): AgentCommand[] {
|
|
const byName = new Map<string, AgentCommand>();
|
|
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));
|
|
}
|