feat: opción Restart en TUI dashboard de agentes

Añade botón "Restart" en el menú de acciones de agente en la TUI.
Ejecuta stop + start del launcher unificado para aplicar cambios
de configuración sin salir del dashboard. Incluye intent nuevo
IntentRestartAgent y su implementación en el adapter impuro.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 15:46:23 +00:00
parent f193f8d5ea
commit 525425a81c
3 changed files with 23 additions and 0 deletions
+15
View File
@@ -37,6 +37,9 @@ func (a *Adapter) RunIntent(intent puretui.Intent) tea.Cmd {
case puretui.IntentDisableAgent:
return a.disableAgent(intent.AgentID)
case puretui.IntentRestartAgent:
return a.restartAgent(intent.AgentID)
case puretui.IntentLoadLogs:
return a.loadLogs(intent.AgentID)
@@ -123,6 +126,18 @@ func (a *Adapter) disableAgent(id string) tea.Cmd {
}
}
func (a *Adapter) restartAgent(id string) tea.Cmd {
return func() tea.Msg {
_ = a.mgr.StopUnified()
time.Sleep(500 * time.Millisecond)
err := a.mgr.StartUnified()
if err == nil {
time.Sleep(500 * time.Millisecond)
}
return puretui.MsgActionDone{AgentID: id, Action: "Restart", Err: err}
}
}
func (a *Adapter) startLauncher() tea.Cmd {
return func() tea.Msg {
err := a.mgr.StartUnified()