feat: add /backend command parsing

Add support for /backend command to show or switch local backend providers. Follows the same pattern as /model command with optional argument support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
William Valentin
2026-02-05 13:35:10 -08:00
parent dbeaa78e2c
commit 465b4a0c3c
2 changed files with 20 additions and 0 deletions
+9
View File
@@ -35,6 +35,15 @@ describe('parseCommand', () => {
expect(parseCommand('/model opus')).toEqual({ type: 'model', name: 'opus' });
});
it('parses /backend command without argument', () => {
expect(parseCommand('/backend')).toEqual({ type: 'backend' });
});
it('parses /backend command with argument', () => {
expect(parseCommand('/backend llamacpp')).toEqual({ type: 'backend', provider: 'llamacpp' });
expect(parseCommand('/backend ollama')).toEqual({ type: 'backend', provider: 'ollama' });
});
it('parses /transfer command', () => {
expect(parseCommand('/transfer telegram')).toEqual({ type: 'transfer', target: 'telegram' });
});