refactor: use conversations (#475)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-13 16:40:59 -08:00
committed by GitHub
parent 3615247d14
commit ef7d8c98df
26 changed files with 1572 additions and 168 deletions

View File

@@ -6,6 +6,7 @@ type CommandHandler = (args: string[]) => Promise<string> | string;
interface Command {
desc: string;
handler: CommandHandler;
args?: string; // Optional argument syntax hint (e.g., "[conversation_id]", "<name>")
hidden?: boolean; // Hidden commands don't show in autocomplete but still work
order?: number; // Lower numbers appear first in autocomplete (default: 100)
}
@@ -68,11 +69,20 @@ export const commands: Record<string, Command> = {
},
},
"/clear": {
desc: "Clear conversation history (keep memory)",
desc: "Start a new conversation (keep agent memory)",
order: 17,
handler: () => {
// Handled specially in App.tsx to access client and agent ID
return "Clearing messages...";
// Handled specially in App.tsx to create new conversation
return "Starting new conversation...";
},
},
"/clear-messages": {
desc: "Reset all agent messages (destructive)",
order: 18,
hidden: true, // Advanced command, not shown in autocomplete
handler: () => {
// Handled specially in App.tsx to reset agent messages
return "Resetting agent messages...";
},
},
@@ -339,11 +349,12 @@ export const commands: Record<string, Command> = {
},
},
"/resume": {
desc: "Browse and switch to another agent",
hidden: true, // Backwards compatibility alias for /agents
desc: "Resume a previous conversation",
args: "[conversation_id]",
order: 19,
handler: () => {
// Handled specially in App.tsx to show agent selector
return "Opening agent selector...";
// Handled specially in App.tsx to show conversation selector or switch directly
return "Opening conversation selector...";
},
},
"/pinned": {