feat: add agent commands support in TUI#612
Conversation
Fixes docker#603 Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
| func (a *appModel) buildCommandCategories() []dialog.CommandCategory { | ||
| return []dialog.CommandCategory{ | ||
| categories := []dialog.CommandCategory{ | ||
| { |
There was a problem hiding this comment.
Should I break this method into smaller parts or keep it as is since the logic is straightforward?
There was a problem hiding this comment.
Should be fine for now. Am on my phone now, hard to review, will take a closer look tomorrow
|
@rumpl have you had a chance to review this pr? |
|
@Deepam02 when the prompt for the command is too long the lines wrap, could we trim the command prompt so that it takes only one line? |
| case editor.SendMsg: | ||
| cmd := p.processMessage(msg.Content) | ||
| // Resolve agent commands (if any) | ||
| content := p.app.ResolveCommand(msg.Content) |
There was a problem hiding this comment.
Could the editor do the resolve? It kinda feels like it would be its job and not here, so basically the editor sends a message, and we don't care if the user typed it or if it was extracted from a command
There was a problem hiding this comment.
Done! I moved the command resolution into the editor component. Now the editor resolves commands before sending the message.
Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>

Fixes #603
Agent commands can be invoked by typing /command in chat
Commands now appear in the command palette (Ctrl+P) under "Agent Commands" category