bubbletea

package
v1.2.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package bubbletea is evva's reference terminal UI: it satisfies the public ui.UI contract (pkg/ui) and drives any agent through ui.Controller, so it depends only on pkg/* — a downstream host embeds it exactly the way cmd/evva does. Built from focused components, a focus stack, and a declarative layout engine rather than a god-object root model.

Wiring (host responsibility):

tui := bubbletea.New(evvaHome)
ag, _ := agent.New(agent.Config{...}, agent.WithSink(tui), agent.WithRootContext(ctx))
tui.Attach(ag.Controller())
tui.Run(ctx)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UI

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

UI is the v2 bubbletea TUI. Construct with New(); attach an agent via Attach() before calling Run().

func New

func New(evvaHome string) *UI

New builds a UI ready to be Attached and Run. evvaHome is the user's config directory (typically ~/.evva); it is plumbed through to the app model for future banner / settings resolution.

Mouse capture is on via tea.WithMouseCellMotion so the wheel scrolls the transcript viewport. The trade-off (no native drag-select unless the user holds Shift/Alt) is documented in the approved plan; the Ctrl+Y yank mode is the canonical clean-copy path for users on terminals where Shift-bypass doesn't work (tmux, screen).

func (*UI) Attach

func (u *UI) Attach(c ui.Controller)

Attach hands the UI its agent controller. Must be called before Run.

func (*UI) Emit

func (u *UI) Emit(e event.Event)

Emit satisfies event.Sink. Called from the agent goroutine; forwards to the bubbletea main loop via Send so all state mutation stays on one goroutine.

func (*UI) Run

func (u *UI) Run(ctx context.Context) error

Run starts the bubbletea program and blocks until exit. ctx cancellation triggers a clean shutdown via a QuitMsg.

Directories

Path Synopsis
Package app is the v2 TUI's top-level tea.Model.
Package app is the v2 TUI's top-level tea.Model.
components
agents
Package agents renders the horizontal subagent chip strip that sits just above the input.
Package agents renders the horizontal subagent chip strip that sits just above the input.
bgtasks
Package bgtasks renders the horizontal background-task chip strip.
Package bgtasks renders the horizontal background-task chip strip.
diff
Package diff renders a *fs.FileDiff (the structured metadata write_file / edit_file attach to tools.Result) as a multi-line git-style string with a gutter / content split.
Package diff renders a *fs.FileDiff (the structured metadata write_file / edit_file attach to tools.Result) as a multi-line git-style string with a gutter / content split.
input
Package input owns the v2 TUI's bottom textarea: prompt composition, paste compaction, and history navigation.
Package input owns the v2 TUI's bottom textarea: prompt composition, paste compaction, and history navigation.
monitors
Package monitors renders the horizontal monitor-task chip strip.
Package monitors renders the horizontal monitor-task chip strip.
overlays
Package overlays implements the modal panels the App pushes onto its focus stack: /config (form), /model (picker), /compact (chooser).
Package overlays implements the modal panels the App pushes onto its focus stack: /config (form), /model (picker), /compact (chooser).
slash
Package slash renders the autocomplete suggestion panel that pops up when the user types "/" at the start of the input.
Package slash renders the autocomplete suggestion panel that pops up when the user types "/" at the start of the input.
status
Package status owns the v2 TUI's bottom HUD: the run-state pill, model + token cells, context-utilization meter, and the contextual hint line that sits above it.
Package status owns the v2 TUI's bottom HUD: the run-state pill, model + token cells, context-utilization meter, and the contextual hint line that sits above it.
todos
Package todos renders the bottom todo panel and the green "TODOS COMPLETE" snapshot folded into the transcript when every todo in the store finishes.
Package todos renders the bottom todo panel and the green "TODOS COMPLETE" snapshot folded into the transcript when every todo in the store finishes.
transcript
Package transcript owns the scrollback model of the v2 TUI.
Package transcript owns the scrollback model of the v2 TUI.
Package events declares the tea.Msg types the v2 TUI passes through its Update loop.
Package events declares the tea.Msg types the v2 TUI passes through its Update loop.
Package mouse owns mouse-capture wiring + clipboard integration.
Package mouse owns mouse-capture wiring + clipboard integration.
Package theme owns every styled surface in the v2 TUI.
Package theme owns every styled surface in the v2 TUI.

Jump to

Keyboard shortcuts

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