Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v0.0.0-...-ea7b840 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendChatMessage

func SendChatMessage(role, content, toolName string) tea.Msg

func SendCostUpdate

func SendCostUpdate(total float64) tea.Msg

func SendModelSwitch

func SendModelSwitch(model, tier string) tea.Msg

Helper to send messages to the TUI

func SendProfileReadiness

func SendProfileReadiness(ready, total int) tea.Msg

func SendWorkflowUpdate

func SendWorkflowUpdate() tea.Msg

Types

type ChatMessageMsg

type ChatMessageMsg struct {
	Role      string // "user", "assistant", "tool"
	Content   string
	Timestamp time.Time
	ToolName  string // For tool messages
}

ChatMessageMsg represents a chat message to display

type ChatView

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

ChatView displays the conversation history

func NewChatView

func NewChatView() *ChatView

NewChatView creates a new chat view

func (*ChatView) AddMessage

func (c *ChatView) AddMessage(msg ChatMessageMsg)

AddMessage adds a message to the chat

func (*ChatView) Update

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

Update handles messages

func (*ChatView) View

func (c *ChatView) View(width, height int) string

View renders the chat view

type CostUpdateMsg

type CostUpdateMsg struct {
	Total float64
}

CostUpdateMsg indicates session cost updated

type InputBar

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

InputBar handles user input at the bottom

func NewInputBar

func NewInputBar() *InputBar

NewInputBar creates a new input bar

func (*InputBar) Clear

func (i *InputBar) Clear()

Clear clears the input

func (*InputBar) SetFocused

func (i *InputBar) SetFocused(focused bool)

SetFocused sets the focus state

func (*InputBar) SetOnSubmit

func (i *InputBar) SetOnSubmit(fn func(string))

SetOnSubmit sets the callback for when input is submitted

func (*InputBar) Update

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

Update handles messages

func (*InputBar) View

func (i *InputBar) View(width int) string

View renders the input bar

type MissionView

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

MissionView displays workflow/mission state

func NewMissionView

func NewMissionView() *MissionView

NewMissionView creates a new mission view

func (*MissionView) Update

func (m *MissionView) Update(engine *workflow.Engine)

Update updates the mission view with new workflow state

func (*MissionView) View

func (m *MissionView) View(width, height int) string

View renders the mission view

type Model

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

Model is the main TUI application model

func NewModel

func NewModel() *Model

NewModel creates a new TUI model

func (*Model) Init

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

Init initializes the TUI

func (*Model) SetTierRouter

func (m *Model) SetTierRouter(router *routing.TierRouter)

SetTierRouter sets the tier router for cost tracking

func (*Model) SetWorkflowEngine

func (m *Model) SetWorkflowEngine(engine *workflow.Engine)

SetWorkflowEngine sets the workflow engine for mission tracking

func (*Model) Update

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

Update handles messages and updates the model

func (*Model) View

func (m *Model) View() string

View renders the TUI

type ModelSwitchMsg

type ModelSwitchMsg struct {
	Model string
	Tier  string
}

ModelSwitchMsg indicates the LLM model changed

type ProfileReadinessMsg

type ProfileReadinessMsg struct {
	Ready int
	Total int
}

ProfileReadinessMsg indicates capability readiness counts.

type Program

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

Program wraps the tea.Program for easy integration

func NewProgram

func NewProgram() *Program

NewProgram creates a new TUI program

func NewProgramWithHandler

func NewProgramWithHandler(onSubmit func(string)) *Program

NewProgramWithHandler creates a TUI program with an input handler

func (*Program) AddSystemMessage

func (p *Program) AddSystemMessage(content string)

AddSystemMessage adds a system message before the TUI event loop starts.

func (*Program) Printf

func (p *Program) Printf(format string, args ...interface{})

Printf sends a formatted message to the chat

func (*Program) Quit

func (p *Program) Quit()

Quit quits the TUI

func (*Program) Run

func (p *Program) Run() error

Run starts the TUI

func (*Program) Send

func (p *Program) Send(msg tea.Msg)

Send sends a message to the TUI

func (*Program) SetInputHandler

func (p *Program) SetInputHandler(handler func(string))

SetInputHandler sets the input handler callback

func (*Program) SetProfileReadiness

func (p *Program) SetProfileReadiness(ready, total int)

SetProfileReadiness sets capability readiness counts in the TUI.

func (*Program) SetTierRouter

func (p *Program) SetTierRouter(router *routing.TierRouter)

SetTierRouter sets the tier router

func (*Program) SetWorkflowEngine

func (p *Program) SetWorkflowEngine(engine *workflow.Engine)

SetWorkflowEngine sets the workflow engine

type StatusBar

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

StatusBar displays current model, tier, and cost at the top

func NewStatusBar

func NewStatusBar() *StatusBar

NewStatusBar creates a new status bar

func (*StatusBar) SetCost

func (s *StatusBar) SetCost(cost float64)

SetCost sets the session cost

func (*StatusBar) SetModel

func (s *StatusBar) SetModel(model, tier string)

SetModel sets the current model and tier

func (*StatusBar) SetProfileReadiness

func (s *StatusBar) SetProfileReadiness(ready, total int)

SetProfileReadiness sets capability readiness counts.

func (*StatusBar) View

func (s *StatusBar) View(width int) string

View renders the status bar

type WorkflowUpdateMsg

type WorkflowUpdateMsg struct{}

WorkflowUpdateMsg indicates workflow state changed

Jump to

Keyboard shortcuts

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