ui

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package ui implements the bubbletea TUI for Errata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDiffs

func RenderDiffs(responses []models.ModelResponse, width ...int) string

RenderDiffs returns a multi-line string showing diffs for all responses, including errors.

func RenderSelectionMenu

func RenderSelectionMenu(responses []models.ModelResponse) string

RenderSelectionMenu returns the numbered selection prompt string. Failed responses are shown as non-selectable; only OK responses get numbers.

func Run

func Run(adapterList []models.ModelAdapter, cfg config.Config, warnings []string, mcpDefs []tools.ToolDef, mcpDispatchers map[string]tools.MCPDispatcher, resuming bool, providerModels []adapters.ProviderModels, debugLog bool, store *datastore.Store) error

Run starts the bubbletea program and blocks until exit.

Types

type App

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

App is the bubbletea model.

func New

func New(adapterList []models.ModelAdapter, cfg config.Config, mcpDefs []tools.ToolDef, mcpDispatchers map[string]tools.MCPDispatcher, providerModels []adapters.ProviderModels, debugLog bool, store *datastore.Store) *App

New creates the App model.

func (App) Init

func (a App) Init() tea.Cmd

func (*App) SetProgram

func (a *App) SetProgram(p *tea.Program)

SetProgram wires up the tea.Program reference so goroutines can send messages.

func (App) Update

func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (App) View

func (a App) View() tea.View

type MentionResult

type MentionResult struct {
	ModelIDs []string // resolved full model IDs (deduped)
	Prompt   string   // remaining text after stripping leading @mentions
	Errors   []string // unresolved @tokens (no matching adapter)
}

MentionResult holds the result of parsing @mentions from prompt text.

func ParseMentions

func ParseMentions(input string, adapterIDs []string) MentionResult

ParseMentions extracts leading @model tokens from a prompt string and resolves them against the known adapter IDs using case-insensitive prefix matching. If a prefix matches multiple adapters, all are included (group targeting). Consumption stops at the first non-@ word or an unresolved @token.

Jump to

Keyboard shortcuts

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