feat (tui): agents dialog (#1802)

This commit is contained in:
Aiden Cline
2025-08-11 00:46:38 -05:00
committed by GitHub
parent 6145dfcca0
commit 62b8c7aee0
4 changed files with 346 additions and 1 deletions

View File

@@ -64,12 +64,13 @@ func (r CommandRegistry) Sorted() []Command {
commands = append(commands, command)
}
slices.SortFunc(commands, func(a, b Command) int {
// Priority order: session_new, session_share, model_list, app_help first, app_exit last
// Priority order: session_new, session_share, model_list, agent_list, app_help first, app_exit last
priorityOrder := map[CommandName]int{
SessionNewCommand: 0,
AppHelpCommand: 1,
SessionShareCommand: 2,
ModelListCommand: 3,
AgentListCommand: 4,
}
aPriority, aHasPriority := priorityOrder[a.Name]
@@ -119,6 +120,7 @@ const (
SessionExportCommand CommandName = "session_export"
ToolDetailsCommand CommandName = "tool_details"
ModelListCommand CommandName = "model_list"
AgentListCommand CommandName = "agent_list"
ThemeListCommand CommandName = "theme_list"
FileListCommand CommandName = "file_list"
FileCloseCommand CommandName = "file_close"
@@ -248,6 +250,12 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
Keybindings: parseBindings("<leader>m"),
Trigger: []string{"models"},
},
{
Name: AgentListCommand,
Description: "list agents",
Keybindings: parseBindings("<leader>a"),
Trigger: []string{"agents"},
},
{
Name: ThemeListCommand,
Description: "list themes",