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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user