tui

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 46 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tui is antares' terminal UI: a colourful, responsive, web-like chat built on Bubble Tea — sidebar, scrollable transcript with Markdown, a bordered input box, a slash-command palette, and toggleable reasoning. The Bubble Tea renderer owns the screen, so resizing and redraws never corrupt the layout.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDemoFrame

func RenderDemoFrame(w, h int) string

RenderDemoFrame renders a single demo frame at the given size — used by the screenshot tool to preview the design.

func RenderModelModalFrame

func RenderModelModalFrame(w, h int) string

RenderModelModalFrame previews the model picker with a seeded provider.

func RenderProviderModalFrame

func RenderProviderModalFrame(w, h int) string

RenderProviderModalFrame previews the provider picker.

func RenderThemeModalFrame

func RenderThemeModalFrame(w, h int) string

RenderThemeModalFrame renders the demo with the theme picker open — used by the screenshot tool to preview the modal.

func RenderWelcomeFrame

func RenderWelcomeFrame(w, h, frame int) string

RenderWelcomeFrame renders the empty-state splash at a given animation frame — used by the screenshot tool to preview the welcome screen.

func ThemeExists

func ThemeExists(name string) bool

ThemeExists reports whether a theme name is known (exported for the CLI).

func ThemeNames

func ThemeNames() []string

ThemeNames lists the available theme names (exported for the CLI).

Types

type Command

type Command struct {
	Name    string
	Args    string
	Summary string
	Run     func(m *Model, args string) (quit bool, cmd tea.Cmd)
}

Command is one slash command offered in the palette. Native commands carry a Run; the rest come from the shared registry in internal/commands and are dispatched through commands.Run.

type Model

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

Model is the Bubble Tea model.

func New

func New(ag *agent.Agent, cfg *config.Config, db store.Store) *Model

New builds a TUI bound to a running agent.

func NewDemo

func NewDemo() *Model

NewDemo builds a self-contained TUI seeded with representative content and no live agent — for previewing the interface (and for hot-reload development). Sending a message produces a canned reply instead of calling a model.

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Run

func (m *Model) Run(ctx context.Context) error

Run takes over the terminal until the user quits.

func (*Model) SetMCP added in v0.6.0

func (m *Model) SetMCP(mgr *mcp.Manager)

SetMCP wires the runtime's MCP manager so /mcp can list server state. Call once after New; nil is fine.

func (*Model) SetReload added in v0.4.0

func (m *Model) SetReload(fn func() error)

SetReload wires the runtime's reload closure so config changes made from the TUI (model switch, provider connect, theme, /config …) rebuild the same services a dashboard save would. Call once after New; nil is fine (the TUI falls back to a config-only refresh and notes what a restart would apply).

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type Theme

type Theme struct {
	Name    string
	Accent  lipgloss.AdaptiveColor // the highlight (prompt, focus, "you", the active tab)
	Accent2 lipgloss.AdaptiveColor // the second accent (a command being typed, a question)
	Text    lipgloss.AdaptiveColor
	Muted   lipgloss.AdaptiveColor
	Faint   lipgloss.AdaptiveColor
	Border  lipgloss.AdaptiveColor
	Green   lipgloss.AdaptiveColor
	Red     lipgloss.AdaptiveColor
	Yellow  lipgloss.AdaptiveColor

	Canvas lipgloss.AdaptiveColor // behind the boxes and the status bar
	Panel  lipgloss.AdaptiveColor // inside every box
	Subtle lipgloss.AdaptiveColor // inside the composer
	Band   lipgloss.AdaptiveColor // under the selected row of a list
}

Theme is a named colour scheme. Everything else in the UI is greyscale; a theme only picks the accents and the neutral ramp, so switching stays calm.

The surfaces are what the grid of boxes is painted with: Canvas behind everything, Panel inside every box, Subtle inside the composer, Band under a selected row. Border is mixed from the theme's own Panel and Muted to about 2.4:1 against Panel, so a box's outline can be seen without competing with the muted text it frames; theme_test.go holds every theme to that.

Jump to

Keyboard shortcuts

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