tui

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 25 Imported by: 0

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 LoginWizard added in v0.6.1

type LoginWizard struct {
	Step         int    // 0=provider, 1=apikey, 2=baseurl, 3=model, 4=name
	Provider     string // "anthropic", "openai", "openrouter", "custom"
	ProviderName string // display name (for custom)
	APIKey       string
	BaseURL      string
	Model        string
}

LoginWizard tracks the multi-step login flow

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