tui

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 24 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DisplayBlock

type DisplayBlock struct {
	Type      string // "user", "assistant", "tool", "system"
	Content   string
	Tools     []*ToolState
	Thinking  string
	Timestamp time.Time
}

DisplayBlock represents one visual block in the conversation

type InputModel

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

InputModel wraps bubbles/textarea for full IME/Chinese support + history

func NewInputModel

func NewInputModel() *InputModel

func (*InputModel) Blur

func (i *InputModel) Blur()

func (*InputModel) Focus

func (i *InputModel) Focus()

func (*InputModel) Reset

func (i *InputModel) Reset()

func (*InputModel) SetWidth

func (i *InputModel) SetWidth(w int)

func (*InputModel) Update

func (i *InputModel) Update(msg tea.Msg) (bool, tea.Cmd)

Update processes a key message, returns true if Enter was pressed (submit)

func (*InputModel) Value

func (i *InputModel) Value() string

func (*InputModel) View

func (i *InputModel) View() string

type Model

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

Model is the main Bubble Tea model

func NewModel

func NewModel(cfg *config.Config, initialPrompt string, resume bool) *Model

func (*Model) GetAgent

func (m *Model) GetAgent() *agent.Agent

func (*Model) GetConfig

func (m *Model) GetConfig() *config.Config

func (*Model) GetCost

func (m *Model) GetCost() float64

func (*Model) GetTokensIn

func (m *Model) GetTokensIn() int

func (*Model) GetTokensOut

func (m *Model) GetTokensOut() int

func (*Model) Init

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

func (*Model) SendPrompt

func (m *Model) SendPrompt(prompt string)

func (*Model) SetModel

func (m *Model) SetModel(model string)

func (*Model) SetPermissionMode

func (m *Model) SetPermissionMode(mode string)

func (*Model) SetProgram

func (m *Model) SetProgram(p *tea.Program)

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type ToolState

type ToolState struct {
	ID        string
	Name      string
	Input     map[string]interface{}
	InputStr  string
	Status    string // "running", "done", "error"
	Output    string
	Error     string
	StartTime time.Time
	EndTime   time.Time
	Expanded  bool
}

ToolState tracks a single tool call's lifecycle

Jump to

Keyboard shortcuts

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