tui

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 46 Imported by: 0

README

internal/tui — M31 Autonomous Terminal UI

This directory implements the Bubble Tea-based terminal user interface for M31 Autonomous.

Package Organization

internal/tui/
├── app.go, app_state.go, app_update*.go, app_view*.go, app_channel.go
│   Core Bubble Tea model (Init/Update/View loop), screen routing, state management
│
├── types.go              # Re-exports from tuitypes (backward compatibility)
├── constants.go          # Layout width thresholds, refresh intervals
├── helpers.go            # Message constructors, session helpers, layout utils
├── truncate.go           # ANSI-aware string truncation
├── transition.go         # Screen transition dim-and-reveal effects
├── health.go             # Health check ticker + sidebar refresh
├── cache_refresh.go      # Model cache refresh ticker
│
├── tuitypes/             # Shared types package
│   └── tuitypes.go       # Screen enum, all message types, WorkflowEngine interface
│
├── streaming/            # LLM streaming pipeline
│   ├── streaming.go      # StartStreamCmd, StreamTickCmd, stream message types
│   └── agent_loop.go     # AgentLoop (autonomous tool-use), BuildAgentMessages
│
├── commands/             # Slash command system
│   ├── commands.go       # CommandInfo, CommandResult, CommandContext, CommandRegistry
│   ├── core.go           # /help, /clear, /status, /reset, /quit, /undo, etc.
│   ├── session.go        # /sessions, /export, /fork, /goal, /resume, /ledger
│   ├── git.go            # /diff, /rollback, /bisect
│   ├── ai.go             # /model, /models, /fallback, /provider, /compress, /memory
│   ├── config.go         # /settings, /config, /theme, /cost, /log, /key, /tokens
│   ├── agent.go          # /agent, /agent-cancel
│   └── workflow.go       # /new, /workflow, /phase, /plan, /execute, /verify, /ship
│
├── components/           # Reusable UI components (41 files)
│   badge, bash_renderer, breadcrumb, card, codeblock, confirm, datatable,
│   divider, dropdown, file_renderers, filetree, filterchips, logo, message,
│   metriccard, notification_list, permission, progress, question, search,
│   sparkline, special_renderers, spinner, splitpane, starfield, statrow,
│   tabbar, taskgraph, thinking, timeline, toolcard, toolrenderers, truncate,
│   workflow_phasebar
│
├── layout/               # Responsive layout system
│   ├── page.go           # PageLayout, PageChrome
│   ├── minscreen.go      # Minimum screen fallback
│   └── responsive.go     # Breakpoint detection, ShowSidebar()
│
├── theme/                # Theme system
│   ├── theme.go          # Theme struct definition
│   ├── colors.go         # Color constants and palettes
│   ├── registry.go       # Theme registry, ByID(), ListThemes()
│   ├── borders.go        # Border style helpers
│   ├── shadow.go         # Shadow effects
│   ├── tabs.go           # Tab styles
│   └── unicode.go        # Box-drawing characters
│
└── [Screen models]       # Full-screen UI models (flat in tui/ for dependency reasons)
    repl_model.go, repl.go, repl_state.go, repl_view.go, repl_welcome.go,
    repl_stream.go, repl_thinking.go, repl_commands.go, repl_clipboard.go,
    repl_quickactions.go, repl_keys.go,
    plan_model.go, plan_view.go, plan_refine.go,
    execute_model.go, execute_view.go,
    verify.go,
    ship_model.go, ship_view.go,
    discuss.go,
    firstrun_model.go, firstrun_view.go,
    resume_model.go, resume_view.go, sessiondetail_model.go,
    settings_model.go, settings_view.go, settings_tabs.go, settings_edit.go,
    config_model.go,
    modelselector.go, modelselector_view.go, modelselector_list.go,
    diff_model.go, diff_view.go,
    bisect_model.go,
    rollback.go,
    ledger.go,
    dashboard_model.go,
    metrics.go,
    goalinput.go,
    phasemodelpicker.go, phasemodelpicker_view.go,
    fileexplorer_model.go,
    tooldetail_model.go,
    themepicker_model.go,
    help.go

Key Design Decisions

Why are screen models flat (not in sub-packages)?

Go doesn't allow circular imports. Screen models depend on message types (AppMsg, PopScreenMsg, etc.) defined in tuitypes. If screen models were in sub-packages like screens/repl/, they'd need to import tuitypes — but the core tui package also imports tuitypes for routing. This would work, but the real blocker is that screen models also depend on shared utilities (helpers.go, constants.go, types.go) that live in the core tui package. Moving screens to sub-packages would require those utilities to also move, creating a cascade of changes with diminishing returns.

The flat structure with file naming conventions (repl_*.go, plan_*.go) provides clear organization while avoiding circular dependency issues.

Sub-package extraction strategy

Three sub-packages were extracted because they have clean dependency boundaries:

  1. tuitypes — Screen enum + message types + WorkflowEngine interface. No TUI dependencies; only imports git, tools, types, workflow, arbitrage, session.

  2. streaming — LLM streaming pipeline + agent loop. Zero TUI dependencies; fully self-contained with provider, types, tools, tokens, config.

  3. commands — Slash command handlers. Depends on tuitypes for Screen/messages and config, git, provider, tools, session, ledger, rollback, autodream.

Backward compatibility

The core tui package re-exports all types from tuitypes, streaming, and commands via type aliases and variable aliases. This means existing code within internal/tui/ continues to work without import changes. New code should import the sub-packages directly.

File Naming Conventions

Pattern Meaning
*_model.go Model struct definition
*_view.go View() rendering
*_extra_test.go Additional test coverage
app_*.go Core app loop files
repl_*.go REPL screen files
commands_*.go Command handler files
*_test.go Unit tests

Documentation

Overview

Package tui implements the Bubble Tea TUI for M31A.

This file re-exports command types from the commands sub-package so that existing code within the tui package can reference them without explicit imports. New code should import the commands package directly.

Package tui implements the Bubble Tea TUI for M31A.

This file re-exports streaming types from the streaming sub-package so that existing code within the tui package can reference them without explicit imports. New code should import the streaming package directly.

Package tui implements the Bubble Tea TUI for M31A.

This file re-exports types from the tuitypes sub-package so that existing code within the tui package can reference them without explicit imports. New code should import tuitypes directly.

Index

Constants

View Source
const (
	// WidthUltraCompact is the minimum width for which only the REPL viewport
	// and input area are shown — no header, no sidebar, no status bar chrome.
	WidthUltraCompact = 40

	// WidthCompact is the minimum width for a compact layout that includes
	// a compact header but no sidebar and no keyboard hints.
	WidthCompact = 60

	// WidthFull is the minimum width for the full layout including sidebar,
	// all keyboard hints, cost display, and all chrome elements.
	WidthFull = 80
)

Width thresholds for responsive layout

View Source
const (
	ScreenFirstRun         = tuitypes.ScreenFirstRun
	ScreenREPL             = tuitypes.ScreenREPL
	ScreenModelSelector    = tuitypes.ScreenModelSelector
	ScreenSettings         = tuitypes.ScreenSettings
	ScreenResume           = tuitypes.ScreenResume
	ScreenPermission       = tuitypes.ScreenPermission
	ScreenPlan             = tuitypes.ScreenPlan
	ScreenExecute          = tuitypes.ScreenExecute
	ScreenVerify           = tuitypes.ScreenVerify
	ScreenShip             = tuitypes.ScreenShip
	ScreenDiff             = tuitypes.ScreenDiff
	ScreenLedger           = tuitypes.ScreenLedger
	ScreenRollback         = tuitypes.ScreenRollback
	ScreenGoalInput        = tuitypes.ScreenGoalInput
	ScreenDiscuss          = tuitypes.ScreenDiscuss
	ScreenMetrics          = tuitypes.ScreenMetrics
	ScreenConfig           = tuitypes.ScreenConfig
	ScreenHelp             = tuitypes.ScreenHelp
	ScreenBisect           = tuitypes.ScreenBisect
	ScreenThemePicker      = tuitypes.ScreenThemePicker
	ScreenNotifications    = tuitypes.ScreenNotifications
	ScreenDashboard        = tuitypes.ScreenDashboard
	ScreenSessionDetail    = tuitypes.ScreenSessionDetail
	ScreenFileExplorer     = tuitypes.ScreenFileExplorer
	ScreenToolDetail       = tuitypes.ScreenToolDetail
	ScreenPhaseModelPicker = tuitypes.ScreenPhaseModelPicker
	ScreenGhostPicker      = tuitypes.ScreenGhostPicker
	ScreenGhostOutput      = tuitypes.ScreenGhostOutput
	ScreenConfirmQuit      = tuitypes.ScreenConfirmQuit
)
View Source
const (
	// MaxMessageHistory is the maximum number of messages stored in the REPL.
	MaxMessageHistory = 1000
)
View Source
const SidebarRefreshInterval = 5 * time.Second

SidebarRefreshInterval is the interval at which the sidebar polls for git status updates.

Variables

View Source
var (
	NewCommandRegistry = commands.NewCommandRegistry
	DefaultCommands    = commands.DefaultCommands
	ParseCommand       = commands.ParseCommand
)

Command constructor re-exports

View Source
var (
	StartStreamCmd             = streaming.StartStreamCmd
	StreamTickCmd              = streaming.StreamTickCmd
	AgentLoop                  = streaming.AgentLoop
	BuildAgentMessages         = streaming.BuildAgentMessages
	LoadProjectContextForAgent = streaming.LoadProjectContextForAgent
)

Streaming function re-exports

Functions

func CacheRefreshCmd

func CacheRefreshCmd(ctx context.Context, registry *provider.Registry, providerName string) tea.Cmd

CacheRefreshCmd runs FetchModels in a goroutine and emits CacheRefreshResultMsg.

func CacheRefreshTicker

func CacheRefreshTicker(providerName string, d time.Duration) tea.Cmd

CacheRefreshTicker returns a tea.Cmd that emits a RefreshCacheMsg after d.

func HealthCheckCmd

func HealthCheckCmd(ctx context.Context, p provider.LLMProvider, timeout time.Duration) tea.Cmd

HealthCheckCmd runs a health check against the given provider in a goroutine and emits a HealthCheckResultMsg when it completes.

func HealthCheckTicker

func HealthCheckTicker(ctx context.Context, d time.Duration) tea.Cmd

HealthCheckTicker returns a tea.Cmd that emits a HealthCheckTickMsg after the given duration. The app re-schedules it in response to HealthCheckResultMsg.

func NextCacheRefreshTick

func NextCacheRefreshTick(d time.Duration) tea.Cmd

NextCacheRefreshTick returns a tea.Cmd for the next cache refresh tick.

func NextHealthTick

func NextHealthTick(ctx context.Context, d time.Duration) tea.Cmd

NextHealthTick returns a tea.Cmd for the next health check tick.

func NextSidebarRefreshTick

func NextSidebarRefreshTick(ctx context.Context, d time.Duration) tea.Cmd

NextSidebarRefreshTick returns a tea.Cmd for the next sidebar refresh tick.

func ProviderShortName

func ProviderShortName(name string) string

ProviderShortName returns a short display name for a provider.

func RegisterProvider

func RegisterProvider(registry *provider.Registry, cfg *config.Config, providerID, apiKey, version string) error

RegisterProvider creates and registers a provider client in the registry using the given API key and configuration. If the provider is already registered, it is replaced with the new client.

func RenderPermissionModal

func RenderPermissionModal(req *tools.PermissionRequest, countdown, width, termW, termH int, t theme.Theme, urgent bool) string

RenderPermissionModal renders a full-screen permission modal.

func RenderPhaseBadge

func RenderPhaseBadge(t theme.Theme, phase string) string

RenderPhaseBadge renders a compact phase indicator for the header. Shows e.g. "[init]" in brand color with brand border when workflow is active.

func RenderPhaseBreadcrumb

func RenderPhaseBreadcrumb(t theme.Theme, phase types.WorkflowPhase) string

RenderPhaseBreadcrumb renders the workflow phase breadcrumb using theme.PhaseActive/PhasePast/PhaseFuture.

func RenderPromptBottomBorder

func RenderPromptBottomBorder(color lipgloss.Color, width int) string

RenderPromptBottomBorder renders the border line below the input frame.

func RenderPromptMetadata

func RenderPromptMetadata(agentName, modelName, providerName string, t theme.Theme, width int) string

RenderPromptMetadata renders the agent · model · provider row above the textarea.

func RenderStatusBar

func RenderStatusBar(t theme.Theme, width int, info *StatusBarInfo) string

RenderStatusBar renders the status bar line at the bottom of the terminal. Uses a clean 3-zone layout:

left (cwd + branch) · center (operation) · right (hints + cost)

No background fill — inherits terminal background.

func SidebarRefreshTicker

func SidebarRefreshTicker(ctx context.Context, d time.Duration) tea.Cmd

SidebarRefreshTicker returns a tea.Cmd that emits a SidebarRefreshTickMsg after the given duration. The sidebar re-schedules it in response to the tick.

func TruncateEnd

func TruncateEnd(s string, maxLen int) string

TruncateEnd truncates a string by cutting at maxLen and appending "...". Delegates to components.TruncateEnd.

func TruncateError

func TruncateError(s string) string

TruncateError truncates an error message to show the first 200 runes plus "[...]". Delegates to components.TruncateError.

func TruncateMiddle

func TruncateMiddle(s string, maxLen int) string

TruncateMiddle truncates a string by showing the start and end with "..." in the middle. Delegates to components.TruncateMiddle.

func TruncateWithEllipsis

func TruncateWithEllipsis(s string, maxWidth int) string

TruncateWithEllipsis truncates a string to maxWidth visible columns, appending "..." if truncation occurred. Delegates to components.TruncateWithEllipsis.

Types

type AgentDoneMsg

type AgentDoneMsg = streaming.AgentDoneMsg

Streaming type re-exports

type AgentErrorMsg

type AgentErrorMsg = streaming.AgentErrorMsg

Streaming type re-exports

type AgentIterationDoneMsg

type AgentIterationDoneMsg = streaming.AgentIterationDoneMsg

Streaming type re-exports

type AgentIterationMsg

type AgentIterationMsg = streaming.AgentIterationMsg

Streaming type re-exports

type AgentStreamMsg

type AgentStreamMsg = streaming.AgentStreamMsg

Streaming type re-exports

type AgentThinkingMsg

type AgentThinkingMsg = streaming.AgentThinkingMsg

Streaming type re-exports

type AgentToolDoneMsg

type AgentToolDoneMsg = streaming.AgentToolDoneMsg

Streaming type re-exports

type AgentToolProgressMsg added in v1.0.2

type AgentToolProgressMsg = streaming.AgentToolProgressMsg

Streaming type re-exports

type AgentToolStartMsg

type AgentToolStartMsg = streaming.AgentToolStartMsg

Streaming type re-exports

type AppMsg

type AppMsg = tuitypes.AppMsg

Message type re-exports

type AppState

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

AppState is the top-level Bubble Tea model. All state mutations go through Update(). No goroutine may mutate AppState directly.

func NewApp

func NewApp(
	cfg *config.Config,
	configPath string,
	registry *provider.Registry,
	sessionManager *session.Manager,
	dispatcher *tools.Dispatcher,
	gitClient *git.Git,
	ledgerClient *ledger.Ledger,
	rollbackClient *rollback.Rollback,
	autoDreamClient *autodream.Consolidator,
	version string,
	themeMode theme.Mode,
) *AppState

NewApp creates a new AppState.

func (*AppState) Init

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

Init implements tea.Model. It starts the health ticker and permission listener.

func (*AppState) RunPhaseCmd

func (m *AppState) RunPhaseCmd(phase types.WorkflowPhase) tea.Cmd

RunPhaseCmd runs a workflow phase in a goroutine and returns a tea.Cmd.

func (*AppState) SetCwd

func (a *AppState) SetCwd(cwd string)

SetCwd stores the working directory so it can be propagated to the REPL model for @-mention file resolution.

func (*AppState) SetKeychain

func (a *AppState) SetKeychain(kc keychain.Keychain)

SetKeychain configures the OS keychain for secure API key storage.

func (*AppState) SetResumeSessionID

func (a *AppState) SetResumeSessionID(id string)

SetResumeSessionID configures the app to auto-resume a session on startup.

func (*AppState) SetSubagentManager

func (a *AppState) SetSubagentManager(m *subagent.Manager)

SetSubagentManager wires the parallel-subagent manager into the app. Must be called before the first tea.Program.Run; the manager's event channel is drained starting from Init().

func (*AppState) Shutdown

func (m *AppState) Shutdown()

Shutdown cleanly tears down all background goroutines.

func (*AppState) StartTransition

func (m *AppState) StartTransition(to Screen, prevView string)

StartTransition begins a screen transition effect. It captures the current view as the fading-out frame.

func (*AppState) Update

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

Update implements tea.Model. It is the single dispatch point for all messages. CRITICAL: Never mutate AppState from a goroutine. All mutations go here.

func (*AppState) View

func (m *AppState) View() string

View implements tea.Model. It renders the full terminal frame using the unified PageLayout system: 1-line header + content viewport + 1-line footer.

type BisectModel

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

BisectModel provides an interactive git bisect interface.

func NewBisectModel

func NewBisectModel(t theme.Theme, w, h int) *BisectModel

NewBisectModel creates a BisectModel.

func (*BisectModel) Init

func (bm *BisectModel) Init() tea.Cmd

Init implements tea.Model.

func (*BisectModel) SetCommits

func (bm *BisectModel) SetCommits(commits []bisectCommit)

SetCommits sets the bisect range.

func (*BisectModel) SetDimensions

func (bm *BisectModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*BisectModel) SetTheme

func (bm *BisectModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*BisectModel) Update

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

Update implements tea.Model.

func (*BisectModel) View

func (bm *BisectModel) View() string

View implements tea.Model.

type BisectStartMsg

type BisectStartMsg = tuitypes.BisectStartMsg

Message type re-exports

type CacheRefreshResultMsg

type CacheRefreshResultMsg = tuitypes.CacheRefreshResultMsg

Message type re-exports

type CommandCategory

type CommandCategory string

CommandCategory groups slash commands in the palette.

const (
	CatCore     CommandCategory = "Core"
	CatAI       CommandCategory = "AI"
	CatConfig   CommandCategory = "Config"
	CatSession  CommandCategory = "Session"
	CatGit      CommandCategory = "Git"
	CatWorkflow CommandCategory = "Workflow"
)

type CommandContext

type CommandContext = commands.CommandContext

Command type re-exports

type CommandHandler

type CommandHandler = commands.CommandHandler

Command type re-exports

type CommandInfo

type CommandInfo = commands.CommandInfo

Command type re-exports

type CommandPaletteModel

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

CommandPaletteModel is the command palette overlay.

func NewCommandPalette

func NewCommandPalette(registry *CommandRegistry, t theme.Theme) *CommandPaletteModel

NewCommandPalette creates a new command palette model.

func (*CommandPaletteModel) Close

func (cp *CommandPaletteModel) Close()

Close hides the command palette.

func (*CommandPaletteModel) IsOpen

func (cp *CommandPaletteModel) IsOpen() bool

IsOpen returns true when the palette is visible.

func (*CommandPaletteModel) Open

func (cp *CommandPaletteModel) Open()

Open shows the command palette.

func (*CommandPaletteModel) SetDimensions

func (cp *CommandPaletteModel) SetDimensions(w, h int)

SetDimensions updates the display dimensions.

func (*CommandPaletteModel) SetTheme

func (cp *CommandPaletteModel) SetTheme(t theme.Theme)

SetTheme updates the command palette theme.

func (*CommandPaletteModel) Update

func (cp *CommandPaletteModel) Update(msg tea.Msg) (*CommandPaletteModel, tea.Cmd)

Update handles key events inside the command palette.

func (*CommandPaletteModel) View

func (cp *CommandPaletteModel) View() string

View renders the command palette overlay, bottom-anchored above the status bar.

type CommandRegistry

type CommandRegistry = commands.CommandRegistry

Command type re-exports

type CommandResult

type CommandResult = commands.CommandResult

Command type re-exports

type ConfigModel

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

ConfigModel is the full interactive configuration editor for ScreenConfig. Every field from every section of config.Config is editable inline. Pressing 's' saves directly to the TOML file without leaving the screen.

func NewConfigModel

func NewConfigModel(t theme.Theme, cfg *config.Config, cfgPath string, w, h int, kc keychain.Keychain) *ConfigModel

NewConfigModel creates a ConfigModel.

func (*ConfigModel) Init

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

func (*ConfigModel) Update

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

func (*ConfigModel) View

func (m *ConfigModel) View() string

type ConfigSavedMsg

type ConfigSavedMsg struct{}

ConfigSavedMsg is emitted when the config editor writes to disk.

type ConfirmQuitModel

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

ConfirmQuitModel shows a confirmation dialog when quitting during active processing.

func NewConfirmQuitModel

func NewConfirmQuitModel(t theme.Theme, w, h int) *ConfirmQuitModel

NewConfirmQuitModel creates a ConfirmQuitModel.

func (*ConfirmQuitModel) Init

func (cq *ConfirmQuitModel) Init() tea.Cmd

Init implements tea.Model.

func (*ConfirmQuitModel) SetDimensions

func (cq *ConfirmQuitModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*ConfirmQuitModel) SetMessage

func (cq *ConfirmQuitModel) SetMessage(msg string)

SetMessage sets the confirmation message.

func (*ConfirmQuitModel) SetTheme

func (cq *ConfirmQuitModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*ConfirmQuitModel) Update

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

Update implements tea.Model.

func (*ConfirmQuitModel) View

func (cq *ConfirmQuitModel) View() string

View implements tea.Model.

type DashboardModel

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

DashboardModel shows the workflow pipeline overview.

func NewDashboardModel

func NewDashboardModel(t theme.Theme, w, h int) *DashboardModel

NewDashboardModel creates a DashboardModel.

func (*DashboardModel) Init

func (dm *DashboardModel) Init() tea.Cmd

Init implements tea.Model.

func (*DashboardModel) SetDimensions

func (dm *DashboardModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*DashboardModel) SetTheme

func (dm *DashboardModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*DashboardModel) SetWorkflowState

func (dm *DashboardModel) SetWorkflowState(phase types.WorkflowPhase, goal, model, provider string)

SetWorkflowState updates the dashboard with current workflow state.

func (*DashboardModel) Update

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

Update implements tea.Model.

func (*DashboardModel) View

func (dm *DashboardModel) View() string

View implements tea.Model.

type DiffCloseMsg

type DiffCloseMsg = tuitypes.DiffCloseMsg

Message type re-exports

type DiffModel

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

DiffModel shows a git diff with syntax coloring.

func NewDiffModel

func NewDiffModel(t theme.Theme) *DiffModel

NewDiffModel creates a DiffModel.

func (*DiffModel) Init

func (dm *DiffModel) Init() tea.Cmd

Init implements tea.Model.

func (*DiffModel) SetDiff

func (dm *DiffModel) SetDiff(diff string)

SetDiff loads a new diff string into the model and computes stats.

func (*DiffModel) SetDimensions

func (dm *DiffModel) SetDimensions(w, h int)

SetDimensions updates the diff model dimensions and refreshes the viewport.

func (*DiffModel) SetTheme

func (dm *DiffModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*DiffModel) SetTitle

func (dm *DiffModel) SetTitle(title string)

SetTitle sets the optional title line shown above the diff.

func (*DiffModel) Update

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

Update implements tea.Model.

func (*DiffModel) View

func (dm *DiffModel) View() string

View implements tea.Model — delegates to diff_view.go.

type DiffScreenMsg

type DiffScreenMsg = tuitypes.DiffScreenMsg

Message type re-exports

type DiscussAnswerMsg

type DiscussAnswerMsg = tuitypes.DiscussAnswerMsg

Message type re-exports

type DiscussAnswerTimeoutMsg

type DiscussAnswerTimeoutMsg = tuitypes.DiscussAnswerTimeoutMsg

Message type re-exports

type DiscussCompleteMsg

type DiscussCompleteMsg = tuitypes.DiscussCompleteMsg

Message type re-exports

type DiscussModel

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

DiscussModel presents discuss Q&A questions one-by-one.

func NewDiscussModel

func NewDiscussModel(t theme.Theme, questions []string, w, h int) *DiscussModel

NewDiscussModel creates a DiscussModel for the given questions.

func (*DiscussModel) Init

func (dm *DiscussModel) Init() tea.Cmd

Init implements tea.Model.

func (*DiscussModel) SetDimensions

func (dm *DiscussModel) SetDimensions(w, h int)

SetDimensions updates the discuss model dimensions.

func (*DiscussModel) SetTheme

func (dm *DiscussModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*DiscussModel) SetTimeout

func (dm *DiscussModel) SetTimeout(secs int)

SetTimeout configures the per-question timeout.

func (*DiscussModel) Update

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

Update implements tea.Model.

func (*DiscussModel) View

func (dm *DiscussModel) View() string

View implements tea.Model.

type DismissToastMsg

type DismissToastMsg = tuitypes.DismissToastMsg

Message type re-exports

type ErrorMsg

type ErrorMsg = tuitypes.ErrorMsg

Message type re-exports

type ExecuteModel

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

ExecuteModel displays real-time task execution progress.

func NewExecuteModel

func NewExecuteModel(tasks []types.Task, t theme.Theme, w, h int) *ExecuteModel

NewExecuteModel creates an ExecuteModel.

func (*ExecuteModel) AppendLiveOutput

func (em *ExecuteModel) AppendLiveOutput(lines []string)

AppendLiveOutput appends output lines for the currently running task.

func (*ExecuteModel) SetCurrentTask

func (em *ExecuteModel) SetCurrentTask(taskIdx int)

SetCurrentTask marks which task is currently executing.

func (*ExecuteModel) Update

func (em *ExecuteModel) Update(msg tea.Msg) (*ExecuteModel, tea.Cmd)

Update handles execute screen key events.

func (*ExecuteModel) UpdateTaskStatus

func (em *ExecuteModel) UpdateTaskStatus(taskID int, status types.TaskStatus)

UpdateTaskStatus updates a task's status by ID.

func (*ExecuteModel) View

func (em *ExecuteModel) View() string

View renders the execute progress screen content. Header, footer, and chrome are handled by the unified PageLayout.

type ExecutePauseMsg

type ExecutePauseMsg = tuitypes.ExecutePauseMsg

Message type re-exports

type FallbackEventMsg

type FallbackEventMsg = tuitypes.FallbackEventMsg

Message type re-exports

type FileExplorerModel

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

FileExplorerModel shows a file tree browser for the project.

func NewFileExplorerModel

func NewFileExplorerModel(t theme.Theme, w, h int) *FileExplorerModel

NewFileExplorerModel creates a FileExplorerModel.

func (*FileExplorerModel) Init

func (fe *FileExplorerModel) Init() tea.Cmd

Init implements tea.Model.

func (*FileExplorerModel) SetDimensions

func (fe *FileExplorerModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*FileExplorerModel) SetRoot

func (fe *FileExplorerModel) SetRoot(root *components.FileNode)

SetRoot sets the file tree root.

func (*FileExplorerModel) SetTheme

func (fe *FileExplorerModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*FileExplorerModel) Update

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

Update implements tea.Model.

func (*FileExplorerModel) View

func (fe *FileExplorerModel) View() string

View implements tea.Model.

type FileWatcher added in v1.0.2

type FileWatcher struct {
	Events chan tea.Msg
	// contains filtered or unexported fields
}

FileWatcher watches the working directory for file system changes and emits SidebarRefreshTickMsg to trigger immediate sidebar refreshes. This replaces the slow 5-second polling with near-instant detection of file changes.

func NewFileWatcher added in v1.0.2

func NewFileWatcher(workDir string, events chan tea.Msg) (*FileWatcher, error)

NewFileWatcher creates a file watcher for the given working directory. It watches non-ignored directories recursively for create, write, remove, and rename events. Events are debounced (300ms) and emit a SidebarRefreshTickMsg to trigger an immediate sidebar refresh.

func (*FileWatcher) Close added in v1.0.2

func (fw *FileWatcher) Close()

Close stops the file watcher and cleans up resources.

type FirstRunCompleteMsg

type FirstRunCompleteMsg = tuitypes.FirstRunCompleteMsg

Message type re-exports

type FirstRunModel

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

FirstRunModel is a multi-step setup wizard shown on first launch.

func NewFirstRunModel

func NewFirstRunModel(t theme.Theme, registry *provider.Registry, cfg *config.Config, version string, ctx context.Context) *FirstRunModel

NewFirstRunModel creates a FirstRunModel. Accepts a context that is cancelled on app shutdown to prevent resource leaks.

func (*FirstRunModel) Init

func (fr *FirstRunModel) Init() tea.Cmd

Init implements tea.Model.

func (*FirstRunModel) SetContentWidth

func (fr *FirstRunModel) SetContentWidth(w int)

SetContentWidth sets the available content width (accounting for sidebar). When set, the wizard centers within this width instead of the full terminal.

func (*FirstRunModel) SetDimensions

func (fr *FirstRunModel) SetDimensions(w, h int)

SetDimensions updates the wizard dimensions.

func (*FirstRunModel) SetTheme

func (fr *FirstRunModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*FirstRunModel) Update

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

Update implements tea.Model.

func (*FirstRunModel) View

func (fr *FirstRunModel) View() string

View implements tea.Model.

type FirstRunOpts

type FirstRunOpts struct {
	Providers       []ProviderEntry
	ModelID         string
	SaveKeychain    bool
	DefaultProvider string
}

FirstRunOpts carries the data collected from the first-run wizard.

type GhostOutputModel

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

GhostOutputModel shows the results of a ghost write operation.

func NewGhostOutputModel

func NewGhostOutputModel(t theme.Theme, w, h int) *GhostOutputModel

NewGhostOutputModel creates a GhostOutputModel.

func (*GhostOutputModel) Init

func (go_ *GhostOutputModel) Init() tea.Cmd

Init implements tea.Model.

func (*GhostOutputModel) SetDimensions

func (go_ *GhostOutputModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*GhostOutputModel) SetResult

func (go_ *GhostOutputModel) SetResult(r *tuitypes.GhostResult)

SetResult sets the ghost write result to display.

func (*GhostOutputModel) SetTheme

func (go_ *GhostOutputModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*GhostOutputModel) Update

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

Update implements tea.Model.

func (*GhostOutputModel) View

func (go_ *GhostOutputModel) View() string

View implements tea.Model.

type GhostPickerModel

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

GhostPickerModel shows a file selector for ghost write operations.

func NewGhostPickerModel

func NewGhostPickerModel(t theme.Theme, w, h int) *GhostPickerModel

NewGhostPickerModel creates a GhostPickerModel.

func (*GhostPickerModel) Init

func (gp *GhostPickerModel) Init() tea.Cmd

Init implements tea.Model.

func (*GhostPickerModel) SelectedFiles

func (gp *GhostPickerModel) SelectedFiles() []string

SelectedFiles returns the paths of all selected files.

func (*GhostPickerModel) SetDimensions

func (gp *GhostPickerModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*GhostPickerModel) SetFiles

func (gp *GhostPickerModel) SetFiles(paths []string)

SetFiles sets the list of files available for ghost write.

func (*GhostPickerModel) SetTheme

func (gp *GhostPickerModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*GhostPickerModel) Update

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

Update implements tea.Model.

func (*GhostPickerModel) View

func (gp *GhostPickerModel) View() string

View implements tea.Model.

type GhostWriteRequestMsg

type GhostWriteRequestMsg = tuitypes.GhostWriteRequestMsg

Message type re-exports

type GhostWriteResultMsg

type GhostWriteResultMsg = tuitypes.GhostWriteResultMsg

Message type re-exports

type GoalInputModel

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

GoalInputModel is a full-screen textarea for entering workflow goals.

func NewGoalInputModel

func NewGoalInputModel(t theme.Theme, recentGoals []string) *GoalInputModel

NewGoalInputModel creates a GoalInputModel.

func (*GoalInputModel) Init

func (gi *GoalInputModel) Init() tea.Cmd

Init implements tea.Model.

func (*GoalInputModel) SetDimensions

func (gi *GoalInputModel) SetDimensions(w, h int)

SetDimensions updates the goal input dimensions.

func (*GoalInputModel) SetTheme

func (gi *GoalInputModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*GoalInputModel) Update

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

Update implements tea.Model.

func (*GoalInputModel) View

func (gi *GoalInputModel) View() string

View implements tea.Model — content only, chrome handled by PageLayout.

type GoalSubmittedMsg

type GoalSubmittedMsg = tuitypes.GoalSubmittedMsg

Message type re-exports

type HealResultMsg

type HealResultMsg = tuitypes.HealResultMsg

Message type re-exports

type HealthCheckResultMsg

type HealthCheckResultMsg = tuitypes.HealthCheckResultMsg

Message type re-exports

type HealthCheckTickMsg

type HealthCheckTickMsg = tuitypes.HealthCheckTickMsg

Message type re-exports

type HelpModel

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

HelpModel shows keybinding help overlay with scrollable viewport.

func NewHelpModel

func NewHelpModel(t theme.Theme) *HelpModel

NewHelpModel creates a HelpModel with the default M31A keybindings.

func (*HelpModel) Init

func (hm *HelpModel) Init() tea.Cmd

Init implements tea.Model.

func (*HelpModel) SetDimensions

func (hm *HelpModel) SetDimensions(w, h int)

SetDimensions updates the help model dimensions.

func (*HelpModel) SetTheme

func (hm *HelpModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*HelpModel) Update

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

Update implements tea.Model with scrollable viewport.

func (*HelpModel) View

func (hm *HelpModel) View() string

View implements tea.Model.

type KeyAction

type KeyAction func() tea.Cmd

KeyAction is a callback that produces a tea.Cmd when a key chord fires.

type KeyActionMsg

type KeyActionMsg struct {
	Action string
}

KeyActionMsg is emitted by leader-key bindings to communicate an action name to AppState.handleKeyAction.

type KeyBinding

type KeyBinding struct {
	Key         string
	Description string
	Action      KeyAction
	Context     KeyContext
}

KeyBinding associates a key (or chord) with an action and description.

type KeyContext

type KeyContext string

KeyContext identifies which screen or layer is active for key binding lookups.

const (
	CtxGlobal    KeyContext = "global"
	CtxREPL      KeyContext = "repl"
	CtxPalette   KeyContext = "palette"
	CtxSidebar   KeyContext = "sidebar"
	CtxSettings  KeyContext = "settings"
	CtxModelSel  KeyContext = "modelselector"
	CtxResume    KeyContext = "resume"
	CtxPermModal KeyContext = "permission"
	CtxFirstRun  KeyContext = "firstrun"
	CtxPlan      KeyContext = "plan"
	CtxExecute   KeyContext = "execute"
	CtxVerify    KeyContext = "verify"
	CtxShip      KeyContext = "ship"
	CtxDiscuss   KeyContext = "discuss"
	CtxDiff      KeyContext = "diff"
	CtxLedger    KeyContext = "ledger"
	CtxRollback  KeyContext = "rollback"
	CtxMetrics   KeyContext = "metrics"
	CtxGoalInput KeyContext = "goalinput"
	CtxConfig    KeyContext = "config"
	CtxHelp      KeyContext = "help"
)

type KeyRegistry

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

KeyRegistry holds all key bindings indexed by KeyContext. It supports simple key bindings and two-key leader-chord sequences.

func NewKeyRegistry

func NewKeyRegistry(opts KeyRegistryOpts) *KeyRegistry

NewKeyRegistry creates a KeyRegistry with the given options.

func (*KeyRegistry) DeactivateLeader

func (r *KeyRegistry) DeactivateLeader()

DeactivateLeader clears leader mode (called from LeaderTimeoutMsg handler).

func (*KeyRegistry) GetContextBindings

func (r *KeyRegistry) GetContextBindings(ctx KeyContext) []KeyBinding

GetContextBindings returns all bindings active for a context (global + context-specific).

func (*KeyRegistry) Handle

func (r *KeyRegistry) Handle(key string, ctx KeyContext) (bool, tea.Cmd)

Handle processes a key event and returns (handled, cmd). If the leader key is active it looks for chord bindings first. If the leader key itself is pressed it activates leader mode and returns a timeout tick.

func (*KeyRegistry) IsLeaderActive

func (r *KeyRegistry) IsLeaderActive() bool

IsLeaderActive returns true if the leader key was just pressed.

func (*KeyRegistry) LeaderKey

func (r *KeyRegistry) LeaderKey() string

LeaderKey returns the configured leader key string (e.g. "ctrl+x").

func (*KeyRegistry) Register

func (r *KeyRegistry) Register(ctx KeyContext, key, description string, action KeyAction)

Register adds a key binding to the registry.

func (*KeyRegistry) RegisterDefaultBindings

func (r *KeyRegistry) RegisterDefaultBindings()

RegisterDefaultBindings registers all application-level key bindings. These bindings use KeyActionMsg so that AppState.handleKeyAction dispatches them without creating circular references.

func (*KeyRegistry) RenderWhichKey

func (r *KeyRegistry) RenderWhichKey(ctx KeyContext, maxWidth int, brand, textSecondary, textMuted lipgloss.Color) string

RenderWhichKey returns a formatted which-key overlay showing available leader key bindings for the current context. Returns empty string if no bindings.

type KeyRegistryOpts

type KeyRegistryOpts struct {
	LeaderKey     string
	LeaderTimeout time.Duration
}

KeyRegistryOpts configures the key registry.

type LeaderTimeoutMsg

type LeaderTimeoutMsg struct{}

LeaderTimeoutMsg is emitted after the leader key timeout expires.

type LedgerModel

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

LedgerModel displays the cross-session learning ledger.

func NewLedgerModel

func NewLedgerModel(t theme.Theme, l *ledger.Ledger) *LedgerModel

NewLedgerModel creates a LedgerModel backed by the given ledger.

func (*LedgerModel) Init

func (lm *LedgerModel) Init() tea.Cmd

Init implements tea.Model.

func (*LedgerModel) LoadEntries

func (lm *LedgerModel) LoadEntries()

LoadEntries reloads the entries from the ledger.

func (*LedgerModel) SetDimensions

func (lm *LedgerModel) SetDimensions(w, h int)

SetDimensions updates the ledger model dimensions.

func (*LedgerModel) SetTheme

func (lm *LedgerModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*LedgerModel) Update

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

Update implements tea.Model.

func (*LedgerModel) View

func (lm *LedgerModel) View() string

View implements tea.Model — content only, chrome handled by PageLayout.

type MentionCompleter

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

MentionCompleter scans the working directory and provides fuzzy-filtered completions for @-mention autocomplete in the REPL textarea.

func NewMentionCompleter

func NewMentionCompleter(cwd string) *MentionCompleter

NewMentionCompleter creates a new completer rooted at the given directory.

func (*MentionCompleter) Filter

func (c *MentionCompleter) Filter(query string) []MentionEntry

Filter returns up to 8 entries whose path/name matches query (fuzzy prefix + contains). If query is empty, returns the first 8 top-level entries.

func (*MentionCompleter) Scan

func (c *MentionCompleter) Scan()

Scan (re)scans the working directory, populating entries up to maxMentionEntries.

type MentionContext

type MentionContext struct {
	Path    string
	Content string
}

MentionContext holds a resolved @-mention path and the file's content.

func ResolveMentions

func ResolveMentions(cwd, message string) []MentionContext

ResolveMentions scans message for @path tokens and reads their file contents. Returns one MentionContext per successfully read file (directories are skipped). File contents are capped at 8 000 bytes to avoid flooding the context window.

type MentionEntry

type MentionEntry struct {
	Path        string // relative path from cwd
	IsDir       bool
	DisplayName string // last path component (filename or dir name)
	Size        int64  // file size in bytes (0 for directories)
	LineCount   int    // approximate line count (0 for directories)
}

MentionEntry represents a file or directory that can be @-mentioned in the chat.

type MetricsModel

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

MetricsModel displays session analytics.

func NewMetricsModel

func NewMetricsModel(t theme.Theme) *MetricsModel

NewMetricsModel creates a MetricsModel.

func (*MetricsModel) ApplyStats

func (mm *MetricsModel) ApplyStats(s metricsStats)

ApplyStats applies loaded stats to the model (called from Update on metricsLoadedMsg).

func (*MetricsModel) Init

func (mm *MetricsModel) Init() tea.Cmd

Init implements tea.Model.

func (*MetricsModel) LoadStatsCmd

func (mm *MetricsModel) LoadStatsCmd(sessionManager *session.Manager) tea.Cmd

LoadStatsCmd returns a tea.Cmd that loads metrics asynchronously (TU-11 fix).

func (*MetricsModel) SetDimensions

func (mm *MetricsModel) SetDimensions(w, h int)

SetDimensions updates the metrics model dimensions.

func (*MetricsModel) SetTheme

func (mm *MetricsModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*MetricsModel) Update

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

Update implements tea.Model.

func (*MetricsModel) View

func (mm *MetricsModel) View() string

View implements tea.Model — content only, chrome handled by PageLayout.

type ModelSelectedMsg

type ModelSelectedMsg = tuitypes.ModelSelectedMsg

Message type re-exports

type ModelSelector

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

ModelSelector is a full-screen model/provider picker with search, scroll, and pricing.

func NewModelSelector

func NewModelSelector(ctx context.Context, registry *provider.Registry, sessionManager *session.Manager, t theme.Theme) *ModelSelector

NewModelSelector creates a ModelSelector backed by the given registry.

func (*ModelSelector) Init

func (ms *ModelSelector) Init() tea.Cmd

Init starts model fetch commands for all registered providers.

func (*ModelSelector) SetDimensions

func (ms *ModelSelector) SetDimensions(w, h int)

SetDimensions updates the model selector dimensions.

func (*ModelSelector) SetTheme

func (ms *ModelSelector) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*ModelSelector) Update

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

Update handles key events and async load messages.

func (*ModelSelector) View

func (ms *ModelSelector) View() string

View is delegated to modelselector_view.go.

type NotificationModel

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

NotificationModel shows the notification history.

func NewNotificationModel

func NewNotificationModel(t theme.Theme, w, h int) *NotificationModel

NewNotificationModel creates a NotificationModel.

func (*NotificationModel) AddNotification

func (nm *NotificationModel) AddNotification(text, ntype string)

AddNotification adds a notification to the history.

func (*NotificationModel) Init

func (nm *NotificationModel) Init() tea.Cmd

Init implements tea.Model.

func (*NotificationModel) SetDimensions

func (nm *NotificationModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*NotificationModel) SetTheme

func (nm *NotificationModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*NotificationModel) Update

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

Update implements tea.Model.

func (*NotificationModel) View

func (nm *NotificationModel) View() string

View implements tea.Model.

type OptimizedMsg

type OptimizedMsg = tuitypes.OptimizedMsg

Message type re-exports

type PermissionRequestMsg

type PermissionRequestMsg = tuitypes.PermissionRequestMsg

Message type re-exports

type PermissionResponseMsg

type PermissionResponseMsg = tuitypes.PermissionResponseMsg

Message type re-exports

type PermissionTickMsg

type PermissionTickMsg = tuitypes.PermissionTickMsg

Message type re-exports

type PhaseModelPickedMsg

type PhaseModelPickedMsg = tuitypes.PhaseModelPickedMsg

Message type re-exports

type PhaseModelPickerModel

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

PhaseModelPickerModel is the Bubble Tea model for the dual-model picker. It shows two panels side-by-side: Planning Model (left) and Coding Model (right).

func NewPhaseModelPickerModel

func NewPhaseModelPickerModel(ctx context.Context, registry *provider.Registry, t theme.Theme, w, h int) *PhaseModelPickerModel

NewPhaseModelPickerModel creates a PhaseModelPickerModel.

func (*PhaseModelPickerModel) Init

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

Init fires async model fetches for all registered providers.

func (*PhaseModelPickerModel) SetDimensions

func (m *PhaseModelPickerModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*PhaseModelPickerModel) SetTheme

func (m *PhaseModelPickerModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*PhaseModelPickerModel) Update

Update handles messages.

func (*PhaseModelPickerModel) View

func (m *PhaseModelPickerModel) View() string

View delegates to the view renderer.

type PhaseResultMsg

type PhaseResultMsg = tuitypes.PhaseResultMsg

Message type re-exports

type PlanApproveMsg

type PlanApproveMsg = tuitypes.PlanApproveMsg

Message type re-exports

type PlanModel

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

PlanModel displays the plan generated by the Plan phase and lets the user review tasks before execution begins. Supports refine and confirm modes.

func NewPlanModel

func NewPlanModel(
	tasks []types.Task,
	t theme.Theme,
	modelID, modelName, provider string,
	estCost float64,
	costEstimate string,
	w, h int,
) *PlanModel

NewPlanModel creates a PlanModel.

func (*PlanModel) SetDimensions

func (pm *PlanModel) SetDimensions(w, h int)

SetDimensions updates the plan model dimensions.

func (*PlanModel) SetPlanContent

func (pm *PlanModel) SetPlanContent(markdown string)

SetPlanContent sets the rich markdown plan content for display.

func (*PlanModel) SetPlanVersion

func (pm *PlanModel) SetPlanVersion(version int)

SetPlanVersion sets the plan version number for display.

func (*PlanModel) Update

func (pm *PlanModel) Update(msg tea.Msg) (*PlanModel, tea.Cmd)

Update handles plan screen key events.

func (*PlanModel) UpdateTasks

func (pm *PlanModel) UpdateTasks(tasks []types.Task)

UpdateTasks replaces the task list and recomputes waves.

func (*PlanModel) View

func (pm *PlanModel) View() string

View renders the plan review screen content.

type PlanReadyMsg

type PlanReadyMsg = tuitypes.PlanReadyMsg

Message type re-exports

type PlanRefineModel

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

PlanRefineModel provides a text area for the user to enter plan refinement feedback.

func NewPlanRefineModel

func NewPlanRefineModel(t theme.Theme, width int) *PlanRefineModel

NewPlanRefineModel creates a PlanRefineModel with a configured textarea.

func (*PlanRefineModel) Update

func (pm *PlanRefineModel) Update(msg tea.Msg) (*PlanRefineModel, tea.Cmd)

Update handles refine input key events.

func (*PlanRefineModel) Value

func (pm *PlanRefineModel) Value() string

Value returns the current textarea content.

func (*PlanRefineModel) View

func (pm *PlanRefineModel) View() string

View renders the refine input area.

type PlanRefineMsg

type PlanRefineMsg = tuitypes.PlanRefineMsg

Message type re-exports

type PopScreenMsg

type PopScreenMsg = tuitypes.PopScreenMsg

Message type re-exports

type ProviderEntry

type ProviderEntry = tuitypes.ProviderEntry

Message type re-exports

type ProviderModelsFetchedMsg

type ProviderModelsFetchedMsg struct {
	Models []types.ModelInfo
	Model  *types.ModelInfo
	Err    error
}

ProviderModelsFetchedMsg carries the result of an async FetchModels call.

type QuestionRequestMsg

type QuestionRequestMsg = tuitypes.QuestionRequestMsg

Message type re-exports

type QuestionResponseMsg

type QuestionResponseMsg = tuitypes.QuestionResponseMsg

Message type re-exports

type RefreshCacheMsg

type RefreshCacheMsg = tuitypes.RefreshCacheMsg

Message type re-exports

type ReplModel

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

ReplModel is the main chat interface model. It manages the conversation viewport, input textarea, streaming state, and renders the welcome screen when no messages are present.

func NewReplModel

func NewReplModel(t theme.Theme, version string) ReplModel

NewReplModel creates a new ReplModel.

func (*ReplModel) AddMessage

func (m *ReplModel) AddMessage(msg types.Message)

AddMessage adds a message to the REPL and re-renders.

func (*ReplModel) AppendStreamChunk

func (m *ReplModel) AppendStreamChunk(chunk *types.StreamChunk)

AppendStreamChunk appends a streamed token from a workflow phase to the REPL's streaming buffer.

func (*ReplModel) ClearMessages

func (m *ReplModel) ClearMessages()

ClearMessages removes all messages and resets streaming state.

func (*ReplModel) GetStatusText

func (m *ReplModel) GetStatusText() string

GetStatusText returns the current status text for the status bar.

func (*ReplModel) Init

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

Init implements tea.Model; the REPL starts with a spinner tick.

func (*ReplModel) InputValue

func (m *ReplModel) InputValue() string

InputValue returns the trimmed current textarea input.

func (*ReplModel) LastCost

func (m *ReplModel) LastCost() float64

LastCost returns the estimated cost of the last completed stream.

func (*ReplModel) LastUsage

func (m *ReplModel) LastUsage() *types.Usage

LastUsage returns the usage from the last completed stream.

func (*ReplModel) Messages

func (m *ReplModel) Messages() []types.Message

Messages returns all messages in the REPL.

func (*ReplModel) RefreshViewport

func (m *ReplModel) RefreshViewport()

func (*ReplModel) SetChangedFiles

func (m *ReplModel) SetChangedFiles(n int)

SetChangedFiles updates the count of git-changed files shown on the welcome screen.

func (*ReplModel) SetCommandRegistry

func (m *ReplModel) SetCommandRegistry(reg *CommandRegistry)

SetCommandRegistry sets the command registry.

func (*ReplModel) SetCwd

func (m *ReplModel) SetCwd(cwd string)

SetCwd sets the working directory for @filepath resolution. Changing cwd also invalidates the cached mention completer.

func (*ReplModel) SetDispatcher

func (m *ReplModel) SetDispatcher(d *tools.Dispatcher)

SetDispatcher sets the tool dispatcher.

func (*ReplModel) SetFrecentHistory

func (m *ReplModel) SetFrecentHistory(fh *history.FrecentHistory)

SetFrecentHistory sets the frecency history for prompt history navigation.

func (*ReplModel) SetKeyRegistry

func (m *ReplModel) SetKeyRegistry(kr *KeyRegistry)

SetKeyRegistry sets the key registry.

func (*ReplModel) SetLastActivity

func (m *ReplModel) SetLastActivity(t time.Time)

SetLastActivity updates the last-activity timestamp.

func (*ReplModel) SetMessages

func (m *ReplModel) SetMessages(msgs []types.Message)

SetMessages replaces all messages and re-renders the viewport.

func (*ReplModel) SetProvider

func (m *ReplModel) SetProvider(ctx context.Context, registry *provider.Registry, activeProvider string, model *types.ModelInfo, sessionID string, cfg *config.Config) tea.Cmd

SetProvider configures the active provider and returns a tea.Cmd that asynchronously validates the model by fetching the provider's model catalog.

func (*ReplModel) SetSessionID

func (m *ReplModel) SetSessionID(id string)

SetSessionID updates the session ID.

func (*ReplModel) SetSessionSparkline

func (m *ReplModel) SetSessionSparkline(spark string)

SetSessionSparkline updates the recent-activity sparkline shown on the welcome screen.

func (*ReplModel) SetSidebarWidth

func (m *ReplModel) SetSidebarWidth(sw int)

SetSidebarWidth updates the reserved width for the sidebar.

func (*ReplModel) SetStreaming

func (m *ReplModel) SetStreaming(v bool)

SetStreaming sets the streaming state.

func (*ReplModel) SetTheme

func (m *ReplModel) SetTheme(t theme.Theme)

SetTheme updates the theme and reinitializes the message renderer.

func (*ReplModel) SetThinking

func (m *ReplModel) SetThinking(v bool)

SetThinking sets the thinking state.

func (*ReplModel) ShowQuestion

func (m *ReplModel) ShowQuestion(msg QuestionRequestMsg)

ShowQuestion displays a question in the REPL.

func (*ReplModel) SpinnerTick

func (m *ReplModel) SpinnerTick() tea.Cmd

SpinnerTick returns a tea.Cmd that ticks the spinner at 10fps.

func (*ReplModel) TrackLiveTool

func (m *ReplModel) TrackLiveTool(toolName string, msgIndex int)

TrackLiveTool registers an in-progress agent loop tool card by name, mapping it to the message index so UpdateLiveTool can find it later.

func (*ReplModel) Update

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

Update processes messages for the REPL. Delegates to handleKeyMsg, handleStreamMsg, etc. based on message type.

func (*ReplModel) UpdateLiveTool

func (m *ReplModel) UpdateLiveTool(toolName string, err error, durationMs int64)

UpdateLiveTool updates an in-progress tool card with its result. It modifies the message's tool_use segment to carry result data, then re-renders the viewport.

func (*ReplModel) View

func (m *ReplModel) View() string

View renders the REPL screen (standalone mode, not used by PageLayout).

func (*ReplModel) ViewContent

func (m *ReplModel) ViewContent(contentHeight, contentWidth int) string

ViewContent renders the REPL content area for the unified PageLayout system. It returns ONLY the content: viewport + separator + textarea. Header, footer, metadata row, and status bar are handled by PageChrome.

Layout (exactly contentHeight rows):

viewport  ← contentHeight - chromeHeight rows
▁[quick actions ctrl+q]▁▁▁▁▁▁▁▁▁▁▁  ← input separator (1 row)
[textarea]                ← textarea.Height() rows

Overlays (slash, mention, quick-actions dropdown, which-key, new-messages) float on the viewport — they are composited onto its bottom rows so they do not consume extra vertical space.

type ResumeModel

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

ResumeModel shows the session browser so the user can resume a past session.

func NewResumeModel

func NewResumeModel(sessions []session.SessionInfo, t theme.Theme) *ResumeModel

NewResumeModel creates a ResumeModel.

func (*ResumeModel) Init

func (rm *ResumeModel) Init() tea.Cmd

Init implements tea.Model.

func (*ResumeModel) Refresh

func (rm *ResumeModel) Refresh(sessions []session.SessionInfo)

Refresh replaces the session list (called after re-fetching).

func (*ResumeModel) SetDimensions

func (rm *ResumeModel) SetDimensions(w, h int)

SetDimensions updates the resume model dimensions.

func (*ResumeModel) SetTheme

func (rm *ResumeModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*ResumeModel) Update

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

Update implements tea.Model.

func (*ResumeModel) View

func (rm *ResumeModel) View() string

View implements tea.Model — delegates to renderResume.

type RollbackModel

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

RollbackModel shows the git commit timeline and allows resetting to any commit.

func NewRollbackModel

func NewRollbackModel(t theme.Theme, g *git.Git, rb *rollback.Rollback, w, h int) *RollbackModel

NewRollbackModel creates a RollbackModel.

func (*RollbackModel) Init

func (rm *RollbackModel) Init() tea.Cmd

Init implements tea.Model.

func (*RollbackModel) LoadCommits

func (rm *RollbackModel) LoadCommits()

LoadCommits fetches the commit chain from the rollback package.

func (*RollbackModel) SetDimensions

func (rm *RollbackModel) SetDimensions(w, h int)

SetDimensions updates the rollback model dimensions.

func (*RollbackModel) SetTheme

func (rm *RollbackModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*RollbackModel) Update

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

Update implements tea.Model.

func (*RollbackModel) View

func (rm *RollbackModel) View() string

View implements tea.Model — content only, chrome handled by PageLayout.

type Screen

type Screen = tuitypes.Screen

Screen re-exports

type ScreenTransition

type ScreenTransition struct {
	Active     bool
	StartAt    time.Time
	Duration   time.Duration
	FromScreen Screen
	ToScreen   Screen
	// contains filtered or unexported fields
}

ScreenTransition captures a dim-and-reveal transition between screens.

func (*ScreenTransition) Progress

func (t *ScreenTransition) Progress() float64

Progress returns the transition progress as 0.0–1.0.

func (*ScreenTransition) TransitionTick

func (t *ScreenTransition) TransitionTick() bool

TransitionTick advances a running transition. Returns true when the transition is complete.

type SessionDetailModel

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

SessionDetailModel shows detailed info about a session before loading it.

func NewSessionDetailModel

func NewSessionDetailModel(t theme.Theme, w, h int) *SessionDetailModel

NewSessionDetailModel creates a SessionDetailModel.

func (*SessionDetailModel) Init

func (sd *SessionDetailModel) Init() tea.Cmd

Init implements tea.Model.

func (*SessionDetailModel) SetDimensions

func (sd *SessionDetailModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*SessionDetailModel) SetSession

func (sd *SessionDetailModel) SetSession(s *session.Session)

SetSession sets the session to display.

func (*SessionDetailModel) SetTheme

func (sd *SessionDetailModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*SessionDetailModel) Update

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

Update implements tea.Model.

func (*SessionDetailModel) View

func (sd *SessionDetailModel) View() string

View implements tea.Model.

type SessionDetailRequestMsg

type SessionDetailRequestMsg = tuitypes.SessionDetailRequestMsg

Message type re-exports

type SessionExportMsg

type SessionExportMsg = tuitypes.SessionExportMsg

Message type re-exports

type SessionRenameMsg

type SessionRenameMsg = tuitypes.SessionRenameMsg

Message type re-exports

type SettingsModel

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

SettingsModel manages the settings editor (6-tab layout).

func NewSettingsModel

func NewSettingsModel(cfg *config.Config, registry *provider.Registry, t theme.Theme, configPath string, version string, kc keychain.Keychain, ctx context.Context) *SettingsModel

NewSettingsModel creates a SettingsModel. Accepts a context that is cancelled on app shutdown to prevent resource leaks.

func (*SettingsModel) Init

func (s *SettingsModel) Init() tea.Cmd

func (*SettingsModel) SetConfig

func (s *SettingsModel) SetConfig(cfg *config.Config)

func (*SettingsModel) SetTheme

func (s *SettingsModel) SetTheme(t theme.Theme)

func (*SettingsModel) Update

func (s *SettingsModel) Update(msg tea.Msg) (*SettingsModel, tea.Cmd)

Update handles settings screen key events.

func (*SettingsModel) View

func (s *SettingsModel) View() string

View renders the settings screen content. Header, footer, and chrome are handled by the unified PageLayout.

type SettingsSavedMsg

type SettingsSavedMsg = tuitypes.SettingsSavedMsg

Message type re-exports

type SettingsTab

type SettingsTab int

SettingsTab identifies which settings tab is active.

const (
	TabProvider SettingsTab = iota
	TabModel
	TabUI
	TabKeys
	TabWorkflow
	TabAbout
)

type ShipModel

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

ShipModel displays the workflow completion summary.

func NewShipModel

func NewShipModel(summary ShipSummary, t theme.Theme, w, h int) *ShipModel

NewShipModel creates a ShipModel.

func (*ShipModel) SetDemonstration

func (sm *ShipModel) SetDemonstration(content string)

SetDemonstration sets the demonstration walkthrough content.

func (*ShipModel) Update

func (sm *ShipModel) Update(msg tea.Msg) (*ShipModel, tea.Cmd)

Update handles ship screen key events.

func (*ShipModel) View

func (sm *ShipModel) View() string

View renders the ship summary screen inside a branded ThinBorder card.

type ShipSummary

type ShipSummary struct {
	SessionID     string
	Model         string
	Provider      string
	TaskDone      int
	TaskTotal     int
	TaskFailed    int
	TaskSkipped   int
	Commits       []git.CommitInfo
	FilesAdded    int
	FilesModified int
	FilesDeleted  int
	Insertions    int
	Deletions     int
	Duration      string
	TotalTokens   int
	TotalCost     float64
}

ShipSummary carries workflow completion statistics for the Ship screen.

type SidebarFile

type SidebarFile = tuitypes.SidebarFile

Message type re-exports

type SidebarModel

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

SidebarModel manages the collapsible sidebar panel that shows git status.

func NewSidebarModel

func NewSidebarModel(g *git.Git, t theme.Theme) *SidebarModel

NewSidebarModel creates a new SidebarModel.

func (*SidebarModel) Blur

func (s *SidebarModel) Blur()

Blur removes keyboard focus from the sidebar.

func (*SidebarModel) DecreaseWidth

func (s *SidebarModel) DecreaseWidth()

DecreaseWidth shrinks the sidebar width by 2, down to the min.

func (*SidebarModel) Focus

func (s *SidebarModel) Focus()

Focus gives keyboard focus to the sidebar.

func (*SidebarModel) GetWidth

func (s *SidebarModel) GetWidth() int

GetWidth returns the sidebar display width (0 if hidden).

func (*SidebarModel) HandleKey

func (s *SidebarModel) HandleKey(msg tea.KeyMsg) tea.Cmd

HandleKey processes a key event when the sidebar is focused. Returns a command to execute (e.g., show diff) or nil.

func (*SidebarModel) HandleMouse

func (s *SidebarModel) HandleMouse(msg tea.MouseMsg, sidebarX int) tea.Cmd

HandleMouse processes mouse events for the sidebar. Returns a tea.Cmd if a file was clicked (to show diff), or nil.

func (*SidebarModel) IncreaseWidth

func (s *SidebarModel) IncreaseWidth()

IncreaseWidth grows the sidebar width by 2, up to the max.

func (*SidebarModel) IsFocused

func (s *SidebarModel) IsFocused() bool

IsFocused returns true if the sidebar has keyboard focus.

func (*SidebarModel) IsVisible

func (s *SidebarModel) IsVisible() bool

IsVisible returns true if the sidebar is shown.

func (*SidebarModel) SelectedFile

func (s *SidebarModel) SelectedFile() *git.FileStatus

SelectedFile returns the currently selected file, or nil if none.

func (*SidebarModel) SetHeight

func (s *SidebarModel) SetHeight(h int)

SetHeight sets the total available height for the sidebar so it can constrain the file list and enable scrolling.

func (*SidebarModel) SetSessionID

func (s *SidebarModel) SetSessionID(id string)

SetSessionID sets the active session ID for display.

func (*SidebarModel) SetShutdownContext

func (s *SidebarModel) SetShutdownContext(ctx context.Context)

SetShutdownContext sets the context for the periodic refresh ticker.

func (*SidebarModel) SetTheme

func (s *SidebarModel) SetTheme(t theme.Theme)

SetTheme updates the sidebar theme.

func (*SidebarModel) SetTokenUsage

func (s *SidebarModel) SetTokenUsage(totalTokens, contextLen int, cost float64, showCost bool, modelName string)

SetTokenUsage updates the token usage display in the sidebar.

func (*SidebarModel) SetVersion

func (s *SidebarModel) SetVersion(v string)

SetVersion sets the version string displayed in the header.

func (*SidebarModel) SetWidth

func (s *SidebarModel) SetWidth(w int)

SetWidth sets the sidebar width, clamped to min/max.

func (*SidebarModel) Toggle

func (s *SidebarModel) Toggle()

Toggle shows/hides the sidebar.

func (*SidebarModel) ToggleFocus

func (s *SidebarModel) ToggleFocus()

ToggleFocus toggles sidebar keyboard focus.

func (*SidebarModel) Update

func (s *SidebarModel) Update(msg tea.Msg) (*SidebarModel, tea.Cmd)

Update handles sidebar-specific messages.

func (*SidebarModel) View

func (s *SidebarModel) View() string

View renders the sidebar with file tree, git info, and token usage.

type SidebarRefreshMsg

type SidebarRefreshMsg = tuitypes.SidebarRefreshMsg

Message type re-exports

type SidebarRefreshTickMsg

type SidebarRefreshTickMsg = tuitypes.SidebarRefreshTickMsg

Message type re-exports

type SlashCommandMsg

type SlashCommandMsg = tuitypes.SlashCommandMsg

Message type re-exports

type StatusBarInfo

type StatusBarInfo struct {
	PromptTokens     int
	TotalTokens      int
	Cost             float64
	ShowCost         bool
	WhichKey         string
	LeaderActive     bool
	AgentName        string
	ModelName        string
	ProviderName     string
	IsStreaming      bool
	IsThinking       bool
	ThinkingDuration int64 // milliseconds of current thinking session
	KeyboardHints    []string
	WorkflowPhase    string
	QuestionProgress string
	CwdName          string // basename of working directory
	GitBranch        string // current git branch
	SpinnerFrame     string // animated spinner frame (empty = use static char)
	ContextUsed      int    // tokens used in context window
	ContextMax       int    // model's max context length (0 = unknown)
}

StatusBarInfo carries optional info to render in the status bar.

type StreamChunkMsg

type StreamChunkMsg = tuitypes.StreamChunkMsg

Message type re-exports

type StreamDoneMsg

type StreamDoneMsg = streaming.StreamDoneMsg

Streaming type re-exports

type StreamErrorMsg

type StreamErrorMsg = streaming.StreamErrorMsg

Streaming type re-exports

type StreamMsg

type StreamMsg = streaming.StreamMsg

Streaming type re-exports

type SubagentEventMsg

type SubagentEventMsg struct {
	Event subagent.SubagentEvent
}

SubagentEventMsg is delivered to AppState.Update whenever the subagent manager emits an event. It carries a single subagent.SubagentEvent.

type SubagentRow

type SubagentRow struct {
	Info      subagent.SubagentInfo
	LastEvent string // human-readable "Grep foo" / "Read x.go" / "done"
	Expanded  bool
	UpdatedAt time.Time
}

SubagentRow is the per-agent snapshot kept by the SubagentsModel. It mirrors subagent.SubagentInfo plus UI-only fields (expanded, lastUpdate).

type SubagentsModel

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

SubagentsModel renders the parallel-subagent panel shown between the header and the REPL (or beside the REPL in wide layouts). It maintains an ordered list of rows keyed by agent ID; rows are appended as events arrive and are never reordered so the user's mental model stays stable.

func NewSubagentsModel

func NewSubagentsModel(t theme.Theme) *SubagentsModel

NewSubagentsModel creates an empty panel.

func (*SubagentsModel) ApplyEvent

func (m *SubagentsModel) ApplyEvent(ev subagent.SubagentEvent)

ApplyEvent mutates the model in response to a subagent event. All calls are idempotent; out-of-order events simply overwrite state.

func (*SubagentsModel) IsEmpty

func (m *SubagentsModel) IsEmpty() bool

IsEmpty reports whether there are any rows.

func (*SubagentsModel) MoveCursor

func (m *SubagentsModel) MoveCursor(delta int)

MoveCursor shifts the highlighted row by delta (clamped).

func (*SubagentsModel) Selected

func (m *SubagentsModel) Selected() *SubagentRow

Selected returns the currently-highlighted row (or nil if empty).

func (*SubagentsModel) SetSize

func (m *SubagentsModel) SetSize(width, height int)

SetSize updates the panel budget. The TUI calls this on WindowSizeMsg.

func (*SubagentsModel) SetTheme

func (m *SubagentsModel) SetTheme(t theme.Theme)

SetTheme refreshes the theme.

func (*SubagentsModel) ToggleExpand

func (m *SubagentsModel) ToggleExpand()

ToggleExpand flips the expanded state of the highlighted row.

func (*SubagentsModel) View

func (m *SubagentsModel) View() string

View renders the panel.

type ThemeChangedMsg

type ThemeChangedMsg = tuitypes.ThemeChangedMsg

Message type re-exports

type ThemePickerModel

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

ThemePickerModel lets users browse and preview theme presets.

func NewThemePickerModel

func NewThemePickerModel(t theme.Theme, w, h int) *ThemePickerModel

NewThemePickerModel creates a ThemePickerModel with built-in presets.

func (*ThemePickerModel) Init

func (tp *ThemePickerModel) Init() tea.Cmd

Init implements tea.Model.

func (*ThemePickerModel) SetDimensions

func (tp *ThemePickerModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*ThemePickerModel) SetTheme

func (tp *ThemePickerModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*ThemePickerModel) Update

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

Update implements tea.Model.

func (*ThemePickerModel) View

func (tp *ThemePickerModel) View() string

View implements tea.Model.

type ThinkingBlockToggleMsg

type ThinkingBlockToggleMsg struct {
	Index int
}

ThinkingBlockToggleMsg is emitted when the user toggles a thinking block.

type TickMsg

type TickMsg = streaming.TickMsg

Streaming type re-exports

type Toast

type Toast = tuitypes.Toast

Message type re-exports

type ToastExpiryMsg

type ToastExpiryMsg = tuitypes.ToastExpiryMsg

Message type re-exports

type ToastMsg

type ToastMsg = tuitypes.ToastMsg

Message type re-exports

type ToolClickMsg

type ToolClickMsg struct {
	MessageIndex int
	ToolName     string
}

ToolClickMsg is emitted when a mouse click lands on a tool card inside the REPL viewport. MessageIndex identifies the message; ToolName is the name of the first tool_use segment in that message.

type ToolDetailModel

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

ToolDetailModel shows expanded tool output with full content and scrolling.

func NewToolDetailModel

func NewToolDetailModel(t theme.Theme, w, h int) *ToolDetailModel

NewToolDetailModel creates a ToolDetailModel.

func (*ToolDetailModel) Init

func (td *ToolDetailModel) Init() tea.Cmd

Init implements tea.Model.

func (*ToolDetailModel) SetContent

func (td *ToolDetailModel) SetContent(title, content string)

SetContent sets the tool output content.

func (*ToolDetailModel) SetDimensions

func (td *ToolDetailModel) SetDimensions(w, h int)

SetDimensions updates dimensions.

func (*ToolDetailModel) SetTheme

func (td *ToolDetailModel) SetTheme(t theme.Theme)

SetTheme updates the theme.

func (*ToolDetailModel) Update

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

Update implements tea.Model.

func (*ToolDetailModel) View

func (td *ToolDetailModel) View() string

View implements tea.Model.

type VerifyModel

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

VerifyModel displays task verification results and provides self-healing.

func NewVerifyModel

func NewVerifyModel(tasks []types.Task, results map[int]workflow.VerificationResult, t theme.Theme, w, h int) *VerifyModel

NewVerifyModel creates a VerifyModel.

func (*VerifyModel) SetHealFunc

func (vm *VerifyModel) SetHealFunc(f func(taskID int) tea.Cmd)

SetHealFunc sets the callback for self-healing a specific task.

func (*VerifyModel) SetManualSteps

func (vm *VerifyModel) SetManualSteps(steps []string)

SetManualSteps sets manual verification steps from the plan for display.

func (*VerifyModel) StartHealing

func (vm *VerifyModel) StartHealing(taskID int, attempt int)

StartHealing marks the model as healing a specific task (shows spinner).

func (*VerifyModel) StopHealing

func (vm *VerifyModel) StopHealing()

StopHealing clears the healing state.

func (*VerifyModel) TickSpinner

func (vm *VerifyModel) TickSpinner()

TickSpinner advances the spinner animation frame.

func (*VerifyModel) Update

func (vm *VerifyModel) Update(msg tea.Msg) (*VerifyModel, tea.Cmd)

Update handles verify screen key events.

func (*VerifyModel) UpdateResults

func (vm *VerifyModel) UpdateResults(results map[int]workflow.VerificationResult)

UpdateResults replaces the verification results.

func (*VerifyModel) View

func (vm *VerifyModel) View() string

View renders the verify results screen content. Header, footer, and chrome are handled by the unified PageLayout.

type WorkflowEngine

type WorkflowEngine = tuitypes.WorkflowEngine

WorkflowEngine re-exports the workflow engine interface from tuitypes.

Directories

Path Synopsis
Package streaming implements the LLM streaming pipeline for the M31A TUI.
Package streaming implements the LLM streaming pipeline for the M31A TUI.
Package tuitypes defines shared types for the M31A TUI.
Package tuitypes defines shared types for the M31A TUI.

Jump to

Keyboard shortcuts

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