tui

package
v0.1.0-proto2m Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctrl AgentControl) error

Run starts the TUI

Types

type AgentControl

type AgentControl interface {
	FetchStatus(context.Context) ([]AgentStatus, error)
	Lifecycle(ctx context.Context, id, action string) (bool, error)
	GetLogs(ctx context.Context, id string) (<-chan string, error)
}

AgentControl defines the interface for interacting with agents.

type AgentStatus

type AgentStatus struct {
	ID     string
	State  string
	Type   string
	CPU    string
	Memory string
	Uptime time.Duration
}

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

func NewFilter

func NewFilter() Filter

func (*Filter) Activate

func (f *Filter) Activate(mode FilterMode)

func (*Filter) Deactivate

func (f *Filter) Deactivate()

func (*Filter) Matches

func (f *Filter) Matches(agent AgentStatus) bool

func (*Filter) SetQuery

func (f *Filter) SetQuery(query string)

func (*Filter) StatusLine

func (f *Filter) StatusLine() string

func (*Filter) Update

func (f *Filter) Update(msg tea.Msg) (Filter, tea.Cmd)

type FilterMode

type FilterMode int
const (
	FilterNone FilterMode = iota
	FilterByState
	FilterByType
	FilterByName
)

type LogEntry

type LogEntry struct {
	Timestamp time.Time
	Source    string // agent ID or "cluster"
	Type      string // "agent" or "cluster"
	Level     string // INFO, WARN, ERROR, DEBUG
	Message   string
}

type LogFilter

type LogFilter int
const (
	LogFilterAll LogFilter = iota
	LogFilterAgents
	LogFilterCluster
)

type LogViewer

type LogViewer struct {
	// contains filtered or unexported fields
}

func NewLogViewer

func NewLogViewer(agentID string, width, height int) LogViewer

func (LogViewer) Update

func (l LogViewer) Update(msg tea.Msg, agents []AgentStatus, selectedIdx int) (LogViewer, tea.Cmd)

func (LogViewer) View

func (l LogViewer) View() string

type Model

type Model struct {
	// contains filtered or unexported fields
}

func NewModel

func NewModel(ctrl AgentControl) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type ViewMode

type ViewMode int
const (
	ViewOverview ViewMode = iota // Tab 0: Local/Cluster Agents
	ViewGlobal                   // Tab 1: Global Agents Spec
	ViewLogs                     // Tab 2: Unified log stream
	ViewDetail                   // Detail view for specific agent
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL