app

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialogAddProject      = "add_project"
	DialogCreateWorkspace = "create_workspace"
	DialogDeleteWorkspace = "delete_workspace"
	DialogRemoveProject   = "remove_project"
	DialogSelectAssistant = "select_assistant"
	DialogQuit            = "quit"
	DialogCleanupTmux     = "cleanup_tmux"
)

DialogID constants

View Source
const (
	HarnessCenter  = "center"
	HarnessSidebar = "sidebar"
	HarnessMonitor = "monitor"
)

HarnessMode values.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is the root Bubbletea model.

func New

func New(version, commit, date string) (*App, error)

New creates a new App instance.

func (*App) CleanupTmuxOnExit added in v0.0.9

func (a *App) CleanupTmuxOnExit()

CleanupTmuxOnExit is a no-op since sessions are always persisted across restarts.

func (*App) Init

func (a *App) Init() tea.Cmd

Init initializes the application.

func (*App) IsTmuxAvailable added in v0.0.9

func (a *App) IsTmuxAvailable() bool

IsTmuxAvailable returns whether tmux is installed and available.

func (*App) SetMsgSender added in v0.0.4

func (a *App) SetMsgSender(send func(tea.Msg))

func (*App) Shutdown added in v0.0.5

func (a *App) Shutdown()

Shutdown releases resources that may outlive the Bubble Tea program.

func (*App) Update

func (a *App) Update(msg tea.Msg) (model tea.Model, cmd tea.Cmd)

Update handles all messages with panic recovery.

func (*App) View

func (a *App) View() (view tea.View)

View renders the application using layer-based composition. This uses lipgloss Canvas to compose layers directly, enabling ultraviolet's cell-level differential rendering for optimal performance.

type GitStatusService added in v0.0.12

type GitStatusService interface {
	Run(ctx context.Context) error
	GetCached(root string) *git.StatusResult
	UpdateCache(root string, status *git.StatusResult)
	Invalidate(root string)
	Refresh(root string) (*git.StatusResult, error)
}

GitStatusService provides cached status reads and fresh refreshes.

type Harness

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

Harness drives a headless render loop for profiling.

func NewHarness

func NewHarness(opts HarnessOptions) (*Harness, error)

NewHarness builds a headless UI harness for the requested mode.

func (*Harness) Render

func (h *Harness) Render() tea.View

Render returns the composed view for the harness mode.

func (*Harness) Step

func (h *Harness) Step(frame int)

Step simulates output for the active tabs.

type HarnessOptions

type HarnessOptions struct {
	Mode            string
	Tabs            int
	Width           int
	Height          int
	HotTabs         int
	PayloadBytes    int
	NewlineEvery    int
	ShowKeymapHints bool
}

HarnessOptions configures the headless UI harness.

type KeyMap

type KeyMap struct {
	// Prefix key (leader)
	Prefix key.Binding

	// Global (active only after prefix)
	Quit           key.Binding
	MoveLeft       key.Binding
	MoveRight      key.Binding
	MoveUp         key.Binding
	MoveDown       key.Binding
	NextTab        key.Binding
	PrevTab        key.Binding
	CloseTab       key.Binding
	DetachTab      key.Binding
	ReattachTab    key.Binding
	RestartTab     key.Binding
	CleanupTmux    key.Binding
	NewAgentTab    key.Binding
	NewTerminalTab key.Binding
	Help           key.Binding

	// Dashboard
	Enter        key.Binding
	Delete       key.Binding
	ToggleFilter key.Binding
	Refresh      key.Binding

	// Agent/Chat
	Interrupt  key.Binding
	SendEscape key.Binding

	// Navigation
	Up    key.Binding
	Down  key.Binding
	Left  key.Binding
	Right key.Binding
}

KeyMap defines all keybindings for the application

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default keybindings

type ProjectRegistry added in v0.0.12

type ProjectRegistry interface {
	Projects() ([]string, error)
	AddProject(path string) error
	RemoveProject(path string) error
}

ProjectRegistry is the minimal interface used by the app for project tracking.

type TmuxOps added in v0.0.12

type TmuxOps interface {
	EnsureAvailable() error
	InstallHint() string
	ActiveAgentSessionsByActivity(window time.Duration, opts tmux.Options) ([]tmux.SessionActivity, error)
	SessionsWithTags(match map[string]string, keys []string, opts tmux.Options) ([]tmux.SessionTagValues, error)
	SessionStateFor(sessionName string, opts tmux.Options) (tmux.SessionState, error)
	SessionHasClients(sessionName string, opts tmux.Options) (bool, error)
	SessionCreatedAt(sessionName string, opts tmux.Options) (int64, error)
	KillSession(sessionName string, opts tmux.Options) error
	KillSessionsMatchingTags(tags map[string]string, opts tmux.Options) (bool, error)
	KillSessionsWithPrefix(prefix string, opts tmux.Options) error
	KillWorkspaceSessions(wsID string, opts tmux.Options) error
	SetMonitorActivityOn(opts tmux.Options) error
	SetStatusOff(opts tmux.Options) error
	CapturePaneTail(sessionName string, lines int, opts tmux.Options) (string, bool)
	ContentHash(content string) [16]byte
}

TmuxOps defines tmux operations used by the app.

type UpdateService added in v0.0.12

type UpdateService interface {
	Check() (*update.CheckResult, error)
	Upgrade(release *update.Release) error
	IsHomebrewBuild() bool
}

UpdateService wraps release checks and upgrades.

type WorkspaceStore added in v0.0.12

type WorkspaceStore interface {
	ListByRepo(repo string) ([]*data.Workspace, error)
	ListByRepoIncludingArchived(repo string) ([]*data.Workspace, error)
	LoadMetadataFor(workspace *data.Workspace) (bool, error)
	UpsertFromDiscovery(workspace *data.Workspace) error
	Save(workspace *data.Workspace) error
	Delete(id data.WorkspaceID) error
}

WorkspaceStore is the minimal interface used by the app for workspace metadata.

Jump to

Keyboard shortcuts

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