tui

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package tui implements the Bubble Tea UI for streaming completions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat added in v0.2.4

type Chat struct {
	Error *errs.Error
	// contains filtered or unexported fields
}

Chat is the Bubble Tea model for an interactive multi-turn REPL.

func NewChat added in v0.2.4

func NewChat(
	ctx context.Context,
	r *lipgloss.Renderer,
	cfg *config.Config,
	agentSvc *agent.Service,
	history []proto.Message,
	saveFn SaveFn,
	initialPrompt string,
) *Chat

NewChat creates the Bubble Tea model for interactive chat.

func (*Chat) Init added in v0.2.4

func (c *Chat) Init() tea.Cmd

Init implements tea.Model.

func (*Chat) Messages added in v0.2.4

func (c *Chat) Messages() []proto.Message

Messages returns the current conversation history.

func (*Chat) Update added in v0.2.4

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

Update implements tea.Model.

func (*Chat) View added in v0.2.4

func (c *Chat) View() string

View implements tea.Model.

type SaveFn added in v0.2.4

type SaveFn func([]proto.Message) error

SaveFn persists conversation messages after each turn.

type Yai

type Yai struct {
	// Output is populated at the end of a run for non-raw output printing.
	Output string
	Input  string
	Styles present.Styles
	Error  *errs.Error

	Config *config.Config
	// contains filtered or unexported fields
}

Yai is the Bubble Tea model that manages reading stdin and streaming LLM output.

func NewYai

func NewYai(
	ctx context.Context,
	r *lipgloss.Renderer,
	cfg *config.Config,
	agentSvc *agent.Service,
) *Yai

NewYai creates the Bubble Tea model used for interactive streaming output.

func (*Yai) GlamourOutput

func (m *Yai) GlamourOutput() string

GlamourOutput returns the last rendered formatted output.

func (*Yai) Init

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

Init implements tea.Model.

func (*Yai) Messages

func (m *Yai) Messages() []proto.Message

Messages returns the message list built/received during streaming.

func (*Yai) Update

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

Update implements tea.Model.

func (*Yai) View

func (m *Yai) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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