tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Title style for the header
	TitleStyle = lipgloss.NewStyle().
				Foreground(colorPrimary).
				Bold(true).
				MarginBottom(1)

	// StatusBar style at the bottom
	StatusBarStyle = lipgloss.NewStyle().
					Foreground(colorText).
					Background(colorPrimary).
					Padding(0, 1)

	// UserMessage style for user chat bubbles
	UserMessageStyle = lipgloss.NewStyle().
						Foreground(colorAccent).
						Bold(true)

	// AssistantMessage style for assistant chat
	AssistantMessageStyle = lipgloss.NewStyle().
							Foreground(colorText)

	// ToolMessage style for tool execution
	ToolMessageStyle = lipgloss.NewStyle().
						Foreground(colorSecondary).
						Italic(true)

	// ErrorMessage style
	ErrorMessageStyle = lipgloss.NewStyle().
						Foreground(colorError).
						Bold(true)

	// InputPrompt style
	InputPromptStyle = lipgloss.NewStyle().
						Foreground(colorPrimary).
						Bold(true)

	// DimStyle for less important text
	DimStyle = lipgloss.NewStyle().
				Foreground(colorDim)

	// HelpStyle for keybinding hints
	HelpStyle = lipgloss.NewStyle().
				Foreground(colorSecondary)

	// SelectedStyle for list selections
	SelectedStyle = lipgloss.NewStyle().
					Foreground(colorPrimary).
					Bold(true)

	// BorderStyle for panels
	BorderStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(colorPrimary)
)

Styles

Functions

This section is empty.

Types

type ChatMessage

type ChatMessage struct {
	Role     string
	Content  string
	Thinking string
	Diff     string
}

type CommandResult

type CommandResult struct {
	Handled     bool
	Command     CommandType
	Message     string
	IsError     bool
	NewModel    string
	NewProvider string
	ClearChat   bool
}

func ExecuteSlashCommand

func ExecuteSlashCommand(input string, cfg *config.Config) CommandResult

type CommandType

type CommandType string
const (
	CommandModel    CommandType = "model"
	CommandProvider CommandType = "provider"
	CommandHelp     CommandType = "help"
	CommandClear    CommandType = "clear"
	CommandUnknown  CommandType = "unknown"
)

func ParseSlashCommand

func ParseSlashCommand(input string) (CommandType, string, bool)

type InputBuffer

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

func (*InputBuffer) Backspace

func (b *InputBuffer) Backspace()

func (*InputBuffer) Clear

func (b *InputBuffer) Clear()

func (*InputBuffer) CursorIsAtBottom

func (b *InputBuffer) CursorIsAtBottom() bool

func (*InputBuffer) CursorIsAtTop

func (b *InputBuffer) CursorIsAtTop() bool

func (*InputBuffer) CursorPos

func (b *InputBuffer) CursorPos() (int, int)

func (*InputBuffer) Delete

func (b *InputBuffer) Delete()

func (*InputBuffer) InsertChar

func (b *InputBuffer) InsertChar(ch string)

func (*InputBuffer) InsertNewline

func (b *InputBuffer) InsertNewline()

func (*InputBuffer) InsertPaste

func (b *InputBuffer) InsertPaste(text string)

func (*InputBuffer) IsEmpty

func (b *InputBuffer) IsEmpty() bool

func (*InputBuffer) LineCount

func (b *InputBuffer) LineCount() int

func (*InputBuffer) MoveDown

func (b *InputBuffer) MoveDown() bool

func (*InputBuffer) MoveEnd

func (b *InputBuffer) MoveEnd()

func (*InputBuffer) MoveHome

func (b *InputBuffer) MoveHome()

func (*InputBuffer) MoveLeft

func (b *InputBuffer) MoveLeft()

func (*InputBuffer) MoveRight

func (b *InputBuffer) MoveRight()

func (*InputBuffer) MoveUp

func (b *InputBuffer) MoveUp() bool

func (*InputBuffer) ScrollOffset

func (b *InputBuffer) ScrollOffset() int

func (*InputBuffer) SetText

func (b *InputBuffer) SetText(text string)

func (*InputBuffer) Text

func (b *InputBuffer) Text() string

func (*InputBuffer) VisibleLines

func (b *InputBuffer) VisibleLines(maxHeight int) []string

type Model

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

func NewModel

func NewModel(
	cfg *config.Config,
	agentClient *llm.Client,
	store session.SessionStore,
	registry tool.ToolRegistry,
	perm *permission.Service,
	bus event.EventBus,
	skillRegistry skill.SkillRegistry,
	toolsEnabled bool,
	sessionID string,
) *Model

func (*Model) Client

func (m *Model) Client() *llm.Client

func (*Model) Init

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

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() tea.View

type State

type State int
const (
	StateInit State = iota
	StateChatting
	StateStreaming
	StateExiting
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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