tui

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
   __ _| |_ _ __(_) __ _
  / _` + "`" + ` | __| '__| |/ _` + "`" + ` |
 | (_| | |_| |  | | (_| |
  \__,_|\__|_|  |_|\__,_|`

Logo is the standard figlet-font ASCII art for Atria, shared across the version flag, empty state, and setup wizard.

Variables

View Source
var Version = "dev"

Version is set by main.go from build-time ldflags.

Functions

func EnsureMonitorDir

func EnsureMonitorDir(dir string) error

func MatchesPrimarySource added in v0.3.0

func MatchesPrimarySource(bs BackendStatus, source string) bool

MatchesPrimarySource reports whether a backend status entry corresponds to the given composite primary source name. Handles the iterm2→iterm mapping.

Types

type AgentDiscoveredMsg

type AgentDiscoveredMsg struct {
	SessionID string
	AgentType model.AgentType
	Source    string // backend source ("pty", "iterm", "tmux", etc.)
	Dir       string // resolved working directory, empty if not found
	DebugSkip string // optional discovery skip reason for debug logging
}

AgentDiscoveredMsg is sent when an untracked agent has been identified and its CWD resolved.

type AgentLaunchedMsg

type AgentLaunchedMsg struct {
	ProjectDir string
	SessionID  string
	AgentType  model.AgentType
	Source     string // backend source ("pty", "tmux", etc.), empty = use primary
	Err        error
}

AgentLaunchedMsg is sent after launching an agent in a new session.

type BackendAvailableMsg

type BackendAvailableMsg struct {
	Err error
}

BackendAvailableMsg indicates whether the backend is usable.

type BackendStatus

type BackendStatus struct {
	Name    string // "pty", "iterm2", "tmux"
	Enabled bool   // in integrations list
	Active  bool   // enabled + probe OK + environment matches
	Launch  bool   // is the launch target
	Reason  string // why unavailable or not active
}

BackendStatus describes the state of a backend for the settings screen.

type ConfigSavedMsg

type ConfigSavedMsg struct {
	Err      error
	Rollback func(m *Model) // reverts optimistic mutations on save failure
}

ConfigSavedMsg is sent after persisting config to disk. If Err is non-nil and Rollback is set, the handler calls Rollback to revert in-memory mutations that were applied optimistically.

type DirBrowserItem

type DirBrowserItem struct {
	Path     string
	Name     string
	IsParent bool // true for ".." entry
}

DirBrowserItem represents a directory in the add-project browser.

type DirBrowserMsg

type DirBrowserMsg struct {
	Dirs       []DirBrowserItem
	CurrentDir string
}

DirBrowserMsg contains directories for the browser view.

type DiscoveryTickMsg added in v0.4.2

type DiscoveryTickMsg struct{}

DiscoveryTickMsg triggers periodic session discovery refresh.

type FocusedMsg

type FocusedMsg struct {
	Err error
}

FocusedMsg is sent after focusing a session.

type GitInfo

type GitInfo struct {
	IsWorktree bool
	ParentRepo string // basename of main repo
	Branch     string // worktree branch name
}

GitInfo holds git worktree metadata for a directory.

type IntegrationToggledMsg

type IntegrationToggledMsg struct {
	Name        string
	Status      BackendStatus
	Err         error
	RemappedIDs map[string]string // old session ID → new session ID (e.g. PTY demotion)
	NewPrimary  string            // source of the new launch target (set on both enable and disable)
}

IntegrationToggledMsg is sent after toggling an integration on or off.

type Model

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

func NewModel

func NewModel(backend terminal.Backend, store *model.Store, watchDirs []string, monitorDir string) Model

func NewModelWithConfig

func NewModelWithConfig(backend terminal.Backend, store *model.Store, watchDirs []string, monitorDir string, defaultAgentCfg string, launchDir string) Model

func (Model) Cleanup

func (m Model) Cleanup()

Cleanup kills all monitor processes.

func (*Model) EnableDebugLog

func (m *Model) EnableDebugLog(path string, unsafe bool) error

EnableDebugLog sets up debug logging to the given file path.

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) SetConfig

func (m *Model) SetConfig(cfg *config.Config, path string)

SetConfig sets the config and config path for the settings screen.

func (*Model) SetPTYClient

func (m *Model) SetPTYClient(pty terminal.Backend)

SetPTYClient sets the PTY client reference for integration toggling.

func (*Model) SetStatusInfo

func (m *Model) SetStatusInfo(info StatusInfo)

SetStatusInfo sets the backend status info for the settings screen.

func (Model) Update

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

func (Model) View

func (m Model) View() string

type MonitorStartedMsg

type MonitorStartedMsg struct {
	SessionID  string
	ProjectDir string
	PID        int
	LogPath    string
	Err        error
}

MonitorStartedMsg is sent after starting a monitor process.

type PromptSentMsg

type PromptSentMsg struct {
	ProjectDir string
	Err        error
}

PromptSentMsg is sent after sending a prompt to an agent.

type QuickResponseArmExpiredMsg added in v0.4.0

type QuickResponseArmExpiredMsg struct {
	SessionID string
}

QuickResponseArmExpiredMsg clears the transient armed quick-response state.

type ScreenReadMsg

type ScreenReadMsg struct {
	SessionID  string
	ProjectDir string
	Content    string
	Err        error
}

ScreenReadMsg contains screen content read from a session.

type SessionsRefreshedMsg

type SessionsRefreshedMsg struct {
	Sessions []terminal.Session
	Err      error
}

SessionsRefreshedMsg is sent when the session list has been refreshed.

type SpinnerTickMsg

type SpinnerTickMsg struct{}

SpinnerTickMsg advances the spinner animation.

type StatusInfo

type StatusInfo struct {
	Backends   []BackendStatus
	ConfigPath string
}

StatusInfo holds backend status information built during startup.

type StatusMsg

type StatusMsg struct {
	Text string
}

StatusMsg is a transient message shown in the status bar.

type StatusTickMsg added in v0.4.2

type StatusTickMsg struct{}

StatusTickMsg triggers background status polling.

type StatusUpdatedMsg

type StatusUpdatedMsg struct {
	SessionID  string
	ProjectDir string
	Status     model.AgentStatus
	Activity   string
	Attention  string
}

StatusUpdatedMsg is sent when agent status has been checked.

type UpgradeAvailableMsg added in v0.3.0

type UpgradeAvailableMsg struct {
	LatestVersion string
	InstallHint   string
}

UpgradeAvailableMsg is sent when a newer version is available on GitHub.

type VisibleRefreshMsg added in v0.4.2

type VisibleRefreshMsg struct {
	SessionID string
}

VisibleRefreshMsg triggers a fast refresh for the currently visible session.

Jump to

Keyboard shortcuts

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