feat: complete DM pairing codes with channel adapters, gateway handlers, and TUI command (Tier 4 feature 4)
This commit is contained in:
@@ -11,6 +11,7 @@ export type Command =
|
||||
| { type: 'backend'; provider?: string }
|
||||
| { type: 'login'; provider?: string }
|
||||
| { type: 'transfer'; target: string }
|
||||
| { type: 'pair'; action?: 'generate' | 'list' | 'revoke'; args?: string }
|
||||
| { type: 'message'; content: string };
|
||||
|
||||
export function parseCommand(input: string): Command | null {
|
||||
@@ -99,6 +100,19 @@ export function parseCommand(input: string): Command | null {
|
||||
return { type: 'login', provider: provider || undefined };
|
||||
}
|
||||
|
||||
// Pair
|
||||
if (trimmed === '/pair' || trimmed === '/pair list') {
|
||||
return { type: 'pair', action: 'list' };
|
||||
}
|
||||
if (trimmed === '/pair generate' || trimmed.startsWith('/pair generate ')) {
|
||||
const label = trimmed.slice('/pair generate'.length).trim() || undefined;
|
||||
return { type: 'pair', action: 'generate', args: label };
|
||||
}
|
||||
if (trimmed.startsWith('/pair revoke ')) {
|
||||
const args = trimmed.slice('/pair revoke '.length).trim();
|
||||
return { type: 'pair', action: 'revoke', args };
|
||||
}
|
||||
|
||||
// Regular message
|
||||
return { type: 'message', content: trimmed };
|
||||
}
|
||||
@@ -111,6 +125,9 @@ Commands:
|
||||
/model <tier> <p/m> Change tier's provider/model (e.g. /model default anthropic/claude-sonnet-4)
|
||||
/backend [provider] Show or switch local backend (ollama, llamacpp)
|
||||
/login [provider] Authenticate with GitHub
|
||||
/pair List pending pairing codes and approved senders
|
||||
/pair generate [label] Generate a new DM pairing code
|
||||
/pair revoke <ch> <id> Revoke an approved sender
|
||||
/reset, /clear, /new Clear conversation history
|
||||
/compact Compact conversation history
|
||||
/usage Show token usage and estimated cost
|
||||
@@ -139,6 +156,7 @@ export const SLASH_COMMANDS = [
|
||||
'/fullscreen',
|
||||
'/fs',
|
||||
'/login',
|
||||
'/pair',
|
||||
'/transfer',
|
||||
'/quit',
|
||||
'/exit',
|
||||
@@ -159,6 +177,7 @@ export const COMMAND_TOOLTIPS: Record<string, string> = {
|
||||
'/fullscreen': 'Switch to fullscreen mode',
|
||||
'/fs': 'Switch to fullscreen mode',
|
||||
'/login': 'Authenticate with GitHub (OAuth device flow)',
|
||||
'/pair': 'Generate/list/revoke DM pairing codes',
|
||||
'/transfer': 'Transfer session to another frontend',
|
||||
'/quit': 'Exit TUI',
|
||||
'/exit': 'Exit TUI',
|
||||
|
||||
Reference in New Issue
Block a user