Documentation
¶
Overview ¶
Package components provides TUI components
Package components provides TUI components
Index ¶
- func FormatAgentLine(theme *Theme, ag agent.Agent, width int) string
- func FormatDuration(d time.Duration) string
- func MiniStats(theme *Theme, stats *session.Stats) string
- func RenderGrouped(theme *Theme, groups []session.Group, width int) string
- func ShortHelp(theme *Theme) string
- func StatusIndicator(theme *Theme, status agent.Status) string
- type AgentItem
- type AgentList
- func (a *AgentList) FilterValue() string
- func (a *AgentList) GroupMode() session.GroupMode
- func (a *AgentList) Init() tea.Cmd
- func (a *AgentList) IsFocused() bool
- func (a *AgentList) ParentAgent() agent.Agent
- func (a *AgentList) Selected() agent.Agent
- func (a *AgentList) SetFocused(focused bool)
- func (a *AgentList) SetGroupMode(mode session.GroupMode)
- func (a *AgentList) SetSelected(id string)
- func (a *AgentList) SetSize(width, height int)
- func (a *AgentList) Update(msg tea.Msg) (*AgentList, tea.Cmd)
- func (a *AgentList) View() string
- func (a *AgentList) ViewMode() ViewMode
- type AgentListKeyMap
- type AgentListRefreshMsg
- type AgentSelectedMsg
- type AlertRefreshMsg
- type AlertsPanel
- func (a *AlertsPanel) Init() tea.Cmd
- func (a *AlertsPanel) IsFocused() bool
- func (a *AlertsPanel) SetFocused(focused bool)
- func (a *AlertsPanel) SetSize(width, height int)
- func (a *AlertsPanel) UnreadCount() int
- func (a *AlertsPanel) Update(msg tea.Msg) (*AlertsPanel, tea.Cmd)
- func (a *AlertsPanel) View() string
- type Command
- type CommandPalette
- func (c *CommandPalette) AddCommand(cmd Command)
- func (c *CommandPalette) Hide()
- func (c *CommandPalette) Init() tea.Cmd
- func (c *CommandPalette) IsVisible() bool
- func (c *CommandPalette) SetCommands(commands []Command)
- func (c *CommandPalette) SetSize(width, height int)
- func (c *CommandPalette) Show() tea.Cmd
- func (c *CommandPalette) Update(msg tea.Msg) (*CommandPalette, tea.Cmd)
- func (c *CommandPalette) View() string
- type Filter
- func (f Filter) Apply(agents []agent.Agent) []agent.Agent
- func (f Filter) HelpText() string
- func (f Filter) Init() tea.Cmd
- func (f Filter) IsActive() bool
- func (f Filter) IsSearchActive() bool
- func (f Filter) SearchQuery() string
- func (f *Filter) SetCounts(filtered, total int)
- func (f Filter) StatusFilter() agent.Status
- func (f Filter) Update(msg tea.Msg) (Filter, tea.Cmd)
- func (f Filter) View() string
- type FilterMode
- type HelpScreen
- func (h *HelpScreen) Hide()
- func (h *HelpScreen) Init() tea.Cmd
- func (h *HelpScreen) IsVisible() bool
- func (h *HelpScreen) SetSize(width, height int)
- func (h *HelpScreen) Show()
- func (h *HelpScreen) Toggle()
- func (h *HelpScreen) Update(msg tea.Msg) (*HelpScreen, tea.Cmd)
- func (h *HelpScreen) View() string
- type InputBar
- func (i *InputBar) Blur()
- func (i *InputBar) Focus() tea.Cmd
- func (i *InputBar) Init() tea.Cmd
- func (i *InputBar) IsActive() bool
- func (i *InputBar) OnSubmit(fn func(string))
- func (i *InputBar) SetPlaceholder(placeholder string)
- func (i *InputBar) SetValue(value string)
- func (i *InputBar) SetWidth(width int)
- func (i *InputBar) Update(msg tea.Msg) (*InputBar, tea.Cmd)
- func (i *InputBar) Value() string
- func (i *InputBar) View() string
- type InputSubmitMsg
- type RefreshMsg
- type SessionViewport
- func (s *SessionViewport) Agent() agent.Agent
- func (s *SessionViewport) Init() tea.Cmd
- func (s *SessionViewport) IsFocused() bool
- func (s *SessionViewport) ScrollToBottom()
- func (s *SessionViewport) ScrollToTop()
- func (s *SessionViewport) SetAgent(ag agent.Agent)
- func (s *SessionViewport) SetAutoScroll(enabled bool)
- func (s *SessionViewport) SetFocused(focused bool)
- func (s *SessionViewport) SetSize(width, height int)
- func (s *SessionViewport) Update(msg tea.Msg) (*SessionViewport, tea.Cmd)
- func (s *SessionViewport) View() string
- type ShowHelpMsg
- type SpawnDialog
- type SpawnResult
- type SpawnState
- type StartInputMsg
- type StartSearchMsg
- type StatsPanel
- type TerminateAgentMsg
- type Theme
- type ToggleAlertsMsg
- type ToggleGroupingMsg
- type ToggleStatsMsg
- type ViewMode
- type ViewportRefreshMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAgentLine ¶
FormatAgentLine formats an agent for display
func FormatDuration ¶
FormatDuration formats a duration for display
func RenderGrouped ¶
RenderGrouped renders agents in groups
Types ¶
type AgentList ¶
type AgentList struct {
// contains filtered or unexported fields
}
func NewAgentList ¶
func (*AgentList) FilterValue ¶
FilterValue returns the current filter value
func (*AgentList) ParentAgent ¶
func (*AgentList) SetFocused ¶
SetFocused sets the focus state
func (*AgentList) SetGroupMode ¶
func (*AgentList) SetSelected ¶
SetSelected sets the selected agent by ID
type AgentListKeyMap ¶
type AgentListKeyMap struct {
Up key.Binding
Down key.Binding
Select key.Binding
ToggleGroup key.Binding
Terminate key.Binding
Pause key.Binding
Filter key.Binding
ClearFilter key.Binding
ViewChildren key.Binding
GoBack key.Binding
}
func DefaultAgentListKeyMap ¶
func DefaultAgentListKeyMap() AgentListKeyMap
type AgentSelectedMsg ¶
AgentSelectedMsg is sent when an agent is selected
type AlertsPanel ¶
type AlertsPanel struct {
// contains filtered or unexported fields
}
AlertsPanel displays alerts and notifications
func NewAlertsPanel ¶
func NewAlertsPanel(theme *Theme, alertMgr *alert.Manager, width, height int) *AlertsPanel
NewAlertsPanel creates a new alerts panel
func (*AlertsPanel) IsFocused ¶
func (a *AlertsPanel) IsFocused() bool
IsFocused returns the focus state
func (*AlertsPanel) SetFocused ¶
func (a *AlertsPanel) SetFocused(focused bool)
SetFocused sets the focus state
func (*AlertsPanel) SetSize ¶
func (a *AlertsPanel) SetSize(width, height int)
SetSize sets the component size
func (*AlertsPanel) UnreadCount ¶
func (a *AlertsPanel) UnreadCount() int
UnreadCount returns the number of unread alerts
func (*AlertsPanel) Update ¶
func (a *AlertsPanel) Update(msg tea.Msg) (*AlertsPanel, tea.Cmd)
Update handles messages
type Command ¶
Command represents a command palette command
func DefaultCommands ¶
func DefaultCommands() []Command
DefaultCommands returns the default command set
type CommandPalette ¶
type CommandPalette struct {
// contains filtered or unexported fields
}
CommandPalette is a fuzzy command palette
func NewCommandPalette ¶
func NewCommandPalette(theme *Theme, commands []Command) *CommandPalette
NewCommandPalette creates a new command palette
func (*CommandPalette) AddCommand ¶
func (c *CommandPalette) AddCommand(cmd Command)
AddCommand adds a command
func (*CommandPalette) Init ¶
func (c *CommandPalette) Init() tea.Cmd
Init initializes the command palette
func (*CommandPalette) IsVisible ¶
func (c *CommandPalette) IsVisible() bool
IsVisible returns whether the palette is visible
func (*CommandPalette) SetCommands ¶
func (c *CommandPalette) SetCommands(commands []Command)
SetCommands sets the available commands
func (*CommandPalette) SetSize ¶
func (c *CommandPalette) SetSize(width, height int)
SetSize sets the component size
func (*CommandPalette) Show ¶
func (c *CommandPalette) Show() tea.Cmd
Show shows the command palette
func (*CommandPalette) Update ¶
func (c *CommandPalette) Update(msg tea.Msg) (*CommandPalette, tea.Cmd)
Update handles messages
func (*CommandPalette) View ¶
func (c *CommandPalette) View() string
View renders the command palette
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func (Filter) IsSearchActive ¶
func (Filter) SearchQuery ¶
func (Filter) StatusFilter ¶
type FilterMode ¶
type FilterMode int
const ( FilterModeNone FilterMode = iota FilterModeSearch FilterModeStatus )
type HelpScreen ¶
type HelpScreen struct {
// contains filtered or unexported fields
}
HelpScreen displays keybindings and help information
func NewHelpScreen ¶
func NewHelpScreen(theme *Theme) *HelpScreen
NewHelpScreen creates a new help screen
func (*HelpScreen) IsVisible ¶
func (h *HelpScreen) IsVisible() bool
IsVisible returns whether the help screen is visible
func (*HelpScreen) SetSize ¶
func (h *HelpScreen) SetSize(width, height int)
SetSize sets the component size
func (*HelpScreen) Update ¶
func (h *HelpScreen) Update(msg tea.Msg) (*HelpScreen, tea.Cmd)
Update handles messages
type InputBar ¶
type InputBar struct {
// contains filtered or unexported fields
}
InputBar is a text input component
func NewInputBar ¶
NewInputBar creates a new input bar
func (*InputBar) SetPlaceholder ¶
SetPlaceholder sets the placeholder text
type InputSubmitMsg ¶
type InputSubmitMsg struct {
Value string
}
InputSubmitMsg is sent when input is submitted
type RefreshMsg ¶
type RefreshMsg struct{}
type SessionViewport ¶
type SessionViewport struct {
// contains filtered or unexported fields
}
SessionViewport displays agent session output
func NewSessionViewport ¶
func NewSessionViewport(theme *Theme, width, height int) *SessionViewport
NewSessionViewport creates a new session viewport
func (*SessionViewport) Agent ¶
func (s *SessionViewport) Agent() agent.Agent
Agent returns the current agent
func (*SessionViewport) Init ¶
func (s *SessionViewport) Init() tea.Cmd
Init initializes the viewport
func (*SessionViewport) IsFocused ¶
func (s *SessionViewport) IsFocused() bool
IsFocused returns the focus state
func (*SessionViewport) ScrollToBottom ¶
func (s *SessionViewport) ScrollToBottom()
ScrollToBottom scrolls to the bottom
func (*SessionViewport) ScrollToTop ¶
func (s *SessionViewport) ScrollToTop()
ScrollToTop scrolls to the top
func (*SessionViewport) SetAgent ¶
func (s *SessionViewport) SetAgent(ag agent.Agent)
SetAgent sets the agent to display
func (*SessionViewport) SetAutoScroll ¶
func (s *SessionViewport) SetAutoScroll(enabled bool)
SetAutoScroll sets the auto-scroll state
func (*SessionViewport) SetFocused ¶
func (s *SessionViewport) SetFocused(focused bool)
SetFocused sets the focus state
func (*SessionViewport) SetSize ¶
func (s *SessionViewport) SetSize(width, height int)
SetSize sets the component size
func (*SessionViewport) Update ¶
func (s *SessionViewport) Update(msg tea.Msg) (*SessionViewport, tea.Cmd)
Update handles messages
type SpawnDialog ¶
type SpawnDialog struct {
// contains filtered or unexported fields
}
func NewSpawnDialog ¶
func NewSpawnDialog() SpawnDialog
func (SpawnDialog) Init ¶
func (d SpawnDialog) Init() tea.Cmd
func (SpawnDialog) IsCancelled ¶
func (d SpawnDialog) IsCancelled() bool
func (SpawnDialog) IsComplete ¶
func (d SpawnDialog) IsComplete() bool
func (SpawnDialog) Result ¶
func (d SpawnDialog) Result() SpawnResult
func (SpawnDialog) Update ¶
func (d SpawnDialog) Update(msg tea.Msg) (SpawnDialog, tea.Cmd)
func (SpawnDialog) View ¶
func (d SpawnDialog) View() string
type SpawnResult ¶
type SpawnResult struct {
Config agent.SpawnConfig
Cancelled bool
}
type SpawnState ¶
type SpawnState int
const ( SpawnStateDirectory SpawnState = iota SpawnStateName SpawnStateConfirm )
type StartInputMsg ¶
type StartInputMsg struct{}
type StartSearchMsg ¶
type StartSearchMsg struct{}
type StatsPanel ¶
type StatsPanel struct {
// contains filtered or unexported fields
}
StatsPanel displays aggregate statistics
func NewStatsPanel ¶
func NewStatsPanel(theme *Theme, manager *session.Manager, width, height int) *StatsPanel
NewStatsPanel creates a new stats panel
func (*StatsPanel) IsFocused ¶
func (s *StatsPanel) IsFocused() bool
IsFocused returns the focus state
func (*StatsPanel) SetFocused ¶
func (s *StatsPanel) SetFocused(focused bool)
SetFocused sets the focus state
func (*StatsPanel) SetSize ¶
func (s *StatsPanel) SetSize(width, height int)
SetSize sets the component size
func (*StatsPanel) Update ¶
func (s *StatsPanel) Update(msg tea.Msg) (*StatsPanel, tea.Cmd)
Update handles messages
type TerminateAgentMsg ¶
type TerminateAgentMsg struct{}
type Theme ¶
type Theme struct {
// Colors
Primary lipgloss.Color
Secondary lipgloss.Color
Accent lipgloss.Color
Background lipgloss.Color
Foreground lipgloss.Color
Border lipgloss.Color
BorderFocused lipgloss.Color
StatusRunning lipgloss.Color
StatusIdle lipgloss.Color
StatusError lipgloss.Color
StatusDone lipgloss.Color
// Base styles
Base lipgloss.Style
Title lipgloss.Style
Subtitle lipgloss.Style
Header lipgloss.Style
BorderStyle lipgloss.Style
// Component styles
AgentListStyle lipgloss.Style
ViewportStyle lipgloss.Style
StatsStyle lipgloss.Style
AlertsStyle lipgloss.Style
InputStyle lipgloss.Style
CommandStyle lipgloss.Style
HelpStyle lipgloss.Style
SelectedItemStyle lipgloss.Style
NormalItemStyle lipgloss.Style
// Status styles
StatusStyles map[agent.Status]lipgloss.Style
}
Theme holds all the styles for the TUI
func DefaultDarkTheme ¶
func DefaultDarkTheme() *Theme
DefaultDarkTheme returns the default dark theme
func DefaultLightTheme ¶
func DefaultLightTheme() *Theme
DefaultLightTheme returns the default light theme
func NewTheme ¶
func NewTheme(cfg *config.ThemeConfig) *Theme
NewTheme creates a new theme from config
func (*Theme) FocusedBorder ¶
FocusedBorder returns a style with focused border
type ToggleAlertsMsg ¶
type ToggleAlertsMsg struct{}
type ToggleGroupingMsg ¶
type ToggleGroupingMsg struct{}
type ToggleStatsMsg ¶
type ToggleStatsMsg struct{}
type ViewportRefreshMsg ¶
type ViewportRefreshMsg struct{}
ViewportRefreshMsg triggers a content refresh