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 ¶
- func RenderDemoFrame(w, h int) string
- func RenderModelModalFrame(w, h int) string
- func RenderProviderModalFrame(w, h int) string
- func RenderThemeModalFrame(w, h int) string
- func RenderWelcomeFrame(w, h, frame int) string
- func ThemeExists(name string) bool
- func ThemeNames() []string
- type Command
- type Model
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderDemoFrame ¶
RenderDemoFrame renders a single demo frame at the given size — used by the screenshot tool to preview the design.
func RenderModelModalFrame ¶
RenderModelModalFrame previews the model picker with a seeded provider.
func RenderProviderModalFrame ¶
RenderProviderModalFrame previews the provider picker.
func RenderThemeModalFrame ¶
RenderThemeModalFrame renders the demo with the theme picker open — used by the screenshot tool to preview the modal.
func RenderWelcomeFrame ¶
RenderWelcomeFrame renders the empty-state splash at a given animation frame — used by the screenshot tool to preview the welcome screen.
func ThemeExists ¶
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 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) SetMCP ¶ added in v0.6.0
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
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).
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.