f5b857dbc6
Implementa un dashboard interactivo con bubbletea siguiendo el patrón pure core / impure shell del proyecto: - pkg/tui/ (PURE): Model, Update, View — solo fmt y strings, cero I/O. Update produce Intent[] (datos puros) en vez de side effects. - shell/tui/ (IMPURE): Adapter convierte Intent[] en tea.Cmd[] con I/O real (process management, /proc stats, log tail). - cmd/dashboard/ (composición): Bridge conecta pure Update con shell Adapter usando la Elm Architecture de bubbletea. Pantallas: Main Menu → Agent List → Agent Actions (start/stop/restart/kill) → Logs. Navegación: flechas ↑↓, Enter seleccionar, 0 volver, q salir. Dependencias añadidas: bubbletea, lipgloss. Actualiza .gitignore para anclar binarios a raíz (/agentctl, /dashboard). Documenta nuevos scripts en CLAUDE.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
569 B
Go
21 lines
569 B
Go
package tui
|
|
|
|
// Messages are pure data returned by the shell adapter.
|
|
// They carry the result of an I/O operation back into the pure Update.
|
|
|
|
// MsgAgentsLoaded carries refreshed agent data.
|
|
type MsgAgentsLoaded struct{ Agents []AgentView }
|
|
|
|
// MsgActionDone reports the result of an agent action (start/stop/kill/restart).
|
|
type MsgActionDone struct {
|
|
AgentID string
|
|
Action string
|
|
Err error
|
|
}
|
|
|
|
// MsgLogsLoaded carries log lines for the selected agent.
|
|
type MsgLogsLoaded struct{ Lines []string }
|
|
|
|
// MsgTick triggers a periodic refresh.
|
|
type MsgTick struct{}
|