tui

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyState added in v1.1.0

func EmptyState(message string) string

EmptyState renders a friendly empty-state message inside a subtle bordered box. [EXPERIMENTAL]

Types

type AgentInfo

type AgentInfo struct {
	ID     string
	Role   string
	Status string
	Task   string
}

type AgentStatusMsg

type AgentStatusMsg struct {
	Agents []AgentInfo
}

type ApprovalRecord added in v1.1.0

type ApprovalRecord struct {
	ID              uuid.UUID
	Timestamp       time.Time
	AgentID         string
	ReqType         string
	Prompt          string
	ToolName        string
	SafetyDecision  string
	Approved        *bool // nil = pending
	Reason          string
	TimedOut        bool
	TaskID          string
	RedactedContext string
}

ApprovalRecord tracks a single approval request and its outcome.

type ApprovalRequestMsg

type ApprovalRequestMsg struct {
	Request types.ApprovalRequest
}

type BusSender

type BusSender interface {
	Send(msg types.Message) (uuid.UUID, error)
	SoftCancel(reason string)
	HardCancel(reason string, evidence string)
}

type DiffMsg

type DiffMsg struct {
	TaskID   string
	FilePath string
	Content  string
	Patch    string
}

type EventMsg

type EventMsg struct {
	Event string
}

type HardCancelMsg

type HardCancelMsg struct{}

type KeyMap

type KeyMap struct {
	Quit       key.Binding
	SoftCancel key.Binding
	HardCancel key.Binding
	Status     key.Binding
	Debug      key.Binding
	Tokens     key.Binding
	NewTask    key.Binding
	OpenConfig key.Binding
	Help       key.Binding
	Tab        key.Binding
	Enter      key.Binding
}

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type Model

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

func NewModel

func NewModel(bus BusSender, stateManager *state.StateManager, streamCh <-chan types.StreamTokenPayload, approvalResponder func(types.ApprovalResponse) error) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

func (Model) WithExperimental added in v1.1.0

func (m Model) WithExperimental(enabled bool) Model

type PanelState added in v1.1.0

type PanelState int
const (
	PanelStateIdle PanelState = iota
	PanelStatePending
	PanelStateRunning
	PanelStatePassed
	PanelStateFailed
)

type ProviderInfo added in v1.2.0

type ProviderInfo struct {
	ActiveProvider  string
	PreferredModel  string
	FallbackChain   []string
	LastError       string
	LastErrorClass  string
	Latency         time.Duration
	InputTokens     int
	OutputTokens    int
	TotalCostUSD    float64
	BudgetUSD       float64
	BudgetRemaining float64
}

ProviderInfo holds the current provider/routing state for display.

type ProviderInfoMsg added in v1.2.0

type ProviderInfoMsg struct {
	ActiveProvider  string
	PreferredModel  string
	FallbackChain   []string
	LastError       string
	LastErrorClass  string
	Latency         time.Duration
	InputTokens     int
	OutputTokens    int
	TotalCostUSD    float64
	BudgetUSD       float64
	BudgetRemaining float64
}

type RecoveryAction added in v1.2.0

type RecoveryAction struct {
	TaskID           string
	Description      string
	ActionType       string // inspect_task, inspect_files, rollback_preview, retry, rollback, export_bundle
	RequiresApproval bool
}

RecoveryAction represents an actionable recovery item.

type RollbackInfoMsg

type RollbackInfoMsg struct {
	TaskID        string
	CanRollback   bool
	TouchedFiles  int
	PreTaskCommit string
	FinalState    string
}

type SoftCancelMsg

type SoftCancelMsg struct{}

type StreamTokenMsg

type StreamTokenMsg struct{ Content string }

type TaskRollbackInfo

type TaskRollbackInfo struct {
	CanRollback   bool
	TouchedFiles  int
	PreTaskCommit string
	FinalState    string
}

type TelemetryMsg added in v1.2.0

type TelemetryMsg struct {
	Records []TelemetryRecord
}

type TelemetryRecord added in v1.2.0

type TelemetryRecord struct {
	Provider     string
	Model        string
	Latency      time.Duration
	InputTokens  int
	OutputTokens int
	CostUSD      float64
	Success      bool
	FailureClass string
	Timestamp    time.Time
}

TelemetryRecord is a TUI-local copy of an LLM telemetry record.

type TelemetrySnapshot added in v1.2.0

type TelemetrySnapshot struct {
	Records     []TelemetryRecord
	LastUpdated time.Time
}

TelemetrySnapshot holds aggregated telemetry for the TUI.

type TestOutputMsg

type TestOutputMsg struct {
	Output  string
	Summary string
}

type TestResultMsg

type TestResultMsg struct {
	TaskID   string
	Output   string
	Passed   int
	Failed   int
	Skipped  int
	Duration string
	Success  bool
}

type TimelineEntry added in v1.1.0

type TimelineEntry struct {
	Timestamp      time.Time
	EventType      string
	AgentID        string
	TaskID         string
	Duration       time.Duration
	Provider       string
	PolicyDecision string
	ErrorClass     string
	Summary        string
}

TimelineEntry represents a single event in the task timeline.

type ToolCallMsg

type ToolCallMsg struct {
	TaskID   string
	ToolName string
	FilePath string
	Content  string
	Patch    string
	Success  bool
}

Jump to

Keyboard shortcuts

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